il.setMinX(minx); il.setWidth(width); il.setHeight(height); il.setMinY(miny); il.setTileWidth(sourceImages.get(0).getWidth());
/** * This method is used for setting the final image layout. * * @param parameters * @param layout * @param bbox */ private void updateLayout( final BandMergeParams parameters, ImageLayout layout, Envelope2D bbox) { // Creation of a GridGeoemtry with the selected BBOX and the defined World2Grid // transformation GridGeometry2D gg2D = new GridGeometry2D(PixelInCell.CELL_CORNER, parameters.gridToCRS, bbox, null); // Selection of the GridEnvelope from the GridGeometry for using it as the new Layout GridEnvelope2D gridRange2D = gg2D.getGridRange2D(); layout.setMinX(gridRange2D.x); layout.setMinY(gridRange2D.y); layout.setWidth(gridRange2D.width); layout.setHeight(gridRange2D.height); }
if ((mask & 2) != 0) result.setMinY(minYL = minY); if ((mask & 4) != 0) result.setWidth((maxXL = maxX) - minXL); if ((mask & 8) != 0) result.setHeight((maxYL = maxY) - minYL);
il.setMinY(dstBounds.y); il.setWidth(dstBounds.width); il.setHeight(dstBounds.height); il.setTileWidth(op.getTileWidth()); il.setTileWidth(op.getTileHeight());
/** * 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); }
il.setMinY(dstBounds.y); il.setWidth(dstBounds.width); il.setHeight(dstBounds.height); il.setTileWidth(op.getTileWidth()); il.setTileHeight(op.getTileHeight());
il.setMinY(targetBB.y); il.setWidth(targetBB.width); il.setHeight(targetBB.height);
il.setWidth(rasterBounds.width).setHeight(rasterBounds.height); if (rasterBounds.x != 0 || rasterBounds.y != 0) { il.setMinX(rasterBounds.x).setMinY(rasterBounds.y);
imageLayout .setWidth(destinationRasterDimension.width) .setHeight(destinationRasterDimension.height);
: new ImageLayout2()); layout.setWidth(union.width) .setHeight(union.height) .setMinX(union.x) .setMinY(union.y);
layout.setMinY(gridRange.y); layout.setWidth(gridRange.width); layout.setHeight(gridRange.height);
layout.setWidth(boundsInt.width); layout.setMinY(boundsInt.y); layout.setHeight(boundsInt.height); operatioName = "Mosaic";
private RenderedImage crop(RenderedImage source, Rectangle cropArea) { ImageLayout layout = new ImageLayout(); layout.setMinX(cropArea.x); layout.setMinY(cropArea.y); layout.setWidth(cropArea.width); layout.setHeight(cropArea.height); return CropDescriptor.create(source, (float) cropArea.getX(), (float) cropArea.getY(), (float) cropArea.getWidth(), (float) cropArea.getHeight(), new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout)).getRendering(); }
layout.setMinY(targetBB.y); layout.setWidth(targetBB.width); layout.setHeight(targetBB.height);
layout.setMinY(alphaArray[i].getMinY()); layout.setWidth(alphaArray[i].getWidth()); layout.setHeight(alphaArray[i].getHeight()); w1.setRenderingHint(JAI.KEY_IMAGE_LAYOUT, layout); w1.translate(0f, 0f, null);
/** * Sets up the image layout information for this Operation. The minX, minY, width, and height are calculated based on the source's dimension and * padding values. Any of these values specified in the layout parameter is ignored. All other variables are taken from the layout parameter or * inherited from the source. */ private static ImageLayout layoutHelper(ImageLayout layout, RenderedImage source, int leftPad, int rightPad, int topPad, int bottomPad) { ImageLayout il = layout == null ? new ImageLayout() : (ImageLayout) layout.clone(); // Set the image bounds according to the padding. il.setMinX(source.getMinX() - leftPad); il.setMinY(source.getMinY() - topPad); il.setWidth(source.getWidth() + leftPad + rightPad); il.setHeight(source.getHeight() + topPad + bottomPad); // Set tile grid offset to minimize the probability that a // tile's bounds does not intersect the source image bounds. if (!il.isValid(ImageLayout.TILE_GRID_X_OFFSET_MASK)) { il.setTileGridXOffset(il.getMinX(null)); } if (!il.isValid(ImageLayout.TILE_GRID_Y_OFFSET_MASK)) { il.setTileGridYOffset(il.getMinY(null)); } // Force inheritance of source image SampleModel and ColorModel. il.setSampleModel(source.getSampleModel()); il.setColorModel(source.getColorModel()); return il; }
@Override public ImageLayout getImageLayout(final String coverageName) throws IOException { if (!checkName(coverageName)) { LOGGER.warn("Unable to find data adapter for '" + coverageName + "'"); return null; } final RasterDataAdapter adapter = (RasterDataAdapter) geowaveAdapterStore.getAdapter(getAdapterId(coverageName)); final GridEnvelope gridEnvelope = getOriginalGridRange(); return new ImageLayout().setMinX(gridEnvelope.getLow(0)).setMinY( gridEnvelope.getLow(1)).setTileWidth(adapter.getTileSize()).setTileHeight( adapter.getTileSize()).setSampleModel(adapter.getSampleModel()).setColorModel( adapter.getColorModel()).setWidth(gridEnvelope.getHigh(0)).setHeight( gridEnvelope.getHigh(1)); }
/** * Builds an {@code ImageLayout} for this image. The {@code width} and * {@code height} arguments are requested tile dimensions which will * only be used if they are smaller than this operator's default * tile dimension. * * @param minX origin X ordinate * @param minY origin Y ordinate * @param width requested tile width * @param height requested tile height * @param sm sample model * * @return the {@code ImageLayout} object */ static ImageLayout buildLayout(int minX, int minY, int width, int height, SampleModel sm) { // build a sample model for the single tile ImageLayout il = new ImageLayout(); il.setMinX(minX); il.setMinY(minY); il.setWidth(width); il.setHeight(height); il.setSampleModel(sm); if (!il.isValid(ImageLayout.TILE_GRID_X_OFFSET_MASK)) { il.setTileGridXOffset(il.getMinX(null)); } if (!il.isValid(ImageLayout.TILE_GRID_Y_OFFSET_MASK)) { il.setTileGridYOffset(il.getMinY(null)); } return il; }
/** * Builds an {@code ImageLayout} for this image. The {@code width} and {@code height} arguments are requested tile dimensions which will only be * used if they are smaller than this operator's default tile dimension. * * @param minX origin X ordinate * @param minY origin Y ordinate * @param width requested tile width * @param height requested tile height * @param sm sample model * * @return the {@code ImageLayout} object */ static ImageLayout buildLayout(int minX, int minY, int width, int height, SampleModel sm) { // build a sample model for the single tile ImageLayout il = new ImageLayout(); il.setMinX(minX); il.setMinY(minY); il.setWidth(width); il.setHeight(height); il.setTileWidth(sm.getWidth()); il.setTileHeight(sm.getHeight()); il.setSampleModel(sm); if (!il.isValid(ImageLayout.TILE_GRID_X_OFFSET_MASK)) { il.setTileGridXOffset(il.getMinX(null)); } if (!il.isValid(ImageLayout.TILE_GRID_Y_OFFSET_MASK)) { il.setTileGridYOffset(il.getMinY(null)); } return il; }
/** * Builds an {@code ImageLayout} for this image. The {@code width} and {@code height} arguments are requested tile dimensions which will only be * used if they are smaller than this operator's default tile dimension. * * @param minX origin X ordinate * @param minY origin Y ordinate * @param width requested tile width * @param height requested tile height * @param sm sample model * * @return the {@code ImageLayout} object */ static ImageLayout buildLayout(int minX, int minY, int width, int height, SampleModel sm) { // build a sample model for the single tile ImageLayout il = new ImageLayout(); il.setMinX(minX); il.setMinY(minY); il.setWidth(width); il.setHeight(height); il.setTileWidth(sm.getWidth()); il.setTileHeight(sm.getHeight()); il.setSampleModel(sm); if (!il.isValid(ImageLayout.TILE_GRID_X_OFFSET_MASK)) { il.setTileGridXOffset(il.getMinX(null)); } if (!il.isValid(ImageLayout.TILE_GRID_Y_OFFSET_MASK)) { il.setTileGridYOffset(il.getMinY(null)); } return il; }