Package javax.media.jai.iterator

Examples of javax.media.jai.iterator.RectIter


       * may be important. But it seems to still lower than query tiles
       * many time (which may involve more computation than necessary).
       */
      bounds.x = ix - left;
      bounds.y = iy - top;
      final RectIter iter = RectIterFactory.create(image.getExtendedData(bounds, this.borderExtender), bounds);
      for (; band<bandUp; band++) {
          iter.startLines();
          int j=0; do {
              iter.startPixels();
              final int[] row=samples[j++];
              int i=0; do {
                  row[i++] = iter.getSample(band);
              }
              while (!iter.nextPixelDone());
              assert i==row.length;
          }
          while (!iter.nextLineDone());
          assert j == samples.length;
          final int xfrac = (int) ((x-x0) * (1 << interpolation.getSubsampleBitsH()));
          final int yfrac = (int) ((y-y0) * (1 << interpolation.getSubsampleBitsV()));
          dest[band] = interpolation.interpolate(samples, xfrac, yfrac);
      }
View Full Code Here


            final RenderedImage raster = gc2d.getRenderedImage();
            final int numBands = raster.getSampleModel().getNumBands();
            final int dataType = raster.getSampleModel().getDataType();
            final double[] valuesD = new double[numBands];
            final int[] valuesI = new int[numBands];
            RectIter iterator = RectIterFactory.create(raster, PlanarImage
                    .wrapRenderedImage(raster).getBounds());

            iterator.startLines();
            while (!iterator.finishedLines()) {
                iterator.startPixels();
                while (!iterator.finishedPixels()) {
                    switch (dataType) {
                    case DataBuffer.TYPE_BYTE:
                    case DataBuffer.TYPE_INT:
                    case DataBuffer.TYPE_SHORT:
                    case DataBuffer.TYPE_USHORT:
                        iterator.getPixel(valuesI);
                        for (int i = 0; i < numBands; i++) {
                            // spit out
                            chars(String.valueOf(valuesI[i]));
                            if (i + 1 < numBands) {
                                chars(",");
                            }
                        }
                        break;
                    case DataBuffer.TYPE_DOUBLE:
                    case DataBuffer.TYPE_FLOAT:
                        iterator.getPixel(valuesD);
                        for (int i = 0; i < numBands; i++) {
                            // spit out
                            chars(String.valueOf(valuesD[i]));
                            if (i + 1 < numBands) {
                                chars(",");
                            }
                        }
                        break;
                    default:
                        break;
                    }
                    // space as sample separator
                    chars(" ");
                    iterator.nextPixel();
                }
                iterator.nextLine();
                chars("\n");
            }

            end("tupleList");
            end("gml:DataBlock");
View Full Code Here

TOP

Related Classes of javax.media.jai.iterator.RectIter

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.