< prev index next >
src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java
Print this page
*** 76,86 ****
* @param w The width (in pixels) of the region of
* image data described.
* @param h The height (in pixels) of the region of image
* data described.
* @param numBands The number of bands for the image data.
! * @throws IllegalArgumentException if <code>dataType</code> is not
* one of the supported data types
*/
public BandedSampleModel(int dataType, int w, int h, int numBands) {
super(dataType, w, h, 1, w,
BandedSampleModel.createIndicesArray(numBands),
--- 76,86 ----
* @param w The width (in pixels) of the region of
* image data described.
* @param h The height (in pixels) of the region of image
* data described.
* @param numBands The number of bands for the image data.
! * @throws IllegalArgumentException if {@code dataType} is not
* one of the supported data types
*/
public BandedSampleModel(int dataType, int w, int h, int numBands) {
super(dataType, w, h, 1, w,
BandedSampleModel.createIndicesArray(numBands),
*** 98,108 ****
* @param h The height (in pixels) of the region of
* image data described.
* @param scanlineStride The line stride of the of the image data.
* @param bankIndices The bank index for each band.
* @param bandOffsets The band offset for each band.
! * @throws IllegalArgumentException if <code>dataType</code> is not
* one of the supported data types
*/
public BandedSampleModel(int dataType,
int w, int h,
int scanlineStride,
--- 98,108 ----
* @param h The height (in pixels) of the region of
* image data described.
* @param scanlineStride The line stride of the of the image data.
* @param bankIndices The bank index for each band.
* @param bandOffsets The band offset for each band.
! * @throws IllegalArgumentException if {@code dataType} is not
* one of the supported data types
*/
public BandedSampleModel(int dataType,
int w, int h,
int scanlineStride,
*** 117,135 ****
* width and height. The new BandedSampleModel will have the same
* number of bands, storage data type, and bank indices
* as this BandedSampleModel. The band offsets will be compressed
* such that the offset between bands will be w*pixelStride and
* the minimum of all of the band offsets is zero.
! * @param w the width of the resulting <code>BandedSampleModel</code>
! * @param h the height of the resulting <code>BandedSampleModel</code>
! * @return a new <code>BandedSampleModel</code> with the specified
* width and height.
! * @throws IllegalArgumentException if <code>w</code> or
! * <code>h</code> equals either
! * <code>Integer.MAX_VALUE</code> or
! * <code>Integer.MIN_VALUE</code>
! * @throws IllegalArgumentException if <code>dataType</code> is not
* one of the supported data types
*/
public SampleModel createCompatibleSampleModel(int w, int h) {
int[] bandOffs;
--- 117,135 ----
* width and height. The new BandedSampleModel will have the same
* number of bands, storage data type, and bank indices
* as this BandedSampleModel. The band offsets will be compressed
* such that the offset between bands will be w*pixelStride and
* the minimum of all of the band offsets is zero.
! * @param w the width of the resulting {@code BandedSampleModel}
! * @param h the height of the resulting {@code BandedSampleModel}
! * @return a new {@code BandedSampleModel} with the specified
* width and height.
! * @throws IllegalArgumentException if {@code w} or
! * {@code h} equals either
! * {@code Integer.MAX_VALUE} or
! * {@code Integer.MIN_VALUE}
! * @throws IllegalArgumentException if {@code dataType} is not
* one of the supported data types
*/
public SampleModel createCompatibleSampleModel(int w, int h) {
int[] bandOffs;
*** 152,162 ****
* can be used with. The new BandedSampleModel/DataBuffer
* combination will represent an image with a subset of the bands
* of the original BandedSampleModel/DataBuffer combination.
* @throws RasterFormatException if the number of bands is greater than
* the number of banks in this sample model.
! * @throws IllegalArgumentException if <code>dataType</code> is not
* one of the supported data types
*/
public SampleModel createSubsetSampleModel(int bands[]) {
if (bands.length > bankIndices.length)
throw new RasterFormatException("There are only " +
--- 152,162 ----
* can be used with. The new BandedSampleModel/DataBuffer
* combination will represent an image with a subset of the bands
* of the original BandedSampleModel/DataBuffer combination.
* @throws RasterFormatException if the number of bands is greater than
* the number of banks in this sample model.
! * @throws IllegalArgumentException if {@code dataType} is not
* one of the supported data types
*/
public SampleModel createSubsetSampleModel(int bands[]) {
if (bands.length > bankIndices.length)
throw new RasterFormatException("There are only " +
*** 177,187 ****
/**
* Creates a DataBuffer that corresponds to this BandedSampleModel,
* The DataBuffer's data type, number of banks, and size
* will be consistent with this BandedSampleModel.
! * @throws IllegalArgumentException if <code>dataType</code> is not
* one of the supported types.
*/
public DataBuffer createDataBuffer() {
DataBuffer dataBuffer = null;
--- 177,187 ----
/**
* Creates a DataBuffer that corresponds to this BandedSampleModel,
* The DataBuffer's data type, number of banks, and size
* will be consistent with this BandedSampleModel.
! * @throws IllegalArgumentException if {@code dataType} is not
* one of the supported types.
*/
public DataBuffer createDataBuffer() {
DataBuffer dataBuffer = null;
*** 221,234 ****
* element. 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.
* <p>
* The following code illustrates transferring data for one pixel from
! * DataBuffer <code>db1</code>, whose storage layout is described by
! * BandedSampleModel <code>bsm1</code>, to DataBuffer <code>db2</code>,
* whose storage layout is described by
! * BandedSampleModel <code>bsm2</code>.
* The transfer will generally be more efficient than using
* getPixel/setPixel.
* <pre>
* BandedSampleModel bsm1, bsm2;
* DataBufferInt db1, db2;
--- 221,234 ----
* element. 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.
* <p>
* The following code illustrates transferring data for one pixel from
! * DataBuffer {@code db1}, whose storage layout is described by
! * BandedSampleModel {@code bsm1}, to DataBuffer {@code db2},
* whose storage layout is described by
! * BandedSampleModel {@code bsm2}.
* The transfer will generally be more efficient than using
* getPixel/setPixel.
* <pre>
* BandedSampleModel bsm1, bsm2;
* DataBufferInt db1, db2;
*** 563,576 ****
* primitive array of type TransferType. For a BandedSampleModel,
* this will be the same as the data type, and samples are transferred
* one per array element.
* <p>
* The following code illustrates transferring data for one pixel from
! * DataBuffer <code>db1</code>, whose storage layout is described by
! * BandedSampleModel <code>bsm1</code>, to DataBuffer <code>db2</code>,
* whose storage layout is described by
! * BandedSampleModel <code>bsm2</code>.
* The transfer will generally be more efficient than using
* getPixel/setPixel.
* <pre>
* BandedSampleModel bsm1, bsm2;
* DataBufferInt db1, db2;
--- 563,576 ----
* primitive array of type TransferType. For a BandedSampleModel,
* this will be the same as the data type, and samples are transferred
* one per array element.
* <p>
* The following code illustrates transferring data for one pixel from
! * DataBuffer {@code db1}, whose storage layout is described by
! * BandedSampleModel {@code bsm1}, to DataBuffer {@code db2},
* whose storage layout is described by
! * BandedSampleModel {@code bsm2}.
* The transfer will generally be more efficient than using
* getPixel/setPixel.
* <pre>
* BandedSampleModel bsm1, bsm2;
* DataBufferInt db1, db2;
< prev index next >