originalSampleModel.getWidth(), originalSampleModel.getHeight()); imageLayout.setSampleModel(sampleModel); imageLayout.setColorModel(colorModel); } catch (IOException 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.setSampleModel( newCm.createCompatibleSampleModel(image.getWidth(), image.getHeight())); } else { layout.setSampleModel( newCm.createCompatibleSampleModel(image.getWidth(), image.getHeight()));
Rectangle rect = rasterElement.toRectangle(); ImageLayout layout = new ImageLayout(rect.x, rect.y, rect.width, rect.height); layout.setSampleModel(sampleModel); layout.setColorModel(colorModel); return layout;
result.setSampleModel(firstSampleModel);
ImageLayout layout = new ImageLayout(image); layout.setColorModel(destinationColorModel); layout.setSampleModel(destinationSampleModel);
.setTileWidth(tileSize.width) .setTileHeight(tileSize.height) .setSampleModel(sampleModel) .setColorModel(colorModel)); image =
oldSM.getDataType()); layout.setColorModel(cm); layout.setSampleModel( cm.createCompatibleSampleModel(oldSM.getWidth(), oldSM.getHeight())); hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout));
/** * Extract the ImageLayout from the provided reader for the first available image. * * @param reader an istance of {@link ImageReader} * @throws IOException in case an error occurs */ protected void setLayout(ImageReader reader) throws IOException { Utilities.ensureNonNull("reader", reader); // save ImageLayout ImageLayout2 layout = new ImageLayout2(); ImageTypeSpecifier its = reader.getImageTypes(0).next(); layout.setColorModel(its.getColorModel()).setSampleModel(its.getSampleModel()); layout.setMinX(0).setMinY(0).setWidth(reader.getWidth(0)).setHeight(reader.getHeight(0)); layout.setTileGridXOffset(0) .setTileGridYOffset(0) .setTileWidth(reader.getTileWidth(0)) .setTileHeight(reader.getTileHeight(0)); setlayout(layout); }
layout2.setSampleModel( ColorUtilities.GRAY_CM.createCompatibleSampleModel( inputRI.getTileWidth(), inputRI.getTileHeight()));
image.getWidth(), image.getHeight()); layout.setColorModel(destinationColorModel); layout.setSampleModel(destinationSampleModel);
new ImageLayout().setColorModel(defaultCM).setSampleModel(defaultSM);
imageLayout.setSampleModel(IHS.getSampleModel()); final RenderingHints rendHints = new RenderingHints(Collections.EMPTY_MAP); rendHints.add(hints); final ImageLayout imageLayout = new ImageLayout(); imageLayout.setColorModel(cm); imageLayout.setSampleModel( cm.createCompatibleSampleModel( intensityWorker.getRenderedImage().getWidth(),
imageLayout.setSampleModel(src.getRenderedImage().getSampleModel());
imageLayout.setSampleModel(src.getRenderedImage().getSampleModel());
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()))); }
private static ImageLayout createImageLayout(RenderedImage sourceImage, Number fillValue) { int targetDataType = Math.max(sourceImage.getSampleModel().getDataType(), DataBufferUtils.getDataBufferType(fillValue)); SingleBandedSampleModel sampleModel = new SingleBandedSampleModel(targetDataType, sourceImage.getTileWidth(), sourceImage.getTileHeight()); return new ImageLayout(sourceImage).setSampleModel(sampleModel); }
private static PlanarImage createByteFormatOp(RenderedImage src) { ColorModel cm = ImageUtils.create8BitGreyscaleColorModel(); SampleModel sm = cm.createCompatibleSampleModel(src.getTileWidth(), src.getTileHeight()); ImageLayout layout = new ImageLayout(src); layout.setColorModel(cm); layout.setSampleModel(sm); return FormatDescriptor.create(src, DataBuffer.TYPE_BYTE, createDefaultRenderingHints(src, layout)); }