java.awt.image

Interface ImageConsumer

Known Implementing Classes:
AreaAveragingScaleFilter, BufferedImageFilter, CropImageFilter, GrayFilter, ImageFilter, PixelGrabber, ReplicateScaleFilter, RGBImageFilter

public interface ImageConsumer

The interface for objects expressing interest in image data through the ImageProducer interfaces. When a consumer is added to an image producer, the producer delivers all of the data about the image using the method calls defined in this interface.
See Also:
ImageProducer

Field Summary

static int
COMPLETESCANLINES
The pixels will be delivered in (multiples of) complete scanlines at a time.
static int
IMAGEABORTED
The image creation process was deliberately aborted.
static int
IMAGEERROR
An error was encountered while producing the image.
static int
RANDOMPIXELORDER
The pixels will be delivered in a random order.
static int
SINGLEFRAME
The image contain a single static image.
static int
SINGLEFRAMEDONE
One frame of the image is complete but there are more frames to be delivered.
static int
SINGLEPASS
The pixels will be delivered in a single pass.
static int
STATICIMAGEDONE
The image is complete and there are no more pixels or frames to be delivered.
static int
TOPDOWNLEFTRIGHT
The pixels will be delivered in top-down, left-to-right order.

Method Summary

void
imageComplete(int status)
The imageComplete method is called when the ImageProducer is finished delivering all of the pixels that the source image contains, or when a single frame of a multi-frame animation has been completed, or when an error in loading or producing the image has occured.
void
setColorModel(ColorModel model)
Sets the ColorModel object used for the majority of the pixels reported using the setPixels method calls.
void
setDimensions(int width, int height)
The dimensions of the source image are reported using the setDimensions method call.
void
setHints(int hintflags)
Sets the hints that the ImageConsumer uses to process the pixels delivered by the ImageProducer.
void
setPixels(int x, int y, int w, int h, ColorModel model, pixels[] , int off, int scansize)
Delivers the pixels of the image with one or more calls to this method.
void
setPixels(int x, int y, int w, int h, ColorModel model, pixels[] , int off, int scansize)
The pixels of the image are delivered using one or more calls to the setPixels method.
void
setProperties(Hashtable props)
Sets the extensible list of properties associated with this image.

Field Details

COMPLETESCANLINES

public static final int COMPLETESCANLINES
The pixels will be delivered in (multiples of) complete scanlines at a time.
Field Value:
4
See Also:
setHints(int)
Usages and Demos :

View More Examples of ImageConsumer.COMPLETESCANLINES
   1:     private static final int hintflags =
   2:     ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES |
   3:     ImageConsumer.SINGLEFRAME;
   4: }

View Full Code Here
   1:       ic.setHints(ImageConsumer.SINGLEPASS);
   2:       ic.setHints(ImageConsumer.COMPLETESCANLINES);
   3:       ic.setDimensions(w, h);
   4:       ic.setColorModel(model);
   5:     }

View Full Code Here
   1:     private static int XbmHints = (ImageConsumer.TOPDOWNLEFTRIGHT |
   2:                    ImageConsumer.COMPLETESCANLINES |
   3:                    ImageConsumer.SINGLEPASS |
   4:                    ImageConsumer.SINGLEFRAME);

View Full Code Here
   1:     public void setHints(int hints) {
   2:     super.setHints(hints & (~ImageConsumer.COMPLETESCANLINES));
   3:     }
   4: 
   5:     public void setColorModel(ColorModel model) {

View Full Code Here
   1:   {
   2:     super.setHints(hints & (~ImageConsumer.COMPLETESCANLINES));
   3:   }
   4: 
   5:   public void setColorModel(ColorModel model)

View Full Code Here

IMAGEABORTED

public static final int IMAGEABORTED
The image creation process was deliberately aborted.
Field Value:
4

IMAGEERROR

public static final int IMAGEERROR
An error was encountered while producing the image.
Field Value:
1
Usages and Demos :

View More Examples of ImageConsumer.IMAGEERROR
   1:          if(status == ImageConsumer.IMAGEABORTED ||
   2:             status == ImageConsumer.IMAGEERROR ) {
   3:                 consumer.imageComplete(status);
   4:                 ipixels = null;
   5:                 bpixels = null;

View Full Code Here
   1:                 if (error) {
   2:                     ic.imageComplete(ImageConsumer.IMAGEERROR);
   3:                 } else {
   4:         ...
   5:             if (isConsumer(ic)) {
   6:                 ic.imageComplete(ImageConsumer.IMAGEERROR);
   7:             }
   8:         ...
   9:                 if (error) {
  10:                     ic.imageComplete(ImageConsumer.IMAGEERROR);
  11:                 } else {

View Full Code Here

RANDOMPIXELORDER

public static final int RANDOMPIXELORDER
The pixels will be delivered in a random order. This tells the ImageConsumer not to use any optimizations that depend on the order of pixel delivery, which should be the default assumption in the absence of any call to the setHints method.
Field Value:
1
See Also:
setHints(int)
Usages and Demos :

View More Examples of ImageConsumer.RANDOMPIXELORDER
   1:         ic.setColorModel (cm);
   2:         ic.setHints (ImageConsumer.RANDOMPIXELORDER);
   3:       }
   4:   }
   5:   

View Full Code Here
   1:     private static final int interlaceflags =
   2:     ImageConsumer.RANDOMPIXELORDER | ImageConsumer.COMPLETESCANLINES |
   3:     ImageConsumer.SINGLEPASS | ImageConsumer.SINGLEFRAME;
   4: 
   5:     private short prefix[]  = new short[4096];

View Full Code Here
   1:         consumer.setDimensions (maxX, maxY);
   2:         consumer.setHints (ImageConsumer.COMPLETESCANLINES | ImageConsumer.RANDOMPIXELORDER);
   3:     }
   4: 
   5:     public synchronized boolean isConsumer (ImageConsumer ic)

View Full Code Here

SINGLEFRAME

public static final int SINGLEFRAME
The image contain a single static image. The pixels will be defined in calls to the setPixels methods and then the imageComplete method will be called with the STATICIMAGEDONE flag after which no more image data will be delivered. An example of an image type which would not meet these criteria would be the output of a video feed, or the representation of a 3D rendering being manipulated by the user. The end of each frame in those types of images will be indicated by calling imageComplete with the SINGLEFRAMEDONE flag.
Field Value:
16
Usages and Demos :

View More Examples of ImageConsumer.SINGLEFRAME
   1:                 |ImageConsumer.SINGLEPASS
   2:                 |ImageConsumer.SINGLEFRAME;
   3:             sfd=ImageConsumer.SINGLEFRAMEDONE;
   4:         }
   5:     

View Full Code Here
   1:     ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES |
   2:     ImageConsumer.SINGLEFRAME;
   3: }

View Full Code Here
   1:       ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);
   2:       ic.setHints(ImageConsumer.SINGLEFRAME);
   3:       ic.setHints(ImageConsumer.SINGLEPASS);
   4:       ic.setHints(ImageConsumer.COMPLETESCANLINES);
   5:       ic.setDimensions(w, h);

View Full Code Here
   1:                    ImageConsumer.SINGLEPASS |
   2:                    ImageConsumer.SINGLEFRAME);
   3: 
   4:     public XbmImageDecoder(InputStreamImageSource src, InputStream is) {
   5:     super(src, is);

View Full Code Here
   1:                         ImageConsumer.SINGLEPASS |
   2:                         ImageConsumer.SINGLEFRAME);
   3:             availinfo |= ImageObserver.ALLBITS;
   4:         ...
   5:                     ImageConsumer.SINGLEPASS |
   6:                     ImageConsumer.SINGLEFRAME));
   7:             if (!ip.isConsumer(ic)) {
   8:                 return true;
   9:             }

View Full Code Here

SINGLEFRAMEDONE

public static final int SINGLEFRAMEDONE
One frame of the image is complete but there are more frames to be delivered.
Field Value:
2
Usages and Demos :

View More Examples of ImageConsumer.SINGLEFRAMEDONE
   1:         if (theConsumer != null) {
   2:             theConsumer.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
   3:         }
   4:     }
   5: }

View Full Code Here
   1:                 |ImageConsumer.SINGLEFRAME;
   2:             sfd=ImageConsumer.SINGLEFRAMEDONE;
   3:         }
   4:     

View Full Code Here
   1:                     linesConsumed = linesProduced;
   2:                     consumer.imageComplete (ImageConsumer.SINGLEFRAMEDONE);
   3:                 }
   4:             }
   5:         }

View Full Code Here

SINGLEPASS

public static final int SINGLEPASS
The pixels will be delivered in a single pass. Each pixel will appear in only one call to any of the setPixels methods. An example of an image format which does not meet this criterion is a progressive JPEG image which defines pixels in multiple passes, each more refined than the previous.
Field Value:
8
See Also:
setHints(int)
Usages and Demos :

View More Examples of ImageConsumer.SINGLEPASS
   1:       ic.setHints(ImageConsumer.SINGLEFRAME);
   2:       ic.setHints(ImageConsumer.SINGLEPASS);
   3:       ic.setHints(ImageConsumer.COMPLETESCANLINES);
   4:       ic.setDimensions(w, h);
   5:       ic.setColorModel(model);

View Full Code Here
   1:                    ImageConsumer.COMPLETESCANLINES |
   2:                    ImageConsumer.SINGLEPASS |
   3:                    ImageConsumer.SINGLEFRAME);
   4: 
   5:     public XbmImageDecoder(InputStreamImageSource src, InputStream is) {

View Full Code Here
   1:                         ImageConsumer.COMPLETESCANLINES |
   2:                         ImageConsumer.SINGLEPASS |
   3:                         ImageConsumer.SINGLEFRAME);
   4:         ...
   5:                     ImageConsumer.COMPLETESCANLINES |
   6:                     ImageConsumer.SINGLEPASS |
   7:                     ImageConsumer.SINGLEFRAME));
   8:             if (!ip.isConsumer(ic)) {
   9:                 return true;

View Full Code Here
   1:     ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES |
   2:     ImageConsumer.SINGLEPASS | ImageConsumer.SINGLEFRAME;
   3: 
   4:         ...
   5:     ImageConsumer.RANDOMPIXELORDER | ImageConsumer.COMPLETESCANLINES |
   6:     ImageConsumer.SINGLEPASS | ImageConsumer.SINGLEFRAME;
   7: 
   8:     private short prefix[]  = new short[4096];
   9:     private byte  suffix[]  = new byte[4096];

View Full Code Here
   1:                     : ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES |
   2:                     ImageConsumer.SINGLEPASS | ImageConsumer.SINGLEFRAME);
   3:             setHints(flags);
   4:             headerComplete();

View Full Code Here

STATICIMAGEDONE

public static final int STATICIMAGEDONE
The image is complete and there are no more pixels or frames to be delivered.
Field Value:
3
Usages and Demos :

View More Examples of ImageConsumer.STATICIMAGEDONE
   1:       final ImageConsumer ic = cons[i];
   2:       ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
   3:     }
   4: 
   5:     if (pic != null)

View Full Code Here
   1:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
   2:         ic.imageComplete (ImageConsumer.STATICIMAGEDONE);
   3:       }
   4: 
   5:     curr = null;

View Full Code Here
   1:             (availinfo & ImageObserver.ALLBITS) != 0) {
   2:             ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
   3:         }
   4:         return true;
   5:     }

View Full Code Here
   1:             if (consumer != null)
   2:                 consumer.imageComplete (ImageConsumer.STATICIMAGEDONE);
   3:         }
   4:         ...
   5:         {
   6:             consumer.imageComplete (ImageConsumer.STATICIMAGEDONE);
   7:         }
   8:     }

View Full Code Here
   1:                 } else {
   2:                     ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
   3:                 }
   4:         ...
   5:                 } else {
   6:                     ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
   7:                 }
   8:             }
   9:         }

View Full Code Here

TOPDOWNLEFTRIGHT

public static final int TOPDOWNLEFTRIGHT
The pixels will be delivered in top-down, left-to-right order.
Field Value:
2
See Also:
setHints(int)
Usages and Demos :

View More Examples of ImageConsumer.TOPDOWNLEFTRIGHT
   1:     private static final int hintflags =
   2:     ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES |
   3:     ImageConsumer.SINGLEFRAME;
   4: }

View Full Code Here
   1:       final ImageConsumer ic = cons[i];
   2:       ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);
   3:       ic.setHints(ImageConsumer.SINGLEFRAME);
   4:       ic.setHints(ImageConsumer.SINGLEPASS);
   5:       ic.setHints(ImageConsumer.COMPLETESCANLINES);

View Full Code Here
   1:                      | ImageConsumer.SINGLEPASS
   2:                      | ImageConsumer.TOPDOWNLEFTRIGHT);
   3:       }
   4: 
   5:     for (int line = 0; line < height; line++)

View Full Code Here
   1:         numlines = Math.max(numlines, y + h);
   2:         if ((hints & ImageConsumer.TOPDOWNLEFTRIGHT) == 0) {
   3:             if (seen == null) {
   4:         ...
   5:         if (get() != null && bit_state == BITS_ALLOCATED) {
   6:             hints = (ImageConsumer.TOPDOWNLEFTRIGHT |
   7:                         ImageConsumer.COMPLETESCANLINES |
   8:         ...
   9:         if (hints != 0) {
  10:             ic.setHints(hints & (ImageConsumer.TOPDOWNLEFTRIGHT |
  11:                     ImageConsumer.COMPLETESCANLINES |

View Full Code Here
   1:     private static final int normalflags =
   2:     ImageConsumer.TOPDOWNLEFTRIGHT | ImageConsumer.COMPLETESCANLINES |
   3:     ImageConsumer.SINGLEPASS | ImageConsumer.SINGLEFRAME;
   4: 
   5:     private static final int interlaceflags =

View Full Code Here

Method Details

imageComplete

public void imageComplete(int status)
The imageComplete method is called when the ImageProducer is finished delivering all of the pixels that the source image contains, or when a single frame of a multi-frame animation has been completed, or when an error in loading or producing the image has occured. The ImageConsumer should remove itself from the list of consumers registered with the ImageProducer at this time, unless it is interested in successive frames.
Parameters:
status - the status of image loading
Usages and Demos :

View More Examples of imageComplete(int status)
   1: import java.awt.Component;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5:     }
   6:     private ImageConsumer theConsumer;
   7:         ...
   8:     public synchronized void addConsumer(ImageConsumer ic) {
   9:         theConsumer = ic;
  10:         ...
  11:         if (theConsumer != null) {
  12:             theConsumer.imageComplete(ImageConsumer.SINGLEFRAMEDONE);

View Full Code Here
   1: {
   2:     private ImageConsumer consumer;
   3:     private int w,h;
   4:         ...
   5:             this.pixel=pixel;
   6:             hints=ImageConsumer.TOPDOWNLEFTRIGHT
   7:         ...
   8:                 |ImageConsumer.COMPLETESCANLINES
   9:                 |ImageConsumer.SINGLEPASS
  10:         ...
  11:                 consumer.setPixels(0, 0, w, h, cm, pixel, 0, w);
  12:             consumer.imageComplete(sfd);

View Full Code Here
   1: import java.awt.image.ColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5: 
   6:   public synchronized void addConsumer (final ImageConsumer ic)
   7:   {
   8:         ...
   9: 
  10:   public synchronized boolean isConsumer (final ImageConsumer ic)
  11:   {
  12:         ...
  13:       final ImageConsumer ic = cons[i];
  14:       ic.imageComplete(ImageConsumer.STATICIMAGEDONE);

View Full Code Here
   1: import java.awt.image.DirectColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
   7:         ic.setDimensions (width, height);
   8:         ...
   9:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
  10:         ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
  11:       }

View Full Code Here
   1:         numlines = Math.max(numlines, y + h);
   2:         if ((hints & ImageConsumer.TOPDOWNLEFTRIGHT) == 0) {
   3:             if (seen == null) {
   4:         ...
   5:         if (get() != null && bit_state == BITS_ALLOCATED) {
   6:             hints = (ImageConsumer.TOPDOWNLEFTRIGHT |
   7:         ...
   8:                         ImageConsumer.COMPLETESCANLINES |
   9:                         ImageConsumer.SINGLEPASS |
  10:         ...
  11:             (availinfo & ImageObserver.ALLBITS) != 0) {
  12:             ic.imageComplete(ImageConsumer.STATICIMAGEDONE);

View Full Code Here

setColorModel

public void setColorModel(ColorModel model)
Sets the ColorModel object used for the majority of the pixels reported using the setPixels method calls. Note that each set of pixels delivered using setPixels contains its own ColorModel object, so no assumption should be made that this model will be the only one used in delivering pixel values. A notable case where multiple ColorModel objects may be seen is a filtered image when for each set of pixels that it filters, the filter determines whether the pixels can be sent on untouched, using the original ColorModel, or whether the pixels should be modified (filtered) and passed on using a ColorModel more convenient for the filtering process.
Parameters:
model - the specified ColorModel
See Also:
ColorModel
Usages and Demos :

View More Examples of setColorModel(ColorModel model)
   1: {
   2:     private ImageConsumer consumer;
   3:     private int w,h;
   4:         ...
   5:             this.pixel=pixel;
   6:             hints=ImageConsumer.TOPDOWNLEFTRIGHT
   7:         ...
   8:                 |ImageConsumer.COMPLETESCANLINES
   9:                 |ImageConsumer.SINGLEPASS
  10:         ...
  11:                     consumer.setProperties(null);
  12:                     consumer.setColorModel(cm);

View Full Code Here
   1: import java.awt.image.ColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5: 
   6:   public synchronized void addConsumer (final ImageConsumer ic)
   7:   {
   8:         ...
   9: 
  10:   public synchronized boolean isConsumer (final ImageConsumer ic)
  11:   {
  12:         ...
  13:       ic.setDimensions(w, h);
  14:       ic.setColorModel(model);

View Full Code Here
   1: import jp.ujihara.java.awt.image.ColorModel;
   2: import jp.ujihara.java.awt.image.ImageConsumer;
   3: import java.io.BufferedReader;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) v.elementAt (i);
   7: 
   8:         ...
   9:         ic.setDimensions (width, height);
  10:         ic.setColorModel(cm);
  11:         ic.setHints (ImageConsumer.COMPLETESCANLINES

View Full Code Here
   1: import java.awt.image.DirectColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
   7:         ic.setDimensions (width, height);
   8:         ...
   9:         ic.setColorModel(cm);
  10:         ic.setHints (ImageConsumer.RANDOMPIXELORDER);

View Full Code Here
   1:         numlines = Math.max(numlines, y + h);
   2:         if ((hints & ImageConsumer.TOPDOWNLEFTRIGHT) == 0) {
   3:             if (seen == null) {
   4:         ...
   5:         if (get() != null && bit_state == BITS_ALLOCATED) {
   6:             hints = (ImageConsumer.TOPDOWNLEFTRIGHT |
   7:         ...
   8:                         ImageConsumer.COMPLETESCANLINES |
   9:                         ImageConsumer.SINGLEPASS |
  10:         ...
  11:         if (full && colormodel != null) {
  12:             ic.setColorModel(colormodel);

View Full Code Here

setDimensions

public void setDimensions(int width,
                          int height)
The dimensions of the source image are reported using the setDimensions method call.
Parameters:
width - the width of the source image
height - the height of the source image
Usages and Demos :

View More Examples of setDimensions(int width,int height)
   1: import java.awt.Component;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5:     }
   6:     private ImageConsumer theConsumer;
   7:         ...
   8:     public synchronized void addConsumer(ImageConsumer ic) {
   9:         theConsumer = ic;
  10:         ...
  11:         if (theConsumer != null) {
  12:             theConsumer.setDimensions(width, height);

View Full Code Here
   1: {
   2:     private ImageConsumer consumer;
   3:     private int w,h;
   4:         ...
   5:             this.pixel=pixel;
   6:             hints=ImageConsumer.TOPDOWNLEFTRIGHT
   7:         ...
   8:                 |ImageConsumer.COMPLETESCANLINES
   9:                 |ImageConsumer.SINGLEPASS
  10:         ...
  11:                     consumer=imageconsumer;
  12:                     consumer.setDimensions(w,h);

View Full Code Here
   1: import java.awt.image.ColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5: 
   6:   public synchronized void addConsumer (final ImageConsumer ic)
   7:   {
   8:         ...
   9: 
  10:   public synchronized boolean isConsumer (final ImageConsumer ic)
  11:   {
  12:         ...
  13:       ic.setHints(ImageConsumer.COMPLETESCANLINES);
  14:       ic.setDimensions(w, h);

View Full Code Here
   1: import jp.ujihara.java.awt.image.ColorModel;
   2: import jp.ujihara.java.awt.image.ImageConsumer;
   3: import java.io.BufferedReader;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) v.elementAt (i);
   7: 
   8:         ...
   9:         ic.setDimensions(width, height);
  10:         ic.setColorModel (cm);

View Full Code Here
   1: import java.awt.image.DirectColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
   7:         ...
   8:         ic.setDimensions(width, height);
   9:         ic.setColorModel (cm);

View Full Code Here

setHints

public void setHints(int hintflags)
Sets the hints that the ImageConsumer uses to process the pixels delivered by the ImageProducer. The ImageProducer can deliver the pixels in any order, but the ImageConsumer may be able to scale or convert the pixels to the destination ColorModel more efficiently or with higher quality if it knows some information about how the pixels will be delivered up front. The setHints method should be called before any calls to any of the setPixels methods with a bit mask of hints about the manner in which the pixels will be delivered. If the ImageProducer does not follow the guidelines for the indicated hint, the results are undefined.
Parameters:
hintflags - a set of hints that the ImageConsumer uses to process the pixels
Usages and Demos :

View More Examples of setHints(int hintflags)
   1: {
   2:     private ImageConsumer consumer;
   3:     private int w,h;
   4:         ...
   5:             this.pixel=pixel;
   6:             hints=ImageConsumer.TOPDOWNLEFTRIGHT
   7:         ...
   8:                 |ImageConsumer.COMPLETESCANLINES
   9:                 |ImageConsumer.SINGLEPASS
  10:         ...
  11:                     consumer.setColorModel(cm);
  12:                     consumer.setHints(hints);

View Full Code Here
   1: import java.awt.image.ColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5: 
   6:   public synchronized void addConsumer (final ImageConsumer ic)
   7:   {
   8:         ...
   9: 
  10:   public synchronized boolean isConsumer (final ImageConsumer ic)
  11:   {
  12:         ...
  13:       final ImageConsumer ic = cons[i];
  14:       ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);

View Full Code Here
   1: import java.awt.image.DirectColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
   7:         ic.setDimensions (width, height);
   8:         ...
   9:         ic.setColorModel (cm);
  10:         ic.setHints(ImageConsumer.RANDOMPIXELORDER);
  11:       }

View Full Code Here
   1:     RayTracerEngine        engine;
   2:     ImageConsumer     consumer;
   3:     int             imagePixels [];
   4:         ...
   5:                     linesConsumed = linesProduced;
   6:                     consumer.imageComplete (ImageConsumer.SINGLEFRAMEDONE);
   7:                 }
   8:         ...
   9:             if (consumer != null)
  10:                 consumer.imageComplete (ImageConsumer.STATICIMAGEDONE);
  11:         }
  12:         ...
  13:         consumer.setDimensions (maxX, maxY);
  14:         consumer.setHints(ImageConsumer.COMPLETESCANLINES | ImageConsumer.RANDOMPIXELORDER);

View Full Code Here

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      ColorModel model,
                      pixels[] ,
                      int off,
                      int scansize)
Delivers the pixels of the image with one or more calls to this method. Each call specifies the location and size of the rectangle of source pixels that are contained in the array of pixels. The specified ColorModel object should be used to convert the pixels into their corresponding color and alpha components. Pixel (m,n) is stored in the pixels array at index (n * scansize + m + off). The pixels delivered using this method are all stored as bytes.
Parameters:
w - the width of the area of pixels
h - the height of the area of pixels
model - the specified ColorModel
off - the offset into the pixels array
scansize - the distance from one row of pixels to the next in the pixels array
See Also:
ColorModel
Usages and Demos :

View More Examples of setPixels(int x,int y,int w,int h,ColorModel model,pixels[] ,int off,int scansize)
   1: {
   2:     private ImageConsumer consumer;
   3:     private int w,h;
   4:         ...
   5:             this.pixel=pixel;
   6:             hints=ImageConsumer.TOPDOWNLEFTRIGHT
   7:         ...
   8:                 |ImageConsumer.COMPLETESCANLINES
   9:                 |ImageConsumer.SINGLEPASS
  10:         ...
  11:                 }
  12:                 consumer.setPixels(0, 0, w, h, cm, pixel, 0, w);

View Full Code Here
   1: import java.awt.image.ColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5: 
   6:   public synchronized void addConsumer (final ImageConsumer ic)
   7:   {
   8:         ...
   9: 
  10:   public synchronized boolean isConsumer (final ImageConsumer ic)
  11:   {
  12:         ...
  13:         final ImageConsumer ic = cons[j];
  14:         ic.setPixels(0, i, w, rows, model, pixels, 0, w);

View Full Code Here
   1: import jp.ujihara.java.awt.image.ColorModel;
   2: import jp.ujihara.java.awt.image.ImageConsumer;
   3: import java.io.BufferedReader;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) v.elementAt (i);
   7: 
   8:         ...
   9:             ImageConsumer ic = (ImageConsumer) v.elementAt (i);
  10:             ic.setPixels(0, 0 + line, width, 1, cm, scanline, 0, width);
  11:           }

View Full Code Here
   1: import java.awt.image.DirectColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
   7:         ic.setDimensions (width, height);
   8:         ...
   9:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
  10:         ic.setPixels(x, y, width, height, cm, pixels, 0, scansize);
  11:       }

View Full Code Here
   1: 
   2:     public synchronized void addConsumer(ImageConsumer ic) {
   3:         if (theConsumers.contains(ic)) {
   4:         ...
   5:                 if (error) {
   6:                     ic.imageComplete(ImageConsumer.IMAGEERROR);
   7:                 } else {
   8:         ...
   9:                     ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
  10:                 }
  11:         ...
  12:                 if (pixels instanceof byte[]) {
  13:                     ic.setPixels(x, y, w, h, model, bpixels, off, dataWidth);

View Full Code Here

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      ColorModel model,
                      pixels[] ,
                      int off,
                      int scansize)
The pixels of the image are delivered using one or more calls to the setPixels method. Each call specifies the location and size of the rectangle of source pixels that are contained in the array of pixels. The specified ColorModel object should be used to convert the pixels into their corresponding color and alpha components. Pixel (m,n) is stored in the pixels array at index (n * scansize + m + off). The pixels delivered using this method are all stored as ints. this method are all stored as ints.
Parameters:
w - the width of the area of pixels
h - the height of the area of pixels
model - the specified ColorModel
off - the offset into the pixels array
scansize - the distance from one row of pixels to the next in the pixels array
See Also:
ColorModel
Usages and Demos :

View More Examples of setPixels(int x,int y,int w,int h,ColorModel model,pixels[] ,int off,int scansize)
   1: {
   2:     private ImageConsumer consumer;
   3:     private int w,h;
   4:         ...
   5:             this.pixel=pixel;
   6:             hints=ImageConsumer.TOPDOWNLEFTRIGHT
   7:         ...
   8:                 |ImageConsumer.COMPLETESCANLINES
   9:                 |ImageConsumer.SINGLEPASS
  10:         ...
  11:                 }
  12:                 consumer.setPixels(0, 0, w, h, cm, pixel, 0, w);

View Full Code Here
   1: import java.awt.image.ColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5: 
   6:   public synchronized void addConsumer (final ImageConsumer ic)
   7:   {
   8:         ...
   9: 
  10:   public synchronized boolean isConsumer (final ImageConsumer ic)
  11:   {
  12:         ...
  13:         final ImageConsumer ic = cons[j];
  14:         ic.setPixels(0, i, w, rows, model, pixels, 0, w);

View Full Code Here
   1: import jp.ujihara.java.awt.image.ColorModel;
   2: import jp.ujihara.java.awt.image.ImageConsumer;
   3: import java.io.BufferedReader;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) v.elementAt (i);
   7: 
   8:         ...
   9:             ImageConsumer ic = (ImageConsumer) v.elementAt (i);
  10:             ic.setPixels(0, 0 + line, width, 1, cm, scanline, 0, width);
  11:           }

View Full Code Here
   1: import java.awt.image.DirectColorModel;
   2: import java.awt.image.ImageConsumer;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5:       {
   6:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
   7:         ic.setDimensions (width, height);
   8:         ...
   9:         ImageConsumer ic = (ImageConsumer) curr.elementAt (i);
  10:         ic.setPixels(x, y, width, height, cm, pixels, 0, scansize);
  11:       }

View Full Code Here
   1: 
   2:     public synchronized void addConsumer(ImageConsumer ic) {
   3:         if (theConsumers.contains(ic)) {
   4:         ...
   5:                 if (error) {
   6:                     ic.imageComplete(ImageConsumer.IMAGEERROR);
   7:                 } else {
   8:         ...
   9:                     ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
  10:                 }
  11:         ...
  12:                 if (pixels instanceof byte[]) {
  13:                     ic.setPixels(x, y, w, h, model, bpixels, off, dataWidth);

View Full Code Here

setProperties

public void setProperties(Hashtable props)
Sets the extensible list of properties associated with this image.
Parameters:
props - the list of properties to be associated with this image