Examples of ParameterBlock


Examples of java.awt.image.renderable.ParameterBlock

    oldValue = event.getOldValue();
    newValue = event.getNewValue();

      } else if (propName.equals("parameterblock")) {

    ParameterBlock oldPB = (ParameterBlock)event.getOldValue();
    Vector oldSrcs = oldPB.getSources();
    oldPB.removeSources();

    ParameterBlock newPB = (ParameterBlock)event.getNewValue();
    Vector newSrcs = newPB.getSources();
    newPB.removeSources();

    // XXX Check serverName is correct thing to pass
    JAIRMIUtil.checkClientParameters(oldPB, serverName);
    JAIRMIUtil.checkClientParameters(newPB, serverName);

    oldPB.setSources(JAIRMIUtil.replaceSourcesWithId(oldSrcs,
                 serverName));
    newPB.setSources(JAIRMIUtil.replaceSourcesWithId(newSrcs,
                 serverName));

    oldValue = oldPB;
    newValue = newPB;
View Full Code Here

Examples of java.awt.image.renderable.ParameterBlock

  if (preferencesSet)
      super.setNegotiationPreferences(negPref);

  // Create a RenderableOp on the server for this operation.

  ParameterBlock newPB = (ParameterBlock)paramBlock.clone();
  newPB.removeSources();

  // XXX Since checking to see whether any of the parameters are images
  // causes problems with the "renderable" operator (the RenderedOp
  // downsampler chain needs to be sent to the server as a RenderedOp,
  // and checkClientParameters would make it a RenderedImage), we do
View Full Code Here

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

Examples of java.awt.image.renderable.ParameterBlock

        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

Examples of java.awt.image.renderable.ParameterBlock

        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

Examples of java.awt.image.renderable.ParameterBlock

  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

Examples of java.awt.image.renderable.ParameterBlock

        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

Examples of java.awt.image.renderable.ParameterBlock

        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

Examples of java.awt.image.renderable.ParameterBlock

                                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

Examples of java.awt.image.renderable.ParameterBlock

     */
    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
TOP
Copyright © 2018 www.massapi.com. 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.