javax.imageio
Class ImageTypeSpecifier

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.imageio.ImageTypeSpecifier

public class ImageTypeSpecifier
extends Object sample code for java.lang.Object definition code for java.lang.Object

A class that allows the format of an image (in particular, its SampleModel and ColorModel) to be specified in a convenient manner.


Field Summary
protected  ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel colorModel sample code for javax.imageio.ImageTypeSpecifier.colorModel definition code for javax.imageio.ImageTypeSpecifier.colorModel
          The ColorModel to be used as a prototype.
protected  SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel sampleModel sample code for javax.imageio.ImageTypeSpecifier.sampleModel definition code for javax.imageio.ImageTypeSpecifier.sampleModel
          A SampleModel to be used as a prototype.
 
Constructor Summary
ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier.ImageTypeSpecifier(java.awt.image.ColorModel, java.awt.image.SampleModel) definition code for javax.imageio.ImageTypeSpecifier.ImageTypeSpecifier(java.awt.image.ColorModel, java.awt.image.SampleModel) (ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  colorModel, SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel)
          Constructs an ImageTypeSpecifier directly from a ColorModel and a SampleModel.
ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier.ImageTypeSpecifier(java.awt.image.RenderedImage) definition code for javax.imageio.ImageTypeSpecifier.ImageTypeSpecifier(java.awt.image.RenderedImage) (RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage  image)
          Constructs an ImageTypeSpecifier from a RenderedImage.
 
Method Summary
static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier createBanded sample code for javax.imageio.ImageTypeSpecifier.createBanded(java.awt.color.ColorSpace, int[], int[], int, boolean, boolean) definition code for javax.imageio.ImageTypeSpecifier.createBanded(java.awt.color.ColorSpace, int[], int[], int, boolean, boolean) (ColorSpace sample code for java.awt.color.ColorSpace definition code for java.awt.color.ColorSpace  colorSpace, int[] bankIndices, int[] bandOffsets, int dataType, boolean hasAlpha, boolean isAlphaPremultiplied)
          Returns a specifier for a banded image format that will use a ComponentColorModel and a BandedSampleModel to store each channel in a separate array.
 BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage createBufferedImage sample code for javax.imageio.ImageTypeSpecifier.createBufferedImage(int, int) definition code for javax.imageio.ImageTypeSpecifier.createBufferedImage(int, int) (int width, int height)
          Creates a BufferedImage with a given width and height according to the specification embodied in this object.
static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier createFromBufferedImageType sample code for javax.imageio.ImageTypeSpecifier.createFromBufferedImageType(int) definition code for javax.imageio.ImageTypeSpecifier.createFromBufferedImageType(int) (int bufferedImageType)
          Returns an ImageTypeSpecifier that encodes one of the standard BufferedImage types (other than TYPE_CUSTOM).
static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier createFromRenderedImage sample code for javax.imageio.ImageTypeSpecifier.createFromRenderedImage(java.awt.image.RenderedImage) definition code for javax.imageio.ImageTypeSpecifier.createFromRenderedImage(java.awt.image.RenderedImage) (RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage  image)
          Returns an ImageTypeSpecifier that encodes the layout of a RenderedImage (which may be a BufferedImage).
static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier createGrayscale sample code for javax.imageio.ImageTypeSpecifier.createGrayscale(int, int, boolean) definition code for javax.imageio.ImageTypeSpecifier.createGrayscale(int, int, boolean) (int bits, int dataType, boolean isSigned)
          Returns a specifier for a grayscale image format that will pack pixels of the given bit depth into array elements of the specified data type.
static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier createGrayscale sample code for javax.imageio.ImageTypeSpecifier.createGrayscale(int, int, boolean, boolean) definition code for javax.imageio.ImageTypeSpecifier.createGrayscale(int, int, boolean, boolean) (int bits, int dataType, boolean isSigned, boolean isAlphaPremultiplied)
          Returns a specifier for a grayscale plus alpha image format that will pack pixels of the given bit depth into array elements of the specified data type.
static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier createIndexed sample code for javax.imageio.ImageTypeSpecifier.createIndexed(byte[], byte[], byte[], byte[], int, int) definition code for javax.imageio.ImageTypeSpecifier.createIndexed(byte[], byte[], byte[], byte[], int, int) (byte[] redLUT, byte[] greenLUT, byte[] blueLUT, byte[] alphaLUT, int bits, int dataType)
          Returns a specifier for an indexed-color image format that will pack index values of the given bit depth into array elements of the specified data type.
static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier createInterleaved sample code for javax.imageio.ImageTypeSpecifier.createInterleaved(java.awt.color.ColorSpace, int[], int, boolean, boolean) definition code for javax.imageio.ImageTypeSpecifier.createInterleaved(java.awt.color.ColorSpace, int[], int, boolean, boolean) (ColorSpace sample code for java.awt.color.ColorSpace definition code for java.awt.color.ColorSpace  colorSpace, int[] bandOffsets, int dataType, boolean hasAlpha, boolean isAlphaPremultiplied)
          Returns a specifier for an interleaved image format that will use a ComponentColorModel and a PixelInterleavedSampleModel to store each pixel component in a separate byte, short, or int.
static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier createPacked sample code for javax.imageio.ImageTypeSpecifier.createPacked(java.awt.color.ColorSpace, int, int, int, int, int, boolean) definition code for javax.imageio.ImageTypeSpecifier.createPacked(java.awt.color.ColorSpace, int, int, int, int, int, boolean) (ColorSpace sample code for java.awt.color.ColorSpace definition code for java.awt.color.ColorSpace  colorSpace, int redMask, int greenMask, int blueMask, int alphaMask, int transferType, boolean isAlphaPremultiplied)
          Returns a specifier for a packed image format that will use a DirectColorModel and a packed SampleModel to store each pixel packed into in a single byte, short, or int.
 boolean equals sample code for javax.imageio.ImageTypeSpecifier.equals(java.lang.Object) definition code for javax.imageio.ImageTypeSpecifier.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  o)
          Returns true if the given Object is an ImageTypeSpecifier and has a SampleModel and ColorModel that are equal to those of this object.
 int getBitsPerBand sample code for javax.imageio.ImageTypeSpecifier.getBitsPerBand(int) definition code for javax.imageio.ImageTypeSpecifier.getBitsPerBand(int) (int band)
          Return the number of bits used to represent samples of the given band.
 int getBufferedImageType sample code for javax.imageio.ImageTypeSpecifier.getBufferedImageType() definition code for javax.imageio.ImageTypeSpecifier.getBufferedImageType() ()
          Returns an int containing one of the enumerated constant values describing image formats from BufferedImage.
 ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel getColorModel sample code for javax.imageio.ImageTypeSpecifier.getColorModel() definition code for javax.imageio.ImageTypeSpecifier.getColorModel() ()
          Returns the ColorModel specified by this object.
 int getNumBands sample code for javax.imageio.ImageTypeSpecifier.getNumBands() definition code for javax.imageio.ImageTypeSpecifier.getNumBands() ()
          Return the number of bands specified by this object.
 int getNumComponents sample code for javax.imageio.ImageTypeSpecifier.getNumComponents() definition code for javax.imageio.ImageTypeSpecifier.getNumComponents() ()
          Return the number of color components specified by this object.
 SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel getSampleModel sample code for javax.imageio.ImageTypeSpecifier.getSampleModel() definition code for javax.imageio.ImageTypeSpecifier.getSampleModel() ()
          Returns a SampleModel based on the settings encapsulated within this object.
 SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel getSampleModel sample code for javax.imageio.ImageTypeSpecifier.getSampleModel(int, int) definition code for javax.imageio.ImageTypeSpecifier.getSampleModel(int, int) (int width, int height)
          Returns a SampleModel based on the settings encapsulated within this object.
 int hashCode sample code for javax.imageio.ImageTypeSpecifier.hashCode() definition code for javax.imageio.ImageTypeSpecifier.hashCode() ()
          Returns the hash code for this ImageTypeSpecifier.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

colorModel sample code for javax.imageio.ImageTypeSpecifier.colorModel

protected ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  colorModel
The ColorModel to be used as a prototype.


sampleModel sample code for javax.imageio.ImageTypeSpecifier.sampleModel

protected SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel
A SampleModel to be used as a prototype.

Constructor Detail

ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier(java.awt.image.ColorModel, java.awt.image.SampleModel) definition code for javax.imageio.ImageTypeSpecifier(java.awt.image.ColorModel, java.awt.image.SampleModel)

public ImageTypeSpecifier(ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  colorModel,
                          SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  sampleModel)
Constructs an ImageTypeSpecifier directly from a ColorModel and a SampleModel. It is the caller's responsibility to supply compatible parameters.

Parameters:
colorModel - a ColorModel.
sampleModel - a SampleModel.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if either parameter is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if sampleModel is not compatible with colorModel.

ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier(java.awt.image.RenderedImage) definition code for javax.imageio.ImageTypeSpecifier(java.awt.image.RenderedImage)

public ImageTypeSpecifier(RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage  image)
Constructs an ImageTypeSpecifier from a RenderedImage. If a BufferedImage is being used, one of the factory methods createFromRenderedImage or createFromBufferedImageType should be used instead in order to get a more accurate result.

Parameters:
image - a RenderedImage.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the argument is null.
Method Detail

createPacked sample code for javax.imageio.ImageTypeSpecifier.createPacked(java.awt.color.ColorSpace, int, int, int, int, int, boolean) definition code for javax.imageio.ImageTypeSpecifier.createPacked(java.awt.color.ColorSpace, int, int, int, int, int, boolean)

public static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  createPacked(ColorSpace sample code for java.awt.color.ColorSpace definition code for java.awt.color.ColorSpace  colorSpace,
                                              int redMask,
                                              int greenMask,
                                              int blueMask,
                                              int alphaMask,
                                              int transferType,
                                              boolean isAlphaPremultiplied)
Returns a specifier for a packed image format that will use a DirectColorModel and a packed SampleModel to store each pixel packed into in a single byte, short, or int.

Parameters:
colorSpace - the desired ColorSpace.
redMask - a contiguous mask indicated the position of the red channel.
greenMask - a contiguous mask indicated the position of the green channel.
blueMask - a contiguous mask indicated the position of the blue channel.
alphaMask - a contiguous mask indicated the position of the alpha channel.
transferType - the desired SampleModel transfer type.
isAlphaPremultiplied - true if the color channels will be premultipled by the alpha channel.
Returns:
an ImageTypeSpecifier with the desired characteristics.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if colorSpace is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if colorSpace is not of type TYPE_RGB.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if no mask has at least 1 bit set.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if transferType if not one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT.

createInterleaved sample code for javax.imageio.ImageTypeSpecifier.createInterleaved(java.awt.color.ColorSpace, int[], int, boolean, boolean) definition code for javax.imageio.ImageTypeSpecifier.createInterleaved(java.awt.color.ColorSpace, int[], int, boolean, boolean)

public static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  createInterleaved(ColorSpace sample code for java.awt.color.ColorSpace definition code for java.awt.color.ColorSpace  colorSpace,
                                                   int[] bandOffsets,
                                                   int dataType,
                                                   boolean hasAlpha,
                                                   boolean isAlphaPremultiplied)
Returns a specifier for an interleaved image format that will use a ComponentColorModel and a PixelInterleavedSampleModel to store each pixel component in a separate byte, short, or int.

Parameters:
colorSpace - the desired ColorSpace.
bandOffsets - an array of ints indicating the offsets for each band.
dataType - the desired data type, as one of the enumerations from the DataBuffer class.
hasAlpha - true if an alpha channel is desired.
isAlphaPremultiplied - true if the color channels will be premultipled by the alpha channel.
Returns:
an ImageTypeSpecifier with the desired characteristics.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if colorSpace is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bandOffsets is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if dataType is not one of the legal DataBuffer.TYPE_* constants.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bandOffsets.length does not equal the number of color space components, plus 1 if hasAlpha is true.

createBanded sample code for javax.imageio.ImageTypeSpecifier.createBanded(java.awt.color.ColorSpace, int[], int[], int, boolean, boolean) definition code for javax.imageio.ImageTypeSpecifier.createBanded(java.awt.color.ColorSpace, int[], int[], int, boolean, boolean)

public static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  createBanded(ColorSpace sample code for java.awt.color.ColorSpace definition code for java.awt.color.ColorSpace  colorSpace,
                                              int[] bankIndices,
                                              int[] bandOffsets,
                                              int dataType,
                                              boolean hasAlpha,
                                              boolean isAlphaPremultiplied)
Returns a specifier for a banded image format that will use a ComponentColorModel and a BandedSampleModel to store each channel in a separate array.

Parameters:
colorSpace - the desired ColorSpace.
bankIndices - an array of ints indicating the bank in which each band will be stored.
bandOffsets - an array of ints indicating the starting offset of each band within its bank.
dataType - the desired data type, as one of the enumerations from the DataBuffer class.
hasAlpha - true if an alpha channel is desired.
isAlphaPremultiplied - true if the color channels will be premultipled by the alpha channel.
Returns:
an ImageTypeSpecifier with the desired characteristics.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if colorSpace is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bankIndices is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bandOffsets is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the lengths of bankIndices and bandOffsets differ.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bandOffsets.length does not equal the number of color space components, plus 1 if hasAlpha is true.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if dataType is not one of the legal DataBuffer.TYPE_* constants.

createGrayscale sample code for javax.imageio.ImageTypeSpecifier.createGrayscale(int, int, boolean) definition code for javax.imageio.ImageTypeSpecifier.createGrayscale(int, int, boolean)

public static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  createGrayscale(int bits,
                                                 int dataType,
                                                 boolean isSigned)
Returns a specifier for a grayscale image format that will pack pixels of the given bit depth into array elements of the specified data type.

Parameters:
bits - the number of bits per gray value (1, 2, 4, 8, or 16).
dataType - the desired data type, as one of the enumerations from the DataBuffer class.
isSigned - true if negative values are to be represented.
Returns:
an ImageTypeSpecifier with the desired characteristics.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bits is not one of 1, 2, 4, 8, or 16.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if dataType is not one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_SHORT, or DataBuffer.TYPE_USHORT.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bits is larger than the bit size of the given dataType.

createGrayscale sample code for javax.imageio.ImageTypeSpecifier.createGrayscale(int, int, boolean, boolean) definition code for javax.imageio.ImageTypeSpecifier.createGrayscale(int, int, boolean, boolean)

public static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  createGrayscale(int bits,
                                                 int dataType,
                                                 boolean isSigned,
                                                 boolean isAlphaPremultiplied)
Returns a specifier for a grayscale plus alpha image format that will pack pixels of the given bit depth into array elements of the specified data type.

Parameters:
bits - the number of bits per gray value (1, 2, 4, 8, or 16).
dataType - the desired data type, as one of the enumerations from the DataBuffer class.
isSigned - true if negative values are to be represented.
isAlphaPremultiplied - true if the luminance channel will be premultipled by the alpha channel.
Returns:
an ImageTypeSpecifier with the desired characteristics.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bits is not one of 1, 2, 4, 8, or 16.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if dataType is not one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_SHORT, or DataBuffer.TYPE_USHORT.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bits is larger than the bit size of the given dataType.

createIndexed sample code for javax.imageio.ImageTypeSpecifier.createIndexed(byte[], byte[], byte[], byte[], int, int) definition code for javax.imageio.ImageTypeSpecifier.createIndexed(byte[], byte[], byte[], byte[], int, int)

public static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  createIndexed(byte[] redLUT,
                                               byte[] greenLUT,
                                               byte[] blueLUT,
                                               byte[] alphaLUT,
                                               int bits,
                                               int dataType)
Returns a specifier for an indexed-color image format that will pack index values of the given bit depth into array elements of the specified data type.

Parameters:
redLUT - an array of bytes containing the red values for each index.
greenLUT - an array of bytes containing * the green values for each index.
blueLUT - an array of bytes containing the blue values for each index.
alphaLUT - an array of bytes containing the alpha values for each index, or null to create a fully opaque LUT.
bits - the number of bits in each index.
dataType - the desired output type, as one of the enumerations from the DataBuffer class.
Returns:
an ImageTypeSpecifier with the desired characteristics.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if redLUT is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if greenLUT is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if blueLUT is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bits is not one of 1, 2, 4, 8, or 16.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the non-null LUT parameters do not have lengths of exactly 1 << bits.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if dataType is not one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bits is larger than the bit size of the given dataType.

createFromBufferedImageType sample code for javax.imageio.ImageTypeSpecifier.createFromBufferedImageType(int) definition code for javax.imageio.ImageTypeSpecifier.createFromBufferedImageType(int)

public static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  createFromBufferedImageType(int bufferedImageType)
Returns an ImageTypeSpecifier that encodes one of the standard BufferedImage types (other than TYPE_CUSTOM).

Parameters:
bufferedImageType - an int representing one of the standard BufferedImage types.
Returns:
an ImageTypeSpecifier with the desired characteristics.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if bufferedImageType is not one of the standard types, or is equal to TYPE_CUSTOM.
See Also:
BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage , BufferedImage.TYPE_INT_RGB sample code for java.awt.image.BufferedImage.TYPE_INT_RGB definition code for java.awt.image.BufferedImage.TYPE_INT_RGB , BufferedImage.TYPE_INT_ARGB sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB , BufferedImage.TYPE_INT_ARGB_PRE sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE , BufferedImage.TYPE_INT_BGR sample code for java.awt.image.BufferedImage.TYPE_INT_BGR definition code for java.awt.image.BufferedImage.TYPE_INT_BGR , BufferedImage.TYPE_3BYTE_BGR sample code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR definition code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR , BufferedImage.TYPE_4BYTE_ABGR sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR definition code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR , BufferedImage.TYPE_4BYTE_ABGR_PRE sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE definition code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE , BufferedImage.TYPE_USHORT_565_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB definition code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB , BufferedImage.TYPE_USHORT_555_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB definition code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB , BufferedImage.TYPE_BYTE_GRAY sample code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY definition code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY , BufferedImage.TYPE_USHORT_GRAY sample code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY definition code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY , BufferedImage.TYPE_BYTE_BINARY sample code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY definition code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY , BufferedImage.TYPE_BYTE_INDEXED sample code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED definition code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED

createFromRenderedImage sample code for javax.imageio.ImageTypeSpecifier.createFromRenderedImage(java.awt.image.RenderedImage) definition code for javax.imageio.ImageTypeSpecifier.createFromRenderedImage(java.awt.image.RenderedImage)

public static ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  createFromRenderedImage(RenderedImage sample code for java.awt.image.RenderedImage definition code for java.awt.image.RenderedImage  image)
Returns an ImageTypeSpecifier that encodes the layout of a RenderedImage (which may be a BufferedImage).

Parameters:
image - a RenderedImage.
Returns:
an ImageTypeSpecifier with the desired characteristics.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if image is null.

getBufferedImageType sample code for javax.imageio.ImageTypeSpecifier.getBufferedImageType() definition code for javax.imageio.ImageTypeSpecifier.getBufferedImageType()

public int getBufferedImageType()
Returns an int containing one of the enumerated constant values describing image formats from BufferedImage.

Returns:
an int representing a BufferedImage type.
See Also:
BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage , BufferedImage.TYPE_CUSTOM sample code for java.awt.image.BufferedImage.TYPE_CUSTOM definition code for java.awt.image.BufferedImage.TYPE_CUSTOM , BufferedImage.TYPE_INT_RGB sample code for java.awt.image.BufferedImage.TYPE_INT_RGB definition code for java.awt.image.BufferedImage.TYPE_INT_RGB , BufferedImage.TYPE_INT_ARGB sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB , BufferedImage.TYPE_INT_ARGB_PRE sample code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE definition code for java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE , BufferedImage.TYPE_INT_BGR sample code for java.awt.image.BufferedImage.TYPE_INT_BGR definition code for java.awt.image.BufferedImage.TYPE_INT_BGR , BufferedImage.TYPE_3BYTE_BGR sample code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR definition code for java.awt.image.BufferedImage.TYPE_3BYTE_BGR , BufferedImage.TYPE_4BYTE_ABGR sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR definition code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR , BufferedImage.TYPE_4BYTE_ABGR_PRE sample code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE definition code for java.awt.image.BufferedImage.TYPE_4BYTE_ABGR_PRE , BufferedImage.TYPE_USHORT_565_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB definition code for java.awt.image.BufferedImage.TYPE_USHORT_565_RGB , BufferedImage.TYPE_USHORT_555_RGB sample code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB definition code for java.awt.image.BufferedImage.TYPE_USHORT_555_RGB , BufferedImage.TYPE_BYTE_GRAY sample code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY definition code for java.awt.image.BufferedImage.TYPE_BYTE_GRAY , BufferedImage.TYPE_USHORT_GRAY sample code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY definition code for java.awt.image.BufferedImage.TYPE_USHORT_GRAY , BufferedImage.TYPE_BYTE_BINARY sample code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY definition code for java.awt.image.BufferedImage.TYPE_BYTE_BINARY , BufferedImage.TYPE_BYTE_INDEXED sample code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED definition code for java.awt.image.BufferedImage.TYPE_BYTE_INDEXED

getNumComponents sample code for javax.imageio.ImageTypeSpecifier.getNumComponents() definition code for javax.imageio.ImageTypeSpecifier.getNumComponents()

public int getNumComponents()
Return the number of color components specified by this object. This is the same value as returned by ColorModel.getNumComponents

Returns:
the number of components in the image.

getNumBands sample code for javax.imageio.ImageTypeSpecifier.getNumBands() definition code for javax.imageio.ImageTypeSpecifier.getNumBands()

public int getNumBands()
Return the number of bands specified by this object. This is the same value as returned by SampleModel.getNumBands

Returns:
the number of bands in the image.

getBitsPerBand sample code for javax.imageio.ImageTypeSpecifier.getBitsPerBand(int) definition code for javax.imageio.ImageTypeSpecifier.getBitsPerBand(int)

public int getBitsPerBand(int band)
Return the number of bits used to represent samples of the given band.

Parameters:
band - the index of the band to be queried, as an int.
Returns:
an int specifying a number of bits.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if band is negative or greater than the largest band index.

getSampleModel sample code for javax.imageio.ImageTypeSpecifier.getSampleModel() definition code for javax.imageio.ImageTypeSpecifier.getSampleModel()

public SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  getSampleModel()
Returns a SampleModel based on the settings encapsulated within this object. The width and height of the SampleModel will be set to arbitrary values.

Returns:
a SampleModel with arbitrary dimensions.

getSampleModel sample code for javax.imageio.ImageTypeSpecifier.getSampleModel(int, int) definition code for javax.imageio.ImageTypeSpecifier.getSampleModel(int, int)

public SampleModel sample code for java.awt.image.SampleModel definition code for java.awt.image.SampleModel  getSampleModel(int width,
                                  int height)
Returns a SampleModel based on the settings encapsulated within this object. The width and height of the SampleModel will be set to the supplied values.

Parameters:
width - the desired width of the returned SampleModel.
height - the desired height of the returned SampleModel.
Returns:
a SampleModel with the given dimensions.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if either width or height are negative or zero.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the product of width and height is greater than Integer.MAX_VALUE

getColorModel sample code for javax.imageio.ImageTypeSpecifier.getColorModel() definition code for javax.imageio.ImageTypeSpecifier.getColorModel()

public ColorModel sample code for java.awt.image.ColorModel definition code for java.awt.image.ColorModel  getColorModel()
Returns the ColorModel specified by this object.

Returns:
a ColorModel.

createBufferedImage sample code for javax.imageio.ImageTypeSpecifier.createBufferedImage(int, int) definition code for javax.imageio.ImageTypeSpecifier.createBufferedImage(int, int)

public BufferedImage sample code for java.awt.image.BufferedImage definition code for java.awt.image.BufferedImage  createBufferedImage(int width,
                                         int height)
Creates a BufferedImage with a given width and height according to the specification embodied in this object.

Parameters:
width - the desired width of the returned BufferedImage.
height - the desired height of the returned BufferedImage.
Returns:
a new BufferedImage
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if either width or height are negative or zero.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the product of width and height is greater than Integer.MAX_VALUE, or if the number of array elements needed to store the image is greater than Integer.MAX_VALUE.

equals sample code for javax.imageio.ImageTypeSpecifier.equals(java.lang.Object) definition code for javax.imageio.ImageTypeSpecifier.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  o)
Returns true if the given Object is an ImageTypeSpecifier and has a SampleModel and ColorModel that are equal to those of this object.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
o - the Object to be compared for equality.
Returns:
true if the given object is an equivalent ImageTypeSpecifier.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for javax.imageio.ImageTypeSpecifier.hashCode() definition code for javax.imageio.ImageTypeSpecifier.hashCode()

public int hashCode()
Returns the hash code for this ImageTypeSpecifier.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code for this ImageTypeSpecifier
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable