colormodel.html

来自「API資料大全」· HTML 代码 · 共 1,326 行 · 第 1/5 页

HTML
1,326
字号
<TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#getTransferType()">getTransferType</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the transfer type of this <code>ColorModel</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#getTransparency()">getTransparency</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the transparency.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#getUnnormalizedComponents(float[], int, int[], int)">getUnnormalizedComponents</A></B>(float[]&nbsp;normComponents,                          int&nbsp;normOffset,                          int[]&nbsp;components,                          int&nbsp;offset)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of all of the color/alpha components in unnormalized form, given a normalized component array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#hasAlpha()">hasAlpha</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether or not alpha is supported in this  <code>ColorModel</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#hashCode()">hashCode</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the hash code for this ColorModel.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#isAlphaPremultiplied()">isAlphaPremultiplied</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether or not the alpha has been premultiplied in the pixel values to be translated by this <code>ColorModel</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#isCompatibleRaster(java.awt.image.Raster)">isCompatibleRaster</A></B>(<A HREF="../../../java/awt/image/Raster.html">Raster</A>&nbsp;raster)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if <code>raster</code> is compatible with this <code>ColorModel</code> and <code>false</code> if it is not.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#isCompatibleSampleModel(java.awt.image.SampleModel)">isCompatibleSampleModel</A></B>(<A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A>&nbsp;sm)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the <code>SampleModel</code> is compatible with this <code>ColorModel</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../java/awt/image/ColorModel.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>String</code> representation of the contents of this <code>ColorModel</code>object.</TD></TR></TABLE>&nbsp;<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>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="pixel_bits"><!-- --></A><H3>pixel_bits</H3><PRE>protected int <B>pixel_bits</B></PRE><DL><DD>The total number of bits in the pixel.</DL><HR><A NAME="transferType"><!-- --></A><H3>transferType</H3><PRE>protected int <B>transferType</B></PRE><DL><DD>Data type of the array used to represent pixel values.</DL><!-- ========= 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="ColorModel(int)"><!-- --></A><H3>ColorModel</H3><PRE>public <B>ColorModel</B>(int&nbsp;bits)</PRE><DL><DD>Constructs a <code>ColorModel</code> that translates pixels of the specified number of bits to color/alpha components.  The color space is the default RGB <code>ColorSpace</code>, which is sRGB. Pixel values are assumed to include alpha information.  If color and alpha information are represented in the pixel value as separate spatial bands, the color bands are assumed not to be premultiplied with the alpha value. The transparency type is java.awt.Transparency.TRANSLUCENT.  The transfer type will be the smallest of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,  or DataBuffer.TYPE_INT that can hold a single pixel  (or DataBuffer.TYPE_UNDEFINED if bits is greater than 32).  Since this constructor has no information about the number of bits per color and alpha component, any subclass calling this constructor should override any method that requires this information.<DD><DL><DT><B>Parameters:</B><DD><CODE>bits</CODE> - the number of bits of a pixel<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the number 		of bits in <code>bits</code> is less than 1</DL></DD></DL><HR><A NAME="ColorModel(int, int[], java.awt.color.ColorSpace, boolean, boolean, int, int)"><!-- --></A><H3>ColorModel</H3><PRE>protected <B>ColorModel</B>(int&nbsp;pixel_bits,                     int[]&nbsp;bits,                     <A HREF="../../../java/awt/color/ColorSpace.html">ColorSpace</A>&nbsp;cspace,                     boolean&nbsp;hasAlpha,                     boolean&nbsp;isAlphaPremultiplied,                     int&nbsp;transparency,                     int&nbsp;transferType)</PRE><DL><DD>Constructs a <code>ColorModel</code> that translates pixel values to color/alpha components.  Color components will be in the specified <code>ColorSpace</code>. <code>pixel_bits</code> is the number of bits in the pixel values.  The bits array specifies the number of significant bits per color and alpha component. Its length should be the number of components in the  <code>ColorSpace</code> if there is no alpha information in the pixel values, or one more than this number if there is alpha information.  <code>hasAlpha</code> indicates whether or not alpha information is present.  The <code>boolean</code>  <code>isAlphaPremultiplied</code> specifies how to interpret pixel values in which color and alpha information are represented as separate spatial bands.  If the <code>boolean</code> is <code>true</code>, color samples are assumed to have been multiplied by the alpha sample.  The <code>transparency</code>  specifies what alpha values can be represented by this color model. The transfer type is the type of primitive array used to represent pixel values.  Note that the bits array contains the number of significant bits per color/alpha component after the translation from pixel values.  For example, for an <code>IndexColorModel</code> with <code>pixel_bits</code> equal to 16, the bits array might have four elements with each element set to 8.<DD><DL><DT><B>Parameters:</B><DD><CODE>pixel_bits</CODE> - the number of bits in the pixel values<DD><CODE>bits</CODE> - array that specifies the number of significant bits		per color and alpha component<DD><CODE>cspace</CODE> - the specified <code>ColorSpace</code><DD><CODE>hasAlpha</CODE> - <code>true</code> if alpha information is present;		<code>false</code> otherwise<DD><CODE>isAlphaPremultiplied</CODE> - <code>true</code> if color samples are		assumed to be premultiplied by the alpha samples;		<code>false</code> otherwise<DD><CODE>transparency</CODE> - what alpha values can be represented by this		color model<DD><CODE>transferType</CODE> - the type of the array used to represent pixel		values<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the length of		the bit array is less than the number of color or alpha		components in this <code>ColorModel</code>, or if the          transparency is not a valid value.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/Transparency.html"><CODE>Transparency</CODE></A></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="getRGBdefault()"><!-- --></A><H3>getRGBdefault</H3><PRE>public static <A HREF="../../../java/awt/image/ColorModel.html">ColorModel</A> <B>getRGBdefault</B>()</PRE><DL><DD>Returns a <code>DirectColorModel</code> that describes the default format for integer RGB values used in many of the methods in the AWT image interfaces for the convenience of the programmer. The color space is the default <A HREF="../../../java/awt/color/ColorSpace.html"><CODE>ColorSpace</CODE></A>, sRGB. The format for the RGB values is an integer with 8 bits each of alpha, red, green, and blue color components ordered correspondingly from the most significant byte to the least significant byte, as in:  0xAARRGGBB.  Color components are not premultiplied by the alpha component.  This format does not necessarily represent the native or the most efficient <code>ColorModel</code> for a particular device or for all images. It is merely used as a common color model format.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>DirectColorModel</code>object describing default		RGB values.</DL></DD></DL><HR><A NAME="hasAlpha()"><!-- --></A><H3>hasAlpha</H3><PRE>public final boolean <B>hasAlpha</B>()</PRE><DL><DD>Returns whether or not alpha is supported in this  <code>ColorModel</code>.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>true</code> if alpha is supported in this <code>ColorModel</code>; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="isAlphaPremultiplied()"><!-- --></A><H3>isAlphaPremultiplied</H3><PRE>public final boolean <B>isAlphaPremultiplied</B>()</PRE><DL><DD>Returns whether or not the alpha has been premultiplied in the pixel values to be translated by this <code>ColorModel</code>.   If the boolean is <code>true</code>, this <code>ColorModel</code>  is to be used to interpret pixel values in which color and alpha information are represented as separate spatial bands, and color samples are assumed to have been multiplied by the alpha sample.<DD><DL></DL></DD>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?