/** * Creates a new TiledImage object with a single band of constant value. * The data type of the image corresponds to the class of {@code value}. * * @param width image width in pixels * * @param height image height in pixels * * @param value the constant value to fill the image * * @return a new TiledImage object */ public static TiledImage createConstantImage(int width, int height, Number value) { return createConstantImage(width, height, new Number[] {value}); }
/** * Creates a new TiledImage object with one or more bands of constant value. * The number of bands in the output image corresponds to the length of * the input values array and the data type of the image corresponds to the * {@code Number} class used. * * @param width image width in pixels * * @param height image height in pixels * * @param values array of values (must contain at least one element) * * @return a new TiledImage object */ public static TiledImage createConstantImage(int width, int height, Number[] values) { return createConstantImage(0, 0, width, height, values); }
/** * Creates a new TiledImage object with a single band of constant value. * The data type of the image corresponds to the class of {@code value}. * * @param minx minimum image X ordinate * * @param miny minimum image Y ordinate * * @param width image width in pixels * * @param height image height in pixels * * @param value the constant value to fill the image * * @return a new TiledImage object */ public static TiledImage createConstantImage(int minx, int miny, int width, int height, Number value) { return createConstantImage(minx, miny, width, height, new Number[] {value}); }
/** * Creates a new TiledImage object with one or more bands of constant value. * The number of bands in the output image corresponds to the length of * the input values array and the data type of the image corresponds to the * {@code Number} class used. * * @param minx minimum image X ordinate * * @param miny minimum image Y ordinate * * @param width image width in pixels * * @param height image height in pixels * * @param values array of values (must contain at least one element) * * @return a new TiledImage object */ public static TiledImage createConstantImage(int minx, int miny, int width, int height, Number[] values) { Dimension tileSize = JAI.getDefaultTileSize(); return createConstantImage(minx, miny, width, height, tileSize.width, tileSize.height, values); } /**
TiledImage img = createConstantImage(width, height, val);
lookupImg = createConstantImage(dataImg.getWidth(), dataImg.getHeight(), Integer.valueOf(0));