?? pngencoder.html
字號:
<A NAME="PngEncoder()"><!-- --></A><H3>PngEncoder</H3><PRE>public <B>PngEncoder</B>()</PRE><DL><DD>Class constructor<P></DL><HR><A NAME="PngEncoder(java.awt.Image)"><!-- --></A><H3>PngEncoder</H3><PRE>public <B>PngEncoder</B>(java.awt.Image image)</PRE><DL><DD>Class constructor specifying Image to encode, with no alpha channel encoding.<P><DT><B>Parameters:</B><DD><CODE>image</CODE> - A Java Image object which uses the DirectColorModel<DT><B>See Also:</B><DD><CODE>Image</CODE></DL><HR><A NAME="PngEncoder(java.awt.Image, boolean)"><!-- --></A><H3>PngEncoder</H3><PRE>public <B>PngEncoder</B>(java.awt.Image image, boolean encodeAlpha)</PRE><DL><DD>Class constructor specifying Image to encode, and whether to encode alpha.<P><DT><B>Parameters:</B><DD><CODE>image</CODE> - A Java Image object which uses the DirectColorModel<DD><CODE>encodeAlpha</CODE> - Encode the alpha channel? false=no; true=yes<DT><B>See Also:</B><DD><CODE>Image</CODE></DL><HR><A NAME="PngEncoder(java.awt.Image, boolean, int)"><!-- --></A><H3>PngEncoder</H3><PRE>public <B>PngEncoder</B>(java.awt.Image image, boolean encodeAlpha, int whichFilter)</PRE><DL><DD>Class constructor specifying Image to encode, whether to encode alpha, and filter to use.<P><DT><B>Parameters:</B><DD><CODE>image</CODE> - A Java Image object which uses the DirectColorModel<DD><CODE>encodeAlpha</CODE> - Encode the alpha channel? false=no; true=yes<DD><CODE>whichFilter</CODE> - 0=none, 1=sub, 2=up<DT><B>See Also:</B><DD><CODE>Image</CODE></DL><HR><A NAME="PngEncoder(java.awt.Image, boolean, int, int)"><!-- --></A><H3>PngEncoder</H3><PRE>public <B>PngEncoder</B>(java.awt.Image image, boolean encodeAlpha, int whichFilter, int compLevel)</PRE><DL><DD>Class constructor specifying Image source to encode, whether to encode alpha, filter to use, and compression level.<P><DT><B>Parameters:</B><DD><CODE>image</CODE> - A Java Image object<DD><CODE>encodeAlpha</CODE> - Encode the alpha channel? false=no; true=yes<DD><CODE>whichFilter</CODE> - 0=none, 1=sub, 2=up<DD><CODE>compLevel</CODE> - 0..9<DT><B>See Also:</B><DD><CODE>Image</CODE></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="setImage(java.awt.Image)"><!-- --></A><H3>setImage</H3><PRE>public void <B>setImage</B>(java.awt.Image image)</PRE><DL><DD>Set the image to be encoded<P><DD><DL><DT><B>Parameters:</B><DD><CODE>image</CODE> - A Java Image object which uses the DirectColorModel<DT><B>See Also:</B><DD><CODE>Image</CODE>, <CODE>DirectColorModel</CODE></DL></DD></DL><HR><A NAME="pngEncode(boolean)"><!-- --></A><H3>pngEncode</H3><PRE>public byte[] <B>pngEncode</B>(boolean encodeAlpha)</PRE><DL><DD>Creates an array of bytes that is the PNG equivalent of the current image, specifying whether to encode alpha or not.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>encodeAlpha</CODE> - boolean false=no alpha, true=encode alpha<DT><B>Returns:</B><DD>an array of bytes, or null if there was a problem</DL></DD></DL><HR><A NAME="pngEncode()"><!-- --></A><H3>pngEncode</H3><PRE>public byte[] <B>pngEncode</B>()</PRE><DL><DD>Creates an array of bytes that is the PNG equivalent of the current image. Alpha encoding is determined by its setting in the constructor.<P><DD><DL><DT><B>Returns:</B><DD>an array of bytes, or null if there was a problem</DL></DD></DL><HR><A NAME="setEncodeAlpha(boolean)"><!-- --></A><H3>setEncodeAlpha</H3><PRE>public void <B>setEncodeAlpha</B>(boolean encodeAlpha)</PRE><DL><DD>Set the alpha encoding on or off.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>encodeAlpha</CODE> - false=no, true=yes</DL></DD></DL><HR><A NAME="getEncodeAlpha()"><!-- --></A><H3>getEncodeAlpha</H3><PRE>public boolean <B>getEncodeAlpha</B>()</PRE><DL><DD>Retrieve alpha encoding status.<P><DD><DL><DT><B>Returns:</B><DD>boolean false=no, true=yes</DL></DD></DL><HR><A NAME="setFilter(int)"><!-- --></A><H3>setFilter</H3><PRE>public void <B>setFilter</B>(int whichFilter)</PRE><DL><DD>Set the filter to use<P><DD><DL><DT><B>Parameters:</B><DD><CODE>whichFilter</CODE> - from constant list</DL></DD></DL><HR><A NAME="getFilter()"><!-- --></A><H3>getFilter</H3><PRE>public int <B>getFilter</B>()</PRE><DL><DD>Retrieve filtering scheme<P><DD><DL><DT><B>Returns:</B><DD>int (see constant list)</DL></DD></DL><HR><A NAME="setCompressionLevel(int)"><!-- --></A><H3>setCompressionLevel</H3><PRE>public void <B>setCompressionLevel</B>(int level)</PRE><DL><DD>Set the compression level to use<P><DD><DL><DT><B>Parameters:</B><DD><CODE>level</CODE> - 0 through 9</DL></DD></DL><HR><A NAME="getCompressionLevel()"><!-- --></A><H3>getCompressionLevel</H3><PRE>public int <B>getCompressionLevel</B>()</PRE><DL><DD>Retrieve compression level<P><DD><DL><DT><B>Returns:</B><DD>int in range 0-9</DL></DD></DL><HR><A NAME="resizeByteArray(byte[], int)"><!-- --></A><H3>resizeByteArray</H3><PRE>protected byte[] <B>resizeByteArray</B>(byte[] array, int newLength)</PRE><DL><DD>Increase or decrease the length of a byte array.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>array</CODE> - The original array.<DD><CODE>newLength</CODE> - The length you wish the new array to have.<DT><B>Returns:</B><DD>Array of newly desired length. If shorter than the original, the trailing elements are truncated.</DL></DD></DL><HR><A NAME="writeBytes(byte[], int)"><!-- --></A><H3>writeBytes</H3><PRE>protected int <B>writeBytes</B>(byte[] data, int offset)</PRE><DL><DD>Write an array of bytes into the pngBytes array. Note: This routine has the side effect of updating maxPos, the largest element written in the array. The array is resized by 1000 bytes or the length of the data to be written, whichever is larger.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - The data to be written into pngBytes.<DD><CODE>offset</CODE> - The starting point to write to.<DT><B>Returns:</B><DD>The next place to be written to in the pngBytes array.</DL></DD></DL><HR><A NAME="writeBytes(byte[], int, int)"><!-- --></A><H3>writeBytes</H3><PRE>protected int <B>writeBytes</B>(byte[] data, int nBytes, int offset)</PRE><DL><DD>Write an array of bytes into the pngBytes array, specifying number of bytes to write. Note: This routine has the side effect of updating maxPos, the largest element written in the array. The array is resized by 1000 bytes or the length of the data to be written, whichever is larger.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - The data to be written into pngBytes.<DD><CODE>nBytes</CODE> - The number of bytes to be written.<DD><CODE>offset</CODE> - The starting point to write to.<DT><B>Returns:</B><DD>The next place to be written to in the pngBytes array.</DL></DD></DL><HR><A NAME="writeInt2(int, int)"><!-- --></A><H3>writeInt2</H3><PRE>protected int <B>writeInt2</B>(int n, int offset)</PRE><DL><DD>Write a two-byte integer into the pngBytes array at a given position.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>n</CODE> - The integer to be written into pngBytes.<DD><CODE>offset</CODE> - The starting point to write to.<DT><B>Returns:</B><DD>The next place to be written to in the pngBytes array.</DL></DD></DL><HR><A NAME="writeInt4(int, int)"><!-- --></A><H3>writeInt4</H3><PRE>protected int <B>writeInt4</B>(int n, int offset)</PRE><DL><DD>Write a four-byte integer into the pngBytes array at a given position.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>n</CODE> - The integer to be written into pngBytes.<DD><CODE>offset</CODE> - The starting point to write to.<DT><B>Returns:</B><DD>The next place to be written to in the pngBytes array.</DL></DD></DL><HR><A NAME="writeByte(int, int)"><!-- --></A><H3>writeByte</H3><PRE>protected int <B>writeByte</B>(int b, int offset)</PRE><DL><DD>Write a single byte into the pngBytes array at a given position.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - The integer to be written into pngBytes.<DD><CODE>offset</CODE> - The starting point to write to.<DT><B>Returns:</B><DD>The next place to be written to in the pngBytes array.</DL></DD></DL><HR><A NAME="writeHeader()"><!-- --></A><H3>writeHeader</H3><PRE>protected void <B>writeHeader</B>()</PRE><DL><DD>Write a PNG "IHDR" chunk into the pngBytes array.<P><DD><DL></DL></DD></DL><HR><A NAME="filterSub(byte[], int, int)"><!-- --></A><H3>filterSub</H3><PRE>protected void <B>filterSub</B>(byte[] pixels, int startPos, int width)</PRE><DL><DD>Perform "sub" filtering on the given row. Uses temporary array leftBytes to store the original values of the previous pixels. The array is 16 bytes long, which will easily hold two-byte samples plus two-byte alpha.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>pixels</CODE> - The array holding the scan lines being built<DD><CODE>startPos</CODE> - Starting position within pixels of bytes to be filtered.<DD><CODE>width</CODE> - Width of a scanline in pixels.</DL></DD></DL><HR><A NAME="filterUp(byte[], int, int)"><!-- --></A><H3>filterUp</H3><PRE>protected void <B>filterUp</B>(byte[] pixels, int startPos, int width)</PRE><DL><DD>Perform "up" filtering on the given row. Side effect: refills the prior row with current row<P><DD><DL><DT><B>Parameters:</B><DD><CODE>pixels</CODE> - The array holding the scan lines being built<DD><CODE>startPos</CODE> - Starting position within pixels of bytes to be filtered.<DD><CODE>width</CODE> - Width of a scanline in pixels.</DL></DD></DL><HR><A NAME="writeImageData()"><!-- --></A><H3>writeImageData</H3><PRE>protected boolean <B>writeImageData</B>()</PRE><DL><DD>Write the image data into the pngBytes array. This will write one or more PNG "IDAT" chunks. In order to conserve memory, this method grabs as many rows as will fit into 32K bytes, or the whole image; whichever is less.<P><DD><DL><DT><B>Returns:</B><DD>true if no errors; false if error grabbing pixels</DL></DD></DL><HR><A NAME="writeEnd()"><!-- --></A><H3>writeEnd</H3><PRE>protected void <B>writeEnd</B>()</PRE><DL><DD>Write a PNG "IEND" chunk into the pngBytes array.<P><DD><DL></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=3 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="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../com/keypoint/PngEncoderB.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> <A HREF="PngEncoder.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -