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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pngencoder.java

?? l系統(tǒng) l系統(tǒng) l系統(tǒng) l系統(tǒng) l系統(tǒng) l系統(tǒng) l系統(tǒng) l系統(tǒng)
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
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;    }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美高清一区| www.亚洲在线| 一区二区三区不卡在线观看| caoporm超碰国产精品| 国产综合久久久久久久久久久久| 亚洲一区在线观看免费观看电影高清 | 日韩美女一区二区三区| 美腿丝袜亚洲三区| 国产精品久久久爽爽爽麻豆色哟哟 | 欧美激情综合网| 精品免费视频一区二区| 欧美日韩国产高清一区二区 | 精品国产不卡一区二区三区| 91久久久免费一区二区| 视频一区二区中文字幕| 亚洲国产你懂的| 亚洲女性喷水在线观看一区| 国产区在线观看成人精品| 日韩欧美激情在线| 日韩网站在线看片你懂的| 91精品办公室少妇高潮对白| 91同城在线观看| 欧美精品自拍偷拍| 一本高清dvd不卡在线观看| 国产资源精品在线观看| 色婷婷精品久久二区二区蜜臀av| 久久综合色播五月| 日韩中文欧美在线| 99视频精品全部免费在线| 韩国毛片一区二区三区| 亚洲欧美日韩国产成人精品影院| 国产99久久精品| 欧美一区二区三区的| 亚洲靠逼com| 成人黄色a**站在线观看| 日韩一区二区三免费高清| 亚洲欧洲国产日本综合| 狠狠狠色丁香婷婷综合久久五月| 欧美日韩另类一区| 中文字幕在线不卡| 国产九色精品成人porny| 欧美一区二区在线免费播放| 亚洲精品国产精华液| 大尺度一区二区| 欧美极品xxx| 久久精品国产99久久6| 欧美久久久一区| 亚洲aaa精品| 欧美va亚洲va香蕉在线| 国产精品麻豆一区二区| 免费观看91视频大全| 天天综合日日夜夜精品| 国产一区二区剧情av在线| 91在线视频免费91| 日韩无一区二区| 成人欧美一区二区三区小说| 秋霞电影一区二区| 成人少妇影院yyyy| 欧美精品99久久久**| 成人国产精品免费观看视频| 国产日韩欧美精品在线| 国产一区二区精品久久91| 久久精品欧美一区二区三区不卡| 国产综合久久久久久久久久久久| 久久久欧美精品sm网站| 国产一区二区免费看| 国产视频一区二区在线| 成人h精品动漫一区二区三区| 久久免费国产精品| 韩国av一区二区三区在线观看| 久久一留热品黄| 成人国产视频在线观看| 一区二区国产视频| 51久久夜色精品国产麻豆| 毛片av一区二区| 国产欧美日韩中文久久| 91麻豆福利精品推荐| 午夜久久久影院| 久久久久久久久97黄色工厂| 波多野结衣的一区二区三区| 一区二区三区四区亚洲| 欧美一区二区在线播放| 国产乱一区二区| 国产精品午夜免费| 精品视频一区二区不卡| 精品一区二区三区免费毛片爱| 国产日韩欧美综合在线| 91国模大尺度私拍在线视频| 日韩成人午夜精品| 精品欧美乱码久久久久久1区2区| 成人av网址在线| 丝袜亚洲精品中文字幕一区| 国产欧美一区二区精品久导航| 在线看不卡av| 国产在线精品一区二区| 亚洲免费成人av| 2020国产精品自拍| 欧美性三三影院| 国产精品亚洲视频| 午夜激情久久久| 中文成人av在线| 69av一区二区三区| 99久久婷婷国产综合精品电影 | 色婷婷av一区二区三区gif| 日本视频一区二区三区| 国产精品女同互慰在线看| 欧美一区二区私人影院日本| www.性欧美| 国产福利不卡视频| 日本美女一区二区三区| 亚洲精品福利视频网站| 久久久久久日产精品| 在线不卡一区二区| www.日韩大片| 福利一区二区在线观看| 国产成人福利片| 亚洲久本草在线中文字幕| 欧美性猛交xxxx乱大交退制版 | 国产欧美精品区一区二区三区 | 日韩丝袜美女视频| 欧美主播一区二区三区| 99精品久久只有精品| 国产一区二区视频在线| 精品在线播放免费| 美女网站色91| 美腿丝袜亚洲一区| 欧美a一区二区| 午夜国产精品影院在线观看| 亚洲精品国产成人久久av盗摄| 中文字幕在线观看不卡视频| 国产午夜精品一区二区三区嫩草| 精品日韩一区二区三区免费视频| 日韩欧美国产综合在线一区二区三区| 欧美精品视频www在线观看| 欧美三区在线观看| 欧美日韩一区二区在线观看| 欧美午夜理伦三级在线观看| 欧美亚洲一区三区| 91麻豆免费观看| 成人精品视频一区二区三区尤物| 国产成人在线免费| 国产福利一区二区| 成人三级伦理片| aa级大片欧美| 91麻豆产精品久久久久久| 91免费国产视频网站| 97精品久久久久中文字幕| 91浏览器打开| 在线精品视频免费观看| 欧美吞精做爰啪啪高潮| 91黄色免费版| 欧美精品 日韩| 日韩免费看网站| 久久综合九色综合久久久精品综合| 日韩一区二区在线观看视频| 日韩欧美专区在线| 国产欧美日韩在线视频| 亚洲欧美区自拍先锋| 午夜精彩视频在线观看不卡| 久久91精品久久久久久秒播| 国产福利精品一区二区| av电影一区二区| 欧美巨大另类极品videosbest | 国产一区 二区| 99久久精品免费观看| 欧美日韩久久久一区| 久久久欧美精品sm网站| 亚洲自拍偷拍网站| 久草这里只有精品视频| 91在线免费播放| 91精品久久久久久久91蜜桃 | 欧美日韩久久久| 久久久久久久久久看片| 亚洲自拍另类综合| 国产麻豆精品在线观看| 欧美综合一区二区三区| 久久综合九色综合欧美98| 亚洲乱码一区二区三区在线观看| 日本视频免费一区| www.亚洲在线| 精品国产免费久久| 一区二区三区欧美日韩| 67194成人在线观看| 欧美在线一二三| 717成人午夜免费福利电影| 欧美一区二区网站| 亚洲精品一区二区三区福利| 久久美女高清视频| 中文乱码免费一区二区| 免费av网站大全久久| 午夜精品福利一区二区三区蜜桃| 狠狠色丁香婷婷综合久久片| 在线免费观看视频一区| 久久综合久久综合九色| 又紧又大又爽精品一区二区| 国产一本一道久久香蕉| 欧美日韩视频在线一区二区| 国产精品18久久久久久久久久久久| 精品国产制服丝袜高跟| 国产一区不卡在线|