indexcolormodel.html

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

HTML
1,198
字号
			the <code>cmap</code> array<DD><CODE>trans</CODE> - the index of the fully transparent pixel<DD><CODE>transferType</CODE> - the data type of the array used to represent           pixel values.  The data type must be either            <code>DataBuffer.TYPE_BYTE</code> or           <code>DataBuffer.TYPE_USHORT</code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>bits</code> is less           than 1 or greater than 16<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>size</code> is less           than 1</DL></DD></DL><HR><A NAME="IndexColorModel(int, int, int[], int, int, java.math.BigInteger)"><!-- --></A><H3>IndexColorModel</H3><PRE>public <B>IndexColorModel</B>(int&nbsp;bits,                       int&nbsp;size,                       int[]&nbsp;cmap,                       int&nbsp;start,                       int&nbsp;transferType,                       <A HREF="../../../java/math/BigInteger.html">BigInteger</A>&nbsp;validBits)</PRE><DL><DD>Constructs an <code>IndexColorModel</code> from an  <code>int</code> array where each <code>int</code> is  comprised of red, green, blue, and alpha             components in the default RGB color model format.   The array must have enough values in it to fill all of the needed component arrays of the specified size. The <code>ColorSpace</code> is the default sRGB space.   The transfer type is the smallest of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT that can hold a single pixel. The <code>BigInteger</code> object specifies the valid/invalid pixels in the <code>cmap</code> array.  A pixel is valid if the  <code>BigInteger</code> value at that index is set, and is invalid if the <code>BigInteger</code> bit  at that index is not set.<DD><DL><DT><B>Parameters:</B><DD><CODE>bits</CODE> - the number of bits each pixel occupies<DD><CODE>size</CODE> - the size of the color component array<DD><CODE>cmap</CODE> - the array of color components<DD><CODE>start</CODE> - the starting offset of the first color component<DD><CODE>transferType</CODE> - the specified data type<DD><CODE>validBits</CODE> - a <code>BigInteger</code> object.  If a bit is    set in the BigInteger, the pixel at that index is valid.    If a bit is not set, the pixel at that index    is considered invalid.  If null, all pixels are valid.    Only bits from 0 to map_size will be considered.</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="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>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#getTransparency()">getTransparency</A></CODE> in class <CODE><A HREF="../../../java/awt/image/ColorModel.html">ColorModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the transparency of this <code>IndexColorModel</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="getComponentSize()"><!-- --></A><H3>getComponentSize</H3><PRE>public int[] <B>getComponentSize</B>()</PRE><DL><DD>Returns an array of the number of bits for each color/alpha component. The array contains the color components in the order red, green, blue, followed by the alpha component, if present.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#getComponentSize()">getComponentSize</A></CODE> in class <CODE><A HREF="../../../java/awt/image/ColorModel.html">ColorModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an array containing the number of bits of each color          and alpha component of this <code>IndexColorModel</code></DL></DD></DL><HR><A NAME="getMapSize()"><!-- --></A><H3>getMapSize</H3><PRE>public final int <B>getMapSize</B>()</PRE><DL><DD>Returns the size of the color/alpha component arrays in this <code>IndexColorModel</code>.<DD><DL><DT><B>Returns:</B><DD>the size of the color and alpha component arrays.</DL></DD></DL><HR><A NAME="getTransparentPixel()"><!-- --></A><H3>getTransparentPixel</H3><PRE>public final int <B>getTransparentPixel</B>()</PRE><DL><DD>Returns the index of the transparent pixel in this  <code>IndexColorModel</code> or -1 if there is no transparent pixel.<DD><DL><DT><B>Returns:</B><DD>the index of this <code>IndexColorModel</code> object's       transparent pixel, or -1 if there is no such pixel.</DL></DD></DL><HR><A NAME="getReds(byte[])"><!-- --></A><H3>getReds</H3><PRE>public final void <B>getReds</B>(byte[]&nbsp;r)</PRE><DL><DD>Copies the array of red color components into the specified array.   Only the initial entries of the array as specified by  <A HREF="../../../java/awt/image/IndexColorModel.html#getMapSize()"><CODE>getMapSize</CODE></A> are written.<DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - the specified array into which the elements of the       array of red color components are copied</DL></DD></DL><HR><A NAME="getGreens(byte[])"><!-- --></A><H3>getGreens</H3><PRE>public final void <B>getGreens</B>(byte[]&nbsp;g)</PRE><DL><DD>Copies the array of green color components into the specified array.   Only the initial entries of the array as specified by  <code>getMapSize</code> are written.<DD><DL><DT><B>Parameters:</B><DD><CODE>g</CODE> - the specified array into which the elements of the       array of green color components are copied</DL></DD></DL><HR><A NAME="getBlues(byte[])"><!-- --></A><H3>getBlues</H3><PRE>public final void <B>getBlues</B>(byte[]&nbsp;b)</PRE><DL><DD>Copies the array of blue color components into the specified array.   Only the initial entries of the array as specified by  <code>getMapSize</code> are written.<DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - the specified array into which the elements of the       array of blue color components are copied</DL></DD></DL><HR><A NAME="getAlphas(byte[])"><!-- --></A><H3>getAlphas</H3><PRE>public final void <B>getAlphas</B>(byte[]&nbsp;a)</PRE><DL><DD>Copies the array of alpha transparency components into the  specified array.  Only the initial entries of the array as specified  by <code>getMapSize</code> are written.<DD><DL><DT><B>Parameters:</B><DD><CODE>a</CODE> - the specified array into which the elements of the       array of alpha components are copied</DL></DD></DL><HR><A NAME="getRGBs(int[])"><!-- --></A><H3>getRGBs</H3><PRE>public final void <B>getRGBs</B>(int[]&nbsp;rgb)</PRE><DL><DD>Converts data for each index from the color and alpha component arrays to an int in the default RGB ColorModel format and copies the resulting 32-bit ARGB values into the specified array.  Only the initial entries of the array as specified by  <code>getMapSize</code> are written.<DD><DL><DT><B>Parameters:</B><DD><CODE>rgb</CODE> - the specified array into which the converted ARGB         values from this array of color and alpha components        are copied.</DL></DD></DL><HR><A NAME="getRed(int)"><!-- --></A><H3>getRed</H3><PRE>public final 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.  The pixel value is specified as an int.  The returned value is a non pre-multiplied value.<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 value of the red color component for the specified pixel</DL></DD></DL><HR><A NAME="getGreen(int)"><!-- --></A><H3>getGreen</H3><PRE>public final 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.  The pixel value is specified as an int.  The returned value is a non pre-multiplied value.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#getGreen(int)">getGreen</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 value of the green color component for the specified pixel</DL></DD></DL><HR><A NAME="getBlue(int)"><!-- --></A><H3>getBlue</H3><PRE>public final 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.  The pixel value is specified as an int.  The returned value is a non pre-multiplied value.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#getBlue(int)">getBlue</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 value of the blue color component for the specified pixel</DL></DD></DL><HR><A NAME="getAlpha(int)"><!-- --></A><H3>getAlpha</H3><PRE>public final int <B>getAlpha</B>(int&nbsp;pixel)</PRE>

⌨️ 快捷键说明

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