|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectmoebiusViewer.SinglePixelGrabber
The PixelGrabber class implements an ImageConsumer which can be attached to an Image or ImageProducer object to retrieve a single pixel of that image.
| Field Summary |
| Fields inherited from interface java.awt.image.ImageConsumer |
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT |
| Constructor Summary | |
SinglePixelGrabber(java.awt.Image img,
int x,
int y)
Create a PixelGrabber object to grab the (x, y) pixel from the specified image. |
|
SinglePixelGrabber(java.awt.image.ImageProducer ip,
int x,
int y)
Create a PixelGrabber object to grab the (x, y) pixel from the image produced by the specified ImageProducer. |
|
| Method Summary | |
void |
abortGrabbing()
Request the PixelGrabber to abort the image fetch. |
int |
getStatus()
Return the status of the pixels. |
int |
grabPixel()
Request the Image or ImageProducer to start delivering pixels and wait for the pixel of interest to be delivered. |
int |
grabPixel(long ms)
Request the Image or ImageProducer to start delivering pixels and wait for the pixel of interest to be delivered or until the specified timeout has elapsed. |
void |
imageComplete(int status)
The imageComplete method is part of the ImageConsumer API which this class must implement to retrieve the pixels. |
void |
reset()
|
void |
reset(java.awt.Image img)
|
void |
reset(java.awt.image.ImageProducer ip)
|
void |
reset(int x,
int y)
|
void |
setColorModel(java.awt.image.ColorModel model)
The setColorModel method is part of the ImageConsumer API which this class must implement to retrieve the pixels. |
void |
setDimensions(int width,
int height)
The setDimensions method is part of the ImageConsumer API which this class must implement to retrieve the pixels. |
void |
setHints(int hints)
The setHints method is part of the ImageConsumer API which this class must implement to retrieve the pixels. |
void |
setPixels(int srcX,
int srcY,
int srcW,
int srcH,
java.awt.image.ColorModel model,
byte[] pixels,
int srcOff,
int srcScan)
The setPixels method is part of the ImageConsumer API which this class must implement to retrieve the pixels. |
void |
setPixels(int srcX,
int srcY,
int srcW,
int srcH,
java.awt.image.ColorModel model,
int[] pixels,
int srcOff,
int srcScan)
The setPixels method is part of the ImageConsumer API which this class must implement to retrieve the pixels. |
void |
setProperties(java.util.Hashtable props)
The setProperties method is part of the ImageConsumer API which this class must implement to retrieve the pixels. |
void |
startGrabbing()
Request the PixelGrabber to start fetching the pixels. |
int |
status()
Returns the status of the pixels. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SinglePixelGrabber(java.awt.Image img,
int x,
int y)
img - the image to retrieve pixels fromx - the x coordinate of the upper left corner of the rectangle
of pixels to retrieve from the image, relative to the default
(unscaled) size of the imagey - the y coordinate of the upper left corner of the rectangle
of pixels to retrieve from the image
public SinglePixelGrabber(java.awt.image.ImageProducer ip,
int x,
int y)
ip - the ImageProducer to retrieve pixels fromx - the x coordinate of the upper left corner of the rectangle
of pixels to retrieve from the image, relative to the default
(unscaled) size of the imagey - the y coordinate of the upper left corner of the rectangle
of pixels to retrieve from the image| Method Detail |
public void reset(int x,
int y)
public void reset(java.awt.Image img)
public void reset(java.awt.image.ImageProducer ip)
public void reset()
public void startGrabbing()
public void abortGrabbing()
public int grabPixel()
throws java.lang.InterruptedException
java.lang.InterruptedException - Another thread has interrupted this thread.
public int grabPixel(long ms)
throws java.lang.InterruptedException
ms:
ms == 0, waits until all pixels are delivered
ms > 0, waits until all pixels are delivered
as timeout expires.
ms < 0, returns pixValue if the pixel
is grabbed, -1 otherwise and does not wait.
ms - the number of milliseconds to wait for the image pixels
to arrive before timing out
pixValue if the pixel was successfully grabbed
-1 on abort, error or timeout
java.lang.InterruptedException - Another thread has interrupted this thread.public int getStatus()
ImageObserver
public void setDimensions(int width,
int height)
Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels.
setDimensions in interface java.awt.image.ImageConsumerpublic void setHints(int hints)
Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels.
setHints in interface java.awt.image.ImageConsumerpublic void setProperties(java.util.Hashtable props)
Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels.
setProperties in interface java.awt.image.ImageConsumerpublic void setColorModel(java.awt.image.ColorModel model)
Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels.
setColorModel in interface java.awt.image.ImageConsumer
public void setPixels(int srcX,
int srcY,
int srcW,
int srcH,
java.awt.image.ColorModel model,
byte[] pixels,
int srcOff,
int srcScan)
Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels.
setPixels in interface java.awt.image.ImageConsumer
public void setPixels(int srcX,
int srcY,
int srcW,
int srcH,
java.awt.image.ColorModel model,
int[] pixels,
int srcOff,
int srcScan)
Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels.
setPixels in interface java.awt.image.ImageConsumerpublic void imageComplete(int status)
Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels.
imageComplete in interface java.awt.image.ImageConsumerpublic int status()
getStatus have the
same implementation, but getStatus is the
preferred method because it conforms to the convention of
naming information-retrieval methods with the form
"getXXX".
ImageObserver,
getStatus()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||