java.awt.image
Class WritableRaster

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.image.Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster 
      extended by java.awt.image.WritableRaster

public class WritableRaster
extends Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster

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
 
Fields inherited from class java.awt.image.Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster
dataBuffer sample code for java.awt.image.Raster.dataBuffer definition code for java.awt.image.Raster.dataBuffer , height sample code for java.awt.image.Raster.height definition code for java.awt.image.Raster.height , minX sample code for java.awt.image.Raster.minX definition code for java.awt.image.Raster.minX , minY sample code for java.awt.image.Raster.minY definition code for java.awt.image.Raster.minY , numBands sample code for java.awt.image.Raster.numBands definition code for java.awt.image.Raster.numBands , numDataElements sample code for java.awt.image.Raster.numDataElements definition code for java.awt.image.Raster.numDataElements , parent sample code for java.awt.image.Raster.parent definition code for java.awt.image.Raster.parent , sampleModel sample code for java.awt.image.Raster.sampleModel definition code for java.awt.image.Raster.sampleModel , sampleModelTranslateX sample code for java.awt.image.Raster.sampleModelTranslateX definition code for java.awt.image.Raster.sampleModelTranslateX , sampleModelTranslateY sample code for java.awt.image.Raster.sampleModelTranslateY definition code for java.awt.image.Raster.sampleModelTranslateY , width sample code for java.awt.image.Raster.width definition code for java.awt.image.Raster.width
 
Constructor Summary
protected WritableRaster sample code for java.awt.image.WritableRaster.WritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Point) definition code for java.awt.image.WritableRaster.WritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Point) (SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  dataBuffer, Point sample code for java.awt.Point definition code for java.awt.Point  origin)
          Constructs a WritableRaster with the given SampleModel and DataBuffer.
protected WritableRaster sample code for java.awt.image.WritableRaster.WritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Rectangle, java.awt.Point, java.awt.image.WritableRaster) definition code for java.awt.image.WritableRaster.WritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Rectangle, java.awt.Point, java.awt.image.WritableRaster) (SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  dataBuffer, Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  aRegion, Point sample code for java.awt.Point definition code for java.awt.Point  sampleModelTranslate, WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  parent)
          Constructs a WritableRaster with the given SampleModel, DataBuffer, and parent.
protected WritableRaster sample code for java.awt.image.WritableRaster.WritableRaster(java.awt.image.SampleModel, java.awt.Point) definition code for java.awt.image.WritableRaster.WritableRaster(java.awt.image.SampleModel, java.awt.Point) (SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel, Point sample code for java.awt.Point definition code for java.awt.Point  origin)
          Constructs a WritableRaster with the given SampleModel.
 
Method Summary
 WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster createWritableChild sample code for java.awt.image.WritableRaster.createWritableChild(int, int, int, int, int, int, int[]) definition code for java.awt.image.WritableRaster.createWritableChild(int, int, int, int, int, int, int[]) (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.
 WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster createWritableTranslatedChild sample code for java.awt.image.WritableRaster.createWritableTranslatedChild(int, int) definition code for java.awt.image.WritableRaster.createWritableTranslatedChild(int, int) (int childMinX, int childMinY)
          Create a WritableRaster with the same size, SampleModel and DataBuffer as this one, but with a different location.
 WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster getWritableParent sample code for java.awt.image.WritableRaster.getWritableParent() definition code for java.awt.image.WritableRaster.getWritableParent() ()
          Returns the parent WritableRaster (if any) of this WritableRaster, or else null.
 void setDataElements sample code for java.awt.image.WritableRaster.setDataElements(int, int, int, int, java.lang.Object) definition code for java.awt.image.WritableRaster.setDataElements(int, int, int, int, java.lang.Object) (int x, int y, int w, int h, Object sample code for java.lang.Object definition code for java.lang.Object  inData)
          Sets the data for a rectangle of pixels from a primitive array of type TransferType.
 void setDataElements sample code for java.awt.image.WritableRaster.setDataElements(int, int, java.lang.Object) definition code for java.awt.image.WritableRaster.setDataElements(int, int, java.lang.Object) (int x, int y, Object sample code for java.lang.Object definition code for java.lang.Object  inData)
          Sets the data for a single pixel from a primitive array of type TransferType.
 void setDataElements sample code for java.awt.image.WritableRaster.setDataElements(int, int, java.awt.image.Raster) definition code for java.awt.image.WritableRaster.setDataElements(int, int, java.awt.image.Raster) (int x, int y, Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  inRaster)
          Sets the data for a rectangle of pixels from an input Raster.
 void setPixel sample code for java.awt.image.WritableRaster.setPixel(int, int, double[]) definition code for java.awt.image.WritableRaster.setPixel(int, int, double[]) (int x, int y, double[] dArray)
          Sets a pixel in the DataBuffer using a double array of samples for input.
 void setPixel sample code for java.awt.image.WritableRaster.setPixel(int, int, float[]) definition code for java.awt.image.WritableRaster.setPixel(int, int, float[]) (int x, int y, float[] fArray)
          Sets a pixel in the DataBuffer using a float array of samples for input.
 void setPixel sample code for java.awt.image.WritableRaster.setPixel(int, int, int[]) definition code for java.awt.image.WritableRaster.setPixel(int, int, int[]) (int x, int y, int[] iArray)
          Sets a pixel in the DataBuffer using an int array of samples for input.
 void setPixels sample code for java.awt.image.WritableRaster.setPixels(int, int, int, int, double[]) definition code for java.awt.image.WritableRaster.setPixels(int, int, int, int, double[]) (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.
 void setPixels sample code for java.awt.image.WritableRaster.setPixels(int, int, int, int, float[]) definition code for java.awt.image.WritableRaster.setPixels(int, int, int, int, float[]) (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.
 void setPixels sample code for java.awt.image.WritableRaster.setPixels(int, int, int, int, int[]) definition code for java.awt.image.WritableRaster.setPixels(int, int, int, int, int[]) (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.
 void setRect sample code for java.awt.image.WritableRaster.setRect(int, int, java.awt.image.Raster) definition code for java.awt.image.WritableRaster.setRect(int, int, java.awt.image.Raster) (int dx, int dy, Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  srcRaster)
          Copies pixels from Raster srcRaster to this WritableRaster.
 void setRect sample code for java.awt.image.WritableRaster.setRect(java.awt.image.Raster) definition code for java.awt.image.WritableRaster.setRect(java.awt.image.Raster) (Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster  srcRaster)
          Copies pixels from Raster srcRaster to this WritableRaster.
 void setSample sample code for java.awt.image.WritableRaster.setSample(int, int, int, double) definition code for java.awt.image.WritableRaster.setSample(int, int, int, double) (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.
 void setSample sample code for java.awt.image.WritableRaster.setSample(int, int, int, float) definition code for java.awt.image.WritableRaster.setSample(int, int, int, float) (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.
 void setSample sample code for java.awt.image.WritableRaster.setSample(int, int, int, int) definition code for java.awt.image.WritableRaster.setSample(int, int, int, int) (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.
 void setSamples sample code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, double[]) definition code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, double[]) (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.
 void setSamples sample code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, float[]) definition code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, float[]) (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.
 void setSamples sample code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, int[]) definition code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, int[]) (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.
 
Methods inherited from class java.awt.image.Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster
createBandedRaster sample code for java.awt.image.Raster.createBandedRaster(java.awt.image.DataBuffer, int, int, int, int[], int[], java.awt.Point) definition code for java.awt.image.Raster.createBandedRaster(java.awt.image.DataBuffer, int, int, int, int[], int[], java.awt.Point) , createBandedRaster sample code for java.awt.image.Raster.createBandedRaster(int, int, int, int, int[], int[], java.awt.Point) definition code for java.awt.image.Raster.createBandedRaster(int, int, int, int, int[], int[], java.awt.Point) , createBandedRaster sample code for java.awt.image.Raster.createBandedRaster(int, int, int, int, java.awt.Point) definition code for java.awt.image.Raster.createBandedRaster(int, int, int, int, java.awt.Point) , createChild sample code for java.awt.image.Raster.createChild(int, int, int, int, int, int, int[]) definition code for java.awt.image.Raster.createChild(int, int, int, int, int, int, int[]) , createCompatibleWritableRaster sample code for java.awt.image.Raster.createCompatibleWritableRaster() definition code for java.awt.image.Raster.createCompatibleWritableRaster() , createCompatibleWritableRaster sample code for java.awt.image.Raster.createCompatibleWritableRaster(int, int) definition code for java.awt.image.Raster.createCompatibleWritableRaster(int, int) , createCompatibleWritableRaster sample code for java.awt.image.Raster.createCompatibleWritableRaster(int, int, int, int) definition code for java.awt.image.Raster.createCompatibleWritableRaster(int, int, int, int) , createCompatibleWritableRaster sample code for java.awt.image.Raster.createCompatibleWritableRaster(java.awt.Rectangle) definition code for java.awt.image.Raster.createCompatibleWritableRaster(java.awt.Rectangle) , createInterleavedRaster sample code for java.awt.image.Raster.createInterleavedRaster(java.awt.image.DataBuffer, int, int, int, int, int[], java.awt.Point) definition code for java.awt.image.Raster.createInterleavedRaster(java.awt.image.DataBuffer, int, int, int, int, int[], java.awt.Point) , createInterleavedRaster sample code for java.awt.image.Raster.createInterleavedRaster(int, int, int, int, int, int[], java.awt.Point) definition code for java.awt.image.Raster.createInterleavedRaster(int, int, int, int, int, int[], java.awt.Point) , createInterleavedRaster sample code for java.awt.image.Raster.createInterleavedRaster(int, int, int, int, java.awt.Point) definition code for java.awt.image.Raster.createInterleavedRaster(int, int, int, int, java.awt.Point) , createPackedRaster sample code for java.awt.image.Raster.createPackedRaster(java.awt.image.DataBuffer, int, int, int, int[], java.awt.Point) definition code for java.awt.image.Raster.createPackedRaster(java.awt.image.DataBuffer, int, int, int, int[], java.awt.Point) , createPackedRaster sample code for java.awt.image.Raster.createPackedRaster(java.awt.image.DataBuffer, int, int, int, java.awt.Point) definition code for java.awt.image.Raster.createPackedRaster(java.awt.image.DataBuffer, int, int, int, java.awt.Point) , createPackedRaster sample code for java.awt.image.Raster.createPackedRaster(int, int, int, int[], java.awt.Point) definition code for java.awt.image.Raster.createPackedRaster(int, int, int, int[], java.awt.Point) , createPackedRaster sample code for java.awt.image.Raster.createPackedRaster(int, int, int, int, int, java.awt.Point) definition code for java.awt.image.Raster.createPackedRaster(int, int, int, int, int, java.awt.Point) , createRaster sample code for java.awt.image.Raster.createRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Point) definition code for java.awt.image.Raster.createRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Point) , createTranslatedChild sample code for java.awt.image.Raster.createTranslatedChild(int, int) definition code for java.awt.image.Raster.createTranslatedChild(int, int) , createWritableRaster sample code for java.awt.image.Raster.createWritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Point) definition code for java.awt.image.Raster.createWritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Point) , createWritableRaster sample code for java.awt.image.Raster.createWritableRaster(java.awt.image.SampleModel, java.awt.Point) definition code for java.awt.image.Raster.createWritableRaster(java.awt.image.SampleModel, java.awt.Point) , getBounds sample code for java.awt.image.Raster.getBounds() definition code for java.awt.image.Raster.getBounds() , getDataBuffer sample code for java.awt.image.Raster.getDataBuffer() definition code for java.awt.image.Raster.getDataBuffer() , getDataElements sample code for java.awt.image.Raster.getDataElements(int, int, int, int, java.lang.Object) definition code for java.awt.image.Raster.getDataElements(int, int, int, int, java.lang.Object) , getDataElements sample code for java.awt.image.Raster.getDataElements(int, int, java.lang.Object) definition code for java.awt.image.Raster.getDataElements(int, int, java.lang.Object) , getHeight sample code for java.awt.image.Raster.getHeight() definition code for java.awt.image.Raster.getHeight() , getMinX sample code for java.awt.image.Raster.getMinX() definition code for java.awt.image.Raster.getMinX() , getMinY sample code for java.awt.image.Raster.getMinY() definition code for java.awt.image.Raster.getMinY() , getNumBands sample code for java.awt.image.Raster.getNumBands() definition code for java.awt.image.Raster.getNumBands() , getNumDataElements sample code for java.awt.image.Raster.getNumDataElements() definition code for java.awt.image.Raster.getNumDataElements() , getParent sample code for java.awt.image.Raster.getParent() definition code for java.awt.image.Raster.getParent() , getPixel sample code for java.awt.image.Raster.getPixel(int, int, double[]) definition code for java.awt.image.Raster.getPixel(int, int, double[]) , getPixel sample code for java.awt.image.Raster.getPixel(int, int, float[]) definition code for java.awt.image.Raster.getPixel(int, int, float[]) , getPixel sample code for java.awt.image.Raster.getPixel(int, int, int[]) definition code for java.awt.image.Raster.getPixel(int, int, int[]) , getPixels sample code for java.awt.image.Raster.getPixels(int, int, int, int, double[]) definition code for java.awt.image.Raster.getPixels(int, int, int, int, double[]) , getPixels sample code for java.awt.image.Raster.getPixels(int, int, int, int, float[]) definition code for java.awt.image.Raster.getPixels(int, int, int, int, float[]) , getPixels sample code for java.awt.image.Raster.getPixels(int, int, int, int, int[]) definition code for java.awt.image.Raster.getPixels(int, int, int, int, int[]) , getSample sample code for java.awt.image.Raster.getSample(int, int, int) definition code for java.awt.image.Raster.getSample(int, int, int) , getSampleDouble sample code for java.awt.image.Raster.getSampleDouble(int, int, int) definition code for java.awt.image.Raster.getSampleDouble(int, int, int) , getSampleFloat sample code for java.awt.image.Raster.getSampleFloat(int, int, int) definition code for java.awt.image.Raster.getSampleFloat(int, int, int) , getSampleModel sample code for java.awt.image.Raster.getSampleModel() definition code for java.awt.image.Raster.getSampleModel() , getSampleModelTranslateX sample code for java.awt.image.Raster.getSampleModelTranslateX() definition code for java.awt.image.Raster.getSampleModelTranslateX() , getSampleModelTranslateY sample code for java.awt.image.Raster.getSampleModelTranslateY() definition code for java.awt.image.Raster.getSampleModelTranslateY() , getSamples sample code for java.awt.image.Raster.getSamples(int, int, int, int, int, double[]) definition code for java.awt.image.Raster.getSamples(int, int, int, int, int, double[]) , getSamples sample code for java.awt.image.Raster.getSamples(int, int, int, int, int, float[]) definition code for java.awt.image.Raster.getSamples(int, int, int, int, int, float[]) , getSamples sample code for java.awt.image.Raster.getSamples(int, int, int, int, int, int[]) definition code for java.awt.image.Raster.getSamples(int, int, int, int, int, int[]) , getTransferType sample code for java.awt.image.Raster.getTransferType() definition code for java.awt.image.Raster.getTransferType() , getWidth sample code for java.awt.image.Raster.getWidth() definition code for java.awt.image.Raster.getWidth()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

WritableRaster sample code for java.awt.image.WritableRaster(java.awt.image.SampleModel, java.awt.Point) definition code for java.awt.image.WritableRaster(java.awt.image.SampleModel, java.awt.Point)

protected WritableRaster(SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel,
                         Point sample code for java.awt.Point definition code for java.awt.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 - The SampleModel that specifies the layout.
origin - The Point that specifies the origin.
Throws:
RasterFormatException sample code for java.awt.image.RasterFormatException definition code for java.awt.image.RasterFormatException - if computing either origin.x + sampleModel.getWidth() or origin.y + sampleModel.getHeight() results in integer overflow

WritableRaster sample code for java.awt.image.WritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Point) definition code for java.awt.image.WritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Point)

protected WritableRaster(SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel,
                         DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  dataBuffer,
                         Point sample code for java.awt.Point definition code for java.awt.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 - The SampleModel that specifies the layout.
dataBuffer - The DataBuffer that contains the image data.
origin - The Point that specifies the origin.
Throws:
RasterFormatException sample code for java.awt.image.RasterFormatException definition code for java.awt.image.RasterFormatException - if computing either origin.x + sampleModel.getWidth() or origin.y + sampleModel.getHeight() results in integer overflow

WritableRaster sample code for java.awt.image.WritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Rectangle, java.awt.Point, java.awt.image.WritableRaster) definition code for java.awt.image.WritableRaster(java.awt.image.SampleModel, java.awt.image.DataBuffer, java.awt.Rectangle, java.awt.Point, java.awt.image.WritableRaster)

protected WritableRaster(SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel,
                         DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  dataBuffer,
                         Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  aRegion,
                         Point sample code for java.awt.Point definition code for java.awt.Point  sampleModelTranslate,
                         WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.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 - The SampleModel that specifies the layout.
dataBuffer - The DataBuffer that contains the image data.
aRegion - The Rectangle that specifies the image area.
sampleModelTranslate - The Point that specifies the translation from SampleModel to Raster coordinates.
parent - The parent (if any) of this raster.
Throws:
RasterFormatException sample code for java.awt.image.RasterFormatException definition code for java.awt.image.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

getWritableParent sample code for java.awt.image.WritableRaster.getWritableParent() definition code for java.awt.image.WritableRaster.getWritableParent()

public WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.WritableRaster  getWritableParent()
Returns the parent WritableRaster (if any) of this WritableRaster, or else null.

Returns:
the parent of this WritableRaster, or null.

createWritableTranslatedChild sample code for java.awt.image.WritableRaster.createWritableTranslatedChild(int, int) definition code for java.awt.image.WritableRaster.createWritableTranslatedChild(int, int)

public WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.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 - X coord of the upper left corner of the new Raster.
childMinY - Y coord of the upper left corner of the new Raster.
Returns:
a WritableRaster the same as this one except for the specified location.
Throws:
RasterFormatException sample code for java.awt.image.RasterFormatException definition code for java.awt.image.RasterFormatException - if computing either childMinX + this.getWidth() or childMinY + this.getHeight() results in integer overflow

createWritableChild sample code for java.awt.image.WritableRaster.createWritableChild(int, int, int, int, int, int, int[]) definition code for java.awt.image.WritableRaster.createWritableChild(int, int, int, int, int, int, int[])

public WritableRaster sample code for java.awt.image.WritableRaster definition code for java.awt.image.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 - X coordinate of the upper left corner in this WritableRaster's coordinates.
parentY - Y coordinate of the upper left corner in this WritableRaster's coordinates.
w - Width of the region starting at (parentX, parentY).
h - Height of the region starting at (parentX, parentY).
childMinX - X coordinate of the upper left corner of the returned WritableRaster.
childMinY - Y coordinate of the upper left corner of the returned WritableRaster.
bandList - Array of band indices, or null to use all bands.
Returns:
a WritableRaster sharing all or part of the DataBuffer of this WritableRaster.
Throws:
RasterFormatException sample code for java.awt.image.RasterFormatException definition code for java.awt.image.RasterFormatException - if the subregion is outside of the raster bounds.
RasterFormatException sample code for java.awt.image.RasterFormatException definition code for java.awt.image.RasterFormatException - 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

setDataElements sample code for java.awt.image.WritableRaster.setDataElements(int, int, java.lang.Object) definition code for java.awt.image.WritableRaster.setDataElements(int, int, java.lang.Object)

public void setDataElements(int x,
                            int y,
                            Object sample code for java.lang.Object definition code for java.lang.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 - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
inData - An object reference to an array of type defined by getTransferType() and length getNumDataElements() containing the pixel data to place at x,y.
Throws:
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if inData is too small to hold the input.
See Also:
SampleModel.setDataElements(int, int, Object, DataBuffer) sample code for java.awt.image.SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)

setDataElements sample code for java.awt.image.WritableRaster.setDataElements(int, int, java.awt.image.Raster) definition code for java.awt.image.WritableRaster.setDataElements(int, int, java.awt.image.Raster)

public void setDataElements(int x,
                            int y,
                            Raster sample code for java.awt.image.Raster definition code for java.awt.image.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 - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
inRaster - Raster containing data to place at x,y.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if inRaster is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds.

setDataElements sample code for java.awt.image.WritableRaster.setDataElements(int, int, int, int, java.lang.Object) definition code for java.awt.image.WritableRaster.setDataElements(int, int, int, int, java.lang.Object)

public void setDataElements(int x,
                            int y,
                            int w,
                            int h,
                            Object sample code for java.lang.Object definition code for java.lang.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 - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - Width of the pixel rectangle.
h - Height of the pixel rectangle.
inData - 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.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if inData is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if inData is too small to hold the input.
See Also:
SampleModel.setDataElements(int, int, int, int, Object, DataBuffer) sample code for java.awt.image.SampleModel.setDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer)

setRect sample code for java.awt.image.WritableRaster.setRect(java.awt.image.Raster) definition code for java.awt.image.WritableRaster.setRect(java.awt.image.Raster)

public void setRect(Raster sample code for java.awt.image.Raster definition code for java.awt.image.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 - The Raster from which to copy pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if srcRaster is null.

setRect sample code for java.awt.image.WritableRaster.setRect(int, int, java.awt.image.Raster) definition code for java.awt.image.WritableRaster.setRect(int, int, java.awt.image.Raster)

public void setRect(int dx,
                    int dy,
                    Raster sample code for java.awt.image.Raster definition code for java.awt.image.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 setRect(Raster) sample code for java.awt.image.WritableRaster.setRect(java.awt.image.Raster) definition code for java.awt.image.WritableRaster.setRect(java.awt.image.Raster) .

Parameters:
dx - The X translation factor from src space to dst space of the copy.
dy - The Y translation factor from src space to dst space of the copy.
srcRaster - The Raster from which to copy pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if srcRaster is null.

setPixel sample code for java.awt.image.WritableRaster.setPixel(int, int, int[]) definition code for java.awt.image.WritableRaster.setPixel(int, int, int[])

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 - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
iArray - The input samples in a int array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if iArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if iArray is too small to hold the input.

setPixel sample code for java.awt.image.WritableRaster.setPixel(int, int, float[]) definition code for java.awt.image.WritableRaster.setPixel(int, int, float[])

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 - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
fArray - The input samples in a float array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if fArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if fArray is too small to hold the input.

setPixel sample code for java.awt.image.WritableRaster.setPixel(int, int, double[]) definition code for java.awt.image.WritableRaster.setPixel(int, int, double[])

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 - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
dArray - The input samples in a double array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if dArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if dArray is too small to hold the input.

setPixels sample code for java.awt.image.WritableRaster.setPixels(int, int, int, int, int[]) definition code for java.awt.image.WritableRaster.setPixels(int, int, int, int, int[])

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 - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - Width of the pixel rectangle.
h - Height of the pixel rectangle.
iArray - The input int pixel array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if iArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if iArray is too small to hold the input.

setPixels sample code for java.awt.image.WritableRaster.setPixels(int, int, int, int, float[]) definition code for java.awt.image.WritableRaster.setPixels(int, int, int, int, float[])

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 - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - Width of the pixel rectangle.
h - Height of the pixel rectangle.
fArray - The input float pixel array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if fArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if fArray is too small to hold the input.

setPixels sample code for java.awt.image.WritableRaster.setPixels(int, int, int, int, double[]) definition code for java.awt.image.WritableRaster.setPixels(int, int, int, int, double[])

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 - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - Width of the pixel rectangle.
h - Height of the pixel rectangle.
dArray - The input double pixel array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if dArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if dArray is too small to hold the input.

setSample sample code for java.awt.image.WritableRaster.setSample(int, int, int, int) definition code for java.awt.image.WritableRaster.setSample(int, int, int, int)

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 - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
b - The band to set.
s - The input sample.
Throws:
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates or the band index are not in bounds.

setSample sample code for java.awt.image.WritableRaster.setSample(int, int, int, float) definition code for java.awt.image.WritableRaster.setSample(int, int, int, float)

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 - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
b - The band to set.
s - The input sample as a float.
Throws:
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates or the band index are not in bounds.

setSample sample code for java.awt.image.WritableRaster.setSample(int, int, int, double) definition code for java.awt.image.WritableRaster.setSample(int, int, int, double)

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 - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
b - The band to set.
s - The input sample as a double.
Throws:
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates or the band index are not in bounds.

setSamples sample code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, int[]) definition code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, int[])

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 - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - Width of the pixel rectangle.
h - Height of the pixel rectangle.
b - The band to set.
iArray - The input int sample array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if iArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates or the band index are not in bounds, or if iArray is too small to hold the input.

setSamples sample code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, float[]) definition code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, float[])

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 - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - Width of the pixel rectangle.
h - Height of the pixel rectangle.
b - The band to set.
fArray - The input float sample array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if fArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates or the band index are not in bounds, or if fArray is too small to hold the input.

setSamples sample code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, double[]) definition code for java.awt.image.WritableRaster.setSamples(int, int, int, int, int, double[])

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 - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - Width of the pixel rectangle.
h - Height of the pixel rectangle.
b - The band to set.
dArray - The input double sample array.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if dArray is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates or the band index are not in bounds, or if dArray is too small to hold the input.