/** * Create a new instance of JiffleOpImage in the rendered layer. * * @param paramBlock specifies the source image and the parameters WRITE ME */ public RenderedImage create(ParameterBlock paramBlock, RenderingHints renderHints) { String script = (String) paramBlock.getObjectParameter(JiffleDescriptor.SCRIPT_ARG); String destVarName = (String) paramBlock.getObjectParameter(JiffleDescriptor.DEST_NAME_ARG); Rectangle destBounds = (Rectangle) paramBlock.getObjectParameter(JiffleDescriptor.DEST_BOUNDS_ARG); int dataType = paramBlock.getIntParameter(JiffleDescriptor.DEST_TYPE_ARG); // Build an image layout based on the destination bounds, if provided, or the union of the // source bounds ImageLayout layout = (ImageLayout) renderHints.get(JAI.KEY_IMAGE_LAYOUT); if (destBounds != null) { layout = buildLayout(destBounds, getPreferredTileSize(paramBlock), dataType); } else if (layout == null) { destBounds = getSourceBounds(paramBlock); layout = buildLayout(destBounds, getPreferredTileSize(paramBlock), dataType); } Map<String, JiffleOpImage.ImageSpecification> sourceImages = buildSourceImageMap(paramBlock); return new JiffleOpImage(sourceImages, layout, renderHints, script, destVarName); }
/** * Create a new instance of JiffleOpImage in the rendered layer. * * @param paramBlock specifies the source image and the parameters WRITE ME */ public RenderedImage create(ParameterBlock paramBlock, RenderingHints renderHints) { String script = (String) paramBlock.getObjectParameter(JiffleDescriptor.SCRIPT_ARG); String destVarName = (String) paramBlock.getObjectParameter(JiffleDescriptor.DEST_NAME_ARG); Rectangle destBounds = (Rectangle) paramBlock.getObjectParameter(JiffleDescriptor.DEST_BOUNDS_ARG); int dataType = paramBlock.getIntParameter(JiffleDescriptor.DEST_TYPE_ARG); // Build an image layout based on the destination bounds, if provided, or the union of the // source bounds ImageLayout layout = (ImageLayout) renderHints.get(JAI.KEY_IMAGE_LAYOUT); if (destBounds != null) { layout = buildLayout(destBounds, getPreferredTileSize(paramBlock), dataType); } else if (layout == null) { destBounds = getSourceBounds(paramBlock); layout = buildLayout(destBounds, getPreferredTileSize(paramBlock), dataType); } Map<String, JiffleOpImage.ImageSpecification> sourceImages = buildSourceImageMap(paramBlock); return new JiffleOpImage(sourceImages, layout, renderHints, script, destVarName); }