⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 componentcolormodel.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 components. This array can then be passed to the <CODE>setDataElements</CODE>  method of a <CODE>WritableRaster</CODE> object.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#getDataElements(int[], int, java.lang.Object)">getDataElements</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>components</CODE> - An array of unnormalized color/alpha components.<DD><CODE>offset</CODE> - The integer offset into the <CODE>components</CODE> array.<DD><CODE>obj</CODE> - The object in which to store the data element array  representation of the pixel. If <CODE>obj</CODE> variable is null,  a new array is allocated.  If <CODE>obj</CODE> is not null, it must  be a primitive array of type <CODE>transferType</CODE>. An  <CODE>ArrayIndexOutOfBoundsException</CODE> is thrown if  <CODE>obj</CODE> is not large enough to hold a pixel value  for this <CODE>ColorModel</CODE>.  Since <code>ComponentColorModel</code> can be subclassed, subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an  unsupported <code>transferType</code>.<DT><B>Returns:</B><DD>The data element array representation of a pixel  in this <CODE>ColorModel</CODE>.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - If the components array is not large enough to hold all the color and alpha components (starting at offset).<DD><CODE><A HREF="../../../java/lang/ClassCastException.html">ClassCastException</A></CODE> - If <CODE>obj</CODE> is not null and is not a  primitive  array of type <CODE>transferType</CODE>.<DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - If <CODE>obj</CODE> is not large enough to hold a pixel value for this <CODE>ColorModel</CODE>.<DD><CODE><A HREF="../../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - If the transfer type of  this <CODE>ComponentColorModel</CODE> is not one of the supported transfer types:   <CODE>DataBuffer.TYPE_BYTE</CODE>, <CODE>DataBuffer.TYPE_USHORT</CODE>,  or <CODE>DataBuffer.TYPE_INT</CODE>.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/image/WritableRaster.html#setDataElements(int, int, java.lang.Object)"><CODE>WritableRaster.setDataElements(int, int, java.lang.Object)</CODE></A>, <A HREF="../../../java/awt/image/SampleModel.html#setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)"><CODE>SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)</CODE></A></DL></DD></DL><HR><A NAME="coerceData(java.awt.image.WritableRaster, boolean)"><!-- --></A><H3>coerceData</H3><PRE>public <A HREF="../../../java/awt/image/ColorModel.html">ColorModel</A> <B>coerceData</B>(<A HREF="../../../java/awt/image/WritableRaster.html">WritableRaster</A>&nbsp;raster,                             boolean&nbsp;isAlphaPremultiplied)</PRE><DL><DD>Forces the raster data to match the state specified in the <CODE>isAlphaPremultiplied</CODE> variable, assuming the data  is currently correctly described by this <CODE>ColorModel</CODE>.   It may multiply or divide the color raster data by alpha, or  do nothing if the data is in the correct state.  If the data needs  to be coerced, this method also returns an instance of  this <CODE>ColorModel</CODE> with the <CODE>isAlphaPremultiplied</CODE> flag set appropriately. Since <code>ColorModel</code> can be subclassed, subclasses inherit the implementation of this method and if they don't override it then they throw an exception if they use an unsupported  <code>transferType</code>.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#coerceData(java.awt.image.WritableRaster, boolean)">coerceData</A></CODE> in class <CODE><A HREF="../../../java/awt/image/ColorModel.html">ColorModel</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>raster</code> is  <code>null</code> and data coercion is required.<DD><CODE><A HREF="../../../java/lang/UnsupportedOperationException.html">UnsupportedOperationException</A></CODE> - if the transfer type of  this <CODE>ComponentColorModel</CODE> is not one of the supported transfer types:   <CODE>DataBuffer.TYPE_BYTE</CODE>, <CODE>DataBuffer.TYPE_USHORT</CODE>,  or <CODE>DataBuffer.TYPE_INT</CODE>.</DL></DD></DL><HR><A NAME="isCompatibleRaster(java.awt.image.Raster)"><!-- --></A><H3>isCompatibleRaster</H3><PRE>public boolean <B>isCompatibleRaster</B>(<A HREF="../../../java/awt/image/Raster.html">Raster</A>&nbsp;raster)</PRE><DL><DD>Returns true if <CODE>raster</CODE> is compatible with this  <CODE>ColorModel</CODE>; false if it is not.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#isCompatibleRaster(java.awt.image.Raster)">isCompatibleRaster</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>raster</CODE> - The <CODE>Raster</CODE> object to test for compatibility.<DT><B>Returns:</B><DD><CODE>true</CODE> if <CODE>raster</CODE> is compatible with this  <CODE>ColorModel</CODE>, <CODE>false</CODE> if it is not.</DL></DD></DL><HR><A NAME="createCompatibleWritableRaster(int, int)"><!-- --></A><H3>createCompatibleWritableRaster</H3><PRE>public <A HREF="../../../java/awt/image/WritableRaster.html">WritableRaster</A> <B>createCompatibleWritableRaster</B>(int&nbsp;w,                                                     int&nbsp;h)</PRE><DL><DD>Creates a <CODE>WritableRaster</CODE> with the specified width and height,  that  has a data layout (<CODE>SampleModel</CODE>) compatible with  this <CODE>ColorModel</CODE>.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#createCompatibleWritableRaster(int, int)">createCompatibleWritableRaster</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>w</CODE> - The width of the <CODE>WritableRaster</CODE> you want to create.<DD><CODE>h</CODE> - The height of the <CODE>WritableRaster</CODE> you want to create.<DT><B>Returns:</B><DD>A <CODE>WritableRaster</CODE> that is compatible with  this <CODE>ColorModel</CODE>.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/image/WritableRaster.html"><CODE>WritableRaster</CODE></A>, <A HREF="../../../java/awt/image/SampleModel.html"><CODE>SampleModel</CODE></A></DL></DD></DL><HR><A NAME="createCompatibleSampleModel(int, int)"><!-- --></A><H3>createCompatibleSampleModel</H3><PRE>public <A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A> <B>createCompatibleSampleModel</B>(int&nbsp;w,                                               int&nbsp;h)</PRE><DL><DD>Creates a <CODE>SampleModel</CODE> with the specified width and height,  that  has a data layout compatible with this <CODE>ColorModel</CODE>.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#createCompatibleSampleModel(int, int)">createCompatibleSampleModel</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>w</CODE> - The width of the <CODE>SampleModel</CODE> you want to create.<DD><CODE>h</CODE> - The height of the <CODE>SampleModel</CODE> you want to create.<DT><B>Returns:</B><DD>A <CODE>SampleModel</CODE> that is compatible with this <CODE>ColorModel</CODE>.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/image/SampleModel.html"><CODE>SampleModel</CODE></A></DL></DD></DL><HR><A NAME="isCompatibleSampleModel(java.awt.image.SampleModel)"><!-- --></A><H3>isCompatibleSampleModel</H3><PRE>public boolean <B>isCompatibleSampleModel</B>(<A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A>&nbsp;sm)</PRE><DL><DD>Checks whether or not the specified <CODE>SampleModel</CODE>  is compatible with this <CODE>ColorModel</CODE>.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#isCompatibleSampleModel(java.awt.image.SampleModel)">isCompatibleSampleModel</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>sm</CODE> - The <CODE>SampleModel</CODE> to test for compatibility.<DT><B>Returns:</B><DD><CODE>true</CODE> if the <CODE>SampleModel</CODE> is  compatible with this <CODE>ColorModel</CODE>, <CODE>false</CODE>  if it is not.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/image/SampleModel.html"><CODE>SampleModel</CODE></A></DL></DD></DL><HR><A NAME="getAlphaRaster(java.awt.image.WritableRaster)"><!-- --></A><H3>getAlphaRaster</H3><PRE>public <A HREF="../../../java/awt/image/WritableRaster.html">WritableRaster</A> <B>getAlphaRaster</B>(<A HREF="../../../java/awt/image/WritableRaster.html">WritableRaster</A>&nbsp;raster)</PRE><DL><DD>Returns a <CODE>Raster</CODE> representing the alpha channel of an image, extracted from the input <CODE>Raster</CODE>. This method assumes that <CODE>Raster</CODE> objects associated with  this <CODE>ColorModel</CODE> store the alpha band, if present, as  the last band of image data. Returns null if there is no separate spatial  alpha channel associated with this <CODE>ColorModel</CODE>. This method creates a new <CODE>Raster</CODE>, but will share the data array.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#getAlphaRaster(java.awt.image.WritableRaster)">getAlphaRaster</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>raster</CODE> - The <CODE>WritableRaster</CODE> from which to extract the  alpha  channel.<DT><B>Returns:</B><DD>A <CODE>WritableRaster</CODE> containing the image's alpha channel.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../../java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Compares this color model with another for equality.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/ColorModel.html#equals(java.lang.Object)">equals</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>obj</CODE> - The object to compare with this color model.<DT><B>Returns:</B><DD><CODE>true</CODE> if the color model objects are equal,  <CODE>false</CODE> if they are not.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ComponentColorModel.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../java/awt/image/ColorModel.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../java/awt/image/ComponentSampleModel.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="ComponentColorModel.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.awt.image.ColorModel">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, se

⌨️ 快捷键说明

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