public static RenderedOp create(RenderedImage source0, FillType type, RenderingHints hints) { ParameterBlockJAI pb = new ParameterBlockJAI("TransparencyFill", RenderedRegistryMode.MODE_NAME); pb.setSource("source0", source0); pb.setParameter("type", type); return JAI.create("TransparencyFill", pb, hints); } }
Errors.format(ErrorKeys.INCOMPATIBLE_GRID_GEOMETRY)); block.setSource(source.getRenderedImage(), i);
GridCoverage2D cov = sources[i]; block.setSource(cov.getRenderedImage(), i);
pb.setSource("source0", raster);
pb.setSource("source0", raster);
protected PlanarImage scaleUnit(PlanarImage image) { final RenderingHints hints = new RenderingHints(JAI.KEY_BORDER_EXTENDER, BorderExtender.createInstance(BorderExtender.BORDER_ZERO)); final ParameterBlockJAI pb = new ParameterBlockJAI("DivideByConst", RenderedRegistryMode.MODE_NAME); pb.setSource("source0", image); pb.setParameter("constants", new double[] { scaleArea }); return JAI.create("DivideByConst", pb, hints); }
/** * Get the bands of a multi-band image as a list of single-band images. This can * be used, for example, to separate the result image returned by the KernelStats * operator into separate result images. * * @param img the multi-band image * @return a List of new single-band images */ public static List<RenderedImage> getBandsAsImages(RenderedImage img) { List<RenderedImage> images = new ArrayList<>(); if (img != null) { int numBands = img.getSampleModel().getNumBands(); for (int band = 0; band < numBands; band++) { ParameterBlockJAI pb = new ParameterBlockJAI("BandSelect"); pb.setSource("source0", img); pb.setParameter("bandindices", new int[]{band}); RenderedImage bandImg = JAI.create("BandSelect", pb); images.add(bandImg); } } return images; }
/** * Reformats an image. * * <p> * Creates a <code>ParameterBlockJAI</code> from all supplied arguments except <code>hints</code> and invokes * {@link JAI#createRenderable(String,ParameterBlock,RenderingHints)}. * * @see JAI * @see ParameterBlockJAI * @see RenderableOp * * @param source0 <code>RenderableImage</code> source 0. * @param dataType The output data type (from java.awt.image.DataBuffer). May be <code>null</code>. * @param hints The <code>RenderingHints</code> to use. May be <code>null</code>. * @return The <code>RenderableOp</code> destination. * @throws IllegalArgumentException if <code>source0</code> is <code>null</code>. */ public static RenderableOp createRenderable(RenderableImage source0, Integer dataType, RenderingHints hints) { ParameterBlockJAI pb = new ParameterBlockJAI("Format", RenderableRegistryMode.MODE_NAME); pb.setSource("source0", source0); pb.setParameter("dataType", dataType); return JAI.createRenderable("Format", pb, hints); } }
/** * Get the bands of a multi-band image as a list of single-band images. This can * be used, for example, to separate the result image returned by the KernelStats * operator into separate result images. * * @param img the multi-band image * @return a List of new single-band images */ public static List<RenderedImage> getBandsAsImages(RenderedImage img) { List<RenderedImage> images = CollectionFactory.list(); if (img != null) { int numBands = img.getSampleModel().getNumBands(); for (int band = 0; band < numBands; band++) { ParameterBlockJAI pb = new ParameterBlockJAI("BandSelect"); pb.setSource("source0", img); pb.setParameter("bandindices", new int[]{band}); RenderedImage bandImg = JAI.create("BandSelect", pb); images.add(bandImg); } } return images; }
/** * Get the bands of a multi-band image as a list of single-band images. This can * be used, for example, to separate the result image returned by the KernelStats * operator into separate result images. * * @param img the multi-band image * @return a List of new single-band images */ public static List<RenderedImage> getBandsAsImages(RenderedImage img) { List<RenderedImage> images = CollectionFactory.list(); if (img != null) { int numBands = img.getSampleModel().getNumBands(); for (int band = 0; band < numBands; band++) { ParameterBlockJAI pb = new ParameterBlockJAI("BandSelect"); pb.setSource("source0", img); pb.setParameter("bandindices", new int[]{band}); RenderedImage bandImg = JAI.create("BandSelect", pb); images.add(bandImg); } } return images; }
public RenderedOp create(RenderedImage source0, ColorMapTransform domain1D, Integer bandIndex, ROI roi, Range nodata, RenderingHints hints) { ParameterBlockJAI pb = new ParameterBlockJAI(RasterClassifierOpImage.OPERATION_NAME, RenderedRegistryMode.MODE_NAME); // Setting source pb.setSource(source0, 0); // Setting parameters pb.setParameter("Domain1D", domain1D); pb.setParameter("bandIndex", bandIndex); pb.setParameter("roi", roi); pb.setParameter("nodata", nodata); return JAI.create(RasterClassifierOpImage.OPERATION_NAME, pb, hints); } }
/** * Creates a new {@link RenderedOp} with the RLookup operation applied. * * @param table input {@link RangeLookupTable} * @param defaultValue Value to set for pixels outside ROI or outside of the Table Range * @param roi Input {@link ROI} to use in computation * @param hints Configuration hints */ public static RenderedOp create(RenderedImage source, RangeLookupTable table, Number defaultValue, ROI roi, RenderingHints hints) { // Definition of the ParameterBlock ParameterBlockJAI pb = new ParameterBlockJAI("RLookup"); // Setting the source pb.setSource(source, 0); // Setting the parameters pb.setParameter("table", table); pb.setParameter("default", defaultValue); pb.setParameter("roi", roi); // Calling the operation return JAI.create("RLookup", pb, hints); }
/** * Creates a new {@link RenderedOp} with the RLookup operation applied. * * @param table input {@link RangeLookupTable} * @param defaultValue Value to set for pixels outside ROI or outside of the Table Range * @param roi Input {@link ROI} to use in computation * @param hints Configuration hints */ public static RenderedOp create(RenderedImage source, RangeLookupTable table, Number defaultValue, ROI roi, RenderingHints hints) { // Definition of the ParameterBlock ParameterBlockJAI pb = new ParameterBlockJAI("RLookup"); // Setting the source pb.setSource(source, 0); // Setting the parameters pb.setParameter("table", table); pb.setParameter("default", defaultValue); pb.setParameter("roi", roi); // Calling the operation return JAI.create("RLookup", pb, hints); }
public RenderedOp create(RenderedImage source0, ColorMapTransform domain1D, Integer bandIndex, ROI roi, Range nodata, RenderingHints hints) { ParameterBlockJAI pb = new ParameterBlockJAI(RasterClassifierOpImage.OPERATION_NAME, RenderedRegistryMode.MODE_NAME); // Setting source pb.setSource(source0, 0); // Setting parameters pb.setParameter("Domain1D", domain1D); pb.setParameter("bandIndex", bandIndex); pb.setParameter("roi", roi); pb.setParameter("nodata", nodata); return JAI.create(RasterClassifierOpImage.OPERATION_NAME, pb, hints); } }
/** * Resizes an image. * * <p> * Creates a <code>ParameterBlockJAI</code> from all supplied arguments except <code>hints</code> and invokes * {@link JAI#create(String,ParameterBlock,RenderingHints)}. * * @see JAI * @see ParameterBlockJAI * @see RenderedOp * * @param source0 <code>RenderedImage</code> source 0. * @param hints The <code>RenderingHints</code> to use. May be <code>null</code>. * @return The <code>RenderedOp</code> destination. * @throws IllegalArgumentException if <code>source0</code> is <code>null</code>. */ public static RenderedOp create(RenderedImage source0, RenderingHints hints) { ParameterBlockJAI pb = new ParameterBlockJAI("Scale", RenderedRegistryMode.MODE_NAME); // Setting of the source pb.setSource("source0", source0); // Execution of the operation. return JAI.create("Scale", pb, hints); } }
/** * Static create method returning a new image passed by the GenericPiecewise operation * * @param source0 input image to process * @param domain1D input piecewise transformation * @param bandIndex index defining on which band calculation must be done * @param roi {@link ROI} object used for reducing computation area * @param nodata NoData {@link Range} defining NoData values * @param hints Configuration Hints * @return */ public RenderedOp create(RenderedImage source0, PiecewiseTransform1D domain1D, Integer bandIndex, ROI roi, Range nodata, RenderingHints hints) { ParameterBlockJAI pb = new ParameterBlockJAI(GenericPiecewiseOpImage.OPERATION_NAME, RenderedRegistryMode.MODE_NAME); // Setting source pb.setSource(source0, 0); // Setting parameters pb.setParameter("Domain1D", domain1D); pb.setParameter("bandIndex", bandIndex); pb.setParameter("roi", roi); pb.setParameter("nodata", nodata); return JAI.create(GenericPiecewiseOpImage.OPERATION_NAME, pb, hints); }
/** * Convenience method which constructs a {@link ParameterBlockJAI} and * invokes {@code JAI.create("ArtifactsFilter", params) } * * @param sourceImage the image to be restored * * @param roi a {@link ROI} defining the working area * * @param hints an optional RenderingHints object * * @return a RenderedImage with a band for each requested statistic */ public static RenderedImage create( RenderedImage sourceImage, ROI sourceRoi, double[] backgroundValues, final int threshold, final int filterSize, RenderingHints hints ) { ParameterBlockJAI pb = new ParameterBlockJAI("ArtifactsFilter", RenderedRegistryMode.MODE_NAME); pb.setSource(srcImageNames[0], sourceImage); pb.setParameter(paramNames[ROI_ARG], sourceRoi); pb.setParameter(paramNames[BACKGROUND_ARG], backgroundValues); pb.setParameter(paramNames[THRESHOLD_ARG], threshold); pb.setParameter(paramNames[FILTERSIZE_ARG], filterSize); return JAI.create("ArtifactsFilter", pb, hints); }
/** * Static create method returning a new image passed by the GenericPiecewise operation * * @param source0 input image to process * @param domain1D input piecewise transformation * @param bandIndex index defining on which band calculation must be done * @param roi {@link ROI} object used for reducing computation area * @param nodata NoData {@link Range} defining NoData values * @param hints Configuration Hints * @return */ public RenderedOp create(RenderedImage source0, PiecewiseTransform1D domain1D, Integer bandIndex, ROI roi, Range nodata, RenderingHints hints) { ParameterBlockJAI pb = new ParameterBlockJAI(GenericPiecewiseOpImage.OPERATION_NAME, RenderedRegistryMode.MODE_NAME); // Setting source pb.setSource(source0, 0); // Setting parameters pb.setParameter("Domain1D", domain1D); pb.setParameter("bandIndex", bandIndex); pb.setParameter("roi", roi); pb.setParameter("nodata", nodata); return JAI.create(GenericPiecewiseOpImage.OPERATION_NAME, pb, hints); }
private RenderedOp doOp(RenderedImage srcImg, RangeLookupTable table, ROI roi, Double defaultValue) { ParameterBlockJAI pb = new ParameterBlockJAI("RLookup"); pb.setSource("source0", srcImg); pb.setParameter("table", table); pb.setParameter("roi", roi); pb.setParameter("default", defaultValue); return JAI.create("RLookup", pb); }