java.awt.image
Class PixelGrabber
java.lang.Object
|
+--java.awt.image.PixelGrabber
All Implemented Interfaces:
ImageConsumer
PixelGrabber is an ImageConsumer designed to extract a rectangular region of pixels
from an Image
PixelGrabber(java.awt.Image img, int x, int y, int w, int h, int[] pix, int off, int scansize)
|
PixelGrabber(java.awt.image.ImageProducer ip, int x, int y, int w, int h, int[] pix, int off, int scansize)
|
PixelGrabber(java.awt.Image img, int x, int y, int w, int h, boolean forceRGB)
|
synchronized void | abortGrabbing()
|
synchronized java.awt.image.ColorModel | getColorModel()
|
synchronized int | getHeight()
|
synchronized java.lang.Object | getPixels()
|
synchronized int | getStatus()
|
synchronized int | getWidth()
|
boolean | grabPixels()
|
synchronized boolean | grabPixels(long ms)
|
synchronized void | imageComplete(int status)
|
void | setColorModel(java.awt.image.ColorModel model)
|
void | setDimensions(int width, int height)
|
void | setHints(int flags)
|
void | setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int offset, int scansize)
|
void | setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int offset, int scansize)
|
void | setProperties(java.util.Hashtable props)
|
synchronized void | startGrabbing()
|
synchronized int | status()
|
PixelGrabber
public PixelGrabber(java.awt.Image img, int x, int y, int w, int h, boolean forceRGB)
Create a PixelGrabber used to grab pixels from the specified Image
in the specified rectangle
Parameters:
PixelGrabber
public PixelGrabber(java.awt.Image img, int x, int y, int w, int h, int[] pix, int off, int scansize)
Create a PixelGrabber used to grab pixels from the specified Image
in the specified rectangle
Parameters:
PixelGrabber
public PixelGrabber(java.awt.image.ImageProducer ip, int x, int y, int w, int h, int[] pix, int off, int scansize)
Create a PixelGrabber used to grab pixels from the specified ImageProducer
in the specified rectangle
Parameters:
abortGrabbing
public synchronized void abortGrabbing()
Abort the grabbing of pixels
getColorModel
public synchronized ColorModel getColorModel()
Get the ColorModel of the image
Returns:
getHeight
public synchronized int getHeight()
Return height of pixel region
Returns:
getPixels
public synchronized Object getPixels()
Returns the grabbed pixel buffer
Returns:
getStatus
public synchronized int getStatus()
Get the status of the pixel grabbing representing by ImageObserver flags
Returns:
getWidth
public synchronized int getWidth()
Return width of pixel region
Returns:
grabPixels
public boolean grabPixels()
Grab the Pixels.
Returns:
Throws:
grabPixels
public synchronized boolean grabPixels(long ms)
Grab the Pixels and abort if it takes too long
Parameters:
Returns:
Throws:
imageComplete
public synchronized void imageComplete(int status)
The ImageProducer
calls this method to indicate a
single frame or the entire image is complete. The method is
also used to indicate an error in loading or producing the
image.
Parameters:
setColorModel
public void setColorModel(java.awt.image.ColorModel model)
This ColorModel
should indicate the model used by
the majority of calls to setPixels
. Each call to
setPixels
could however indicate a different
ColorModel
.
Parameters:
See Also:
setDimensions
public void setDimensions(int width, int height)
An ImageProducer
indicates the size of the image
being produced using this method.
Parameters:
setHints
public void setHints(int flags)
The ImageProducer
should call this method with a
bit mask of hints from any of RANDOMPIXELORDER
,
TOPDOWNLEFTRIGHT
, COMPLETESCANLINES
,
SINGLEPASS
, SINGLEFRAME
.
Parameters:
setPixels
public void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int offset, int scansize)
This function delivers a rectangle of pixels where any
pixel(m,n) is stored in the array as a byte
at
index (n * scansize + m + offset).
Parameters:
setPixels
public void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int offset, int scansize)
This function delivers a rectangle of pixels where any
pixel(m,n) is stored in the array as an int
at
index (n * scansize + m + offset).
Parameters:
setProperties
public void setProperties(java.util.Hashtable props)
An ImageProducer
can set a list of properties
associated with this image by using this method.
Parameters:
startGrabbing
public synchronized void startGrabbing()
Start Grabbing Pixels
status
public synchronized int status()