Generated by
JDiff

java.awt.image Documentation Differences

This file contains all the changes in documentation in the package java.awt.image as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class AffineTransformOp, constructor AffineTransformOp(AffineTransform, RenderingHints)

Constructs an AffineTransformOp given an affine transform. The interpolation type is determined from the RenderingHints object. If the interpolation hint is defined it will be used. Otherwise if the rendering quality hint is defined the interpolation type is determined from its value. If no hints are specified (hints is null) the interpolation type is TYPE_NEAREST_NEIGHBOR @param xform The AffineTransform to use for the operation. @param hints The RenderingHints object used to specify the interpolation type for the operation. @throws ImagingOpException if the transform is non-invertible. @see java.awt.RenderingHints#KEY_INTERPOLATION @see java.awt.RenderingHints#KEY_RENDERING
Class AffineTransformOp, constructor AffineTransformOp(AffineTransform, int)

Constructs an AffineTransformOp given an affine transform and the interpolation type. @param xform The AffineTransform to use for the operation. @param interpolationType One of the integer interpolation type constants defined by this class: TYPE_NEAREST_NEIGHBOR TYPE_BILINEAR @throws ImagingOpException if the transform is non-invertible.
Class AffineTransformOp, int getInterpolationType()

Returns the interpolation type used by this op. @return the interpolation type. @see #TYPE_NEAREST_NEIGHBOR @see #TYPE_BILINEAR
Class AffineTransformOp, Point2D getPoint2D(Point2D, Point2D)

Returns the location of the corresponding destination point given a point in the source. If dstPt is specified it is used to hold the return value. @param srcPt The Point2D that represents the source point. @param dstPt The Point2D in which to store the result. @return The Point2D in the destination that corresponds to the specified point in the source.

Class AreaAveragingScaleFilter

An ImageFilter class for scaling images using a simple area averaging algorithm that produces smoother results than the nearest neighbor algorithm. This class extends the basic ImageFilter Class to scale an existing image and provide a source for a new image containing the resampled image. The pixels in the source image are blended to produce pixels for an image of the specified size. The blending process is analogous to scaling up the source image to a multiple of the destination size using pixel replication and then scaling it back down to the destination size by simply averaging all the pixels in the supersized image that fall within a given pixel of the destination image. If the data from the source is not delivered in TopDownLeftRight order then the filter will back off to a simple pixel replication behavior and utilize the requestTopDownLeftRightResend() method to refilter the pixels in a better way at the end. It is meant to be used in conjunction with a FilteredImageSource object to produce scaled versions of existing images. @see FilteredImageSource @see ReplicateScaleFilter @see ImageFilter @version 1.10 0211 12/0203/0001 @author Jim Graham

Class BandCombineOp, WritableRaster filter(Raster, WritableRaster)

Transforms the Raster using the matrix specified in the constructor. An IllegalArgumentException may be thrown if the number of bands in the source or destination is incompatible with the matrix. See the class comments for more details.

If the destination is null it will be created with a number of bands equalling the number of rows in the matrix. No exception is thrown if the operation causes a data overflow. @param src The Raster to be filtered. @param destdst The Raster in which to store the results of the filter operation. @return The filtered Raster. @throws IllegalArgumentException If the number of bands in the source or destination is incompatible with the matrix.

Class BandCombineOp, Point2D getPoint2D(Point2D, Point2D)

Returns the location of the corresponding destination point given a point in the source Raster. If dstPt is specified it is used to hold the return value. Since this is not a geometric operation the point returned is the same as the specified srcPt. @param srcPt The Point2D that represents the point in the source Raster @param dstPt The Point2D in which to store the result. @return The Point2D in the destination image that corresponds to the specified point in the source image.

Class BandedSampleModel

This class represents image data which is stored in a band interleaved fashion and for which each sample of a pixel occupies one data element of the DataBuffer. It subclasses ComponentSampleModel but provides a more efficent implementation for accessing band interleaved image data than is provided by ComponentSampleModel. This class should typically be used when working with images which store sample data for each band in a different bank of the DataBuffer. Accessor methods are provided so that image data can be manipulated directly. Pixel stride is the number of data array elements between two samples for the same band on the same scanline. The pixel stride for a BandedSampleModel is one. Scanline stride is the number of data array elements between a given sample and the corresponding sample in the same column of the next scanline. Band offsets denote the number of data array elements from the first data array element of the bank of the DataBuffer holding each band to the first sample of the band. The bands are numbered from 0 to N-1. Bank indices denote the correspondence between a bank of the data buffer and a band of image data. This class supports TYPE_BYTE TYPE_USHORT TYPE_SHORT TYPE_INT TYPE_FLOAT and TYPE_DOUBLE datatypes
Class BandedSampleModel, constructor BandedSampleModel(int, int, int, int, int[], int[])

Constructs a BandedSampleModel with the specified parameters. The number of bands will be inferred from the lengths of the bandOffsets bankIndices arrays which must be equal. The pixel stride will be one data element. @param dataType The data type for storing samples. @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. @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 dataType is not one of the supported data types
Class BandedSampleModel, DataBuffer createDataBuffer()

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 dataType is not eitherone DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT orof DataBuffer.TYPE_SHORTthe orsupported DataBuffertypes.TYPE_INT
Class BandedSampleModel, Object getDataElements(int, int, Object, DataBuffer)

Returns data for a single pixel in a primitive array of type TransferType. For a BandedSampleModel this will be the same as the data type and samples will be returned one per array 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.

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

 BandedSampleModel bsm1 bsm2; DataBufferInt db1 db2; bsm2.setDataElements(x y bsm1.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. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param obj If non-null a primitive array in which to return the pixel data. @param data The DataBuffer containing the image data. @return the data for the specified pixel. @see #setDataElements(int int Object DataBuffer)

Class BandedSampleModel, int[] getPixel(int, int, int[], DataBuffer)

Returns all samples for the specified pixel in an int array. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data @return the samples for the specified pixel. @see #setPixel(int int int[] DataBuffer)
Class BandedSampleModel, int[] getPixels(int, int, int, int, int[], DataBuffer)

Returns all samples for the specified rectangle of pixels in an int array one sample per data array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the upper left pixel location. @param  y The Y coordinatecoordinates of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data @return the samples for the pixels within the specified region. @see #setPixels(int int int int int[] DataBuffer)
Class BandedSampleModel, int getSample(int, int, int, DataBuffer)

Returns as int the sample in a specified band for the pixel located at (x y). ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data @return the sample in the specified band for the specified pixel. @see #setSample(int int int int DataBuffer)
Class BandedSampleModel, double getSampleDouble(int, int, int, DataBuffer)

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. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data @return a double value that represents the sample in the specified band for the specified pixel.
Class BandedSampleModel, float getSampleFloat(int, int, int, DataBuffer)

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. @param x The X coordinate of the pixel location. @param  y The Y coordinateThecoordinates of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data @return a float value that represents the sample in the specified band for the specified pixel.
Class BandedSampleModel, int[] getSamples(int, int, int, int, int, int[], DataBuffer)

Returns the samples in a specified band for the specified rectangle of pixels in an int array one sample per data array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the upper left pixel location. @param  y The Y coordinatecoordinates of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to return. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data @return the samples in the specified band for the pixels within the specified region. @see #setSamples(int int int int int int[] DataBuffer)
Class BandedSampleModel, void setDataElements(int, int, Object, DataBuffer)

Sets the data for a single pixel in the specified DataBuffer from a 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.

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

 BandedSampleModel bsm1 bsm2; DataBufferInt db1 db2; bsm2.setDataElements(x y bsm1.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. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param obj If non-null returns the primitive array in this object. @param data The DataBuffer containing the image data. @see #getDataElements(int int Object DataBuffer)

Class BandedSampleModel, void setPixel(int, int, int[], DataBuffer)

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. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getPixel(int int int[] DataBuffer)
Class BandedSampleModel, void setPixels(int, int, int, int, int[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param  y The Y coordinatecoordinates of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getPixels(int int int int int[] DataBuffer)
Class BandedSampleModel, void setSample(int, int, int, double, DataBuffer)

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. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to set. @param s The input sample as a double. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer)
Class BandedSampleModel, void setSample(int, int, int, float, DataBuffer)

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. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to set. @param s The input sample as a float. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer)
Class BandedSampleModel, void setSample(int, int, int, int, DataBuffer)

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. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to set. @param s The input sample as an int. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer)
Class BandedSampleModel, void setSamples(int, int, int, int, int, int[], DataBuffer)

Sets the samples in the specified band for the specified rectangle of pixels from an int array containing one sample per data array element. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the upper left pixel location. @param  y The Y coordinatecoordinates of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to set. @param iArray The input sample array. @param data The DataBuffer containing the image data. @see #getSamples(int int int int int int[] DataBuffer)

Class BufferedImage, constructor BufferedImage(ColorModel, WritableRaster, boolean, Hashtable)

Constructs a new BufferedImage with a specified ColorModel and Raster. If the number and types of bands in the SampleModel of the Raster do not match the number and types required by the ColorModel to represent its color and alpha components a RasterFormatException is thrown. This method can multiply or divide the color Raster data by alpha to match the alphaPremultiplied state in the ColorModel. Properties for this BufferedImage can be established by passing in a Hashtable of String/Object pairs. @param ColorModelcm ColorModel for the new image @param raster Raster for the image data @param isRasterPremultiplied if true the data in the raster has been premultiplied with alpha. @param properties Hashtable of String/Object pairs. @exception RasterFormatException if the number and types of bands in the SampleModel of the Raster do not match the number and types required by the ColorModel to represent its color and alpha components. @exception IllegalArgumentException if raster is incompatible with cm @see ColorModel @see Raster @see WritableRaster
Class BufferedImage, constructor BufferedImage(int, int, int, IndexColorModel)

Constructs a BufferedImage of one of the predefined image types: TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED.

If the image type is TYPE_BYTE_BINARY the number of entries in the color model is used to determine whether the image should have 1 2 or 4 bits per pixel. If the color model has 1 or 2 entries the image will have 1 bit per pixel. If it has 3 or 4 entries the image with have 2 bits per pixel. If it has between 5 and 16 entries the image will have 4 bits per pixel. Otherwise an IllegalArgumentException will be thrown. @param width width of the created image @param height height of the created image @param imageType type of the created image @param cm IndexColorModel of the created image @throws IllegalArgumentException if the imageType is not TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED or if the imageType is TYPE_BYTE_BINARY and the color map has more than 16 entries. @see #TYPE_BYTE_BINARY @see #TYPE_BYTE_INDEXED

Class BufferedImage, Raster getData()

Returns the image as one large tile. The Raster returned is a copy of the image data is not updated if the image is changed. @return a Raster that is a copy of the image data. @see #setData(Raster)
Class BufferedImage, Raster getData(Rectangle)

Computes and returns an arbitrary region of the BufferedImage. The Raster returned is a copy of the image data and is not updated if the image is changed. @param rect the region of the BufferedImage to be returned. @return a Raster that is a copy of the image data of the specified region of the BufferedImage @see #setData(Raster)
Class BufferedImage, int getRGB(int, int)

Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace. Color conversion takes place if this default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. @param x  y the coordinates of the pixel from which to get the pixel in the default RGB color model and sRGB color space @return an integer pixel in the default RGB color model and default sRGB colorspace. @see #setRGB(int int int) @see #setRGB(int int int int int[] int int)
Class BufferedImage, int[] getRGB(int, int, int, int, int[], int, int)

Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space from a portion of the image data. Color conversion takes place if the default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. With a specified coordinate (x  y) in the image the ARGB pixel can be accessed in this way:
 pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)]; 
@param startX   startY the starting coordinates @param w width of region @param h height of region @param rgbArray if not null the rgb pixels are written here @param offset offset into the rgbArray @param scansize scanline stride for the rgbArray @return array of RGB pixels. @exception IllegalArgumentException if an unknown datatype is specified @see #setRGB(int int int) @see #setRGB(int int int int int[] int int)
Class BufferedImage, void setData(Raster)

Sets a rectangular region of the image to the contents of the specified Raster r which is assumed to be in the same coordinate space as the BufferedImage. The operation is clipped to the bounds of the BufferedImage. @param r the specified Raster @see #getData @see #getData(Rectangle)
Class BufferedImage, void setRGB(int, int, int)

Sets a pixel in this BufferedImage to the specified RGB value. The pixel is assumed to be in the default RGB color model TYPE_INT_ARGB and default sRGB color space. For images with an IndexColorModel the index with the nearest color is chosen. @param x  y the coordinates of the pixel to set @param rgb the RGB value @see #getRGB(int int) @see #getRGB(int int int int int[] int int)
Class BufferedImage, void setRGB(int, int, int, int, int[], int, int)

Sets an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space into a portion of the image data. Color conversion takes place if the default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. With a specified coordinate (x  y) in the this image the ARGB pixel can be accessed in this way:
 pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)]; 
WARNING: No dithering takes place. @param startX  startY the starting coordinates @param w width of the region @param h height of the region @param rgbArray the rgb pixels @param offset offset into the rgbArray @param scansize scanline stride for the rgbArray @see #getRGB(int int) @see #getRGB(int int int int int[] int int)
Class BufferedImage, int TYPE_BYTE_BINARY

Represents an opaque byte-packed binary1 2 or 4 bit image. The image has an IndexColorModel without alpha. When this type is used as the imageType argument to the BufferedImage constructor that takes an imageType argument but no ColorModel argument ana IndexColorModel1-bit image is created with an IndexColorModel with two colors in the default sRGB ColorSpace: {0  0  0} and {255  255  255}.

Images with 2 or 4 bits per pixel may be constructed via the BufferedImage constructor that takes a ColorModel argument by supplying a ColorModel with an appropriate map size.

Images with 8 bits per pixel should use the image types TYPE_BYTE_INDEXED or TYPE_BYTE_GRAY depending on their ColorModel.


Class BufferedImageFilter, constructor BufferedImageFilter(BufferedImageOp)

Constructs a BufferedImageFilter with the specified single-source/single-destination operator. @param op the specified BufferedImageOp to use to filter a BufferedImage @throws NullPointerException if op is null

Class BufferedImageOp

This interface describes single-input/single-output operations performed on BufferedImage objects. It is implemented by such classes as AffineTransformOp ConvolveOp BandCombineOpColorConvertOp RescaleOp and LookupOp. These objects can be passed into a BufferedImageFilter to operate on a BufferedImage in the ImageProducer-ImageFilter-ImageConsumer paradigm. This interface cannot be used to describe more sophisticated Ops such as

onesClasses that take multiple sources. Each class implementingimplement this interface willmust specify whether or not itthey will allow an in-place filtering-- operationfilter (i.e.operations where the source object is equal to the destination object). Note that the

This interface restrictioncannot be used to single-inputdescribe more sophisticated operations such as those that take multiple sources. Note that this restriction also means that the values of the destination pixels prior to the operation are not used as input to the filter operation. @see BufferedImage @see BufferedImageFilter @see AffineTransformOp @see BandCombineOp @see ColorConvertOp @see ConvolveOp @see LookupOp @see RescaleOp @version 10 Feb 1997

Class BufferedImageOp, BufferedImage createCompatibleDestImage(BufferedImage, ColorModel)

Creates a zeroed destination image with the correct size and number of bands. TheAn IllegalArgumentException may be thrown if the source image is incompatible with the types of images allowed by the class implementing this filter. @param src Source imageThe forBufferedImage the filterto be operation.filtered @param destCM ColorModel of the destination. If null the ColorModel of the source will beis used. @return The zeroed destination image.
Class BufferedImageOp, BufferedImage filter(BufferedImage, BufferedImage)

Performs a single-input/single-output operation on a BufferedImage. If the color models for the two images do not match a color conversion into the destination color model will beis performed. If the destination image is null a BufferedImage with an appropriate ColorModel will beis created. The

An IllegalArgumentException may be thrown if the source and/or destination image is incompatible with the types of images $ allowed by the class implementing this filter. @param src The BufferedImage to be filtered @param dest The BufferedImage in which to store the results$ @return The filtered BufferedImage. @throws IllegalArgumentException If the source and/or destination image is not compatible with the types of images allowed by the class implementing this filter.

Class BufferedImageOp, Rectangle2D getBounds2D(BufferedImage)

Returns the bounding box of the filtered destination image. TheAn IllegalArgumentException may be thrown if the source image is incompatible with the types of images allowed by the class implementing this filter. @param src The BufferedImage to be filtered @return The Rectangle2D representing the destination image's bounding box.
Class BufferedImageOp, Point2D getPoint2D(Point2D, Point2D)

Returns the location of the corresponding destination point given a point in the source image. If dstPt is non-nullspecified it will beis used to hold the return value. @param srcPt the Point2D that represents the point in the source image @param dstPt The Point2D in which to store the result @return The Point2D in the destination image that corresponds to the specified point in the source image.
Class BufferedImageOp, RenderingHints getRenderingHints()

Returns the rendering hints for this BufferedImageOpoperation. Returns null@return ifThe noRenderingHints hints have beenobject for this set.BufferedImageOp

Class ColorConvertOp, constructor ColorConvertOp(ColorSpace, ColorSpace, RenderingHints)

Constructs a new ColorConvertOp from two ColorSpace objects. The RenderingHints argument may be null. This Op is primarily useful for calling the filter method on Rasters in which case the two ColorSpaces define the operation to be performed on the Rasters. In that case the number of bands in the source Raster must match the number of components in srcCspace and the number of bands in the destination Raster must match the number of components in dstCspace. For BufferedImages the two ColorSpaces define intermediate spaces through which the source is converted before being converted to the destination space. @param srcCspace the source ColorSpace @param dstCspace the destination ColorSpace @param hints the RenderingHints object used to control the color conversion or null @throws NullPointerException if either srcCspace or dstCspace is null
Class ColorConvertOp, constructor ColorConvertOp(ColorSpace, RenderingHints)

Constructs a new ColorConvertOp from a ColorSpace object. The RenderingHints argument may be null. This Op can be used only with BufferedImages and is primarily useful when the BufferedImage filter} method is invoked with a destination argument of null. In that case the ColorSpace defines the destination color space for the destination created by the filter method. Otherwise the ColorSpace defines an intermediate space to which the source is converted before being converted to the destination space. @param cspace defines the destination ColorSpace or an intermediate ColorSpace @param hints the RenderingHints object used to control the color conversion or null @throws NullPointerException if cspace is null
Class ColorConvertOp, constructor ColorConvertOp(ICC_Profile[], RenderingHints)

Constructs a new ColorConvertOp from an array of ICC_Profiles. The RenderingHints argument may be null. The sequence of profiles may include profiles that represent color spaces profiles that represent effects etc. If the whole sequence does not represent a well-defined color conversion an exception is thrown.

For BufferedImages if the ColorSpace of the source BufferedImage does not match the requirements of the first profile in the array the first conversion is to an appropriate ColorSpace. If the requirements of the last profile in the array are not met by the ColorSpace of the destination BufferedImage the last conversion is to the destination's ColorSpace.

For Rasters the number of bands in the source Raster must match the requirements of the first profile in the array and the number of bands in the destination Raster must match the requirements of the last profile in the array. The array must have at least two elements or calling the filter method for Rasters will throw an IllegalArgumentException. @param profiles the array of ICC_Profile objects @param hints the RenderingHints object used to control the color conversion or null @exception IllegalArgumentException when the profile sequence does not specify a well-defined color conversion @exception NullPointerException if profiles is null

Class ColorConvertOp, BufferedImage createCompatibleDestImage(BufferedImage, ColorModel)

Creates a zeroed destination image with the correct size and number of bands given this source. @param src Source image for the filter operation. @param destCM ColorModel of the destination. If null an appropriate ColorModel will be used. @return a BufferedImage with the correct size and number of bands from the specified src. @throws IllegalArgumentException if destCM is null and this ColorConvertOp was created without any ICC_Profile or ColorSpace defined for the destination

Class ColorModel

The ColorModel abstract class encapsulates the methods for translating a pixel value to color components (for example red green and blue) and an alpha component. In order to render an image to the screen a printer or another image pixel values must be converted to color and alpha components. As arguments to or return values from methods of this class pixels are represented as 32-bit ints or as arrays of primitive types. The number order and interpretation of color components for a ColorModel is specified by its ColorSpace. A ColorModel used with pixel data that does not include alpha information treats all pixels as opaque which is an alpha value of 1.0.

This ColorModel class supports two representations of pixel values. A pixel value can be a single 32-bit int or an array of primitive types. The Java(tm) Platform 1.0 and 1.1 APIs represented pixels as single byte or single int values. For purposes of the ColorModel class pixel value arguments were passed as ints. The Java(tm) 2 Platform API introduced additional classes for representing images. With BufferedImage or RenderedImage objects based on Raster and SampleModel classes pixel values might not be conveniently representable as a single int. Consequently ColorModel now has methods that accept pixel values represented as arrays of primitive types. The primitive type used by a particular ColorModel object is called its transfer type.

ColorModel objects used with images for which pixel values are not conveniently representable as a single int throw an IllegalArgumentException when methods taking a single int pixel argument are called. Subclasses of ColorModel must specify the conditions under which this occurs. This does not occur with DirectColorModel or IndexColorModel objects.

Currently the transfer types supported by the Java 2D(tm) API are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT and DataBuffer.TYPE_INTDOUBLE. Most rendering operations will perform much faster when using ColorModels and images based on the first three of these types. In addition some image filtering operations are not supported for ColorModels and images based on the latter three types. The transfer type for a particular ColorModel object is specified when the object is created either explicitly or by default. All subclasses of ColorModel must specify what the possible transfer types are and how the number of elements in the primitive arrays representing pixels is determined.

For BufferedImages the transfer type of its Raster and of the Raster object's SampleModel (available from the getTransferType methods of these classes) must match that of the ColorModel. The number of elements in an array representing a pixel for the Raster and SampleModel (available from the getNumDataElements methods of these classes) must match that of the ColorModel.

The algorithm used to convert from pixel values to color and alpha components varies by subclass. For example there is not necessarily a one-to-one correspondence between samples obtained from the SampleModel of a BufferedImage object's Raster and color/alpha components. Even when there is such a correspondence the number of bits in a sample is not necessarily the same as the number of bits in the corresponding color/alpha component. Each subclass must specify how the translation from pixel values to color/alpha components is done.

Methods in the ColorModel class use two different representations of color and alpha components - a normalized form and an unnormalized form. In the normalized form each component is a float value between some minimum and maximum values. For the alpha component the minimum is 0.0 and the maximum is 1.0. For color components the minimum and maximum values for each component can be obtained from the ColorSpace object. These values will often be 0.0 and 1.0 (e.g. normalized component values for the default sRGB color space range from 0.0 to 1.0) but some color spaces have component values with different upper and lower limits. These limits can be obtained using the getMinValue and getMaxValue methods of the ColorSpace class. Normalized color component values are not premultiplied. All ColorModels must support the normalized form.

In the unnormalized form each component is an unsigned integral value between 0 and 2n - 1 where n is the number of significant bits for a particular component. If pixel values for a particular ColorModel represent color samples premultiplied by the alpha sample unnormalized color component values are also premultiplied. In theThe normalizedunnormalized form eachis used only with instances of ColorModel whose ColorSpace has minimum component isvalues of 0.0 for all components and maximum values of 1.0 for all components. The unnormalized form for color and alpha components can be a convenient representation for floatColorModels valuewhose normalized component values all lie between 0.0 and 1.0. NormalizedIn colorsuch cases the integral value 0 maps to 0.0 and the value 2n - 1 maps to 1.0. In other cases such as when the normalized component values arecan be either negative or positive the unnormalized form is not premultipliedconvenient. Such ColorModel objects throw an IllegalArgumentException when methods involving an unnormalized argument are called. Subclasses of ColorModel must specify the conditions under which this occurs. @see IndexColorModel @see ComponentColorModel @see PackedColorModel @see DirectColorModel @see java.awt.Image @see BufferedImage @see RenderedImage @see java.awt.color.ColorSpace @see SampleModel @see Raster @see DataBuffer @version 10 Feb 1997

Class ColorModel, constructor ColorModel(int, int[], ColorSpace, boolean, boolean, int, int)

Constructs a ColorModel that translates pixel values to color/alpha components. Color components will be in the specified ColorSpace. pixel_bits is the number of bits in the pixel values. The bits array specifies the number of significant bits per color and alpha component. Its length should be the number of components in the ColorSpace if there is no alpha information in the pixel values or one more than this number if there is alpha information. hasAlpha indicates whether or not alpha information is present. The boolean isAlphaPremultiplied specifies how to interpret pixel values in which color and alpha information are represented as separate spatial bands. If the boolean is true color samples are assumed to have been multiplied by the alpha sample. The transparency specifies what alpha values can be represented by this color model. The transfer type is the type of primitive array used to represent pixel values. Note that the bits array contains the number of significant bits per color/alpha component after the translation from pixel values. For example for an IndexColorModel with pixel_bits equal to 16 the bits array might have four elements with each element set to 8. @param pixel_bits the number of bits in the pixel values @param bits array that specifies the number of significant bits per color and alpha component @param cspace the specified ColorSpace @param hasAlpha true if alpha information is present; false otherwise @param isAlphaPremultiplied true if color samples are assumed to be premultiplied by the alpha samples; false otherwise @param transparency what alpha values can be represented by this color model @param transferType the type of the array used to represent pixel values @throws IllegalArgumentException if the length of the bit array is less than the number of color or alpha components in this ColorModel or if the transparency is not a valid value. @throws IllegalArgumentException if the sum of the number of bits in bits is less than 1 or if any of the elements in bits is less than 0. @see java.awt.Transparency
Class ColorModel, int[] getComponents(Object, int[], int)

Returns an array of unnormalized color/alpha components given a pixel in this ColorModel. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. If pixel is not a primitive array of type transferType a ClassCastException is thrown. An IllegalArgumentException will be thrown if color component values for this ColorModel are not conveniently representable in the unnormalized form. An ArrayIndexOutOfBoundsException is thrown if pixel is not large enough to hold a pixel value for this ColorModel. This method can be used to retrieve the components for a specific pixel value in any ColorModel. If the components array is null a new array will be allocated. The components array will be returned. Color/alpha components are stored in the components array starting at offset (even if the array is allocated by this method). An ArrayIndexOutOfBoundsException is thrown if the components array is not null and is not large enough to hold all the color and alpha components (starting at offset). Since ColorModel is an abstract class any instance is an instance of a subclass. Subclasses must override this method since the implementation in this abstract class throws an UnsupportedOperationException. @param pixel the specified pixel @param components an array that receives the color and alpha components of the specified pixel @param offset the index into the components array at which to begin storing the color and alpha components of the specified pixel @return an array containing the color and alpha components of the specified pixel starting at the specified offset. @throws UnsupportedOperationException if this method is not supported by this ColorModel
Class ColorModel, int[] getComponents(int, int[], int)

Returns an array of unnormalized color/alpha components given a pixel in this ColorModel. The pixel value is specified as an int. An IllegalArgumentException will be thrown if pixel values for this ColorModel are not conveniently representable as a single int or if color component values for this ColorModel are not conveniently representable in the unnormalized form. For example this method can be used to retrieve the components for a specific pixel value in a DirectColorModel. If the components array is null a new array will be allocated. The components array will be returned. Color/alpha components are stored in the components array starting at offset (even if the array is allocated by this method). An ArrayIndexOutOfBoundsException is thrown if the components array is not null and is not large enough to hold all the color and alpha components (starting at offset). Since ColorModel is an abstract class any instance is an instance of a subclass. Subclasses must override this method since the implementation in this abstract class throws an UnsupportedOperationException. @param pixel the specified pixel @param components the array to receive the color and alpha components of the specified pixel @param offset the offset into the components array at which to start storing the color and alpha components @return an array containing the color and alpha components of the specified pixel starting at the specified offset. @throws UnsupportedOperationException if this method is not supported by this ColorModel
Class ColorModel, float[] getNormalizedComponents(int[], int, float[], int)

Returns an array of all of the color/alpha components in normalized form given an unnormalized component array. Unnormalized components are unsigned integral values between 0 and 2n - 1 where n is the number of bits for a particular component. Normalized components are float values between 0.0a per component minimum and 1maximum specified by the ColorSpace object for this ColorModel.0 An IllegalArgumentException will be thrown if color component values for this ColorModel are not conveniently representable in the unnormalized form. If the normComponents array is null a new array will be allocated. The normComponents array will be returned. Color/alpha components are stored in the normComponents array starting at normOffset (even if the array is allocated by this method). An ArrayIndexOutOfBoundsException is thrown if the normComponents array is not null and is not large enough to hold all the color and alpha components (starting at normOffset). An IllegalArgumentException is thrown if the components array is not large enough to hold all the color and alpha components starting at offset.

Since ColorModel is an abstract class any instance is an instance of a subclass. The default implementation of this method in this abstract class assumes that component values for this class are conveniently representable in the unnormalized form. Therefore subclasses which may have instances which do not support the unnormalized form must override this method. @param components an array containing unnormalized components @param offset the offset into the components array at which to start retrieving unnormalized components @param normComponents an array that receives the components fromnormalized components @param normOffset the index into normComponents at which to begin storing unnormalized components fromnormalized components @return an array containing normalized color and alpha components. @throws IllegalArgumentException If the component values for this ColorModel are not conveniently representable in the unnormalized form. @throws UnsupportedOperationException if the constructor of this ColorModel called the super(bits) constructor but did not override this method. See the constructor #ColorModel(int) @throws UnsupportedOperationException if this method is unable to determine the number of bits per component

Class ColorModel, int[] getUnnormalizedComponents(float[], int, int[], int)

Returns an array of all of the color/alpha components in unnormalized form given a normalized component array. Unnormalized components are unsigned integral values between 0 and 2n - 1 where n is the number of bits for a particular component. Normalized components are float values between 0.0a per component minimum and 1maximum specified by the ColorSpace object for this ColorModel.0 An IllegalArgumentException will be thrown if color component values for this ColorModel are not conveniently representable in the unnormalized form. If the components array is null a new array will be allocated. The components array will be returned. Color/alpha components are stored in the components array starting at offset (even if the array is allocated by this method). An ArrayIndexOutOfBoundsException is thrown if the components array is not null and is not large enough to hold all the color and alpha components (starting at offset). An IllegalArgumentException is thrown if the normComponents array is not large enough to hold all the color and alpha components starting at normOffset. @param normComponents an array containing normalized components @param normOffset the offset into the normComponents array at which to start retrieving normalized components @param components an array that receives the components from normComponents @param offset the index into components at which to begin storing normalized components from normComponents @return an array containing unnormalized color and alpha components. @throws IllegalArgumentException If the component values for this ColorModel are not conveniently representable in the unnormalized form. @throws IllegalArgumentException if the length of normComponents minus normOffset is less than numComponents @throws UnsupportedOperationException if the constructor of this ColorModel called the super(bits) constructor but did not override this method. See the constructor #ColorModel(int)

Class ComponentColorModel

A ColorModel class that works with pixel values that represent color and alpha information as separate samples and that store each sample in a separate data element. This class can be used with an arbitrary ColorSpace. The number of color samples in the pixel values must be same as the number of color components in the ColorSpace. There may be a single alpha sample.

For those methods that use a primitive array pixel representation of type transferType the array length is the same as the number of color and alpha samples. Color samples are stored first in the array followed by the alpha sample if present. The order of the color samples is specified by the ColorSpace. Typically this order reflects the name of the color space type. For example for TYPE_RGB index 0 corresponds to red index 1 to green and index 2 to blue. The transfer types supported are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT and DataBuffer.TYPE_INT.

The translation from pixel sample values to color/alpha components for display or processing purposes is based on a one-to-one correspondence of samples to components. Depending on the transfer type used to create an instance of ComponentColorModel the pixel sample values represented by that instance may be signed or unsigned and may be of integral type or float or double (see below for details). The translation from sample values to normalized color/alpha components must follow certain rules. For float and double samples the translation is an identity i.e. normalized component values are equal to the corresponding sample values. For integral samples the translation should be only a simple scale and offset where the scale and offset constants may be different for each component. The result of applying the scale and offset constants is a set of color/alpha component values which are guaranteed to fall within a certain range. Typically the range for a color component will be the range defined by the getMinValue and getMaxValue methods of the ColorSpace class. The range for an alpha component should be 0.0 to 1.0.

Instances of ComponentColorModel created with transfer types DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT and DataBuffer.TYPE_INT have pixel sample values which are treated as unsigned integral values. The number of bits in a color or alpha sample of a pixel value might not be the same as the number of bits for the corresponding color or alpha componentsample passed to the ComponentColorModel(ColorSpace int[] boolean boolean int int) constructor. ThisIn that case this class assumes that the least significant n bits of a sample value hold the component value where n is the number of significant bits for the component passed to the constructor. It also assumes that any higher-order bits in a sample value are zero. Thus sample values range from 0 to 2n - 1. This class maps these sample values to normalized color component values such that 0 maps to the value obtained from the ColorSpace's getMinValue method for each component and 2n - 1 maps to the value obtained from getMaxValue. To create a ComponentColorModel with a different color sample mapping requires subclassing this class and overriding the getNormalizedComponents(Object float[] int) method. The mapping for an alpha sample always maps 0 to 0.0 and 2n - 1 to 1.0.

For instances with unsigned sample values the unnormalized color/alpha component representation is only supported if two conditions hold. First sample value value 0 must map to normalized component value 0.0 and sample value 2n - 1 to 1.0. Second the min/max range of all color components of the ColorSpace must be 0.0 to 1.0. In this case the component representation is the n least significant bits of the corresponding sample. Thus each component is an unsigned integral value between 0 and 2n - 1 where n is the number of significant bits for a particular component. If these conditions are not met any method taking an unnormalized component argument will throw an IllegalArgumentException.

Instances of ComponentColorModel created with transfer types DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT and DataBuffer.TYPE_DOUBLE have pixel sample values which are treated as signed short float or double values. Such instances do not support the unnormalized color/alpha component representation so any methods taking such a representation as an argument will throw an IllegalArgumentException when called on one of these instances. The normalized component values of instances of this class have a range which depends on the transfer type as follows: for float samples the full range of the float data type; for double samples the full range of the float data type (resulting from casting double to float); for short samples from approximately -maxVal to +maxVal where maxVal is the per component maximum value for the ColorSpace (-32767 maps to -maxVal 0 maps to 0.0 and 32767 maps to +maxVal). A subclass may override the scaling for short sample values to normalized component values by overriding the getNormalizedComponents(Object float[] int) method. For float and double samples the normalized component values are taken to be equal to the corresponding sample values and subclasses should not attempt to add any non-identity scaling for these transfer types.

Instances of ComponentColorModel created with transfer types DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT and DataBuffer.TYPE_DOUBLE use all the bits of all sample values. Thus all color/alpha components have 16 bits when using DataBuffer.TYPE_SHORT 32 bits when using DataBuffer.TYPE_FLOAT and 64 bits when using DataBuffer.TYPE_DOUBLE. When the ComponentColorModel(ColorSpace int[] boolean boolean int int) form of constructor is used with one of these transfer types the bits array argument is ignored.

It is possible to have color/alpha sample values which cannot be reasonably interpreted as component values for rendering. This can happen when ComponentColorModel is subclassed to override the mapping of unsigned sample values to normalized color component values or when signed sample values outside a certain range are used. (As an example specifying an alpha component as a signed short value outside the range 0 to 32767 normalized range 0.0 to 1.0 can lead to unexpected results.) It is the responsibility of applications to appropriately scale pixel data before rendering such that color components fall within the normalized range of the ColorSpace (obtained using the getMinValue and getMaxValue methods of the ColorSpace class) and the alpha component is between 0.0 and 1.0. If color or alpha component values fall outside these ranges rendering results are indeterminate.

Methods that use a single int pixel representation throw an IllegalArgumentException unless the number of components for the ComponentColorModel is one and the component value is unsigned -- in other words a single color component using a transfer type of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT and no alpha.

A ComponentColorModel can be used in conjunction with a ComponentSampleModel a BandedSampleModel or a PixelInterleavedSampleModel to construct a BufferedImage. @see ColorModel @see ColorSpace @see ComponentSampleModel @see BandedSampleModel @see PixelInterleavedSampleModel @see BufferedImage @version 10 Feb 1997

Class ComponentColorModel, constructor ComponentColorModel(ColorSpace, int[], boolean, boolean, int, int)

Constructs a ComponentColorModel from the specified parameters. Color components will be in the specified ColorSpace. The supported transfer types are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT and DataBuffer.TYPE_DOUBLE. If not null the bits array specifies the number of significant bits per color and alpha component. and Itsits length should be at least the number of components in the ColorSpace if there is no alpha information in the pixel values or one more than this number if there is alpha information. AnWhen the IllegalArgumentExceptiontransferType is thrown ifDataBuffer.TYPE_SHORT theDataBuffer.TYPE_FLOAT lengthor ofDataBuffer.TYPE_DOUBLE the array does not matchbits the number of componentsarray argument is ignored. hasAlpha indicates whether alpha information is present. If hasAlpha is true then the boolean isAlphaPremultiplied specifies how to interpret color and alpha samples in pixel values. If the boolean is true color samples are assumed to have been multiplied by the alpha sample. The transparency specifies what alpha values can be represented by this color model. The acceptable transparency values are OPAQUE BITMASK or TRANSLUCENT. The transferType is the type of primitive array used to represent pixel values. Note@param that thecolorSpace The bitsColorSpace arrayassociated with containsthis thecolor model. @param bits The number of significant bits per color/alpha component. after the translation from pixelMay be null in which values.case @paramall colorSpace Thebits of ColorSpaceall associated with this color modelcomponent samples will be significant. @paramIgnored bits Theif transferType numberis one of significantDataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_DOUBLE in which case all bits perof all component samples will be significant. @param hasAlpha If true this color model supports alpha. @param isAlphaPremultiplied If true alpha is premultiplied. @param transparency Specifies what alpha values can be represented by this color model. @param transferType Specifies the type of primitive array used to represent pixel values. @throws IllegalArgumentException If the length of the bits array doesargument is not matchnull its length is less than the number of color and alpha components and transferType is one of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT. @throws IllegalArgumentException If transferType is not one of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_DOUBLE. @see ColorSpace @see java.awt.Transparency
Class ComponentColorModel, ColorModel coerceData(WritableRaster, boolean)

Forces the raster data to match the state specified in the isAlphaPremultiplied variable assuming the data is currently correctly described by this ColorModel. It may multiply or divide the color raster data by alpha or do nothing if the data is in the correct state. If the data needs to be coerced this method also returns an instance of this ColorModel with the isAlphaPremultiplied flag set appropriately. Since ColorModel can be subclassed subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an unsupported transferType. @throws NullPointerException if raster is null and data coercion is required. @throws UnsupportedOperationException if the transfer type of this ComponentColorModel is not one of the supported transfer types: DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE.
Class ComponentColorModel, int getAlpha(Object)

Returns the alpha component for the specified pixel scaled from 0 to 255. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. Since ComponentColorModel can be subclassed subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an unsupported transferType. @param inData The pixel from which you want to get the alpha component specified by an array of data elements of type transferType. @return The alpha component for the specified pixel as an int. @throws ClassCastException If inData is not a primitive array of type transferType. @throws ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel. @throws UnsupportedOperationException If the transfer type of this ComponentColorModel is not one of the supported transfer types: DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE.
Class ComponentColorModel, int getAlpha(int)

Returns the alpha component for the specified pixel scaled from 0 to 255. The pixel value is specified as an int. @param pixel The pixel from which you want to get the alpha component. @return The alpha component for the specified pixel as an int. @throws IllegalArgumentException If there is more than one component in this ColorModel. @throws IllegalArgumentException If the component value for this ColorModel is signed
Class ComponentColorModel, int getBlue(Object)

Returns the blue color component for the specified pixel scaled from 0 to 255 in the default RGB ColorSpace sRGB. A color conversion is done if necessary. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. The returned value is a non pre-multiplied value. If the alpha is premultiplied this method divides it out before returning the value (if the alpha value is 0 the blue value will be 0). Since ComponentColorModel can be subclassed subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an unsupported transferType. @param inData The pixel from which you want to get the blue color component specified by an array of data elements of type transferType. @return The blue color component for the specified pixel as an int. @throws ClassCastException If inData is not a primitive array of type transferType. @throws ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel. @throws UnsupportedOperationException If the transfer type of this ComponentColorModel is not one of the supported transfer types: DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE.
Class ComponentColorModel, int getBlue(int)

Returns the blue color component for the specified pixel scaled from 0 to 255 in the default RGB ColorSpace sRGB. A color conversion is done if necessary. The pixel value is specified as an int. The returned value will be a non pre-multiplied value. If the alpha is premultiplied this method divides it out before returning the value (if the alpha value is 0 the blue value will be 0). @param pixel The pixel from which you want to get the blue color component. @return The blue color component for the specified pixel as an int. @throws IllegalArgumentException If there is more than one component in this ColorModel. @throws IllegalArgumentException If the component value for this ColorModel is signed
Class ComponentColorModel, int[] getComponents(Object, int[], int)

Returns an array of unnormalized color/alpha components given a pixel in this ColorModel. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. An IllegalArgumentException is thrown if the component values for this ColorModel are not conveniently representable in the unnormalized form. Color/alpha components are stored in the components array starting at offset (even if the array is allocated by this method). Since ComponentColorModel can be subclassed subclasses inherit the implementation of this method and if they don't override it then this method might throw an exception if they use an unsupported transferType. @param pixel A pixel value specified by an array of data elements of type transferType. @param components An integer array in which to store the unnormalized color/alpha components. If the components array is null a new array is allocated. @param offset An offset into the components array. @return The components array. @throws IllegalArgumentException If this ComponentColorModel does not support the unnormalized form @throws UnsupportedOperationException in some cases iff the transfer type of this ComponentColorModel is not one of the supportedfollowing transfer types: DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT. @throws ClassCastException If pixel is not a primitive array of type transferType. @throws IllegalArgumentException If the components array is not null and is not large enough to hold all the color and alpha components (starting at offset) or if pixel is not large enough to hold a pixel value for this ColorModel.
Class ComponentColorModel, int[] getComponents(int, int[], int)

Returns an array of unnormalized color/alpha components given a pixel in this ColorModel. An IllegalArgumentException is thrown if the component value for this ColorModel is not conveniently representable in the unnormalized form. Color/alpha components are stored in the components array starting at offset (even if the array is allocated by this method). @param pixel The pixel value specified as an integer. @param components An integer array in which to store the unnormalized color/alpha components. If the components array is null a new array is allocated. @param offset An offset into the components array. @return The components array. @throws IllegalArgumentException If there is more than one component in this ColorModel. @throws IllegalArgumentException If this ColorModel does not support the unnormalized form @throws ArrayIndexOutOfBoundsException If the components array is not null and is not large enough to hold all the color and alpha components (starting at offset).
Class ComponentColorModel, int getGreen(Object)

Returns the green color component for the specified pixel scaled from 0 to 255 in the default RGB ColorSpace sRGB. A color conversion is done if necessary. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. The returned value is a non pre-multiplied value. If the alpha is premultiplied this method divides it out before returning the value (if the alpha value is 0 the green value will be 0). Since ComponentColorModel can be subclassed subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an unsupported transferType. @param inData The pixel from which you want to get the green color component specified by an array of data elements of type transferType. @return The green color component for the specified pixel as an int. @throws ClassCastException If inData is not a primitive array of type transferType. @throws ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel. @throws UnsupportedOperationException If the transfer type of this ComponentColorModel is not one of the supported transfer types: DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE.
Class ComponentColorModel, int getGreen(int)

Returns the green color component for the specified pixel scaled from 0 to 255 in the default RGB ColorSpace sRGB. A color conversion is done if necessary. The pixel value is specified as an int. The returned value will be a non pre-multiplied value. If the alpha is premultiplied this method divides it out before returning the value (if the alpha value is 0 the green value will be 0). @param pixel The pixel from which you want to get the green color component. @return The green color component for the specified pixel as an int. @throws IllegalArgumentException If there is more than one component in this ColorModel. @throws IllegalArgumentException If the component value for this ColorModel is signed
Class ComponentColorModel, int getRGB(Object)

Returns the color/alpha components for the specified pixel in the default RGB color model format. A color conversion is done if necessary. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. The returned value is in a non pre-multiplied format. If the alpha is premultiplied this method divides it out of the color components (if the alpha value is 0 the color values will be 0). Since ComponentColorModel can be subclassed subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an unsupported transferType. @param inData The pixel from which you want to get the color/alpha components specified by an array of data elements of type transferType. @return The color/alpha components for the specified pixel as an int. @throws ClassCastException If inData is not a primitive array of type transferType. @throws ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel. @throws UnsupportedOperationException If the transfer type of this ComponentColorModel is not one of the supported transfer types: DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE. @see ColorModel#getRGBdefault
Class ComponentColorModel, int getRGB(int)

Returns the color/alpha components of the pixel in the default RGB color model format. A color conversion is done if necessary. The returned value will be in a non pre-multiplied format. If the alpha is premultiplied this method divides it out of the color components (if the alpha value is 0 the color values will be 0). @param pixel The pixel from which you want to get the color/alpha components. @return The color/alpha components for the specified pixel as an int. @throws IllegalArgumentException If there is more than one component in this ColorModel. @throws IllegalArgumentException If the component value for this ColorModel is signed
Class ComponentColorModel, int getRed(Object)

Returns the red color component for the specified pixel scaled from 0 to 255 in the default RGB ColorSpace sRGB. A color conversion is done if necessary. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. The returned value will be a non pre-multiplied value. If the alpha is premultiplied this method divides it out before returning the value (if the alpha value is 0 the red value will be 0). Since ComponentColorModel can be subclassed subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an unsupported transferType. @param inData The pixel from which you want to get the red color component specified by an array of data elements of type transferType. @return The red color component for the specified pixel as an int. @throws ClassCastException If inData is not a primitive array of type transferType. @throws ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel. @throws UnsupportedOperationException If the transfer type of this ComponentColorModel is not one of the supported transfer types: DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE.
Class ComponentColorModel, int getRed(int)

Returns the red color component for the specified pixel scaled from 0 to 255 in the default RGB ColorSpace sRGB. A color conversion is done if necessary. The pixel value is specified as an int. The returned value will be a non pre-multiplied value. If the alpha is premultiplied this method divides it out before returning the value (if the alpha value is 0 the red value will be 0). @param pixel The pixel from which you want to get the red color component. @return The red color component for the specified pixel as an int. @throws IllegalArgumentException If there is more than one component in this ColorModel. @throws IllegalArgumentException If the component value for this ColorModel is signed
Class ComponentColorModel, int[] getUnnormalizedComponents(float[], int, int[], int)

Returns an array of all of the color/alpha components in unnormalized form given a normalized component array. Unnormalized components are unsigned integral values between 0 and 2n - 1 where n is the number of bits for a particular component. Normalized components are float values between 0.0a per component minimum and 1maximum specified by the ColorSpace object for this ColorModel.0 An IllegalArgumentException will be thrown if color component values for this ColorModel are not conveniently representable in the unnormalized form. If the components array is null a new array will be allocated. The components array will be returned. Color/alpha components are stored in the components array starting at offset (even if the array is allocated by this method). An ArrayIndexOutOfBoundsException is thrown if the components array is not null and is not large enough to hold all the color and alpha components (starting at offset). An IllegalArgumentException is thrown if the normComponents array is not large enough to hold all the color and alpha components starting at normOffset. @param normComponents an array containing normalized components @param normOffset the offset into the normComponents array at which to start retrieving normalized components @param components an array that receives the components from normComponents @param offset the index into components at which to begin storing normalized components from normComponents @return an array containing unnormalized color and alpha components. @throws IllegalArgumentException if the lengthIf ofthis normComponentsComponentColorModel minusdoes normOffsetnot is less thansupport the unnormalized numComponentsform @throws UnsupportedOperationExceptionIllegalArgumentException if the constructorlength of this ColorModelnormComponents called theminus super(bits)normOffset constructor but did not override this method. Seeis the constructorless than #ColorModel(int)numComponents

Class ComponentSampleModel

This class represents image data which is stored such that each sample of a pixel occupies one data element of the DataBuffer. It stores the N samples which make up a pixel in N separate data array elements. Different bands may be in different banks of the DataBuffer. Accessor methods are provided so that image data can be manipulated directly. This class can support different kinds of interleaving e.g. band interleaving scanline interleaving and pixel interleaving. Pixel stride is the number of data array elements between two samples for the same band on the same scanline. Scanline stride is the number of data array elements between a given sample and the corresponding sample in the same column of the next scanline. Band offsets denote the number of data array elements from the first data array element of the bank of the DataBuffer holding each band to the first sample of the band. The bands are numbered from 0 to N-1. This class can represent image data for which each sample is an unsigned integral number which can be stored in 8 16 or 32 bits (allusing 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 java.awt.image.PixelInterleavedSampleModel @see java.awt.image.BandedSampleModel
Class ComponentSampleModel, constructor ComponentSampleModel(int, int, int, int, int, int[])

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. @param dataType Thethe data type for storing samples. @param w Thethe width (in pixels) of the region of image data described. @param h Thethe height (in pixels) of the region of image data described. @param pixelStride Thethe pixel stride of the region of image data described. @param scanlineStride Thethe line stride of the region of image data described. @param bandOffsets Thethe offsets of all bands. @throws IllegalArgumentException if w or h is not greater than 0 @throws IllegalArgumentException if pixelStride is less than 0 @throws IllegalArgumentException if scanlineStride is less than 0 @throws IllegalArgumentException if numBands is less than 1 @throws IllegalArgumentException if the product of w and h is greater than Integer.MAX_VALUE @throws IllegalArgumentException if dataType is not one of the supported data types
Class ComponentSampleModel, constructor ComponentSampleModel(int, int, int, int, int, int[], int[])

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. @param dataType Thethe data type for storing samples. @param w Thethe width (in pixels) of the region of image data described. @param h Thethe height (in pixels) of the region of image data described. @param pixelStride Thethe pixel stride of the region of image data described. @param scanlineStride The line stride of the region of image data described. @param bandIndices ThebankIndices the bank indices of all bands. @param bandOffsets Thethe band offsets of all bands. @throws IllegalArgumentException if w or h is not greater than 0 @throws IllegalArgumentException if pixelStride is less than 0 @throws IllegalArgumentException if scanlineStride is less than 0 @throws IllegalArgumentException if the length of bankIndices does not equal the length of bankOffsets @throws IllegalArgumentException if any of the bank indices of bandIndices is less than 0 @throws IllegalArgumentException if dataType is not one of the supported data types
Class ComponentSampleModel, SampleModel createCompatibleSampleModel(int, int)

Creates a new ComponentSampleModel with the specified width and height. The new SampleModel will have the same number of bands storage data type interleaving scheme and pixel stride as this SampleModel. @param w the width of the resulting SampleModel @param h the height of the resulting SampleModel @return a new ComponentSampleModel with the specified size @throws IllegalArgumentException if w or h is not greater than 0
Class ComponentSampleModel, DataBuffer createDataBuffer()

Creates a DataBuffer that corresponds to this ComponentSampleModel. The DataBuffer object's data type number of banks and size willare be consistent with this ComponentSampleModel. @return a DataBuffer whose data type number of banks and size are consistent with this ComponentSampleModel.
Class ComponentSampleModel, SampleModel createSubsetSampleModel(int[])

ThisCreates 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. @param bands a subset of bands from this ComponentSampleModel @return a ComponentSampleModel created with a subset of bands from this ComponentSampleModel.
Class ComponentSampleModel, int[] getBandOffsets()

Returns the band offset for all bands. @return the band offsets for all bands.
Class ComponentSampleModel, int[] getBankIndices()

Returns the bank indices for all bands. @return the bank indices for all bands.
Class ComponentSampleModel, Object getDataElements(int, int, Object, DataBuffer)

Returns data for a single pixel in a primitive array of type TransferType. For a ComponentSampleModel this will beis the same as the data type and samples will beare returned one per array element. Generally obj should be passed in as null so that the Object will beis created automatically and will be ofis the right primitive data type.

The following code illustrates transferring data for one pixel from DataBuffer db1 whose storage layout is described by ComponentSampleModel csm1 to DataBuffer db2 whose storage layout is described by ComponentSampleModel csm2. The transfer will generallyis beusually more efficient than using getPixel/ and setPixel.

 ComponentSampleModel csm1 csm2; DataBufferInt db1 db2; csm2.setDataElements(x y csm1.getDataElements(x y null db1) db2); 
Using getDataElements/ and setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModelsSampleModel objects have the same number of bands corresponding bands have the same number of bits per sample and the TransferTypesTransferTypes are the same.

If obj is non-not null it should be a primitive array of type TransferType. Otherwise a ClassCastException is thrown. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds or if obj is non-not null and is not large enough to hold the pixel data. @param x The X coordinate of the pixel location. @param  y The Ythe coordinatecoordinates of the pixel location. @param obj Ifif non-null a primitive array in which to return the pixel data. @param data Thethe DataBuffer containing the image data @return the data of the specified pixel @see #setDataElements(int int Object DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if obj is too small to hold the ouput.

Class ComponentSampleModel, int getNumDataElements()

Returns the number of data elements needed to transfer a pixel viawith the getDataElementsin Object DataBuffer) } and setDataElementsin Object DataBuffer) } methods. For a ComponentSampleModel this is identical to the number of bands. @return the number of data elements needed to transfer a pixel with the getDataElements and setDataElements methods. @see java.awt.image.SampleModel#getNumDataElements @see #getNumBands
Class ComponentSampleModel, int getOffset(int, int)

Gets the offset for the first band of pixel (x y). A sample of the first band can be retrieved from a DataBuffer data with a ComponentSampleModel csm as
 data.getElem(csm.getOffset(x y)); 
@param x  y the location of the pixel @return the offset for the first band of the specified pixel.
Class ComponentSampleModel, int getOffset(int, int, int)

Gets the offset for band b of pixel (x y). A sample of band b can be retrieved from a DataBuffer data with a ComponentSampleModel csm as
 data.getElem(csm.getOffset(x y b)); 
@param x  y the location of the specified pixel @param b the specified band @return the offset for the specified band of the specified pixel.
Class ComponentSampleModel, int[] getPixel(int, int, int[], DataBuffer)

Returns all samples for the specified pixel in an int array one sample per array element. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data @return the samples of the specified pixel. @see #setPixel(int int int[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the output.
Class ComponentSampleModel, int getPixelStride()

Returns the pixel stride of this ComponentSampleModel. @return the pixel stride of this ComponentSampleModel.
Class ComponentSampleModel, int[] getPixels(int, int, int, int, int[], DataBuffer)

Returns all samples for the specified rectangle of pixels in an int array one sample per array element. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the upper left pixel location. @param  y The Ythe coordinatecoordinates of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data @return the samples of the pixels within the specified region. @see #setPixels(int int int int int[] DataBuffer)
Class ComponentSampleModel, int getSample(int, int, int, DataBuffer)

Returns as int the sample in a specified band for the pixel located at (x y). An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Ythe coordinatecoordinates of the pixel location. @param b Thethe band to return. @param data Thethe DataBuffer containing the image data. @return the sample in a specified band for the specified pixel @see #setSample(int int int int DataBuffer)
Class ComponentSampleModel, double getSampleDouble(int, int, int, DataBuffer)

Returns the sample in a specified band for a pixel located at (x y) as a double. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data @return a double value representing the sample in the specified band for the specified pixel.
Class ComponentSampleModel, float getSampleFloat(int, int, int, DataBuffer)

Returns the sample in a specified band for the pixel located at (x y) as a float. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data @return a float value representing the sample in the specified band for the specified pixel.
Class ComponentSampleModel, int[] getSampleSize()

Returns the number of bits per sample for all bands. @return an array containing the number of bits per sample for all bands where each element in the array represents a band.
Class ComponentSampleModel, int getSampleSize(int)

Returns the number of bits per sample for the specified band. @param band the specified band @return the number of bits per sample for the specified band.
Class ComponentSampleModel, int[] getSamples(int, int, int, int, int, int[], DataBuffer)

Returns the samples in a specified band for the specified rectangle of pixels in an int array one sample per data array element. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the upper left pixel location. @param  y The Ythe coordinatecoordinates of the upper left pixel location. @param w Thethe width of the pixel rectangle. @param h Thethe height of the pixel rectangle. @param b Thethe band to return. @param iArray Ifif non-null returns the samples in this array. @param data Thethe DataBuffer containing the image data. @return the samples in the specified band of the specified pixel @see #setSamples(int int int int int int[] DataBuffer)
Class ComponentSampleModel, int getScanlineStride()

Returns the scanline stride of this ComponentSampleModel. @return the scanline stride of this ComponentSampleModel.
Class ComponentSampleModel, void setDataElements(int, int, Object, DataBuffer)

Sets the data for a single pixel in the specified DataBuffer from a primitive array of type TransferType. For a ComponentSampleModel this will beis 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 by ComponentSampleModel csm1 to DataBuffer db2 whose storage layout is described by ComponentSampleModel csm2. The transfer will generallyis beusually more efficient than using getPixel/ and setPixel.

 ComponentSampleModel csm1 csm2; DataBufferInt db1 db2; csm2.setDataElements(x y csm1.getDataElements(x y null db1) db2); 
Using getDataElements/ and setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModelsSampleModel objects have the same number of bands corresponding bands have the same number of bits per sample and the TransferTypesTransferTypes are the same.

A ClassCastException is thrown if obj must beis not a primitive array of type TransferType. Otherwise a ClassCastException is thrown. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds or if obj is not large enough to hold the pixel data. @param x The X coordinate of the pixel location. @param  y The Ythe coordinatecoordinates of the pixel location. @param obj Aa primitive array containing pixel data. @param data Thethe DataBuffer containing the image data. @see #getDataElements(int int Object DataBuffer)

Class ComponentSampleModel, void setPixel(int, int, int[], DataBuffer)

Sets a pixel in the DataBuffer using an int array of samples for input. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getPixel(int int int[] DataBuffer)
Class ComponentSampleModel, void setPixels(int, int, int, int, int[], DataBuffer)

Sets all samples for a rectangle of pixels from an int array containing one sample per array element. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the upper left pixel location. @param  y The Y coordinatecoordinates of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getPixels(int int int int int[] DataBuffer)
Class ComponentSampleModel, void setSample(int, int, int, double, DataBuffer)

Sets a sample in the specified band for the pixel located at (x y) in the DataBuffer using a double for input. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to set. @param s The input sample as a double. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer)
Class ComponentSampleModel, void setSample(int, int, int, float, DataBuffer)

Sets a sample in the specified band for the pixel located at (x y) in the DataBuffer using a float for input. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param b The band to set. @param s The input sample as a float. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer)
Class ComponentSampleModel, void setSample(int, int, int, int, DataBuffer)

Sets a sample in the specified band for the pixel located at (x y) in the DataBuffer using an int for input. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param  y The Ythe coordinatecoordinates of the pixel location. @param b Thethe band to set. @param s Thethe input sample as an int. @param data Thethe DataBuffer containing the image data. @see #getSample(int int int DataBuffer)
Class ComponentSampleModel, void setSamples(int, int, int, int, int, int[], DataBuffer)

Sets the samples in the specified band for the specified rectangle of pixels from an int array containing one sample per data array element. An ArrayIndexOutOfBoundsException maymight be thrown if the coordinates are not in bounds. @param x The X coordinate of the upper left pixel location. @param  y The Y coordinatecoordinates of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to set. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getSamples(int int int int int int[] DataBuffer)

Class ConvolveOp, constructor ConvolveOp(Kernel)

Constructs a ConvolveOp given a Kernel. The edge condition will be EDGE_ZERO_FILL. @param kernel the specified Kernel @see Kernel @see #EDGE_ZERO_FILL
Class ConvolveOp, constructor ConvolveOp(Kernel, int, RenderingHints)

Constructs a ConvolveOp given a Kernel an edge condition and a RenderingHints object (which may be null). @param kernel the specified Kernel @param edgeCondition the specified edge condition @param hints the specified RenderingHints object @see Kernel @see #EDGE_NO_OP @see #EDGE_ZERO_FILL @see java.awt.RenderingHints
Class ConvolveOp, BufferedImage createCompatibleDestImage(BufferedImage, ColorModel)

Creates a zeroed destination image with the correct size and number of bands. If destCM is null an appropriate ColorModel will be used. @param src Source image for the filter operation. @param destCM ColorModel of the destination. Can be null. @return a destination BufferedImage with the correct size and number of bands.
Class ConvolveOp, int getEdgeCondition()

Returns the edge condition. @return the edge condition of this ConvolveOp. @see #EDGE_NO_OP @see #EDGE_ZERO_FILL
Class ConvolveOp, Kernel getKernel()

Returns the Kernel. @return the Kernel of this ConvolveOp.

Class CropImageFilter

An ImageFilter class for cropping images. This class extends the basic ImageFilter Class to extract a given rectangular region of an existing Image and provide a source for a new image containing just the extracted region. It is meant to be used in conjunction with a FilteredImageSource object to produce cropped versions of existing images. @see FilteredImageSource @see ImageFilter @version 1.11 0212 12/0203/0001 @author Jim Graham

Class DataBuffer

This class exists to wrap one or more data arrays. Each data array in the DataBuffer is referred to as a bank. Accessor methods for getting and setting elements of the DataBuffer's banks exist with and without a bank specifier. The methods without a bank specifier use the default 0th bank. The DataBuffer can optionally take an offset per bank so that data in an existing array can be used even if the interesting data doesn't start at array location zero. Getting or setting the 0th element of a bank uses the (0+offset)th element of the array. The size field specifies how much of the data array is available for use. Size + offset for a given bank should never be greater than the length of the associated data array. The data type of a data buffer indicates the type of the data array(s) and may also indicate additional semantics e.g. storing unsigned 8-bit data in elements of a byte array. The data type may be TYPE_UNDEFINED or one of the types defined below. Other types may be added in the future. Generally an object of class DataBuffer will be cast down to one of its data type specific subclasses to access data type specific methods for improved performance. Currently the Java 2D(tm) API image classes use only TYPE_BYTE TYPE_USHORT TYPE_INT TYPE_SHORT TYPE_FLOAT and TYPE_INTDOUBLE DataBuffers to store image data. @see java.awt.image.Raster @see java.awt.image.SampleModel
Class DataBuffer, int getDataType()

Returns the data type of this DataBuffer. @return the data type of this DataBuffer.
Class DataBuffer, int getElem(int)

Returns the requested data array element from the first (default) bank as an integer. @param i the index of the requested data array element @return the data array element at the specified index. @see #setElem(int int) @see #setElem(int int int)
Class DataBuffer, int getElem(int, int)

Returns the requested data array element from the specified bank as an integer. @param bank the specified bank @param i the index of the requested data array element @return the data array element at the specified index from the specified bank at the specified index. @see #setElem(int int) @see #setElem(int int int)
Class DataBuffer, double getElemDouble(int)

Returns the requested data array element from the first (default) bank as a double. The implementation in this class is to cast #getElem(iint) to a double. Subclasses maycan override this method if another implementation is needed. @param i the specified index @return a double value representing the element at the specified index in the data array. @see #setElemDouble(int double) @see #setElemDouble(int int double)
Class DataBuffer, double getElemDouble(int, int)

Returns the requested data array element from the specified bank as a double. The implementation in this class is to cast getElem(bank i) to a double. Subclasses may override this method if another implementation is needed. @param bank the specified bank @param i the specified index @return a double value representing the element from the specified bank at the specified index in the data array. @see #setElemDouble(int double) @see #setElemDouble(int int double)
Class DataBuffer, float getElemFloat(int)

Returns the requested data array element from the first (default) bank as a float. The implementation in this class is to cast getElem(i) to a float. Subclasses may override this method if another implementation is needed. @param i the index of the requested data array element @return a float value representing the data array element at the specified index. @see #setElemFloat(int float) @see #setElemFloat(int int float)
Class DataBuffer, float getElemFloat(int, int)

Returns the requested data array element from the specified bank as a float. The implementation in this class is to cast getElem(bank iint) to a float. Subclasses maycan override this method if another implementation is needed. @param bank the specified bank @param i the index of the requested data array element @return a float value representing the data array element from the specified bank at the specified index. @see #setElemFloat(int float) @see #setElemFloat(int int float)
Class DataBuffer, int getNumBanks()

Returns the number of banks in this DataBuffer. @return the number of banks.
Class DataBuffer, int getOffset()

Returns the offset of the default bank in array elements. @return the offset of the default bank.
Class DataBuffer, int[] getOffsets()

Returns the offsets (in array elements) of all the banks. @return the offsets of all banks.
Class DataBuffer, int getSize()

Returns the size (in array elements) of all banks. @return the size of all banks.
Class DataBuffer, void setElem(int, int)

Sets the requested data array element in the first (default) bank from the given integer. @param i the specified index into the data array @param val the data to set the element at the specified index in the data array @see #getElem(int) @see #getElem(int int)
Class DataBuffer, void setElem(int, int, int)

Sets the requested data array element in the specified bank from the given integer. @param bank the specified bank @param i the specified index into the data array @param val the data to set the element in the specified bank at the specified index in the data array @see #getElem(int) @see #getElem(int int)
Class DataBuffer, void setElemDouble(int, double)

Sets the requested data array element in the first (default) bank from the given double. The implementation in this class is to cast val to an int and call setElem.int) Subclasses maycan override this method if another implementation is needed. @param i the specified index @param val the value to set the element at the specified index in the data array @see #getElemDouble(int) @see #getElemDouble(int int)
Class DataBuffer, void setElemDouble(int, int, double)

Sets the requested data array element in the specified bank from the given double. The implementation in this class is to cast val to an int and call setElem.int) Subclasses maycan override this method if another implementation is needed. @param bank the specified bank @param i the specified index @param val the value to set the element in the specified bank at the specified index of the data array @see #getElemDouble(int) @see #getElemDouble(int int)
Class DataBuffer, void setElemFloat(int, float)

Sets the requested data array element in the first (default) bank from the given float. The implementation in this class is to cast val to an int and call setElem.int) Subclasses maycan override this method if another implementation is needed. @param i the specified index @param val the value to set the element at the specified index in the data array @see #getElemFloat(int) @see #getElemFloat(int int)
Class DataBuffer, void setElemFloat(int, int, float)

Sets the requested data array element in the specified bank from the given float. The implementation in this class is to cast * val to an int and call setElem.int) Subclasses maycan override this method if another implementation is needed. @param bank the specified bank @param i the specified index @param val the value to set the element in the specified bank at the specified index in the data array @see #getElemFloat(int) @see #getElemFloat(int int)
Class DataBuffer, int TYPE_UNDEFINED

Tag for undefined data.

Class DataBufferByte, int getElem(int)

Returns the requested data array element from the first (default) bank. @param i The data array element you want to get. @return The requested data array element as an integer. @see #setElem(int int) @see #setElem(int int int)
Class DataBufferByte, int getElem(int, int)

Returns the requested data array element from the specified bank. @param bank The bank from which you want to get a data array element. @param i The data array element you want to get. @return The requested data array element as an integer. @see #setElem(int int) @see #setElem(int int int)
Class DataBufferByte, void setElem(int, int)

Sets the requested data array element in the first (default) bank to the specified value. @param i The data array element you want to set. @param val The integer value to which you want to set the data array element. @see #getElem(int) @see #getElem(int int)
Class DataBufferByte, void setElem(int, int, int)

Sets the requested data array element in the specified bank from the given integer. @param bank The bank in which you want to set the data array element. @param i The data array element you want to set. @param val The integer value to which you want to set the specified data array element. @see #getElem(int) @see #getElem(int int)

Class DataBufferInt, int getElem(int)

Returns the requested data array element from the first (default) bank. @param i The data array element you want to get. @return The requested data array element as an integer. @see #setElem(int int) @see #setElem(int int int)
Class DataBufferInt, int getElem(int, int)

Returns the requested data array element from the specified bank. @param bank The bank from which you want to get a data array element. @param i The data array element you want to get. @return The requested data array element as an integer. @see #setElem(int int) @see #setElem(int int int)
Class DataBufferInt, void setElem(int, int)

Sets the requested data array element in the first (default) bank to the specified value. @param i The data array element you want to set. @param val The integer value to which you want to set the data array element. @see #getElem(int) @see #getElem(int int)
Class DataBufferInt, void setElem(int, int, int)

Sets the requested data array element in the specified bank to the integer value i. @param bank The bank in which you want to set the data array element. @param i The data array element you want to set. @param val The integer value to which you want to set the specified data array element. @see #getElem(int) @see #getElem(int int)

Class DataBufferShort, int getElem(int)

Returns the requested data array element from the first (default) bank. @param i The data array element you want to get. @return The requested data array element as an integer. @see #setElem(int int) @see #setElem(int int int)
Class DataBufferShort, int getElem(int, int)

Returns the requested data array element from the specified bank. @param bank The bank from which you want to get a data array element. @param i The data array element you want to get. @return The requested data array element as an integer. @see #setElem(int int) @see #setElem(int int int)
Class DataBufferShort, void setElem(int, int)

Sets the requested data array element in the first (default) bank to the specified value. @param i The data array element you want to set. @param val The integer value to which you want to set the data array element. @see #getElem(int) @see #getElem(int int)
Class DataBufferShort, void setElem(int, int, int)

Sets the requested data array element in the specified bank from the given integer. @param bank The bank in which you want to set the data array element. @param i The data array element you want to set. @param val The integer value to which you want to set the specified data array element. @see #getElem(int) @see #getElem(int int)

Class DataBufferUShort, int getElem(int)

Returns the requested data array element from the first (default) bank. @param i The data array element you want to get. @return The requested data array element as an integer. @see #setElem(int int) @see #setElem(int int int)
Class DataBufferUShort, int getElem(int, int)

Returns the requested data array element from the specified bank. @param bank The bank from which you want to get a data array element. @param i The data array element you want to get. @return The requested data array element as an integer. @see #setElem(int int) @see #setElem(int int int)
Class DataBufferUShort, void setElem(int, int)

Sets the requested data array element in the first (default) bank to the specified value. @param i The data array element you want to set. @param val The integer value to which you want to set the data array element. @see #getElem(int) @see #getElem(int int)
Class DataBufferUShort, void setElem(int, int, int)

Sets the requested data array element in the specified bank from the given integer. @param bank The bank in which you want to set the data array element. @param i The data array element you want to set. @param val The integer value to which you want to set the specified data array element. @see #getElem(int) @see #getElem(int int)

Class DirectColorModel

The DirectColorModel class is a ColorModel class that works with pixel values that represent RGB color and alpha information as separate samples and that pack all samples for a single pixel into a single int short or byte quantity. This class can be used only with ColorSpaces of type ColorSpace.TYPE_RGB. In addition for each component of the ColorSpace the minimum normalized component value obtained via the getMinValue() method of ColorSpace must be 0.0 and the maximum value obtained via the getMaxValue() method must be 1.0 (these min/max values are typical for RGB spaces). There must be three color samples in the pixel values and there can be a single alpha sample. For those methods that use a primitive array pixel representation of type transferType the array length is always one. The transfer types supported are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT and DataBuffer.TYPE_INT. Color and alpha samples are stored in the single element of the array in bits indicated by bit masks. Each bit mask must be contiguous and masks must not overlap. The same masks apply to the single int pixel representation used by other methods. The correspondence of masks and color/alpha samples is as follows:

The translation from pixel values to color/alpha components for display or processing purposes is a one-to-one correspondence of samples to components. A DirectColorModel is typically used with image data which uses masks to define packed samples. For example a DirectColorModel can be used in conjunction with a SinglePixelPackedSampleModel to construct a BufferedImage Normally the masks used by the SampleModel and the ColorModel would be the same. However if they are different the color interpretation of pixel data will be done according to the masks of the ColorModel.

A single int pixel representation is valid for all objects of this class since it is always possible to represent pixel values used with this class in a single int. Therefore methods which use this representation will not throw an IllegalArgumentException due to an invalid pixel value.

This color model is similar to an X11 TrueColor visual. The default RGB ColorModel specified by the getRGBdefault method is a DirectColorModel with the following parameters:

 Number of bits: 32 Red mask: 0x00ff0000 Green mask: 0x0000ff00 Blue mask: 0x000000ff Alpha mask: 0xff000000 Color space: sRGB isAlphaPremultiplied: False Transparency: Transparency.TRANSLUCENT transferType: DataBuffer.TYPE_INT 

Many of the methods in this class are final. This is because the underlying native graphics code makes assumptions about the layout and operation of this class and those assumptions are reflected in the implementations of the methods here that are marked final. You can subclass this class for other reasons but you cannot override or modify the behavior of those methods. @see ColorModel @see ColorSpace @see SinglePixelPackedSampleModel @see BufferedImage @see ColorModel#getRGBdefault @version 10 Feb 1997

Class DirectColorModel, constructor DirectColorModel(ColorSpace, int, int, int, int, int, boolean, int)

Constructs a DirectColorModel from the specified parameters. Color components are in the specified ColorSpace which must be of type ColorSpace.TYPE_RGB and have minimum normalized component values which are all 0.0 and maximum values which are all 1.0. The masks specify which bits in an int pixel representation contain the red green and blue color samples and the alpha sample if present. If amask is 0 pixel values do not contain alpha information and all pixels are treated as opaque which means that alpha = 1.0. All of the bits in each mask must be contiguous and fit in the specified number of least significant bits of an int pixel representation. If there is alpha the boolean isAlphaPremultiplied specifies how to interpret color and alpha samples in pixel values. If the boolean is true color samples are assumed to have been multiplied by the alpha sample. The transparency value is Transparency.OPAQUE if no alpha is present or Transparency.TRANSLUCENT otherwise. The transfer type is the type of primitive array used to represent pixel values and must be one of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT. @param space the specified ColorSpace @param bits the number of bits in the pixel values; for example the sum of the number of bits in the masks. @param rmask specifies a mask indicating which bits in an integer pixel contain the red component @param gmask specifies a mask indicating which bits in an integer pixel contain the green component @param bmask specifies a mask indicating which bits in an integer pixel contain the blue component @param amask specifies a mask indicating which bits in an integer pixel contain the alpha component @param isAlphaPremultiplied true if color samples are premultiplied by the alpha sample; false otherwise @param transferType the type of array used to represent pixel values @throws IllegalArgumentException if space is not a TYPE_RGB space or if the min/max normalized component values are not 0.0/1.0.
Class DirectColorModel, int[] getComponents(Object, int[], int)

Returns an array of unnormalized color/alpha components given a pixel in this ColorModel. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. If pixel is not a primitive array of type transferType a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if pixel is not large enough to hold a pixel value for this ColorModel. If the components array is null a new array is allocated. The components array is returned. Color/alpha components are stored in the components array starting at offset even if the array is allocated by this method. An ArrayIndexOutOfBoundsException is thrown if the components array is not null and is not large enough to hold all the color and alpha components starting at offset. Since DirectColorModel can be subclassed subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an unsupported transferType. @param pixel the specified pixel @param components the array to receive the color and alpha components of the specified pixel @param offset the offset into the components array at which to start storing the color and alpha components @return an array containing the color and alpha components of the specified pixel starting at the specified offset. @exception ClassCastException if pixel is not a primitive array of type transferType @exception ArrayIndexOutOfBoundsException if pixel is not large enough to hold a pixel value for this ColorModel or if components is not null and is not large enough to hold all the color and alpha components starting at offset @exception UnsupportedOperationException if this transferType is not supported by this color model

Class FilteredImageSource

This class is an implementation of the ImageProducer interface which takes an existing image and a filter object and uses them to produce image data for a new filtered version of the original image. Here is an example which filters an image by swapping the red and blue compents:
 Image src = getImage("doc:///demo/images/duke/T1.gif"); ImageFilter colorfilter = new RedBlueSwapFilter(); Image img = createImage(new FilteredImageSource(src.getSource() colorfilter)); 
@see ImageProducer @version 1.22 0224 12/0203/0001 @author Jim Graham
Class FilteredImageSource, constructor FilteredImageSource(ImageProducer, ImageFilter)

Constructs an ImageProducer object from an existing ImageProducer and a filter object. @param orig the specified ImageProducer @param imgf the specified ImageFilter @see ImageFilter @see java.awt.Component#createImage
Class FilteredImageSource, boolean isConsumer(ImageConsumer)

Determines whether an ImageConsumer is on the list of consumers currently interested in data for this image. @param ic the specified ImageConsumer @return true if the ImageConsumer is on the list; false otherwise @see ImageConsumer

Class ImageConsumer

The interface for objects expressing interest in image data through the ImageProducer interfaces. When a consumer is added to an image producer the producer delivers all of the data about the image using the method calls defined in this interface. @see ImageProducer @version 1.17 0219 12/0203/0001 @author Jim Graham
Class ImageConsumer, void imageComplete(int)

The imageComplete method is called when the ImageProducer is finished delivering all of the pixels that the source image contains or when a single frame of a multi-frame animation has been completed or when an error in loading or producing the image has occured. The ImageConsumer should remove itself from the list of consumers registered with the ImageProducer at this time unless it is interested in successive frames. @param status the status of image loading @see ImageProducer#removeConsumer
Class ImageConsumer, void setColorModel(ColorModel)

TheSets the ColorModel object used for the majority of the pixels reported using the setPixels method calls. Note that each set of pixels delivered using setPixels contains its own ColorModel object so no assumption should be made that this model will be the only one used in delivering pixel values. A notable case where multiple ColorModel objects may be seen is a filtered image when for each set of pixels that it filters the filter determines whether the pixels can be sent on untouched using the original ColorModel or whether the pixels should be modified (filtered) and passed on using a ColorModel more convenient for the filtering process. @param model the specified ColorModel @see ColorModel
Class ImageConsumer, void setDimensions(int, int)

The dimensions of the source image are reported using the setDimensions method call. @param width the width of the source image @param height the height of the source image
Class ImageConsumer, void setHints(int)

Sets the hints that the ImageConsumer uses to process the pixels delivered by the ImageProducer. The ImageProducer can deliver the pixels in any order but the ImageConsumer may be able to scale or convert the pixels to the destination ColorModel more efficiently or with higher quality if it knows some information about how the pixels will be delivered up front. The setHints method should be called before any calls to any of the setPixels methods with a bit mask of hints about the manner in which the pixels will be delivered. If the ImageProducer does not follow the guidelines for the indicated hint the results are undefined. @param hintflags a set of hints that the ImageConsumer uses to process the pixels
Class ImageConsumer, void setPixels(int, int, int, int, ColorModel, byte[], int, int)

TheDelivers the pixels of the image are delivered usingwith one or more calls to the setPixelsthis method. Each call specifies the location and size of the rectangle of source pixels that are contained in the array of pixels. The specified ColorModel object should be used to convert the pixels into their corresponding color and alpha components. Pixel (m n) is stored in the pixels array at index (n * scansize + m + off). The pixels delivered using this method are all stored as bytes. @param x  y the coordinates of the upper-left corner of the area of pixels to be set @param w the width of the area of pixels @param h the height of the area of pixels @param model the specified ColorModel @param pixels the array of pixels @param off the offset into the pixels array @param scansize the distance from one row of pixels to the next in the pixels array @see ColorModel
Class ImageConsumer, void setPixels(int, int, int, int, ColorModel, int[], int, int)

The pixels of the image are delivered using one or more calls to the setPixels method. Each call specifies the location and size of the rectangle of source pixels that are contained in the array of pixels. The specified ColorModel object should be used to convert the pixels into their corresponding color and alpha components. Pixel (m n) is stored in the pixels array at index (n * scansize + m + off). The pixels delivered using this method are all stored as ints. this method are all stored as ints. @param x  y the coordinates of the upper-left corner of the area of pixels to be set @param w the width of the area of pixels @param h the height of the area of pixels @param model the specified ColorModel @param pixels the array of pixels @param off the offset into the pixels array @param scansize the distance from one row of pixels to the next in the pixels array @see ColorModel
Class ImageConsumer, void setProperties(Hashtable)

Sets the extensible list of properties associated with this image. @param props the list of properties to be associated with this image

Class ImageFilter

This class implements a filter for the set of interface methods that are used to deliver data from an ImageProducer to an ImageConsumer. It is meant to be used in conjunction with a FilteredImageSource object to produce filtered versions of existing images. It is a base class that provides the calls needed to implement a "Null filter" which has no effect on the data being passed through. Filters should subclass this class and override the methods which deal with the data that needs to be filtered and modify it as necessary. @see FilteredImageSource @see ImageConsumer @version 1.23 0225 12/0203/0001 @author Jim Graham
Class ImageFilter, ImageFilter getFilterInstance(ImageConsumer)

Returns a unique instance of an ImageFilter object which will actually perform the filtering for the specified ImageConsumer. The default implementation just clones this object.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. Developers using this class to filter pixels from an image should avoid calling this method directly since that operation could interfere with the filtering operation. @param ic the specified ImageConsumer @return an ImageFilter used to perform the filtering for the specified ImageConsumer.


Class ImageObserver

An asynchronous update interface for receiving notifications about Image information as the Image is constructed. @version 1.24 0225 12/0203/0001 @author Jim Graham

Class ImageProducer

The interface for objects which can produce the image data for Images. Each image contains an ImageProducer which is used to reconstruct the image whenever it is needed for example when a new size of the Image is scaled or when the width or height of the Image is being requested. @see ImageConsumer @version 1.16 0218 12/0203/0001 @author Jim Graham
Class ImageProducer, void addConsumer(ImageConsumer)

ThisRegisters method is used to register an ImageConsumer with the ImageProducer for access to the image data during a later reconstruction of the Image. The ImageProducer may at its discretion start delivering the image data to the consumer using the ImageConsumer interface immediately or when the next available image reconstruction is triggered by a call to the startProduction method. @param ic the specified ImageConsumer @see #startProduction
Class ImageProducer, boolean isConsumer(ImageConsumer)

ThisDetermines method determines if a givenspecified ImageConsumer object is currently registered with this ImageProducer as one of its consumers. @param ic the specified ImageConsumer @return true if the specified ImageConsumer is registered with this ImageProducer; false otherwise.
Class ImageProducer, void removeConsumer(ImageConsumer)

ThisRemoves method removes the givenspecified ImageConsumer object from the list of consumers currently registered to receive image data. It is not considered an error to remove a consumer that is not currently registered. The ImageProducer should stop sending data to this consumer as soon as is feasible. @param ic the specified ImageConsumer
Class ImageProducer, void requestTopDownLeftRightResend(ImageConsumer)

ThisRequests method ison used by anbehalf of the ImageConsumer to request that the ImageProducer attempt to resend the image data one more time in TOPDOWNLEFTRIGHT order so that higher quality conversion algorithms which depend on receiving pixels in order can be used to produce a better output version of the image. The ImageProducer is free to ignore this call if it cannot resend the data in that order. If the data can be resent then the ImageProducer should respond by executing the following minimum set of ImageConsumer method calls:
 ic.setHints(TOPDOWNLEFTRIGHT | ); ic.setPixels(...); // As many times as needed ic.imageComplete(); 
@param ic the specified ImageConsumer @see ImageConsumer#setHints
Class ImageProducer, void startProduction(ImageConsumer)

This method bothRegisters registers the givenspecified ImageConsumer object as a consumer and starts an immediate reconstruction of the image data which will then be delivered to this consumer and any other consumer which maymight have already been registered with the producer. This method differs from the addConsumer method in that a reproduction of the image data should be triggered as soon as possible. @param ic the specified ImageConsumer @see #addConsumer

Class IndexColorModel, constructor IndexColorModel(int, int, int[], int, boolean, int, int)

Constructs an IndexColorModel from an array of ints where each int is comprised of red green blue and optional alpha components in the default RGB color model format. The specified transparent index represents a pixel that is considered entirely transparent regardless of any alpha value specified for it. The array must have enough values in it to fill all of the needed component arrays of the specified size. The ColorSpace is the default sRGB space. The transparency value is Transparency.TRANSLUCENT if hasAlpha is true; otherwise it is Transparency.BITMASK if trans is a valid index into the colormap (between 0 and size - 1) or Transparency.OPAQUE if trans is not a valid index. @param bits the number of bits each pixel occupies @param size the size of the color component arrays @param cmap the array of color components @param start the starting offset of the first color component @param hasalpha indicates whether alpha values are contained in the cmap array @param trans the index of the fully transparent pixel @param transferType the data type of the array used to represent pixel values. The data type must be either DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT. @throws IllegalArgumentException if bits is less than 1 or greater than 16 @throws IllegalArgumentException if size is less than 1 @throws IllegalArgumentException if transferType is not one of DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT
Class IndexColorModel, constructor IndexColorModel(int, int, int[], int, int, BigInteger)

Constructs an IndexColorModel from an int array where each int is comprised of red green blue and alpha components in the default RGB color model format. The array must have enough values in it to fill all of the needed component arrays of the specified size. The ColorSpace is the default sRGB space. The transfer type is the smallestmust be one of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT that can hold a single pixel. The BigInteger object specifies the valid/invalid pixels in the cmap array. A pixel is valid if the BigInteger value at that index is set and is invalid if the BigInteger bit at that index is not set. @param bits the number of bits each pixel occupies @param size the size of the color component array @param cmap the array of color components @param start the starting offset of the first color component @param transferType the specified data type @param validBits a BigInteger object. If a bit is set in the BigInteger the pixel at that index is valid. If a bit is not set the pixel at that index is considered invalid. If null all pixels are valid. Only bits from 0 to map_size will be considered. @throws IllegalArgumentException if bits is less than 1 or greater than 16 @throws IllegalArgumentException if size is less than 1 @throws IllegalArgumentException if transferType is not one of DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT
Class IndexColorModel, BufferedImage convertToIntDiscrete(Raster, boolean)

Returns a new BufferedImage of TYPE_INT_ARGB or TYPE_INT_RGB that has a Raster with pixel data computed by expanding the indices in the source Raster using the color/alpha component arrays of this ColorModel. If forceARGB is true a TYPE_INT_ARGB image is returned regardless of whether or not this ColorModel has an alpha component array or a transparent pixel. @param raster the specified Raster @param forceARGB if true the returned BufferedImage is TYPE_INT_ARGB; otherwise it is TYPE_INT_RGB @return a BufferedImage created with the specified Raster @throws IllegalArgumentException if the raster argument is not compatible with this IndexColorModel

Class LookupOp, constructor LookupOp(LookupTable, RenderingHints)

Constructs a LookupOp object given the lookup table and a RenderingHints object (which maymight be null). @param lookup the specified LookupTable @param hints the specified RenderingHints or null
Class LookupOp, BufferedImage createCompatibleDestImage(BufferedImage, ColorModel)

Creates a zeroed destination image with the correct size and number of bands. If destCM is null an appropriate ColorModel will be used. @param src Source image for the filter operation. @param destCM ColorModel of the destination.'s CanColorModel which can be null. @return a filtered destination BufferedImage.
Class LookupOp, WritableRaster createCompatibleDestRaster(Raster)

Creates a zeroed -destination Raster with the correct size and number of bands given this source. @param src the Raster to be transformed @return the zeroed-destination Raster.
Class LookupOp, BufferedImage filter(BufferedImage, BufferedImage)

Performs a lookup operation on a BufferedImage. If the color model in the source image is not the same as that in the destination image the pixels will be converted in the destination. If the destination image is null a BufferedImage will be created with an appropriate ColorModel. An IllegalArgumentException maymight be thrown if the number of arrays in the LookupTable does not meet the restrictions stated in the class comment above or if the source image has an IndexColorModel. @param src the BufferedImage to be filtered @param dst the BufferedImage in which to store the results of the filter operation @return the filtered BufferedImage. @throws IllegalArgumentException if the number of arrays in the LookupTable does not meet the restrictions described in the class comments or if the source image has an IndexColorModel.
Class LookupOp, WritableRaster filter(Raster, WritableRaster)

Performs a lookup operation on a Raster. If the destination Raster is null a new Raster will be created. The IllegalArgumentException maymight be thrown if the source Raster and the destination RastersRaster do not have differentthe same numbersnumber of bands or if the number of arrays in the LookupTable does not meet the restrictions stated in the class comment above. @param src the source Raster to filter @param dst the destination WritableRaster for the filtered src @return the filtered WritableRaster. @throws IllegalArgumentException if the source and destinations rasters do not have the same number of bands or the number of arrays in the LookupTable does not meet the restrictions described in the class comments.
Class LookupOp, Rectangle2D getBounds2D(BufferedImage)

Returns the bounding box of the filtered destination image. Since this is not a geometric operation the bounding box does not change. @param src the BufferedImage to be filtered @return the bounds of the filtered definition image.
Class LookupOp, Rectangle2D getBounds2D(Raster)

Returns the bounding box of the filtered destination Raster. Since this is not a geometric operation the bounding box does not change. @param src the Raster to be filtered @return the bounds of the filtered definition Raster.
Class LookupOp, Point2D getPoint2D(Point2D, Point2D)

Returns the location of the destination point given a point in the source. If dstPt is non-not null it will be used to hold the return value. Since this is not a geometric operation the srcPt will equal the dstPt. @param srcPt a Point2D that represents a point in the source image @param dstPt a Point2Dthat represents the location in the destination @return the Point2D in the destination that corresponds to the specified point in the source.
Class LookupOp, RenderingHints getRenderingHints()

Returns the rendering hints for this op. @return the RenderingHints object associated with this op.
Class LookupOp, LookupTable getTable()

Returns the LookupTable. @return the LookupTable of this LookupOp.

Class LookupTable, int getNumComponents()

Returns the number of components in the lookup table. @return the number of components in this LookupTable.
Class LookupTable, int getOffset()

Returns the offset. @return the offset of this LookupTable.
Class LookupTable, int[] lookupPixel(int[], int[])

Returns an int array of components for one pixel. SourceThe anddest destination may bearray contains the equal.result The destof the arraylookup and is returned. If dest is null a new array willis allocated. The source and destination can be allocatedequal. @param src the source array of components of one pixel @param dest the destination array of components for one pixel translated with this LookupTable @return an int array of components for one pixel.

Class MemoryImageSource

This class is an implementation of the ImageProducer interface which uses an array to produce pixel values for an Image. Here is an example which calculates a 100x100 image representing a fade from black to blue along the X axis and a fade from black to red along the Y axis:
 int w = 100; int h = 100; int pix[] = new int[w * h]; int index = 0; for (int y = 0; y  The MemoryImageSource is also capable of managing a memory image which varies over time to allow animation or custom rendering. Here is an example showing how to set up the animation source and signal changes in the data (adapted from the MemoryAnimationSourceDemo by Garth Dickie): 
 int pixels[]; MemoryImageSource source; public void init() { int width = 50; int height = 50; int size = width * height; pixels = new int[size]; int value = getBackground().getRGB(); for (int i = 0; i  @see ImageProducer @version 1.23 0227 12/0203/0001 @author Jim Graham @author Animation capabilities inspired by the MemoryAnimationSource class written by Garth Dickie
Class MemoryImageSource, constructor MemoryImageSource(int, int, ColorModel, byte[], int, int)

Constructs an ImageProducer object which uses an array of bytes to produce data for an Image object. @param w the width of the rectangle of pixels @param h the height of the rectangle of pixels @param cm the specified ColorModel @param pix an array of pixels @param off the offset into the array of where to store the first pixel @param scan the distance from one row of pixels to the next in the array @see java.awt.Component#createImage
Class MemoryImageSource, constructor MemoryImageSource(int, int, ColorModel, byte[], int, int, Hashtable)

Constructs an ImageProducer object which uses an array of bytes to produce data for an Image object. @param w the width of the rectangle of pixels @param h the height of the rectangle of pixels @param cm the specified ColorModel @param pix an array of pixels @param off the offset into the array of where to store the first pixel @param scan the distance from one row of pixels to the next in the array @param props a list of properties that the ImageProducer uses to process an image @see java.awt.Component#createImage
Class MemoryImageSource, constructor MemoryImageSource(int, int, ColorModel, int[], int, int)

Constructs an ImageProducer object which uses an array of integers to produce data for an Image object. @param w the width of the rectangle of pixels @param h the height of the rectangle of pixels @param cm the specified ColorModel @param pix an array of pixels @param off the offset into the array of where to store the first pixel @param scan the distance from one row of pixels to the next in the array @see java.awt.Component#createImage
Class MemoryImageSource, constructor MemoryImageSource(int, int, ColorModel, int[], int, int, Hashtable)

Constructs an ImageProducer object which uses an array of integers to produce data for an Image object. @param w the width of the rectangle of pixels @param h the height of the rectangle of pixels @param cm the specified ColorModel @param pix an array of pixels @param off the offset into the array of where to store the first pixel @param scan the distance from one row of pixels to the next in the array @param props a list of properties that the ImageProducer uses to process an image @see java.awt.Component#createImage
Class MemoryImageSource, constructor MemoryImageSource(int, int, int[], int, int)

Constructs an ImageProducer object which uses an array of integers in the default RGB ColorModel to produce data for an Image object. @param w the width of the rectangle of pixels @param h the height of the rectangle of pixels @param pix an array of pixels @param off the offset into the array of where to store the first pixel @param scan the distance from one row of pixels to the next in the array @see java.awt.Component#createImage @see ColorModel#getRGBdefault
Class MemoryImageSource, constructor MemoryImageSource(int, int, int[], int, int, Hashtable)

Constructs an ImageProducer object which uses an array of integers in the default RGB ColorModel to produce data for an Image object. @param w the width of the rectangle of pixels @param h the height of the rectangle of pixels @param pix an array of pixels @param off the offset into the array of where to store the first pixel @param scan the distance from one row of pixels to the next in the array @param props a list of properties that the ImageProducer uses to process an image @see java.awt.Component#createImage @see ColorModel#getRGBdefault
Class MemoryImageSource, void addConsumer(ImageConsumer)

Adds an ImageConsumer to the list of consumers interested in data for this image. @param ic the specified ImageConsumer @see ImageConsumer
Class MemoryImageSource, boolean isConsumer(ImageConsumer)

DetermineDetermines if an ImageConsumer is on the list of consumers currently interested in data for this image. @param ic the specified ImageConsumer @return true if the ImageConsumer is on the list; false otherwise. @see ImageConsumer
Class MemoryImageSource, void newPixels()

SendSends a whole new buffer of pixels to any ImageConsumers that are currently interested in the data for this image and notify them that an animation frame is complete. This method only has effect if the animation flag has been turned on through the setAnimated() method. @see #newPixels(int int int int boolean) @see ImageConsumer @see #setAnimated
Class MemoryImageSource, void newPixels(byte[], ColorModel, int, int)

ChangeChanges to a new byte array to hold the pixels for this image. If the animation flag has been turned on through the setAnimated() method then the new pixels will be immediately delivered to any ImageConsumers that are currently interested in the data for this image. @param newpix the new pixel array @param newmodel the specified ColorModel @param offset the offset into the array @param scansize the distance from one row of pixels to the next in the array @see #newPixels(int int int int boolean) @see #setAnimated
Class MemoryImageSource, void newPixels(int, int, int, int)

SendSends a rectangular region of the buffer of pixels to any ImageConsumers that are currently interested in the data for this image and notify them that an animation frame is complete. This method only has effect if the animation flag has been turned on through the setAnimated() method. If the full buffer update flag was turned on with the setFullBufferUpdates() method then the rectangle parameters will be ignored and the entire buffer will always be sent. @param x the x coordinate of the upper left corner of the rectangle of pixels to be sent @param y the y coordinate of the upper left corner of the rectangle of pixels to be sent @param w the width of the rectangle of pixels to be sent @param h the height of the rectangle of pixels to be sent @see #newPixels(int int int int boolean) @see ImageConsumer @see #setAnimated @see #setFullBufferUpdates
Class MemoryImageSource, void newPixels(int, int, int, int, boolean)

SendSends a rectangular region of the buffer of pixels to any ImageConsumers that are currently interested in the data for this image. If the framenotify parameter is true then the consumers are also notified that an animation frame is complete. This method only has effect if the animation flag has been turned on through the setAnimated() method. If the full buffer update flag was turned on with the setFullBufferUpdates() method then the rectangle parameters will be ignored and the entire buffer will always be sent. @param x the x coordinate of the upper left corner of the rectangle of pixels to be sent @param y the y coordinate of the upper left corner of the rectangle of pixels to be sent @param w the width of the rectangle of pixels to be sent @param h the height of the rectangle of pixels to be sent @param framenotify true if the consumers should be sent a SINGLEFRAMEDONE notification @see ImageConsumer @see #setAnimated @see #setFullBufferUpdates
Class MemoryImageSource, void newPixels(int[], ColorModel, int, int)

ChangeChanges to a new int array to hold the pixels for this image. If the animation flag has been turned on through the setAnimated() method then the new pixels will be immediately delivered to any ImageConsumers that are currently interested in the data for this image. @param newpix the new pixel array @param newmodel the specified ColorModel @param offset the offset into the array @param scansize the distance from one row of pixels to the next in the array @see #newPixels(int int int int boolean) @see #setAnimated
Class MemoryImageSource, void removeConsumer(ImageConsumer)

RemoveRemoves an ImageConsumer from the list of consumers interested in data for this image. @param ic the specified ImageConsumer @see ImageConsumer
Class MemoryImageSource, void requestTopDownLeftRightResend(ImageConsumer)

Requests that a given ImageConsumer have the image data delivered one more time in top-down left-right order. @param ic the specified ImageConsumer @see ImageConsumer
Class MemoryImageSource, void setAnimated(boolean)

ChangeChanges this memory image into a multi-frame animation or a single-frame static image depending on the animated parameter.

This method should be called immediately after the MemoryImageSource is constructed and before an image is created with it to ensure that all ImageConsumers will receive the correct multi-frame data. If an ImageConsumer is added to this ImageProducer before this flag is set then that ImageConsumer will see only a snapshot of the pixel data that was available when it connected. @param animated true if the image is a multi-frame animation

Class MemoryImageSource, void setFullBufferUpdates(boolean)

SpecifySpecifies whether this animated memory image should always be updated by sending the complete buffer of pixels whenever there is a change. This flag is ignored if the animation flag is not turned on through the setAnimated() method.

This method should be called immediately after the MemoryImageSource is constructed and before an image is created with it to ensure that all ImageConsumers will receive the correct pixel delivery hints. @param fullbuffers true if the complete pixel buffer should always be sent @see #setAnimated

Class MemoryImageSource, void startProduction(ImageConsumer)

Adds an ImageConsumer to the list of consumers interested in data for this image and immediately startstarts delivery of the image data through the ImageConsumer interface. @param ic the specified ImageConsumer image data through the ImageConsumer interface. @see ImageConsumer

Class MultiPixelPackedSampleModel, Object getDataElements(int, int, Object, DataBuffer)

Returns data for a single pixel in a primitive array of type TransferType. For a MultiPixelPackedSampleModel the array has one element and the type is the smallest of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT that can hold a single pixel. Generally obj should be passed in as null so that the Object is created automatically and is the correct primitive data type.

The following code illustrates transferring data for one pixel from DataBuffer db1 whose storage layout is described by MultiPixelPackedSampleModel mppsm1 to DataBuffer db2 whose storage layout is described by MultiPixelPackedSampleModel mppsm2. The transfer is generally more efficient than using getPixel or setPixel.

 MultiPixelPackedSampleModel mppsm1 mppsm2; DataBufferInt db1 db2; mppsm2.setDataElements(x y mppsm1.getDataElements(x y null db1) db2); 
Using getDataElements or 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 not null it should be a primitive array of type TransferType. Otherwise a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if the coordinates are not in bounds or if obj is not null and is not large enough to hold the pixel data. @param x  y coordinates of the pixel location. @param obj a primitive array in which to return the pixel data or null. @param data the DataBuffer containing the image data. @return an Object containing data for the specified pixel. @exception ClassCastException if obj is not a primitive array of type TransferType or is not null @exception ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if obj is not null or not large enough to hold the pixel data @see #setDataElements(int int Object DataBuffer)

Class MultiPixelPackedSampleModel, int[] getPixel(int, int, int[], DataBuffer)

Returns the specified single band pixel in the first element of an int array. ArrayIndexOutOfBoundsException is thrown if the coordinates are not in bounds. @param x  y the coordinates of the pixel location @param iArray the array containing the pixel to be returned or null @param data the DataBuffer where image data is stored @return an array containing the specified pixel. @exception ArrayIndexOutOfBoundsException if the coordinates are not in bounds @see #setPixel(int int int[] DataBuffer)
Class MultiPixelPackedSampleModel, int getSample(int, int, int, DataBuffer)

Returns as int the sample in a specified band for the pixel located at (x  y). An ArrayIndexOutOfBoundsException is thrown if the coordinates are not in bounds. @param x  y the coordinates of the specified pixel @param b the band to return which is assumed to be 0 @param data the DataBuffer containing the image data @return the specified band containing the sample of the specified pixel. @exception ArrayIndexOutOfBoundException if the specified coordinates are not in bounds. @see #setSample(int int int int DataBuffer)
Class MultiPixelPackedSampleModel, void setDataElements(int, int, Object, DataBuffer)

Sets the data for a single pixel in the specified DataBuffer from a primitive array of type TransferType. For a MultiPixelPackedSampleModel only the first element of the array holds valid data and the type must be the smallest of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT that can hold a single pixel.

The following code illustrates transferring data for one pixel from DataBuffer db1 whose storage layout is described by MultiPixelPackedSampleModel mppsm1 to DataBuffer db2 whose storage layout is described by MultiPixelPackedSampleModel mppsm2. The transfer is generally more efficient than using getPixel or setPixel.

 MultiPixelPackedSampleModel mppsm1 mppsm2; DataBufferInt db1 db2; mppsm2.setDataElements(x y mppsm1.getDataElements(x y null db1) db2); 
Using getDataElements or setDataElements to transfer between two DataBuffer/SampleModel pairs is legitimate if the SampleModel objects 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 is thrown if the coordinates are not in bounds or if obj is not large enough to hold the pixel data. @param x  y the coordinates of the pixel location @param obj a primitive array containing pixel data @param data the DataBuffer containing the image data @see #getDataElements(int int Object DataBuffer)

Class MultiPixelPackedSampleModel, void setPixel(int, int, int[], DataBuffer)

Sets a pixel in the DataBuffer using an int array for input. ArrayIndexOutOfBoundsException is thrown if the coordinates are not in bounds. @param x  y the coordinates of the pixel location @param iArray the input pixel in an int array @param data the DataBuffer containing the image data @see #getPixel(int int int[] DataBuffer)
Class MultiPixelPackedSampleModel, void setSample(int, int, int, int, DataBuffer)

Sets a sample in the specified band for the pixel located at (x  y) in the DataBuffer using an int for input. An ArrayIndexOutOfBoundsException is thrown if the coordinates are not in bounds. @param x  y the coordinates of the specified pixel @param b the band to return which is assumed to be 0 @param s the input sample as an int @param data the DataBuffer where image data is stored @exception ArrayIndexOutOfBoundsException if the coordinates are not in bounds. @see #getSample(int int int DataBuffer)

Class PixelGrabber

The PixelGrabber class implements an ImageConsumer which can be attached to an Image or ImageProducer object to retrieve a subset of the pixels in that image. Here is an example:
 public void handlesinglepixel(int x int y int pixel) { int alpha = (pixel >> 24) & 0xff; int red = (pixel >> 16) & 0xff; int green = (pixel >> 8) & 0xff; int blue = (pixel ) & 0xff; // Deal with the pixel as necessary... } public void handlepixels(Image img int x int y int w int h) { int[] pixels = new int[w * h]; PixelGrabber pg = new PixelGrabber(img x y w h pixels 0 w); try { pg.grabPixels(); } catch (InterruptedException e) { System.err.println("interrupted waiting for pixels "); return; } if ((pg.getStatus() & ImageObserver.ABORT) = 0) { System.err.println("image fetch aborted or errored"); return; } for (int j = 0; j  @see ColorModel#getRGBdefault @version 1.19 0221 12/0203/0001 @author Jim Graham
Class PixelGrabber, constructor PixelGrabber(ImageProducer, int, int, int, int, int[], int, int)

Create a PixelGrabber object to grab the (x y w h) rectangular section of pixels from the image produced by the specified ImageProducer into the given array. The pixels are stored into the array in the default RGB ColorModel. The RGB data for pixel (i j) where (i j) is inside the rectangle (x y w h) is stored in the array at pix[(j - y) * scansize + (i - x) + off]. @seeparam ColorModel#getRGBdefaultip @paramthe ImageProducer that imgproduces the image from which to retrieve pixels from @param x the x coordinate of the upper left corner of the rectangle of pixels to retrieve from the image relative to the default (unscaled) size of the image @param y the y coordinate of the upper left corner of the rectangle of pixels to retrieve from the image @param w the width of the rectangle of pixels to retrieve @param h the height of the rectangle of pixels to retrieve @param pix the array of integers which are to be used to hold the RGB pixels retrieved from the image @param off the offset into the array of where to store the first pixel @param scansize the distance from one row of pixels to the next in the array @see ColorModel#getRGBdefault
Class PixelGrabber, ColorModel getColorModel()

Get the ColorModel for the pixels stored in the array. If the PixelGrabber was constructed with an explicit pixel buffer then this method will always return the default RGB ColorModel otherwise it may return null until the ColorModel used by the ImageProducer is known. Since the PixelGrabber may fall back on accumulating the data in the default RGB ColorModel at any time if the source image uses more than one ColorModel to deliver the data the ColorModel object returned by this method may change over time until the image grab is complete and may not reflect any of the ColorModel objects that was used by the ImageProducer to deliver the pixels. @return the ColorModel object used for storing the pixels @see #getStatus @see ColorModel#getRGBdefault @see #setColorModel(ColorModel)
Class PixelGrabber, Object getPixels()

Get the pixel buffer. If the PixelGrabber was not constructed with an explicit pixel buffer to hold the pixels then this method will return null until the size and format of the image data is known. Since the PixelGrabber may fall back on accumulating the data in the default RGB ColorModel at any time if the source image uses more than one ColorModel to deliver the data the array object returned by this method may change over time until the image grab is complete. @return either a byte array or an int array @see #getStatus @see #setPixels(int int int int ColorModel byte[] int int) @see #setPixels(int int int int ColorModel int[] int int)
Class PixelGrabber, int getStatus()

Return the status of the pixels. The ImageObserver flags representing the available pixel information are returned. @see ImageObserver @return the bitwise OR of all relevant ImageObserver flags @see ImageObserver
Class PixelGrabber, void imageComplete(int)

The imageComplete method is part of the ImageConsumer API which this class must implement to retrieve the pixels.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels. @param status the status of image loading

Class PixelGrabber, void setColorModel(ColorModel)

The setColorModel method is part of the ImageConsumer API which this class must implement to retrieve the pixels.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels. @param model the specified ColorModel @see #getColorModel

Class PixelGrabber, void setDimensions(int, int)

The setDimensions method is part of the ImageConsumer API which this class must implement to retrieve the pixels.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels. @param width the width of the dimension @param height the height of the dimension

Class PixelGrabber, void setHints(int)

The setHints method is part of the ImageConsumer API which this class must implement to retrieve the pixels.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels. @param hints a set of hints used to process the pixels

Class PixelGrabber, void setPixels(int, int, int, int, ColorModel, byte[], int, int)

The setPixels method is part of the ImageConsumer API which this class must implement to retrieve the pixels.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels. @param srcX  srcY the coordinates of the upper-left corner of the area of pixels to be set @param srcW the width of the area of pixels @param srcH the height of the area of pixels @param model the specified ColorModel @param pixels the array of pixels @param srcOff the offset into the pixels array @param srcScan the distance from one row of pixels to the next in the pixels array @see #getPixels

Class PixelGrabber, void setPixels(int, int, int, int, ColorModel, int[], int, int)

The setPixels method is part of the ImageConsumer API which this class must implement to retrieve the pixels.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels. @param srcX  srcY the coordinates of the upper-left corner of the area of pixels to be set @param srcW the width of the area of pixels @param srcH the height of the area of pixels @param model the specified ColorModel @param pixels the array of pixels @param srcOff the offset into the pixels array @param srcScan the distance from one row of pixels to the next in the pixels array @see #getPixels

Class PixelGrabber, void setProperties(Hashtable)

The setProperties method is part of the ImageConsumer API which this class must implement to retrieve the pixels.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being grabbed. Developers using this class to retrieve pixels from an image should avoid calling this method directly since that operation could result in problems with retrieving the requested pixels. @param props the list of properties


Class PixelInterleavedSampleModel, SampleModel createCompatibleSampleModel(int, int)

Creates a new PixelInterleavedSampleModel with the specified width and height. The new PixelInterleavedSampleModel will have the same number of bands storage data type and pixel stride as this PixelInterleavedSampleModel. The band offsets may be compressed such that the minimum of all of the band offsets is zero. @param w the width of the resulting SampleModel @param h the height of the resulting SampleModel @return a new SampleModel with the specified width and height. @throws IllegalArgumentException if w or h is not greater than 0

Class RGBImageFilter

This class provides an easy way to create an ImageFilter which modifies the pixels of an image in the default RGB ColorModel. It is meant to be used in conjunction with a FilteredImageSource object to produce filtered versions of existing images. It is an abstract class that provides the calls needed to channel all of the pixel data through a single method which converts pixels one at a time in the default RGB ColorModel regardless of the ColorModel being used by the ImageProducer. The only method which needs to be defined to create a useable image filter is the filterRGB method. Here is an example of a definition of a filter which swaps the red and blue components of an image:
 class RedBlueSwapFilter extends RGBImageFilter { public RedBlueSwapFilter() { // The filter's operation does not depend on the // pixel's location so IndexColorModels can be // filtered directly. canFilterIndexColorModel = true; } public int filterRGB(int x int y int rgb) { return ((rgb & 0xff00ff00) | ((rgb & 0xff0000) >> 16) | ((rgb & 0xff) < 16)); } } 
@see FilteredImageSource @see ImageFilter @see ColorModel#getRGBdefault @version 1.19 0221 12/0203/0001 @author Jim Graham
Class RGBImageFilter, int filterRGB(int, int, int)

Subclasses must specify a method to convert a single input pixel in the default RGB ColorModel to a single output pixel. @param x  y the coordinates of the pixel @param rgb the integer pixel representation in the default RGB color model @return a filtered pixel in the default RGB color model. @see ColorModel#getRGBdefault @see #filterRGBPixels
Class RGBImageFilter, void filterRGBPixels(int, int, int, int, int[], int, int)

Filters a buffer of pixels in the default RGB ColorModel by passing them one by one through the filterRGB method. @param x  y the coordinates of the upper-left corner of the region of pixels @param w the width of the region of pixels @param h the height of the region of pixels @param pixels the array of pixels @param off the offset into the pixels array @param scansize the distance from one row of pixels to the next in the array @see ColorModel#getRGBdefault @see #filterRGB

Class Raster, constructor Raster(SampleModel, DataBuffer, Point)

Constructs a Raster with the given SampleModel and DataBuffer. The Raster's upper left corner is origin and it is the same size as the SampleModel. The DataBuffer is not initialized and must be compatible with SampleModel. @param sampleModel The SampleModel that specifies the layout. @param dataBuffer The DataBuffer that contains the image data. @param origin The Point that specifies the origin @throws RasterFormatException if computing either origin.x + sampleModel.getWidth() or origin.y + sampleModel.getHeight() results in integer overflow @throws NullPointerException either sampleModel or origin is null
Class Raster, constructor Raster(SampleModel, DataBuffer, Rectangle, Point, Raster)

Constructs a Raster with the given SampleModel DataBuffer and parent. aRegion specifies the bounding rectangle of the new Raster. When translated into the base Raster's coordinate system aRegion must be contained by the base Raster. (The base Raster is the Raster's ancestor which has no parent.) sampleModelTranslate specifies the sampleModelTranslateX and sampleModelTranslateY values of the new Raster. Note that this constructor should generally be called by other constructors or create methods it should not be used directly. @param sampleModel The SampleModel that specifies the layout. @param dataBuffer The DataBuffer that contains the image data. @param aRegion The Rectangle that specifies the image area. @param sampleModelTranslate The Point that specifies the translation from SampleModel to Raster coordinates. @param parent The parent (if any) of this raster @throws NullPointerException if any of sampleModel dataBuffer aRegion or sampleModelTranslate is null @throws RasterFormatException if aRegion has width or height less than or equal to zero or computing either aRegion.x + aRegion.width or aRegion.y + aRegion.height results in integer overflow
Class Raster, constructor Raster(SampleModel, Point)

Constructs a Raster with the given SampleModel. The Raster's upper left corner is origin and it is the same size as the SampleModel. A DataBuffer large enough to describe the Raster is automatically created. @param sampleModel The SampleModel that specifies the layout. @param origin The Point that specified the origin @throws RasterFormatException if computing either origin.x + sampleModel.getWidth() or origin.y + sampleModel.getHeight() results in integer overflow @throws NullPointerException either sampleModel or origin is null
Class Raster, WritableRaster createBandedRaster(DataBuffer, int, int, int, int[], int[], Point)

Creates a Raster based on a BandedSampleModel with the specified DataBuffer width height scanline stride bank indices and band offsets. The number of bands is inferred from bankIndices.length and bandOffsets.length which must be the same. The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. @param dataBuffer the DataBuffer that contains the image data @param w the width in pixels of the image data @param h the height in pixels of the image data @param scanlineStride the line stride of the image data @param bankIndices the bank indices for each band @param bandOffsets the offsets of all bands @param location the upper-left corner of the Raster @return a WritableRaster object with the specified DataBuffer width height scanline stride bank indices and band offsets. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws IllegalArgumentException if dataType is not one of the supported data types which are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT @throws NullPointerException if dataBuffer is null
Class Raster, WritableRaster createBandedRaster(int, int, int, int, Point)

Creates a Raster based on a BandedSampleModel with the specified data type width height and number of bands.

The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. The dataType parameter should be one of the enumerated values defined in the DataBuffer class.

The only dataTypes supported currently are TYPE_BYTE TYPE_USHORT and TYPE_INT. @param dataType the data type for storing samples @param w the width in pixels of the image data @param h the height in pixels of the image data @param bands the number of bands @param location the upper-left corner of the Raster @return a WritableRaster object with the specified data type width height and number of bands. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws ArrayIndexOutOfBoundsException if bands is less than 1

Class Raster, WritableRaster createBandedRaster(int, int, int, int, int[], int[], Point)

Creates a Raster based on a BandedSampleModel with the specified data type width height scanline stride bank indices and band offsets. The number of bands is inferred from bankIndices.length and bandOffsets.length which must be the same.

The upper left corner of the Raster is given by the location argument. The dataType parameter should be one of the enumerated values defined in the DataBuffer class.

The only dataTypes supported currently are TYPE_BYTE TYPE_USHORT and TYPE_INT. @param dataType the data type for storing samples @param w the width in pixels of the image data @param h the height in pixels of the image data @param scanlineStride the line stride of the image data @param bankIndices the bank indices for each band @param bandOffsets the offsets of all bands @param location the upper-left corner of the Raster @return a WritableRaster object with the specified data type width height scanline stride bank indices and band offsets. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws IllegalArgumentException if dataType is not one of the supported data types which are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT @throws ArrayIndexOutOfBoundsException if bankIndices or bandOffsets is null

Class Raster, Raster createChild(int, int, int, int, int, int, int[])

Returns a new Raster which shares all or part of this Raster's DataBuffer. The new Raster will possess a reference to the current Raster accessible through its getParent() method.

The parentX parentY width and height parameters form a Rectangle in this Raster's coordinate space indicating the area of pixels to be shared. An error will be thrown if this Rectangle is not contained with the bounds of the current Raster.

The new Raster may additionally be translated to a different coordinate system for the plane than that used by the current Raster. The childMinX and childMinY parameters give the new (x y) coordinate of the upper-left pixel of the returned Raster; the coordinate (childMinX childMinY) in the new Raster will map to the same pixel as the coordinate (parentX parentY) in the current Raster.

The new Raster may be defined to contain only a subset of the bands of the current Raster possibly reordered by means of the bandList parameter. If bandList is null it is taken to include all of the bands of the current Raster in their current order.

To create a new Raster that contains a subregion of the current Raster but shares its coordinate system and bands this method should be called with childMinX equal to parentX childMinY equal to parentY and bandList equal to null. @param parentX X coordinate of the upper left corner in this Raster's coordinates. @param  parentY Y coordinatecoordinates of the upper -left corner in this Raster's coordinates. @param width Width of the region starting at (parentX parentY). @param height Height of the region starting at (parentX parentY). @param childMinX X coordinate of the upper left corner of the returned Raster. @param  childMinY Y coordinatecoordinates of the upper -left corner of the returned Raster. @param bandList Array of band indices or null to use all bands @return a new Raster. @exception RasterFormatException if the specified subregion is outside of the raster bounds. @throws RasterFormatException if width or height is less than or equal to zero or computing any of parentX + width parentY + height childMinX + width or childMinY + height results in integer overflow

Class Raster, WritableRaster createCompatibleWritableRaster()

Create a compatible WritableRaster the same size as this Raster with the same SampleModel and a new initialized DataBuffer. @return a compatible WritableRaster with the same sample model and a new data buffer.
Class Raster, WritableRaster createCompatibleWritableRaster(Rectangle)

Create a compatible WritableRaster with location (minX minY) and size (width height) specified by rect a new SampleModel and a new initialized DataBuffer. @param rect a Rectangle that specifies the size and location of the WritableRaster @return a compatible WritableRaster with the specified size and location and a new sample model and data buffer. @throws RasterFormatException if rect has width or height less than or equal to zero or computing either rect.x + rect.width or rect.y + rect.height results in integer overflow @throws NullPointerException if rect is null
Class Raster, WritableRaster createCompatibleWritableRaster(int, int)

Create a compatible WritableRaster with the specified size a new SampleModel and a new initialized DataBuffer. @param w the specified width of the new WritableRaster @param h the specified height of the new WritableRaster @return a compatible WritableRaster with the specified size and a new sample model and data buffer. @exception RasterFormatException if the width or height is less than or equal to zero.
Class Raster, WritableRaster createCompatibleWritableRaster(int, int, int, int)

Create a compatible WritableRaster with the specified location (minX minY) and size (width height) a new SampleModel and a new initialized DataBuffer. @param x  y the coordinates of the upper-left corner of the WritableRaster @param w the specified width of the WritableRaster @param h the specified height of the WritableRaster @return a compatible WritableRaster with the specified size and location and a new sample model and data buffer. @throws RasterFormatException if w or h is less than or equal to zero or computing either x + w or y + h results in integer overflow
Class Raster, WritableRaster createInterleavedRaster(DataBuffer, int, int, int, int, int[], Point)

Creates a Raster based on a PixelInterleavedSampleModel with the specified DataBuffer width height scanline stride pixel stride and band offsets. The number of bands is inferred from bandOffsets.length. The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used.

Note that interleaved DataBuffer.TYPE_INT Rasters are not supported. To create a 1-band Raster of type DataBuffer.TYPE_INT use Raster.createPackedRaster(). @param dataBuffer the DataBuffer that contains the image data @param w the width in pixels of the image data @param h the height in pixels of the image data @param scanlineStride the line stride of the image data @param pixelStride the pixel stride of the image data @param bandOffsets the offsets of all bands @param location the upper-left corner of the Raster @return a WritableRaster object with the specified DataBuffer width height scanline stride pixel stride and band offsets. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws IllegalArgumentException if dataType is not one of the supported data types which are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT @throws RasterFormatException if dataBuffer has more than one bank. @throws NullPointerException if dataBuffer is null

Class Raster, WritableRaster createInterleavedRaster(int, int, int, int, Point)

Creates a Raster based on a PixelInterleavedSampleModel with the specified data type width height and number of bands.

The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. The dataType parameter should be one of the enumerated values defined in the DataBuffer class.

Note that interleaved DataBuffer.TYPE_INT Rasters are not supported. To create a 1-band Raster of type DataBuffer.TYPE_INT use Raster.createPackedRaster().

The only dataTypes supported currently are TYPE_BYTE and TYPE_USHORT. @param dataType the data type for storing samples @param w the width in pixels of the image data @param h the height in pixels of the image data @param bands the number of bands @param location the upper-left corner of the Raster @return a WritableRaster object with the specified data type width height and number of bands. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow

Class Raster, WritableRaster createInterleavedRaster(int, int, int, int, int, int[], Point)

Creates a Raster based on a PixelInterleavedSampleModel with the specified data type width height scanline stride pixel stride and band offsets. The number of bands is inferred from bandOffsets.length.

The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. The dataType parameter should be one of the enumerated values defined in the DataBuffer class.

Note that interleaved DataBuffer.TYPE_INT Rasters are not supported. To create a 1-band Raster of type DataBuffer.TYPE_INT use Raster.createPackedRaster().

The only dataTypes supported currently are TYPE_BYTE and TYPE_USHORT. @param dataType the data type for storing samples @param w the width in pixels of the image data @param h the height in pixels of the image data @param scanlineStride the line stride of the image data @param pixelStride the pixel stride of the image data @param bandOffsets the offsets of all bands @param location the upper-left corner of the Raster @return a WritableRaster object with the specified data type width height scanline stride pixel stride and band offsets. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws IllegalArgumentException if dataType is not one of the supported data types which are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INTUSHORT.

Class Raster, WritableRaster createPackedRaster(DataBuffer, int, int, int, Point)

Creates a Raster based on a MultiPixelPackedSampleModel with the specified DataBuffer width height and bits per pixel. The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. @param dataBuffer the DataBuffer that contains the image data @param w the width in pixels of the image data @param h the height in pixels of the image data @param bitsPerPixel the number of bits for each pixel @param location the upper-left corner of the Raster @return a WritableRaster object with the specified DataBuffer width height and bits per pixel. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws IllegalArgumentException if dataType is not one of the supported data types which are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT @throws RasterFormatException if dataBuffer has more than one bank. @throws NullPointerException if dataBuffer is null
Class Raster, WritableRaster createPackedRaster(DataBuffer, int, int, int, int[], Point)

Creates a Raster based on a SinglePixelPackedSampleModel with the specified DataBuffer width height scanline stride and band masks. The number of bands is inferred from bandMasks.length. The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. @param dataBuffer the DataBuffer that contains the image data @param w the width in pixels of the image data @param h the height in pixels of the image data @param scanlineStride the line stride of the image data @param bandMasks an array containing an entry for each band @param location the upper-left corner of the Raster @return a WritableRaster object with the specified DataBuffer width height scanline stride and band masks. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws IllegalArgumentException if dataType is not one of the supported data types which are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT @throws RasterFormatException if dataBuffer has more than one bank. @throws NullPointerException if dataBuffer is null
Class Raster, WritableRaster createPackedRaster(int, int, int, int, int, Point)

Creates a Raster based on a packed SampleModel with the specified data type width height number of bands and bits per band. If the number of bands is one the SampleModel will be a MultiPixelPackedSampleModel.

If the number of bands is more than one the SampleModel will be a SinglePixelPackedSampleModel with each band having bitsPerBand bits. In either case the requirements on dataType and bitsPerBand imposed by the corresponding SampleModel must be met.

The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. The dataType parameter should be one of the enumerated values defined in the DataBuffer class.

The only dataTypes supported currently are TYPE_BYTE TYPE_USHORT and TYPE_INT. @param dataType the data type for storing samples @param w the width in pixels of the image data @param h the height in pixels of the image data @param bands the number of bands @param bitsPerBand the number of bits per band @param location the upper-left corner of the Raster @return a WritableRaster object with the specified data type width height number of bands and bits per band. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws IllegalArgumentException if the product of bitsPerBand and bands is greater than the number of bits held by dataType @throws IllegalArgumentException if bitsPerBand or bands is not greater than zero @throws IllegalArgumentException if dataType is not one of the supported data types which are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT

Class Raster, WritableRaster createPackedRaster(int, int, int, int[], Point)

Creates a Raster based on a SinglePixelPackedSampleModel with the specified data type width height and band masks. The number of bands is inferred from bandMasks.length.

The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. The dataType parameter should be one of the enumerated values defined in the DataBuffer class.

The only dataTypes supported currently are TYPE_BYTE TYPE_USHORT and TYPE_INT. @param dataType the data type for storing samples @param w the width in pixels of the image data @param h the height in pixels of the image data @param bandMasks an array containing an entry for each band @param location the upper-left corner of the Raster @return a WritableRaster object with the specified data type width height and band masks. @throws RasterFormatException if w or h is less than or equal to zero or computing either location.x + w or location.y + h results in integer overflow @throws IllegalArgumentException if dataType is not one of the supported data types which are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT

Class Raster, Raster createRaster(SampleModel, DataBuffer, Point)

Creates a Raster with the specified SampleModel and DataBuffer. The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. @param sm the specified SampleModel @param db the specified DataBuffer @param location the upper-left corner of the Raster @return a Raster with the specified SampleModel DataBuffer and location. @throws RasterFormatException if computing either location.x + sm.getWidth() or location.y + sm.getHeight() results in integer overflow @throws RasterFormatException if dataBuffer has more than one bank and the sampleModel is PixelInterleavedSampleModel SinglePixelPackedSampleModel or MultiPixelPackedSampleModel. @throws NullPointerException if either SampleModel or DataBuffer is null
Class Raster, Raster createTranslatedChild(int, int)

Create a Raster with the same size SampleModel and DataBuffer as this one but with a different location. The new Raster will possess a reference to the current Raster accessible through its getParent() method. @param childMinX X childMinY coordcoordinates of the upper -left corner of the new Raster. @paramreturn childMinY Ya new coordRaster ofwith the uppersame left corner of thesize SampleModel and DataBuffer newas this Raster but with the specified location. @throws RasterFormatException if computing either childMinX + this.getWidth() or childMinY + this.getHeight() results in integer overflow
Class Raster, WritableRaster createWritableRaster(SampleModel, DataBuffer, Point)

Creates a WritableRaster with the specified SampleModel and DataBuffer. The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. @param Thesm the specified SampleModel @param db the specified DataBuffer @param location the onlyupper-left corner of the WritableRaster @return dataTypesa WritableRaster supported currently arewith the specified TYPE_BYTESampleModel TYPE_USHORTDataBuffer and TYPE_INTlocation. @throws RasterFormatException if computing either location.x + sm.getWidth() or location.y + sm.getHeight() results in integer overflow @throws RasterFormatException if dataBuffer has more than one bank and the sampleModel is PixelInterleavedSampleModel SinglePixelPackedSampleModel or MultiPixelPackedSampleModel. @throws NullPointerException if either SampleModel or DataBuffer is null
Class Raster, WritableRaster createWritableRaster(SampleModel, Point)

Creates a WritableRaster with the specified SampleModel. The upper left corner of the Raster is given by the location argument. If location is null (0 0) will be used. @param Thesm the specified SampleModel @param location the upper-left corner of the onlyWritableRaster @return dataTypesa supportedWritableRaster currently arewith the TYPE_BYTEspecified TYPE_USHORTSampleModel and TYPE_INTlocation. @throws RasterFormatException if computing either location.x + sm.getWidth() or location.y + sm.getHeight() results in integer overflow
Class Raster, Rectangle getBounds()

Returns the bounding Rectangle of this Raster. This function returns the same information as getMinX/MinY/Width/Height. @return the bounding box of this Raster.
Class Raster, DataBuffer getDataBuffer()

Returns the DataBuffer associated with this Raster. @return the DataBuffer of this Raster.
Class Raster, Object getDataElements(int, int, Object)

Returns data for a single pixel in a primitive array of type TransferType. For image data supported by the Java 2D(tm) API this will be one of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE. Data may be returned in a packed format thus increasing efficiency for data transfers. There will be no explicit bounds checking on the parameters. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. A ClassCastException will be thrown if the input object is non null and references anything other than an array of TransferType. @see java.awt.image.SampleModel#getDataElements(int int Object DataBuffer) @param x The X coordinate of the pixel location. @param  y The Ythe coordinatecoordinates of the pixel location. @param outData An object reference to an array of type defined by getTransferType() and length getNumDataElements(). If null an array of appropriate type and size will be allocated. @return An object reference to an array of type defined by getTransferType() with the requested pixel data. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if outData is too small to hold the output.
Class Raster, Object getDataElements(int, int, int, int, Object)

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_INTDOUBLE. Data may be returned in a packed format thus increasing efficiency for data transfers. There will be no explicit bounds checking on the parameters. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. A ClassCastException will be thrown if the input object is non null and references anything other than an array of TransferType. @see java.awt.image.SampleModel#getDataElements(int int int int Object DataBuffer) @param x The X coordinate of the upper left pixel location. @param  y The Ythe coordinatecoordinates of the upper -left pixel location. @param widthw Width of the pixel rectangle. @param heighth Height of the pixel rectangle. @param outData An object reference to an array of type defined by getTransferType() and length w*h*getNumDataElements(). If null an array of appropriate type and size will be allocated. @return An object reference to an array of type defined by getTransferType() with the requested pixel data. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if outData is too small to hold the output.
Class Raster, int getHeight()

Returns the height in pixels of the Raster. @return the height of this Raster.
Class Raster, int getMinX()

Returns the minimum valid X coordinate of the Raster. @return the minimum x coordinate of this Raster.
Class Raster, int getMinY()

Returns the minimum valid Y coordinate of the Raster. @return the minimum y coordinate of this Raster.
Class Raster, int getNumBands()

Returns the number of bands (samples per pixel) in this Raster. @return the number of bands of this Raster.
Class Raster, int getNumDataElements()

Returns the number of data elements needed to transfer one 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 underlying 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 data type of the DataBuffer. @return the number of data elements.
Class Raster, Raster getParent()

Returns the parent Raster (if any) of this Raster or elsenull. @return the parent Raster or null.
Class Raster, double[] getPixel(int, int, double[])

Returns the samples in an array of double for the specified pixel. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param xHowever Theexplicit X coordinatebounds of the pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the pixel location. @param dArray An optionally preallocated double array @return the samples for the specified pixel. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if dArray is too small to hold the output.
Class Raster, float[] getPixel(int, int, float[])

Returns the samples in an array of float for the specified pixel. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param xHowever Theexplicit X coordinatebounds of the pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the pixel location. @param fArray An optionally preallocated float array @return the samples for the specified pixel. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the output.
Class Raster, int[] getPixel(int, int, int[])

Returns the samples in an array of int for the specified pixel. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param xHowever Theexplicit X coordinatebounds of the pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the pixel location. @param iArray An optionally preallocated int array @return the samples for the specified pixel. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the output.
Class Raster, double[] getPixels(int, int, int, int, double[])

Returns a double array containing all samples for a rectangle of pixels one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x TheHowever Xexplicit coordinate of thebounds upper left pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the upper -left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param dArray An optionally pre-allocated double array @return the samples for the specified rectangle of pixels. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if dArray is too small to hold the output.
Class Raster, float[] getPixels(int, int, int, int, float[])

Returns a float array containing all samples for a rectangle of pixels one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x TheHowever Xexplicit coordinate of thebounds upper left pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the upper left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param fArray An optionally pre-allocated float array @return the samples for the specified rectangle of pixels. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the output.
Class Raster, int[] getPixels(int, int, int, int, int[])

Returns an int array containing all samples for a rectangle of pixels one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x TheHowever Xexplicit coordinate of thebounds upper left pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the upper -left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param iArray An optionally pre-allocated int array @return the samples for the specified rectangle of pixels. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the output.
Class Raster, int getSample(int, int, int)

Returns the sample in a specified band for the pixel located at (x y) as an int. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The y X coordinatethe coordinates of the pixel location. @param yb The Yband coordinateto ofreturn @return the sample in the specified band for the pixel locationat the specified coordinate. @param bthrows ArrayIndexOutOfBoundsException Theif the coordinates or the band toindex returnare not in bounds.
Class Raster, double getSampleDouble(int, int, int)

Returns the sample in a specified band for a pixel located at (x y) as a double. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The y X coordinatethe coordinates of the pixel location. @param yb The Yband coordinateto ofreturn @return the sample in the specified band for the pixel locationat the specified coordinate. @param bthrows ArrayIndexOutOfBoundsException Theif the coordinates or the band toindex returnare not in bounds.
Class Raster, float getSampleFloat(int, int, int)

Returns the sample in a specified band for the pixel located at (x y) as a float. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The y X coordinatethe coordinates of the pixel location. @param yb The Yband coordinateto ofreturn @return the sample in the specified band for the pixel locationat the specified coordinate. @param bthrows ArrayIndexOutOfBoundsException Theif the coordinates or the band toindex returnare not in bounds.
Class Raster, SampleModel getSampleModel()

Returns the SampleModel that describes the layout of the image data. @return the SampleModel of this Raster.
Class Raster, int getSampleModelTranslateX()

Returns the X translation from the coordinate system of the SampleModel to that of the Raster. To convert a pixel's X coordinate from the Raster coordinate system to the SampleModel coordinate system this value must be subtracted. @return the X translation from the coordinate space of the Raster's SampleModel to that of the Raster.
Class Raster, int getSampleModelTranslateY()

Returns the Y translation from the coordinate system of the SampleModel to that of the Raster. To convert a pixel's Y coordinate from the Raster coordinate system to the SampleModel coordinate system this value must be subtracted. @return the Y translation from the coordinate space of the Raster's SampleModel to that of the Raster.
Class Raster, double[] getSamples(int, int, int, int, int, double[])

Returns the samples for a specified band for a specified rectangle of pixels in a double array one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x TheHowever Xexplicit coordinate of thebounds upper left pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the upper -left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param b The band to return. @param dArray An optionally pre-allocated double array @return the samples for the specified band for the specified rectangle of pixels. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if dArray is too small to hold the output.
Class Raster, float[] getSamples(int, int, int, int, int, float[])

Returns the samples for a specified band for the specified rectangle of pixels in a float array one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x TheHowever Xexplicit coordinate of thebounds upper left pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the upper -left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param b The band to return. @param fArray An optionally pre-allocated float array @return the samples for the specified band for the specified rectangle of pixels. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if fArray is too small to hold the output.
Class Raster, int[] getSamples(int, int, int, int, int, int[])

Returns the samples for a specified band for the specified rectangle of pixels in an int array one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x TheHowever Xexplicit coordinate of thebounds upper left pixel locationchecking is not guaranteed. @param yx The y Y coordinatethe coordinates of the upper -left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param b The band to return. @param iArray An optionally pre-allocated int array @return the samples for the specified band for the specified rectangle of pixels. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if iArray is too small to hold the output.
Class Raster, 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 underlying 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 data type of the DataBuffer. The TransferType will be one of the types defined in DataBuffer. @return this transfer type.
Class Raster, int getWidth()

Returns the width in pixels of the Raster. @return the width of this Raster.

Class RasterOp, WritableRaster createCompatibleDestRaster(Raster)

Creates a zeroed destination Raster with the correct size and number of bands. The IllegalArgumentException may be thrown if the source Raster is incompatible with the types of Rasters allowed by the class implementing this filter. @param src the source Raster @return a WritableRaster that is compatible with src
Class RasterOp, WritableRaster filter(Raster, WritableRaster)

Performs a single-input/single-output operation from a source Raster to a destination Raster. If the destination Raster is null a new Raster will be created. The IllegalArgumentException may be thrown if the source and/or destination Raster is incompatible with the types of Rasters allowed by the class implementing this filter. @param src the source Raster @param dest the destination WritableRaster @return a WritableRaster that represents the result of the filtering operation.
Class RasterOp, Rectangle2D getBounds2D(Raster)

Returns the bounding box of the filtered destination Raster. The IllegalArgumentException may be thrown if the source Raster is incompatible with the types of Rasters allowed by the class implementing this filter. @param src the source Raster @return a Rectangle2D that is the bounding box of the Raster resulting from the filtering operation.
Class RasterOp, Point2D getPoint2D(Point2D, Point2D)

Returns the location of the destination point given a point in the source Raster. If dstPt is non-null it will be used to hold the return value. @param srcPt the source Point2D @param dstPt the destination Point2D @return the location of the destination point.
Class RasterOp, RenderingHints getRenderingHints()

Returns the rendering hints for this RasterOp. Returns null if no hints have been set. @return the RenderingHints object of this RasterOp.

Class RenderedImage, ColorModel getColorModel()

Returns the ColorModel associated with this image. All Rasters returned from this image will have this as their ColorModel. This can return null. @return the ColorModel of this image.
Class RenderedImage, Raster getData()

Returns the image as one large tile (for tile based images this will require fetching the whole image and copying the image data over). The Raster returned is a copy of the image data and will not be updated if the image is changed. @return the image as one large tile.
Class RenderedImage, Raster getData(Rectangle)

Computes and returns an arbitrary region of the RenderedImage. The Raster returned is a copy of the image data and will not be updated if the image is changed. @param rect the region of the RenderedImage to be returned. @return the region of the RenderedImage indicated by the specified Rectangle.
Class RenderedImage, int getHeight()

Returns the height of the RenderedImage. @return the height of this RenderedImage.
Class RenderedImage, int getMinTileX()

Returns the minimum tile index in the X direction. @return the minimum tile index in the X direction.
Class RenderedImage, int getMinTileY()

Returns the minimum tile index in the Y direction. @return the minimum tile index in the X direction.
Class RenderedImage, int getMinX()

Returns the minimum X coordinate (inclusive) of the RenderedImage. @return the X coordinate of this RenderedImage.
Class RenderedImage, int getMinY()

Returns the minimum Y coordinate (inclusive) of the RenderedImage. @return the Y coordinate of this RenderedImage.
Class RenderedImage, int getNumXTiles()

Returns the number of tiles in the X direction. @return the number of tiles in the X direction.
Class RenderedImage, int getNumYTiles()

Returns the number of tiles in the Y direction. @return the number of tiles in the Y direction.
Class RenderedImage, Object getProperty(String)

Gets a property from the property set of this image. The set of properties and whether it is immutable is determined by the implementing class. This method returns java.awt.Image.UndefinedProperty if the specified property is not defined for this RenderedImage. @param name the name of the property @return the property indicated by the specified name. @see java.awt.Image#UndefinedProperty
Class RenderedImage, SampleModel getSampleModel()

Returns the SampleModel associated with this image. All Rasters returned from this image will have this as their SampleModel. @return the SampleModel of this image.
Class RenderedImage, Vector getSources()

Returns a vector of RenderedImages that are the immediate sources of image data for this RenderedImage. This method returns null if the RenderedImage object has no information about its immediate sources. It returns an empty Vector if the RenderedImage object has no immediate sources. @return a Vector of RenderedImage objects.
Class RenderedImage, Raster getTile(int, int)

Returns tile (tileX tileY). Note that tileX and tileY are indices into the tile array not pixel locations. The Raster that is returned is live and will be updated if the image is changed. @param tileX the X index of the requested tile in the tile array. @param tileY the Y index of the requested tile in the tile array @return the tile given the specified indices.
Class RenderedImage, int getTileGridXOffset()

Returns the X offset of the tile grid relative to the origin i.e. the X coordinate of the upper-left pixel of tile (0 0). (Note that tile (0 0) may not actually exist.) @return the X offset of the tile grid relative to the origin.
Class RenderedImage, int getTileGridYOffset()

Returns the Y offset of the tile grid relative to the origin i.e. the Y coordinate of the upper-left pixel of tile (0 0). (Note that tile (0 0) may not actually exist.) @return the Y offset of the tile grid relative to the origin.
Class RenderedImage, int getTileHeight()

Returns the tile height in pixels. All tiles must have the same height. @return the tile height in pixels.
Class RenderedImage, int getTileWidth()

Returns the tile width in pixels. All tiles must have the same width. @return the tile width in pixels.
Class RenderedImage, int getWidth()

Returns the width of the RenderedImage. @return the width of this RenderedImage.

Class ReplicateScaleFilter

An ImageFilter class for scaling images using the simplest algorithm. This class extends the basic ImageFilter Class to scale an existing image and provide a source for a new image containing the resampled image. The pixels in the source image are sampled to produce pixels for an image of the specified size by replicating rows and columns of pixels to scale up or omitting rows and columns of pixels to scale down. It is meant to be used in conjunction with a FilteredImageSource object to produce scaled versions of existing images. @see FilteredImageSource @see ImageFilter @version 1.12 0214 12/0203/0001 @author Jim Graham

Class RescaleOp, constructor RescaleOp(float, float, RenderingHints)

Constructs a new RescaleOp with the desired scale factor and offset. The scaleFactor and offset will be applied to all bands in a source Raster and to all color (but not alpha) components in a BufferedImage. The RenderingHints argument may be null. @param scaleFactor the specified scale factor @param offset the specified offset @param hints the specified RenderingHints or null
Class RescaleOp, constructor RescaleOp(float[], float[], RenderingHints)

Constructs a new RescaleOp with the desired scale factors and offsets. The length of the scaleFactor and offset arrays must meet the restrictions stated in the class comments above. The RenderingHints argument may be null. @param scaleFactors the specified scale factors @param offsets the specified offsets @param hints the specified RenderingHints or null
Class RescaleOp, BufferedImage createCompatibleDestImage(BufferedImage, ColorModel)

Creates a zeroed destination image with the correct size and number of bands. @param src Source image for the filter operation. @param destCM ColorModel of the destination. If null the ColorModel of the source will be used. @return the zeroed-destination image.
Class RescaleOp, WritableRaster createCompatibleDestRaster(Raster)

Creates a zeroed -destination Raster with the correct size and number of bands given this source. @param src the source Raster @return the zeroed-destination Raster.
Class RescaleOp, BufferedImage filter(BufferedImage, BufferedImage)

Rescales the source BufferedImage. If the color model in the source image is not the same as that in the destination image the pixels will be converted in the destination. If the destination image is null a BufferedImage will be created with the source ColorModel. An IllegalArgumentException may be thrown if the number of scaling factors/offsets in this object does not meet the restrictions stated in the class comments above or if the source image has an IndexColorModel. @param src the BufferedImage to be filtered @param dst the destination for the filtering operation or null @return the filtered BufferedImage. @throws IllegalArgumentException if the ColorModel of src is an IndexColorModel or if the number of scaling factors and offsets in this RescaleOp do not meet the requirements stated in the class comments.
Class RescaleOp, WritableRaster filter(Raster, WritableRaster)

Rescales the pixel data in the source Raster. If the destination Raster is null a new Raster will be created. The source and destination must have the same number of bands. Otherwise an IllegalArgumentException is thrown. Note that the number of scaling factors/offsets in this object must meet the restrictions stated in the class comments above. Otherwise an IllegalArgumentException is thrown. @param src the Raster to be filtered @param dst the destination for the filtering operation or null @return the filtered WritableRaster. @throws IllegalArgumentException if src and dst do not have the same number of bands or if the number of scaling factors and offsets in this RescaleOp do not meet the requirements stated in the class comments.
Class RescaleOp, Rectangle2D getBounds2D(Raster)

Returns the bounding box of the rescaled destination Raster. Since this is not a geometric operation the bounding box does not change. @param src the rescaled destination Raster @return the bounds of the specified Raster.
Class RescaleOp, int getNumFactors()

Returns the number of scaling factors and offsets used in this RescaleOp. @return the number of scaling factors and offsets of this RescaleOp.
Class RescaleOp, float[] getOffsets(float[])

Returns the offsets in the given array. The array is also returned for convenience. If offsets is null a new array will be allocated. @param offsets the array to contain the offsets of this RescaleOp @return the offsets of this RescaleOp.
Class RescaleOp, Point2D getPoint2D(Point2D, Point2D)

Returns the location of the destination point given a point in the source. If dstPt is non-null it will be used to hold the return value. Since this is not a geometric operation the srcPt will equal the dstPt. @param srcPt a point in the source image @param dstPt the destination point or null @return the location of the destination point.
Class RescaleOp, RenderingHints getRenderingHints()

Returns the rendering hints for this op. @return the rendering hints of this RescaleOp.
Class RescaleOp, float[] getScaleFactors(float[])

Returns the scale factors in the given array. The array is also returned for convenience. If scaleFactors is null a new array will be allocated. @param scaleFactors the array to contain the scale factors of this RescaleOp @return the scale factors of this RescaleOp.

Class SampleModel

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 all built-in image processing and display operators process samples whichoperators may not operate on all representpossible sample types but generally will work for unsigned integral valuessamples 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 java.awt.image.DataBuffer @see java.awt.image.Raster @see java.awt.image.ComponentSampleModel @see java.awt.image.PixelInterleavedSampleModel @see java.awt.image.BandedSampleModel @see java.awt.image.MultiPixelPackedSampleModel @see java.awt.image.SinglePixelPackedSampleModel

Class SampleModel, SampleModel createCompatibleSampleModel(int, int)

Creates a SampleModel which describes data in this SampleModel's format but with a different width and height. @param w the width of the image data @param h the height of the image data @return a SampleModel describing the same image data as this SampleModel but with a different size.
Class SampleModel, DataBuffer createDataBuffer()

Creates a DataBuffer that corresponds to this SampleModel. The DataBuffer's width and height will match this SampleModel's. @return a DataBuffer corresponding to this SampleModel.
Class SampleModel, SampleModel createSubsetSampleModel(int[])

Creates a new SampleModel with a subset of the bands of this SampleModel. @param bands the subset of bands of this SampleModel @return a SampleModel with a subset of bands of this SampleModel.
Class SampleModel, Object getDataElements(int, int, Object, DataBuffer)

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_INTDOUBLE. 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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param obj If non-null a primitive array in which to return the pixel data. @param data The DataBuffer containing the image data. @return the data elements for the specified pixel. @see #getNumDataElements @see #getTransferType @see java.awt.image.DataBuffer @see #setDataElements(int int Object DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if obj is too small to hold the output.

Class SampleModel, Object getDataElements(int, int, int, int, Object, DataBuffer)

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_INTDOUBLE. 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. @param x The minimum X coordinate of the pixel rectangle. @param y The minimum Y coordinate of the pixel rectangle. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param obj If non-null a primitive array in which to return the pixel data. @param data The DataBuffer containing the image data. @return the data elements for the specified region of pixels. @see #getNumDataElements @see #getTransferType @see #setDataElements(int int int int Object DataBuffer) @see java.awt.image.DataBuffer @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if obj is too small to hold the output.

Class SampleModel, int getDataType()

Returns the data type of the DataBuffer storing the pixel data. @return the data type.
Class SampleModel, int getHeight()

Returns the height in pixels. @return the height in pixels of the region of image data that this SampleModel describes.
Class SampleModel, int getNumBands()

Returns the total number of bands of image data. @return the number of bands of image data that this SampleModel describes.
Class SampleModel, 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. @return the number of data elements. @see #getDataElements(int int Object DataBuffer) @see #getDataElements(int int int int Object DataBuffer) @see #setDataElements(int int Object DataBuffer) @see #setDataElements(int int int int Object DataBuffer) @see #getTransferType
Class SampleModel, double[] getPixel(int, int, double[], DataBuffer)

Returns the samples for the specified pixel in an array of double. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param dArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified pixel. @see #setPixel(int int double[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if dArray is too small to hold the output.
Class SampleModel, float[] getPixel(int, int, float[], DataBuffer)

Returns the samples for the specified pixel in an array of float. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param fArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified pixel. @see #setPixel(int int float[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the output.
Class SampleModel, int[] getPixel(int, int, int[], DataBuffer)

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. @param x The X coordinate of the pixel location. @param  y The Y coordinatecoordinates of the pixel location. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data @return the samples for the specified pixel. @see #setPixel(int int int[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the output.
Class SampleModel, double[] getPixels(int, int, int, int, double[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param dArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified region of pixels. @see #setPixels(int int int int double[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if dArray is too small to hold the output.
Class SampleModel, float[] getPixels(int, int, int, int, float[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param fArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified region of pixels. @see #setPixels(int int int int float[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the output.
Class SampleModel, int[] getPixels(int, int, int, int, int[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified region of pixels. @see #setPixels(int int int int int[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the output.
Class SampleModel, int getSample(int, int, int, DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data. @return the sample in a specified band for the specified pixel. @see #setSample(int int int int DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class SampleModel, double getSampleDouble(int, int, int, DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data. @return the sample in a specified band for the specified pixel. @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class SampleModel, float getSampleFloat(int, int, int, DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data. @return the sample in a specified band for the specified pixel. @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class SampleModel, int[] getSampleSize()

Returns the size in bits of samples for all bands. @return the size of samples for all bands.
Class SampleModel, int getSampleSize(int)

Returns the size in bits of samples for the specified band. @param band the specified band @return the size of the samples of the specified band.
Class SampleModel, double[] getSamples(int, int, int, int, int, double[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to return. @param dArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified band for the specified region of pixels. @see #setSamples(int int int int int double[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if dArray is too small to hold the output.
Class SampleModel, float[] getSamples(int, int, int, int, int, float[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to return. @param fArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified band for the specified region of pixels. @see #setSamples(int int int int int float[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if fArray is too small to hold the output.
Class SampleModel, int[] getSamples(int, int, int, int, int, int[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to return. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified band for the specified region of pixels. @see #setSamples(int int int int int int[] DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if iArray is too small to hold the output.
Class SampleModel, 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. @return the transfer type. @see #getDataElements(int int Object DataBuffer) @see #getDataElements(int int int int Object DataBuffer) @see #setDataElements(int int Object DataBuffer) @see #setDataElements(int int int int Object DataBuffer) @see #getNumDataElements @see java.awt.image.DataBuffer
Class SampleModel, int getWidth()

Returns the width in pixels. @return the width in pixels of the region of image data that this SampleModel describes.
Class SampleModel, void setDataElements(int, int, Object, DataBuffer)

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_INTDOUBLE. 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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param obj A primitive array containing pixel data. @param data The DataBuffer containing the image data. @see #getNumDataElements @see #getTransferType @see #getDataElements(int int Object DataBuffer) @see java.awt.image.DataBuffer @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if obj is too small to hold the input.

Class SampleModel, void setDataElements(int, int, int, int, Object, DataBuffer)

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_INTDOUBLE. 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. @param x The minimum X coordinate of the pixel rectangle. @param y The minimum Y coordinate of the pixel rectangle. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param obj A primitive array containing pixel data. @param data The DataBuffer containing the image data. @see #getNumDataElements @see #getTransferType @see #getDataElements(int int int int Object DataBuffer) @see java.awt.image.DataBuffer @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if obj is too small to hold the input.

Class SampleModel, void setPixel(int, int, double[], DataBuffer)

Sets a pixel in the DataBuffer using a double array of samples for input. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param dArray The input samples in a double array. @param data The DataBuffer containing the image data. @see #getPixel(int int double[] DataBuffer) @throws NullPointerException if dArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the input.
Class SampleModel, void setPixel(int, int, float[], DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param fArray The input samples in a float array. @param data The DataBuffer containing the image data. @see #getPixel(int int float[] DataBuffer) @throws NullPointerException if fArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the input.
Class SampleModel, void setPixel(int, int, int[], DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getPixel(int int int[] DataBuffer) @throws NullPointerException if iArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the input.
Class SampleModel, void setPixels(int, int, int, int, double[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param dArray The input samples in a double array. @param data The DataBuffer containing the image data. @see #getPixels(int int int int double[] DataBuffer) @throws NullPointerException if dArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if dArray is too small to hold the input.
Class SampleModel, void setPixels(int, int, int, int, float[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param fArray The input samples in a float array. @param data The DataBuffer containing the image data. @see #getPixels(int int int int float[] DataBuffer) @throws NullPointerException if fArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the input.
Class SampleModel, void setPixels(int, int, int, int, int[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getPixels(int int int int int[] DataBuffer) @throws NullPointerException if iArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the input.
Class SampleModel, void setSample(int, int, int, double, DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to set. @param s The input sample as a double. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class SampleModel, void setSample(int, int, int, float, DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to set. @param s The input sample as a float. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class SampleModel, void setSample(int, int, int, int, DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to set. @param s The input sample as an int. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer) @throws NullPointerException if data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class SampleModel, void setSamples(int, int, int, int, int, double[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to set. @param dArray The input samples in a double array. @param data The DataBuffer containing the image data. @see #getSamples(int int int int int double[] DataBuffer) @throws NullPointerException if dArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if dArray is too small to hold the input.
Class SampleModel, void setSamples(int, int, int, int, int, float[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to set. @param fArray The input samples in a float array. @param data The DataBuffer containing the image data. @see #getSamples(int int int int int float[] DataBuffer) @throws NullPointerException if fArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if fArray is too small to hold the input.
Class SampleModel, void setSamples(int, int, int, int, int, int[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to set. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getSamples(int int int int int int[] DataBuffer) @throws NullPointerException if iArray or data is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if iArray is too small to hold the input.

Class ShortLookupTable, constructor ShortLookupTable(int, short[])

Constructs a ShortLookupTable object from an array of shorts representing a lookup table for each band. The offset will be subtracted from the input values before indexing into the array. The data array is stored as a reference. @param offset the value subtracted from the input values before indexing into the arrays @param data an array of shorts
Class ShortLookupTable, constructor ShortLookupTable(int, short[][])

Constructs a ShortLookupTable object from an array of short arrays representing a lookup table for each band. The offset will be subtracted from the input values before indexing into the arrays. The number of bands is the length of the data argument. The data array for each band is stored as a reference. @param offset the value subtracted from the input values before indexing into the arrays @param data an array of short arrays representing a lookup table for each band

Class SinglePixelPackedSampleModel, SampleModel createCompatibleSampleModel(int, int)

ThisCreates creates a new SinglePixelPackedSampleModel with the specified width and height. The new SinglePixelPackedSampleModel will have the same storage data type and bit masks as this SinglePixelPackedSampleModel. @param w the width of the resulting SampleModel @param h the height of the resulting SampleModel @return a SinglePixelPackedSampleModel with the specified width and height. @throws IllegalArgumentException if w or h is not greater than 0
Class SinglePixelPackedSampleModel, int[] getBitMasks()

Returns the bit masks for all bands. @return the bit masks for all bands.
Class SinglePixelPackedSampleModel, int[] getBitOffsets()

Returns the bit offsets into the data array element representing a pixel for all bands. @return the bit offsets representing a pixel for all bands.
Class SinglePixelPackedSampleModel, Object getDataElements(int, int, Object, DataBuffer)

Returns data for a single pixel in a primitive array of type TransferType. For a SinglePixelPackedSampleModel the array will have one element and the type will be the same as the storage data type. 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 SinglePixelPackedSampleModel sppsm1 to DataBuffer db2 whose storage layout is described by SinglePixelPackedSampleModel sppsm2. The transfer will generally be more efficient than using getPixel/setPixel.

 SinglePixelPackedSampleModel sppsm1 sppsm2; DataBufferInt db1 db2; sppsm2.setDataElements(x y sppsm1.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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param obj If non-null a primitive array in which to return the pixel data. @param data The DataBuffer containing the image data. @return the data for the specified pixel. @see #setDataElements(int int Object DataBuffer)

Class SinglePixelPackedSampleModel, int getOffset(int, int)

Returns the offset (in data array elements) of pixel (x y). The data element containing pixel x y can be retrieved from a DataBuffer data with a SinglePixelPackedSampleModel sppsm as:
 data.getElem(sppsm.getOffset(x y)); 
@param x  y the coordinates of the specified pixel @return the offset of the specified pixel.
Class SinglePixelPackedSampleModel, int[] getPixel(int, int, int[], DataBuffer)

Returns all samples in for the specified pixel in an int array. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param iArray If non-null returns the samples in this array @param data The DataBuffer containing the image data. @return all samples for the specified pixel. @see #setPixel(int int int[] DataBuffer)
Class SinglePixelPackedSampleModel, int[] getPixels(int, int, int, int, int[], DataBuffer)

Returns all samples 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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return all samples for the specified region of pixels. @see #setPixels(int int int int int[] DataBuffer)
Class SinglePixelPackedSampleModel, int getSample(int, int, int, DataBuffer)

Returns as int the sample in a specified band for the pixel located at (x y). ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to return. @param data The DataBuffer containing the image data. @return the sample in a specified band for the specified pixel. @see #setSample(int int int int DataBuffer)
Class SinglePixelPackedSampleModel, int[] getSamples(int, int, int, int, int, int[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to return. @param iArray If non-null returns the samples in this array. @param data The DataBuffer containing the image data. @return the samples for the specified band for the specified region of pixels. @see #setSamples(int int int int int int[] DataBuffer)
Class SinglePixelPackedSampleModel, int getScanlineStride()

Returns the scanline stride of this SinglePixelPackedSampleModel. @return the scanline stride of this SinglePixelPackedSampleModel.
Class SinglePixelPackedSampleModel, void setDataElements(int, int, Object, DataBuffer)

Sets the data for a single pixel in the specified DataBuffer from a primitive array of type TransferType. For a SinglePixelPackedSampleModel only the first element of the array will hold valid data and the type of the array must be the same as the storage data type of the SinglePixelPackedSampleModel.

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

 SinglePixelPackedSampleModel sppsm1 sppsm2; DataBufferInt db1 db2; sppsm2.setDataElements(x y sppsm1.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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param obj A primitive array containing pixel data. @param data The DataBuffer containing the image data. @see #getDataElements(int int Object DataBuffer)

Class SinglePixelPackedSampleModel, void setPixel(int, int, int[], DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getPixel(int int int[] DataBuffer)
Class SinglePixelPackedSampleModel, void setPixels(int, int, int, int, int[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getPixels(int int int int int[] DataBuffer)
Class SinglePixelPackedSampleModel, void setSample(int, int, int, int, DataBuffer)

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. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to set. @param s The input sample as an int. @param data The DataBuffer containing the image data. @see #getSample(int int int DataBuffer)
Class SinglePixelPackedSampleModel, void setSamples(int, int, int, int, int, int[], DataBuffer)

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. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w The width of the pixel rectangle. @param h The height of the pixel rectangle. @param b The band to set. @param iArray The input samples in an int array. @param data The DataBuffer containing the image data. @see #getSamples(int int int int int int[] DataBuffer)

Class WritableRaster, constructor WritableRaster(SampleModel, DataBuffer, Point)

Constructs a WritableRaster with the given SampleModel and DataBuffer. The WritableRaster's upper left corner is origin and it is the same size as the SampleModel. The DataBuffer is not initialized and must be compatible with SampleModel. @param sampleModel The SampleModel that specifies the layout. @param dataBuffer The DataBuffer that contains the image data. @param origin The Point that specifies the origin. @throws RasterFormatException if computing either origin.x + sampleModel.getWidth() or origin.y + sampleModel.getHeight() results in integer overflow
Class WritableRaster, constructor WritableRaster(SampleModel, DataBuffer, Rectangle, Point, WritableRaster)

Constructs a WritableRaster with the given SampleModel DataBuffer and parent. aRegion specifies the bounding rectangle of the new Raster. When translated into the base Raster's coordinate system aRegion must be contained by the base Raster. (The base Raster is the Raster's ancestor which has no parent.) sampleModelTranslate specifies the sampleModelTranslateX and sampleModelTranslateY values of the new Raster. Note that this constructor should generally be called by other constructors or create methods it should not be used directly. @param sampleModel The SampleModel that specifies the layout. @param dataBuffer The DataBuffer that contains the image data. @param aRegion The Rectangle that specifies the image area. @param sampleModelTranslate The Point that specifies the translation from SampleModel to Raster coordinates. @param parent The parent (if any) of this raster. @throws RasterFormatException if aRegion has width or height less than or equal to zero or computing either aRegion.x + aRegion.width or aRegion.y + aRegion.height results in integer overflow
Class WritableRaster, constructor WritableRaster(SampleModel, Point)

Constructs a WritableRaster with the given SampleModel. The WritableRaster's upper left corner is origin and it is the same size as the SampleModel. A DataBuffer large enough to describe the WritableRaster is automatically created. @param sampleModel The SampleModel that specifies the layout. @param origin The Point that specifies the origin. @throws RasterFormatException if computing either origin.x + sampleModel.getWidth() or origin.y + sampleModel.getHeight() results in integer overflow
Class WritableRaster, WritableRaster createWritableChild(int, int, int, int, int, int, int[])

Returns a new WritableRaster which shares all or part of this WritableRaster's DataBuffer. The new WritableRaster will possess a reference to the current WritableRaster accessible through its getParent() and getWritableParent() methods.

The parentX parentY width and height parameters form a Rectangle in this WritableRaster's coordinate space indicating the area of pixels to be shared. An error will be thrown if this Rectangle is not contained with the bounds of the current WritableRaster.

The new WritableRaster may additionally be translated to a different coordinate system for the plane than that used by the current WritableRaster. The childMinX and childMinY parameters give the new (x y) coordinate of the upper-left pixel of the returned WritableRaster; the coordinate (childMinX childMinY) in the new WritableRaster will map to the same pixel as the coordinate (parentX parentY) in the current WritableRaster.

The new WritableRaster may be defined to contain only a subset of the bands of the current WritableRaster possibly reordered by means of the bandList parameter. If bandList is null it is taken to include all of the bands of the current WritableRaster in their current order.

To create a new WritableRaster that contains a subregion of the current WritableRaster but shares its coordinate system and bands this method should be called with childMinX equal to parentX childMinY equal to parentY and bandList equal to null. @param parentX X coordinate of the upper left corner in this WritableRaster's coordinates. @param parentY Y coordinate of the upper left corner in this WritableRaster's coordinates. @param widthw Width of the region starting at (parentX parentY). @param heighth Height of the region starting at (parentX parentY). @param childMinX X coordinate of the upper left corner of the returned WritableRaster. @param childMinY Y coordinate of the upper left corner of the returned WritableRaster. @param bandList Array of band indices or null to use all bands. @return a WritableRaster sharing all or part of the DataBuffer of this WritableRaster. @exception RasterFormatException if the subregion is outside of the raster bounds. @throws RasterFormatException if w or h is less than or equal to zero or computing any of parentX + w parentY + h childMinX + w or childMinY + h results in integer overflow

Class WritableRaster, WritableRaster createWritableTranslatedChild(int, int)

Create a WritableRaster with the same size SampleModel and DataBuffer as this one but with a different location. The new WritableRaster will possess a reference to the current WritableRaster accessible through its getParent() and getWritableParent() methods. @param childMinX X coord of the upper left corner of the new Raster. @param childMinY Y coord of the upper left corner of the new Raster. @return a WritableRaster the same as this one except for the specified location. @throws RasterFormatException if computing either childMinX + this.getWidth() or childMinY + this.getHeight() results in integer overflow
Class WritableRaster, WritableRaster getWritableParent()

Returns the parent WritableRaster (if any) of this WritableRaster or else null. @return the parent of this WritableRaster or null.
Class WritableRaster, void setDataElements(int, int, Object)

Sets the data for a single pixel from a primitive array of type TransferType. For image data supported by the Java 2D(tm) API this will be one of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE. Data in the array may be in a packed format thus increasing efficiency for data transfers. There will be no explicit bounds checking on the parameters. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds or if inData is not large enough to hold the pixel data. However explicit bounds checking is not guaranteed. A ClassCastException will be thrown if the input object is not null and references anything other than an array of TransferType. @see java.awt.image.SampleModel#setDataElements(int int Object DataBuffer) @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param inData An object reference to an array of type defined by getTransferType() and length getNumDataElements() containing the pixel data to place at x y. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if inData is too small to hold the input.
Class WritableRaster, void setDataElements(int, int, Raster)

Sets the data for a rectangle of pixels from an input Raster. The input Raster must be compatible with this WritableRaster in that they must have the same number of bands corresponding bands must have the same number of bits per sample the TransferTypes and NumDataElements must be the same and the packing used by the getDataElements/setDataElements must be identical. There will be no explicit bounds checking on the parameters. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param inRaster Raster containing data to place at x y. @throws NullPointerException if inRaster is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds.
Class WritableRaster, void setDataElements(int, int, int, int, Object)

Sets the data for a rectangle of pixels from a primitive array of type TransferType. For image data supported by the Java 2D API this will be one of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT DataBuffer.TYPE_INT DataBuffer.TYPE_SHORT DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_INTDOUBLE. Data in the array may be in a packed format thus increasing efficiency for data transfers. There will be no explicit bounds checking on the parameters. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds or if inData is not large enough to hold the pixel data. However explicit bounds checking is not guaranteed. A ClassCastException will be thrown if the input object is not null and references anything other than an array of TransferType. @see java.awt.image.SampleModel#setDataElements(int int int int Object DataBuffer) @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param inData An object reference to an array of type defined by getTransferType() and length w*h*getNumDataElements() containing the pixel data to place between x y and x+w-1 y+h-1. @throws NullPointerException if inData is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if inData is too small to hold the input.
Class WritableRaster, void setPixel(int, int, double[])

Sets a pixel in the DataBuffer using a double array of samples for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param dArray The input samples in a double array. @throws NullPointerException if dArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if dArray is too small to hold the input.
Class WritableRaster, void setPixel(int, int, float[])

Sets a pixel in the DataBuffer using a float array of samples for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param fArray The input samples in a float array. @throws NullPointerException if fArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the input.
Class WritableRaster, void setPixel(int, int, int[])

Sets a pixel in the DataBuffer using an int array of samples for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param iArray The input samples in a int array. @throws NullPointerException if iArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the input.
Class WritableRaster, void setPixels(int, int, int, int, double[])

Sets all samples for a rectangle of pixels from a double array containing one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param dArray The input double pixel array. @throws NullPointerException if dArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if dArray is too small to hold the input.
Class WritableRaster, void setPixels(int, int, int, int, float[])

Sets all samples for a rectangle of pixels from a float array containing one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param fArray The input float pixel array. @throws NullPointerException if fArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if fArray is too small to hold the input.
Class WritableRaster, void setPixels(int, int, int, int, int[])

Sets all samples for a rectangle of pixels from an int array containing one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param iArray The input int pixel array. @throws NullPointerException if iArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates are not in bounds or if iArray is too small to hold the input.
Class WritableRaster, void setRect(Raster)

Copies pixels from Raster srcRaster to this WritableRaster. Each pixel in srcRaster is copied to the same x y address in this raster unless the address falls outside the bounds of this raster. srcRaster must have the same number of bands as this WritableRaster. The copy is a simple copy of source samples to the corresponding destination samples.

If all samples of both source and destination Rasters are of integral type and less than or equal to 32 bits in size then calling this method is equivalent to executing the following code for all x y addresses valid in both Rasters.

 Raster srcRaster; WritableRaster dstRaster; for (int b = 0; b  Thus when copying an integral type source to an integral type destination if the source sample size is greater than the destination sample size for a particular band the high order bits of the source sample are truncated. If the source sample size is less than the destination size for a particular band the high order bits of the destination are zero-extended or sign-extended depending on whether srcRaster's SampleModel treats the sample as a signed or unsigned quantity. 

When copying a float or double source to an integral type destination each source sample is cast to the destination type. When copying an integral type source to a float or double destination the source is first converted to a 32-bit int (if necessary) using the above rules for integral types and then the int is cast to float or double.

@param srcRaster The Raster from which to copy pixels. @throws NullPointerException if srcRaster is null.

Class WritableRaster, void setRect(int, int, Raster)

Copies pixels from Raster srcRaster to this WritableRaster. For each (x y) address in srcRaster the corresponding pixel is copied to address (x+dx y+dy) in this WritableRaster unless (x+dx y+dy) falls outside the bounds of this raster. srcRaster must have the same number of bands as this WritableRaster. The copy is a simple copy of source samples to the corresponding destination samples. For details see WritableRaster#setRect(Raster) @param dx The X translation factor from src space to dst space of the copy. @param dy The Y translation factor from src space to dst space of the copy. @param srcRaster The Raster from which to copy pixels. @throws NullPointerException if srcRaster is null.
Class WritableRaster, void setSample(int, int, int, double)

Sets a sample in the specified band for the pixel located at (x y) in the DataBuffer using a double for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to set. @param s The input sample as a double. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class WritableRaster, void setSample(int, int, int, float)

Sets a sample in the specified band for the pixel located at (x y) in the DataBuffer using a float for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to set. @param s The input sample as a float. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class WritableRaster, void setSample(int, int, int, int)

Sets a sample in the specified band for the pixel located at (x y) in the DataBuffer using an int for input. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the pixel location. @param y The Y coordinate of the pixel location. @param b The band to set. @param s The input sample. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds.
Class WritableRaster, void setSamples(int, int, int, int, int, double[])

Sets the samples in the specified band for the specified rectangle of pixels from a double array containing one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param b The band to set. @param dArray The input double sample array. @throws NullPointerException if dArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if dArray is too small to hold the input.
Class WritableRaster, void setSamples(int, int, int, int, int, float[])

Sets the samples in the specified band for the specified rectangle of pixels from a float array containing one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param b The band to set. @param fArray The input float sample array. @throws NullPointerException if fArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if fArray is too small to hold the input.
Class WritableRaster, void setSamples(int, int, int, int, int, int[])

Sets the samples in the specified band for the specified rectangle of pixels from an int array containing one sample per array element. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. However explicit bounds checking is not guaranteed. @param x The X coordinate of the upper left pixel location. @param y The Y coordinate of the upper left pixel location. @param w Width of the pixel rectangle. @param h Height of the pixel rectangle. @param b The band to set. @param iArray The input int sample array. @throws NullPointerException if iArray is null. @throws ArrayIndexOutOfBoundsException if the coordinates or the band index are not in bounds or if iArray is too small to hold the input.

Class WritableRenderedImage, void addTileObserver(TileObserver)

Adds an observer. If the observer is already present it will receive multiple notifications. @param to the specified TileObserver
Class WritableRenderedImage, WritableRaster getWritableTile(int, int)

Checks out a tile for writing. The WritableRenderedImage is responsible for notifying all of its TileObservers when a tile goes from having no writers to having one writer. @param tileX the X index of the tile. @param tileY the Y index of the tile. @return a writable tile.
Class WritableRenderedImage, Point[] getWritableTileIndices()

Returns an array of Point objects indicating which tiles are checked out for writing. Returns null if none are checked out. @return an array containing the locations of tiles that are checked out for writing.
Class WritableRenderedImage, boolean hasTileWriters()

Returns whether any tile is checked out for writing. Semantically equivalent to (getWritableTileIndices() = null). @return true if any tiles are checked out for writing; false otherwise.
Class WritableRenderedImage, boolean isTileWritable(int, int)

Returns whether a tile is currently checked out for writing. @param tileX the X index of the tile. @param tileY the Y index of the tile. @return true if specified tile is checked out for writing; false otherwise.
Class WritableRenderedImage, void removeTileObserver(TileObserver)

Removes an observer. If the observer was not registered nothing happens. If the observer was registered for multiple notifications it will now be registered for one fewer. @param to the specified TileObserver
Class WritableRenderedImage, void setData(Raster)

Sets a rect of the image to the contents of the Raster r which is assumed to be in the same coordinate space as the WritableRenderedImage. The operation is clipped to the bounds of the WritableRenderedImage. @param r the specified Raster