Examples of ROIShape


Examples of javax.media.jai.ROIShape

            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 scale factors
      float sx = 1.0F/pb.getIntParameter(1);
      float sy = 1.0F/pb.getIntParameter(2);

      // Create an equivalent transform.
      AffineTransform transform =
    new AffineTransform(sx, 0.0, 0.0, sy, 0, 0);

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

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

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

      // Return the warped and possibly clipped ROI.
      return dstROI;
  } else {
View Full Code Here

Examples of javax.media.jai.ROIShape

            src.getHeight());
            }

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

            // Set the nearest neighbor interpolation object.
            Interpolation interpNN = interp instanceof InterpolationNearest ?
                interp :
                Interpolation.getInstance(Interpolation.INTERP_NEAREST);

            // Retrieve the Warp object.
            Warp warp = (Warp)pb.getObjectParameter(0);

            // Create the warped ROI.
            ROI dstROI = new ROI(JAI.create("warp", srcROI.getAsImage(),
                                            warp, interpNN));

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

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

            // Return the warped and possibly clipped ROI.
            return dstROI;
        }
View Full Code Here

Examples of javax.media.jai.ROIShape

                srcBounds = src.getBounds();
            }

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

            // Retrieve the scale factors and translation values.
            double sx = pb.getDoubleParameter(0);
            double sy = pb.getDoubleParameter(1);

            // Create an equivalent transform.
            AffineTransform transform =
                new AffineTransform(sx, 0.0, 0.0, sy, 0, 0);

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

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

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

            // Return the warped and possibly clipped ROI.
            return dstROI;
        } else {
View Full Code Here

Examples of javax.media.jai.ROIShape

            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 values.
            float tx = pb.getFloatParameter(0);
            float ty = pb.getFloatParameter(1);

            // Create a transform representing the translation.
            AffineTransform transform =
                AffineTransform.getTranslateInstance((double) tx,
                                                     (double) ty);
            // Create the translated ROI.
            ROI dstROI = srcROI.transform(transform);

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

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

            // Return the warped and possibly clipped ROI.
            return dstROI;
        }
View Full Code Here

Examples of javax.media.jai.ROIShape

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

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

            // Return the sheared and possibly clipped ROI.
            return dstROI;
        }
View Full Code Here

Examples of javax.media.jai.ROIShape

            root = new Node(this);
        }

        void constructTree() {
            if (roi == null)
                roi = new ROIShape(source.getBounds());

            // Cycle throw all source tiles.
            int minTileX = source.getMinTileX();
            int maxTileX = source.getMaxTileX();
            int minTileY = source.getMinTileY();
View Full Code Here

Examples of javax.media.jai.ROIShape

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

            // Return the transformed and possibly clipped ROI.
            return dstROI;
        }
View Full Code Here

Examples of javax.media.jai.ROIShape

/*  86 */     out.writeBoolean(aoi != null);
/*  87 */     if (aoi != null) {
/*  88 */       if ((aoi instanceof Serializable))
/*  89 */         out.writeObject(aoi);
/*     */       else {
/*  91 */         out.writeObject(new ROIShape(aoi));
/*     */       }
/*     */     }
/*     */
/*  95 */     out.writeObject(rhp);
/*     */   }
View Full Code Here

Examples of javax.media.jai.ROIShape

/*     */   }
/*     */
/*     */   protected synchronized void train() {
/*  94 */     PlanarImage source = getSourceImage(0);
/*  95 */     if (this.roi == null) {
/*  96 */       this.roi = new ROIShape(source.getBounds());
/*     */     }
/*     */
/*  99 */     int minTileX = source.getMinTileX();
/* 100 */     int maxTileX = source.getMaxTileX();
/* 101 */     int minTileY = source.getMinTileY();
View Full Code Here

Examples of javax.media.jai.ROIShape

/*     */       {
/*  96 */         srcBounds = new Rectangle(src.getMinX(), src.getMinY(), src.getWidth(), src.getHeight());
/*     */       }
/*     */
/* 103 */       if (!srcBounds.contains(srcROI.getBounds())) {
/* 104 */         srcROI = srcROI.intersect(new ROIShape(srcBounds));
/*     */       }
/*     */
/* 108 */       AffineTransform transform = (AffineTransform)pb.getObjectParameter(0);
/*     */
/* 112 */       ROI dstROI = srcROI.transform(transform);
/*     */
/* 115 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 119 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 120 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 124 */       return dstROI;
/*     */     }
/*     */
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.