@Override public ImageLayout getImageLayout(String coverageName) throws IOException { if (!checkName(coverageName)) { throw new IllegalArgumentException( "The specified coverageName " + coverageName + "is not supported"); } return (ImageLayout) imageLayout.clone(); }
/** * Set the provided layout for this {@link GridCoverage2DReader}- * * @param layout the {@link ImageLayout} to set. It must be nont null */ protected void setlayout(ImageLayout layout) { Utilities.ensureNonNull("layout", layout); this.imageLayout = (ImageLayout) layout.clone(); }
Object l = localHints.get(JAI.KEY_IMAGE_LAYOUT); if ((l != null) && (l instanceof ImageLayout)) { final ImageLayout layout = (ImageLayout) ((ImageLayout) l).clone(); localHints.put(JAI.KEY_IMAGE_LAYOUT, layout);
Object l = localHints.get(JAI.KEY_IMAGE_LAYOUT); if ((l != null) && (l instanceof ImageLayout)) { final ImageLayout layout = (ImageLayout) ((ImageLayout) l).clone(); localHints.put(JAI.KEY_IMAGE_LAYOUT, layout);
if (mask != 0) { if (layout == result) { result = (ImageLayout) layout.clone();
localHints.add( new RenderingHints( JAI.KEY_IMAGE_LAYOUT, ((ImageLayout) layout).clone()));
layout = (ImageLayout) layout.clone(); } else { layout = new ImageLayout(sourceImage);
ImageLayout layout = (ImageLayout) targetHints.get(JAI.KEY_IMAGE_LAYOUT); if (layout != null) { layout = (ImageLayout) layout.clone(); } else { layout = new ImageLayout(sourceImage);
layout = (ImageLayout) layoutOld.clone();
layout = (ImageLayout) layout.clone(); } else { layout = new ImageLayout();
/** * If the user didn't specified explicitly a sample or a color model, creates default ones. * This method is actually a workaround for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). * * @param layout The user-supplied layout. * @return A layout with at least a color model. */ private static ImageLayout layout(final RenderedImage source, ImageLayout layout) { if (layout == null) { layout = new ImageLayout(); } else if ((layout.getValidMask() & (SAMPLE_MODEL_MASK | COLOR_MODEL_MASK)) == 0) { layout = (ImageLayout) layout.clone(); } else { return layout; } return layout.setSampleModel(source.getSampleModel()).setColorModel(source.getColorModel()); }
/** * If the user didn't specified explicitly a sample or a color model, creates default ones. * This method is actually a workaround for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). * * @param layout The user-supplied layout. * @return A layout with at least a color model. */ private static ImageLayout layout(final RenderedImage source, ImageLayout layout) { if (layout == null) { layout = new ImageLayout(); } else if ((layout.getValidMask() & (SAMPLE_MODEL_MASK | COLOR_MODEL_MASK)) == 0) { layout = (ImageLayout) layout.clone(); } else { return layout; } final ColorModel cm = ColorUtilities.BINARY_COLOR_MODEL; return layout.setColorModel(cm).setSampleModel(cm.createCompatibleSampleModel( layout.getWidth(source), layout.getHeight(source))); }
private static ImageLayout layoutHelper(List sources, ImageLayout il, boolean setAlpha) { ImageLayout layout = (il == null) ? new ImageLayout() : (ImageLayout) il.clone();
private static ImageLayout layoutHelper(RenderedImage source, ImageLayout il, Map config) { ImageLayout layout = (il == null) ? new ImageLayout() : (ImageLayout) il.clone(); SampleModel sm = layout.getSampleModel(source); if (!ImageUtil.isBinary(sm)) { sm = new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE, layout.getTileWidth(source), layout.getTileHeight(source), 1); layout.setSampleModel(sm); } ColorModel cm = layout.getColorModel(null); if (cm == null || !JDKWorkarounds.areCompatibleDataModels(sm, cm)) { layout.setColorModel(ImageUtil.getCompatibleColorModel(sm, config)); } return layout; }
private static ImageLayout layoutHelper(RenderedImage source, ImageLayout il, Map config) { ImageLayout layout = (il == null) ? new ImageLayout() : (ImageLayout) il.clone(); SampleModel sm = layout.getSampleModel(source); if (!ImageUtil.isBinary(sm)) { sm = new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE, layout.getTileWidth(source), layout.getTileHeight(source), 1); layout.setSampleModel(sm); } ColorModel cm = layout.getColorModel(null); if (cm == null || !JDKWorkarounds.areCompatibleDataModels(sm, cm)) { layout.setColorModel(ImageUtil.getCompatibleColorModel(sm, config)); } return layout; }
/** * 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; }
ImageLayout layout = (ImageLayout) hints.get(JAI.KEY_IMAGE_LAYOUT); if (layout != null) { layout = (ImageLayout) layout.clone(); } else { layout = new ImageLayout(sourceImage);
layout = (ImageLayout) layout.clone(); } else { layout = new ImageLayout(sourceImage);
int[] bandIndices) { ImageLayout il = layout == null ? new ImageLayout() : (ImageLayout)layout.clone();
int[] bandIndices) { ImageLayout il = layout == null ? new ImageLayout() : (ImageLayout)layout.clone();