/** * Takes two rendered or renderable source images, and myltiply form each pixel the related * value of the second image, each one from each source image of the corresponding position and * band. See JAI {@link MultiplyDescriptor} for details. * * @param renderedImage the {@link RenderedImage} to be multiplied to this {@link ImageWorker}. * @return this {@link ImageWorker}. * @see MultiplyDescriptor */ public final ImageWorker multiply(RenderedImage renderedImage) { ParameterBlock pb = new ParameterBlock(); pb.setSource(image, 0); pb.setSource(renderedImage, 1); if (JAIExt.isJAIExtOperation(ALGEBRIC_OP_NAME)) { prepareAlgebricOperation(Operator.MULTIPLY, pb, roi, nodata, true); image = JAI.create(ALGEBRIC_OP_NAME, pb, getRenderingHints()); } else { image = JAI.create("Multiply", pb, getRenderingHints()); } invalidateStatistics(); return this; }
/** * Takes two rendered or renderable source images, and subtract form each pixel the related * value of the second image, each one from each source image of the corresponding position and * band. See JAI {@link AddDescriptor} for details. * * @param renderedImage the {@link RenderedImage} to be subtracted to this {@link ImageWorker}. * @return this {@link ImageWorker}. * @see SubtractDescriptor */ public final ImageWorker subtract(final RenderedImage renderedImage) { ParameterBlock pb = new ParameterBlock(); pb.setSource(image, 0); pb.setSource(renderedImage, 1); if (JAIExt.isJAIExtOperation(ALGEBRIC_OP_NAME)) { prepareAlgebricOperation(Operator.SUBTRACT, pb, roi, nodata, true); image = JAI.create(ALGEBRIC_OP_NAME, pb, getRenderingHints()); } else { image = JAI.create("Subtract", pb, getRenderingHints()); } invalidateStatistics(); return this; }
/** * Takes two rendered or renderable source images, and do an OR for each pixel images, each one * from each source image of the corresponding position and band. See JAI {@link AddDescriptor} * for details. * * @param renderedImage the {@link RenderedImage} to be subtracted to this {@link ImageWorker}. * @return this {@link ImageWorker}. * @see SubtractDescriptor */ public final ImageWorker or(final RenderedImage renderedImage) { ParameterBlock pb = new ParameterBlock(); pb.setSource(image, 0); pb.setSource(renderedImage, 1); if (JAIExt.isJAIExtOperation(ALGEBRIC_OP_NAME)) { prepareAlgebricOperation(Operator.OR, pb, roi, nodata, true); image = JAI.create(ALGEBRIC_OP_NAME, pb, getRenderingHints()); } else { image = JAI.create("Or", pb, getRenderingHints()); } invalidateStatistics(); return this; }
/** * Takes two rendered or renderable source images, and adds every pair of pixels, one from each * source image of the corresponding position and band. See JAI {@link AddDescriptor} for * details. * * @param renderedImage the {@link RenderedImage} to be added to this {@link ImageWorker}. * @return this {@link ImageWorker}. * @see AddDescriptor */ public final ImageWorker addImage(final RenderedImage renderedImage) { ParameterBlock pb = new ParameterBlock(); pb.setSource(image, 0); pb.setSource(renderedImage, 1); if (JAIExt.isJAIExtOperation(ALGEBRIC_OP_NAME)) { prepareAlgebricOperation(Operator.SUM, pb, roi, nodata, true); image = JAI.create(ALGEBRIC_OP_NAME, pb, getRenderingHints()); } else { image = JAI.create("Add", pb, getRenderingHints()); } // image = AddDescriptor.create(image, renderedImage, getRenderingHints()); invalidateStatistics(); return this; }
pb.setSource(mask, 1); if (JAIExt.isJAIExtOperation(ALGEBRIC_OP_NAME)) { prepareAlgebricOperation(Operator.SUM, pb, roi, nodata, true); image = JAI.create(ALGEBRIC_OP_NAME, pb, getRenderingHints()); } else { pb.setSource(mask, 0); if (algebricJAIExt) { prepareAlgebricOperation(Operator.NOT, pb, roi, null, false); mask = JAI.create(ALGEBRIC_OP_NAME, pb, renderingHints); } else { pb.setSource(image, 1); if (algebricJAIExt) { prepareAlgebricOperation(Operator.AND, pb, roi, nodata, true); image = JAI.create(ALGEBRIC_OP_NAME, pb, getRenderingHints()); } else { pb.setSource(image, 1); if (algebricJAIExt) { prepareAlgebricOperation(Operator.SUM, pb, roi, nodata, true); image = JAI.create(ALGEBRIC_OP_NAME, pb, getRenderingHints()); } else {