multipixelpackedsamplemodel.html
来自「API資料大全」· HTML 代码 · 共 858 行 · 第 1/4 页
HTML
858 行
createCompatibleSampleModel</H3><PRE>public <A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A> <B>createCompatibleSampleModel</B>(int w, int h)</PRE><DL><DD>Creates a new <code>MultiPixelPackedSampleModel</code> with the specified width and height. The new <code>MultiPixelPackedSampleModel</code> has the same storage data type and number of bits per pixel as this <code>MultiPixelPackedSampleModel</code>.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/SampleModel.html#createCompatibleSampleModel(int, int)">createCompatibleSampleModel</A></CODE> in class <CODE><A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>w</CODE> - the specified width<DD><CODE>h</CODE> - the specified height<DT><B>Returns:</B><DD>a <A HREF="../../../java/awt/image/SampleModel.html"><CODE>SampleModel</CODE></A> with the specified width and height and with the same storage data type and number of bits per pixel as this <code>MultiPixelPackedSampleModel</code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>w</code> or <code>h</code> is not greater than 0</DL></DD></DL><HR><A NAME="createDataBuffer()"><!-- --></A><H3>createDataBuffer</H3><PRE>public <A HREF="../../../java/awt/image/DataBuffer.html">DataBuffer</A> <B>createDataBuffer</B>()</PRE><DL><DD>Creates a <code>DataBuffer</code> that corresponds to this <code>MultiPixelPackedSampleModel</code>. The <code>DataBuffer</code> object's data type and size is consistent with this <code>MultiPixelPackedSampleModel</code>. The <code>DataBuffer</code> has a single bank.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/SampleModel.html#createDataBuffer()">createDataBuffer</A></CODE> in class <CODE><A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>DataBuffer</code> with the same data type and size as this <code>MultiPixelPackedSampleModel</code>.</DL></DD></DL><HR><A NAME="getNumDataElements()"><!-- --></A><H3>getNumDataElements</H3><PRE>public int <B>getNumDataElements</B>()</PRE><DL><DD>Returns the number of data elements needed to transfer one pixel via the <A HREF="../../../java/awt/image/MultiPixelPackedSampleModel.html#getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)"><CODE>getDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)</CODE></A> and <A HREF="../../../java/awt/image/MultiPixelPackedSampleModel.html#setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)"><CODE>setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)</CODE></A> methods. For a <code>MultiPixelPackedSampleModel</code>, this is one.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/SampleModel.html#getNumDataElements()">getNumDataElements</A></CODE> in class <CODE><A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of data elements.</DL></DD></DL><HR><A NAME="getSampleSize()"><!-- --></A><H3>getSampleSize</H3><PRE>public int[] <B>getSampleSize</B>()</PRE><DL><DD>Returns the number of bits per sample for all bands.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/SampleModel.html#getSampleSize()">getSampleSize</A></CODE> in class <CODE><A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of bits per sample.</DL></DD></DL><HR><A NAME="getSampleSize(int)"><!-- --></A><H3>getSampleSize</H3><PRE>public int <B>getSampleSize</B>(int band)</PRE><DL><DD>Returns the number of bits per sample for the specified band.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/SampleModel.html#getSampleSize(int)">getSampleSize</A></CODE> in class <CODE><A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>band</CODE> - the specified band<DT><B>Returns:</B><DD>the number of bits per sample for the specified band.</DL></DD></DL><HR><A NAME="getOffset(int, int)"><!-- --></A><H3>getOffset</H3><PRE>public int <B>getOffset</B>(int x, int y)</PRE><DL><DD>Returns the offset of pixel (x, y) in data array elements.<DD><DL><DT><B>Parameters:</B><DD><CODE>x, y</CODE> - the specified pixel<DT><B>Returns:</B><DD>the offset of the specified pixel.</DL></DD></DL><HR><A NAME="getBitOffset(int)"><!-- --></A><H3>getBitOffset</H3><PRE>public int <B>getBitOffset</B>(int x)</PRE><DL><DD>Returns the offset, in bits, into the data element in which it is stored for the <code>x</code>th pixel of a scanline. This offset is the same for all scanlines.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the specified pixel<DT><B>Returns:</B><DD>the bit offset of the specified pixel.</DL></DD></DL><HR><A NAME="getScanlineStride()"><!-- --></A><H3>getScanlineStride</H3><PRE>public int <B>getScanlineStride</B>()</PRE><DL><DD>Returns the scanline stride.<DD><DL><DT><B>Returns:</B><DD>the scanline stride of this <code>MultiPixelPackedSampleModel</code>.</DL></DD></DL><HR><A NAME="getPixelBitStride()"><!-- --></A><H3>getPixelBitStride</H3><PRE>public int <B>getPixelBitStride</B>()</PRE><DL><DD>Returns the pixel bit stride in bits. This value is the same as the number of bits per pixel.<DD><DL><DT><B>Returns:</B><DD>the <code>pixelBitStride</code> of this <code>MultiPixelPackedSampleModel</code>.</DL></DD></DL><HR><A NAME="getDataBitOffset()"><!-- --></A><H3>getDataBitOffset</H3><PRE>public int <B>getDataBitOffset</B>()</PRE><DL><DD>Returns the data bit offset in bits.<DD><DL><DT><B>Returns:</B><DD>the <code>dataBitOffset</code> of this <code>MultiPixelPackedSampleModel</code>.</DL></DD></DL><HR><A NAME="getTransferType()"><!-- --></A><H3>getTransferType</H3><PRE>public int <B>getTransferType</B>()</PRE><DL><DD>Returns the TransferType used to transfer pixels by way of the <code>getDataElements</code> and <code>setDataElements</code> methods. The TransferType might or might not be the same as the storage DataType. The TransferType is one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/SampleModel.html#getTransferType()">getTransferType</A></CODE> in class <CODE><A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the transfertype.</DL></DD></DL><HR><A NAME="createSubsetSampleModel(int[])"><!-- --></A><H3>createSubsetSampleModel</H3><PRE>public <A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A> <B>createSubsetSampleModel</B>(int[] bands)</PRE><DL><DD>Creates a new <code>MultiPixelPackedSampleModel</code> with a subset of the bands of this <code>MultiPixelPackedSampleModel</code>. Since a <code>MultiPixelPackedSampleModel</code> only has one band, the bands argument must have a length of one and indicate the zeroth band.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/SampleModel.html#createSubsetSampleModel(int[])">createSubsetSampleModel</A></CODE> in class <CODE><A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>bands</CODE> - the specified bands<DT><B>Returns:</B><DD>a new <code>SampleModel</code> with a subset of bands of this <code>MultiPixelPackedSampleModel</code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/awt/image/RasterFormatException.html">RasterFormatException</A></CODE> - if the number of bands requested is not one.<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>w</code> or <code>h</code> is not greater than 0</DL></DD></DL><HR><A NAME="getSample(int, int, int, java.awt.image.DataBuffer)"><!-- --></A><H3>getSample</H3><PRE>public int <B>getSample</B>(int x, int y, int b, <A HREF="../../../java/awt/image/DataBuffer.html">DataBuffer</A> data)</PRE><DL><DD>Returns as <code>int</code> the sample in a specified band for the pixel located at (x, y). An <code>ArrayIndexOutOfBoundsException</code> is thrown if the coordinates are not in bounds.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/awt/image/SampleModel.html#getSample(int, int, int, java.awt.image.DataBuffer)">getSample</A></CODE> in class <CODE><A HREF="../../../java/awt/image/SampleModel.html">SampleModel</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x, y</CODE> - the coordinates of the specified pixel<DD><CODE>b</CODE> - the band to return, which is assumed to be 0<DD><CODE>data</CODE> - the <code>DataBuffer</code> containing the image data<DT><B>Returns:</B><DD>the specified band containing the sample of the specified pixel.<DT><B>Throws:</B><DD><CODE>ArrayIndexOutOfBoundException</CODE> - if the specified coordinates are not in bounds.</DL></DD></DL><HR><A NAME="setSample(int, int, int, int, java.awt.image.DataBuffer)"><!-- --></A><H3>setSample</H3><PRE>public void <B>setSample</B>(int x,
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?