Class ComponentSampleModel
- Direct Known Subclasses:
BandedSampleModel, PixelInterleavedSampleModel
DataBuffer.TYPE_BYTE,
DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT,
respectively), data for which each sample is a signed integral number
which can be stored in 16 bits (using DataBuffer.TYPE_SHORT),
or data for which each sample is a signed float or double quantity
(using DataBuffer.TYPE_FLOAT or
DataBuffer.TYPE_DOUBLE, respectively).
All samples of a given ComponentSampleModel
are stored with the same precision. All strides and offsets must be
non-negative. This class supports
TYPE_BYTE,
TYPE_USHORT,
TYPE_SHORT,
TYPE_INT,
TYPE_FLOAT,
TYPE_DOUBLE,- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]Offsets for all bands in data array elements.protected int[]Index for each bank storing a band of image data.protected intThe number of bands in thisComponentSampleModel.protected intThe number of banks in thisComponentSampleModel.protected intPixel stride (in data array elements) of the region of image data described by this ComponentSampleModel.protected intLine stride (in data array elements) of the region of image data described by this ComponentSampleModel.Fields declared in class SampleModel
dataType, height, widthModifier and TypeFieldDescriptionprotected intData type of the DataBuffer storing the pixel data.protected intHeight in pixels of the region of image data that this SampleModel describes.protected intWidth in pixels of the region of image data that this SampleModel describes. -
Constructor Summary
ConstructorsConstructorDescriptionComponentSampleModel(int dataType, int w, int h, int pixelStride, int scanlineStride, int[] bandOffsets) Constructs a ComponentSampleModel with the specified parameters.ComponentSampleModel(int dataType, int w, int h, int pixelStride, int scanlineStride, int[] bankIndices, int[] bandOffsets) Constructs a ComponentSampleModel with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptioncreateCompatibleSampleModel(int w, int h) Creates a newComponentSampleModelwith the specified width and height.Creates aDataBufferthat corresponds to thisComponentSampleModel.createSubsetSampleModel(int[] bands) Creates a new ComponentSampleModel with a subset of the bands of this ComponentSampleModel.final int[]Returns the band offset for all bands.final int[]Returns the bank indices for all bands.getDataElements(int x, int y, Object obj, DataBuffer data) Returns data for a single pixel in a primitive array of typeTransferType.final intReturns the number of data elements needed to transfer a pixel with thegetDataElements(int, int, Object, DataBuffer)andsetDataElements(int, int, Object, DataBuffer)methods.intgetOffset(int x, int y) Gets the offset for the first band of pixel (x,y).intgetOffset(int x, int y, int b) Gets the offset for band b of pixel (x,y).int[]getPixel(int x, int y, int[] iArray, DataBuffer data) Returns the samples for a specified pixel in an int array, one sample per array element.int[]getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) Returns all samples for a rectangle of pixels in an int array, one sample per array element.final intReturns the pixel stride of this ComponentSampleModel.intgetSample(int x, int y, int b, DataBuffer data) Returns the sample in a specified band for the pixel located at (x,y) as an int.doublegetSampleDouble(int x, int y, int b, DataBuffer data) Returns the sample in a specified band for a pixel located at (x,y) as a double.floatgetSampleFloat(int x, int y, int b, DataBuffer data) Returns the sample in a specified band for the pixel located at (x,y) as a float.int[]getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) Returns the samples for a specified band for the specified rectangle of pixels in an int array, one sample per array element.final int[]Returns the number of bits per sample for all bands.final intgetSampleSize(int band) Returns the number of bits per sample for the specified band.final intReturns the scanline stride of this ComponentSampleModel.voidsetDataElements(int x, int y, Object obj, DataBuffer data) Sets the data for a single pixel in the specifiedDataBufferfrom a primitive array of typeTransferType.voidsetPixel(int x, int y, int[] iArray, DataBuffer data) Sets a pixel in the DataBuffer using an int array of samples for input.voidsetPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) Sets all samples for a rectangle of pixels from an int array containing one sample per array element.voidsetSample(int x, int y, int b, double s, DataBuffer data) Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a double for input.voidsetSample(int x, int y, int b, float s, DataBuffer data) Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a float for input.voidsetSample(int x, int y, int b, int s, DataBuffer data) Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using an int for input.voidsetSamples(int x, int y, int w, int h, int b, int[] iArray, 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 declared in class SampleModel
getDataElements, getDataType, getHeight, getNumBands, getPixel, getPixel, getPixels, getPixels, getSamples, getSamples, getTransferType, getWidth, setDataElements, setPixel, setPixel, setPixels, setPixels, setSamples, setSamplesModifier and TypeMethodDescriptiongetDataElements(int x, int y, int w, int h, Object obj, DataBuffer data) Returns the pixel data for the specified rectangle of pixels in a primitive array of type TransferType.final intReturns the data type of the DataBuffer storing the pixel data.final intReturns the height in pixels.final intReturns the total number of bands of image data.double[]getPixel(int x, int y, double[] dArray, DataBuffer data) Returns the samples for the specified pixel in an array of double.float[]getPixel(int x, int y, float[] fArray, DataBuffer data) Returns the samples for the specified pixel in an array of float.double[]getPixels(int x, int y, int w, int h, double[] dArray, DataBuffer data) Returns all samples for a rectangle of pixels in a double array, one sample per array element.float[]getPixels(int x, int y, int w, int h, float[] fArray, DataBuffer data) Returns all samples for a rectangle of pixels in a float array, one sample per array element.double[]getSamples(int x, int y, int w, int h, int b, double[] dArray, 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(int x, int y, int w, int h, int b, float[] fArray, DataBuffer data) Returns the samples for a specified band for the specified rectangle of pixels in a float array, one sample per array element.intReturns the TransferType used to transfer pixels via the getDataElements and setDataElements methods.final intgetWidth()Returns the width in pixels.voidsetDataElements(int x, int y, int w, int h, Object obj, DataBuffer data) Sets the data for a rectangle of pixels in the specified DataBuffer from a primitive array of type TransferType.voidsetPixel(int x, int y, double[] dArray, DataBuffer data) Sets a pixel in the DataBuffer using a double array of samples for input.voidsetPixel(int x, int y, float[] fArray, DataBuffer data) Sets a pixel in the DataBuffer using a float array of samples for input.voidsetPixels(int x, int y, int w, int h, double[] dArray, DataBuffer data) Sets all samples for a rectangle of pixels from a double array containing one sample per array element.voidsetPixels(int x, int y, int w, int h, float[] fArray, DataBuffer data) Sets all samples for a rectangle of pixels from a float array containing one sample per array element.voidsetSamples(int x, int y, int w, int h, int b, double[] dArray, 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.voidsetSamples(int x, int y, int w, int h, int b, float[] fArray, 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.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Creates and returns a copy of this object.booleanIndicates whether some other object is "equal to" this one.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class<?> getClass()Returns the runtime class of thisObject.inthashCode()Returns a hash code value for this object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
bandOffsets
protected int[] bandOffsetsOffsets for all bands in data array elements. -
bankIndices
protected int[] bankIndicesIndex for each bank storing a band of image data. -
numBands
protected int numBandsThe number of bands in thisComponentSampleModel. -
numBanks
protected int numBanksThe number of banks in thisComponentSampleModel. -
scanlineStride
protected int scanlineStrideLine stride (in data array elements) of the region of image data described by this ComponentSampleModel. -
pixelStride
protected int pixelStridePixel stride (in data array elements) of the region of image data described by this ComponentSampleModel.
-
-
Constructor Details
-
ComponentSampleModel
public ComponentSampleModel(int dataType, int w, int h, int pixelStride, int scanlineStride, int[] bandOffsets) Constructs a ComponentSampleModel with the specified parameters. The number of bands will be given by the length of the bandOffsets array. All bands will be stored in the first bank of the DataBuffer.- Parameters:
dataType- the data type for storing samplesw- the width (in pixels) of the region of image data describedh- the height (in pixels) of the region of image data describedpixelStride- the pixel stride of the region of image data describedscanlineStride- the line stride of the region of image data describedbandOffsets- the offsets of all bands- Throws:
IllegalArgumentException- ifwandhare not both greater than 0IllegalArgumentException- if the product ofwandhis greater thanInteger.MAX_VALUEIllegalArgumentException- ifpixelStrideis less than 0IllegalArgumentException- ifscanlineStrideis less than 0NullPointerException- ifbandOffsetsisnullIllegalArgumentException- ifbandOffsets.lengthis 0IllegalArgumentException- ifdataTypeis not one of the supported data types for this sample model.
-
ComponentSampleModel
public ComponentSampleModel(int dataType, int w, int h, int pixelStride, int scanlineStride, int[] bankIndices, int[] bandOffsets) Constructs a ComponentSampleModel with the specified parameters. The number of bands will be given by the length of the bandOffsets array. Different bands may be stored in different banks of the DataBuffer.- Parameters:
dataType- the data type for storing samplesw- the width (in pixels) of the region of image data describedh- the height (in pixels) of the region of image data describedpixelStride- the pixel stride of the region of image data describedscanlineStride- The line stride of the region of image data describedbankIndices- the bank indices of all bandsbandOffsets- the band offsets of all bands- Throws:
IllegalArgumentException- ifwandhare not both greater than 0IllegalArgumentException- if the product ofwandhis greater thanInteger.MAX_VALUEIllegalArgumentException- ifpixelStrideis less than 0IllegalArgumentException- ifscanlineStrideis less than 0NullPointerException- ifbankIndicesisnullNullPointerException- ifbandOffsetsisnullIllegalArgumentException- ifbandOffsets.lengthis 0IllegalArgumentException- if the length ofbankIndicesdoes not equal the length ofbandOffsetsIllegalArgumentException- if any of the bank indices ofbandIndicesis less than 0IllegalArgumentException- ifdataTypeis not one of the supported data types for this sample model
-
-
Method Details
-
createCompatibleSampleModel
Creates a newComponentSampleModelwith the specified width and height. The newSampleModelwill have the same number of bands, storage data type, interleaving scheme, and pixel stride as thisSampleModel.- Specified by:
createCompatibleSampleModelin classSampleModel- Parameters:
w- the width of the resultingSampleModelh- the height of the resultingSampleModel- Returns:
- a new
ComponentSampleModelwith the specified size - Throws:
IllegalArgumentException- ifworhis not greater than 0
-
createSubsetSampleModel
Creates a new ComponentSampleModel with a subset of the bands of this ComponentSampleModel. The new ComponentSampleModel can be used with any DataBuffer that the existing ComponentSampleModel can be used with. The new ComponentSampleModel/DataBuffer combination will represent an image with a subset of the bands of the original ComponentSampleModel/DataBuffer combination.- Specified by:
createSubsetSampleModelin classSampleModel- Parameters:
bands- a subset of bands from thisComponentSampleModel- Returns:
- a
ComponentSampleModelcreated with a subset of bands from thisComponentSampleModel.
-
createDataBuffer
Creates aDataBufferthat corresponds to thisComponentSampleModel. TheDataBufferobject's data type, number of banks, and size are be consistent with thisComponentSampleModel.- Specified by:
createDataBufferin classSampleModel- Returns:
- a
DataBufferwhose data type, number of banks and size are consistent with thisComponentSampleModel.
-
getOffset
public int getOffset(int x, int y) Gets the offset for the first band of pixel (x,y). A sample of the first band can be retrieved from aDataBufferdatawith aComponentSampleModelcsmasdata.getElem(csm.getOffset(x, y));- Parameters:
x- the X location of the pixely- the Y location of the pixel- Returns:
- the offset for the first band of the specified pixel.
-
getOffset
public int getOffset(int x, int y, int b) Gets the offset for band b of pixel (x,y). A sample of bandbcan be retrieved from aDataBuffer datawith aComponentSampleModel csmasdata.getElem(csm.getOffset(x, y, b));- Parameters:
x- the X location of the specified pixely- the Y location of the specified pixelb- the specified band- Returns:
- the offset for the specified band of the specified pixel.
-
getSampleSize
public final int[] getSampleSize()Returns the number of bits per sample for all bands.- Specified by:
getSampleSizein classSampleModel- Returns:
- an array containing the number of bits per sample for all bands, where each element in the array represents a band.
-
getSampleSize
public final int getSampleSize(int band) Returns the number of bits per sample for the specified band.- Specified by:
getSampleSizein classSampleModel- Parameters:
band- the specified band- Returns:
- the number of bits per sample for the specified band.
-
getBankIndices
public final int[] getBankIndices()Returns the bank indices for all bands.- Returns:
- the bank indices for all bands.
-
getBandOffsets
public final int[] getBandOffsets()Returns the band offset for all bands.- Returns:
- the band offsets for all bands.
-
getScanlineStride
public final int getScanlineStride()Returns the scanline stride of this ComponentSampleModel.- Returns:
- the scanline stride of this
ComponentSampleModel.
-
getPixelStride
public final int getPixelStride()Returns the pixel stride of this ComponentSampleModel.- Returns:
- the pixel stride of this
ComponentSampleModel.
-
getNumDataElements
public final int getNumDataElements()Returns the number of data elements needed to transfer a pixel with thegetDataElements(int, int, Object, DataBuffer)andsetDataElements(int, int, Object, DataBuffer)methods. For aComponentSampleModel, this is identical to the number of bands.- Specified by:
getNumDataElementsin classSampleModel- Returns:
- the number of data elements needed to transfer a pixel with
the
getDataElementsandsetDataElementsmethods. - See Also:
-
getDataElements
Returns data for a single pixel in a primitive array of typeTransferType. For aComponentSampleModel, this is the same as the data type, and samples are returned one per array element. Generally,objshould be passed in asnull, so that theObjectis created automatically and is the right primitive data type.The following code illustrates transferring data for one pixel from
DataBuffer db1, whose storage layout is described byComponentSampleModel csm1, toDataBuffer db2, whose storage layout is described byComponentSampleModel csm2. The transfer is usually more efficient than usinggetPixelandsetPixel.ComponentSampleModel csm1, csm2; DataBufferInt db1, db2; csm2.setDataElements(x, y, csm1.getDataElements(x, y, null, db1), db2);UsinggetDataElementsandsetDataElementsto transfer between twoDataBuffer/SampleModelpairs is legitimate if theSampleModelobjects have the same number of bands, corresponding bands have the same number of bits per sample, and theTransferTypes are the same.If
objis notnull, it should be a primitive array of typeTransferType. Otherwise, aClassCastExceptionis thrown. AnArrayIndexOutOfBoundsExceptionmight be thrown if the coordinates are not in bounds, or ifobjis notnulland is not large enough to hold the pixel data.- Specified by:
getDataElementsin classSampleModel- Parameters:
x- the X coordinate of the pixel locationy- the Y coordinate of the pixel locationobj- if non-null, a primitive array in which to return the pixel datadata- theDataBuffercontaining the image data- Returns:
- the data of the specified pixel
- Throws:
NullPointerException- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates are not in bounds, or if obj is too small to hold the output.- See Also:
-
getPixel
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.- Overrides:
getPixelin classSampleModel- Parameters:
x- The X coordinate of the pixel locationy- The Y coordinate of the pixel locationiArray- If non-null, returns the samples in this arraydata- The DataBuffer containing the image data- Returns:
- the samples for the specified pixel.
- Throws:
NullPointerException- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates are not in bounds, or ifiArrayis too small to hold the output.- See Also:
-
getPixels
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.- Overrides:
getPixelsin classSampleModel- 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- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates are not in bounds, orworhis negative or ifiArrayis too small to hold the output.- See Also:
-
getSample
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.- Specified by:
getSamplein classSampleModel- 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- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates or the band index are not in bounds.- See Also:
-
getSampleFloat
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.- Overrides:
getSampleFloatin classSampleModel- 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- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates or the band index are not in bounds.
-
getSampleDouble
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.- Overrides:
getSampleDoublein classSampleModel- 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- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates or the band index are not in bounds.
-
getSamples
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.- Overrides:
getSamplesin classSampleModel- 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- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates or band index are not in bounds, orworhis negative, or ifiArrayis too small to hold the output.- See Also:
-
setDataElements
Sets the data for a single pixel in the specifiedDataBufferfrom a primitive array of typeTransferType. For aComponentSampleModel, this is the same as the data type, and samples are transferred one per array element.The following code illustrates transferring data for one pixel from
DataBuffer db1, whose storage layout is described byComponentSampleModel csm1, toDataBuffer db2, whose storage layout is described byComponentSampleModel csm2. The transfer is usually more efficient than usinggetPixelandsetPixel.ComponentSampleModel csm1, csm2; DataBufferInt db1, db2; csm2.setDataElements(x, y, csm1.getDataElements(x, y, null, db1), db2);UsinggetDataElementsandsetDataElementsto transfer between twoDataBuffer/SampleModelpairs is legitimate if theSampleModelobjects have the same number of bands, corresponding bands have the same number of bits per sample, and theTransferTypes are the same.A
ClassCastExceptionis thrown ifobjis not a primitive array of typeTransferType. AnArrayIndexOutOfBoundsExceptionmight be thrown if the coordinates are not in bounds, or ifobjis not large enough to hold the pixel data.- Specified by:
setDataElementsin classSampleModel- Parameters:
x- the X coordinate of the pixel locationy- the Y coordinate of the pixel locationobj- a primitive array containing pixel datadata- the DataBuffer containing the image data- Throws:
NullPointerException- ifobjordataisnull.ArrayIndexOutOfBoundsException- if the coordinates are not in bounds, or if obj is too small to hold the input.- See Also:
-
setPixel
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.- Overrides:
setPixelin classSampleModel- 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- ifiArrayordataisnull.ArrayIndexOutOfBoundsException- if the coordinates are not in bounds, or ifiArrayis too small to hold the input.- See Also:
-
setPixels
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.- Overrides:
setPixelsin classSampleModel- 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- ifiArrayordataisnull.ArrayIndexOutOfBoundsException- if the coordinates are not in bounds, orworhis negative or ifiArrayis too small to hold the input.- See Also:
-
setSample
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.- Specified by:
setSamplein classSampleModel- 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- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates or the band index are not in bounds.- See Also:
-
setSample
Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a float for input. The default implementation of this method casts the input float sample to an int and then calls thesetSample(int, int, int, DataBuffer)method using that int value. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.- Overrides:
setSamplein classSampleModel- 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- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates or the band index are not in bounds.- See Also:
-
setSample
Sets a sample in the specified band for the pixel located at (x,y) in the DataBuffer using a double for input. The default implementation of this method casts the input double sample to an int and then calls thesetSample(int, int, int, DataBuffer)method using that int value. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds.- Overrides:
setSamplein classSampleModel- 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- ifdataisnull.ArrayIndexOutOfBoundsException- if the coordinates or the band index are not in bounds.- See Also:
-
setSamples
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.- Overrides:
setSamplesin classSampleModel- 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- ifiArrayordataisnull.ArrayIndexOutOfBoundsException- if the coordinates or band index are not in bounds, orworhis negative, or ifiArrayis too small to hold the input.- See Also:
-