/** * Prepare the {@link ImageLayout} for the final image by building the {@link ColorModel} from the input * * @param image the image to classify. * @param layout a proposed layout. * @param lic the pieces we are asked to use. * @return a layout suitable for the image that we'll create after this */ private static <T extends ColorMapTransformElement> ImageLayout prepareLayout( RenderedImage image, ImageLayout layout, ColorMapTransform<T> lic) { // // // // Get the final color model from the pieces and from that one // create the sample model // // /// final ColorModel finalColorModel = lic.getColorModel(); // create a good sample model for the output raster final SampleModel finalSampleModel = lic .getSampleModel(image.getWidth(), image.getHeight()); if (layout == null) layout = new ImageLayout(); layout.setColorModel(finalColorModel); layout.setSampleModel(finalSampleModel); return layout; } }
/** * Prepare the {@link ImageLayout} for the final image by building the {@link ColorModel} from the input * * @param image the image to classify. * @param layout a proposed layout. * @param lic the pieces we are asked to use. * @return a layout suitable for the image that we'll create after this */ private static <T extends ColorMapTransformElement> ImageLayout prepareLayout( RenderedImage image, ImageLayout layout, ColorMapTransform<T> lic) { // // // // Get the final color model from the pieces and from that one // create the sample model // // /// final ColorModel finalColorModel = lic.getColorModel(); // create a good sample model for the output raster final SampleModel finalSampleModel = lic .getSampleModel(image.getWidth(), image.getHeight()); if (layout == null) layout = new ImageLayout(); layout.setColorModel(finalColorModel); layout.setSampleModel(finalSampleModel); return layout; } }