Package java.awt.image.renderable

Examples of java.awt.image.renderable.ParameterBlock


        // Construct a separable kernel.
        KernelJAI kernel = new KernelJAI(width, height, xOrigin, yOrigin,
                                         dataH, dataV);

        // Construct the parameters for the "Convolve" RIF.
        ParameterBlock args = new ParameterBlock(paramBlock.getSources());
        args.add(kernel);

        // Return the result of the "Convolve" RIF.
        return super.create(args, renderHints);
    }
View Full Code Here


        validate(name, opNode);

        if (name.equalsIgnoreCase("complex")) {
            if(opNode instanceof RenderedOp) {
                RenderedOp op = (RenderedOp)opNode;
                ParameterBlock pb = op.getParameterBlock();
                DFTDataNature dataNature =
                    (DFTDataNature)pb.getObjectParameter(1);
                return dataNature.equals(DFTDescriptor.COMPLEX_TO_REAL) ?
                    Boolean.FALSE : Boolean.TRUE;
            } else if(opNode instanceof RenderableOp) {
                RenderableOp op = (RenderableOp)opNode;
                ParameterBlock pb = op.getParameterBlock();
                DFTDataNature dataNature =
                    (DFTDataNature)pb.getObjectParameter(1);
                return dataNature.equals(DFTDescriptor.COMPLEX_TO_REAL) ?
                    Boolean.FALSE : Boolean.TRUE;
            }
        }
View Full Code Here

        if(opNode instanceof RenderedOp &&
           name.equalsIgnoreCase("roi")) {
            RenderedOp op = (RenderedOp)opNode;

            ParameterBlock pb = op.getParameterBlock();

            // Retrieve the rendered source image and its ROI.
            RenderedImage src = pb.getRenderedSource(0);
            Object property = src.getProperty("ROI");
            if (property == null ||
                property.equals(java.awt.Image.UndefinedProperty) ||
                !(property instanceof ROI)) {
                return java.awt.Image.UndefinedProperty;
            }
            ROI srcROI = (ROI)property;

            // Retrieve the Interpolation object.
            Interpolation interp = (Interpolation)pb.getObjectParameter(3);

            // Determine the effective source bounds.
            Rectangle srcBounds = null;
            PlanarImage dst = op.getRendering();
            if (dst instanceof GeometricOpImage &&
                ((GeometricOpImage)dst).getBorderExtender() == null) {
                srcBounds =
                    new Rectangle(src.getMinX() + interp.getLeftPadding(),
                                  src.getMinY() + interp.getTopPadding(),
                                  src.getWidth() - interp.getWidth() + 1,
                                  src.getHeight() - interp.getHeight() + 1);
            } else {
                srcBounds = new Rectangle(src.getMinX(),
            src.getMinY(),
            src.getWidth(),
            src.getHeight());
            }

            // If necessary, clip the ROI to the effective source bounds.
            if(!srcBounds.contains(srcROI.getBounds())) {
                srcROI = srcROI.intersect(new ROIShape(srcBounds));
            }

            // Retrieve the translation and rotation angle.
      double xorig = (double)pb.getFloatParameter(0);
      double yorig = (double)pb.getFloatParameter(1);
            double angle = (double)pb.getFloatParameter(2);

            // Create an transform representing the rotation.
            AffineTransform transform =
        AffineTransform.getRotateInstance(angle, xorig, yorig);
View Full Code Here

  if (interp == null) {
      throw new IllegalArgumentException(JaiI18N.getString("ROI6"));
  }

        ParameterBlock paramBlock = new ParameterBlock();
        paramBlock.add(at);
        paramBlock.add(interp);
        return performImageOp("Affine", paramBlock, 0, null);
    }
View Full Code Here

        if RIF == null || paramBlock == null ) {
            throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
        }

        // Clone the ParameterBlock and insert a source
        ParameterBlock pb = (ParameterBlock) paramBlock.clone();
        Vector sources = pb.getSources();
        sources.insertElementAt(this.getAsImage(), sourceIndex);

        // Create a new RenderedImage based on the RIF
        // and ParameterBlock.
        RenderedImage im = RIF.create(pb, renderHints);
View Full Code Here

        if ( name == null || paramBlock == null ) {
            throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
        }

        // Clone the ParameterBlock and insert a source
        ParameterBlock pb = (ParameterBlock) paramBlock.clone();
        Vector sources = pb.getSources();
        sources.insertElementAt(this.getAsImage(), sourceIndex);

        // Create a new RenderedImage based on the operation name
        // and ParameterBlock using the default registry.
        RenderedImage im = JAI.create(name, pb, renderHints);
View Full Code Here

                                RenderingHints hints) {
        /* Get ImageLayout and TileCache from RenderingHints. */
        ImageLayout layout = RIFUtil.getImageLayoutHint(hints);
       

        if (!MediaLibAccessor.isMediaLibCompatible(new ParameterBlock())) {
            return null;
        }

        return new DCTOpImage(args.getRenderedSource(0),
                              hints, layout,
View Full Code Here

     */
    private static ParameterBlock foolSourceValidation(ParameterBlock args) {
        if(args.getNumSources() > 1) {
            Vector singleSource = new Vector();
            singleSource.add(args.getSource(0));
           args = new ParameterBlock(singleSource, args.getParameters());
        }
        return args;
    }
View Full Code Here

        validate(name, opNode);

        if (name.equalsIgnoreCase("complex")) {
            if(opNode instanceof RenderedOp) {
                RenderedOp op = (RenderedOp)opNode;
                ParameterBlock pb = op.getParameterBlock();
                DFTDataNature dataNature =
                    (DFTDataNature)pb.getObjectParameter(1);
                return dataNature.equals(IDFTDescriptor.COMPLEX_TO_REAL) ?
                    Boolean.FALSE : Boolean.TRUE;
            } else if(opNode instanceof RenderableOp) {
                RenderableOp op = (RenderableOp)opNode;
                ParameterBlock pb = op.getParameterBlock();
                DFTDataNature dataNature =
                    (DFTDataNature)pb.getObjectParameter(1);
                return dataNature.equals(IDFTDescriptor.COMPLEX_TO_REAL) ?
                    Boolean.FALSE : Boolean.TRUE;
            }
        }
View Full Code Here

    public Object getProperty(String serverName,
            String operationName,
            ParameterBlock paramBlock,
            String name) throws RemoteImagingException {

  ParameterBlock pb = null;
  if(paramBlock == null){
      pb = new ParameterBlock();
  } else {
      pb = (ParameterBlock)paramBlock.clone();
  }

  // Create a RemoteRenderableOp that represents the operation.
View Full Code Here

TOP

Related Classes of java.awt.image.renderable.ParameterBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.