java.awt.image
Class WritableRaster

java.lang.Object
  extended by java.awt.image.Raster
      extended by java.awt.image.WritableRaster

public class WritableRaster
extends Raster

A raster with methods to support updating pixel values.


Field Summary
 
Fields inherited from class java.awt.image.Raster
dataBuffer, height, minX, minY, numBands, numDataElements, parent, sampleModel, sampleModelTranslateX, sampleModelTranslateY, width
 
Constructor Summary
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.
protected WritableRaster(SampleModel sampleModel, Point origin)
          Creates a new WritableRaster.
 
Method Summary
 Raster createChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)
           
 WritableRaster createWritableChild(int parentX, int parentY, int w, int h, int childMinX, int childMinY, int[] bandList)
           
 WritableRaster createWritableTranslatedChild(int childMinX, int childMinY)
           
 WritableRaster getWritableParent()
          Returns the raster's parent, cast as a WritableRaster.
 void setDataElements(int x, int y, int w, int h, Object inData)
           
 void setDataElements(int x, int y, Object inData)
           
 void setDataElements(int x, int y, Raster inRaster)
           
 void setPixel(int x, int y, double[] dArray)
          Sets the samples for the pixel at (x, y) in the raster to the specified values.
 void setPixel(int x, int y, float[] fArray)
          Sets the samples for the pixel at (x, y) in the raster to the specified values.
 void setPixel(int x, int y, int[] iArray)
          Sets the samples for the pixel at (x, y) in the raster to the specified values.
 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.
 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.
 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.
 void setRect(int dx, int dy, Raster srcRaster)
           
 void setRect(Raster srcRaster)
           
 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.
 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.
 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.
 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.
 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.
 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.
 
Methods inherited from class java.awt.image.Raster
createBandedRaster, createBandedRaster, createBandedRaster, createCompatibleWritableRaster, createCompatibleWritableRaster, createCompatibleWritableRaster, createCompatibleWritableRaster, createInterleavedRaster, createInterleavedRaster, createInterleavedRaster, createPackedRaster, createPackedRaster, createPackedRaster, createPackedRaster, createRaster, createTranslatedChild, createWritableRaster, createWritableRaster, getBounds, getDataBuffer, getDataElements, getDataElements, getHeight, getMinX, getMinY, getNumBands, getNumDataElements, getParent, getPixel, getPixel, getPixel, getPixels, getPixels, getPixels, getSample, getSampleDouble, getSampleFloat, getSampleModel, getSampleModelTranslateX, getSampleModelTranslateY, getSamples, getSamples, getSamples, getTransferType, getWidth, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

getWritableParent

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

Returns:
The raster's parent.

createWritableTranslatedChild

public WritableRaster createWritableTranslatedChild(int childMinX,
                                                    int childMinY)
Parameters:
childMinX -
childMinY -
Returns:

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:

createChild

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

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)

setRect

public void setRect(Raster srcRaster)
Parameters:
srcRaster -

setRect

public void setRect(int dx,
                    int dy,
                    Raster srcRaster)
Parameters:
dx -
dy -
srcRaster -

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.

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.