Package javax.media.jai

Examples of javax.media.jai.ROIShape


/*      */
/*      */         }
/*      */
/* 1128 */         at.preConcatenate(renderContext.getTransform());
/*      */
/* 1131 */         ROIShape roi = new ROIShape(at.createTransformedShape(rgn));
/*      */
/* 1134 */         TiledImage ti = new TiledImage(rendering.getMinX(), rendering.getMinY(), rendering.getWidth(), rendering.getHeight(), rendering.getTileGridXOffset(), rendering.getTileGridYOffset(), rendering.getSampleModel(), rendering.getColorModel());
/*      */
/* 1144 */         ti.set(rendering, roi);
/*      */
/* 1147 */         pb = new ParameterBlock();
/* 1148 */         pb.add(ti.getWidth());
/* 1149 */         pb.add(ti.getHeight());
/* 1150 */         Byte[] bandValues = new Byte[ti.getSampleModel().getNumBands()];
/*      */
/* 1152 */         for (int b = 0; b < bandValues.length; b++) {
/* 1153 */           bandValues[b] = new Byte(-1);
/*      */         }
/* 1155 */         pb.add(bandValues);
/*      */
/* 1157 */         ImageLayout il = new ImageLayout();
/* 1158 */         il.setSampleModel(ti.getSampleModel());
/* 1159 */         RenderingHints rh = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, il);
/*      */
/* 1162 */         PlanarImage constImage = JAI.create("constant", pb, rh);
/*      */
/* 1165 */         ROI complementROI = new ROIShape(ti.getBounds()).subtract(roi);
/*      */
/* 1169 */         int maxTileY = ti.getMaxTileY();
/* 1170 */         int maxTileX = ti.getMaxTileX();
/* 1171 */         for (int j = ti.getMinTileY(); j <= maxTileY; j++) {
/* 1172 */           for (int i = ti.getMinTileX(); i <= maxTileX; i++) {
/* 1173 */             if (!roi.intersects(ti.getTileRect(i, j))) {
/* 1174 */               ti.setData(constImage.getTile(i, j), complementROI);
/*      */             }
/*      */
/*      */           }
/*      */
View Full Code Here


/*     */       {
/* 153 */         srcBounds = src.getBounds();
/*     */       }
/*     */
/* 157 */       if (!srcBounds.contains(srcROI.getBounds())) {
/* 158 */         srcROI = srcROI.intersect(new ROIShape(srcBounds));
/*     */       }
/*     */
/* 162 */       double sx = pb.getDoubleParameter(0);
/* 163 */       double sy = pb.getDoubleParameter(1);
/*     */
/* 166 */       AffineTransform transform = new AffineTransform(sx, 0.0D, 0.0D, sy, 0.0D, 0.0D);
/*     */
/* 170 */       ROI dstROI = srcROI.transform(transform);
/*     */
/* 173 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 176 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 177 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 181 */       return dstROI;
/*     */     }
/* 183 */     return null;
View Full Code Here

/* 124 */       ROI dstROI = srcROI.transform(transform);
/*     */
/* 127 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 130 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 131 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 135 */       return dstROI;
/*     */     }
/*     */
View Full Code Here

/*    */       {
/* 80 */         dstBounds = dst.getBounds();
/*    */       }
/*    */
/* 85 */       if (!dstBounds.contains(roi.getBounds())) {
/* 86 */         roi = roi.intersect(new ROIShape(dstBounds));
/*    */       }
/*    */
/* 89 */       return roi;
/*    */     }
/*    */
View Full Code Here

/*    */       {
/* 80 */         dstBounds = dst.getBounds();
/*    */       }
/*    */
/* 85 */       if (!dstBounds.contains(roi.getBounds())) {
/* 86 */         roi = roi.intersect(new ROIShape(dstBounds));
/*    */       }
/*    */
/* 89 */       return roi;
/*    */     }
/*    */
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 */       float sx = pb.getFloatParameter(0);
/* 109 */       float sy = pb.getFloatParameter(1);
/* 110 */       float tx = pb.getFloatParameter(2);
/* 111 */       float ty = pb.getFloatParameter(3);
/*     */
/* 114 */       AffineTransform transform = new AffineTransform(sx, 0.0D, 0.0D, sy, tx, ty);
/*     */
/* 118 */       ROI dstROI = srcROI.transform(transform);
/*     */
/* 121 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 124 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 125 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 129 */       return dstROI;
/*     */     }
/*     */
View Full Code Here

/*     */       {
/* 106 */         srcBounds = new Rectangle(src.getMinX(), src.getMinY(), src.getWidth(), src.getHeight());
/*     */       }
/*     */
/* 113 */       if (!srcBounds.contains(srcROI.getBounds())) {
/* 114 */         srcROI = srcROI.intersect(new ROIShape(srcBounds));
/*     */       }
/*     */
/* 118 */       float sx = 1.0F / pb.getIntParameter(1);
/* 119 */       float sy = 1.0F / pb.getIntParameter(2);
/*     */
/* 122 */       AffineTransform transform = new AffineTransform(sx, 0.0D, 0.0D, sy, 0.0D, 0.0D);
/*     */
/* 126 */       ROI dstROI = srcROI.transform(transform);
/*     */
/* 129 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 132 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 133 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 137 */       return dstROI;
/*     */     }
/* 139 */     return null;
View Full Code Here

/* 167 */       this.root = new Node(this);
/*     */     }
/*     */
/*     */     void constructTree() {
/* 171 */       if (OctTreeOpImage.this.roi == null) {
/* 172 */         OctTreeOpImage.this.roi = new ROIShape(this.source.getBounds());
/*     */       }
/*     */
/* 175 */       int minTileX = this.source.getMinTileX();
/* 176 */       int maxTileX = this.source.getMaxTileX();
/* 177 */       int minTileY = this.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 */       float tx = pb.getFloatParameter(0);
/* 109 */       float ty = pb.getFloatParameter(1);
/*     */
/* 112 */       AffineTransform transform = AffineTransform.getTranslateInstance(tx, ty);
/*     */
/* 116 */       ROI dstROI = srcROI.transform(transform);
/*     */
/* 119 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 122 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 123 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 127 */       return dstROI;
/*     */     }
/*     */
View Full Code Here

/*  79 */       ROI srcROI = (ROI)property;
/*     */
/*  82 */       Rectangle srcBounds = new Rectangle(src.getMinX(), src.getMinY(), src.getWidth(), src.getHeight());
/*     */
/*  88 */       if (!srcBounds.contains(srcROI.getBounds())) {
/*  89 */         srcROI = srcROI.intersect(new ROIShape(srcBounds));
/*     */       }
/*     */
/*  93 */       float sx = pb.getFloatParameter(0);
/*  94 */       float sy = pb.getFloatParameter(1);
/*     */
/*  97 */       AffineTransform transform = new AffineTransform(sx, 0.0D, 0.0D, sy, 0.0D, 0.0D);
/*     */
/* 101 */       ROI dstROI = srcROI.transform(transform);
/*     */
/* 104 */       Rectangle dstBounds = op.getBounds();
/*     */
/* 107 */       if (!dstBounds.contains(dstROI.getBounds())) {
/* 108 */         dstROI = dstROI.intersect(new ROIShape(dstBounds));
/*     */       }
/*     */
/* 112 */       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.