java.awt.image
Class SampleModel

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.image.SampleModel
Direct Known Subclasses:
ComponentSampleModel sample code for java.awt.image.ComponentSampleModel definition code for java.awt.image.ComponentSampleModel , MultiPixelPackedSampleModel sample code for java.awt.image.MultiPixelPackedSampleModel definition code for java.awt.image.MultiPixelPackedSampleModel , SinglePixelPackedSampleModel sample code for java.awt.image.SinglePixelPackedSampleModel definition code for java.awt.image.SinglePixelPackedSampleModel

public abstract class SampleModel
extends Object sample code for java.lang.Object definition code for java.lang.Object

This abstract class defines an interface for extracting samples of pixels in an image. All image data is expressed as a collection of pixels. Each pixel consists of a number of samples. A sample is a datum for one band of an image and a band consists of all samples of a particular type in an image. For example, a pixel might contain three samples representing its red, green and blue components. There are three bands in the image containing this pixel. One band consists of all the red samples from all pixels in the image. The second band consists of all the green samples and the remaining band consists of all of the blue samples. The pixel can be stored in various formats. For example, all samples from a particular band can be stored contiguously or all samples from a single pixel can be stored contiguously.

Subclasses of SampleModel specify the types of samples they can represent (e.g. unsigned 8-bit byte, signed 16-bit short, etc.) and may specify how the samples are organized in memory. In the Java 2D(tm) API, built-in image processing operators may not operate on all possible sample types, but generally will work for unsigned integral samples of 16 bits or less. Some operators support a wider variety of sample types.

A collection of pixels is represented as a Raster, which consists of a DataBuffer and a SampleModel. The SampleModel allows access to samples in the DataBuffer and may provide low-level information that a programmer can use to directly manipulate samples and pixels in the DataBuffer.

This class is generally a fall back method for dealing with images. More efficient code will cast the SampleModel to the appropriate subclass and extract the information needed to directly manipulate pixels in the DataBuffer.

See Also:
DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer , Raster sample code for java.awt.image.Raster definition code for java.awt.image.Raster , ComponentSampleModel sample code for java.awt.image.ComponentSampleModel definition code for java.awt.image.ComponentSampleModel , PixelInterleavedSampleModel sample code for java.awt.image.PixelInterleavedSampleModel definition code for java.awt.image.PixelInterleavedSampleModel , BandedSampleModel sample code for java.awt.image.BandedSampleModel definition code for java.awt.image.BandedSampleModel , MultiPixelPackedSampleModel sample code for java.awt.image.MultiPixelPackedSampleModel definition code for java.awt.image.MultiPixelPackedSampleModel , SinglePixelPackedSampleModel sample code for java.awt.image.SinglePixelPackedSampleModel definition code for java.awt.image.SinglePixelPackedSampleModel

Field Summary
protected  int dataType sample code for java.awt.image.SampleModel.dataType definition code for java.awt.image.SampleModel.dataType
          Data type of the DataBuffer storing the pixel data.
protected  int height sample code for java.awt.image.SampleModel.height definition code for java.awt.image.SampleModel.height
          Height in pixels of the region of image data that this SampleModel describes.
protected  int numBands sample code for java.awt.image.SampleModel.numBands definition code for java.awt.image.SampleModel.numBands
          Number of bands of the image data that this SampleModel describes.
protected  int width sample code for java.awt.image.SampleModel.width definition code for java.awt.image.SampleModel.width
          Width in pixels of the region of image data that this SampleModel describes.
 
Constructor Summary
SampleModel sample code for java.awt.image.SampleModel.SampleModel(int, int, int, int) definition code for java.awt.image.SampleModel.SampleModel(int, int, int, int) (int dataType, int w, int h, int numBands)
          Constructs a SampleModel with the specified parameters.
 
Method Summary
abstract  SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel createCompatibleSampleModel sample code for java.awt.image.SampleModel.createCompatibleSampleModel(int, int) definition code for java.awt.image.SampleModel.createCompatibleSampleModel(int, int) (int w, int h)
          Creates a SampleModel which describes data in this SampleModel's format, but with a different width and height.
abstract  DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer createDataBuffer sample code for java.awt.image.SampleModel.createDataBuffer() definition code for java.awt.image.SampleModel.createDataBuffer() ()
          Creates a DataBuffer that corresponds to this SampleModel.
abstract  SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel createSubsetSampleModel sample code for java.awt.image.SampleModel.createSubsetSampleModel(int[]) definition code for java.awt.image.SampleModel.createSubsetSampleModel(int[]) (int[] bands)
          Creates a new SampleModel with a subset of the bands of this SampleModel.
 Object sample code for java.lang.Object definition code for java.lang.Object getDataElements sample code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) (int x, int y, int w, int h, Object sample code for java.lang.Object definition code for java.lang.Object  obj, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the pixel data for the specified rectangle of pixels in a primitive array of type TransferType.
abstract  Object sample code for java.lang.Object definition code for java.lang.Object getDataElements sample code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) (int x, int y, Object sample code for java.lang.Object definition code for java.lang.Object  obj, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns data for a single pixel in a primitive array of type TransferType.
 int getDataType sample code for java.awt.image.SampleModel.getDataType() definition code for java.awt.image.SampleModel.getDataType() ()
          Returns the data type of the DataBuffer storing the pixel data.
 int getHeight sample code for java.awt.image.SampleModel.getHeight() definition code for java.awt.image.SampleModel.getHeight() ()
          Returns the height in pixels.
 int getNumBands sample code for java.awt.image.SampleModel.getNumBands() definition code for java.awt.image.SampleModel.getNumBands() ()
          Returns the total number of bands of image data.
abstract  int getNumDataElements sample code for java.awt.image.SampleModel.getNumDataElements() definition code for java.awt.image.SampleModel.getNumDataElements() ()
          Returns the number of data elements needed to transfer a pixel via the getDataElements and setDataElements methods.
 double[] getPixel sample code for java.awt.image.SampleModel.getPixel(int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, double[], java.awt.image.DataBuffer) (int x, int y, double[] dArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the samples for the specified pixel in an array of double.
 float[] getPixel sample code for java.awt.image.SampleModel.getPixel(int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, float[], java.awt.image.DataBuffer) (int x, int y, float[] fArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the samples for the specified pixel in an array of float.
 int[] getPixel sample code for java.awt.image.SampleModel.getPixel(int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, int[], java.awt.image.DataBuffer) (int x, int y, int[] iArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the samples for a specified pixel in an int array, one sample per array element.
 double[] getPixels sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, double[], java.awt.image.DataBuffer) (int x, int y, int w, int h, double[] dArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns all samples for a rectangle of pixels in a double array, one sample per array element.
 float[] getPixels sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, float[], java.awt.image.DataBuffer) (int x, int y, int w, int h, float[] fArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns all samples for a rectangle of pixels in a float array, one sample per array element.
 int[] getPixels sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, int[], java.awt.image.DataBuffer) (int x, int y, int w, int h, int[] iArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns all samples for a rectangle of pixels in an int array, one sample per array element.
abstract  int getSample sample code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer) (int x, int y, int b, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the sample in a specified band for the pixel located at (x,y) as an int.
 double getSampleDouble sample code for java.awt.image.SampleModel.getSampleDouble(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSampleDouble(int, int, int, java.awt.image.DataBuffer) (int x, int y, int b, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the sample in a specified band for a pixel located at (x,y) as a double.
 float getSampleFloat sample code for java.awt.image.SampleModel.getSampleFloat(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSampleFloat(int, int, int, java.awt.image.DataBuffer) (int x, int y, int b, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the sample in a specified band for the pixel located at (x,y) as a float.
 double[] getSamples sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer) (int x, int y, int w, int h, int b, double[] dArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the samples for a specified band for a specified rectangle of pixels in a double array, one sample per array element.
 float[] getSamples sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer) (int x, int y, int w, int h, int b, float[] fArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the samples for a specified band for the specified rectangle of pixels in a float array, one sample per array element.
 int[] getSamples sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer) (int x, int y, int w, int h, int b, int[] iArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Returns the samples for a specified band for the specified rectangle of pixels in an int array, one sample per array element.
abstract  int[] getSampleSize sample code for java.awt.image.SampleModel.getSampleSize() definition code for java.awt.image.SampleModel.getSampleSize() ()
          Returns the size in bits of samples for all bands.
abstract  int getSampleSize sample code for java.awt.image.SampleModel.getSampleSize(int) definition code for java.awt.image.SampleModel.getSampleSize(int) (int band)
          Returns the size in bits of samples for the specified band.
 int getTransferType sample code for java.awt.image.SampleModel.getTransferType() definition code for java.awt.image.SampleModel.getTransferType() ()
          Returns the TransferType used to transfer pixels via the getDataElements and setDataElements methods.
 int getWidth sample code for java.awt.image.SampleModel.getWidth() definition code for java.awt.image.SampleModel.getWidth() ()
          Returns the width in pixels.
 void setDataElements 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) (int x, int y, int w, int h, Object sample code for java.lang.Object definition code for java.lang.Object  obj, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Sets the data for a rectangle of pixels in the specified DataBuffer from a primitive array of type TransferType.
abstract  void setDataElements 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) (int x, int y, Object sample code for java.lang.Object definition code for java.lang.Object  obj, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Sets the data for a single pixel in the specified DataBuffer from a primitive array of type TransferType.
 void setPixel sample code for java.awt.image.SampleModel.setPixel(int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixel(int, int, double[], java.awt.image.DataBuffer) (int x, int y, double[] dArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Sets a pixel in the DataBuffer using a double array of samples for input.
 void setPixel sample code for java.awt.image.SampleModel.setPixel(int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixel(int, int, float[], java.awt.image.DataBuffer) (int x, int y, float[] fArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Sets a pixel in the DataBuffer using a float array of samples for input.
 void setPixel sample code for java.awt.image.SampleModel.setPixel(int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixel(int, int, int[], java.awt.image.DataBuffer) (int x, int y, int[] iArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Sets a pixel in the DataBuffer using an int array of samples for input.
 void setPixels sample code for java.awt.image.SampleModel.setPixels(int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixels(int, int, int, int, double[], java.awt.image.DataBuffer) (int x, int y, int w, int h, double[] dArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          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.SampleModel.setPixels(int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixels(int, int, int, int, float[], java.awt.image.DataBuffer) (int x, int y, int w, int h, float[] fArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          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.SampleModel.setPixels(int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixels(int, int, int, int, int[], java.awt.image.DataBuffer) (int x, int y, int w, int h, int[] iArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Sets all samples for a rectangle of pixels from an int array containing one sample per array element.
 void setSample sample code for java.awt.image.SampleModel.setSample(int, int, int, double, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSample(int, int, int, double, java.awt.image.DataBuffer) (int x, int y, int b, double s, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          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.SampleModel.setSample(int, int, int, float, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSample(int, int, int, float, java.awt.image.DataBuffer) (int x, int y, int b, float s, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a float for input.
abstract  void setSample sample code for java.awt.image.SampleModel.setSample(int, int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSample(int, int, int, int, java.awt.image.DataBuffer) (int x, int y, int b, int s, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          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.SampleModel.setSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer) (int x, int y, int w, int h, int b, double[] dArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          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.SampleModel.setSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer) (int x, int y, int w, int h, int b, float[] fArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          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.SampleModel.setSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer) (int x, int y, int w, int h, int b, int[] iArray, DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
          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.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)
 

Field Detail

width sample code for java.awt.image.SampleModel.width

protected int width
Width in pixels of the region of image data that this SampleModel describes.


height sample code for java.awt.image.SampleModel.height

protected int height
Height in pixels of the region of image data that this SampleModel describes.


numBands sample code for java.awt.image.SampleModel.numBands

protected int numBands
Number of bands of the image data that this SampleModel describes.


dataType sample code for java.awt.image.SampleModel.dataType

protected int dataType
Data type of the DataBuffer storing the pixel data.

See Also:
DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer
Constructor Detail

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

public SampleModel(int dataType,
                   int w,
                   int h,
                   int numBands)
Constructs a SampleModel with the specified parameters.

Parameters:
dataType - The data type of the DataBuffer storing the pixel data.
w - The width (in pixels) of the region of image data.
h - The height (in pixels) of the region of image data.
numBands - The number of bands of the image data.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if w or h is not greater than 0
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the product of w and h is greater than Integer.MAX_VALUE
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if dataType is not one of the supported data types
Method Detail

getWidth sample code for java.awt.image.SampleModel.getWidth() definition code for java.awt.image.SampleModel.getWidth()

public final int getWidth()
Returns the width in pixels.

Returns:
the width in pixels of the region of image data that this SampleModel describes.

getHeight sample code for java.awt.image.SampleModel.getHeight() definition code for java.awt.image.SampleModel.getHeight()

public final int getHeight()
Returns the height in pixels.

Returns:
the height in pixels of the region of image data that this SampleModel describes.

getNumBands sample code for java.awt.image.SampleModel.getNumBands() definition code for java.awt.image.SampleModel.getNumBands()

public final int getNumBands()
Returns the total number of bands of image data.

Returns:
the number of bands of image data that this SampleModel describes.

getNumDataElements sample code for java.awt.image.SampleModel.getNumDataElements() definition code for java.awt.image.SampleModel.getNumDataElements()

public abstract int getNumDataElements()
Returns the number of data elements needed to transfer a pixel via the getDataElements and setDataElements methods. When pixels are transferred via these methods, they may be transferred in a packed or unpacked format, depending on the implementation of the SampleModel. Using these methods, pixels are transferred as an array of getNumDataElements() elements of a primitive type given by getTransferType(). The TransferType may or may not be the same as the storage DataType.

Returns:
the number of data elements.
See Also:
getDataElements(int, int, Object, DataBuffer) sample code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) , getDataElements(int, int, int, int, Object, DataBuffer) sample code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) , 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(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) , getTransferType() sample code for java.awt.image.SampleModel.getTransferType() definition code for java.awt.image.SampleModel.getTransferType()

getDataType sample code for java.awt.image.SampleModel.getDataType() definition code for java.awt.image.SampleModel.getDataType()

public final int getDataType()
Returns the data type of the DataBuffer storing the pixel data.

Returns:
the data type.

getTransferType sample code for java.awt.image.SampleModel.getTransferType() definition code for java.awt.image.SampleModel.getTransferType()

public int getTransferType()
Returns the TransferType used to transfer pixels via the getDataElements and setDataElements methods. When pixels are transferred via these methods, they may be transferred in a packed or unpacked format, depending on the implementation of the SampleModel. Using these methods, pixels are transferred as an array of getNumDataElements() elements of a primitive type given by getTransferType(). The TransferType may or may not be the same as the storage DataType. The TransferType will be one of the types defined in DataBuffer.

Returns:
the transfer type.
See Also:
getDataElements(int, int, Object, DataBuffer) sample code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) , getDataElements(int, int, int, int, Object, DataBuffer) sample code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) , 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(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) , getNumDataElements() sample code for java.awt.image.SampleModel.getNumDataElements() definition code for java.awt.image.SampleModel.getNumDataElements() , DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer

getPixel sample code for java.awt.image.SampleModel.getPixel(int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, int[], java.awt.image.DataBuffer)

public int[] getPixel(int x,
                      int y,
                      int[] iArray,
                      DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the samples for a specified pixel in an int array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x, y - The coordinates of the pixel location
iArray - If non-null, returns the samples in this array
data - The DataBuffer containing the image data
Returns:
the samples for the specified pixel.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setPixel(int, int, int[], DataBuffer) sample code for java.awt.image.SampleModel.setPixel(int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixel(int, int, int[], java.awt.image.DataBuffer)

getDataElements sample code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)

public abstract Object sample code for java.lang.Object definition code for java.lang.Object  getDataElements(int x,
                                       int y,
                                       Object sample code for java.lang.Object definition code for java.lang.Object  obj,
                                       DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns data for a single pixel in 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 may be returned in a packed format, thus increasing efficiency for data transfers. Generally, obj should be passed in as null, so that the Object will be created automatically and will be of the right primitive data type.

The following code illustrates transferring data for one pixel from DataBuffer db1, whose storage layout is described by SampleModel sm1, to DataBuffer db2, whose storage layout is described by SampleModel sm2. The transfer will generally be more efficient than using getPixel/setPixel.

             SampleModel sm1, sm2;
             DataBuffer db1, db2;
             sm2.setDataElements(x, y, sm1.getDataElements(x, y, null, db1), db2);
 
Using getDataElements/setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModels have the same number of bands, corresponding bands have the same number of bits per sample, and the TransferTypes are the same.

If obj is non-null, it should be a primitive array of type TransferType. Otherwise, a ClassCastException is thrown. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if obj is non-null and is not large enough to hold the pixel data.

Parameters:
x - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
obj - If non-null, a primitive array in which to return the pixel data.
data - The DataBuffer containing the image data.
Returns:
the data elements for the specified pixel.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if obj is too small to hold the output.
See Also:
getNumDataElements() sample code for java.awt.image.SampleModel.getNumDataElements() definition code for java.awt.image.SampleModel.getNumDataElements() , getTransferType() sample code for java.awt.image.SampleModel.getTransferType() definition code for java.awt.image.SampleModel.getTransferType() , DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer , 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)

getDataElements sample code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer)

public Object sample code for java.lang.Object definition code for java.lang.Object  getDataElements(int x,
                              int y,
                              int w,
                              int h,
                              Object sample code for java.lang.Object definition code for java.lang.Object  obj,
                              DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the pixel data for the specified rectangle of pixels in 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 may be returned in a packed format, thus increasing efficiency for data transfers. Generally, obj should be passed in as null, so that the Object will be created automatically and will be of the right primitive data type.

The following code illustrates transferring data for a rectangular region of pixels from DataBuffer db1, whose storage layout is described by SampleModel sm1, to DataBuffer db2, whose storage layout is described by SampleModel sm2. The transfer will generally be more efficient than using getPixels/setPixels.

             SampleModel sm1, sm2;
             DataBuffer db1, db2;
             sm2.setDataElements(x, y, w, h, sm1.getDataElements(x, y, w,
                           h, null, db1), db2);
 
Using getDataElements/setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModels have the same number of bands, corresponding bands have the same number of bits per sample, and the TransferTypes are the same.

If obj is non-null, it should be a primitive array of type TransferType. Otherwise, a ClassCastException is thrown. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if obj is non-null and is not large enough to hold the pixel data.

Parameters:
x - The minimum X coordinate of the pixel rectangle.
y - The minimum Y coordinate of the pixel rectangle.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
obj - If non-null, a primitive array in which to return the pixel data.
data - The DataBuffer containing the image data.
Returns:
the data elements for the specified region of pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if obj is too small to hold the output.
See Also:
getNumDataElements() sample code for java.awt.image.SampleModel.getNumDataElements() definition code for java.awt.image.SampleModel.getNumDataElements() , getTransferType() sample code for java.awt.image.SampleModel.getTransferType() definition code for java.awt.image.SampleModel.getTransferType() , 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) , DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer

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

public abstract void setDataElements(int x,
                                     int y,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  obj,
                                     DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets the data for a single pixel in the specified DataBuffer 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.

The following code illustrates transferring data for one pixel from DataBuffer db1, whose storage layout is described by SampleModel sm1, to DataBuffer db2, whose storage layout is described by SampleModel sm2. The transfer will generally be more efficient than using getPixel/setPixel.

             SampleModel sm1, sm2;
             DataBuffer db1, db2;
             sm2.setDataElements(x, y, sm1.getDataElements(x, y, null, db1),
                           db2);
 
Using getDataElements/setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModels have the same number of bands, corresponding bands have the same number of bits per sample, and the TransferTypes are the same.

obj must be a primitive array of type TransferType. Otherwise, a ClassCastException is thrown. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if obj is not large enough to hold the pixel data.

Parameters:
x - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
obj - A primitive array containing pixel data.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if obj is too small to hold the input.
See Also:
getNumDataElements() sample code for java.awt.image.SampleModel.getNumDataElements() definition code for java.awt.image.SampleModel.getNumDataElements() , getTransferType() sample code for java.awt.image.SampleModel.getTransferType() definition code for java.awt.image.SampleModel.getTransferType() , getDataElements(int, int, Object, DataBuffer) sample code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) , DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer

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

public void setDataElements(int x,
                            int y,
                            int w,
                            int h,
                            Object sample code for java.lang.Object definition code for java.lang.Object  obj,
                            DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets the data for a rectangle of pixels in the specified DataBuffer 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.

The following code illustrates transferring data for a rectangular region of pixels from DataBuffer db1, whose storage layout is described by SampleModel sm1, to DataBuffer db2, whose storage layout is described by SampleModel sm2. The transfer will generally be more efficient than using getPixels/setPixels.

             SampleModel sm1, sm2;
             DataBuffer db1, db2;
             sm2.setDataElements(x, y, w, h, sm1.getDataElements(x, y, w, h,
                           null, db1), db2);
 
Using getDataElements/setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModels have the same number of bands, corresponding bands have the same number of bits per sample, and the TransferTypes are the same.

obj must be a primitive array of type TransferType. Otherwise, a ClassCastException is thrown. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if obj is not large enough to hold the pixel data.

Parameters:
x - The minimum X coordinate of the pixel rectangle.
y - The minimum Y coordinate of the pixel rectangle.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
obj - A primitive array containing pixel data.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data is null.
ArrayIndexOutOfBoundsException sample code for java.lang.ArrayIndexOutOfBoundsException definition code for java.lang.ArrayIndexOutOfBoundsException - if the coordinates are not in bounds, or if obj is too small to hold the input.
See Also:
getNumDataElements() sample code for java.awt.image.SampleModel.getNumDataElements() definition code for java.awt.image.SampleModel.getNumDataElements() , getTransferType() sample code for java.awt.image.SampleModel.getTransferType() definition code for java.awt.image.SampleModel.getTransferType() , getDataElements(int, int, int, int, Object, DataBuffer) sample code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getDataElements(int, int, int, int, java.lang.Object, java.awt.image.DataBuffer) , DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer

getPixel sample code for java.awt.image.SampleModel.getPixel(int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, float[], java.awt.image.DataBuffer)

public float[] getPixel(int x,
                        int y,
                        float[] fArray,
                        DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the samples for the specified pixel in an array of float. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
fArray - If non-null, returns the samples in this array.
data - The DataBuffer containing the image data.
Returns:
the samples for the specified pixel.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setPixel(int, int, float[], DataBuffer) sample code for java.awt.image.SampleModel.setPixel(int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixel(int, int, float[], java.awt.image.DataBuffer)

getPixel sample code for java.awt.image.SampleModel.getPixel(int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, double[], java.awt.image.DataBuffer)

public double[] getPixel(int x,
                         int y,
                         double[] dArray,
                         DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the samples for the specified pixel in an array of double. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
dArray - If non-null, returns the samples in this array.
data - The DataBuffer containing the image data.
Returns:
the samples for the specified pixel.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setPixel(int, int, double[], DataBuffer) sample code for java.awt.image.SampleModel.setPixel(int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixel(int, int, double[], java.awt.image.DataBuffer)

getPixels sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, int[], java.awt.image.DataBuffer)

public int[] getPixels(int x,
                       int y,
                       int w,
                       int h,
                       int[] iArray,
                       DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns all samples for a rectangle of pixels in an int array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
iArray - If non-null, returns the samples in this array.
data - The DataBuffer containing the image data.
Returns:
the samples for the specified region of pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setPixels(int, int, int, int, int[], DataBuffer) sample code for java.awt.image.SampleModel.setPixels(int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixels(int, int, int, int, int[], java.awt.image.DataBuffer)

getPixels sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, float[], java.awt.image.DataBuffer)

public float[] getPixels(int x,
                         int y,
                         int w,
                         int h,
                         float[] fArray,
                         DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns all samples for a rectangle of pixels in a float array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
fArray - If non-null, returns the samples in this array.
data - The DataBuffer containing the image data.
Returns:
the samples for the specified region of pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setPixels(int, int, int, int, float[], DataBuffer) sample code for java.awt.image.SampleModel.setPixels(int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixels(int, int, int, int, float[], java.awt.image.DataBuffer)

getPixels sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, double[], java.awt.image.DataBuffer)

public double[] getPixels(int x,
                          int y,
                          int w,
                          int h,
                          double[] dArray,
                          DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns all samples for a rectangle of pixels in a double array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
dArray - If non-null, returns the samples in this array.
data - The DataBuffer containing the image data.
Returns:
the samples for the specified region of pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setPixels(int, int, int, int, double[], DataBuffer) sample code for java.awt.image.SampleModel.setPixels(int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setPixels(int, int, int, int, double[], java.awt.image.DataBuffer)

getSample sample code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer)

public abstract int getSample(int x,
                              int y,
                              int b,
                              DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the sample in a specified band for the pixel located at (x,y) as an int. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
b - The band to return.
data - The DataBuffer containing the image data.
Returns:
the sample in a specified band for the specified pixel.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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.
See Also:
setSample(int, int, int, int, DataBuffer) sample code for java.awt.image.SampleModel.setSample(int, int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSample(int, int, int, int, java.awt.image.DataBuffer)

getSampleFloat sample code for java.awt.image.SampleModel.getSampleFloat(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSampleFloat(int, int, int, java.awt.image.DataBuffer)

public float getSampleFloat(int x,
                            int y,
                            int b,
                            DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the sample in a specified band for the pixel located at (x,y) as a float. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
b - The band to return.
data - The DataBuffer containing the image data.
Returns:
the sample in a specified band for the specified pixel.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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.

getSampleDouble sample code for java.awt.image.SampleModel.getSampleDouble(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSampleDouble(int, int, int, java.awt.image.DataBuffer)

public double getSampleDouble(int x,
                              int y,
                              int b,
                              DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the sample in a specified band for a pixel located at (x,y) as a double. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
b - The band to return.
data - The DataBuffer containing the image data.
Returns:
the sample in a specified band for the specified pixel.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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.

getSamples sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer)

public int[] getSamples(int x,
                        int y,
                        int w,
                        int h,
                        int b,
                        int[] iArray,
                        DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the samples for a specified band for the specified rectangle of pixels in an int array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
b - The band to return.
iArray - If non-null, returns the samples in this array.
data - The DataBuffer containing the image data.
Returns:
the samples for the specified band for the specified region of pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setSamples(int, int, int, int, int, int[], DataBuffer) sample code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer)

getSamples sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer)

public float[] getSamples(int x,
                          int y,
                          int w,
                          int h,
                          int b,
                          float[] fArray,
                          DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the samples for a specified band for the specified rectangle of pixels in a float array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
b - The band to return.
fArray - If non-null, returns the samples in this array.
data - The DataBuffer containing the image data.
Returns:
the samples for the specified band for the specified region of pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setSamples(int, int, int, int, int, float[], DataBuffer) sample code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer)

getSamples sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer)

public double[] getSamples(int x,
                           int y,
                           int w,
                           int h,
                           int b,
                           double[] dArray,
                           DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Returns the samples for a specified band for a specified rectangle of pixels in a double array, one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
b - The band to return.
dArray - If non-null, returns the samples in this array.
data - The DataBuffer containing the image data.
Returns:
the samples for the specified band for the specified region of pixels.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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 output.
See Also:
setSamples(int, int, int, int, int, double[], DataBuffer) sample code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.setSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer)

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

public void setPixel(int x,
                     int y,
                     int[] iArray,
                     DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets a pixel in the DataBuffer using an int array of samples for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the pixel location.
y - The Y coordinate of the pixel location.
iArray - The input samples in an int array.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if iArray or data 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.
See Also:
getPixel(int, int, int[], DataBuffer) sample code for java.awt.image.SampleModel.getPixel(int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, int[], java.awt.image.DataBuffer)

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

public void setPixel(int x,
                     int y,
                     float[] fArray,
                     DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets a pixel in the DataBuffer using a float array of samples for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

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.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if fArray or data 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.
See Also:
getPixel(int, int, float[], DataBuffer) sample code for java.awt.image.SampleModel.getPixel(int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, float[], java.awt.image.DataBuffer)

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

public void setPixel(int x,
                     int y,
                     double[] dArray,
                     DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets a pixel in the DataBuffer using a double array of samples for input.

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.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if dArray or data 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.
See Also:
getPixel(int, int, double[], DataBuffer) sample code for java.awt.image.SampleModel.getPixel(int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixel(int, int, double[], java.awt.image.DataBuffer)

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

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      int[] iArray,
                      DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets all samples for a rectangle of pixels from an int array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
iArray - The input samples in an int array.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if iArray or data 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.
See Also:
getPixels(int, int, int, int, int[], DataBuffer) sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, int[], java.awt.image.DataBuffer)

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

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      float[] fArray,
                      DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets all samples for a rectangle of pixels from a float array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
fArray - The input samples in a float array.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if fArray or data 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.
See Also:
getPixels(int, int, int, int, float[], DataBuffer) sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, float[], java.awt.image.DataBuffer)

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

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      double[] dArray,
                      DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets all samples for a rectangle of pixels from a double array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
dArray - The input samples in a double array.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if dArray or data 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.
See Also:
getPixels(int, int, int, int, double[], DataBuffer) sample code for java.awt.image.SampleModel.getPixels(int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getPixels(int, int, int, int, double[], java.awt.image.DataBuffer)

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

public abstract void setSample(int x,
                               int y,
                               int b,
                               int s,
                               DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using an int for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

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 an int.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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.
See Also:
getSample(int, int, int, DataBuffer) sample code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer)

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

public void setSample(int x,
                      int y,
                      int b,
                      float s,
                      DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a float for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

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.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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.
See Also:
getSample(int, int, int, DataBuffer) sample code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer)

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

public void setSample(int x,
                      int y,
                      int b,
                      double s,
                      DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a double for input. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

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.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if data 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.
See Also:
getSample(int, int, int, DataBuffer) sample code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSample(int, int, int, java.awt.image.DataBuffer)

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

public void setSamples(int x,
                       int y,
                       int w,
                       int h,
                       int b,
                       int[] iArray,
                       DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets the samples in the specified band for the specified rectangle of pixels from an int array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
b - The band to set.
iArray - The input samples in an int array.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if iArray or data 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.
See Also:
getSamples(int, int, int, int, int, int[], DataBuffer) sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, int[], java.awt.image.DataBuffer)

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

public void setSamples(int x,
                       int y,
                       int w,
                       int h,
                       int b,
                       float[] fArray,
                       DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets the samples in the specified band for the specified rectangle of pixels from a float array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
b - The band to set.
fArray - The input samples in a float array.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if fArray or data 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.
See Also:
getSamples(int, int, int, int, int, float[], DataBuffer) sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, float[], java.awt.image.DataBuffer)

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

public void setSamples(int x,
                       int y,
                       int w,
                       int h,
                       int b,
                       double[] dArray,
                       DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  data)
Sets the samples in the specified band for the specified rectangle of pixels from a double array containing one sample per array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.

Parameters:
x - The X coordinate of the upper left pixel location.
y - The Y coordinate of the upper left pixel location.
w - The width of the pixel rectangle.
h - The height of the pixel rectangle.
b - The band to set.
dArray - The input samples in a double array.
data - The DataBuffer containing the image data.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if dArray or data 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.
See Also:
getSamples(int, int, int, int, int, double[], DataBuffer) sample code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer) definition code for java.awt.image.SampleModel.getSamples(int, int, int, int, int, double[], java.awt.image.DataBuffer)

createCompatibleSampleModel sample code for java.awt.image.SampleModel.createCompatibleSampleModel(int, int) definition code for java.awt.image.SampleModel.createCompatibleSampleModel(int, int)

public abstract SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  createCompatibleSampleModel(int w,
                                                        int h)
Creates a SampleModel which describes data in this SampleModel's format, but with a different width and height.

Parameters:
w - the width of the image data
h - the height of the image data
Returns:
a SampleModel describing the same image data as this SampleModel, but with a different size.

createSubsetSampleModel sample code for java.awt.image.SampleModel.createSubsetSampleModel(int[]) definition code for java.awt.image.SampleModel.createSubsetSampleModel(int[])

public abstract SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  createSubsetSampleModel(int[] bands)
Creates a new SampleModel with a subset of the bands of this SampleModel.

Parameters:
bands - the subset of bands of this SampleModel
Returns:
a SampleModel with a subset of bands of this SampleModel.

createDataBuffer sample code for java.awt.image.SampleModel.createDataBuffer() definition code for java.awt.image.SampleModel.createDataBuffer()

public abstract DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer  createDataBuffer()
Creates a DataBuffer that corresponds to this SampleModel. The DataBuffer's width and height will match this SampleModel's.

Returns:
a DataBuffer corresponding to this SampleModel.

getSampleSize sample code for java.awt.image.SampleModel.getSampleSize() definition code for java.awt.image.SampleModel.getSampleSize()

public abstract int[] getSampleSize()
Returns the size in bits of samples for all bands.

Returns:
the size of samples for all bands.

getSampleSize sample code for java.awt.image.SampleModel.getSampleSize(int) definition code for java.awt.image.SampleModel.getSampleSize(int)

public abstract int getSampleSize(int band)
Returns the size in bits of samples for the specified band.

Parameters:
band - the specified band
Returns:
the size of the samples of the specified band.