PixelGrabber.PixelGrabber
Class Overview | Class Members |
This Package |
All Packages
public PixelGrabber( Image img,
int x,
int y,
int w,
int h,
int pix[],
int off,
int scansize )
Parameters
- img
- the image to retrieve pixels from
- x
- 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 image
- y
- the y coordinate of the upper left corner of the rectangle
of pixels to retrieve from the image
- w
- the width of the rectangle of pixels to retrieve
- h
- the height of the rectangle of pixels to retrieve
- pix
- the array of integers which are to be used to hold the
RGB pixels retrieved from the image
- off
- the offset into the array of where to store the first pixel
- scansize
- the distance from one row of pixels to the next in
the array
Description
Create a PixelGrabber object to grab the (x, y, w, h) rectangular
section of pixels from the specified image into the given array.
The pixels are stored into the array in the default RGB ColorModel.
The RGB data for pixel (i, j) where (i, j) is inside the rectangle
(x, y, w, h) is stored in the array at
pix[(j - y) * scansize + (i - x) + off].
See Also
getRGBdefault
public PixelGrabber( ImageProducer ip,
int x,
int y,
int w,
int h,
int pix[],
int off,
int scansize )
Parameters
- img
- the image to retrieve pixels from
- x
- 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 image
- y
- the y coordinate of the upper left corner of the rectangle
of pixels to retrieve from the image
- w
- the width of the rectangle of pixels to retrieve
- h
- the height of the rectangle of pixels to retrieve
- pix
- the array of integers which are to be used to hold the
RGB pixels retrieved from the image
- off
- the offset into the array of where to store the first pixel
- scansize
- the distance from one row of pixels to the next in
the array
Description
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.
The pixels are stored into the array in the default RGB ColorModel.
The RGB data for pixel (i, j) where (i, j) is inside the rectangle
(x, y, w, h) is stored in the array at
pix[(j - y) * scansize + (i - x) + off].
See Also
getRGBdefault
public PixelGrabber( Image img,
int x,
int y,
int w,
int h,
boolean forceRGB )
Parameters
- img
- the image to retrieve the image data from
- x
- 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 image
- y
- the y coordinate of the upper left corner of the rectangle
of pixels to retrieve from the image
- w
- the width of the rectangle of pixels to retrieve
- h
- the height of the rectangle of pixels to retrieve
- forceRGB
- true if the pixels should always be converted to
the default RGB ColorModel
Description
Create a PixelGrabber object to grab the (x, y, w, h) rectangular
section of pixels from the specified image. The pixels are
accumulated in the original ColorModel if the same ColorModel
is used for every call to setPixels, otherwise the pixels are
accumulated in the default RGB ColorModel. If the forceRGB
parameter is true, then the pixels will be accumulated in the
default RGB ColorModel anywya. A buffer is allocated by the
PixelGrabber to hold the pixels in either case. If (w < 0) or
(h < 0), then they will default to the remaining width and
height of the source data when that information is delivered.