java.awt.image

Class WritableRaster

public class WritableRaster extends Raster

A raster with methods to support updating pixel values.
Constructor Summary
protected WritableRaster(SampleModel sampleModel, Point origin)
Creates a new WritableRaster.
protected WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, Point origin)
Creates a new WritableRaster instance.
protected WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, WritableRaster parent)
Creates a new WritableRaster instance.
Method Summary
RastercreateChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)
WritableRastercreateWritableChild(int parentX, int parentY, int w, int h, int childMinX, int childMinY, int[] bandList)
WritableRastercreateWritableTranslatedChild(int childMinX, int childMinY)
WritableRastergetWritableParent()
Returns the raster's parent, cast as a {@link WritableRaster}.
voidsetDataElements(int x, int y, Object inData)
voidsetDataElements(int x, int y, Raster inRaster)
voidsetDataElements(int x, int y, int w, int h, Object inData)
voidsetPixel(int x, int y, int[] iArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
voidsetPixel(int x, int y, float[] fArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
voidsetPixel(int x, int y, double[] dArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
voidsetPixels(int x, int y, int w, int h, int[] iArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster.
voidsetPixels(int x, int y, int w, int h, float[] fArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster.
voidsetPixels(int x, int y, int w, int h, double[] dArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster.
voidsetRect(Raster srcRaster)
voidsetRect(int dx, int dy, Raster srcRaster)
voidsetSample(int x, int y, int b, int s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
voidsetSample(int x, int y, int b, float s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
voidsetSample(int x, int y, int b, double s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
voidsetSamples(int x, int y, int w, int h, int b, int[] iArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.
voidsetSamples(int x, int y, int w, int h, int b, float[] fArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.
voidsetSamples(int x, int y, int w, int h, int b, double[] dArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.

Constructor Detail

WritableRaster

protected WritableRaster(SampleModel sampleModel, Point origin)
Creates a new WritableRaster.

Parameters: sampleModel the sample model. origin the origin.

WritableRaster

protected WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, Point origin)
Creates a new WritableRaster instance.

Parameters: sampleModel the sample model. dataBuffer the data buffer. origin the origin.

WritableRaster

protected WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, WritableRaster parent)
Creates a new WritableRaster instance.

Parameters: sampleModel the sample model. dataBuffer the data buffer. aRegion the raster's bounds. sampleModelTranslate the translation. parent the parent.

Method Detail

createChild

public Raster createChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)

createWritableChild

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

Parameters: parentX parentY w h childMinX childMinY bandList

Returns:

createWritableTranslatedChild

public WritableRaster createWritableTranslatedChild(int childMinX, int childMinY)

Parameters: childMinX childMinY

Returns:

getWritableParent

public WritableRaster getWritableParent()
Returns the raster's parent, cast as a {@link WritableRaster}.

Returns: The raster's parent.

setDataElements

public void setDataElements(int x, int y, Object inData)

setDataElements

public void setDataElements(int x, int y, Raster inRaster)

setDataElements

public void setDataElements(int x, int y, int w, int h, Object inData)

setPixel

public void setPixel(int x, int y, int[] iArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.

Parameters: x the x-coordinate of the pixel. y the y-coordinate of the pixel. iArray the sample values (null not permitted).

Throws: NullPointerException if iArray is null.

setPixel

public void setPixel(int x, int y, float[] fArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.

Parameters: x the x-coordinate of the pixel. y the y-coordinate of the pixel. fArray the sample values (null not permitted).

Throws: NullPointerException if fArray is null.

setPixel

public void setPixel(int x, int y, double[] dArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.

Parameters: x the x-coordinate of the pixel. y the y-coordinate of the pixel. dArray the sample values (null not permitted).

Throws: NullPointerException if dArray is null.

setPixels

public void setPixels(int x, int y, int w, int h, int[] iArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster. The array is ordered by pixels (that is, all the samples for the first pixel are grouped together, followed by all the samples for the second pixel, and so on).

Parameters: x the x-coordinate of the top-left pixel. y the y-coordinate of the top-left pixel. w the width of the region of pixels. h the height of the region of pixels. iArray the pixel sample values (null not permitted).

Throws: NullPointerException if iArray is null.

setPixels

public void setPixels(int x, int y, int w, int h, float[] fArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster. The array is ordered by pixels (that is, all the samples for the first pixel are grouped together, followed by all the samples for the second pixel, and so on).

Parameters: x the x-coordinate of the top-left pixel. y the y-coordinate of the top-left pixel. w the width of the region of pixels. h the height of the region of pixels. fArray the pixel sample values (null not permitted).

Throws: NullPointerException if fArray is null.

setPixels

public void setPixels(int x, int y, int w, int h, double[] dArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster. The array is ordered by pixels (that is, all the samples for the first pixel are grouped together, followed by all the samples for the second pixel, and so on).

Parameters: x the x-coordinate of the top-left pixel. y the y-coordinate of the top-left pixel. w the width of the region of pixels. h the height of the region of pixels. dArray the pixel sample values (null not permitted).

Throws: NullPointerException if dArray is null.

setRect

public void setRect(Raster srcRaster)

Parameters: srcRaster

setRect

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

Parameters: dx dy srcRaster

setSample

public void setSample(int x, int y, int b, int s)
Sets the sample value for a band for the pixel at (x, y) in the raster.

Parameters: x the x-coordinate of the pixel. y the y-coordinate of the pixel. b the band (in the range 0 to getNumBands() - 1). s the sample value.

setSample

public void setSample(int x, int y, int b, float s)
Sets the sample value for a band for the pixel at (x, y) in the raster.

Parameters: x the x-coordinate of the pixel. y the y-coordinate of the pixel. b the band (in the range 0 to getNumBands() - 1). s the sample value.

setSample

public void setSample(int x, int y, int b, double s)
Sets the sample value for a band for the pixel at (x, y) in the raster.

Parameters: x the x-coordinate of the pixel. y the y-coordinate of the pixel. b the band (in the range 0 to getNumBands() - 1). s the sample value.

setSamples

public void setSamples(int x, int y, int w, int h, int b, int[] iArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.

Parameters: x the x-coordinate of the top-left pixel. y the y-coordinate of the top-left pixel. w the width of the region of pixels. h the height of the region of pixels. b the band (in the range 0 to getNumBands() - 1). iArray the sample values (null not permitted).

Throws: NullPointerException if iArray is null.

setSamples

public void setSamples(int x, int y, int w, int h, int b, float[] fArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.

Parameters: x the x-coordinate of the top-left pixel. y the y-coordinate of the top-left pixel. w the width of the region of pixels. h the height of the region of pixels. b the band (in the range 0 to getNumBands() - 1). fArray the sample values (null not permitted).

Throws: NullPointerException if fArray is null.

setSamples

public void setSamples(int x, int y, int w, int h, int b, double[] dArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.

Parameters: x the x-coordinate of the top-left pixel. y the y-coordinate of the top-left pixel. w the width of the region of pixels. h the height of the region of pixels. b the band (in the range 0 to getNumBands() - 1). dArray the sample values (null not permitted).

Throws: NullPointerException if dArray is null.