Home » openjdk-7 » javax » imageio » [javadoc | source]
javax.imageio
public class: ImageTypeSpecifier [javadoc | source]
java.lang.Object
   javax.imageio.ImageTypeSpecifier

Direct Known Subclasses:
    Grayscale, Packed, Indexed, Interleaved, Banded

A class that allows the format of an image (in particular, its SampleModel and ColorModel) to be specified in a convenient manner.
Nested Class Summary:
static class  ImageTypeSpecifier.Packed   
static class  ImageTypeSpecifier.Interleaved   
static class  ImageTypeSpecifier.Banded   
static class  ImageTypeSpecifier.Grayscale   
static class  ImageTypeSpecifier.Indexed   
Field Summary
protected  ColorModel colorModel    The ColorModel to be used as a prototype. 
protected  SampleModel sampleModel    A SampleModel to be used as a prototype. 
Constructor:
 public ImageTypeSpecifier(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 - if the argument is null.
    exception: IllegalArgumentException - if the argument is null.
 public ImageTypeSpecifier(ColorModel colorModel,
    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 - if either parameter is null.
    IllegalArgumentException - if sampleModel is not compatible with colorModel.
    exception: IllegalArgumentException - if either parameter is null.
    exception: IllegalArgumentException - if sampleModel is not compatible with colorModel.
Method from javax.imageio.ImageTypeSpecifier Summary:
createBanded,   createBufferedImage,   createComponentCM,   createFromBufferedImageType,   createFromRenderedImage,   createGrayscale,   createGrayscale,   createIndexed,   createInterleaved,   createPacked,   equals,   getBitsPerBand,   getBufferedImageType,   getColorModel,   getNumBands,   getNumComponents,   getSampleModel,   getSampleModel,   hashCode
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.imageio.ImageTypeSpecifier Detail:
 public static ImageTypeSpecifier createBanded(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.
 public BufferedImage createBufferedImage(int width,
    int height) 
    Creates a BufferedImage with a given width and height according to the specification embodied in this object.
 static ColorModel createComponentCM(ColorSpace colorSpace,
    int numBands,
    int dataType,
    boolean hasAlpha,
    boolean isAlphaPremultiplied) 
 public static ImageTypeSpecifier createFromBufferedImageType(int bufferedImageType) 
    Returns an ImageTypeSpecifier that encodes one of the standard BufferedImage types (other than TYPE_CUSTOM).
 public static ImageTypeSpecifier createFromRenderedImage(RenderedImage image) 
    Returns an ImageTypeSpecifier that encodes the layout of a RenderedImage (which may be a BufferedImage).
 public static 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.
 public static 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.
 public static 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.
 public static ImageTypeSpecifier createInterleaved(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.
 public static ImageTypeSpecifier createPacked(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.
 public boolean equals(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.
 public int getBitsPerBand(int band) 
    Return the number of bits used to represent samples of the given band.
 public int getBufferedImageType() 
    Returns an int containing one of the enumerated constant values describing image formats from BufferedImage.
 public ColorModel getColorModel() 
    Returns the ColorModel specified by this object.
 public int getNumBands() 
    Return the number of bands specified by this object. This is the same value as returned by SampleModel.getNumBands
 public int getNumComponents() 
    Return the number of color components specified by this object. This is the same value as returned by ColorModel.getNumComponents
 public 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.
 public 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.
 public int hashCode() 
    Returns the hash code for this ImageTypeSpecifier.