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); }
ImageLayout layout = new ImageLayout(bi); GridEnvelope2D gridRange = new GridEnvelope2D(0, 0, 360, 180); GridToEnvelopeMapper mapper = new GridToEnvelopeMapper(gridRange, envelope);
/** * Gets the image layout from the specified rendering hints, creating a new one if needed. This * method do not modify the specified hints. If the caller modifies the image layout, it should * invoke {@code hints.put(JAI.KEY_IMAGE_LAYOUT, layout)} explicitly. */ private static ImageLayout getImageLayout(final RenderingHints hints) { final Object candidate = hints.get(JAI.KEY_IMAGE_LAYOUT); if (candidate instanceof ImageLayout) { return (ImageLayout) candidate; } return new ImageLayout(); }
/** * Adds an extra channel to the image, with a value of 255 (not public yet because it won't work * with all image types) * * @return */ private ImageWorker addAlphaChannel() { final ImageLayout tempLayout = new ImageLayout(image); tempLayout .unsetValid(ImageLayout.COLOR_MODEL_MASK) .unsetValid(ImageLayout.SAMPLE_MODEL_MASK); RenderedImage alpha = ConstantDescriptor.create( Float.valueOf(image.getWidth()), Float.valueOf(image.getHeight()), new Byte[] {Byte.valueOf((byte) 255)}, new RenderingHints(JAI.KEY_IMAGE_LAYOUT, tempLayout)); addBand(alpha, false, true, null); return this; }
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()))); }
LOGGER.finer("ImageLayout:" + new ImageLayout(src).toString()); LOGGER.finer("MapSize:" + size + " subsx=" + subsx + ",subsy=" + subsy);
layout = new ImageLayout(); layout.setTileGridXOffset(0) .setTileGridYOffset(0)
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; }
ImageLayout il = new ImageLayout(sourceImages.get(0)); il.setMinX(minx); il.setWidth(width);
new ImageLayout().setColorModel(defaultCM).setSampleModel(defaultSM); } else if (LOGGER.isLoggable(Level.WARNING)) LOGGER.warning("Unable to find sample image for path " + baseURL);
/** * Post processes a blank image response, eventually making it transparent * * @param finalImage * @return */ public RenderedImage postProcessBlankResponse(RenderedImage finalImage, RenderingHints hints) { // prepare a ROI made of only zeroes ImageLayout layout = new ImageLayout( finalImage.getMinX(), finalImage.getMinY(), finalImage.getWidth(), finalImage.getHeight()); RenderedOp roi = ConstantDescriptor.create( (float) finalImage.getWidth(), (float) finalImage.getHeight(), new Byte[] {0}, new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout)); ImageWorker iw = new ImageWorker(finalImage); iw.setROI(new ROI(roi)); return iw.getRenderedImage(); } }
return null; ImageLayout layout = initToImage ? new ImageLayout(image) : null; if ((image.getNumXTiles() == 1 || image.getTileWidth() < STRIPE_SIZE) && (image.getNumYTiles() == 1 || image.getTileHeight() < STRIPE_SIZE)) { if ((s = toTileSize(image.getWidth(), defaultSize.width)) != 0) { if (layout == null) { layout = new ImageLayout(); } else if (image.getTileWidth() <= STRIPE_SIZE) { if (layout == null) { layout = new ImageLayout(); layout = new ImageLayout(); } else if (image.getTileHeight() < STRIPE_SIZE) { if (layout == null) { layout = new ImageLayout();
int subsx, int subsy) { super(image, new ImageLayout(image), null, false); this.numColors = numColors; this.alphaThreshold = alpaThreshold; image = BandSelectDescriptor.create(image, new int[] {0, 1, 2}, null); final ImageLayout layout = new ImageLayout(); layout.setColorModel( new ComponentColorModel(
ColorModel colorModel = ImageIOUtilities.createColorModel(sampleModel); Rectangle rect = rasterElement.toRectangle(); ImageLayout layout = new ImageLayout(rect.x, rect.y, rect.width, rect.height); layout.setSampleModel(sampleModel); layout.setColorModel(colorModel);
final ImageLayout layout = new ImageLayout(); layout.setTileWidth(tileDimension.width).setTileHeight(tileDimension.height); this.hints.add(new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout));
RenderingHints localHints = null; if (tileDimensions != null && request.getReadType().equals(ReadType.DIRECT_READ)) { final ImageLayout layout = new ImageLayout(); layout.setTileHeight(tileDimensions.width).setTileWidth(tileDimensions.height); localHints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout); if (layout != null && layout instanceof ImageLayout) { final ImageLayout originalLayout = (ImageLayout) layout; final ImageLayout localLayout = new ImageLayout(); localLayout.setTileHeight(originalLayout.getTileHeight(null)); localLayout.setTileWidth(originalLayout.getTileWidth(null));
destinationColorModel.createCompatibleSampleModel( sampleModel.getWidth(), sampleModel.getHeight()); ImageLayout layout = new ImageLayout(image); layout.setColorModel(destinationColorModel); layout.setSampleModel(destinationSampleModel);
new ImageLayout( rasterLayerResponse.getRasterBounds().x, rasterLayerResponse.getRasterBounds().y,
layout = (ImageLayout) layout.clone(); } else { layout = new ImageLayout(sourceImage); layout.unsetTileLayout();
final ImageLayout imageLayout = new ImageLayout(dst.getRenderedImage());