亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pngencoder.java

?? l系統 l系統 l系統 l系統 l系統 l系統 l系統 l系統
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package com.keypoint;/** * PngEncoder takes a Java Image object and creates a byte string which can be saved as a PNG file. * The Image is presumed to use the DirectColorModel. * * Thanks to Jay Denny at KeyPoint Software *    http://www.keypoint.com/ * who let me develop this code on company time. * * You may contact me with (probably very-much-needed) improvements, * comments, and bug fixes at: * *   david@catcode.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * A copy of the GNU LGPL may be found at * http://www.gnu.org/copyleft/lesser.html, * * @author J. David Eisenberg * @version 1.4, 31 March 2000 */import java.awt.*;import java.awt.image.*;import java.util.*;import java.util.zip.*;import java.io.*;public class PngEncoder extends Object{    /** Constant specifying that alpha channel should be encoded. */    public static final boolean ENCODE_ALPHA=true;    /** Constant specifying that alpha channel should not be encoded. */    public static final boolean NO_ALPHA=false;    /** Constants for filters */    public static final int FILTER_NONE = 0;    public static final int FILTER_SUB = 1;    public static final int FILTER_UP = 2;    public static final int FILTER_LAST = 2;    protected byte[] pngBytes;    protected byte[] priorRow;    protected byte[] leftBytes;    protected Image image;    protected int width, height;    protected int bytePos, maxPos;    protected int hdrPos, dataPos, endPos;    protected CRC32 crc = new CRC32();    protected long crcValue;    protected boolean encodeAlpha;    protected int filter;    protected int bytesPerPixel;    protected int compressionLevel;    /**     * Class constructor     *     */    public PngEncoder()    {        this( null, false, FILTER_NONE, 0 );    }    /**     * Class constructor specifying Image to encode, with no alpha channel encoding.     *     * @param image A Java Image object which uses the DirectColorModel     * @see java.awt.Image     */    public PngEncoder( Image image )    {        this(image, false, FILTER_NONE, 0);    }    /**     * Class constructor specifying Image to encode, and whether to encode alpha.     *     * @param image A Java Image object which uses the DirectColorModel     * @param encodeAlpha Encode the alpha channel? false=no; true=yes     * @see java.awt.Image     */    public PngEncoder( Image image, boolean encodeAlpha )    {        this(image, encodeAlpha, FILTER_NONE, 0);    }    /**     * Class constructor specifying Image to encode, whether to encode alpha, and filter to use.     *     * @param image A Java Image object which uses the DirectColorModel     * @param encodeAlpha Encode the alpha channel? false=no; true=yes     * @param whichFilter 0=none, 1=sub, 2=up     * @see java.awt.Image     */    public PngEncoder( Image image, boolean encodeAlpha, int whichFilter )    {        this( image, encodeAlpha, whichFilter, 0 );    }    /**     * Class constructor specifying Image source to encode, whether to encode alpha, filter to use, and compression level.     *     * @param image A Java Image object     * @param encodeAlpha Encode the alpha channel? false=no; true=yes     * @param whichFilter 0=none, 1=sub, 2=up     * @param compLevel 0..9     * @see java.awt.Image     */    public PngEncoder( Image image, boolean encodeAlpha, int whichFilter,       int compLevel)    {        this.image = image;        this.encodeAlpha = encodeAlpha;        setFilter( whichFilter );        if (compLevel >=0 && compLevel <=9)        {            this.compressionLevel = compLevel;        }    }    /**     * Set the image to be encoded     *     * @param image A Java Image object which uses the DirectColorModel     * @see java.awt.Image     * @see java.awt.image.DirectColorModel     */    public void setImage( Image image )    {        this.image = image;        pngBytes = null;    }    /**     * Creates an array of bytes that is the PNG equivalent of the current image, specifying whether to encode alpha or not.     *     * @param encodeAlpha boolean false=no alpha, true=encode alpha     * @return an array of bytes, or null if there was a problem     */    public byte[] pngEncode( boolean encodeAlpha )    {        byte[]  pngIdBytes = { -119, 80, 78, 71, 13, 10, 26, 10 };        int     i;        if (image == null)        {            return null;        }        width = image.getWidth( null );        height = image.getHeight( null );        this.image = image;        /*         * start with an array that is big enough to hold all the pixels         * (plus filter bytes), and an extra 200 bytes for header info         */        pngBytes = new byte[((width+1) * height * 3) + 200];        /*         * keep track of largest byte written to the array         */        maxPos = 0;        bytePos = writeBytes( pngIdBytes, 0 );        hdrPos = bytePos;        writeHeader();        dataPos = bytePos;        if (writeImageData())        {            writeEnd();            pngBytes = resizeByteArray( pngBytes, maxPos );        }        else        {            pngBytes = null;        }        return pngBytes;    }    /**     * Creates an array of bytes that is the PNG equivalent of the current image.     * Alpha encoding is determined by its setting in the constructor.     *     * @return an array of bytes, or null if there was a problem     */    public byte[] pngEncode()    {        return pngEncode( encodeAlpha );    }    /**     * Set the alpha encoding on or off.     *     * @param encodeAlpha  false=no, true=yes     */    public void setEncodeAlpha( boolean encodeAlpha )    {        this.encodeAlpha = encodeAlpha;    }    /**     * Retrieve alpha encoding status.     *     * @return boolean false=no, true=yes     */    public boolean getEncodeAlpha()    {        return encodeAlpha;    }    /**     * Set the filter to use     *     * @param whichFilter from constant list     */    public void setFilter( int whichFilter )    {        this.filter = FILTER_NONE;        if ( whichFilter <= FILTER_LAST )        {            this.filter = whichFilter;        }    }    /**     * Retrieve filtering scheme     *     * @return int (see constant list)     */    public int getFilter()    {        return filter;    }        /**     * Set the compression level to use     *     * @param level 0 through 9     */    public void setCompressionLevel( int level )    {        if ( level >= 0 && level <= 9)        {            this.compressionLevel = level;        }    }    /**     * Retrieve compression level     *     * @return int in range 0-9     */    public int getCompressionLevel()    {        return compressionLevel;    }    /**     * Increase or decrease the length of a byte array.     *     * @param array The original array.     * @param newLength The length you wish the new array to have.     * @return Array of newly desired length. If shorter than the     *         original, the trailing elements are truncated.     */    protected byte[] resizeByteArray( byte[] array, int newLength )    {        byte[]  newArray = new byte[newLength];        int     oldLength = array.length;        System.arraycopy( array, 0, newArray, 0,            Math.min( oldLength, newLength ) );        return newArray;    }    /**     * 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.     *     * @param data The data to be written into pngBytes.     * @param offset The starting point to write to.     * @return The next place to be written to in the pngBytes array.     */    protected int writeBytes( byte[] data, int offset )    {        maxPos = Math.max( maxPos, offset + data.length );        if (data.length + offset > pngBytes.length)        {            pngBytes = resizeByteArray( pngBytes, pngBytes.length +                Math.max( 1000, data.length ) );        }        System.arraycopy( data, 0, pngBytes, offset, data.length );        return offset + data.length;    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩不卡一区二区三区 | 亚洲线精品一区二区三区| 欧美精品一区二区三区在线| 欧美一区午夜视频在线观看| 欧美人体做爰大胆视频| 欧美人伦禁忌dvd放荡欲情| 色婷婷激情综合| 欧美伦理电影网| 日韩欧美一区二区免费| 久久先锋资源网| 国产欧美va欧美不卡在线| 国产精品无人区| 亚洲乱码国产乱码精品精的特点 | 久久蜜桃一区二区| 国产精品国产三级国产普通话99| 国产精品免费视频网站| 伊人婷婷欧美激情| 日本视频一区二区| 国产suv精品一区二区6| 色婷婷久久99综合精品jk白丝| 欧美网站大全在线观看| 日韩欧美一区中文| 国产天堂亚洲国产碰碰| 一区二区在线观看视频在线观看| 日本不卡一区二区| 国产成a人亚洲精品| 色婷婷综合久久久| 欧美一区二区大片| **性色生活片久久毛片| 日韩av在线发布| 成人av高清在线| 56国语精品自产拍在线观看| 久久精品视频在线免费观看| 亚洲影院理伦片| 国产精品白丝av| 欧美精品乱码久久久久久| 久久亚洲精精品中文字幕早川悠里| 自拍av一区二区三区| 美腿丝袜亚洲一区| 色综合激情五月| 欧美videossexotv100| 日韩一区在线播放| 黑人巨大精品欧美一区| 在线看国产日韩| 国产亚洲成年网址在线观看| 亚洲一区二区在线播放相泽| 国产精品99久久久久久有的能看| 欧美在线免费视屏| 国产精品网站一区| 久久精品av麻豆的观看方式| 色婷婷久久一区二区三区麻豆| 久久久国产午夜精品| 视频一区二区三区中文字幕| 91在线精品一区二区| 精品国产一区二区三区不卡| 亚洲大片精品永久免费| 99精品在线观看视频| 久久久一区二区| 韩国欧美一区二区| 678五月天丁香亚洲综合网| 亚洲一区在线观看视频| 91高清在线观看| 18欧美亚洲精品| 99精品热视频| 中文字幕第一区第二区| 国产91色综合久久免费分享| 久久综合久色欧美综合狠狠| 久久精品国产一区二区三区免费看| 欧美视频中文字幕| 亚洲精品精品亚洲| 在线免费观看日韩欧美| 亚洲精品欧美综合四区| 91女人视频在线观看| 亚洲欧美日韩在线不卡| 色噜噜狠狠成人网p站| 中文字幕一区二区日韩精品绯色| 成人午夜看片网址| 综合久久久久久久| 91麻豆123| 亚洲第一成年网| 欧美久久高跟鞋激| 日本大胆欧美人术艺术动态| 欧美一级艳片视频免费观看| 激情文学综合插| 国产精品欧美极品| 一本到一区二区三区| 亚洲a一区二区| 日韩欧美中文字幕制服| 国产精品性做久久久久久| 国产精品国产精品国产专区不片| jizzjizzjizz欧美| 一区二区久久久久| 91精品国产手机| 国产精品一区免费在线观看| 国产精品亲子伦对白| 欧美亚日韩国产aⅴ精品中极品| 性欧美大战久久久久久久久| 欧美大片一区二区三区| 成人免费毛片app| 亚洲国产日韩精品| 久久蜜臀精品av| 色婷婷久久一区二区三区麻豆| 日韩国产一二三区| 欧美国产一区二区| 欧美精品黑人性xxxx| 国产精品亚洲视频| 丝袜美腿一区二区三区| 中文字幕精品一区 | 久久精品国产一区二区三区免费看 | 国产精品资源在线| 亚洲女人****多毛耸耸8| 日韩限制级电影在线观看| 成人蜜臀av电影| 青青国产91久久久久久| 日韩毛片一二三区| 精品国产免费一区二区三区香蕉| 成人美女视频在线看| 蜜芽一区二区三区| 中文字幕亚洲视频| 日韩免费高清视频| 欧美三级电影网| 国产91高潮流白浆在线麻豆| 日韩激情在线观看| 亚洲综合图片区| 欧美韩日一区二区三区| 日韩一区二区三区av| 欧美体内she精视频| 91一区二区在线| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 69久久99精品久久久久婷婷| 99国产欧美久久久精品| 国产精品一区二区果冻传媒| 日韩高清不卡在线| 亚洲国产一区二区三区青草影视| 国产色婷婷亚洲99精品小说| 日韩一区二区三区电影在线观看| 在线精品视频免费播放| 成人av网站免费| 国产99久久久国产精品免费看| 日韩电影在线一区二区三区| 亚洲一二三区不卡| 亚洲乱码中文字幕| 亚洲欧美视频在线观看视频| 日韩免费看网站| 欧美亚洲综合一区| 色天使久久综合网天天| 亚洲成人av电影在线| 亚洲猫色日本管| 中文字幕日韩av资源站| 中文字幕精品在线不卡| 国产视频亚洲色图| 欧美亚洲日本国产| 国产精品人成在线观看免费| 一区二区三区精品在线| 久久国产精品色| 91传媒视频在线播放| 久久久久久久网| 天堂成人国产精品一区| 成人理论电影网| 日韩一区二区电影在线| 亚洲手机成人高清视频| 久久不见久久见免费视频1| 一本大道久久a久久精品综合| 欧美刺激午夜性久久久久久久| 亚洲色欲色欲www| 久久99精品久久久久久国产越南 | 欧美午夜免费电影| 国产欧美一区在线| 免费成人在线观看| 91国偷自产一区二区使用方法| 国产喂奶挤奶一区二区三区| 免费成人小视频| 欧美喷潮久久久xxxxx| 亚洲欧洲日韩av| 从欧美一区二区三区| 精品日韩在线一区| 水蜜桃久久夜色精品一区的特点| 91伊人久久大香线蕉| 欧美高清在线视频| 国产精品综合一区二区| 日韩精品在线一区| 日韩精品成人一区二区三区| 91福利国产精品| 亚洲欧美福利一区二区| 成av人片一区二区| 国产欧美日韩卡一| 国产jizzjizz一区二区| 国产日韩视频一区二区三区| 久久国产精品露脸对白| 日韩欧美激情一区| 免费欧美日韩国产三级电影| 在线综合+亚洲+欧美中文字幕| 亚洲va韩国va欧美va| 欧美日韩中文国产| 婷婷开心激情综合| 日韩一卡二卡三卡四卡| 亚洲va中文字幕| 337p亚洲精品色噜噜狠狠| 丝袜亚洲另类丝袜在线| 欧美高清hd18日本|