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

📄 directcolormodel.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:34:06 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class  DirectColorModel</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_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/DirectColorModel.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/DataBufferUShort.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../java/awt/image/FilteredImageSource.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="DirectColorModel.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><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.awt.image</FONT><BR>Class  DirectColorModel</H2><PRE><A HREF="../../../java/lang/Object.html">java.lang.Object</A>  |  +--<A HREF="../../../java/awt/image/ColorModel.html">java.awt.image.ColorModel</A>        |        +--<A HREF="../../../java/awt/image/PackedColorModel.html">java.awt.image.PackedColorModel</A>              |              +--<B>java.awt.image.DirectColorModel</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../java/awt/Transparency.html">Transparency</A></DD></DL><HR><DL><DT>public class <B>DirectColorModel</B><DT>extends <A HREF="../../../java/awt/image/PackedColorModel.html">PackedColorModel</A></DL><P>The <code>DirectColorModel</code> class is a <code>ColorModel</code> class that works with pixel values that represent RGB color and alpha information as separate samples and that pack all samples for a single pixel into a single int, short, or byte quantity. This class can be used only with ColorSpaces of type ColorSpace.TYPE_RGB. There must be three color samples in the pixel values and there can be a single alpha sample.  For those methods that use a primitive array pixel representation of type <code>transferType</code>, the array  length is always one.  The transfer  types supported are DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, and DataBuffer.TYPE_INT. Color and alpha samples are stored in the single  element of the array in bits indicated by bit masks.  Each bit mask  must be contiguous and masks must not overlap.  The same masks apply to  the single int pixel representation used by other methods.  The  correspondence of masks and color/alpha samples is as follows: <ul> <li> Masks are identified by indices running from 0 through 2   if no alpha is present, or 3 if an alpha is present.   <li> The first three indices refer to color samples;  index 0 corresponds to red, index 1 to green, and index 2 to blue.   <li> Index 3 corresponds to the alpha sample, if present.  </ul> <p> The translation from pixel values to color/alpha components for display or processing purposes is a one-to-one correspondence of samples to components.  A <code>DirectColorModel</code> is  typically used with image data which uses masks to define packed  samples.  For example, a <code>DirectColorModel</code> can be used in conjunction with a <code>SinglePixelPackedSampleModel</code> to  construct a <A HREF="../../../java/awt/image/BufferedImage.html"><CODE>BufferedImage</CODE></A>.  Normally the masks used by the  <A HREF="../../../java/awt/image/SampleModel.html"><CODE>SampleModel</CODE></A> and the <code>ColorModel</code> would be the  same.  However, if they are different, the color interpretation  of pixel data will be done according to the masks of the  <code>ColorModel</code>. <p> A single int pixel representation is valid for all objects of this class, since it is always possible to represent pixel values used with this class in a single int.  Therefore, methods which use this representation will not throw an <code>IllegalArgumentException</code> due to an invalid pixel value. <p> This color model is similar to an X11 TrueColor visual. The default RGB ColorModel specified by the  <A HREF="../../../java/awt/image/ColorModel.html#getRGBdefault()"><CODE>getRGBdefault</CODE></A> method is a  <code>DirectColorModel</code> with the following parameters: <pre> Number of bits:        32 Red mask:              0x00ff0000 Green mask:            0x0000ff00 Blue mask:             0x000000ff Alpha mask:            0xff000000 Color space:           sRGB isAlphaPremultiplied:  False Transparency:          Transparency.TRANSLUCENT transferType:          DataBuffer.TYPE_INT </pre> <p> Many of the methods in this class are final. This is because the underlying native graphics code makes assumptions about the layout and operation of this class and those assumptions are reflected in the implementations of the methods here that are marked final.  You can subclass this class for other reasons, but you cannot override or modify the behavior of those methods.<P><DL><DT><B>See Also: </B><DD><A HREF="../../../java/awt/image/ColorModel.html"><CODE>ColorModel</CODE></A>, <A HREF="../../../java/awt/color/ColorSpace.html"><CODE>ColorSpace</CODE></A>, <A HREF="../../../java/awt/image/SinglePixelPackedSampleModel.html"><CODE>SinglePixelPackedSampleModel</CODE></A>, <A HREF="../../../java/awt/image/BufferedImage.html"><CODE>BufferedImage</CODE></A>, <A HREF="../../../java/awt/image/ColorModel.html#getRGBdefault()"><CODE>ColorModel.getRGBdefault()</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="fields_inherited_from_class_java.awt.image.ColorModel"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields 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#pixel_bits">pixel_bits</A>, <A HREF="../../../java/awt/image/ColorModel.html#transferType">transferType</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="fields_inherited_from_class_java.awt.Transparency"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface java.awt.<A HREF="../../../java/awt/Transparency.html">Transparency</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/awt/Transparency.html#BITMASK">BITMASK</A>, <A HREF="../../../java/awt/Transparency.html#OPAQUE">OPAQUE</A>, <A HREF="../../../java/awt/Transparency.html#TRANSLUCENT">TRANSLUCENT</A></CODE></TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../java/awt/image/DirectColorModel.html#DirectColorModel(java.awt.color.ColorSpace, int, int, int, int, int, boolean, int)">DirectColorModel</A></B>(<A HREF="../../../java/awt/color/ColorSpace.html">ColorSpace</A>&nbsp;space,                 int&nbsp;bits,                 int&nbsp;rmask,                 int&nbsp;gmask,                 int&nbsp;bmask,                 int&nbsp;amask,                 boolean&nbsp;isAlphaPremultiplied,                 int&nbsp;transferType)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <code>DirectColorModel</code> from the specified parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../java/awt/image/DirectColorModel.html#DirectColorModel(int, int, int, int)">DirectColorModel</A></B>(int&nbsp;bits,                 int&nbsp;rmask,                 int&nbsp;gmask,                 int&nbsp;bmask)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../java/awt/image/DirectColorModel.html#DirectColorModel(int, int, int, int, int)">DirectColorModel</A></B>(int&nbsp;bits,                 int&nbsp;rmask,                 int&nbsp;gmask,                 int&nbsp;bmask,                 int&nbsp;amask)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR>

⌨️ 快捷键说明

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