API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt.image. PixelGrabber View Source
Author(s)
Jim Graham
Since
Version
1.27, 02/14/06
Serial
Hierarchy
 Object
      PixelGrabber
Implements
 ImageConsumer
Subclasses
Description
public class PixelGrabber
  The PixelGrabber class implements an ImageConsumer which can be attached to an Image or ImageProducer object to retrieve a subset of the pixels in that image.
Constructors
public PixelGrabber (Image img, int x, int y, int w, int h, boolean forceRGB)
  Create a PixelGrabber object to grab the (x, y, w, h) rectangular section of pixels from the specified image.
public PixelGrabber (Image img, int x, int y, int w, int h, int[] pix, int off, int scansize)
  Create a PixelGrabber object to grab the (x, y, w, h) rectangular section of pixels from the specified image into the given array.
public PixelGrabber (ImageProducer ip, int x, int y, int w, int h, int[] pix, int off, int scansize)
  Create a PixelGrabber object to grab the (x, y, w, h) rectangular section of pixels from the image produced by the specified ImageProducer into the given array.
Methods
Hide/Show inherited methods
publicsynchronized void abortGrabbing ()
Request the PixelGrabber to abort the image fetch.
publicsynchronized ColorModel getColorModel ()
  Get the ColorModel for the pixels stored in the array.
publicsynchronized int getHeight ()
  Get the height of the pixel buffer (after adjusting for image height).
publicsynchronized Object getPixels ()
  Get the pixel buffer.
publicsynchronized int getStatus ()
  Return the status of the pixels.
publicsynchronized int getWidth ()
  Get the width of the pixel buffer (after adjusting for image width).
public boolean grabPixels () throws InterruptedException
  Request the Image or ImageProducer to start delivering pixels and wait for all of the pixels in the rectangle of interest to be delivered.
publicsynchronized boolean grabPixels (long ms) throws InterruptedException
  Request the Image or ImageProducer to start delivering pixels and wait for all of the pixels in the rectangle of interest to be delivered or until the specified timeout has elapsed.
publicsynchronized void imageComplete (int status) [Specified in ImageConsumer]
  The imageComplete method is part of the ImageConsumer API which this class must implement to retrieve the pixels.
public void setColorModel (ColorModel model) [Specified in ImageConsumer]
  The setColorModel method is part of the ImageConsumer API which this class must implement to retrieve the pixels.
public void setDimensions (int width, int height) [Specified in ImageConsumer]
  The setDimensions method is part of the ImageConsumer API which this class must implement to retrieve the pixels.
public void setHints (int hints) [Specified in ImageConsumer]
  The setHints method is part of the ImageConsumer API which this class must implement to retrieve the pixels.
public void setPixels (int srcX, int srcY, int srcW, int srcH, ColorModel model, byte[] pixels, int srcOff, int srcScan) [Specified in ImageConsumer]
  The setPixels method is part of the ImageConsumer API which this class must implement to retrieve the pixels.
public void setPixels (int srcX, int srcY, int srcW, int srcH, ColorModel model, int[] pixels, int srcOff, int srcScan) [Specified in ImageConsumer]
  The setPixels method is part of the ImageConsumer API which this class must implement to retrieve the pixels.
public void setProperties (Hashtable<Object, Object> props) [Specified in ImageConsumer]
  The setProperties method is part of the ImageConsumer API which this class must implement to retrieve the pixels.
publicsynchronized void startGrabbing ()
Request the PixelGrabber to start fetching the pixels.
publicsynchronized int status ()
  Returns the status of the pixels.
Fields
Hide/Show inherited fields
pack-private byte bytePixels
publicfinalstatic int COMPLETESCANLINES = "4" [Inherited From ImageConsumer]
  The pixels will be delivered in (multiples of) complete scanlines at a time.
pack-private int dstH
pack-private int dstOff
pack-private int dstScan
pack-private int dstW
pack-private int dstX
pack-private int dstY
publicfinalstatic int IMAGEABORTED = "4" [Inherited From ImageConsumer]
  The image creation process was deliberately aborted.
publicfinalstatic int IMAGEERROR = "1" [Inherited From ImageConsumer]
  An error was encountered while producing the image.
pack-private ColorModel imageModel
pack-private int intPixels
pack-private ImageProducer producer
publicfinalstatic int RANDOMPIXELORDER = "1" [Inherited From ImageConsumer]
  The pixels will be delivered in a random order.
publicfinalstatic int SINGLEFRAME = "16" [Inherited From ImageConsumer]
  The image contain a single static image.
publicfinalstatic int SINGLEFRAMEDONE = "2" [Inherited From ImageConsumer]
  One frame of the image is complete but there are more frames to be delivered.
publicfinalstatic int SINGLEPASS = "8" [Inherited From ImageConsumer]
  The pixels will be delivered in a single pass.
publicfinalstatic int STATICIMAGEDONE = "3" [Inherited From ImageConsumer]
  The image is complete and there are no more pixels or frames to be delivered.
publicfinalstatic int TOPDOWNLEFTRIGHT = "2" [Inherited From ImageConsumer]
  The pixels will be delivered in top-down, left-to-right order.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar