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

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

?? pngencoder.java

?? JfreeChart 常用圖表例子
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
     *     * @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) {        this.maxPos = Math.max(this.maxPos, offset + data.length);        if (data.length + offset > this.pngBytes.length) {            this.pngBytes = resizeByteArray(                this.pngBytes, this.pngBytes.length + Math.max(1000, data.length)            );        }        System.arraycopy(data, 0, this.pngBytes, offset, data.length);        return offset + data.length;    }    /**     * 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.     *     * @param data The data to be written into pngBytes.     * @param nBytes The number of bytes to be written.     * @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 nBytes, int offset) {        this.maxPos = Math.max(this.maxPos, offset + nBytes);        if (nBytes + offset > this.pngBytes.length) {            this.pngBytes = resizeByteArray(                this.pngBytes, this.pngBytes.length + Math.max(1000, nBytes)            );        }        System.arraycopy(data, 0, this.pngBytes, offset, nBytes);        return offset + nBytes;    }    /**     * Write a two-byte integer into the pngBytes array at a given position.     *     * @param n The integer 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 writeInt2(int n, int offset) {        byte[] temp = {(byte) ((n >> 8) & 0xff), (byte) (n & 0xff)};        return writeBytes(temp, offset);    }    /**     * Write a four-byte integer into the pngBytes array at a given position.     *     * @param n The integer 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 writeInt4(int n, int offset) {        byte[] temp = {(byte) ((n >> 24) & 0xff),                       (byte) ((n >> 16) & 0xff),                       (byte) ((n >> 8) & 0xff),                       (byte) (n & 0xff)};        return writeBytes(temp, offset);    }    /**     * Write a single byte into the pngBytes array at a given position.     *     * @param b The integer 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 writeByte(int b, int offset) {        byte[] temp = {(byte) b};        return writeBytes(temp, offset);    }    /**     * Write a PNG "IHDR" chunk into the pngBytes array.     */    protected void writeHeader() {        int startPos;        startPos = this.bytePos = writeInt4(13, this.bytePos);        this.bytePos = writeBytes(IHDR, this.bytePos);        this.width = this.image.getWidth(null);        this.height = this.image.getHeight(null);        this.bytePos = writeInt4(this.width, this.bytePos);        this.bytePos = writeInt4(this.height, this.bytePos);        this.bytePos = writeByte(8, this.bytePos); // bit depth        this.bytePos = writeByte((this.encodeAlpha) ? 6 : 2, this.bytePos); // direct model        this.bytePos = writeByte(0, this.bytePos); // compression method        this.bytePos = writeByte(0, this.bytePos); // filter method        this.bytePos = writeByte(0, this.bytePos); // no interlace        this.crc.reset();        this.crc.update(this.pngBytes, startPos, this.bytePos - startPos);        this.crcValue = this.crc.getValue();        this.bytePos = writeInt4((int) this.crcValue, this.bytePos);    }    /**     * 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.     *     * @param pixels The array holding the scan lines being built     * @param startPos Starting position within pixels of bytes to be filtered.     * @param width Width of a scanline in pixels.     */    protected void filterSub(byte[] pixels, int startPos, int width) {        int i;        int offset = this.bytesPerPixel;        int actualStart = startPos + offset;        int nBytes = width * this.bytesPerPixel;        int leftInsert = offset;        int leftExtract = 0;        for (i = actualStart; i < startPos + nBytes; i++) {            this.leftBytes[leftInsert] =  pixels[i];            pixels[i] = (byte) ((pixels[i] - this.leftBytes[leftExtract]) % 256);            leftInsert = (leftInsert + 1) % 0x0f;            leftExtract = (leftExtract + 1) % 0x0f;        }    }    /**     * Perform "up" filtering on the given row.     * Side effect: refills the prior row with current row     *     * @param pixels The array holding the scan lines being built     * @param startPos Starting position within pixels of bytes to be filtered.     * @param width Width of a scanline in pixels.     */    protected void filterUp(byte[] pixels, int startPos, int width) {        int     i, nBytes;        byte    currentByte;        nBytes = width * this.bytesPerPixel;        for (i = 0; i < nBytes; i++) {            currentByte = pixels[startPos + i];            pixels[startPos + i] = (byte) ((pixels[startPos  + i] - this.priorRow[i]) % 256);            this.priorRow[i] = currentByte;        }    }    /**     * 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.     *     *     * @return true if no errors; false if error grabbing pixels     */    protected boolean writeImageData() {        int rowsLeft = this.height;  // number of rows remaining to write        int startRow = 0;       // starting row to process this time through        int nRows;              // how many rows to grab at a time        byte[] scanLines;       // the scan lines to be compressed        int scanPos;            // where we are in the scan lines        int startPos;           // where this line's actual pixels start (used for filtering)        byte[] compressedLines; // the resultant compressed lines        int nCompressed;        // how big is the compressed area?        //int depth;              // color depth ( handle only 8 or 32 )        PixelGrabber pg;        this.bytesPerPixel = (this.encodeAlpha) ? 4 : 3;        Deflater scrunch = new Deflater(this.compressionLevel);        ByteArrayOutputStream outBytes = new ByteArrayOutputStream(1024);        DeflaterOutputStream compBytes = new DeflaterOutputStream(outBytes, scrunch);        try {            while (rowsLeft > 0) {                nRows = Math.min(32767 / (this.width * (this.bytesPerPixel + 1)), rowsLeft);                // nRows = rowsLeft;                int[] pixels = new int[this.width * nRows];                pg = new PixelGrabber(this.image, 0, startRow,                        this.width, nRows, pixels, 0, this.width);                try {                    pg.grabPixels();                }                catch (Exception e) {                    System.err.println("interrupted waiting for pixels!");                    return false;                }                if ((pg.getStatus() & ImageObserver.ABORT) != 0) {                    System.err.println("image fetch aborted or errored");                    return false;                }                /*                 * Create a data chunk. scanLines adds "nRows" for                 * the filter bytes.                 */                scanLines = new byte[this.width * nRows * this.bytesPerPixel +  nRows];                if (this.filter == FILTER_SUB) {                    this.leftBytes = new byte[16];                }                if (this.filter == FILTER_UP) {                    this.priorRow = new byte[this.width * this.bytesPerPixel];                }                scanPos = 0;                startPos = 1;                for (int i = 0; i < this.width * nRows; i++) {                    if (i % this.width == 0) {                        scanLines[scanPos++] = (byte) this.filter;                        startPos = scanPos;                    }                    scanLines[scanPos++] = (byte) ((pixels[i] >> 16) & 0xff);                    scanLines[scanPos++] = (byte) ((pixels[i] >>  8) & 0xff);                    scanLines[scanPos++] = (byte) ((pixels[i]) & 0xff);                    if (this.encodeAlpha) {                        scanLines[scanPos++] = (byte) ((pixels[i] >> 24) & 0xff);                    }                    if ((i % this.width == this.width - 1) && (this.filter != FILTER_NONE)) {                        if (this.filter == FILTER_SUB) {                            filterSub(scanLines, startPos, this.width);                        }                        if (this.filter == FILTER_UP) {                            filterUp(scanLines, startPos, this.width);                        }                    }                }                /*                 * Write these lines to the output area                 */                compBytes.write(scanLines, 0, scanPos);                startRow += nRows;                rowsLeft -= nRows;            }            compBytes.close();            /*             * Write the compressed bytes             */            compressedLines = outBytes.toByteArray();            nCompressed = compressedLines.length;            this.crc.reset();            this.bytePos = writeInt4(nCompressed, this.bytePos);            this.bytePos = writeBytes(IDAT, this.bytePos);            this.crc.update(IDAT);            this.bytePos = writeBytes(compressedLines, nCompressed, this.bytePos);            this.crc.update(compressedLines, 0, nCompressed);            this.crcValue = this.crc.getValue();            this.bytePos = writeInt4((int) this.crcValue, this.bytePos);            scrunch.finish();            return true;        }        catch (IOException e) {            System.err.println(e.toString());            return false;        }    }    /**     * Write a PNG "IEND" chunk into the pngBytes array.     */    protected void writeEnd() {        this.bytePos = writeInt4(0, this.bytePos);        this.bytePos = writeBytes(IEND, this.bytePos);        this.crc.reset();        this.crc.update(IEND);        this.crcValue = this.crc.getValue();        this.bytePos = writeInt4((int) this.crcValue, this.bytePos);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品福利一区二区蜜股av| 三级在线观看一区二区| 欧美视频一区二区三区四区| 日韩国产一二三区| 中文字幕在线一区| 欧美不卡一区二区| 欧美午夜不卡在线观看免费| 粗大黑人巨茎大战欧美成人| 蜜臀av性久久久久蜜臀aⅴ四虎 | 久久久久久免费| 91麻豆精品91久久久久同性| 91香蕉视频在线| 丁香婷婷综合五月| 精久久久久久久久久久| 亚洲成人一区二区| 亚洲柠檬福利资源导航| 日本一二三四高清不卡| 久久久久久久久伊人| 欧美一级免费观看| 欧美日韩卡一卡二| 色妹子一区二区| 99视频热这里只有精品免费| 国产精品一区二区在线看| 麻豆一区二区三| 日本欧美一区二区在线观看| 亚洲观看高清完整版在线观看| 成人欧美一区二区三区小说| 亚洲国产精品国自产拍av| 久久人人超碰精品| 久久久久9999亚洲精品| 久久伊99综合婷婷久久伊| 欧美成人精品高清在线播放| 91精品国产日韩91久久久久久| 在线观看成人免费视频| 欧美影院一区二区| 欧美日韩亚洲国产综合| 欧美色欧美亚洲另类二区| 欧美性三三影院| 欧美日韩一卡二卡| 欧美剧情片在线观看| 欧美精品久久久久久久久老牛影院| 欧美精品丝袜久久久中文字幕| 欧美日韩一二三| 5月丁香婷婷综合| 欧美一区二区女人| 精品欧美久久久| 2020国产精品自拍| 国产欧美日韩另类一区| 国产精品免费视频观看| 日韩码欧中文字| 亚洲一区二区在线观看视频 | 久久蜜桃av一区精品变态类天堂 | 一区二区视频免费在线观看| 亚洲美女精品一区| 亚洲香肠在线观看| 免费高清视频精品| 国内外成人在线| 国产suv精品一区二区三区| 岛国精品一区二区| 91成人在线免费观看| 欧美精品三级在线观看| 欧美一二三四区在线| 久久免费精品国产久精品久久久久| 国产精品视频观看| 亚洲与欧洲av电影| 美女视频黄a大片欧美| 高清国产一区二区| 91成人网在线| 日韩亚洲国产中文字幕欧美| 中文字幕av一区二区三区 | 激情综合五月婷婷| 99精品黄色片免费大全| 欧美二区在线观看| 精品国产1区二区| 亚洲天堂av一区| 日本一区中文字幕| 国产不卡在线播放| 欧美色电影在线| 久久久久久亚洲综合| 一级特黄大欧美久久久| 麻豆久久久久久| 99精品黄色片免费大全| 欧美一区国产二区| 中文字幕一区三区| 麻豆传媒一区二区三区| 91香蕉国产在线观看软件| 666欧美在线视频| 综合久久久久久久| 狠狠久久亚洲欧美| 欧美日韩精品电影| 中文在线资源观看网站视频免费不卡 | 成人免费高清视频| 欧美日韩国产综合一区二区三区| 久久综合色鬼综合色| 亚洲精品成a人| 国产制服丝袜一区| 欧美日韩在线综合| 国产精品久久久久四虎| 久久国内精品视频| 欧美性三三影院| 国产精品欧美一区二区三区| 老司机精品视频在线| 欧美亚洲日本国产| 国产精品美女久久久久久| 久久99精品国产.久久久久久 | 免费成人av资源网| 一本在线高清不卡dvd| 国产亚洲女人久久久久毛片| 亚洲成人三级小说| 91女神在线视频| 欧美国产精品v| 九九热在线视频观看这里只有精品| 欧美在线观看一二区| 中文字幕在线一区| 大美女一区二区三区| 国产亚洲综合色| 久久不见久久见中文字幕免费| 欧美亚洲日本一区| 一区二区三区欧美在线观看| 成人高清伦理免费影院在线观看| www国产成人免费观看视频 深夜成人网| 亚洲一二三区在线观看| 91亚洲午夜精品久久久久久| 国产精品视频在线看| 国产成人在线影院 | 久久夜色精品国产噜噜av| 日韩在线一区二区三区| 欧日韩精品视频| 亚洲欧美aⅴ...| 99久久免费国产| 亚洲色图一区二区三区| 91在线视频免费91| 国产精品白丝在线| 不卡一区二区中文字幕| 国产日产欧美一区二区视频| 国产一区欧美一区| 久久久欧美精品sm网站| 国产在线国偷精品免费看| 久久男人中文字幕资源站| 国产精品 日产精品 欧美精品| 精品精品国产高清a毛片牛牛| 久久精品噜噜噜成人88aⅴ| 欧美va亚洲va| 国产一区二区精品在线观看| 国产欧美日韩视频在线观看| 99久久国产免费看| 亚洲精品成人悠悠色影视| 欧美蜜桃一区二区三区| 欧美aaa在线| 久久久久久毛片| 91最新地址在线播放| 亚洲午夜久久久久久久久电影院| 欧美日韩激情在线| 久久精品国产一区二区三| 26uuu成人网一区二区三区| 国产成a人亚洲| 亚洲精品ww久久久久久p站 | 日韩欧美中文一区| 精品一区二区在线看| 久久老女人爱爱| 99精品国产视频| 天天综合网天天综合色| 精品国产第一区二区三区观看体验 | 国产精品久久久99| 欧美少妇bbb| 蜜臀av在线播放一区二区三区 | 日韩经典一区二区| 日韩亚洲电影在线| 国产a视频精品免费观看| 亚洲一二三四在线观看| 精品99999| 色乱码一区二区三区88| 美国毛片一区二区三区| ...av二区三区久久精品| 欧美疯狂做受xxxx富婆| 国产成人日日夜夜| 亚洲va欧美va人人爽| 国产日韩欧美一区二区三区综合| 91女人视频在线观看| 麻豆高清免费国产一区| 亚洲日本青草视频在线怡红院 | 亚洲国产日韩综合久久精品| 精品蜜桃在线看| 欧洲国内综合视频| 国产精品综合视频| 亚洲国产精品天堂| 日本一区二区三区四区在线视频| 日本乱码高清不卡字幕| 韩国欧美国产一区| 一区二区免费在线| 精品国产乱码久久久久久老虎| 91亚洲精品乱码久久久久久蜜桃| 开心九九激情九九欧美日韩精美视频电影 | 国产精品国产三级国产有无不卡 | 东方欧美亚洲色图在线| 日韩精品久久理论片| 亚洲视频一二三区| 久久亚洲精精品中文字幕早川悠里| 欧美日韩在线不卡| av成人老司机|