Package com.lightcrafts.mediax.jai

Examples of com.lightcrafts.mediax.jai.RenderedOp


                              Object opNode) {
        validate(name, opNode);

        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(1);

            // 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 AffineTransform object.
            AffineTransform transform =
                (AffineTransform)pb.getObjectParameter(0);

            // Create the transformed ROI.
            ROI dstROI = srcROI.transform((AffineTransform)transform);

            // Retrieve the destination bounds.
            Rectangle dstBounds = op.getBounds();

            // If necessary, clip the transformed ROI to the
            // destination bounds.
            if (!dstBounds.contains(dstROI.getBounds())) {
                dstROI = dstROI.intersect(new ROIShape(dstBounds));
View Full Code Here


    /// XXX This should not happen, since by the time a
    // RMIServerProxy is created, all its sources should already
    // have been rendered. In any case, the following deals
    // correctly with the situation if it should arise.

    RenderedOp rop = (RenderedOp)source;
    RenderedImage rendering = rop.getRendering();
    if (!(rendering instanceof Serializable))
        rendering = new SerializableRenderedImage(rendering);

    try {
        remoteImage.setRenderedSource(id, rendering, i);
View Full Code Here

                              Object opNode) {
        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

                              Object opNode) {
        validate(name, opNode);

        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);

            // Create the rotated/translated ROI.
            ROI dstROI = srcROI.transform(transform);

            // Retrieve the destination bounds.
            Rectangle dstBounds = op.getBounds();

            // If necessary, clip the rotated ROI to the destination bounds.
            if(!dstBounds.contains(dstROI.getBounds())) {
                dstROI = dstROI.intersect(new ROIShape(dstBounds));
            }
View Full Code Here

                              Object opNode) {
        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

  // Check whether any of the parameters are Strings which represent
  // images either on this server or another server.
  JAIRMIUtil.checkServerParameters(pb, nodes);

  RenderedOp node = new RenderedOp(opName, pb, rh);

  // Remove all sinks so that no events are sent automatically
  // to the sinks
  node.removeSinks();

  nodes.put(id, node);
    }
View Full Code Here

     * Calls for Rendering of the Op and returns true if the RenderedOp
     * could be rendered else false
     */
    public boolean getRendering(Long id) throws RemoteException {

  RenderedOp op = getNode(id);
  if (op.getRendering() == null) {
      return false;
  } else {
      return true;
  }
    }
View Full Code Here

  PlanarImage pi = PlanarImage.wrapRenderedImage(source);

  Object obj = nodes.get(id);

  if (obj instanceof RenderedOp) {
      RenderedOp op = (RenderedOp)obj;
      op.setSource(pi, index);
      ((PlanarImage)op.getSourceObject(index)).removeSinks();
  } else if (obj instanceof RenderableOp) {
      ((RenderableOp)obj).setSource(pi, index);
  }
    }
View Full Code Here

                 int index)
  throws RemoteException {

  Object obj = nodes.get(id);
  if (obj instanceof RenderedOp) {
      RenderedOp op = (RenderedOp)obj;
      op.setSource(source.getRendering(), index);
      ((PlanarImage)op.getSourceObject(index)).removeSinks();
  } else if (obj instanceof RenderableOp) {
      ((RenderableOp)obj).setSource(source.getRendering(), index);
  }
    }
View Full Code Here

                 int index)
  throws RemoteException {

  Object obj = nodes.get(id);
  if (obj instanceof RenderedOp) {
      RenderedOp op = (RenderedOp)obj;
      op.setSource(nodes.get(sourceId), index);
      ((PlanarImage)nodes.get(sourceId)).removeSinks();
  } else if (obj instanceof RenderableOp) {
      ((RenderableOp)obj).setSource(nodes.get(sourceId), index);
  }
    }
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.RenderedOp

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.