javax.imageio
Class ImageTypeSpecifier
ImageTypeSpecifier store the color and sample models associated
with an IIOImage.
static ImageTypeSpecifier | createBanded(ColorSpace colorSpace, int[] bankIndices, int[] bankOffsets, int dataType, boolean hasAlpha, boolean isAlphaPremultiplied) - Create an image type specifier for a banded image using a
component color model and a banded sample model.
|
BufferedImage | createBufferedImage(int width, int height) - Create a buffered image with the given dimensions using that has
the characteristics specified by this image type specifier.
|
static ImageTypeSpecifier | createFromBufferedImageType(int bufferedImageType) - Create an image type specifier that describes the given buffered
image type.
|
static ImageTypeSpecifier | createFromRenderedImage(RenderedImage image) - Create an image type specifier that describes the given rendered
image's type.
|
static ImageTypeSpecifier | createGrayscale(int bits, int dataType, boolean isSigned) - Create a grayscale image type specifier, given the number of
bits, data type and whether or not the data is signed.
|
static ImageTypeSpecifier | createGrayscale(int bits, int dataType, boolean isSigned, boolean isAlphaPremultiplied) - Create a grayscale image type specifier, given the number of
bits, data type and whether or not the data is signed.
|
static ImageTypeSpecifier | createIndexed(byte[] redLUT, byte[] greenLUT, byte[] blueLUT, byte[] alphaLUT, int bits, int dataType) - Return an image type specifier for an image that uses an indexed
colour model where each colour value has the specified number of
bits and type and where the colour tables are those given.
|
static ImageTypeSpecifier | createInterleaved(ColorSpace colorSpace, int[] bandOffsets, int dataType, boolean hasAlpha, boolean isAlphaPremultiplied) - Create an image type specifier that uses a component colour model
and a pixel interleaved sample model.
|
static ImageTypeSpecifier | createPacked(ColorSpace colorSpace, int redMask, int greenMask, int blueMask, int alphaMask, int transferType, boolean isAlphaPremultiplied) - Create an image type specifier using a direct color model and a
packed sample model.
|
int | getBitsPerBand(int band) - Get the number of bits per sample in the given band.
|
int | getBufferedImageType() - Get the buffered image constant specified by this image type
specifier.
|
ColorModel | getColorModel() - Get the color model specified by this image type specifier.
|
int | getNumBands() - Get the number of bands specified by this image type specifier's
sample model.
|
int | getNumComponents() - Get the number of components specified by this image type
specifier's color model.
|
SampleModel | getSampleModel() - Get the sample model specified by this image type specifier.
|
SampleModel | getSampleModel(int width, int height) - Create a sample model that is compatible with the one specified
by this image type specifier, with the given dimensions.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
ImageTypeSpecifier
public ImageTypeSpecifier(ColorModel colorModel,
SampleModel sampleModel)
Construct an image type specifier with the given models.
colorModel
- the color modelsampleModel
- the sample model
createBanded
public static ImageTypeSpecifier createBanded(ColorSpace colorSpace,
int[] bankIndices,
int[] bankOffsets,
int dataType,
boolean hasAlpha,
boolean isAlphaPremultiplied)
Create an image type specifier for a banded image using a
component color model and a banded sample model.
colorSpace
- the color spacebankIndices
- the bank indices at which each band will be
storedbankOffsets
- the starting band offset for each band within
its bankdataType
- the data type, a DataBuffer constanthasAlpha
- true if this image type specifier should have an
alpha component, false otherwiseisAlphaPremultiplied
- true if other color components should
be premultiplied by the alpha component, false otherwise
- a banded image type specifier
createBufferedImage
public BufferedImage createBufferedImage(int width,
int height)
Create a buffered image with the given dimensions using that has
the characteristics specified by this image type specifier.
width
- width of the buffered image, in pixelsheight
- the height of the buffered image, in pixels
createFromBufferedImageType
public static ImageTypeSpecifier createFromBufferedImageType(int bufferedImageType)
Create an image type specifier that describes the given buffered
image type.
bufferedImageType
- the buffered image type to represent
with the returned image type specifier
- a new image type specifier
createGrayscale
public static ImageTypeSpecifier createGrayscale(int bits,
int dataType,
boolean isSigned)
Create a grayscale image type specifier, given the number of
bits, data type and whether or not the data is signed.
bits
- the number of bits used to specify a greyscale valuedataType
- a DataBuffer type constantisSigned
- true if this type specifier should support
negative values, false otherwise
- a greyscal image type specifier
createGrayscale
public static ImageTypeSpecifier createGrayscale(int bits,
int dataType,
boolean isSigned,
boolean isAlphaPremultiplied)
Create a grayscale image type specifier, given the number of
bits, data type and whether or not the data is signed.
bits
- the number of bits used to specify a greyscale valuedataType
- a DataBuffer type constantisSigned
- true if this type specifier should support
negative values, false otherwise
- a greyscal image type specifier
createIndexed
public static ImageTypeSpecifier createIndexed(byte[] redLUT,
byte[] greenLUT,
byte[] blueLUT,
byte[] alphaLUT,
int bits,
int dataType)
Return an image type specifier for an image that uses an indexed
colour model where each colour value has the specified number of
bits and type and where the colour tables are those given.
redLUT
- the red index valuesgreenLUT
- the green index valuesblueLUT
- the blue index valuesalphaLUT
- the alpha index valuesbits
- the number of bits per index valuedataType
- the type of each index value
- an indexed image type specifier
createInterleaved
public static ImageTypeSpecifier createInterleaved(ColorSpace colorSpace,
int[] bandOffsets,
int dataType,
boolean hasAlpha,
boolean isAlphaPremultiplied)
Create an image type specifier that uses a component colour model
and a pixel interleaved sample model. Each pixel component will
be stored in a separate value of the given data type.
colorSpace
- the colour space used by the colour modelbandOffsets
- the starting band offset for each band within
its bankdataType
- the type of each pixel valuehasAlpha
- true if an alpha channel should be specified,
false otherwiseisAlphaPremultiplied
- true if other colour channels should
be premultiplied by the alpha value, false otherwise
- an interleaved image type specifier
createPacked
public static ImageTypeSpecifier createPacked(ColorSpace colorSpace,
int redMask,
int greenMask,
int blueMask,
int alphaMask,
int transferType,
boolean isAlphaPremultiplied)
Create an image type specifier using a direct color model and a
packed sample model. All pixel components will be packed into
one value of the given data type.
colorSpace
- the color space to use in the color modelredMask
- the bitmask for the red bitsgreenMask
- the bitmask for the green bitsblueMask
- the bitmask for the blue bitsalphaMask
- the bitmask for the alpha bitstransferType
- the data type used to store pixel valuesisAlphaPremultiplied
- true if other colour channels should
be premultiplied by the alpha value, false otherwise
- a packed image type specifier
getBitsPerBand
public int getBitsPerBand(int band)
Get the number of bits per sample in the given band.
band
- the band from which to get the number of bits
- the number of bits in the given band
getBufferedImageType
public int getBufferedImageType()
Get the buffered image constant specified by this image type
specifier.
- a buffered image constant
getNumBands
public int getNumBands()
Get the number of bands specified by this image type specifier's
sample model.
- the number of bands in the sample model
getNumComponents
public int getNumComponents()
Get the number of components specified by this image type
specifier's color model.
- the number of color components per pixel
getSampleModel
public SampleModel getSampleModel(int width,
int height)
Create a sample model that is compatible with the one specified
by this image type specifier, with the given dimensions.
width
- the width of the returned sample modelheight
- the height of the returned sample model
- a sample model compatible with the one in this image type
specifier, with the given dimensions
ImageTypeSpecifier.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.