private void addAlphaColorModelHint(Hints localHints, int currentBandCount) { ImageLayout layout = new ImageLayout(); ColorModel alphaModel = getColorModelWithAlpha(currentBandCount); layout.setColorModel(alphaModel); localHints.put(JAI.KEY_IMAGE_LAYOUT, layout); }
originalSampleModel.getHeight()); imageLayout.setSampleModel(sampleModel); imageLayout.setColorModel(colorModel); } catch (IOException e) { throw new RuntimeException(e);
private ImageLayout getImageLayout(RenderedImage image, RenderingHints hints) { ImageLayout layout = (ImageLayout) hints.get(JAI.KEY_IMAGE_LAYOUT); if (layout == null) layout = new ImageLayout(image); layout.setColorModel(this.paletteBuilder.getIndexColorModel()); layout.setSampleModel( paletteBuilder .getIndexColorModel() .createCompatibleSampleModel(image.getWidth(), image.getHeight())); return layout; }
new ImageLayout().setColorModel(defaultCM).setSampleModel(defaultSM); } else if (LOGGER.isLoggable(Level.WARNING)) LOGGER.warning("Unable to find sample image for path " + baseURL);
public ColorInversion( RenderedImage image, IndexColorModel icm, int quantizationColors, int alpaThreshold) { super(image, new ImageLayout(image), null, false); this.setSource(image, 0); this.op = new InverseColorMapRasterOp(icm, quantizationColors, alpaThreshold); // setlayout; setImageLayout( new ImageLayout(image) .setColorModel(icm) .setSampleModel( icm.createCompatibleSampleModel( image.getWidth(), image.getHeight()))); }
layout.setColorModel(newCm); layout.setSampleModel( newCm.createCompatibleSampleModel(image.getWidth(), image.getHeight())); layout.setColorModel(newCm); layout.setSampleModel( newCm.createCompatibleSampleModel(image.getWidth(), image.getHeight()));
ImageLayout layout = new ImageLayout(rect.x, rect.y, rect.width, rect.height); layout.setSampleModel(sampleModel); layout.setColorModel(colorModel); return layout;
result.setColorModel(firstColorModel); return true;
layout.setColorModel( new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB),
layout.setColorModel(cm); final RenderingHints hints = getRenderingHints(); hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout));
sampleModel.getWidth(), sampleModel.getHeight()); ImageLayout layout = new ImageLayout(image); layout.setColorModel(destinationColorModel); layout.setSampleModel(destinationSampleModel);
Transparency.OPAQUE, oldSM.getDataType()); layout.setColorModel(cm); layout.setSampleModel( cm.createCompatibleSampleModel(oldSM.getWidth(), oldSM.getHeight()));
layout2.setColorModel(ColorUtilities.GRAY_CM); layout2.setSampleModel( ColorUtilities.GRAY_CM.createCompatibleSampleModel(
new ImageLayout().setColorModel(defaultCM).setSampleModel(defaultSM);
layout = new ImageLayout(); layout = layout.setColorModel(colors);
buildOpacityLookupTable(0, 1, -1, image.getSampleModel().getDataType()); ImageLayout layout = new ImageLayout(image); layout.setColorModel(newColorModel); RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);
imageLayout.setColorModel(src.getRenderedImage().getColorModel()); imageLayout.setSampleModel(src.getRenderedImage().getSampleModel());
imageLayout.setColorModel(src.getRenderedImage().getColorModel()); imageLayout.setSampleModel(src.getRenderedImage().getSampleModel());
layout.setColorModel(newCM); worker.setRenderingHint(JAI.KEY_IMAGE_LAYOUT, layout);
final ImageLayout layout = new ImageLayout().setColorModel(model); final RenderedImage newImage = new NullOpImage(image, layout, null, OpImage.OP_COMPUTE_BOUND);