Package javax.media.jai

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


            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

            // 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

            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

            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

/*  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

/*     */   }
/*     */
/*     */   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

/*     */       {
/*  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

/*     */       {
/*  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 */       double xorig = pb.getFloatParameter(0);
/* 109 */       double yorig = pb.getFloatParameter(1);
/* 110 */       double angle = pb.getFloatParameter(2);
/*     */
/* 113 */       AffineTransform transform = AffineTransform.getRotateInstance(angle, xorig, yorig);
/*     */
/* 117 */       ROI dstROI = srcROI.transform(transform);
/*     */
/* 120 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 123 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 124 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 128 */       return dstROI;
/*     */     }
/*     */
View Full Code Here

/*     */       {
/* 102 */         srcBounds = new Rectangle(src.getMinX(), src.getMinY(), src.getWidth(), src.getHeight());
/*     */       }
/*     */
/* 109 */       if (!srcBounds.contains(srcROI.getBounds())) {
/* 110 */         srcROI = srcROI.intersect(new ROIShape(srcBounds));
/*     */       }
/*     */
/* 114 */       Interpolation interpNN = (interp instanceof InterpolationNearest) ? interp : Interpolation.getInstance(0);
/*     */
/* 119 */       Warp warp = (Warp)pb.getObjectParameter(0);
/*     */
/* 122 */       ROI dstROI = new ROI(JAI.create("warp", srcROI.getAsImage(), warp, interpNN));
/*     */
/* 126 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 129 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 130 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 134 */       return dstROI;
/*     */     }
/*     */
View Full Code Here

TOP

Related Classes of javax.media.jai.ROIShape

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.