colormodel.html

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

HTML
1,326
字号
<DD><DL><DT><B>Returns:</B><DD><code>true</code> if the alpha values are premultiplied		in the pixel values to be translated by this		<code>ColorModel</code>; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="getTransferType()"><!-- --></A><H3>getTransferType</H3><PRE>public final int <B>getTransferType</B>()</PRE><DL><DD>Returns the transfer type of this <code>ColorModel</code>. The transfer type is the type of primitive array used to represent pixel values as arrays.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the transfer type.</DL></DD></DL><HR><A NAME="getPixelSize()"><!-- --></A><H3>getPixelSize</H3><PRE>public int <B>getPixelSize</B>()</PRE><DL><DD>Returns the number of bits per pixel described by this  <code>ColorModel</code>.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of bits per pixel.</DL></DD></DL><HR><A NAME="getComponentSize(int)"><!-- --></A><H3>getComponentSize</H3><PRE>public int <B>getComponentSize</B>(int&nbsp;componentIdx)</PRE><DL><DD>Returns the number of bits for the specified color/alpha component. Color components are indexed in the order specified by the  <code>ColorSpace</code>.  Typically, this order reflects the name of the color space type. For example, for TYPE_RGB, index 0 corresponds to red, index 1 to green, and index 2 to blue.  If this <code>ColorModel</code> supports alpha, the alpha component corresponds to the index following the last color component.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>componentIdx</CODE> - the index of the color/alpha component<DT><B>Returns:</B><DD>the number of bits for the color/alpha component at the		specified index.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if <code>componentIdx</code>          is greater than the number of components or         less than zero<DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if the number of bits array is          <code>null</code></DL></DD></DL><HR><A NAME="getComponentSize()"><!-- --></A><H3>getComponentSize</H3><PRE>public int[] <B>getComponentSize</B>()</PRE><DL><DD>Returns an array of the number of bits per color/alpha component.   The array contains the color components in the order specified by the <code>ColorSpace</code>, followed by the alpha component, if present.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an array of the number of bits per color/alpha component</DL></DD></DL><HR><A NAME="getTransparency()"><!-- --></A><H3>getTransparency</H3><PRE>public int <B>getTransparency</B>()</PRE><DL><DD>Returns the transparency.  Returns either OPAQUE, BITMASK, or TRANSLUCENT.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../java/awt/Transparency.html#getTransparency()">getTransparency</A></CODE> in interface <CODE><A HREF="../../../java/awt/Transparency.html">Transparency</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the transparency of this <code>ColorModel</code>.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/Transparency.html#OPAQUE"><CODE>Transparency.OPAQUE</CODE></A>, <A HREF="../../../java/awt/Transparency.html#BITMASK"><CODE>Transparency.BITMASK</CODE></A>, <A HREF="../../../java/awt/Transparency.html#TRANSLUCENT"><CODE>Transparency.TRANSLUCENT</CODE></A></DL></DD></DL><HR><A NAME="getNumComponents()"><!-- --></A><H3>getNumComponents</H3><PRE>public int <B>getNumComponents</B>()</PRE><DL><DD>Returns the number of components, including alpha, in this <code>ColorModel</code>.  This is equal to the number of color components, optionally plus one, if there is an alpha component.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of components in this <code>ColorModel</code></DL></DD></DL><HR><A NAME="getNumColorComponents()"><!-- --></A><H3>getNumColorComponents</H3><PRE>public int <B>getNumColorComponents</B>()</PRE><DL><DD>Returns the number of color components in this <code>ColorModel</code>. This is the number of components returned by <A HREF="../../../java/awt/color/ColorSpace.html#getNumComponents()"><CODE>ColorSpace.getNumComponents()</CODE></A>.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of color components in this <code>ColorModel</code>.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/color/ColorSpace.html#getNumComponents()"><CODE>ColorSpace.getNumComponents()</CODE></A></DL></DD></DL><HR><A NAME="getRed(int)"><!-- --></A><H3>getRed</H3><PRE>public abstract int <B>getRed</B>(int&nbsp;pixel)</PRE><DL><DD>Returns the red color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.  A color conversion is done if necessary.  The pixel value is specified as an int. An <code>IllegalArgumentException</code> is thrown if pixel values for this <code>ColorModel</code> are not conveniently representable as a single int.  The returned value is not a pre-multiplied value.  For example, if the alpha is premultiplied, this method divides it out before returning the value.  If the alpha value is 0, the red value is 0.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pixel</CODE> - a specified pixel<DT><B>Returns:</B><DD>the value of the red component of the specified pixel.</DL></DD></DL><HR><A NAME="getGreen(int)"><!-- --></A><H3>getGreen</H3><PRE>public abstract int <B>getGreen</B>(int&nbsp;pixel)</PRE><DL><DD>Returns the green color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.  A color conversion is done if necessary.  The pixel value is specified as an int. An <code>IllegalArgumentException</code> is thrown if pixel values for this <code>ColorModel</code> are not conveniently representable as a single int.  The returned value is a non pre-multiplied value.  For example, if the alpha is premultiplied, this method divides it out before returning the value.  If the alpha value is 0, the green value is 0.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pixel</CODE> - the specified pixel<DT><B>Returns:</B><DD>the value of the green component of the specified pixel.</DL></DD></DL><HR><A NAME="getBlue(int)"><!-- --></A><H3>getBlue</H3><PRE>public abstract int <B>getBlue</B>(int&nbsp;pixel)</PRE><DL><DD>Returns the blue color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.  A color conversion is done if necessary.  The pixel value is specified as an int. An <code>IllegalArgumentException</code> is thrown if pixel values for this <code>ColorModel</code> are not conveniently representable as a single int.  The returned value is a non pre-multiplied value, for example, if the alpha is premultiplied, this method divides it out before returning the value.  If the alpha value is 0, the blue value is 0.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pixel</CODE> - the specified pixel<DT><B>Returns:</B><DD>the value of the blue component of the specified pixel.</DL></DD></DL><HR><A NAME="getAlpha(int)"><!-- --></A><H3>getAlpha</H3><PRE>public abstract int <B>getAlpha</B>(int&nbsp;pixel)</PRE><DL><DD>Returns the alpha component for the specified pixel, scaled from 0 to 255.  The pixel value is specified as an int. An <code>IllegalArgumentException</code> is thrown if pixel values for this <code>ColorModel</code> are not conveniently representable as a single int.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pixel</CODE> - the specified pixel<DT><B>Returns:</B><DD>the value of alpha component of the specified pixel.</DL></DD></DL><HR><A NAME="getRGB(int)"><!-- --></A><H3>getRGB</H3><PRE>public int <B>getRGB</B>(int&nbsp;pixel)</PRE><DL><DD>Returns the color/alpha components of the pixel in the default RGB color model format.  A color conversion is done if necessary. The pixel value is specified as an int. An <code>IllegalArgumentException</code> thrown if pixel values for this <code>ColorModel</code> are not conveniently representable as a single int.  The returned value is in a non pre-multiplied format. For example, if the alpha is premultiplied, this method divides it out of the color components.  If the alpha value is 0, the color values are 0.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pixel</CODE> - the specified pixel<DT><B>Returns:</B><DD>the RGB value of the color/alpha components of the 		specified pixel.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/image/ColorModel.html#getRGBdefault()"><CODE>getRGBdefault()</CODE></A></DL></DD></DL><HR><A NAME="getRed(java.lang.Object)"><!-- --></A><H3>getRed</H3><PRE>public int <B>getRed</B>(<A HREF="../../../java/lang/Object.html">Object</A>&nbsp;inData)</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 by an array of data elements of type transferType passed in as an object reference.  The returned value is a non pre-multiplied value.  For example, if alpha is premultiplied, this method divides it out before returning the value.  If the alpha value is 0, the red value is 0. If <code>inData</code> is not a primitive array of type transferType, a <code>ClassCastException</code> is thrown.  An <code>ArrayIndexOutOfBoundsException</code> is thrown if  <code>inData</code> is not large enough to hold a pixel value for this <code>ColorModel</code>. If this <code>transferType</code> is not supported, a        <code>UnsupportedOperationException</code> will be thrown.  Since <code>ColorModel</code> is an abstract class, any instance must be an instance of a subclass.  Subclasses inherit the implementation of this method and if they don't override it, this method throws an exception if the subclass uses a <code>transferType</code> other than <code>DataBuffer.TYPE_BYTE</code>,

⌨️ 快捷键说明

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