APIdia Launch Partner
Top Description Fields Constructors Methods
sun.awt.image

public Class BytePackedRaster

extends SunWritableRaster
Class Inheritance
Imports
java.awt.Point, .Rectangle, java.awt.image.DataBuffer, .DataBufferByte, .MultiPixelPackedSampleModel, .Raster, .RasterFormatException, .SampleModel, .WritableRaster

This class is useful for describing 1, 2, or 4 bit image data elements. This raster has one band whose pixels are packed together into individual bytes in a single byte array. This type of raster can be used with an IndexColorModel. This raster uses a MultiPixelPackedSampleModel.

Field Summary

Modifier and TypeField and Description
pack-priv int
bitMask

The bit mask for extracting the pixel.

pack-priv byte[]
data

The image data array.

pack-priv int
dataBitOffset

The data bit offset for each pixel.

private int
maxX

A cached copy of minX + width for use in bounds checks.

private int
maxY

A cached copy of minY + height for use in bounds checks.

pack-priv int
pixelBitStride

The bit stride of a pixel, equal to the total number of bits required to store a pixel.

pack-priv int
scanlineStride

Scanline stride of the image data contained in this Raster.

pack-priv int
shiftOffset

8 minus the pixel bit stride.

pack-priv int

Constructor Summary

AccessConstructor and Description
public
BytePackedRaster(SampleModel
The SampleModel that specifies the layout.
sampleModel
,
Point
The Point that specified the origin.
origin
)

Constructs a BytePackedRaster with the given SampleModel.

public
BytePackedRaster(SampleModel
The SampleModel that specifies the layout.
sampleModel
,
DataBufferByte
The DataBufferByte that contains the image data.
dataBuffer
,
Point
The Point that specifies the origin.
origin
)

Constructs a BytePackedRaster with the given SampleModel and DataBuffer.

public
BytePackedRaster(SampleModel
The SampleModel that specifies the layout.
sampleModel
,
DataBufferByte
The DataBufferByte that contains the image data.
dataBuffer
,
Rectangle
The Rectangle that specifies the image area.
aRegion
,
Point
The Point that specifies the origin.
origin
,
BytePackedRaster
The parent (if any) of this raster.
parent
)

Constructs a BytePackedRaster with the given SampleModel, DataBuffer, and parent.

Method Summary

Modifier and TypeMethod and Description
public Raster
createChild(int
X offset.
x
,
int
Y offset.
y
,
int
Width (in pixels) of the subraster.
width
,
int
Height (in pixels) of the subraster.
height
,
int
Translated X origin of the subraster.
x0
,
int
Translated Y origin of the subraster.
y0
,
int[]
Array of band indices.
bandList
)

Overrides java.awt.image.Raster.createChild.

Creates a subraster given a region of the raster.

public WritableRaster
createCompatibleWritableRaster(int w, int h)

Overrides java.awt.image.Raster.createCompatibleWritableRaster.

Creates a raster with the same layout but using a different width and height, and with new zeroed data arrays.

public WritableRaster
createCompatibleWritableRaster()

Overrides java.awt.image.Raster.createCompatibleWritableRaster.

Creates a raster with the same layout and the same width and height, and with new zeroed data arrays.

public WritableRaster
createWritableChild(int
X offset.
x
,
int
Y offset.
y
,
int
Width (in pixels) of the subraster.
width
,
int
Height (in pixels) of the subraster.
height
,
int
Translated X origin of the subraster.
x0
,
int
Translated Y origin of the subraster.
y0
,
int[]
Array of band indices.
bandList
)

Overrides java.awt.image.WritableRaster.createWritableChild.

Creates a Writable subRaster given a region of the Raster.

public byte[]

Returns:

Byte array with data elements.
getByteData
(int
The X coordinate of the upper left pixel location.
x
,
int
The Y coordinate of the upper left pixel location.
y
,
int
Width of the pixel rectangle.
w
,
int
Height of the pixel rectangle.
h
,
int
The band to return, is ignored.
band
,
byte[]
If non-null, data elements at the specified locations are returned in this array.
outData
)

Returns a byte array containing the specified data elements from the data array.

public byte[]

Returns:

Byte array with data elements.
getByteData
(int
The X coordinate of the upper left pixel location.
x
,
int
The Y coordinate of the upper left pixel location.
y
,
int
Width of the pixel rectangle.
w
,
int
Height of the pixel rectangle.
h
,
byte[]
If non-null, data elements at the specified locations are returned in this array.
outData
)

Returns a byte array containing the specified data elements from the data array.

public int
getDataBitOffset()

Returns the data bit offset for the Raster.

public Object

Returns:

An object reference to an array of type defined by getTransferType() with the request pixel data.
getDataElements
(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
Object
An object reference to an array of type defined by getTransferType() and length getNumDataElements(). If null an array of appropriate type and size will be allocated.
obj
)

Overrides java.awt.image.Raster.getDataElements.

Returns the data element at the specified location.

public Object

Returns:

An object reference to an array of type defined by getTransferType() with the requested pixel data.
getDataElements
(int
The X coordinate of the upper left pixel location.
x
,
int
The Y coordinate of the upper left pixel location.
y
,
int
Width of the pixel rectangle.
w
,
int
Height of the pixel rectangle.
h
,
Object
An object reference to an array of type defined by getTransferType() and length w*h*getNumDataElements(). If null, an array of appropriate type and size will be allocated.
outData
)

Overrides java.awt.image.Raster.getDataElements.

Returns the pixel data for the specified rectangle of pixels in a primitive array of type TransferType.

public byte[]
getDataStorage()

Returns a reference to the entire data array.

public int
getPixelBitStride()

Returns pixel bit stride -- the number of bits between two samples on the same scanline.

public Object

Returns:

An object reference to an array of type defined by getTransferType() with the request pixel data.
getPixelData
(int
The X coordinate of the upper left pixel location.
x
,
int
The Y coordinate of the upper left pixel location.
y
,
int
Width of the pixel rectangle.
w
,
int
Height of the pixel rectangle.
h
,
Object
An object reference to an array of type defined by getTransferType() and length w*h*getNumDataElements(). If null an array of appropriate type and size will be allocated.
obj
)

Returns an array of data elements from the specified rectangular region.

public int[]

Returns:

the samples for the specified rectangle of pixels.
getPixels
(int x, int y, int
Width of the pixel rectangle
w
,
int
Height of the pixel rectangle
h
,
int[]
An optionally pre-allocated int array
iArray
)

Overrides java.awt.image.Raster.getPixels.

Returns an int array containing all samples for a rectangle of pixels, one sample per array element.

public int
getScanlineStride()

Returns the scanline stride -- the number of data array elements between a given sample and the sample in the same column of the next row.

private static native void
public void
putByteData(int
The X coordinate of the upper left pixel location.
x
,
int
The Y coordinate of the upper left pixel location.
y
,
int
Width of the pixel rectangle.
w
,
int
Height of the pixel rectangle.
h
,
int
The band to set, is ignored.
band
,
byte[]
The data elements to be stored.
inData
)

Stores a byte array of data elements into the specified rectangular region.

public void
putByteData(int
The X coordinate of the upper left pixel location.
x
,
int
The Y coordinate of the upper left pixel location.
y
,
int
Width of the pixel rectangle.
w
,
int
Height of the pixel rectangle.
h
,
byte[]
The data elements to be stored.
inData
)

Stores a byte array of data elements into the specified rectangular region.

public void
setDataElements(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
Object
An object reference to an array of type defined by getTransferType() and length getNumDataElements() containing the pixel data to place at x,y.
obj
)

Overrides java.awt.image.WritableRaster.setDataElements.

Stores the data elements at the specified location.

public void
setDataElements(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
Raster
Raster of data to place at x,y location.
inRaster
)

Overrides java.awt.image.WritableRaster.setDataElements.

Stores the Raster data at the specified location.

private void
setDataElements(int
The absolute X coordinate of the destination pixel that will receive a copy of the upper-left pixel of the inRaster
dstX
,
int
The absolute Y coordinate of the destination pixel that will receive a copy of the upper-left pixel of the inRaster
dstY
,
int
The absolute X coordinate of the upper-left source pixel that will be copied into this Raster
srcX
,
int
The absolute Y coordinate of the upper-left source pixel that will be copied into this Raster
srcY
,
int
The number of pixels to store horizontally
width
,
int
The number of pixels to store vertically
height
,
BytePackedRaster
BytePackedRaster of data to place at x,y location.
inRaster
)

Stores the Raster data at the specified location.

public void
setDataElements(int
The X coordinate of the upper left pixel location.
x
,
int
The Y coordinate of the upper left pixel location.
y
,
int
Width of the pixel rectangle.
w
,
int
Height of the pixel rectangle.
h
,
Object
An object reference to an array of type defined by getTransferType() and length w*h*getNumDataElements() containing the pixel data to place between x,y and x+h, y+h.
obj
)

Overrides java.awt.image.WritableRaster.setDataElements.

Stores an array of data elements into the specified rectangular region.

public void
setPixels(int
The X coordinate of the upper left pixel location.
x
,
int
The Y coordinate of the upper left pixel location.
y
,
int
Width of the pixel rectangle.
w
,
int
Height of the pixel rectangle.
h
,
int[]
The input int pixel array.
iArray
)

Overrides java.awt.image.WritableRaster.setPixels.

Sets all samples for a rectangle of pixels from an int array containing one sample per array element.

public void
setRect(int
The X translation factor from src space to dst space of the copy.
dx
,
int
The Y translation factor from src space to dst space of the copy.
dy
,
Raster
The Raster from which to copy pixels.
srcRaster
)

Overrides java.awt.image.WritableRaster.setRect.

Copies pixels from Raster srcRaster to this WritableRaster.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private void

Returns:

String Error string, if the layout is incompatible with the data. Otherwise returns null.
verify
(boolean strictCheck)

Verify that the layout parameters are consistent with the data.

Inherited from sun.awt.image.SunWritableRaster:
makeTrackablemarkDirtymarkDirtymarkDirtymarkDirtysetDataStealersetTrackablestealDatastealDatastealDatastealTrackable

Field Detail

bitMaskback to summary
pack-priv int bitMask

The bit mask for extracting the pixel.

databack to summary
pack-priv byte[] data

The image data array.

dataBitOffsetback to summary
pack-priv int dataBitOffset

The data bit offset for each pixel.

maxXback to summary
private int maxX

A cached copy of minX + width for use in bounds checks.

maxYback to summary
private int maxY

A cached copy of minY + height for use in bounds checks.

pixelBitStrideback to summary
pack-priv int pixelBitStride

The bit stride of a pixel, equal to the total number of bits required to store a pixel.

scanlineStrideback to summary
pack-priv int scanlineStride

Scanline stride of the image data contained in this Raster.

shiftOffsetback to summary
pack-priv int shiftOffset

8 minus the pixel bit stride.

typeback to summary
pack-priv int type

Constructor Detail

BytePackedRasterback to summary
public BytePackedRaster(SampleModel sampleModel, Point origin)

Constructs a BytePackedRaster with the given SampleModel. The Raster's upper left corner is origin and it is the same size as the SampleModel. A DataBuffer large enough to describe the Raster is automatically created. SampleModel must be of type MultiPixelPackedSampleModel.

Parameters
sampleModel:SampleModel

The SampleModel that specifies the layout.

origin:Point

The Point that specified the origin.

BytePackedRasterback to summary
public BytePackedRaster(SampleModel sampleModel, DataBufferByte dataBuffer, Point origin)

Constructs a BytePackedRaster with the given SampleModel and DataBuffer. The Raster's upper left corner is origin and it is the same size as the SampleModel. The DataBuffer is not initialized and must be a DataBufferByte compatible with SampleModel. SampleModel must be of type MultiPixelPackedSampleModel.

Parameters
sampleModel:SampleModel

The SampleModel that specifies the layout.

dataBuffer:DataBufferByte

The DataBufferByte that contains the image data.

origin:Point

The Point that specifies the origin.

BytePackedRasterback to summary
public BytePackedRaster(SampleModel sampleModel, DataBufferByte dataBuffer, Rectangle aRegion, Point origin, BytePackedRaster parent)

Constructs a BytePackedRaster with the given SampleModel, DataBuffer, and parent. DataBuffer must be a DataBufferByte and SampleModel must be of type MultiPixelPackedSampleModel. When translated into the base Raster's coordinate system, aRegion must be contained by the base Raster. Origin is the coordinate in the new Raster's coordinate system of the origin of the base Raster. (The base Raster is the Raster's ancestor which has no parent.) Note that this constructor should generally be called by other constructors or create methods, it should not be used directly.

Parameters
sampleModel:SampleModel

The SampleModel that specifies the layout.

dataBuffer:DataBufferByte

The DataBufferByte that contains the image data.

aRegion:Rectangle

The Rectangle that specifies the image area.

origin:Point

The Point that specifies the origin.

parent:BytePackedRaster

The parent (if any) of this raster.

Exceptions
RasterFormatException:
if the parameters do not conform to requirements of this Raster type.

Method Detail

createChildback to summary
public Raster createChild(int x, int y, int width, int height, int x0, int y0, int[] bandList)

Overrides java.awt.image.Raster.createChild.

Creates a subraster given a region of the raster. The x and y coordinates specify the horizontal and vertical offsets from the upper-left corner of this raster to the upper-left corner of the subraster. Note that the subraster will reference the same DataBuffer as the parent raster, but using different offsets. The bandList is ignored.

Parameters
x:int

X offset.

y:int

Y offset.

width:int

Width (in pixels) of the subraster.

height:int

Height (in pixels) of the subraster.

x0:int

Translated X origin of the subraster.

y0:int

Translated Y origin of the subraster.

bandList:int[]

Array of band indices.

Exceptions
RasterFormatException:
if the specified bounding box is outside of the parent raster.
createCompatibleWritableRasterback to summary
public WritableRaster createCompatibleWritableRaster(int w, int h)

Overrides java.awt.image.Raster.createCompatibleWritableRaster.

Creates a raster with the same layout but using a different width and height, and with new zeroed data arrays.

createCompatibleWritableRasterback to summary
public WritableRaster createCompatibleWritableRaster()

Overrides java.awt.image.Raster.createCompatibleWritableRaster.

Creates a raster with the same layout and the same width and height, and with new zeroed data arrays.

createWritableChildback to summary
public WritableRaster createWritableChild(int x, int y, int width, int height, int x0, int y0, int[] bandList)

Overrides java.awt.image.WritableRaster.createWritableChild.

Creates a Writable subRaster given a region of the Raster. The x and y coordinates specify the horizontal and vertical offsets from the upper-left corner of this Raster to the upper-left corner of the subRaster. The bandList is ignored. A translation to the subRaster may also be specified. Note that the subRaster will reference the same DataBuffer as the parent Raster, but using different offsets.

Parameters
x:int

X offset.

y:int

Y offset.

width:int

Width (in pixels) of the subraster.

height:int

Height (in pixels) of the subraster.

x0:int

Translated X origin of the subraster.

y0:int

Translated Y origin of the subraster.

bandList:int[]

Array of band indices.

Exceptions
RasterFormatException:
if the specified bounding box is outside of the parent Raster.
getByteDataback to summary
public byte[] getByteData(int x, int y, int w, int h, int band, byte[] outData)

Returns a byte array containing the specified data elements from the data array. The band index will be ignored. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinates are out of bounds.

      byte[] byteData = getByteData(x, y, band, w, h, null);
      // To find a data element at location (x2, y2)
      byte element = byteData[(y2-y)*w + (x2-x)];
Parameters
x:int

The X coordinate of the upper left pixel location.

y:int

The Y coordinate of the upper left pixel location.

w:int

Width of the pixel rectangle.

h:int

Height of the pixel rectangle.

band:int

The band to return, is ignored.

outData:byte[]

If non-null, data elements at the specified locations are returned in this array.

Returns:byte[]

Byte array with data elements.

getByteDataback to summary
public byte[] getByteData(int x, int y, int w, int h, byte[] outData)

Returns a byte array containing the specified data elements from the data array. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinates are out of bounds.

      byte[] byteData = raster.getByteData(x, y, w, h, null);
      byte pixel;
      // To find a data element at location (x2, y2)
      pixel = byteData[((y2-y)*w + (x2-x))];
Parameters
x:int

The X coordinate of the upper left pixel location.

y:int

The Y coordinate of the upper left pixel location.

w:int

Width of the pixel rectangle.

h:int

Height of the pixel rectangle.

outData:byte[]

If non-null, data elements at the specified locations are returned in this array.

Returns:byte[]

Byte array with data elements.

getDataBitOffsetback to summary
public int getDataBitOffset()

Returns the data bit offset for the Raster. The data bit offset is the bit index into the data array element corresponding to the first sample of the first scanline.

getDataElementsback to summary
public Object getDataElements(int x, int y, Object obj)

Overrides java.awt.image.Raster.getDataElements.

Returns the data element at the specified location. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinate is out of bounds. A ClassCastException will be thrown if the input object is non null and references anything other than an array of transferType.

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

obj:Object

An object reference to an array of type defined by getTransferType() and length getNumDataElements(). If null an array of appropriate type and size will be allocated.

Returns:Object

An object reference to an array of type defined by getTransferType() with the request pixel data.

getDataElementsback to summary
public Object getDataElements(int x, int y, int w, int h, Object outData)

Overrides java.awt.image.Raster.getDataElements.

Returns the pixel data for the specified rectangle of pixels in a primitive array of type TransferType. For image data supported by the Java 2D API, this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT. Data may be returned in a packed format, thus increasing efficiency for data transfers. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. A ClassCastException will be thrown if the input object is non null and references anything other than an array of TransferType.

Parameters
x:int

The X coordinate of the upper left pixel location.

y:int

The Y coordinate of the upper left pixel location.

w:int

Width of the pixel rectangle.

h:int

Height of the pixel rectangle.

outData:Object

An object reference to an array of type defined by getTransferType() and length w*h*getNumDataElements(). If null, an array of appropriate type and size will be allocated.

Returns:Object

An object reference to an array of type defined by getTransferType() with the requested pixel data.

See Also
java.awt.image.SampleModel#getDataElements(int, int, int, int, Object, DataBuffer)
getDataStorageback to summary
public byte[] getDataStorage()

Returns a reference to the entire data array.

getPixelBitStrideback to summary
public int getPixelBitStride()

Returns pixel bit stride -- the number of bits between two samples on the same scanline.

getPixelDataback to summary
public Object getPixelData(int x, int y, int w, int h, Object obj)

Returns an array of data elements from the specified rectangular region. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinates are out of bounds. A ClassCastException will be thrown if the input object is non null and references anything other than an array of transferType.

      byte[] bandData = (byte[])raster.getPixelData(x, y, w, h, null);
      int pixel;
      // To find a data element at location (x2, y2)
      pixel = bandData[((y2-y)*w + (x2-x))];
Parameters
x:int

The X coordinate of the upper left pixel location.

y:int

The Y coordinate of the upper left pixel location.

w:int

Width of the pixel rectangle.

h:int

Height of the pixel rectangle.

obj:Object

An object reference to an array of type defined by getTransferType() and length w*h*getNumDataElements(). If null an array of appropriate type and size will be allocated.

Returns:Object

An object reference to an array of type defined by getTransferType() with the request pixel data.

getPixelsback to summary
public int[] getPixels(int x, int y, int w, int h, int[] iArray)

Overrides java.awt.image.Raster.getPixels.

Returns an int array containing all samples for a rectangle of pixels, one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters
w:int

Width of the pixel rectangle

h:int

Height of the pixel rectangle

iArray:int[]

An optionally pre-allocated int array

Returns:int[]

the samples for the specified rectangle of pixels.

getScanlineStrideback to summary
public int getScanlineStride()

Returns the scanline stride -- the number of data array elements between a given sample and the sample in the same column of the next row.

initIDsback to summary
private static native void initIDs()

Hides java.awt.image.Raster.initIDs.

putByteDataback to summary
public void putByteData(int x, int y, int w, int h, int band, byte[] inData)

Stores a byte array of data elements into the specified rectangular region. The band index will be ignored. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinates are out of bounds. The data elements in the data array are assumed to be packed. That is, a data element at location (x2, y2) would be found at:

     inData[((y2-y)*w + (x2-x))]
Parameters
x:int

The X coordinate of the upper left pixel location.

y:int

The Y coordinate of the upper left pixel location.

w:int

Width of the pixel rectangle.

h:int

Height of the pixel rectangle.

band:int

The band to set, is ignored.

inData:byte[]

The data elements to be stored.

putByteDataback to summary
public void putByteData(int x, int y, int w, int h, byte[] inData)

Stores a byte array of data elements into the specified rectangular region. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinates are out of bounds. The data elements in the data array are assumed to be packed. That is, a data element at location (x2, y2) would be found at:

     inData[((y2-y)*w + (x2-x))]
Parameters
x:int

The X coordinate of the upper left pixel location.

y:int

The Y coordinate of the upper left pixel location.

w:int

Width of the pixel rectangle.

h:int

Height of the pixel rectangle.

inData:byte[]

The data elements to be stored.

setDataElementsback to summary
public void setDataElements(int x, int y, Object obj)

Overrides java.awt.image.WritableRaster.setDataElements.

Stores the data elements at the specified location. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinate is out of bounds. A ClassCastException will be thrown if the input object is non null and references anything other than an array of transferType.

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

obj:Object

An object reference to an array of type defined by getTransferType() and length getNumDataElements() containing the pixel data to place at x,y.

setDataElementsback to summary
public void setDataElements(int x, int y, Raster inRaster)

Overrides java.awt.image.WritableRaster.setDataElements.

Stores the Raster data at the specified location. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinates are out of bounds.

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

inRaster:Raster

Raster of data to place at x,y location.

setDataElementsback to summary
private void setDataElements(int dstX, int dstY, int srcX, int srcY, int width, int height, BytePackedRaster inRaster)

Stores the Raster data at the specified location.

Parameters
dstX:int

The absolute X coordinate of the destination pixel that will receive a copy of the upper-left pixel of the inRaster

dstY:int

The absolute Y coordinate of the destination pixel that will receive a copy of the upper-left pixel of the inRaster

srcX:int

The absolute X coordinate of the upper-left source pixel that will be copied into this Raster

srcY:int

The absolute Y coordinate of the upper-left source pixel that will be copied into this Raster

width:int

The number of pixels to store horizontally

height:int

The number of pixels to store vertically

inRaster:BytePackedRaster

BytePackedRaster of data to place at x,y location.

setDataElementsback to summary
public void setDataElements(int x, int y, int w, int h, Object obj)

Overrides java.awt.image.WritableRaster.setDataElements.

Stores an array of data elements into the specified rectangular region. An ArrayIndexOutOfBounds exception will be thrown at runtime if the pixel coordinates are out of bounds. A ClassCastException will be thrown if the input object is non null and references anything other than an array of transferType. The data elements in the data array are assumed to be packed. That is, a data element at location (x2, y2) would be found at:

     inData[((y2-y)*w + (x2-x))]
Parameters
x:int

The X coordinate of the upper left pixel location.

y:int

The Y coordinate of the upper left pixel location.

w:int

Width of the pixel rectangle.

h:int

Height of the pixel rectangle.

obj:Object

An object reference to an array of type defined by getTransferType() and length w*h*getNumDataElements() containing the pixel data to place between x,y and x+h, y+h.

setPixelsback to summary
public void setPixels(int x, int y, int w, int h, int[] iArray)

Overrides java.awt.image.WritableRaster.setPixels.

Sets all samples for a rectangle of pixels from an int array containing one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters
x:int

The X coordinate of the upper left pixel location.

y:int

The Y coordinate of the upper left pixel location.

w:int

Width of the pixel rectangle.

h:int

Height of the pixel rectangle.

iArray:int[]

The input int pixel array.

setRectback to summary
public void setRect(int dx, int dy, Raster srcRaster)

Overrides java.awt.image.WritableRaster.setRect.

Copies pixels from Raster srcRaster to this WritableRaster. For each (x, y) address in srcRaster, the corresponding pixel is copied to address (x+dx, y+dy) in this WritableRaster, unless (x+dx, y+dy) falls outside the bounds of this raster. srcRaster must have the same number of bands as this WritableRaster. The copy is a simple copy of source samples to the corresponding destination samples. For details, see WritableRaster#setRect(Raster).

Parameters
dx:int

The X translation factor from src space to dst space of the copy.

dy:int

The Y translation factor from src space to dst space of the copy.

srcRaster:Raster

The Raster from which to copy pixels.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

verifyback to summary
private void verify(boolean strictCheck)

Verify that the layout parameters are consistent with the data. If strictCheck is false, this method will check for ArrayIndexOutOfBounds conditions. If strictCheck is true, this method will check for additional error conditions such as line wraparound (width of a line greater than the scanline stride).

Returns:void

String Error string, if the layout is incompatible with the data. Otherwise returns null.