📄 directcolormodel.html
字号:
</TR></TABLE> <A NAME="methods_inherited_from_class_java.awt.image.ColorModel"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.awt.image.<A HREF="../../../java/awt/image/ColorModel.html">ColorModel</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/awt/image/ColorModel.html#finalize()">finalize</A>, <A HREF="../../../java/awt/image/ColorModel.html#getColorSpace()">getColorSpace</A>, <A HREF="../../../java/awt/image/ColorModel.html#getComponentSize()">getComponentSize</A>, <A HREF="../../../java/awt/image/ColorModel.html#getComponentSize(int)">getComponentSize</A>, <A HREF="../../../java/awt/image/ColorModel.html#getNormalizedComponents(int[], int, float[], int)">getNormalizedComponents</A>, <A HREF="../../../java/awt/image/ColorModel.html#getNumColorComponents()">getNumColorComponents</A>, <A HREF="../../../java/awt/image/ColorModel.html#getNumComponents()">getNumComponents</A>, <A HREF="../../../java/awt/image/ColorModel.html#getPixelSize()">getPixelSize</A>, <A HREF="../../../java/awt/image/ColorModel.html#getRGBdefault()">getRGBdefault</A>, <A HREF="../../../java/awt/image/ColorModel.html#getTransferType()">getTransferType</A>, <A HREF="../../../java/awt/image/ColorModel.html#getTransparency()">getTransparency</A>, <A HREF="../../../java/awt/image/ColorModel.html#getUnnormalizedComponents(float[], int, int[], int)">getUnnormalizedComponents</A>, <A HREF="../../../java/awt/image/ColorModel.html#hasAlpha()">hasAlpha</A>, <A HREF="../../../java/awt/image/ColorModel.html#hashCode()">hashCode</A>, <A HREF="../../../java/awt/image/ColorModel.html#isAlphaPremultiplied()">isAlphaPremultiplied</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DirectColorModel(int, int, int, int)"><!-- --></A><H3>DirectColorModel</H3><PRE>public <B>DirectColorModel</B>(int bits, int rmask, int gmask, int bmask)</PRE><DL><DD>Constructs a <code>DirectColorModel</code> from the specified masks that indicate which bits in an <code>int</code> pixel representation contain the red, green and blue color samples. As pixel values do not contain alpha information, 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. The <code>ColorSpace</code> is the default sRGB space. The transparency value is Transparency.OPAQUE. The transfer type is the smallest of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT that can hold a single pixel.<DD><DL><DT><B>Parameters:</B><DD><CODE>bits</CODE> - the number of bits in the pixel values; for example, the sum of the number of bits in the masks.<DD><CODE>rmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the red component<DD><CODE>gmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the green component<DD><CODE>bmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the blue component</DL></DD></DL><HR><A NAME="DirectColorModel(int, int, int, int, int)"><!-- --></A><H3>DirectColorModel</H3><PRE>public <B>DirectColorModel</B>(int bits, int rmask, int gmask, int bmask, int amask)</PRE><DL><DD>Constructs a <code>DirectColorModel</code> from the specified masks that indicate 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. Alpha, if present, is not premultiplied. The <code>ColorSpace</code> is the default sRGB space. The transparency value is Transparency.OPAQUE if no alpha is present, or Transparency.TRANSLUCENT otherwise. The transfer type is the smallest of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT that can hold a single pixel.<DD><DL><DT><B>Parameters:</B><DD><CODE>bits</CODE> - the number of bits in the pixel values; for example, the sum of the number of bits in the masks.<DD><CODE>rmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the red component<DD><CODE>gmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the green component<DD><CODE>bmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the blue component<DD><CODE>amask</CODE> - specifies a mask indicating which bits in an integer pixel contain the alpha component</DL></DD></DL><HR><A NAME="DirectColorModel(java.awt.color.ColorSpace, int, int, int, int, int, boolean, int)"><!-- --></A><H3>DirectColorModel</H3><PRE>public <B>DirectColorModel</B>(<A HREF="../../../java/awt/color/ColorSpace.html">ColorSpace</A> space, int bits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType)</PRE><DL><DD>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. 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.<DD><DL><DT><B>Parameters:</B><DD><CODE>space</CODE> - the specified <code>ColorSpace</code><DD><CODE>bits</CODE> - the number of bits in the pixel values; for example, the sum of the number of bits in the masks.<DD><CODE>rmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the red component<DD><CODE>gmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the green component<DD><CODE>bmask</CODE> - specifies a mask indicating which bits in an integer pixel contain the blue component<DD><CODE>amask</CODE> - specifies a mask indicating which bits in an integer pixel contain the alpha component<DD><CODE>isAlphaPremultiplied</CODE> - <code>true</code> if color samples are premultiplied by the alpha sample; <code>false</code> otherwise<DD><CODE>transferType</CODE> - the type of array used to represent pixel values</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getRedMask()"><!-- --></A><H3>getRedMask</H3><PRE>public final int <B>getRedMask</B>()</PRE><DL><DD>Returns the mask indicating which bits in an <code>int</code> pixel representation contain the red color component.<DD><DL><DT><B>Returns:</B><DD>the mask, which indicates which bits of the <code>int</code> pixel representation contain the red color sample.</DL></DD></DL><HR><A NAME="getGreenMask()"><!-- --></A><H3>getGreenMask</H3><PRE>public final int <B>getGreenMask</B>()</PRE><DL><DD>Returns the mask indicating which bits in an <code>int</code> pixel representation contain the green color component.<DD><DL><DT><B>Returns:</B><DD>the mask, which indicates which bits of the <code>int</code> pixel representation contain the green color sample.</DL></DD></DL><HR><A NAME="getBlueMask()"><!-- --></A><H3>getBlueMask</H3><PRE>public final int <B>getBlueMask</B>()</PRE><DL><DD>Returns the mask indicating which bits in an <code>int</code> pixel representation contain the blue color component.<DD><DL><DT><B>Returns:</B><DD>the mask, which indicates which bits of the <code>int</code> pixel representation contain the blue color sample.</DL></DD></DL><HR><A NAME="getAlphaMask()"><!-- --></A><H3>getAlphaMask</H3><PRE>public final int <B>getAlphaMask</B>()</PRE><DL><DD>Returns the mask indicating which bits in an <code>int</code> pixel representation contain the alpha component.<DD><DL><DT><B>Returns:</B><DD>the mask, which indicates which bits of the <code>int</code> pixel representation contain the alpha sample.</DL></DD></DL><HR><A NAME="getRed(int)"><!-- --></A><H3>getRed</H3><PRE>public final int <B>getRed</B>(int pixel)</PRE><DL><DD>Returns the red color component for the specified pixel, scaled from 0 to 255 in the default RGB <code>ColorSpace</code>, sRGB. A color conversion is done if necessary. The pixel value is specified as an <code>int</code>. The returned value is a non pre-multiplied value. Thus, if the alpha is premultiplied, this method divides it out before returning the value. If the alpha value is 0, for example, the red value is 0.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#getRed(int)">getRed</A></CODE> in class <CODE><A HREF="../../../java/awt/image/ColorModel.html">ColorModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pixel</CODE> - the specified pixel<DT><B>Returns:</B><DD>the red color component for the specified pixel, from 0 to 255 in the sRGB <code>ColorSpace</code>.</DL></DD></DL><HR><A NAME="getGreen(int)"><!-- --></A><H3>getGreen</H3><PRE>public final int <B>getGreen</B>(int pixel)</PRE><DL><DD>Returns the green color component for the specified pixel, scaled from 0 to 255 in the default RGB <code>ColorSpace</code>, sRGB. A color conversion is done if necessary. The pixel value is specified as an <code>int</code>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -