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 is 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. @see java.awt.RenderingHints#KEY_INTERPOLATION @see java.awt.RenderingHints#KEY_RENDERING
Class AffineTransformOp, BufferedImage filter(BufferedImage, BufferedImage)

Transforms the source BufferedImage and stores the results in the destination BufferedImage. If the color models for the two images do not match a color conversion into the destination color model is performed. If the destination image is null a BufferedImage is created with the source ColorModel.

The coordinates of the rectangle returned by getBounds2D(BufferedImage) are not necessarily the same as the coordinates of the BufferedImage returned by this method. If the upper-left corner coordinates of the rectangle are negative then this part of the rectangle is not drawn. If the upper-left corner coordinates of the rectangle are positive then the filtered image is drawn at that position in the destination BufferedImage.

An IllegalArgumentException may beis thrown if the source is the same as the destination. @param src The BufferedImage to transform. @param dst The BufferedImage in which to store the results of the transformation. @return The filtered BufferedImage. @throws IllegalArgumentException if src and dst are the same @throws ImagingOpException Ifif the image cannot be transformed because of a data-processing error that might be caused by an invalid image format tile format or image-processing operation or any other unsupported operation.

Class AffineTransformOp, WritableRaster filter(Raster, WritableRaster)

Transforms the source Raster and stores the results in the destination Raster. This operation performs the transform band by band.

If the destination Raster is null a new Raster is created. An IllegalArgumentException may be thrown if the source is the same as the destination or if the number of bands in the source is not equal to the number of bands in the destination.

The coordinates of the rectangle returned by getBounds2D(Raster) are not necessarily the same as the coordinates of the WritableRaster returned by this method. If the upper-left corner coordinates of rectangle are negative then this part of the rectangle is not drawn. If the coordinates of the rectangle are positive then the filtered image is drawn at that position in the destination Raster.

@param src The Raster to transform. @param dst The Raster in which to store the results of the transformation. @return The transformed Raster. @throws ImagingOpException Ifif the Rasterraster cannot be transformed because of a data-processing error that might be caused by an invalid image format tile format or image-processing operation or any other unsupported operation.

Class AffineTransformOp, Rectangle2D getBounds2D(BufferedImage)

Returns the bounding box of the transformed destination. The rectangle returned is the actual bounding box of the transformed points. The coordinates of the upper-left corner of the returned rectangle might not be (0  0). @param src The BufferedImage to be transformed. @return The Rectangle2D representing the destination's bounding box.
Class AffineTransformOp, Rectangle2D getBounds2D(Raster)

Returns the bounding box of the transformed destination. The rectangle returned will be the actual bounding box of the transformed points. The coordinates of the upper-left corner of the returned rectangle might not be (0  0). @param src The Raster to be transformed. @return The Rectangle2D representing the destination's bounding box.

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 ReplicateImageFilterReplicateScaleFilter @see ImageFilter @version 1.610 0902/2102/9800 @author Jim Graham
Class AreaAveragingScaleFilter, void setHints(int)

Detect if the data is being delivered with the necessary hints to allow the averaging algorithm to do its work.

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. @see ImageConsumer#setHints

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

Combine the components for the delivered byte pixels into the accumulation arrays and send on any averaged data for rows of pixels that are complete. If the correct hints were not specified in the setHints call then relay the work to our superclass which is capable of scaling pixels regardless of the delivery hints.

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. @see ReplicateScaleFilter

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

Combine the components for the delivered int pixels into the accumulation arrays and send on any averaged data for rows of pixels that are complete. If the correct hints were not specified in the setHints call then relay the work to our superclass which is capable of scaling pixels regardless of the delivery hints.

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. @see ReplicateScaleFilter


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 datatypes
Class BandedSampleModel, constructor BandedSampleModel(int, int, int, int)

Constructs a BandedSampleModel with the specified parameters. The pixel stride will be one data element. The scanline stride will be the same as the width. Each band will be stored in a separate bank and all band offsets will be zero. @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. @throws IllegalArgumentException if dataType is not one of the supported data types
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, SampleModel createCompatibleSampleModel(int, int)

Creates a new BandedSampleModel with the specified width and height. The new BandedSampleModel will have the same number of bands storage data type and bank indices as this BandedSampleModel. The band offsets will be compressed such that the offset between bands will be w*pixelStride and the minimum of all of the band offsets is zero. @param w the width of the resulting BandedSampleModel @param h the height of the resulting BandedSampleModel @return a new BandedSampleModel with the specified width and height. @throws IllegalArgumentException if w or h equals either Integer.MAX_VALUE or Integer.MIN_VALUE @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 either DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_SHORT or DataBuffer.TYPE_INT
Class BandedSampleModel, SampleModel createSubsetSampleModel(int[])

Creates a new BandedSampleModel with a subset of the bands of this BandedSampleModel. The new BandedSampleModel can be used with any DataBuffer that the existing BandedSampleModel can be used with. The new BandedSampleModel/DataBuffer combination will represent an image with a subset of the bands of the original BandedSampleModel/DataBuffer combination. @throws RasterFormatException if the number of bands is greater than the number of banks in this sample model. @throws IllegalArgumentException if dataType is not one of the supported data types

Class BufferedImage, int TYPE_INT_ARGB

Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel with alpha. The color data in this image is considered not to be premultiplied with alpha. When this type is used as the imageType argument to a BufferedImage constructor the created image created is consistent with images created in the JDK1.1 and earlier releases.

Class BufferedImageFilter

ThisThe BufferedImageFilter class subclasses an ImageFilter to provide a simple means of using a single-source/single-destination image operator ({@link BufferedImageOp}) to filter a BufferedImage in the Image Producer/Consumer/Observer paradigm. Examples of these image operators are: ConvolveOp AffineTransformOp and LookupOp. @see ImageFilter @see BufferedImage @see BufferedImageOp @version 10 Feb 1997
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
Class BufferedImageFilter, BufferedImageOp getBufferedImageOp()

Returns the BufferedImageOp. @return the operator of this BufferedImageFilter.
Class BufferedImageFilter, void imageComplete(int)

Filters the information provided in the imageComplete method of the ImageConsumer interface.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. 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. @seeparam ImageConsumer#imageCompletestatus the status of image loading @throws ImagingOpException if there was a problem calling the filter method of the BufferedImageOp associated with this instance. @see ImageConsumer#imageComplete

Class BufferedImageFilter, void setColorModel(ColorModel)

Filters the information provided in the setColorModel method of the ImageConsumer interface.

If model is null this method clears the current ColorModel of this BufferedImageFilter.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. 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 ColorModel to which to set the ColorModel of this BufferedImageFilter @see ImageConsumer#setColorModel

Class BufferedImageFilter, void setDimensions(int, int)

Filters the information provided in the int setDimensions } method of the ImageConsumer interface.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. 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 to which to set the width of this BufferedImageFilter @param height the height to which to set the height of this BufferedImageFilter @see ImageConsumer#setDimensions

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

Filters the information provided in the setPixels method of the ImageConsumer interface which takes an array of bytes.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. 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. @throws IllegalArgumentException if width or height are less than zero. @see ImageConsumer#setPixels(int int int int ColorModel byte[] int int)

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

Filters the information provided in the setPixels method of the ImageConsumer interface which takes an array of integers.

Note: This method is intended to be called by the ImageProducer of the Image whose pixels are being filtered. 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. @throws IllegalArgumentException if width or height are less than zero. @see ImageConsumer#setPixels(int int int int ColorModel int[] int int)


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) Platform 1.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) 2D API are DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT and DataBuffer.TYPE_INT. 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. 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 the normalized form each component is a float value between 0.0 and 1.0. Normalized color component values are not premultiplied. @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)

Constructs a ColorModel that translates pixels of the specified number of bits to color/alpha components. The color space is the default RGB ColorSpace which is sRGB. Pixel values are assumed to include alpha information. If color and alpha information are represented in the pixel value as separate spatial bands the color bands are assumed not to be premultiplied with the alpha value. The transparency type is java.awt.Transparency.TRANSLUCENT. The transfer type will be the smallest of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT that can hold a single pixel (or DataBuffer.TYPE_UNDEFINED if bits is greater than 32). Since this constructor has no information about the number of bits per color and alpha component any subclass calling this constructor should override any method that requires this information. @param bits the number of bits of a pixel @exceptionthrows IllegalArgumentException if the number of bits in bits is less than 1
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 @exceptionthrows 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. @see java.awt.Transparency
Class ColorModel, 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 will also return an instance of this ColorModel with the isAlphaPremultiplied flag set appropriately. This method will throw a UnsupportedOperationException if it is not supported by this ColorModel. 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 raster the WritableRaster data @param isAlphaPremultiplied true if the alpha is premultiplied; false otherwise @return a ColorModel object that represents the coerced data.
Class ColorModel, SampleModel createCompatibleSampleModel(int, int)

Creates a SampleModel with the specified width and height that has a data layout compatible with this ColorModel. 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 w the width to apply to the new SampleModel @param h the height to apply to the new SampleModel @return a SampleModel object with the specified width and height. @exceptionthrows UnsupportedOperationException if this method is not supported by this ColorModel @see SampleModel
Class ColorModel, WritableRaster createCompatibleWritableRaster(int, int)

Creates a WritableRaster with the specified width and height that has a data layout (SampleModel) compatible with this ColorModel. 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 w the width to apply to the new WritableRaster @param h the height to apply to the new WritableRaster @return a WritableRaster object with the specified width and height. @exceptionthrows UnsupportedOperationException if this method is not supported by this ColorModel @see WritableRaster @see SampleModel
Class ColorModel, 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. If inData is not a primitive array of type transferType a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if inData is not large enough to hold a pixel value for this ColorModel. If this transferType is not supported a UnsupportedOperationException will be thrown. Since ColorModel is an abstract class any instance must be an instance of a subclass. Subclasses inherit the implementation of this method and if they don't override it this method throws an exception if the subclass uses a transferType other than DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT. @param inData the specified pixel @return the alpha component of the specified pixel scaled from 0 to 255. @exceptionthrows ClassCastException if inData is not a primitive array of type transferType @exceptionthrows ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel @exceptionthrows UnsupportedOperationException if this tranferType is not supported by this ColorModel
Class ColorModel, WritableRaster getAlphaRaster(WritableRaster)

Returns a Raster representing the alpha channel of an image extracted from the input Raster provided that pixel values of this ColorModel represent color and alpha information as separate spatial bands (e.g. ComponentColorModel and DirectColorModel). This method assumes that Raster objects associated with such a ColorModel store the alpha band if present as the last band of image data. Returns null if there is no separate spatial alpha channel associated with this ColorModel. If this is an IndexColorModel which has alpha in the lookup table this method will return null since there is no spatially discrete alpha channel. This method will create a new Raster (but will share the data array). Since ColorModel is an abstract class any instance is an instance of a subclass. Subclasses must override this method to get any behavior other than returning null because the implementation in this abstract class returns null. @param raster the specified Raster @return a Raster representing the alpha channel of an image obtained from the specified Raster.
Class ColorModel, 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. For example 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. If inData is not a primitive array of type transferType a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if inData is not large enough to hold a pixel value for this ColorModel. If this transferType is not supported a UnsupportedOperationException will be thrown. Since ColorModel is an abstract class any instance must be an instance of a subclass. Subclasses inherit the implementation of this method and if they don't override it this method throws an exception if the subclass uses a transferType other than DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT. @param inData an array of pixel values @return the value of the blue component of the specified pixel. @exceptionthrows ClassCastException if inData is not a primitive array of type transferType @exceptionthrows ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel @exceptionthrows UnsupportedOperationException if this tranferType is not supported by this ColorModel
Class ColorModel, int getComponentSize(int)

Returns the number of bits for the specified color/alpha component. Color components are indexed in the order 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. If this ColorModel supports alpha the alpha component corresponds to the index following the last color component. @param componentIdx the index of the color/alpha component @return the number of bits for the color/alpha component at the specified index. @throws ArrayIndexOutOfBoundsException if componentIdx is greater than the number of components or less than zero @throws NullPointerException if the number of bits array is null
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 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. @exceptionthrows 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. 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. @exceptionthrows UnsupportedOperationException if this method is not supported by this ColorModel
Class ColorModel, int getDataElement(int[], int)

Returns a pixel value represented as an int in this ColorModel given an array of unnormalized color/alpha components. This method will throw an IllegalArgumentException if pixel values for this ColorModel are not conveniently representable as a single int. An ArrayIndexOutOfBoundsException 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. Subclasses must override this method since the implementation in this abstract class throws an UnsupportedOperationException. @param components an array of unnormalized color and alpha components @param offset the index into components at which to begin retrieving the color and alpha components @return an int pixel value in this ColorModel corresponding to the specified components. @exceptionthrows IllegalArgumentException if pixel values for this ColorModel are not conveniently representable as a single int @exceptionthrows ArrayIndexOutOfBoundsException if the components array is not large enough to hold all of the color and alpha components starting at offset @exceptionthrows UnsupportedOperationException if this method is not supported by this ColorModel
Class ColorModel, Object getDataElements(int, Object)

Returns a data element array representation of a pixel in this ColorModel given an integer pixel representation in the default RGB color model. This array can then be passed to the WritableRaster#setDataElements method of a WritableRaster object. If the pixel variable is null a new array will be allocated. If pixel is not null it must be a primitive array of type transferType; otherwise a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if pixel is not large enough to hold a pixel value for this ColorModel. The pixel array is returned. If this transferType is not supported a UnsupportedOperationException will be thrown. 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 rgb the integer pixel representation in the default RGB color model @param pixel the specified pixel @return an array representation of the specified pixel in this ColorModel. @exceptionthrows ClassCastException if pixel is not a primitive array of type transferType @exceptionthrows ArrayIndexOutOfBoundsException if pixel is not large enough to hold a pixel value for this ColorModel @exceptionthrows UnsupportedOperationException if this method is not supported by this ColorModel @see WritableRaster#setDataElements @see SampleModel#setDataElements
Class ColorModel, Object getDataElements(int[], int, Object)

Returns a data element array representation of a pixel in this ColorModel given an array of unnormalized color/alpha components. This array can then be passed to the setDataElements method of a WritableRaster object. An ArrayIndexOutOfBoundsException is thrown if the components array is not large enough to hold all the color and alpha components (starting at offset). If the obj variable is null a new array will be allocated. If obj is not null it must be a primitive array of type transferType; otherwise a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if obj is not large enough to hold a pixel value for this ColorModel. 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 components an array of unnormalized color and alpha components @param offset the index into components at which to begin retrieving color and alpha components @param obj the Object representing an array of color and alpha components @return an Object representing an array of color and alpha components. @exceptionthrows ClassCastException if obj is not a primitive array of type transferType @exceptionthrows ArrayIndexOutOfBoundsException if obj is not large enough to hold a pixel value for this ColorModel or the components array is not large enough to hold all of the color and alpha components starting at offset @exceptionthrows UnsupportedOperationException if this method is not supported by this ColorModel @see WritableRaster#setDataElements @see SampleModel#setDataElements
Class ColorModel, 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 will be a non pre-multiplied value. For example if the alpha is premultiplied this method divides it out before returning the value. If the alpha value is 0 the green value is 0. If inData is not a primitive array of type transferType a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if inData is not large enough to hold a pixel value for this ColorModel. If this transferType is not supported a UnsupportedOperationException will be thrown. Since ColorModel is an abstract class any instance must be an instance of a subclass. Subclasses inherit the implementation of this method and if they don't override it this method throws an exception if the subclass uses a transferType other than DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT. @param inData an array of pixel values @return the value of the green component of the specified pixel. @exceptionthrows ClassCastException if inData is not a primitive array of type transferType @exceptionthrows ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel @exceptionthrows UnsupportedOperationException if this tranferType 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.0 and 1.0. 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. @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 from components @param normOffset the index into normComponents at which to begin storing unnormalized components from components @return an array containing normalized color and alpha components. @exceptionthrows 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 not supported by thisunable to determine the ColorModelnumber of bits per component
Class ColorModel, 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 is a non pre-multiplied value. For example if alpha is premultiplied this method divides it out before returning the value. If the alpha value is 0 the red value is 0. If inData is not a primitive array of type transferType a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if inData is not large enough to hold a pixel value for this ColorModel. If this transferType is not supported a UnsupportedOperationException will be thrown. Since ColorModel is an abstract class any instance must be an instance of a subclass. Subclasses inherit the implementation of this method and if they don't override it this method throws an exception if the subclass uses a transferType other than DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT. @param inData an array of pixel values @return the value of the red component of the specified pixel. @exceptionthrows ClassCastException if inData is not a primitive array of type transferType @exceptionthrows ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel @exceptionthrows UnsupportedOperationException if this tranferType is not supported by this ColorModel
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.0 and 1.0. 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. @exceptionthrows UnsupportedOperationExceptionIllegalArgumentException if thisthe methodlength of normComponents minus normOffset is not supportedless than bynumComponents @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 ColorModel, int hashCode()

Returns athe hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable. The general contract of hashCode is: Whenever it is invoked on the same object more than once during an execution of a Java application the hashCode method must consistently return the same integer provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. If two objects are equal according to the equals(Object) method then calling the hashCode method on each of the two objects must produce the same integer result. It is not required that if two objects are unequal according to the java.lang.Object#equals(java.lang.Object) method then calling the hashCode method on each of the two objects must produce distinct integer results. However the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables. As much as is reasonably practical the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer but this implementation technique is not required by the JavaTM programming languageColorModel.) @return a hash code value for this object. @see java.lang.Object#equals(java.lang.Object) @see java.utilColorModel.Hashtable
Class ColorModel, boolean isCompatibleRaster(Raster)

Returns true if raster is compatible with this ColorModel and false if it is not. 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 raster the Raster object to test for compatibility @return true if raster is compatible with this ColorModel. @exceptionthrows UnsupportedOperationException if this method has not been implemented for this ColorModel
Class ColorModel, boolean isCompatibleSampleModel(SampleModel)

Checks if the SampleModel is compatible with this ColorModel. 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 sm the specified SampleModel @return true if the specified SampleModel is compatible with this ColorModel; false otherwise. @exceptionthrows UnsupportedOperationException if this method is not supported by this ColorModel @see SampleModel

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 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. An IllegalArgumentException is thrown if the length of the array does not match the number of components. 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 that the bits array contains the number of significant bits per color/alpha component after the translation from pixel values. @param colorSpace The ColorSpace associated with this color model. @param bits The number of significant bits per component. @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 length of the bits array does not match the number of components. @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. @throwsSince UnsupportedOperationExceptionColorModel If the transfercan be subclassed typesubclasses inherit the implementation of this ComponentColorModelmethod is not oneand if they ofdon't the supported transferoverride it then types:they DataBuffer.TYPE_BYTEthrow DataBuffer.TYPE_USHORTan orexception DataBufferif they use an unsupported transferType.TYPE_INT @throws NullPointerException if raster is null and data coercion is required. @throws UnsupportedOperationException Ifif the transfer type of this ComponentColorModel is not one of the supported transfer types: DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT.
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 or DataBuffer.TYPE_INT.
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 or DataBuffer.TYPE_INT.
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. 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 UnsupportedOperationException Ifin some cases iff the transfer type of this ComponentColorModel is not one of the supported 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, Object getDataElements(int, Object)

Returns a data element array representation of a pixel in this ColorModel given an integer pixel representation in the default RGB color model. This array can then be passed to the setDataElements method of a WritableRaster object. If the pixel parameter is null a new array is allocated. 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 rgb @param pixel The integer representation of the pixel#. @throws ClassCastException If pixel is not null and is not a primitive array of type transferType. @throws ArrayIndexOutOfBoundsException If pixel 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 or DataBuffer.TYPE_INT. @see WritableRaster#setDataElements @see SampleModel#setDataElements
Class ComponentColorModel, Object getDataElements(int[], int, Object)

Returns a data element array representation of a pixel in this ColorModel given an array of unnormalized color/alpha components. This array can then be passed to the setDataElements method of a WritableRaster object. @param components An array of unnormalized color/alpha components. @param offset The integer offset into the components array. @param obj The object in which to store the data element array representation of the pixel. If obj variable is null a new array is allocated. If obj is not null it must be a primitive array of type transferType. An ArrayIndexOutOfBoundsException is thrown if obj is not large enough to hold a pixel value for this ColorModel. 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. @return The data element array representation of a pixel in this ColorModel. @throws IllegalArgumentException If the components array is not large enough to hold all the color and alpha components (starting at offset). @throws ClassCastException If obj is not null and is not a primitive array of type transferType. @throws ArrayIndexOutOfBoundsException If obj 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 or DataBuffer.TYPE_INT. @see WritableRaster#setDataElements @see SampleModel#setDataElements
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 or DataBuffer.TYPE_INT.
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 or DataBuffer.TYPE_INT. @see ColorModel#getRGBdefault
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 or DataBuffer.TYPE_INT.

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 integral number which can be stored in 8 16 or 32 bits (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 @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 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 pixelStride The pixel stride of the region of image data described. @param scanlineStride The line stride of the region of image data described. @param bandOffsets The 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 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 pixelStride The pixel stride of the region of image data described. @param scanlineStride The line stride of the region of image data described. @param bandIndices The bank indices of all bands. @param bandOffsets The 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
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 @throws IllegalArgumentException if w or h is not greater than 0

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.8 0911 02/2102/9800 @author Jim Graham
Class CropImageFilter, void setDimensions(int, int)

Override the source image's dimensions and pass the dimensions of the rectangular cropped region to the ImageConsumer.

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. @see ImageConsumer

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

Determine whether the delivered byte pixels intersect the region to be extracted and passes through only that subset of pixels that appear in the output region.

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.

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

Determine if the delivered int pixels intersect the region to be extracted and pass through only that subset of pixels that appear in the output region.

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.

Class CropImageFilter, void setProperties(Hashtable)

Passes along the properties from the source object after adding a property indicating the cropped region.

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.


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 and TYPE_INT DataBuffers to store image data. @see java.awt.image.Raster @see java.awt.image.SampleModel

Class DirectColorModel

AThe DirectColorModel class is a ColorModel class that works with pixel values whichthat represent RGB color and alpha information as separate samples and whichthat 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. There must be three color samples in the pixel values and there maycan be a single alpha sample. For those methods whichthat 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 ColorModel.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 will beare in the specified ColorSpace which must be of type ColorSpace.TYPE_RGB. 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 soand all pixels will beare treated as opaque (alphawhich =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 will beis 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
Class DirectColorModel, constructor DirectColorModel(int, int, int, int)

Constructs a DirectColorModel from the givenspecified masks specifyingthat indicate which bits in an int pixel representation contain the red green and blue color samples. PixelAs pixel values do not contain alpha information so all pixels will beare treated as opaque (alphawhich =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. The ColorSpace will beis the default sRGB space. The transparency value will beis Transparency.OPAQUE. The transfer type will beis the smallest of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT that can hold a single pixel. @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
Class DirectColorModel, constructor DirectColorModel(int, int, int, int, int)

Constructs a DirectColorModel from the givenspecified masks specifyingthat indicate 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 soand all pixels will beare treated as opaque (alphawhich =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. Alpha if present willis not be premultiplied. The ColorSpace will beis the default sRGB space. The transparency value will beis Transparency.OPAQUE if no alpha is present or Transparency.TRANSLUCENT otherwise. The transfer type will beis the smallest of DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT or DataBuffer.TYPE_INT that can hold a single pixel. @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
Class DirectColorModel, ColorModel coerceData(WritableRaster, boolean)

Forces the Rasterraster 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 Rasterraster data by alpha or do nothing if the data is in the correct state. If the data needs to be coerced this method will also return an instance of this ColorModel with the isAlphaPremultiplied flag set appropriately. This method will throw a UnsupportedOperationException if this transferType is not supported by this ColorModel. 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. @param raster the WritableRaster data @param isAlphaPremultiplied true if the alpha is premultiplied; false otherwise @return a ColorModel object that represents the coerced data. @exception UnsupportedOperationException if this transferType is not supported by this color model
Class DirectColorModel, WritableRaster createCompatibleWritableRaster(int, int)

Creates a WritableRaster with the specified width and height that has a data layout (SampleModel) compatible with this ColorModel. @param w the width to apply to the new WritableRaster @param h the height to apply to the new WritableRaster @return a WritableRaster object with the specified width and height. @throws IllegalArgumentException if w or h is less than or equal to zero @see WritableRaster @see SampleModel
Class DirectColorModel, 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. If inData is not a primitive array of type transferType a ClassCastException is thrown. An ArrayIndexOutOfBoundsException is thrown if inData is not large enough to hold a pixel value for this ColorModel. 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. If this transferType is not supported an UnsupportedOperationException is thrown. @param inData the specified pixel @return the alpha component of the specified pixel scaled from 0 to 255. @exception ClassCastException if inData is not a primitive array of type transferType @exception ArrayIndexOutOfBoundsException if inData is not large enough to hold a pixel value for this ColorModel @exception UnsupportedOperationException if this tranferType is not supported by this ColorModel
Class DirectColorModel, 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 specified pixel @return the value of the alpha component of pixel from 0 to 255.
Class DirectColorModel, int getAlphaMask()

Returns the mask indicating which bits in an int pixel representation contain the alpha component. @return the mask which indicates which bits of the int pixel representation contain the alpha sample.
Class DirectColorModel, in