mbedward / jaitools

Raster image processing for Java developers
17 stars 15 forks source link

New Generate operation to create single or multi-band images with systematic or random data #218

Open mbedward opened 11 years ago

mbedward commented 11 years ago

This started out as work on a "Random" operation to generate images with random values via objects that implement a RandomGenerator interface. However, I now realize that the same scheme can be used to generate systematic data (e.g. gradients and other patterns). JAI ImageFunction can be used to do this for float and double images but it would be nice to have something more flexible, easier to use and capable of supporting all image data types.

The idea is to have a simple Generator interface something like:

public interface Generator {
    ImageDataType getType();
    Number getValue(int imageX, int imageY);
}

Passing the image coordinates to the getValue method allows, for instance, spatially auto-correlated random values to be generated easily.

The operation will take three args:

where the generators arg can be either a single Generator object or an array of objects (one for each band of the result image).