sources.stream().map(it -> it.image).collect(Collectors.toList()); ImageLayout il = new ImageLayout(sourceImages.get(0)); il.setMinX(minx); il.setWidth(width); il.setHeight(height);
/** * 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); }
result = (ImageLayout) layout.clone(); if ((mask & 1) != 0) result.setMinX(minXL = minX); if ((mask & 2) != 0) result.setMinY(minYL = minY); if ((mask & 4) != 0) result.setWidth((maxXL = maxX) - minXL);
ImageLayout il = new ImageLayout(); Rectangle dstBounds = op.getBounds(); il.setMinX(dstBounds.x); il.setMinY(dstBounds.y); il.setWidth(dstBounds.width);
JAI.KEY_IMAGE_LAYOUT, new ImageLayout() .setMinX(gridBounds.x) .setMinY(gridBounds.y) .setTileWidth(tileSize.width)
localHints.remove(JAI.KEY_IMAGE_LAYOUT); ImageLayout il = new ImageLayout(); il.setMinX(dstBounds.x); il.setMinY(dstBounds.y); il.setWidth(dstBounds.width);
localHints.remove(JAI.KEY_IMAGE_LAYOUT); ImageLayout il = new ImageLayout(); il.setMinX(targetBB.x); il.setMinY(targetBB.y); il.setWidth(targetBB.width);
imageLayout.setMinX(destinationRasterDimension.x).setMinY(destinationRasterDimension.y); imageLayout .setWidth(destinationRasterDimension.width)
layout.setWidth(union.width) .setHeight(union.height) .setMinX(union.x) .setMinY(union.y); final RenderingHints localHints;
layout.setMinX(gridRange.x); layout.setMinY(gridRange.y); layout.setWidth(gridRange.width);
layout.setMinX(boundsInt.x); layout.setWidth(boundsInt.width); layout.setMinY(boundsInt.y);
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(); }
final Rectangle targetBB = targetGG.getGridRange2D(); if (isBoundsUndefined(layout, false)) { layout.setMinX(targetBB.x); layout.setMinY(targetBB.y); layout.setWidth(targetBB.width);
layout.setMinX(alphaArray[i].getMinX()); layout.setMinY(alphaArray[i].getMinY()); layout.setWidth(alphaArray[i].getWidth());
/** * 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; }
il.setMinX(minX); il.setMinY(minY); il.setWidth(width);