|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagejava.awt.imageas colored differences. Deletions are shownlike 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.
Constructs anClass AffineTransformOp, constructor AffineTransformOp(AffineTransform, int)AffineTransformOpgiven an affine transform. The interpolation type is determined from theRenderingHintsobject. 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 (hintsis null) the interpolation type is TYPE_NEAREST_NEIGHBOR @param xform TheAffineTransformto use for the operation. @param hints TheRenderingHintsobject 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
Constructs anClass AffineTransformOp, int getInterpolationType()AffineTransformOpgiven an affine transform and the interpolation type. @param xform TheAffineTransformto 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.
Returns the interpolation type used by this op. @return the interpolation type. @see #TYPE_NEAREST_NEIGHBOR @see #TYPE_BILINEARClass AffineTransformOp, Point2D getPoint2D(Point2D, Point2D)
Returns the location of the corresponding destination point given a point in the source. IfdstPtis specified it is used to hold the return value. @param srcPt ThePoint2Dthat represents the source point. @param dstPt ThePoint2Din which to store the result. @return ThePoint2Din the destination that corresponds to the specified point in the source.
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
Transforms theClass BandCombineOp, Point2D getPoint2D(Point2D, Point2D)Rasterusing the matrix specified in the constructor. AnIllegalArgumentExceptionmay 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
Rasterto be filtered. @paramdestdst TheRasterin which to store the results of the filter operation. @return The filteredRaster. @throws IllegalArgumentException If the number of bands in the source or destination is incompatible with the matrix.
Returns the location of the corresponding destination point given a point in the sourceRaster. IfdstPtis specified it is used to hold the return value. Since this is not a geometric operation the point returned is the same as the specifiedsrcPt. @param srcPt ThePoint2Dthat represents the point in the sourceRaster@param dstPt ThePoint2Din which to store the result. @return ThePoint2Din the destination image that corresponds to the specified point in the source image.
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 datatypesClass 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. @paramClass BandedSampleModel, DataBuffer createDataBuffer()numBands The number of bands for the image data. @paramscanlineStride 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 ifdataTypeis not one of the supported data types
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 ifClass BandedSampleModel, Object getDataElements(int, int, Object, DataBuffer)dataTypeis noteitheroneDataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT orofDataBuffer.TYPE_SHORTtheorsupportedDataBuffertypes.TYPE_INT
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.Class BandedSampleModel, int[] getPixel(int, int, int[], DataBuffer)The following code illustrates transferring data for one pixel from DataBuffer
db1whose storage layout is described by BandedSampleModelbsm1to DataBufferdb2whose storage layout is described by BandedSampleModelbsm2. 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. @paramy TheY 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)
Returns all samples for the specified pixel in an int array. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. @param xClass BandedSampleModel, int[] getPixels(int, int, int, int, int[], DataBuffer)The X coordinate of the pixel location. @paramy TheY 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)
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 xClass BandedSampleModel, int getSample(int, int, int, DataBuffer)The X coordinate of the upper left pixel location. @paramy TheY 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)
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 xClass BandedSampleModel, double getSampleDouble(int, int, int, DataBuffer)The X coordinate of the pixel location. @paramy TheY 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)
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 xClass BandedSampleModel, float getSampleFloat(int, int, int, DataBuffer)The X coordinate of the pixel location. @paramy TheY 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.
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 xClass BandedSampleModel, int[] getSamples(int, int, int, int, int, int[], DataBuffer)The X coordinate of the pixel location. @paramyThe 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.
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 xClass BandedSampleModel, void setDataElements(int, int, Object, DataBuffer)The X coordinate of the upper left pixel location. @paramy TheY 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)
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.Class BandedSampleModel, void setPixel(int, int, int[], DataBuffer)The following code illustrates transferring data for one pixel from DataBuffer
db1whose storage layout is described by BandedSampleModelbsm1to DataBufferdb2whose storage layout is described by BandedSampleModelbsm2. 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. @paramy TheY 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)
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 xClass BandedSampleModel, void setPixels(int, int, int, int, int[], DataBuffer)The X coordinate of the pixel location. @paramy TheY 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)
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 xClass BandedSampleModel, void setSample(int, int, int, double, DataBuffer)The X coordinate of the upper left pixel location. @paramy TheY 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)
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 xClass BandedSampleModel, void setSample(int, int, int, float, DataBuffer)The X coordinate of the pixel location. @paramy TheY 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)
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 xClass BandedSampleModel, void setSample(int, int, int, int, DataBuffer)The X coordinate of the pixel location. @paramy TheY 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)
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 xClass BandedSampleModel, void setSamples(int, int, int, int, int, int[], DataBuffer)The X coordinate of the pixel location. @paramy TheY 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)
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 xThe X coordinate of the upper left pixel location. @paramy TheY 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)
Constructs a newClass BufferedImage, constructor BufferedImage(int, int, int, IndexColorModel)BufferedImagewith a specifiedColorModelandRaster. If the number and types of bands in theSampleModelof theRasterdo not match the number and types required by theColorModelto represent its color and alpha components a RasterFormatException is thrown. This method can multiply or divide the colorRasterdata by alpha to match thealphaPremultipliedstate in theColorModel. Properties for thisBufferedImagecan be established by passing in a Hashtable ofString/Objectpairs. @paramColorModelcmColorModelfor the new image @param rasterRasterfor the image data @param isRasterPremultiplied iftruethe data in the raster has been premultiplied with alpha. @param propertiesHashtableofString/Objectpairs. @exceptionRasterFormatExceptionif the number and types of bands in theSampleModelof theRasterdo not match the number and types required by theColorModelto represent its color and alpha components. @exceptionIllegalArgumentExceptionifrasteris incompatible withcm@see ColorModel @see Raster @see WritableRaster
Constructs aClass BufferedImage, Raster getData()BufferedImageof 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
IndexColorModelof 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
Returns the image as one large tile. TheClass BufferedImage, Raster getData(Rectangle)Rasterreturned is a copy of the image data is not updated if the image is changed. @return aRasterthat is a copy of the image data. @see #setData(Raster)
Computes and returns an arbitrary region of theClass BufferedImage, int getRGB(int, int)BufferedImage. TheRasterreturned is a copy of the image data and is not updated if the image is changed. @param rect the region of theBufferedImageto be returned. @return aRasterthat is a copy of the image data of the specified region of theBufferedImage@see #setData(Raster)
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 imageClass BufferedImage, void setData(Raster)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 startXstartY the starting coordinates @param w width of region @param h height of region @param rgbArray if notnullthe rgb pixels are written here @param offset offset into thergbArray@param scansize scanline stride for thergbArray@return array of RGB pixels. @exceptionIllegalArgumentExceptionif an unknown datatype is specified @see #setRGB(int int int) @see #setRGB(int int int int int[] int int)
Sets a rectangular region of the image to the contents of the specifiedClass BufferedImage, void setRGB(int, int, int)Rasterrwhich is assumed to be in the same coordinate space as theBufferedImage. The operation is clipped to the bounds of theBufferedImage. @param r the specifiedRaster@see #getData @see #getData(Rectangle)
Sets a pixel in thisClass BufferedImage, void setRGB(int, int, int, int, int[], int, int)BufferedImageto 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 anIndexColorModelthe 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)
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 imageClass BufferedImage, int TYPE_BYTE_BINARYColorModel. 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 thergbArray@param scansize scanline stride for thergbArray@see #getRGB(int int) @see #getRGB(int int int int int[] int int)
Represents an opaque byte-packedbinary1 2 or 4 bit image. The image has an IndexColorModel without alpha. When this type is used as theimageTypeargument to theBufferedImageconstructor that takes animageTypeargument but noColorModelargumentanaIndexColorModel1-bit image is created with anIndexColorModelwith two colors in the default sRGBColorSpace: {0 0 0} and {255 255 255}.Images with 2 or 4 bits per pixel may be constructed via the
BufferedImageconstructor that takes aColorModelargument by supplying aColorModelwith an appropriate map size.Images with 8 bits per pixel should use the image types
TYPE_BYTE_INDEXEDorTYPE_BYTE_GRAYdepending on theirColorModel.
Constructs aBufferedImageFilterwith the specified single-source/single-destination operator. @param op the specifiedBufferedImageOpto use to filter aBufferedImage@throws NullPointerException if op is null
This interface describes single-input/single-output operations performed onClass BufferedImageOp, BufferedImage createCompatibleDestImage(BufferedImage, ColorModel)BufferedImageobjects. It is implemented bysuch classes asAffineTransformOpConvolveOpBandCombineOpColorConvertOpRescaleOpandLookupOp. These objects can be passed into aBufferedImageFilterto operate on aBufferedImagein the ImageProducer-ImageFilter-ImageConsumer paradigm.This interface cannot be used to describe more sophisticated Ops such as
onesClasses thattake multiple sources. Each class implementingimplement this interfacewillmust specify whether or notittheywillallowanin-place filtering--operationfilter(i.e.operations where the source object is equal to the destination object).Note that theThis interface
restrictioncannot be used tosingle-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
Creates a zeroed destination image with the correct size and number of bands.Class BufferedImageOp, BufferedImage filter(BufferedImage, BufferedImage)TheAnIllegalArgumentExceptionmay be thrown if the source image is incompatible with the types of images allowed by the class implementing this filter. @param srcSource imageTheforBufferedImagethe filterto beoperation.filtered @param destCMColorModelof the destination. If null theColorModelof the sourcewill beis used. @return The zeroed destination image.
Performs a single-input/single-output operation on aClass BufferedImageOp, Rectangle2D getBounds2D(BufferedImage)BufferedImage. If the color models for the two images do not match a color conversion into the destination color modelwill beis performed. If the destination image is null aBufferedImagewith an appropriateColorModelwill beis created.TheAn
IllegalArgumentExceptionmay 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 TheBufferedImageto be filtered @param dest TheBufferedImagein which to store the results$ @return The filteredBufferedImage. @throws IllegalArgumentException If the source and/or destination image is not compatible with the types of images allowed by the class implementing this filter.
Returns the bounding box of the filtered destination image.Class BufferedImageOp, Point2D getPoint2D(Point2D, Point2D)TheAnIllegalArgumentExceptionmay be thrown if the source image is incompatible with the types of images allowed by the class implementing this filter. @param src TheBufferedImageto be filtered @return TheRectangle2Drepresenting the destination image's bounding box.
Returns the location of the corresponding destination point given a point in the source image. IfClass BufferedImageOp, RenderingHints getRenderingHints()dstPtisnon-nullspecified itwill beis used to hold the return value. @param srcPt thePoint2Dthat represents the point in the source image @param dstPt ThePoint2Din which to store the result @return ThePoint2Din the destination image that corresponds to the specified point in the source image.
Returns the rendering hints for thisBufferedImageOpoperation.Returns null@returnifThenoRenderingHintshints have beenobject for thisset.BufferedImageOp
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 sourceClass ColorConvertOp, constructor ColorConvertOp(ColorSpace, RenderingHints)ColorSpace@param dstCspace the destinationColorSpace@param hints theRenderingHintsobject used to control the color conversion ornull@throws NullPointerException if either srcCspace or dstCspace is null
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 destinationClass ColorConvertOp, constructor ColorConvertOp(ICC_Profile[], RenderingHints)ColorSpaceor an intermediateColorSpace@param hints theRenderingHintsobject used to control the color conversion ornull@throws NullPointerException if cspace is null
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.Class ColorConvertOp, BufferedImage createCompatibleDestImage(BufferedImage, ColorModel)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_Profileobjects @param hints theRenderingHintsobject used to control the color conversion ornull@exception IllegalArgumentException when the profile sequence does not specify a well-defined color conversion @exception NullPointerException if profiles is null
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 aBufferedImagewith the correct size and number of bands from the specifiedsrc. @throws IllegalArgumentException ifdestCMisnulland thisColorConvertOpwas created without anyICC_ProfileorColorSpacedefined for the destination
TheClass ColorModel, constructor ColorModel(int, int[], ColorSpace, boolean, boolean, int, int)ColorModelabstract 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 aColorModelis specified by itsColorSpace. AColorModelused with pixel data that does not include alpha information treats all pixels as opaque which is an alpha value of 1.0.This
ColorModelclass 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 singlebyteor singleintvalues. For purposes of theColorModelclass 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. ConsequentlyColorModelnow has methods that accept pixel values represented as arrays of primitive types. The primitive type used by a particularColorModelobject is called its transfer type.
ColorModelobjects 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 ofColorModelmust 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 particularColorModelobject is specified when the object is created either explicitly or by default. All subclasses ofColorModelmust specify what the possible transfer types are and how the number of elements in the primitive arrays representing pixels is determined.For
BufferedImagesthe transfer type of itsRasterand of theRasterobject'sSampleModel(available from thegetTransferTypemethods of these classes) must match that of theColorModel. The number of elements in an array representing a pixel for theRasterandSampleModel(available from thegetNumDataElementsmethods of these classes) must match that of theColorModel.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
SampleModelof aBufferedImageobject'sRasterand 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
ColorModelclass use two different representations of color and alpha components - a normalized form and an unnormalized form. In the normalized form each component is afloatvalue 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 theColorSpaceobject. 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 thegetMinValueandgetMaxValuemethods of theColorSpaceclass. Normalized color component values are not premultiplied. AllColorModelsmust 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
ColorModelrepresent color samples premultiplied by the alpha sample unnormalized color component values are also premultiplied.In theThenormalizedunnormalized formeachis used only with instances ofColorModelwhoseColorSpacehas minimum componentisvalues 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 forfloatColorModelsvaluewhose normalized component values all lie between 0.0 and 1.0.NormalizedIncolorsuch 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 valuesarecan be either negative or positive the unnormalized form is notpremultipliedconvenient. SuchColorModelobjects throw an IllegalArgumentException when methods involving an unnormalized argument are called. Subclasses ofColorModelmust 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
Constructs aClass ColorModel, int[] getComponents(Object, int[], int)ColorModelthat translates pixel values to color/alpha components. Color components will be in the specifiedColorSpace.pixel_bitsis 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 theColorSpaceif there is no alpha information in the pixel values or one more than this number if there is alpha information.hasAlphaindicates whether or not alpha information is present. ThebooleanisAlphaPremultipliedspecifies how to interpret pixel values in which color and alpha information are represented as separate spatial bands. If thebooleanistruecolor samples are assumed to have been multiplied by the alpha sample. Thetransparencyspecifies 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 anIndexColorModelwithpixel_bitsequal 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 specifiedColorSpace@param hasAlphatrueif alpha information is present;falseotherwise @param isAlphaPremultipliedtrueif color samples are assumed to be premultiplied by the alpha samples;falseotherwise @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 thisColorModelor if the transparency is not a valid value. @throws IllegalArgumentException if the sum of the number of bits inbitsis less than 1 or if any of the elements inbitsis less than 0. @see java.awt.Transparency
Returns an array of unnormalized color/alpha components given a pixel in thisClass ColorModel, int[] getComponents(int, int[], int)ColorModel. The pixel value is specified by an array of data elements of type transferType passed in as an object reference. Ifpixelis not a primitive array of type transferType aClassCastExceptionis thrown. AnIllegalArgumentExceptionwill be thrown if color component values for thisColorModelare not conveniently representable in the unnormalized form. AnArrayIndexOutOfBoundsExceptionis thrown ifpixelis not large enough to hold a pixel value for thisColorModel. This method can be used to retrieve the components for a specific pixel value in anyColorModel. If the components array isnulla new array will be allocated. The components array will be returned. Color/alpha components are stored in thecomponentsarray starting atoffset(even if the array is allocated by this method). AnArrayIndexOutOfBoundsExceptionis thrown if the components array is notnulland is not large enough to hold all the color and alpha components (starting atoffset). SinceColorModelis an abstract class any instance is an instance of a subclass. Subclasses must override this method since the implementation in this abstract class throws anUnsupportedOperationException. @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 thecomponentsarray 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 thisColorModel
Returns an array of unnormalized color/alpha components given a pixel in thisClass ColorModel, float[] getNormalizedComponents(int[], int, float[], int)ColorModel. The pixel value is specified as anint. AnIllegalArgumentExceptionwill be thrown if pixel values for thisColorModelare not conveniently representable as a singleintor if color component values for thisColorModelare not conveniently representable in the unnormalized form. For example this method can be used to retrieve the components for a specific pixel value in aDirectColorModel. If the components array isnulla new array will be allocated. The components array will be returned. Color/alpha components are stored in the components array starting atoffset(even if the array is allocated by this method). AnArrayIndexOutOfBoundsExceptionis thrown if the components array is notnulland is not large enough to hold all the color and alpha components (starting at offset). SinceColorModelis an abstract class any instance is an instance of a subclass. Subclasses must override this method since the implementation in this abstract class throws anUnsupportedOperationException. @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 thecomponentsarray 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 thisColorModel
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 betweenClass ColorModel, int[] getUnnormalizedComponents(float[], int, int[], int)0.0a per component minimum and1maximum specified by theColorSpaceobject for thisColorModel.0AnIllegalArgumentExceptionwill be thrown if color component values for thisColorModelare not conveniently representable in the unnormalized form. If thenormComponentsarray isnulla new array will be allocated. ThenormComponentsarray will be returned. Color/alpha components are stored in thenormComponentsarray starting atnormOffset(even if the array is allocated by this method). AnArrayIndexOutOfBoundsExceptionis thrown if thenormComponentsarray is notnulland is not large enough to hold all the color and alpha components (starting atnormOffset). AnIllegalArgumentExceptionis thrown if thecomponentsarray is not large enough to hold all the color and alpha components starting atoffset.Since
ColorModelis 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 thecomponentsarray at which to start retrieving unnormalized components @param normComponents an array that receives thecomponents fromnormalized components @param normOffset the index intonormComponentsat which to begin storingunnormalized components fromnormalized components @return an array containing normalized color and alpha components. @throws IllegalArgumentException If the component values for thisColorModelare not conveniently representable in the unnormalized form. @throws UnsupportedOperationException if the constructor of thisColorModelcalled thesuper(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
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 between0.0a per component minimum and1maximum specified by theColorSpaceobject for thisColorModel.0AnIllegalArgumentExceptionwill be thrown if color component values for thisColorModelare not conveniently representable in the unnormalized form. If thecomponentsarray isnulla new array will be allocated. Thecomponentsarray will be returned. Color/alpha components are stored in thecomponentsarray starting atoffset(even if the array is allocated by this method). AnArrayIndexOutOfBoundsExceptionis thrown if thecomponentsarray is notnulland is not large enough to hold all the color and alpha components (starting atoffset). AnIllegalArgumentExceptionis thrown if thenormComponentsarray is not large enough to hold all the color and alpha components starting atnormOffset. @param normComponents an array containing normalized components @param normOffset the offset into thenormComponentsarray at which to start retrieving normalized components @param components an array that receives the components fromnormComponents@param offset the index intocomponentsat which to begin storing normalized components fromnormComponents@return an array containing unnormalized color and alpha components. @throws IllegalArgumentException If the component values for thisColorModelare not conveniently representable in the unnormalized form. @throws IllegalArgumentException if the length ofnormComponentsminusnormOffsetis less thannumComponents@throws UnsupportedOperationException if the constructor of thisColorModelcalled thesuper(bits)constructor but did not override this method. See the constructor #ColorModel(int)
AClass ComponentColorModel, constructor ComponentColorModel(ColorSpace, int[], boolean, boolean, int, int)ColorModelclass 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 arbitraryColorSpace. The number of color samples in the pixel values must be same as the number of color components in theColorSpace. There may be a single alpha sample.For those methods that use a primitive array pixel representation of type
transferTypethe 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 theColorSpace. Typically this order reflects the name of the color space type. For example forTYPE_RGBindex 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
ComponentColorModelthe 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 thegetMinValueandgetMaxValuemethods of theColorSpaceclass. The range for an alpha component should be 0.0 to 1.0.Instances of
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 alphaComponentColorModelcreated with transfer typesDataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTandDataBuffer.TYPE_INThave pixel sample values which are treated as unsigned integral values.componentsample passed to theComponentColorModel(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 theColorSpace'sgetMinValuemethod for each component and 2n - 1 maps to the value obtained fromgetMaxValue. To create aComponentColorModelwith a different color sample mapping requires subclassing this class and overriding thegetNormalizedComponents(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
ColorSpacemust 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 anIllegalArgumentException.Instances of
ComponentColorModelcreated with transfer typesDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATandDataBuffer.TYPE_DOUBLEhave 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 anIllegalArgumentExceptionwhen 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 theColorSpace(-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 thegetNormalizedComponents(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
ComponentColorModelcreated with transfer typesDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATandDataBuffer.TYPE_DOUBLEuse all the bits of all sample values. Thus all color/alpha components have 16 bits when usingDataBuffer.TYPE_SHORT32 bits when usingDataBuffer.TYPE_FLOATand 64 bits when usingDataBuffer.TYPE_DOUBLE. When theComponentColorModel(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
ComponentColorModelis 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 theColorSpace(obtained using thegetMinValueandgetMaxValuemethods of theColorSpaceclass) 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
IllegalArgumentExceptionunless the number of components for theComponentColorModelis one and the component value is unsigned -- in other words a single color component using a transfer type ofDataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTorDataBuffer.TYPE_INTand no alpha.A
ComponentColorModelcan be used in conjunction with aComponentSampleModelaBandedSampleModelor aPixelInterleavedSampleModelto construct aBufferedImage. @see ColorModel @see ColorSpace @see ComponentSampleModel @see BandedSampleModel @see PixelInterleavedSampleModel @see BufferedImage @version 10 Feb 1997
Constructs aClass ComponentColorModel, ColorModel coerceData(WritableRaster, boolean)ComponentColorModelfrom the specified parameters. Color components will be in the specifiedColorSpace. The supported transfer types areDataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTDataBuffer.TYPE_INTDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATandDataBuffer.TYPE_DOUBLE. If not null thebitsarray specifies the number of significant bits per color and alpha component.andItsits length should be at least the number of components in theColorSpaceif there is no alpha information in the pixel values or one more than this number if there is alpha information.AnWhen theisIllegalArgumentExceptiontransferTypethrown ifDataBuffer.TYPE_SHORTtheDataBuffer.TYPE_FLOATlengthorofDataBuffer.TYPE_DOUBLEthearray does not matchbitsthe number of componentsarray argument is ignored.hasAlphaindicates whether alpha information is present. IfhasAlphais true then the booleanisAlphaPremultipliedspecifies 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. Thetransparencyspecifies what alpha values can be represented by this color model. The acceptabletransparencyvalues areOPAQUEBITMASKorTRANSLUCENT. ThetransferTypeis the type of primitive array used to represent pixel values.Note@paramthat thecolorSpace ThebitsColorSpacearrayassociated withcontainsthisthecolor model. @param bits The number of significant bits percolor/alphacomponent.after the translation from pixelMay be null in whichvalues.case@paramallcolorSpace Thebits ofColorSpaceallassociated with this color modelcomponent samples will be significant.@paramIgnoredbits Theif transferTypenumberis one ofsignificantDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATorDataBuffer.TYPE_DOUBLEin which case all bitsperof 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 thelength of thebitsarraydoesargument is notmatchnull its length is less than the number of color and alpha components and transferType is one ofDataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTorDataBuffer.TYPE_INT. @throws IllegalArgumentException If transferType is not one ofDataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTDataBuffer.TYPE_INTDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATorDataBuffer.TYPE_DOUBLE. @see ColorSpace @see java.awt.Transparency
Forces the raster data to match the state specified in theClass ComponentColorModel, int getAlpha(Object)isAlphaPremultipliedvariable assuming the data is currently correctly described by thisColorModel. 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 thisColorModelwith theisAlphaPremultipliedflag set appropriately. SinceColorModelcan 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 unsupportedtransferType. @throws NullPointerException ifrasterisnulland data coercion is required. @throws UnsupportedOperationException if the transfer type of thisComponentColorModelis not one of the supported transfer types:DataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTDataBuffer.TYPE_INTDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATorDataBuffer.TYPE_.INTDOUBLE
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 typeClass ComponentColorModel, int getAlpha(int)transferTypepassed in as an object reference. SinceComponentColorModelcan 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 unsupportedtransferType. @param inData The pixel from which you want to get the alpha component specified by an array of data elements of typetransferType. @return The alpha component for the specified pixel as an int. @throws ClassCastException IfinDatais not a primitive array of typetransferType. @throws ArrayIndexOutOfBoundsException ifinDatais not large enough to hold a pixel value for thisColorModel. @throws UnsupportedOperationException If the transfer type of thisComponentColorModelis not one of the supported transfer types:DataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTDataBuffer.TYPE_INTDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATorDataBuffer.TYPE_.INTDOUBLE
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 thisClass ComponentColorModel, int getBlue(Object)ColorModel. @throws IllegalArgumentException If the component value for thisColorModelis signed
Returns the blue color component for the specified pixel scaled from 0 to 255 in the default RGBClass ComponentColorModel, int getBlue(int)ColorSpacesRGB. A color conversion is done if necessary. Thepixelvalue is specified by an array of data elements of typetransferTypepassed 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). SinceComponentColorModelcan 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 unsupportedtransferType. @param inData The pixel from which you want to get the blue color component specified by an array of data elements of typetransferType. @return The blue color component for the specified pixel as an int. @throws ClassCastException IfinDatais not a primitive array of typetransferType. @throws ArrayIndexOutOfBoundsException ifinDatais not large enough to hold a pixel value for thisColorModel. @throws UnsupportedOperationException If the transfer type of thisComponentColorModelis not one of the supported transfer types:DataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTDataBuffer.TYPE_INTDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATorDataBuffer.TYPE_.INTDOUBLE
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 thisClass ComponentColorModel, int[] getComponents(Object, int[], int)ColorModel. @throws IllegalArgumentException If the component value for thisColorModelis signed
Returns an array of unnormalized color/alpha components given a pixel in thisClass ComponentColorModel, int[] getComponents(int, int[], int)ColorModel. The pixel value is specified by an array of data elements of typetransferTypepassed in as an object reference. An IllegalArgumentException is thrown if the component values for thisColorModelare not conveniently representable in the unnormalized form. Color/alpha components are stored in thecomponentsarray starting atoffset(even if the array is allocated by this method). SinceComponentColorModelcan 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 unsupportedtransferType. @param pixel A pixel value specified by an array of data elements of typetransferType. @param components An integer array in which to store the unnormalized color/alpha components. If thecomponentsarray is null a new array is allocated. @param offset An offset into thecomponentsarray. @return Thecomponentsarray. @throws IllegalArgumentException If thisComponentColorModeldoes not support the unnormalized form @throws UnsupportedOperationException in some cases iff the transfer type of thisComponentColorModelis not one of thesupportedfollowing transfer types:DataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTorDataBuffer.TYPE_INT. @throws ClassCastException Ifpixelis not a primitive array of typetransferType. @throws IllegalArgumentException If thecomponentsarray is not null and is not large enough to hold all the color and alpha components (starting at offset) or ifpixelis not large enough to hold a pixel value for this ColorModel.
Returns an array of unnormalized color/alpha components given a pixel in thisClass ComponentColorModel, int getGreen(Object)ColorModel. An IllegalArgumentException is thrown if the component value for thisColorModelis not conveniently representable in the unnormalized form. Color/alpha components are stored in thecomponentsarray starting atoffset(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 thecomponentsarray is null a new array is allocated. @param offset An offset into thecomponentsarray. @return The components array. @throws IllegalArgumentException If there is more than one component in thisColorModel. @throws IllegalArgumentException If thisColorModeldoes not support the unnormalized form @throws ArrayIndexOutOfBoundsException If thecomponentsarray is not null and is not large enough to hold all the color and alpha components (starting at offset).
Returns the green color component for the specified pixel scaled from 0 to 255 in the default RGBClass ComponentColorModel, int getGreen(int)ColorSpacesRGB. A color conversion is done if necessary. Thepixelvalue is specified by an array of data elements of typetransferTypepassed 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). SinceComponentColorModelcan 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 unsupportedtransferType. @param inData The pixel from which you want to get the green color component specified by an array of data elements of typetransferType. @return The green color component for the specified pixel as an int. @throws ClassCastException IfinDatais not a primitive array of typetransferType. @throws ArrayIndexOutOfBoundsException ifinDatais not large enough to hold a pixel value for thisColorModel. @throws UnsupportedOperationException If the transfer type of thisComponentColorModelis not one of the supported transfer types:DataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTDataBuffer.TYPE_INTDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATorDataBuffer.TYPE_.INTDOUBLE
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 thisClass ComponentColorModel, int getRGB(Object)ColorModel. @throws IllegalArgumentException If the component value for thisColorModelis signed
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 typeClass ComponentColorModel, int getRGB(int)transferTypepassed 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). SinceComponentColorModelcan 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 unsupportedtransferType. @param inData The pixel from which you want to get the color/alpha components specified by an array of data elements of typetransferType. @return The color/alpha components for the specified pixel as an int. @throws ClassCastException IfinDatais not a primitive array of typetransferType. @throws ArrayIndexOutOfBoundsException ifinDatais not large enough to hold a pixel value for thisColorModel. @throws UnsupportedOperationException If the transfer type of thisComponentColorModelis not one of the supported transfer types:DataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTDataBuffer.TYPE_INTDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATorDataBuffer.TYPE_. @see ColorModel#getRGBdefaultINTDOUBLE
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 thisClass ComponentColorModel, int getRed(Object)ColorModel. @throws IllegalArgumentException If the component value for thisColorModelis signed
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. TheClass ComponentColorModel, int getRed(int)pixelvalue is specified by an array of data elements of typetransferTypepassed 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). SinceComponentColorModelcan 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 unsupportedtransferType. @param inData The pixel from which you want to get the red color component specified by an array of data elements of typetransferType. @return The red color component for the specified pixel as an int. @throws ClassCastException IfinDatais not a primitive array of typetransferType. @throws ArrayIndexOutOfBoundsException ifinDatais not large enough to hold a pixel value for thisColorModel. @throws UnsupportedOperationException If the transfer type of thisComponentColorModelis not one of the supported transfer types:DataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTDataBuffer.TYPE_INTDataBuffer.TYPE_SHORTDataBuffer.TYPE_FLOATorDataBuffer.TYPE_.INTDOUBLE
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 thisClass ComponentColorModel, int[] getUnnormalizedComponents(float[], int, int[], int)ColorModel. @throws IllegalArgumentException If the component value for thisColorModelis signed
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 between0.0a per component minimum and1maximum specified by theColorSpaceobject for thisColorModel.0AnIllegalArgumentExceptionwill be thrown if color component values for thisColorModelare not conveniently representable in the unnormalized form. If thecomponentsarray isnulla new array will be allocated. Thecomponentsarray will be returned. Color/alpha components are stored in thecomponentsarray starting atoffset(even if the array is allocated by this method). AnArrayIndexOutOfBoundsExceptionis thrown if thecomponentsarray is notnulland is not large enough to hold all the color and alpha components (starting atoffset). AnIllegalArgumentExceptionis thrown if thenormComponentsarray is not large enough to hold all the color and alpha components starting atnormOffset. @param normComponents an array containing normalized components @param normOffset the offset into thenormComponentsarray at which to start retrieving normalized components @param components an array that receives the components fromnormComponents@param offset the index intocomponentsat which to begin storing normalized components fromnormComponents@return an array containing unnormalized color and alpha components. @throws IllegalArgumentExceptionif the lengthIfofthisnormComponentsComponentColorModelminusdoesnormOffsetnotis less thansupport the unnormalizednumComponentsform @throwsUnsupportedOperationExceptionIllegalArgumentException if theconstructorlength ofthisColorModelnormComponentscalled theminussuper(bits)normOffsetconstructor but did not override this method. Seeisthe constructorless than#ColorModel(int)numComponents
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 (Class ComponentSampleModel, constructor ComponentSampleModel(int, int, int, int, int, int[])allusingDataBuffer.TYPE_BYTEDataBuffer.TYPE_USHORTorDataBuffer.TYPE_INTrespectively) data for which each sample is a signed integral number which can be stored in 16 bits (usingDataBuffer.TYPE_SHORT) or data for which each sample is a signed float or double quantity (usingDataBuffer.TYPE_FLOATorDataBuffer.TYPE_DOUBLErespectively). 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
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 dataTypeClass ComponentSampleModel, constructor ComponentSampleModel(int, int, int, int, int, int[], int[])Thethe data type for storing samples.@param wThethe width (in pixels) of the region of image data described.@param hThethe height (in pixels) of the region of image data described.@param pixelStrideThethe pixel stride of the region of image data described.@param scanlineStrideThethe line stride of the region of image data described.@param bandOffsetsThethe offsets of all bands.@throws IllegalArgumentException ifworhis not greater than 0 @throws IllegalArgumentException ifpixelStrideis less than 0 @throws IllegalArgumentException ifscanlineStrideis less than 0 @throws IllegalArgumentException ifnumBandsis less than 1 @throws IllegalArgumentException if the product ofwandhis greater thanInteger.MAX_VALUE@throws IllegalArgumentException ifdataTypeis not one of the supported data types
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 dataTypeThethe data type for storing samples.@param wThethe width (in pixels) of the region of image data described.@param hThethe height (in pixels) of the region of image data described.@param pixelStrideThethe pixel stride of the region of image data described.@param scanlineStride The line stride of the region of image data described.@parambandIndices ThebankIndices the bank indices of all bands.@param bandOffsetsThethe band offsets of all bands.@throws IllegalArgumentException ifworhis not greater than 0 @throws IllegalArgumentException ifpixelStrideis less than 0 @throws IllegalArgumentException ifscanlineStrideis less than 0 @throws IllegalArgumentException if the length ofbankIndicesdoes not equal the length ofbankOffsets@throws IllegalArgumentException if any of the bank indices ofbandIndicesis less than 0 @throws IllegalArgumentException ifdataTypeis not one of the supported data types