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

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

?? fileformatwriter.java

?? jpeg2000編解碼
?? JAVA
字號:
/* * cvs identifier: * * $Id: FileFormatWriter.java,v 1.1.1.1 2002/07/22 09:26:50 grosbois Exp $ *  * Class:                   FileFormatWriter * * Description:             Writes the file format * * * * COPYRIGHT: *  * This software module was originally developed by Rapha雔 Grosbois and * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel * Askel鰂 (Ericsson Radio Systems AB); and Bertrand Berthelot, David * Bouchard, F閘ix Henry, Gerard Mozelle and Patrice Onno (Canon Research * Centre France S.A) in the course of development of the JPEG2000 * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This * software module is an implementation of a part of the JPEG 2000 * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio * Systems AB and Canon Research Centre France S.A (collectively JJ2000 * Partners) agree not to assert against ISO/IEC and users of the JPEG * 2000 Standard (Users) any of their rights under the copyright, not * including other intellectual property rights, for this software module * with respect to the usage by ISO/IEC and Users of this software module * or modifications thereof for use in hardware or software products * claiming conformance to the JPEG 2000 Standard. Those intending to use * this software module in hardware or software products are advised that * their use may infringe existing patents. The original developers of * this software module, JJ2000 Partners and ISO/IEC assume no liability * for use of this software module or modifications thereof. No license * or right to this software module is granted for non JPEG 2000 Standard * conforming products. JJ2000 Partners have full right to use this * software module for his/her own purpose, assign or donate this * software module to any third party and to inhibit third parties from * using this software module for non JPEG 2000 Standard conforming * products. This copyright notice must be included in all copies or * derivative works of this software module. *  * Copyright (c) 1999/2000 JJ2000 Partners. *  */package jj2000.j2k.fileformat.writer;import jj2000.j2k.codestream.*;import jj2000.j2k.fileformat.*;import jj2000.j2k.io.*;import java.io.*;/** * This class writes the file format wrapper that may or may not exist around * a valid JPEG 2000 codestream. This class writes the simple possible legal * fileformat * * @see jj2000.j2k.fileformat.reader.FileFormatReader * */public class FileFormatWriter implements FileFormatBoxes{        /** The file from which to read the codestream and write file*/    private BEBufferedRandomAccessFile fi;    /** The name of the file from which to read the codestream and to write     * the JP2 file*/    private String filename;    /** Image height */    private int height;    /** Image width */    private int width;    /** Number of components */    private int nc;    /** Bits per component */    private int bpc[];    /** Flag indicating whether number of bits per component varies */    private boolean bpcVaries;    /** Length of codestream */    private int clength;    /** Length of Colour Specification Box */    private static final int CSB_LENGTH = 15;    /** Length of File Type Box */    private static final int FTB_LENGTH = 20;    /** Length of Image Header Box */    private static final int IHB_LENGTH = 22;    /** base length of Bits Per Component box */    private static final int BPC_LENGTH = 8;        /**      * The constructor of the FileFormatWriter. It receives all the     * information necessary about a codestream to generate a legal JP2 file     *     * @param filename The name of the file that is to be made a JP2 file     *     * @param height The height of the image     *     * @param width The width of the image     *     * @param nc The number of components     *     * @param bpc The number of bits per component     *      * @param clength Length of codestream      * */    public FileFormatWriter(String filename, int height, int width, int nc,                             int[] bpc, int clength){         this.height = height;        this.width = width;        this.nc = nc;        this.bpc = bpc;        this.filename=filename;        this.clength = clength;        bpcVaries=false;        int fixbpc = bpc[0];        for(int i=nc-1; i>0 ; i--){            if(bpc[i]!=fixbpc)                bpcVaries = true;        }              }    /**      * This method reads the codestream and writes the file format wrapper and     * the codestream to the same file     *     * @return The number of bytes increases because of the file format     *     * @exception java.io.IOException If an I/O error ocurred.     * */    public int writeFileFormat() throws IOException {        byte[] codestream;        try{            // Read and buffer the codestream            fi = new BEBufferedRandomAccessFile(filename,"rw+");            codestream= new byte[clength];            fi.readFully(codestream, 0, clength);            // Write the JP2_SINATURE_BOX            fi.seek(0);            fi.writeInt(0x0000000c);            fi.writeInt(JP2_SIGNATURE_BOX);            fi.writeInt(0x0d0a870a);                        // Write File Type box            writeFileTypeBox();                        // Write JP2 Header box            writeJP2HeaderBox();            // Write the Codestream box             writeContiguousCodeStreamBox(codestream);            fi.close();        }        catch(Exception e){            throw new Error("Error while writing JP2 file format");        }        if(bpcVaries)            return 12+FTB_LENGTH+8+IHB_LENGTH+CSB_LENGTH+BPC_LENGTH+nc+8;        else            return 12+FTB_LENGTH+8+IHB_LENGTH+CSB_LENGTH+8;    }    /**      * This method writes the File Type box     *     * @exception java.io.IOException If an I/O error ocurred.     * */    public void writeFileTypeBox()throws IOException {        // Write box length (LBox)        // LBox(4) + TBox (4) + BR(4) + MinV(4) + CL(4) = 20        fi.writeInt(FTB_LENGTH);        // Write File Type box (TBox)        fi.writeInt(FILE_TYPE_BOX);        // Write File Type data (DBox)        // Write Brand box (BR)        fi.writeInt(FT_BR);        // Write Minor Version        fi.writeInt(0);                // Write Compatibility list        fi.writeInt(FT_BR);            }    /**      * This method writes the JP2Header box     *     * @exception java.io.IOException If an I/O error ocurred.     * */    public void writeJP2HeaderBox()throws IOException {        // Write box length (LBox)        // if the number of bits per components varies, a bpcc box is written        if(bpcVaries)            fi.writeInt(8+IHB_LENGTH+CSB_LENGTH+BPC_LENGTH+nc);        else            fi.writeInt(8+IHB_LENGTH+CSB_LENGTH);        // Write a JP2Header (TBox)        fi.writeInt(JP2_HEADER_BOX);        // Write image header box         writeImageHeaderBox();        // Write Colour Bpecification Box        writeColourSpecificationBox();        // if the number of bits per components varies write bpcc box        if(bpcVaries)            writeBitsPerComponentBox();    }    /**      * This method writes the Bits Per Component box     *     * @exception java.io.IOException If an I/O error ocurred.     *     */    public void writeBitsPerComponentBox()throws IOException {        // Write box length (LBox)        fi.writeInt(BPC_LENGTH+nc);        // Write a Bits Per Component box (TBox)        fi.writeInt(BITS_PER_COMPONENT_BOX);        // Write bpc fields        for(int i=0;i<nc;i++){          fi.writeByte(bpc[i]-1);        }    }    /**      * This method writes the Colour Specification box     *     * @exception java.io.IOException If an I/O error ocurred.     *     */    public void writeColourSpecificationBox()throws IOException {        // Write box length (LBox)        fi.writeInt(CSB_LENGTH);        // Write a Bits Per Component box (TBox)        fi.writeInt(COLOUR_SPECIFICATION_BOX);        // Write METH field        fi.writeByte(CSB_METH);        // Write PREC field        fi.writeByte(CSB_PREC);        // Write APPROX field        fi.writeByte(CSB_APPROX);        // Write EnumCS field        if(nc>1)            fi.writeInt(CSB_ENUM_SRGB);        else            fi.writeInt(CSB_ENUM_GREY);           }    /**      * This method writes the Image Header box     *     * @exception java.io.IOException If an I/O error ocurred.     * */    public void writeImageHeaderBox()throws IOException {        // Write box length        fi.writeInt(IHB_LENGTH);        // Write ihdr box name        fi.writeInt(IMAGE_HEADER_BOX);        // Write HEIGHT field        fi.writeInt(height);        // Write WIDTH field        fi.writeInt(width);        // Write NC field        fi.writeShort(nc);        // Write BPC field        // if the number of bits per component varies write 0xff else write        // number of bits per components        if(bpcVaries)            fi.writeByte(0xff);        else            fi.writeByte(bpc[0]-1);        // Write C field        fi.writeByte(IMB_C);        // Write UnkC field        fi.writeByte(IMB_UnkC);        // Write IPR field        fi.writeByte(IMB_IPR);    }    /**      * This method writes the Contiguous codestream box     *     * @param cs The contiguous codestream     *     * @exception java.io.IOException If an I/O error ocurred.     * */    public void writeContiguousCodeStreamBox(byte[] cs)throws IOException {        // Write box length (LBox)        // This value is set to 0 since in this implementation, this box is        // always last        fi.writeInt(clength+8);        // Write contiguous codestream box name (TBox)        fi.writeInt(CONTIGUOUS_CODESTREAM_BOX);                        // Write codestream        for(int i=0; i<clength ;i++)            fi.writeByte(cs[i]);    }          } 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区观看| 成人欧美一区二区三区黑人麻豆 | 精品日韩在线观看| 蜜桃一区二区三区四区| 欧美大片国产精品| 国产精华液一区二区三区| 中文子幕无线码一区tr| 色哟哟一区二区三区| 性欧美大战久久久久久久久| 5566中文字幕一区二区电影| 国产真实乱对白精彩久久| 欧美韩日一区二区三区四区| 99久久久国产精品免费蜜臀| 亚洲精品乱码久久久久久黑人 | 欧美一级在线视频| 国产一区二区调教| 中文字幕亚洲成人| 欧美日韩第一区日日骚| 国产原创一区二区| 亚洲伦理在线精品| 日韩欧美专区在线| 国产精品国产三级国产普通话99| 爽好多水快深点欧美视频| 久久精品久久久精品美女| 久久久久久久久久久电影| 国产成人午夜高潮毛片| 一区二区三区免费观看| 久久亚洲捆绑美女| 欧美视频完全免费看| 经典三级一区二区| 亚洲精品自拍动漫在线| 欧美精品一区二区在线播放| 97久久超碰国产精品| 久久se这里有精品| 亚洲精品日韩综合观看成人91| 日韩欧美三级在线| 色狠狠av一区二区三区| 韩国av一区二区三区在线观看| 一区二区三区精品| 欧美国产欧美综合| 91.com视频| 91极品美女在线| 国产xxx精品视频大全| 日韩**一区毛片| 亚洲欧美日韩成人高清在线一区| 欧美va亚洲va香蕉在线| 欧美日韩三级一区| jizzjizzjizz欧美| 国产一区二区91| 美女网站视频久久| 一级做a爱片久久| 椎名由奈av一区二区三区| 久久久久久久精| 日韩精品一区二区三区四区| 欧美日韩亚洲丝袜制服| 91视频在线看| 成人黄色网址在线观看| 国产一本一道久久香蕉| 蜜臀国产一区二区三区在线播放 | 中文字幕精品一区二区三区精品| 日韩欧美久久久| 欧美日韩精品三区| 欧美性淫爽ww久久久久无| hitomi一区二区三区精品| 国产成a人无v码亚洲福利| 精品一区二区三区视频 | 日韩美女在线视频| 欧美丰满美乳xxx高潮www| 欧美在线一区二区三区| 色综合久久99| 色菇凉天天综合网| 91麻豆.com| 在线亚洲人成电影网站色www| 99久久99久久免费精品蜜臀| 不卡的av在线| 99re在线精品| 色88888久久久久久影院野外 | 国产乱理伦片在线观看夜一区| 美女任你摸久久| 精品一区二区三区久久久| 久久精品国产精品亚洲红杏 | 26uuu精品一区二区在线观看| 日韩一级免费观看| 日韩久久精品一区| 久久久久久一二三区| 国产女人水真多18毛片18精品视频| 久久众筹精品私拍模特| 国产区在线观看成人精品| 国产亚洲1区2区3区| 国产精品久久久久久一区二区三区 | 免费成人你懂的| 激情综合网天天干| 国产不卡视频在线观看| 99精品在线观看视频| 欧美性感一类影片在线播放| 欧美日韩精品三区| 精品福利av导航| 国产精品久久久久久福利一牛影视| 亚洲免费观看在线视频| 婷婷开心久久网| 国产一区二区h| 色94色欧美sute亚洲线路一久| 欧美精品高清视频| 国产亚洲精品精华液| 亚洲精品免费电影| 蜜臀精品久久久久久蜜臀| 成人性视频免费网站| 欧美图片一区二区三区| 久久综合网色—综合色88| 一区二区中文字幕在线| 日欧美一区二区| 国产成人三级在线观看| 在线观看日产精品| 欧美成人福利视频| 成人欧美一区二区三区在线播放| 三级久久三级久久久| 波多野结衣中文字幕一区二区三区| 在线观看日韩毛片| 久久久久国产精品免费免费搜索| 亚洲精品日日夜夜| 国产一区在线观看麻豆| 欧美午夜一区二区三区免费大片| 欧美精品一区二区三区蜜桃视频| 亚洲免费高清视频在线| 激情欧美日韩一区二区| 欧洲一区二区三区在线| 久久品道一品道久久精品| 亚洲高清免费在线| 成+人+亚洲+综合天堂| 日韩欧美国产综合| 亚洲午夜久久久久久久久电影网 | 首页亚洲欧美制服丝腿| 成人国产精品免费观看| 日韩精品中午字幕| 一二三四区精品视频| 风间由美一区二区av101| 3atv一区二区三区| 亚洲免费观看视频| 福利电影一区二区| 精品国产凹凸成av人导航| 午夜伦理一区二区| 色综合久久天天| 国产欧美日韩久久| 精品亚洲国内自在自线福利| 欧美日韩视频专区在线播放| 综合网在线视频| 粉嫩在线一区二区三区视频| 欧美xxx久久| 日本女人一区二区三区| 欧美日韩中文字幕一区二区| 亚洲欧美日韩一区二区| kk眼镜猥琐国模调教系列一区二区| 26uuu成人网一区二区三区| 免费亚洲电影在线| 欧美久久久久久久久久| 亚洲一区二区高清| 欧美性受极品xxxx喷水| 亚洲激情图片qvod| 色综合久久精品| 亚洲视频免费观看| 一本到高清视频免费精品| 国产精品毛片大码女人| 成人午夜精品一区二区三区| 久久精品一区四区| 国产69精品一区二区亚洲孕妇| 久久久国产精品午夜一区ai换脸| 黄色小说综合网站| 26uuu成人网一区二区三区| 国内精品不卡在线| 国产亚洲欧洲一区高清在线观看| 国产高清成人在线| 欧美极品另类videosde| 成人精品gif动图一区| 18欧美乱大交hd1984| 色婷婷综合久久久久中文| 亚洲精品五月天| 欧美日韩一区二区三区免费看| 亚洲午夜成aⅴ人片| 欧美日韩成人一区| 毛片av中文字幕一区二区| 26uuu另类欧美亚洲曰本| 成人性生交大片免费看视频在线| 中文字幕在线播放不卡一区| 色综合久久综合网| 亚洲成人av在线电影| 欧美成人一级视频| 国产成人精品一区二区三区四区 | 亚洲色图.com| 在线免费观看日本一区| 日本麻豆一区二区三区视频| 日韩精品专区在线影院重磅| 国产成a人亚洲精品| 有坂深雪av一区二区精品| 6080午夜不卡| 国产一区二区三区av电影| 亚洲欧洲综合另类在线| 欧美二区在线观看| 国产激情91久久精品导航 | 偷拍自拍另类欧美| 26uuu另类欧美亚洲曰本|