private static RasterFormatTag getRasterFormatTag(SampleModel sampleModel1) { int compatibleTag = RasterAccessor.findCompatibleTag(null, sampleModel1); return new RasterFormatTag(sampleModel1, compatibleTag); }
/** * Where the mask image is set the original values in the source image are preserved. * Otherwise the values are replaced by the no-data value. * * @param sourceImage The source image. * @param maskImage The mask image. This mask prevents pixel values from being overwritten by fill value (where mask != 0). * @param fillValue The value to replace the original ones. */ public FillConstantOpImage(RenderedImage sourceImage, RenderedImage maskImage, Number fillValue) { super(sourceImage, maskImage, createImageLayout(sourceImage, fillValue), null, true); this.fillValue = fillValue; int compatibleTagId = RasterAccessor.findCompatibleTag(null, maskImage.getSampleModel()); maskFormatTag = new RasterFormatTag(maskImage.getSampleModel(), compatibleTagId); srcDestFormatTags = RasterAccessor.findCompatibleTags(new RenderedImage[]{sourceImage}, this); }
int sTagID = RasterAccessor.findCompatibleTag(null, srcSampleModel); int dTagID = RasterAccessor.findCompatibleTag(null, dstSampleModel);
private WarpSourceCoordinatesOpImage(Warp warp, ImageLayout layout, Map configuration) { super(layout, configuration, layout.getSampleModel(null), layout.getMinX(null), layout.getMinY(null), layout.getWidth(null), layout.getHeight(null)); this.warp = warp; int compatibleTag = RasterAccessor.findCompatibleTag(null, layout.getSampleModel(null)); rasterFormatTag = new RasterFormatTag(layout.getSampleModel(null), compatibleTag); OperatorContext.setTileCache(this); }
int sTagID = RasterAccessor.findCompatibleTag(null, srcSampleModel); int dTagID = RasterAccessor.findCompatibleTag(null, dstSampleModel);
private WarpSourceCoordinatesOpImage(Warp warp, ImageLayout layout, Map configuration) { super(layout, configuration, layout.getSampleModel(null), layout.getMinX(null), layout.getMinY(null), layout.getWidth(null), layout.getHeight(null)); this.warp = warp; int compatibleTag = RasterAccessor.findCompatibleTag(null, layout.getSampleModel(null)); rasterFormatTag = new RasterFormatTag(layout.getSampleModel(null), compatibleTag); OperatorContext.setTileCache(this); }
private void computeRect(final Raster sources, final WritableRaster destinationRaster, final Rectangle destRect) { // Clear the background and return if no sources. if (sources == null) { ImageUtil.fillBackground(destinationRaster, destRect, backgroundValues); return; } // Determine the format tag id. final SampleModel[] sourceSM = new SampleModel[] { sources.getSampleModel() }; final int formatTagID = RasterAccessor.findCompatibleTag(sourceSM, destinationRaster.getSampleModel()); // Create dest accessor. final RasterAccessor rasterAccessor = new RasterAccessor(destinationRaster, destRect, new RasterFormatTag(destinationRaster.getSampleModel(), formatTagID), null); final int dataType = rasterAccessor.getDataType(); // Branch to data type-specific method. switch (dataType) { case DataBuffer.TYPE_BYTE: computeRect(rasterAccessor); break; default: throw new UnsupportedOperationException("The following datatype isn't actually supported " + dataType); } rasterAccessor.copyDataToRaster(); }
final int formatTagID = RasterAccessor.findCompatibleTag(sourceSM, destinationRaster.getSampleModel());
int tagID = RasterAccessor.findCompatibleTag(sampleModels, dest.getSampleModel());
if (alphaRaster != null) { SampleModel alphaSampleModel = alphaRaster.getSampleModel(); int alphaFormatTagID = RasterAccessor.findCompatibleTag(null, alphaSampleModel); RasterFormatTag alphaFormatTag = new RasterFormatTag(alphaSampleModel, alphaFormatTagID);