本文整理汇总了Java中java.awt.color.ColorSpace.getMaxValue方法的典型用法代码示例。如果您正苦于以下问题:Java ColorSpace.getMaxValue方法的具体用法?Java ColorSpace.getMaxValue怎么用?Java ColorSpace.getMaxValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.color.ColorSpace
的用法示例。
在下文中一共展示了ColorSpace.getMaxValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Context
import java.awt.color.ColorSpace; //导入方法依赖的package包/类
public Context(TestEnvironment env, Result result, ColorSpace cs) {
this.cs = cs;
this.env = env;
this.res = result;
numComponents = cs.getNumComponents();
val = new float[numComponents];
for (int i = 0; i < numComponents; i++) {
float min = cs.getMinValue(i);
float max = cs.getMaxValue(i);
val[i] = 0.5f * (max - min);
}
rgb = new float[]{0.5f, 0.5f, 0.5f};
cie = new float[]{0.5f, 0.5f, 0.5f};
}
示例2: DirectColorModel
import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
* Constructs a <code>DirectColorModel</code> from the specified
* parameters. Color components are in the specified
* <code>ColorSpace</code>, which must be of type ColorSpace.TYPE_RGB
* and have minimum normalized component values which are all 0.0
* and maximum values which are all 1.0.
* The masks specify which bits in an <code>int</code> pixel
* representation contain the red, green and blue color samples and
* the alpha sample, if present. If <code>amask</code> is 0, pixel
* values do not contain alpha information and all pixels are treated
* as opaque, which means that alpha = 1.0. All of the
* bits in each mask must be contiguous and fit in the specified number
* of least significant bits of an <code>int</code> pixel
* representation. If there is alpha, the <code>boolean</code>
* <code>isAlphaPremultiplied</code> specifies how to interpret
* color and alpha samples in pixel values. If the <code>boolean</code>
* is <code>true</code>, color samples are assumed to have been
* multiplied by the alpha sample. The transparency value is
* Transparency.OPAQUE, if no alpha is present, or
* Transparency.TRANSLUCENT otherwise. The transfer type
* is the type of primitive array used to represent pixel values and
* must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
* DataBuffer.TYPE_INT.
* @param space the specified <code>ColorSpace</code>
* @param bits the number of bits in the pixel values; for example,
* the sum of the number of bits in the masks.
* @param rmask specifies a mask indicating which bits in an
* integer pixel contain the red component
* @param gmask specifies a mask indicating which bits in an
* integer pixel contain the green component
* @param bmask specifies a mask indicating which bits in an
* integer pixel contain the blue component
* @param amask specifies a mask indicating which bits in an
* integer pixel contain the alpha component
* @param isAlphaPremultiplied <code>true</code> if color samples are
* premultiplied by the alpha sample; <code>false</code> otherwise
* @param transferType the type of array used to represent pixel values
* @throws IllegalArgumentException if <code>space</code> is not a
* TYPE_RGB space or if the min/max normalized component
* values are not 0.0/1.0.
*/
public DirectColorModel(ColorSpace space, int bits, int rmask,
int gmask, int bmask, int amask,
boolean isAlphaPremultiplied,
int transferType) {
super (space, bits, rmask, gmask, bmask, amask,
isAlphaPremultiplied,
amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
transferType);
if (ColorModel.isLinearRGBspace(colorSpace)) {
is_LinearRGB = true;
if (maxBits <= 8) {
lRGBprecision = 8;
tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
} else {
lRGBprecision = 16;
tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
}
} else if (!is_sRGB) {
for (int i = 0; i < 3; i++) {
// super constructor checks that space is TYPE_RGB
// check here that min/max are all 0.0/1.0
if ((space.getMinValue(i) != 0.0f) ||
(space.getMaxValue(i) != 1.0f)) {
throw new IllegalArgumentException(
"Illegal min/max RGB component value");
}
}
}
setFields();
}
示例3: DirectColorModel
import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
* Constructs a {@code DirectColorModel} from the specified
* parameters. Color components are in the specified
* {@code ColorSpace}, which must be of type ColorSpace.TYPE_RGB
* and have minimum normalized component values which are all 0.0
* and maximum values which are all 1.0.
* The masks specify which bits in an {@code int} pixel
* representation contain the red, green and blue color samples and
* the alpha sample, if present. If {@code amask} is 0, pixel
* values do not contain alpha information and all pixels are treated
* as opaque, which means that alpha = 1.0. All of the
* bits in each mask must be contiguous and fit in the specified number
* of least significant bits of an {@code int} pixel
* representation. If there is alpha, the {@code boolean}
* {@code isAlphaPremultiplied} specifies how to interpret
* color and alpha samples in pixel values. If the {@code boolean}
* is {@code true}, color samples are assumed to have been
* multiplied by the alpha sample. The transparency value is
* Transparency.OPAQUE, if no alpha is present, or
* Transparency.TRANSLUCENT otherwise. The transfer type
* is the type of primitive array used to represent pixel values and
* must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
* DataBuffer.TYPE_INT.
* @param space the specified {@code ColorSpace}
* @param bits the number of bits in the pixel values; for example,
* the sum of the number of bits in the masks.
* @param rmask specifies a mask indicating which bits in an
* integer pixel contain the red component
* @param gmask specifies a mask indicating which bits in an
* integer pixel contain the green component
* @param bmask specifies a mask indicating which bits in an
* integer pixel contain the blue component
* @param amask specifies a mask indicating which bits in an
* integer pixel contain the alpha component
* @param isAlphaPremultiplied {@code true} if color samples are
* premultiplied by the alpha sample; {@code false} otherwise
* @param transferType the type of array used to represent pixel values
* @throws IllegalArgumentException if {@code space} is not a
* TYPE_RGB space or if the min/max normalized component
* values are not 0.0/1.0.
*/
public DirectColorModel(ColorSpace space, int bits, int rmask,
int gmask, int bmask, int amask,
boolean isAlphaPremultiplied,
int transferType) {
super (space, bits, rmask, gmask, bmask, amask,
isAlphaPremultiplied,
amask == 0 ? Transparency.OPAQUE : Transparency.TRANSLUCENT,
transferType);
if (ColorModel.isLinearRGBspace(colorSpace)) {
is_LinearRGB = true;
if (maxBits <= 8) {
lRGBprecision = 8;
tosRGB8LUT = ColorModel.getLinearRGB8TosRGB8LUT();
fromsRGB8LUT8 = ColorModel.getsRGB8ToLinearRGB8LUT();
} else {
lRGBprecision = 16;
tosRGB8LUT = ColorModel.getLinearRGB16TosRGB8LUT();
fromsRGB8LUT16 = ColorModel.getsRGB8ToLinearRGB16LUT();
}
} else if (!is_sRGB) {
for (int i = 0; i < 3; i++) {
// super constructor checks that space is TYPE_RGB
// check here that min/max are all 0.0/1.0
if ((space.getMinValue(i) != 0.0f) ||
(space.getMaxValue(i) != 1.0f)) {
throw new IllegalArgumentException(
"Illegal min/max RGB component value");
}
}
}
setFields();
}