📄 color space.htm
字号:
<P></P></DD></DL>
<TABLE border=0>
<TBODY>
<TR>
<TD><IMG src="Color Space.files/cistine.gif"></TD>
<TD>
<HR>
<B>API:</B> <CODE>javax.media.jai.FloatDoubleColorModel </CODE>
<HR>
</TD></TR></TBODY></TABLE><PRE><UL>
<LI>FloatDoubleColorModel(ColorSpace colorSpace, boolean hasAlpha,
boolean isAlphaPremultiplied, int transparency,
int transferType)
<P></P></LI></UL></PRE>
<DL><A name=51988>
<DT>
<DD>constructs a <CODE>FloatDoubleColorModel</CODE> from the specified
parameters.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD rowSpan=5><EM>Parameters</EM>:<EM></EM>
<P></P>
<TD><CODE>colorSpace</CODE>
<P></P>
<TD>The <CODE>ColorSpace</CODE> associated with this color model. See
<A
href="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Color.doc.html#51305">Section
5.2.2, "Color Space</A>."
<P></P>
<TR vAlign=top>
<TD><CODE>hasAlpha</CODE>
<P></P>
<TD>If true, this color model supports alpha.
<P></P>
<TR vAlign=top>
<TD><CODE>isAlphaPremultiplied</CODE>
<P></P>
<TD>If true, alpha is premultiplied.
<P></P>
<TR vAlign=top>
<TD><CODE>transparency</CODE>
<P></P>
<TD>Specifies what alpha values can be represented by this color
model. See <A
href="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Color.doc.html#51516">Section
5.3, "Transparency</A>."
<P></P>
<TR vAlign=top>
<TD><CODE>transferType</CODE>
<P></P>
<TD>Specifies the type of primitive array used to represent pixel
values. One of <CODE>DataBuffer.TYPE_FLOAT</CODE> or
<CODE>DataBuffer.TYPE_DOUBLE</CODE>.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><A name=51305>
<H3>5.2.2 <IMG src="Color Space.files/space.gif">Color Space</H3></A>The
<CODE>ColorSpace</CODE> class represents a system for measuring colors,
typically using three or more separate numeric values. For example, RGB and
CMYK are color spaces. A <CODE>ColorSpace</CODE> object serves as a color
space tag that identifies the specific color space of a <CODE>Color</CODE>
object or, through a <CODE>ColorModel</CODE> object, of an <CODE>Image</CODE>,
<CODE>BufferedImage</CODE>, or <CODE>GraphicsConfiguration</CODE>.
<P><CODE>ColorSpace</CODE> provides methods that transform <CODE>Colors</CODE>
in a specific color space to and from <CODE>sRGB</CODE> and to and from a
well-defined <CODE>CIEXYZ</CODE> color space. All <CODE>ColorSpace</CODE>
objects must be able to map a color from the represented color space into
<CODE>sRGB</CODE> and transform an <CODE>sRGB</CODE> color into the
represented color space.
<P><A
href="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Color.doc.html#51319">Table
5-1</A> lists the variables used to refer to color spaces (such as
<CODE>CS_sRGB</CODE> and <CODE>CS_CIEXYZ</CODE>) and to color space types
(such as <CODE>TYPE_RGB</CODE> and <CODE>TYPE_CMYK</CODE>).
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B><A name=51319><I>Table 5-1 </I><IMG
src="Color Space.files/sm-blank.gif" border=0> Color Space Types
</A></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TH><A name=51323>Name </A>
<TH><A name=51325>Description </A>
<TR vAlign=top>
<TD><A name=51328>CS_CIEXYZ</A><BR>
<TD><A name=51330>A widely-used, device-independent color standard
developed by the Commission Internationale de Eclairage (CIE), based on
color-matching experiments on human observers.</A><BR>
<TR vAlign=top>
<TD><A name=51333>CS_GRAY</A><BR>
<TD><A name=51335>Grayscale color space.</A><BR>
<TR vAlign=top>
<TD><A name=51338>CS_LINEAR_RGB</A><BR>
<TD><A name=51340>Linear RGB. Images that have not been previously
color-corrected.</A><BR>
<TR vAlign=top>
<TD><A name=51343>CS_PYCC</A><BR>
<TD><A name=51345>PhotoCD YCC conversion color space. A
luminance/chrominance standard for Kodak PhotoCD images.</A><BR>
<TR vAlign=top>
<TD><A name=51348>CS_sRGB</A><BR>
<TD><A name=51351>A proposed default "standard RGB" color standard for
use over the Internet.</A><BR>
<TR vAlign=top>
<TD><A name=51353>TYPE_2CLR</A><BR>
<TD><A name=51355>A generic two-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51357>TYPE_3CLR</A><BR>
<TD><A name=51359>A generic three-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51361>TYPE_4CLR</A><BR>
<TD><A name=51363>A generic four-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51365>TYPE_5CLR</A><BR>
<TD><A name=51367>A generic five-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51369>TYPE_6CLR</A><BR>
<TD><A name=51371>A generic six-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51373>TYPE_7CLR</A><BR>
<TD><A name=51375>A generic seven-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51377>TYPE_8CLR</A><BR>
<TD><A name=51379>A generic eight-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51381>TYPE_9CLR</A><BR>
<TD><A name=51383>A generic nine-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51385>TYPE_ACLR</A><BR>
<TD><A name=51387>A generic 10-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51389>TYPE_BCLR</A><BR>
<TD><A name=51391>A generic 11-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51393>TYPE_CCLR</A><BR>
<TD><A name=51395>A generic 12-component color space.</A><BR>
<TR vAlign=top>
<TD><A name=51397>TYPE_CMY</A><BR>
<TD><A name=51399>Any of the family of CMY color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51401>TYPE_CMYK</A><BR>
<TD><A name=51403>Any of the family of CMYK color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51405>TYPE_DCLR</A><BR>
<TD><A name=51407>Generic 13-component color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51409>TYPE_ECLR</A><BR>
<TD><A name=51411>Generic 14-component color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51413>TYPE_FCLR</A><BR>
<TD><A name=51415>Generic 15-component color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51417>TYPE_GRAY</A><BR>
<TD><A name=51419>Any of the family of GRAY color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51421>TYPE_HLS</A><BR>
<TD><A name=51423>Any of the family of HLS color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51425>TYPE_HSV</A><BR>
<TD><A name=51427>Any of the family of HSV color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51429>TYPE_Lab</A><BR>
<TD><A name=51431>Any of the family of Lab color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51433>TYPE_Luv</A><BR>
<TD><A name=51435>Any of the family of Luv color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51437>TYPE_RGB</A><BR>
<TD><A name=51439>Any of the family of RGB color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51441>TYPE_XYZ</A><BR>
<TD><A name=51443>Any of the family of XYZ color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51445>TYPE_YCbCr</A><BR>
<TD><A name=51447>Any of the family of YCbCr color spaces.</A><BR>
<TR vAlign=top>
<TD><A name=51449>TYPE_Yxy</A><BR>
<TD><A name=51451>Any of the family of Yxy color
spaces.</A><BR></TR></TBODY></TABLE>
<P>Conversion between Java color spaces is simplified by a set of methods that
map a color from a represented color space to either sRGB or CIEXYZ and
transform a sRGB or CIEXYZ color space to the represented color space. There
are four methods:
<P>
<UL>
<LI>The <CODE>toRGB</CODE> method transforms a <CODE>Color</CODE> in the
represented color space to a <CODE>Color</CODE> in sRGB.
<P></P></LI></UL>
<UL>
<LI>The <CODE>toCIEXYZ</CODE> method transforms a <CODE>Color</CODE> in the
represented color space to a <CODE>Color</CODE> in CIEXYZ.
<P></P></LI></UL>
<UL>
<LI>The <CODE>fromRGB</CODE> method takes a <CODE>Color</CODE> in sRGB and
transforms into the represented color space.
<P></P></LI></UL>
<UL>
<LI>The <CODE>fromCIEXYZ</CODE> method takes a <CODE>Color</CODE> in CIEXYZ
and transforms into the represented color space.
<P></P></LI></UL>The sRGB (which stands for "standard" RGB) color space is
provided as a convenience to programmers, since many applications are
primarily concerned with RGB images. Defining a standard RGB color space makes
writing such applications easier. The <CODE>toRGB</CODE> and
<CODE>fromRGB</CODE> methods are provided so that developers can easily
retrieve colors in this standard space. However, the sRGB color space is not
intended for use with highly accurate color correction or conversions.
<P>The sRGB color space is somewhat limited in that it cannot represent every
color in the full gamut (spectrum of representable colors) of CIEXYZ color. If
a color is specified in some space that has a different gammut than sRGB,
using sRGB as an intermediate color space results in a loss of information.
The CIEXYZ color space is used as an intermediate color space to avoid any
loss of color quality. The CIEXYZ color space is known as the <EM>conversion
space</EM> for this reason. The <CODE>toCIEXYZ</CODE> and
<CODE>fromCIEXYZ</CODE> methods support conversions between any two color
spaces at a reasonably high degree of accuracy, one color at a time.
<P>
<TABLE border=0>
<TBODY>
<TR>
<TD><IMG src="Color Space.files/cistine.gif"></TD>
<TD>
<HR>
<B>API:</B> <CODE>java.awt.color.ColorSpace </CODE>
<HR>
</TD></TR></TBODY></TABLE><PRE><UL>
<LI>abstract float[] toRGB(float[] colorvalue)
<P></P></LI></UL></PRE>
<DL><A name=51468>
<DT>
<DD>transforms a color value assumed to be in this <CODE>ColorSpace</CODE>
into a value in the default <CODE>CS_sRGB</CODE> color space.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameter</EM>:<EM></EM>
<P></P>
<TD><CODE>colorvalue</CODE>
<P></P>
<TD>A float array with length of at least the number of components in
this <CODE>ColorSpace</CODE>.<CODE></CODE>
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>abstract float[] fromRGB(float[] rgbvalue)
<P></P></LI></UL></PRE>
<DL><A name=51477>
<DT>
<DD>transforms a color value assumed to be in the default
<CODE>CS_sRGB</CODE> color space into this <CODE>ColorSpace</CODE>.
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TD><EM>Parameter</EM>:
<P></P>
<TD><CODE>rgbvalue</CODE>
<P></P>
<TD>A float array with length of at least 3.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>abstract float[] toCIEXYZ(float[] colorvalue)
<P></P></LI></UL></PRE>
<DL><A name=51486>
<DT>
<DD>transforms a color value assumed to be in this <CODE>ColorSpace</CODE>
into the <CODE>CS_CIEXYZ</CODE> conversion color space. </A>
<P></P></DD></DL><PRE><UL>
<LI>abstract float[] fromCIEXYZ(float[] colorvalue)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -