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

public Class ByteInterleavedRaster

extends ByteComponentRaster
Class Inheritance
Imports
java.awt.image.Raster, .WritableRaster, .RasterFormatException, .SampleModel, .ComponentSampleModel, .PixelInterleavedSampleModel, .SinglePixelPackedSampleModel, .DataBufferByte, java.awt.Rectangle, .Point

This class defines a Raster with pixels consisting of one or more 8-bit data elements stored in close proximity to each other in a single byte array.

The bit precision per data element is that of the data type (that is, the bit precision for this Raster is 8). There is only one pixel stride and one scanline stride for all bands. This type of Raster can be used with a ComponentColorModel if there are multiple bands, or an IndexColorModel if there is only one band.

Field Summary

Modifier and TypeField and Description
pack-priv int[]
bitMasks

If packed == true, the SampleModel's bit masks.

pack-priv int[]
bitOffsets

If packed == true, the SampleModel's bit offsets.

pack-priv int
dbOffset

The DataBuffer offset, minus sampleModelTranslateX*pixelStride, minus sampleModelTranslateY*scanlineStride, used to calculate pixel offsets.

pack-priv int
pack-priv boolean
inOrder

True if the data offsets range from 0 to (pixelStride - 1) in order.

private int
maxX

Hides sun.awt.image.ByteComponentRaster.maxX.

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

Hides sun.awt.image.ByteComponentRaster.maxY.

A cached copy of minY + height for use in bounds checks.
pack-priv boolean
packed

True if a SinglePixelPackedSampleModel is being used.

Inherited from sun.awt.image.ByteComponentRaster:
bandOffsetdatadataOffsetspixelStridescanlineStridetype

Constructor Summary

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

Constructs a ByteInterleavedRaster with the given SampleModel.

public
ByteInterleavedRaster(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 ByteInterleavedRaster with the given SampleModel and DataBuffer.

public
ByteInterleavedRaster(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
,
ByteInterleavedRaster
The parent (if any) of this raster.
parent
)

Constructs a ByteInterleavedRaster 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 sun.awt.image.ByteComponentRaster.createChild.

Creates a subraster given a region of the raster.

public WritableRaster
createCompatibleWritableRaster(int w, int h)

Overrides sun.awt.image.ByteComponentRaster.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 sun.awt.image.ByteComponentRaster.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 sun.awt.image.ByteComponentRaster.createWritableChild.

Creates a Writable subRaster given a region of the Raster.

public byte[]

Returns:

Data array with data elements for all bands.
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.
band
,
byte[]
If non-null, data elements for all bands at the specified location are returned in this array.
outData
)

Overrides sun.awt.image.ByteComponentRaster.getByteData.

Returns a byte array of data elements from the specified rectangular region for the specified band.

public byte[]

Returns:

Data array with data elements for all bands.
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 for all bands at the specified location are returned in this array.
outData
)

Overrides sun.awt.image.ByteComponentRaster.getByteData.

Returns a byte array of data elements from the specified rectangular region.

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 sun.awt.image.ByteComponentRaster.getDataElements.

Returns the data elements for all bands at the specified location.

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 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
)

Overrides sun.awt.image.ByteComponentRaster.getDataElements.

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

public int
getDataOffset(int
The band whose offset is returned.
band
)

Overrides sun.awt.image.ByteComponentRaster.getDataOffset.

Returns the data offset for the specified band.

public int[]
getDataOffsets()

Overrides sun.awt.image.ByteComponentRaster.getDataOffsets.

Returns a copy of the data offsets array.

public byte[]
getDataStorage()

Overrides sun.awt.image.ByteComponentRaster.getDataStorage.

Returns a reference to the data array.

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.

public int
getPixelStride()

Overrides sun.awt.image.ByteComponentRaster.getPixelStride.

Returns pixel stride -- the number of data array elements between two samples for the same band on the same scanline.

public int
getSample(int x, int y, int b)

Overrides java.awt.image.Raster.getSample.

Returns the sample in a specified band for the pixel located at (x,y) as an int.

public int[]
getSamples(int x, int y, int w, int h, int b, int[] iArray)

Overrides java.awt.image.Raster.getSamples.

Returns the samples for a specified band for the specified rectangle of pixels in an int array, one sample per array element.

public int
getScanlineStride()

Overrides sun.awt.image.ByteComponentRaster.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 in the same band.

private boolean
isInterleaved(ComponentSampleModel sm)

Analyzes a ComponentSampleModel to determine if it can function as a PixelInterleavedSampleModel.

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.
band
,
byte[]
The data elements to be stored.
inData
)

Overrides sun.awt.image.ByteComponentRaster.putByteData.

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

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
)

Overrides sun.awt.image.ByteComponentRaster.putByteData.

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 sun.awt.image.ByteComponentRaster.setDataElements.

Stores the data elements for all bands 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 sun.awt.image.ByteComponentRaster.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
,
Raster
Raster 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 sun.awt.image.ByteComponentRaster.setDataElements.

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

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.

public void
setRect(int dx, int dy, Raster srcRaster)

Overrides java.awt.image.WritableRaster.setRect.

Copies pixels from Raster srcRaster to this WritableRaster.

public void
setSample(int x, int y, int b, int s)

Overrides java.awt.image.WritableRaster.setSample.

Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using an int for input.

public void
setSamples(int x, int y, int w, int h, int b, int[] iArray)

Overrides java.awt.image.WritableRaster.setSamples.

Sets the samples in the specified band for the specified rectangle of pixels from an int array containing one sample per array element.

public String
toString()

Overrides sun.awt.image.ByteComponentRaster.toString.

Returns a string representation of the object.

Inherited from sun.awt.image.ByteComponentRaster:
verify

Field Detail

bitMasksback to summary
pack-priv int[] bitMasks

If packed == true, the SampleModel's bit masks.

bitOffsetsback to summary
pack-priv int[] bitOffsets

If packed == true, the SampleModel's bit offsets.

dbOffsetback to summary
pack-priv int dbOffset

The DataBuffer offset, minus sampleModelTranslateX*pixelStride, minus sampleModelTranslateY*scanlineStride, used to calculate pixel offsets.

dbOffsetPackedback to summary
pack-priv int dbOffsetPacked
inOrderback to summary
pack-priv boolean inOrder

True if the data offsets range from 0 to (pixelStride - 1) in order.

maxXback to summary
private int maxX

Hides sun.awt.image.ByteComponentRaster.maxX.

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

maxYback to summary
private int maxY

Hides sun.awt.image.ByteComponentRaster.maxY.

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

packedback to summary
pack-priv boolean packed

True if a SinglePixelPackedSampleModel is being used.

Constructor Detail

ByteInterleavedRasterback to summary
public ByteInterleavedRaster(SampleModel sampleModel, Point origin)

Constructs a ByteInterleavedRaster 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 SinglePixelPackedSampleModel or InterleavedSampleModel.

Parameters
sampleModel:SampleModel

The SampleModel that specifies the layout.

origin:Point

The Point that specified the origin.

ByteInterleavedRasterback to summary
public ByteInterleavedRaster(SampleModel sampleModel, DataBufferByte dataBuffer, Point origin)

Constructs a ByteInterleavedRaster 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 SinglePixelPackedSampleModel or InterleavedSampleModel.

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.

ByteInterleavedRasterback to summary
public ByteInterleavedRaster(SampleModel sampleModel, DataBufferByte dataBuffer, Rectangle aRegion, Point origin, ByteInterleavedRaster parent)

Constructs a ByteInterleavedRaster with the given SampleModel, DataBuffer, and parent. DataBuffer must be a DataBufferByte and SampleModel must be of type SinglePixelPackedSampleModel or InterleavedSampleModel. 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:ByteInterleavedRaster

The parent (if any) of this raster.

Method Detail

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

Overrides sun.awt.image.ByteComponentRaster.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. A subset of the bands of the parent Raster may be specified. If this is null, then all the bands are present in the subRaster. 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.
createCompatibleWritableRasterback to summary
public WritableRaster createCompatibleWritableRaster(int w, int h)

Overrides sun.awt.image.ByteComponentRaster.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 sun.awt.image.ByteComponentRaster.createCompatibleWritableRaster.

Creates a Raster with the same layout and the same width and height, and with new zeroed data arrays. If the Raster is a subRaster, this will call createCompatibleRaster(width, height).

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

Overrides sun.awt.image.ByteComponentRaster.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. A subset of the bands of the parent Raster may be specified. If this is null, then all the bands are present in the subRaster. 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)

Overrides sun.awt.image.ByteComponentRaster.getByteData.

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

      byte[] bandData = raster.getByteData(x, y, w, h, null);
      // To find the data element at location (x2, y2)
      byte bandElement = 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.

band:int

The band to return.

outData:byte[]

If non-null, data elements for all bands at the specified location are returned in this array.

Returns:byte[]

Data array with data elements for all bands.

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

Overrides sun.awt.image.ByteComponentRaster.getByteData.

Returns a byte 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.

      byte[] bandData = raster.getByteData(x, y, w, h, null);
      int numDataElements = raster.getnumDataElements();
      byte[] pixel = new byte[numDataElements];
      // To find a data element at location (x2, y2)
      System.arraycopy(bandData, ((y2-y)*w + (x2-x))*numDataElements,
                       pixel, 0, numDataElements);
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 for all bands at the specified location are returned in this array.

Returns:byte[]

Data array with data elements for all bands.

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

Overrides sun.awt.image.ByteComponentRaster.getDataElements.

Returns the data elements for all bands 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 obj)

Overrides sun.awt.image.ByteComponentRaster.getDataElements.

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.getDataElements(x, y, w, h, null);
      int numDataElements = raster.getNumDataElements();
      byte[] pixel = new byte[numDataElements];
      // To find a data element at location (x2, y2)
      System.arraycopy(bandData, ((y2-y)*w + (x2-x))*numDataElements,
                       pixel, 0, numDataElements);
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.

getDataOffsetback to summary
public int getDataOffset(int band)

Overrides sun.awt.image.ByteComponentRaster.getDataOffset.

Returns the data offset for the specified band. The data offset is the index into the data array in which the first sample of the first scanline is stored.

Parameters
band:int

The band whose offset is returned.

getDataOffsetsback to summary
public int[] getDataOffsets()

Overrides sun.awt.image.ByteComponentRaster.getDataOffsets.

Returns a copy of the data offsets array. For each band the data offset is the index into the band's data array, of the first sample of the band.

getDataStorageback to summary
public byte[] getDataStorage()

Overrides sun.awt.image.ByteComponentRaster.getDataStorage.

Returns a reference to the data array.

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

Overrides java.awt.image.Raster.getPixels.

Doc from 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. However, explicit bounds checking is not guaranteed.

getPixelStrideback to summary
public int getPixelStride()

Overrides sun.awt.image.ByteComponentRaster.getPixelStride.

Returns pixel stride -- the number of data array elements between two samples for the same band on the same scanline.

getSampleback to summary
public int getSample(int x, int y, int b)

Overrides java.awt.image.Raster.getSample.

Doc from java.awt.image.Raster.getSample.

Returns the sample in a specified band for the pixel located at (x,y) as an int. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

getSamplesback to summary
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray)

Overrides java.awt.image.Raster.getSamples.

Doc from java.awt.image.Raster.getSamples.

Returns the samples for a specified band for the specified rectangle of pixels in an int array, one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

getScanlineStrideback to summary
public int getScanlineStride()

Overrides sun.awt.image.ByteComponentRaster.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 in the same band.

isInterleavedback to summary
private boolean isInterleaved(ComponentSampleModel sm)

Analyzes a ComponentSampleModel to determine if it can function as a PixelInterleavedSampleModel. In order to do so, it must use only bank 0 of its DataBuffer, and the data offsets must span a range of less than pixelStride.

These properties are trivially true for a 1-banded SampleModel.

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

Overrides sun.awt.image.ByteComponentRaster.putByteData.

Stores a byte array of data elements into the specified rectangular region for the specified band. 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)) + n]
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.

inData:byte[]

The data elements to be stored.

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

Overrides sun.awt.image.ByteComponentRaster.putByteData.

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 for the nth band at location (x2, y2) would be found at:

     inData[((y2-y)*w + (x2-x))*numDataElements + n]
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 sun.awt.image.ByteComponentRaster.setDataElements.

Stores the data elements for all bands 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 sun.awt.image.ByteComponentRaster.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, Raster 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:Raster

Raster 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 sun.awt.image.ByteComponentRaster.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 for the nth band at location (x2, y2) would be found at:

     inData[((y2-y)*w + (x2-x))*numDataElements + n]
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.

Doc from 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. However, explicit bounds checking is not guaranteed.

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

Overrides java.awt.image.WritableRaster.setRect.

Doc from 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).

setSampleback to summary
public void setSample(int x, int y, int b, int s)

Overrides java.awt.image.WritableRaster.setSample.

Doc from java.awt.image.WritableRaster.setSample.

Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using an int for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

setSamplesback to summary
public void setSamples(int x, int y, int w, int h, int b, int[] iArray)

Overrides java.awt.image.WritableRaster.setSamples.

Doc from java.awt.image.WritableRaster.setSamples.

Sets the samples in the specified band for the specified 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. However, explicit bounds checking is not guaranteed.

toStringback to summary
public String toString()

Overrides sun.awt.image.ByteComponentRaster.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.