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