public class ImageTypeSpecifier extends Object
SampleModel和
ColorModel)是一个方便的方式指定。
| Modifier and Type | Field and Description |
|---|---|
protected ColorModel |
colorModel
的
ColorModel作为原型。
|
protected SampleModel |
sampleModel
一个
SampleModel作为原型。
|
| Constructor and Description |
|---|
ImageTypeSpecifier(ColorModel colorModel, SampleModel sampleModel)
构建了一个
ImageTypeSpecifier直接从
ColorModel和
SampleModel。
|
ImageTypeSpecifier(RenderedImage image)
构建了一个从
RenderedImage
ImageTypeSpecifier。
|
| Modifier and Type | Method and Description |
|---|---|
static ImageTypeSpecifier |
createBanded(ColorSpace colorSpace, int[] bankIndices, int[] bandOffsets, int dataType, boolean hasAlpha, boolean isAlphaPremultiplied)
返回一个带状的图像格式,将使用一个
ComponentColorModel和
BandedSampleModel存储每个通道在一个独立的数组说明符。
|
BufferedImage |
createBufferedImage(int width, int height)
创建一个
BufferedImage与给定的宽度和高度根据体现在这个对象的规范。
|
static ImageTypeSpecifier |
createFromBufferedImageType(int bufferedImageType)
返回一个
ImageTypeSpecifier编码标准之一
BufferedImage类型(除了
TYPE_CUSTOM)。
|
static ImageTypeSpecifier |
createFromRenderedImage(RenderedImage image)
返回一个
ImageTypeSpecifier编码一个
RenderedImage布局(这可能是一个
BufferedImage)。
|
static ImageTypeSpecifier |
createGrayscale(int bits, int dataType, boolean isSigned)
返回一个用于灰度图像的格式,将给定的比特深度为指定的数据类型说明符数组元素的像素。
|
static ImageTypeSpecifier |
createGrayscale(int bits, int dataType, boolean isSigned, boolean isAlphaPremultiplied)
返回一个灰度加α的图像格式,将给定的比特深度为指定的数据类型说明符数组元素的像素。
|
static ImageTypeSpecifier |
createIndexed(byte[] redLUT, byte[] greenLUT, byte[] blueLUT, byte[] alphaLUT, int bits, int dataType)
返回一个索引颜色的图像格式,将给定的比特深度为指定的数据类型说明符数组元素的索引值。
|
static ImageTypeSpecifier |
createInterleaved(ColorSpace colorSpace, int[] bandOffsets, int dataType, boolean hasAlpha, boolean isAlphaPremultiplied)
返回一个交错的图像格式,将使用一个
ComponentColorModel和
PixelInterleavedSampleModel存储每个像素组成短一个单独的字节说明符或int。
|
static ImageTypeSpecifier |
createPacked(ColorSpace colorSpace, int redMask, int greenMask, int blueMask, int alphaMask, int transferType, boolean isAlphaPremultiplied)
返回一个填充的图像格式,将使用一个
DirectColorModel和填充
SampleModel存储每个像素填充到一个单字节,短的说明符或int。
|
boolean |
equals(Object o)
返回
true如果给定的
Object是
ImageTypeSpecifier具有
SampleModel和
ColorModel等于这些对象。
|
int |
getBitsPerBand(int band)
返回用于表示给定带的样本的比特数。
|
int |
getBufferedImageType()
返回一个int包含一个枚举常量的值从
BufferedImage描述图像格式。
|
ColorModel |
getColorModel()
返回指定对象的
ColorModel。
|
int |
getNumBands()
返回由该对象指定的条带数。
|
int |
getNumComponents()
返回由该对象指定的颜色组件的数量。
|
SampleModel |
getSampleModel()
返回一个
SampleModel基于设置封装在这个对象。
|
SampleModel |
getSampleModel(int width, int height)
返回一个
SampleModel基于设置封装在这个对象。
|
int |
hashCode()
返回此imagetypespecifier哈希代码。
|
protected ColorModel colorModel
ColorModel作为原型。
protected SampleModel sampleModel
SampleModel作为原型。
public ImageTypeSpecifier(ColorModel colorModel, SampleModel sampleModel)
ImageTypeSpecifier直接从
ColorModel和
SampleModel。它是调用方的责任,提供兼容的参数。
colorModel -
ColorModel。
sampleModel -
SampleModel。
IllegalArgumentException如果任一参数是
null。
IllegalArgumentException -如果
sampleModel不兼容
colorModel。
public ImageTypeSpecifier(RenderedImage image)
RenderedImage
ImageTypeSpecifier。如果一个
BufferedImage正在使用一个工厂方法
createFromRenderedImage或
createFromBufferedImageType应使用而不是为了得到更精确的结果。
image -
RenderedImage。
IllegalArgumentException -如果参数是
null。
public static ImageTypeSpecifier createPacked(ColorSpace colorSpace, int redMask, int greenMask, int blueMask, int alphaMask, int transferType, boolean isAlphaPremultiplied)
DirectColorModel和填充
SampleModel存储每个像素填充到一个单字节,短的说明符或int。
colorSpace -所需的
ColorSpace。
redMask -连续掩码显示红色通道的位置。
greenMask -连续掩码表示绿色通道的位置。
blueMask -连续掩码表示的蓝色通道的位置。
alphaMask -连续掩码表示的alpha通道的位置。
transferType -所需的
SampleModel转移型。
isAlphaPremultiplied -
true如果颜色通道将premultipled通过Alpha通道。
ImageTypeSpecifier。
null
colorSpace
IllegalArgumentException。
colorSpace
IllegalArgumentException类型不是
TYPE_RGB。
IllegalArgumentException -如果没有面具有至少1位。
IllegalArgumentException -如果
transferType如果没有一个
DataBuffer.TYPE_BYTE,
DataBuffer.TYPE_USHORT,或
DataBuffer.TYPE_INT。
public static ImageTypeSpecifier createInterleaved(ColorSpace colorSpace, int[] bandOffsets, int dataType, boolean hasAlpha, boolean isAlphaPremultiplied)
ComponentColorModel和
PixelInterleavedSampleModel存储每个像素组成短一个单独的字节说明符或int。
colorSpace -所需的
ColorSpace。
bandOffsets -
ints指示每个波段的偏移量数组。
dataType -所需的数据类型,作为一个从
DataBuffer类的枚举。
hasAlpha -
true如果alpha通道所需的。
isAlphaPremultiplied -
true如果颜色通道将premultipled通过Alpha通道。
ImageTypeSpecifier。
null
colorSpace
IllegalArgumentException。
null
bandOffsets
IllegalArgumentException。
IllegalArgumentException -如果
dataType不是一个法律
DataBuffer.TYPE_*常数。
IllegalArgumentException -如果
bandOffsets.length并不等于颜色空间的分量数,加1,如果
hasAlpha是
true。
public static ImageTypeSpecifier createBanded(ColorSpace colorSpace, int[] bankIndices, int[] bandOffsets, int dataType, boolean hasAlpha, boolean isAlphaPremultiplied)
ComponentColorModel和
BandedSampleModel存储每个通道在一个独立的数组说明符。
colorSpace -所需的
ColorSpace。
bankIndices -一系列
ints指示银行在每个乐队将存储。
bandOffsets -
ints指示起始偏移每个乐队在其银行的数组。
dataType -所需的数据类型,作为一个从
DataBuffer类的枚举。
hasAlpha -
true如果alpha通道所需的。
isAlphaPremultiplied -
true如果颜色通道将premultipled通过Alpha通道。
ImageTypeSpecifier。
null
colorSpace
IllegalArgumentException。
null
bankIndices
IllegalArgumentException。
null
bandOffsets
IllegalArgumentException。
IllegalArgumentException -如果
bankIndices和
bandOffsets长度不同。
IllegalArgumentException -如果
bandOffsets.length并不等于颜色空间的分量数,加1,如果
hasAlpha是
true。
IllegalArgumentException -如果
dataType不是一个法律
DataBuffer.TYPE_*常数。
public static ImageTypeSpecifier createGrayscale(int bits, int dataType, boolean isSigned)
bits -每个灰度值的位数(1,2,4,8,或16)。
dataType -所需的数据类型,作为一个从
DataBuffer类的枚举。
isSigned -
true如果负值来表示。
ImageTypeSpecifier。
IllegalArgumentException -如果
bits是不是1,2,4,8,或16。
IllegalArgumentException -如果
dataType不是一
DataBuffer.TYPE_BYTE,
DataBuffer.TYPE_SHORT,或
DataBuffer.TYPE_USHORT。
IllegalArgumentException -如果
bits大于给定的
dataType钻头尺寸。
public static ImageTypeSpecifier createGrayscale(int bits, int dataType, boolean isSigned, boolean isAlphaPremultiplied)
bits -每个灰度值的位数(1,2,4,8,或16)。
dataType -所需的数据类型,作为一个从
DataBuffer类的枚举。
isSigned -
true如果负值来表示。
isAlphaPremultiplied -
true如果亮度通道将premultipled通过Alpha通道。
ImageTypeSpecifier。
IllegalArgumentException -如果
bits是不是1,2,4,8,或16。
IllegalArgumentException -如果
dataType不是一
DataBuffer.TYPE_BYTE,
DataBuffer.TYPE_SHORT,或
DataBuffer.TYPE_USHORT。
IllegalArgumentException -如果
bits大于给定的
dataType钻头尺寸。
public static ImageTypeSpecifier createIndexed(byte[] redLUT, byte[] greenLUT, byte[] blueLUT, byte[] alphaLUT, int bits, int dataType)
redLUT -含各指标值的数组
bytes红。
greenLUT -含*各指标的绿色价值观
bytes数组。
blueLUT -含各指标值的数组
bytes蓝。
alphaLUT -含各指数α值
bytes数组,或
null创建一个完全不透明的LUT。
bits在每个指标的比特数。
dataType -期望的输出类型,作为一个从
DataBuffer类的枚举。
ImageTypeSpecifier。
null
redLUT
IllegalArgumentException。
null
greenLUT
IllegalArgumentException。
null
blueLUT
IllegalArgumentException。
IllegalArgumentException -如果
bits是不是1,2,4,8,或16。
IllegalArgumentException -如果非
null LUT参数不准确
1 << bits长度。
IllegalArgumentException -如果
dataType不是一
DataBuffer.TYPE_BYTE,
DataBuffer.TYPE_SHORT,
DataBuffer.TYPE_USHORT,或
DataBuffer.TYPE_INT。
IllegalArgumentException -如果
bits大于给定的
dataType钻头尺寸。
public static ImageTypeSpecifier createFromBufferedImageType(int bufferedImageType)
ImageTypeSpecifier编码标准之一
BufferedImage类型(除了
TYPE_CUSTOM)。
bufferedImageType代表一个标准的
BufferedImage类型int。
ImageTypeSpecifier。
IllegalArgumentException -如果
bufferedImageType不是一个标准的类型,或等于
TYPE_CUSTOM。
BufferedImage,
BufferedImage.TYPE_INT_RGB,
BufferedImage.TYPE_INT_ARGB,
BufferedImage.TYPE_INT_ARGB_PRE,
BufferedImage.TYPE_INT_BGR,
BufferedImage.TYPE_3BYTE_BGR,
BufferedImage.TYPE_4BYTE_ABGR,
BufferedImage.TYPE_4BYTE_ABGR_PRE,
BufferedImage.TYPE_USHORT_565_RGB,
BufferedImage.TYPE_USHORT_555_RGB,
BufferedImage.TYPE_BYTE_GRAY,
BufferedImage.TYPE_USHORT_GRAY,
BufferedImage.TYPE_BYTE_BINARY,
BufferedImage.TYPE_BYTE_INDEXED
public static ImageTypeSpecifier createFromRenderedImage(RenderedImage image)
ImageTypeSpecifier编码一个
RenderedImage布局(这可能是一个
BufferedImage)。
image -
RenderedImage。
ImageTypeSpecifier。
null
image
IllegalArgumentException。
public int getBufferedImageType()
BufferedImage描述图像格式。
BufferedImage型
int。
BufferedImage,
BufferedImage.TYPE_CUSTOM,
BufferedImage.TYPE_INT_RGB,
BufferedImage.TYPE_INT_ARGB,
BufferedImage.TYPE_INT_ARGB_PRE,
BufferedImage.TYPE_INT_BGR,
BufferedImage.TYPE_3BYTE_BGR,
BufferedImage.TYPE_4BYTE_ABGR,
BufferedImage.TYPE_4BYTE_ABGR_PRE,
BufferedImage.TYPE_USHORT_565_RGB,
BufferedImage.TYPE_USHORT_555_RGB,
BufferedImage.TYPE_BYTE_GRAY,
BufferedImage.TYPE_USHORT_GRAY,
BufferedImage.TYPE_BYTE_BINARY,
BufferedImage.TYPE_BYTE_INDEXED
public int getNumComponents()
ColorModel.getNumComponents
public int getNumBands()
SampleModel.getNumBands
public int getBitsPerBand(int band)
band -乐队要查询的索引,为int型。
IllegalArgumentException -如果
band阴性或大于最大的波段指数。
public SampleModel getSampleModel()
SampleModel基于设置封装在这个对象。
SampleModel的高度和宽度将设置为任意值。
SampleModel。
public SampleModel getSampleModel(int width, int height)
SampleModel基于设置封装在这个对象。
SampleModel的高度和宽度将设置为提供的值。
width -返回的
SampleModel所需宽度。
height -返回的
SampleModel所期望的高度。
SampleModel。
IllegalArgumentException -如果
width或
height是负数或零。
IllegalArgumentException -如果
width和
height产品大于
Integer.MAX_VALUE
public ColorModel getColorModel()
ColorModel。
ColorModel。
public BufferedImage createBufferedImage(int width, int height)
BufferedImage与给定的宽度和高度根据体现在这个对象的规范。
width -返回的
BufferedImage所需宽度。
height -返回的
BufferedImage所期望的高度。
BufferedImage
IllegalArgumentException -如果
width或
height是负数或零。
IllegalArgumentException -如果
width和
height产品大于
Integer.MAX_VALUE,或如果数组元素需要存储图像的数量大于
Integer.MAX_VALUE。
public boolean equals(Object o)
true如果给定的
Object是
ImageTypeSpecifier具有
SampleModel和
ColorModel等于这些对象。
equals 方法重写,继承类
Object
o -
Object是比较平等。
true如果给定的对象是一个相当
ImageTypeSpecifier。
Object.hashCode(),
HashMap
public int hashCode()
hashCode 方法重写,继承类
Object
Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.