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

public Class WritableRaster

extends Raster
Class Inheritance
Known Direct Subclasses
sun.awt.image.SunWritableRaster, sun.awt.image.WritableRasterNative
Imports
java.awt.Rectangle, .Point

This class extends Raster to provide pixel writing capabilities. Refer to the class comment for Raster for descriptions of how a Raster stores pixels.

The constructors of this class are protected. To instantiate a WritableRaster, use one of the createWritableRaster factory methods in the Raster class.

Field Summary

Inherited from java.awt.image.Raster:
dataBufferheightminXminYnumBandsnumDataElementsparentsampleModelsampleModelTranslateXsampleModelTranslateYwidth

Constructor Summary

AccessConstructor and Description
protected
WritableRaster(SampleModel
The SampleModel that specifies the layout.
sampleModel
,
Point
The Point that specifies the origin.
origin
)

Constructs a WritableRaster with the given SampleModel.

protected
WritableRaster(SampleModel
The SampleModel that specifies the layout.
sampleModel
,
DataBuffer
The DataBuffer that contains the image data.
dataBuffer
,
Point
The Point that specifies the origin.
origin
)

Constructs a WritableRaster with the given SampleModel and DataBuffer.

protected
WritableRaster(SampleModel
The SampleModel that specifies the layout.
sampleModel
,
DataBuffer
The DataBuffer that contains the image data.
dataBuffer
,
Rectangle
The Rectangle that specifies the image area.
aRegion
,
Point
The Point that specifies the translation from SampleModel to Raster coordinates.
sampleModelTranslate
,
WritableRaster
The parent (if any) of this raster.
parent
)

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

Method Summary

Modifier and TypeMethod and Description
public WritableRaster

Returns:

a WritableRaster sharing all or part of the DataBuffer of this WritableRaster.
createWritableChild
(int
X coordinate of the upper left corner in this WritableRaster's coordinates.
parentX
,
int
Y coordinate of the upper left corner in this WritableRaster's coordinates.
parentY
,
int
Width of the region starting at (parentX, parentY).
w
,
int
Height of the region starting at (parentX, parentY).
h
,
int
X coordinate of the upper left corner of the returned WritableRaster.
childMinX
,
int
Y coordinate of the upper left corner of the returned WritableRaster.
childMinY
,
int[]
Array of band indices, or null to use all bands.
bandList
)

Returns a new WritableRaster which shares all or part of this WritableRaster's DataBuffer.

public WritableRaster

Returns:

a WritableRaster the same as this one except for the specified location.
createWritableTranslatedChild
(int
X coord of the upper left corner of the new Raster.
childMinX
,
int
Y coord of the upper left corner of the new Raster.
childMinY
)

Create a WritableRaster with the same size, SampleModel and DataBuffer as this one, but with a different location.

public WritableRaster

Returns:

the parent of this WritableRaster, or null.
getWritableParent
()

Returns the parent WritableRaster (if any) of this WritableRaster, or else null.

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

Sets the data for a single pixel from a primitive array of type TransferType.

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

Sets the data for a rectangle of pixels from an input Raster.

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+w-1, y+h-1.
inData
)

Sets the data for a rectangle of pixels from a primitive array of type TransferType.

public void
setPixel(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
int[]
The input samples in a int array.
iArray
)

Sets a pixel in the DataBuffer using an int array of samples for input.

public void
setPixel(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
float[]
The input samples in a float array.
fArray
)

Sets a pixel in the DataBuffer using a float array of samples for input.

public void
setPixel(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
double[]
The input samples in a double array.
dArray
)

Sets a pixel in the DataBuffer using a double array of samples for input.

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
)

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

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
,
float[]
The input float pixel array.
fArray
)

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

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
,
double[]
The input double pixel array.
dArray
)

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

public void
setRect(Raster
The Raster from which to copy pixels.
srcRaster
)

Copies pixels from Raster srcRaster to this WritableRaster.

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
)

Copies pixels from Raster srcRaster to this WritableRaster.

public void
setSample(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
int
The band to set.
b
,
int
The input sample.
s
)

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

public void
setSample(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
int
The band to set.
b
,
float
The input sample as a float.
s
)

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

public void
setSample(int
The X coordinate of the pixel location.
x
,
int
The Y coordinate of the pixel location.
y
,
int
The band to set.
b
,
double
The input sample as a double.
s
)

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

public void
setSamples(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.
b
,
int[]
The input int sample array.
iArray
)

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

public void
setSamples(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.
b
,
float[]
The input float sample array.
fArray
)

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

public void
setSamples(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.
b
,
double[]
The input double sample array.
dArray
)

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

Inherited from java.awt.image.Raster:
createBandedRastercreateBandedRastercreateBandedRastercreateChildcreateCompatibleWritableRastercreateCompatibleWritableRastercreateCompatibleWritableRastercreateCompatibleWritableRastercreateInterleavedRastercreateInterleavedRastercreateInterleavedRastercreatePackedRastercreatePackedRastercreatePackedRastercreatePackedRastercreateRastercreateTranslatedChildcreateWritableRastercreateWritableRastergetBoundsgetDataBuffergetDataElementsgetDataElementsgetHeightgetMinXgetMinYgetNumBandsgetNumDataElementsgetParentgetPixelgetPixelgetPixelgetPixelsgetPixelsgetPixelsgetSamplegetSampleDoublegetSampleFloatgetSampleModelgetSampleModelTranslateXgetSampleModelTranslateYgetSamplesgetSamplesgetSamplesgetTransferTypegetWidth

Constructor Detail

WritableRasterback to summary
protected WritableRaster(SampleModel sampleModel, Point origin)

Constructs a WritableRaster with the given SampleModel. The WritableRaster's upper left corner is origin and it is the same size as the SampleModel. A DataBuffer large enough to describe the WritableRaster is automatically created.

Parameters
sampleModel:SampleModel

The SampleModel that specifies the layout.

origin:Point

The Point that specifies the origin.

Exceptions
RasterFormatException:
if computing either origin.x + sampleModel.getWidth() or origin.y + sampleModel.getHeight() results in integer overflow
WritableRasterback to summary
protected WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, Point origin)

Constructs a WritableRaster with the given SampleModel and DataBuffer. The WritableRaster's upper left corner is origin and it is the same size as the SampleModel. The DataBuffer is not initialized and must be compatible with SampleModel.

Parameters
sampleModel:SampleModel

The SampleModel that specifies the layout.

dataBuffer:DataBuffer

The DataBuffer that contains the image data.

origin:Point

The Point that specifies the origin.

Exceptions
RasterFormatException:
if computing either origin.x + sampleModel.getWidth() or origin.y + sampleModel.getHeight() results in integer overflow
WritableRasterback to summary
protected WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, WritableRaster parent)

Constructs a WritableRaster with the given SampleModel, DataBuffer, and parent. aRegion specifies the bounding rectangle of the new Raster. When translated into the base Raster's coordinate system, aRegion must be contained by the base Raster. (The base Raster is the Raster's ancestor which has no parent.) sampleModelTranslate specifies the sampleModelTranslateX and sampleModelTranslateY values of the new Raster. 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:DataBuffer

The DataBuffer that contains the image data.

aRegion:Rectangle

The Rectangle that specifies the image area.

sampleModelTranslate:Point

The Point that specifies the translation from SampleModel to Raster coordinates.

parent:WritableRaster

The parent (if any) of this raster.

Exceptions
RasterFormatException:
if aRegion has width or height less than or equal to zero, or computing either aRegion.x + aRegion.width or aRegion.y + aRegion.height results in integer overflow

Method Detail

createWritableChildback to summary
public WritableRaster createWritableChild(int parentX, int parentY, int w, int h, int childMinX, int childMinY, int[] bandList)

Returns a new WritableRaster which shares all or part of this WritableRaster's DataBuffer. The new WritableRaster will possess a reference to the current WritableRaster, accessible through its getParent() and getWritableParent() methods.

The parentX, parentY, width and height parameters form a Rectangle in this WritableRaster's coordinate space, indicating the area of pixels to be shared. An error will be thrown if this Rectangle is not contained with the bounds of the current WritableRaster.

The new WritableRaster may additionally be translated to a different coordinate system for the plane than that used by the current WritableRaster. The childMinX and childMinY parameters give the new (x, y) coordinate of the upper-left pixel of the returned WritableRaster; the coordinate (childMinX, childMinY) in the new WritableRaster will map to the same pixel as the coordinate (parentX, parentY) in the current WritableRaster.

The new WritableRaster may be defined to contain only a subset of the bands of the current WritableRaster, possibly reordered, by means of the bandList parameter. If bandList is null, it is taken to include all of the bands of the current WritableRaster in their current order.

To create a new WritableRaster that contains a subregion of the current WritableRaster, but shares its coordinate system and bands, this method should be called with childMinX equal to parentX, childMinY equal to parentY, and bandList equal to null.

Parameters
parentX:int

X coordinate of the upper left corner in this WritableRaster's coordinates.

parentY:int

Y coordinate of the upper left corner in this WritableRaster's coordinates.

w:int

Width of the region starting at (parentX, parentY).

h:int

Height of the region starting at (parentX, parentY).

childMinX:int

X coordinate of the upper left corner of the returned WritableRaster.

childMinY:int

Y coordinate of the upper left corner of the returned WritableRaster.

bandList:int[]

Array of band indices, or null to use all bands.

Returns:WritableRaster

a WritableRaster sharing all or part of the DataBuffer of this WritableRaster.

Exceptions
RasterFormatException:
  • if the subregion is outside of the raster bounds.
  • if w or h is less than or equal to zero, or computing any of parentX + w, parentY + h, childMinX + w, or childMinY + h results in integer overflow
createWritableTranslatedChildback to summary
public WritableRaster createWritableTranslatedChild(int childMinX, int childMinY)

Create a WritableRaster with the same size, SampleModel and DataBuffer as this one, but with a different location. The new WritableRaster will possess a reference to the current WritableRaster, accessible through its getParent() and getWritableParent() methods.

Parameters
childMinX:int

X coord of the upper left corner of the new Raster.

childMinY:int

Y coord of the upper left corner of the new Raster.

Returns:WritableRaster

a WritableRaster the same as this one except for the specified location.

Exceptions
RasterFormatException:
if computing either childMinX + this.getWidth() or childMinY + this.getHeight() results in integer overflow
getWritableParentback to summary
public WritableRaster getWritableParent()

Returns the parent WritableRaster (if any) of this WritableRaster, or else null.

Returns:WritableRaster

the parent of this WritableRaster, or null.

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

Sets the data for a single pixel from a primitive array of type TransferType. For image data supported by the Java 2D(tm) API, this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE. Data in the array may be in a packed format, thus increasing efficiency for data transfers. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if inData is not large enough to hold the pixel data. However, explicit bounds checking is not guaranteed. A ClassCastException will be thrown if the input object is not 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.

inData:Object

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

Exceptions
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds, or if inData is too small to hold the input.
See Also
java.awt.image.SampleModel#setDataElements(int, int, Object, DataBuffer)
setDataElementsback to summary
public void setDataElements(int x, int y, Raster inRaster)

Sets the data for a rectangle of pixels from an input Raster. The input Raster must be compatible with this WritableRaster in that they must have the same number of bands, corresponding bands must have the same number of bits per sample, the TransferTypes and NumDataElements must be the same, and the packing used by the getDataElements/setDataElements must be identical. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

inRaster:Raster

Raster containing data to place at x,y.

Exceptions
NullPointerException:
if inRaster is null.
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds.
setDataElementsback to summary
public void setDataElements(int x, int y, int w, int h, Object inData)

Sets the data for a rectangle of pixels from 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, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE. Data in the array may be in a packed format, thus increasing efficiency for data transfers. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if inData is not large enough to hold the pixel data. However, explicit bounds checking is not guaranteed. A ClassCastException will be thrown if the input object is not 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.

inData: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+w-1, y+h-1.

Exceptions
NullPointerException:
if inData is null.
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds, or if inData is too small to hold the input.
See Also
java.awt.image.SampleModel#setDataElements(int, int, int, int, Object, DataBuffer)
setPixelback to summary
public void setPixel(int x, int y, int[] iArray)

Sets a pixel in the DataBuffer using an int array of samples for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

iArray:int[]

The input samples in a int array.

Exceptions
NullPointerException:
if iArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds, or if iArray is too small to hold the input.
setPixelback to summary
public void setPixel(int x, int y, float[] fArray)

Sets a pixel in the DataBuffer using a float array of samples for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

fArray:float[]

The input samples in a float array.

Exceptions
NullPointerException:
if fArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds, or if fArray is too small to hold the input.
setPixelback to summary
public void setPixel(int x, int y, double[] dArray)

Sets a pixel in the DataBuffer using a double array of samples for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

dArray:double[]

The input samples in a double array.

Exceptions
NullPointerException:
if dArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds, or if dArray is too small to hold the input.
setPixelsback to summary
public void setPixels(int x, int y, int w, int h, int[] iArray)

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.

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.

Exceptions
NullPointerException:
if iArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds, or if iArray is too small to hold the input.
setPixelsback to summary
public void setPixels(int x, int y, int w, int h, float[] fArray)

Sets all samples for a rectangle of pixels from a float 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.

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.

fArray:float[]

The input float pixel array.

Exceptions
NullPointerException:
if fArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds, or if fArray is too small to hold the input.
setPixelsback to summary
public void setPixels(int x, int y, int w, int h, double[] dArray)

Sets all samples for a rectangle of pixels from a double 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.

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.

dArray:double[]

The input double pixel array.

Exceptions
NullPointerException:
if dArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates are not in bounds, or if dArray is too small to hold the input.
setRectback to summary
public void setRect(Raster srcRaster)

Copies pixels from Raster srcRaster to this WritableRaster. Each pixel in srcRaster is copied to the same x,y address in this raster, unless the address 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.

If all samples of both source and destination Rasters are of integral type and less than or equal to 32 bits in size, then calling this method is equivalent to executing the following code for all x,y addresses valid in both Rasters.

Raster srcRaster;
      WritableRaster dstRaster;
      for (int b = 0; b < srcRaster.getNumBands(); b++) {
          dstRaster.setSample(x, y, b, srcRaster.getSample(x, y, b));
      }
Thus, when copying an integral type source to an integral type destination, if the source sample size is greater than the destination sample size for a particular band, the high order bits of the source sample are truncated. If the source sample size is less than the destination size for a particular band, the high order bits of the destination are zero-extended or sign-extended depending on whether srcRaster's SampleModel treats the sample as a signed or unsigned quantity.

When copying a float or double source to an integral type destination, each source sample is cast to the destination type. When copying an integral type source to a float or double destination, the source is first converted to a 32-bit int (if necessary), using the above rules for integral types, and then the int is cast to float or double.

Parameters
srcRaster:Raster

The Raster from which to copy pixels.

Exceptions
NullPointerException:
if srcRaster is null.
setRectback to summary
public void setRect(int dx, int dy, Raster srcRaster)

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.

Exceptions
NullPointerException:
if srcRaster is null.
setSampleback to summary
public void setSample(int x, int y, int b, int s)

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.

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

b:int

The band to set.

s:int

The input sample.

Exceptions
ArrayIndexOutOfBoundsException:
if the coordinates or the band index are not in bounds.
setSampleback to summary
public void setSample(int x, int y, int b, float s)

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

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

b:int

The band to set.

s:float

The input sample as a float.

Exceptions
ArrayIndexOutOfBoundsException:
if the coordinates or the band index are not in bounds.
setSampleback to summary
public void setSample(int x, int y, int b, double s)

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

Parameters
x:int

The X coordinate of the pixel location.

y:int

The Y coordinate of the pixel location.

b:int

The band to set.

s:double

The input sample as a double.

Exceptions
ArrayIndexOutOfBoundsException:
if the coordinates or the band index are not in bounds.
setSamplesback to summary
public void setSamples(int x, int y, int w, int h, int b, int[] iArray)

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.

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.

b:int

The band to set.

iArray:int[]

The input int sample array.

Exceptions
NullPointerException:
if iArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates or the band index are not in bounds, or if iArray is too small to hold the input.
setSamplesback to summary
public void setSamples(int x, int y, int w, int h, int b, float[] fArray)

Sets the samples in the specified band for the specified rectangle of pixels from a float 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.

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.

b:int

The band to set.

fArray:float[]

The input float sample array.

Exceptions
NullPointerException:
if fArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates or the band index are not in bounds, or if fArray is too small to hold the input.
setSamplesback to summary
public void setSamples(int x, int y, int w, int h, int b, double[] dArray)

Sets the samples in the specified band for the specified rectangle of pixels from a double 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.

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.

b:int

The band to set.

dArray:double[]

The input double sample array.

Exceptions
NullPointerException:
if dArray is null.
ArrayIndexOutOfBoundsException:
if the coordinates or the band index are not in bounds, or if dArray is too small to hold the input.