Package java.awt.image

Examples of java.awt.image.ImageConsumer


/* 73 */     int[] pixels = new int[scansize];
/*    */
/* 75 */     Rectangle rect = new Rectangle(minX, minY, width, 1);
/*    */
/* 77 */     for (int i = 0; i < numConsumers; i++) {
/* 78 */       ImageConsumer ic = (ImageConsumer)this.consumers.elementAt(i);
/* 79 */       ic.setHints(22);
/*    */     }
/*    */
/* 84 */     for (int y = minY; y < minY + height; y++) {
/* 85 */       rect.y = y;
/* 86 */       Raster row = this.im.getData(rect);
/* 87 */       row.getPixels(minX, y, width, 1, pixels);
/*    */
/* 89 */       for (int i = 0; i < numConsumers; i++) {
/* 90 */         ImageConsumer ic = (ImageConsumer)this.consumers.elementAt(i);
/* 91 */         ic.setPixels(0, y - minY, width, 1, colorModel, pixels, 0, scansize);
/*    */       }
/*    */
/*    */     }
/*    */
/* 96 */     for (int i = 0; i < numConsumers; i++) {
/* 97 */       ImageConsumer ic = (ImageConsumer)this.consumers.elementAt(i);
/* 98 */       ic.imageComplete(3);
/*    */     }
/*    */   }
View Full Code Here


            return;
        }

        src.lockDecoder(this);

        ImageConsumer ic = null;

        for (Iterator<ImageConsumer> i = consumers.iterator(); i.hasNext();) {
            try {
                ic = i.next();
            } catch (ConcurrentModificationException e) {
                i = consumers.iterator();
                continue;
            }
            ic.imageComplete(status);
        }
    }
View Full Code Here

        // Initialize the consumers.
        Iterator it = consumers.iterator();
        while (it.hasNext())
          {
            ImageConsumer target = (ImageConsumer) it.next();
            target.setHints(ImageConsumer.COMPLETESCANLINES
                            | ImageConsumer.SINGLEFRAME
                            | ImageConsumer.SINGLEPASS
                            | ImageConsumer.TOPDOWNLEFTRIGHT);
            target.setDimensions(width, height);
          }

        // Work in scan-line order.
        int[] newLine = new int[width];
        int[] bands = new int[sampleModel.getNumBands()];
        for (int y = 0; y < height; ++y)
          {
            for (int x = 0; x < width; ++x)
              {
                sampleModel.getPixel(x, y, bands, dataBuffer);
                newLine[x] = colorModel.getDataElement(bands, 0);
              }

            // Tell the consumers about the new scan line.
            it = consumers.iterator();
            while (it.hasNext())
              {
                ImageConsumer target = (ImageConsumer) it.next();
                target.setPixels(0, y, width, 1, colorModel, newLine, 0, width);
              }
          }

        // Tell the consumers that we're done.
        it = consumers.iterator();
        while (it.hasNext())
          {
            ImageConsumer target = (ImageConsumer) it.next();
            target.imageComplete(ImageConsumer.STATICIMAGEDONE);
          }
      }
  }
View Full Code Here

TOP

Related Classes of java.awt.image.ImageConsumer

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.