headerinfo.java
来自「jpeg2000编解码」· Java 代码 · 共 858 行 · 第 1/3 页
JAVA
858 行
case LY_RES_COMP_POS_PROG: str += " Progress. type : LY_RES_COMP_POS_PROG\n"; break; case RES_LY_COMP_POS_PROG: str += " Progress. type : RES_LY_COMP_POS_PROG\n"; break; case RES_POS_COMP_LY_PROG: str += " Progress. type : RES_POS_COMP_LY_PROG\n"; break; case POS_COMP_RES_LY_PROG: str += " Progress. type : POS_COMP_RES_LY_PROG\n"; break; case COMP_POS_RES_LY_PROG: str += " Progress. type : COMP_POS_RES_LY_PROG\n"; break; } str += " Num. of layers : "+sgcod_nl+"\n"; str += " Cblk dimension : "+(1<<(spcod_cw+2))+"x"+ (1<<(spcod_ch+2))+"\n"; switch (spcod_t[0]) { case W9X7: str += " Filter : 9-7 irreversible\n"; break; case W5X3: str += " Filter : 5-3 reversible\n"; break; } str += " Multi comp tr. : "+(sgcod_mct==1)+"\n"; if(spcod_ps!=null) { str += " Precincts : "; for(int i=0; i<spcod_ps.length; i++) { str += (1<<(spcod_ps[i] & 0x000F))+"x"+ (1<<(((spcod_ps[i] & 0x00F0)>>4)))+" "; } } str += "\n"; return str; } } /** Returns a new instance of COD */ public COD getNewCOD() { return new COD(); } /** Internal class holding information found in the COC marker segments */ public class COC { public int lcoc; public int ccoc; public int scoc; public int spcoc_ndl; // Number of decomposition levels public int spcoc_cw; public int spcoc_ch; public int spcoc_cs; public int[] spcoc_t = new int[1]; public int[] spcoc_ps; /** Display information found in this COC marker segment */ public String toString() { String str = "\n --- COC ("+lcoc+" bytes) ---\n"; str += " Component : "+ccoc+"\n"; str += " Coding style : "; if(scoc==0) { str += "Default"; } else { if((scoc&0x1)!=0) str += "Precints "; if((scoc&0x2)!=0) str += "SOP "; if((scoc&0x4)!=0) str += "EPH "; } str += "\n"; str += " Cblk style : "; if(spcoc_cs==0) { str += "Default"; } else { if((spcoc_cs&0x1)!=0) str += "Bypass "; if((spcoc_cs&0x2)!=0) str += "Reset "; if((spcoc_cs&0x4)!=0) str += "Terminate "; if((spcoc_cs&0x8)!=0) str += "Vert_causal "; if((spcoc_cs&0x10)!=0) str += "Predict "; if((spcoc_cs&0x20)!=0) str += "Seg_symb "; } str += "\n"; str += " Num. of levels : "+spcoc_ndl+"\n"; str += " Cblk dimension : "+(1<<(spcoc_cw+2))+"x"+ (1<<(spcoc_ch+2))+"\n"; switch (spcoc_t[0]) { case W9X7: str += " Filter : 9-7 irreversible\n"; break; case W5X3: str += " Filter : 5-3 reversible\n"; break; } if(spcoc_ps!=null) { str += " Precincts : "; for(int i=0; i<spcoc_ps.length; i++) { str += (1<<(spcoc_ps[i] & 0x000F))+"x"+ (1<<(((spcoc_ps[i] & 0x00F0)>>4)))+" "; } } str += "\n"; return str; } } /** Returns a new instance of COC */ public COC getNewCOC() { return new COC(); } /** Internal class holding information found in the RGN marker segments */ public class RGN { public int lrgn; public int crgn; public int srgn; public int sprgn; /** Display information found in this RGN marker segment */ public String toString() { String str = "\n --- RGN ("+lrgn+" bytes) ---\n"; str += " Component : "+crgn+"\n"; if(srgn==0) { str += " ROI style : Implicit\n"; } else { str += " ROI style : Unsupported\n"; } str += " ROI shift : "+sprgn+"\n"; str += "\n"; return str; } } /** Returns a new instance of RGN */ public RGN getNewRGN() { return new RGN(); } /** Internal class holding information found in the QCD marker segments */ public class QCD { public int lqcd; public int sqcd; public int[][] spqcd; private int qType = -1; public int getQuantType() { if(qType==-1) { qType = sqcd & ~(SQCX_GB_MSK<<SQCX_GB_SHIFT); } return qType; } private int gb = -1; public int getNumGuardBits() { if(gb==-1) { gb = (sqcd>>SQCX_GB_SHIFT)&SQCX_GB_MSK; } return gb; } /** Display information found in this QCD marker segment */ public String toString() { String str = "\n --- QCD ("+lqcd+" bytes) ---\n"; str += " Quant. type : "; int qt = getQuantType(); if(qt==SQCX_NO_QUANTIZATION) str += "No quantization \n"; else if(qt==SQCX_SCALAR_DERIVED) str += "Scalar derived\n"; else if(qt==SQCX_SCALAR_EXPOUNDED) str += "Scalar expounded\n"; str += " Guard bits : "+getNumGuardBits()+"\n"; if(qt==SQCX_NO_QUANTIZATION) { str += " Exponents :\n"; int exp; for (int i=0; i<spqcd.length; i++) { for(int j=0; j<spqcd[i].length; j++) { if (i==0 && j==0) { exp = (spqcd[0][0]>>SQCX_EXP_SHIFT)&SQCX_EXP_MASK; str += "\tr=0 : "+exp+"\n"; } else if (i!=0 && j>0) { exp = (spqcd[i][j]>>SQCX_EXP_SHIFT)&SQCX_EXP_MASK; str += "\tr="+i+",s="+j+" : "+exp+"\n"; } } } } else { str += " Exp / Mantissa : \n"; int exp; double mantissa; for (int i=0; i<spqcd.length; i++) { for(int j=0; j<spqcd[i].length; j++) { if (i==0 && j==0) { exp = (spqcd[0][0]>>11)&0x1f; mantissa = (-1f-((float)(spqcd[0][0]&0x07ff))/ (1<<11))/(-1<<exp); str += "\tr=0 : "+exp+" / "+mantissa+"\n"; } else if (i!=0 && j>0) { exp = (spqcd[i][j]>>11)&0x1f; mantissa = (-1f-((float)(spqcd[i][j]&0x07ff))/ (1<<11))/(-1<<exp); str += "\tr="+i+",s="+j+" : "+exp+" / "+ mantissa+"\n"; } } } } str += "\n"; return str; } } /** Returns a new instance of QCD */ public QCD getNewQCD() { return new QCD(); } /** Internal class holding information found in the QCC marker segments */ public class QCC { public int lqcc; public int cqcc; public int sqcc; public int[][] spqcc; private int qType = -1; public int getQuantType() { if(qType==-1) { qType = sqcc & ~(SQCX_GB_MSK<<SQCX_GB_SHIFT); } return qType; } private int gb = -1; public int getNumGuardBits() { if(gb==-1) { gb = (sqcc>>SQCX_GB_SHIFT)&SQCX_GB_MSK; } return gb; } /** Display information found in this QCC marker segment */ public String toString() { String str = "\n --- QCC ("+lqcc+" bytes) ---\n"; str += " Component : "+cqcc+"\n"; str += " Quant. type : "; int qt = getQuantType(); if(qt==SQCX_NO_QUANTIZATION) str += "No quantization \n"; else if(qt==SQCX_SCALAR_DERIVED) str += "Scalar derived\n"; else if(qt==SQCX_SCALAR_EXPOUNDED) str += "Scalar expounded\n"; str += " Guard bits : "+getNumGuardBits()+"\n"; if(qt==SQCX_NO_QUANTIZATION) { str += " Exponents :\n"; int exp; for (int i=0; i<spqcc.length; i++) { for(int j=0; j<spqcc[i].length; j++) { if (i==0 && j==0) { exp = (spqcc[0][0]>>SQCX_EXP_SHIFT)&SQCX_EXP_MASK; str += "\tr=0 : "+exp+"\n"; } else if (i!=0 && j>0) { exp = (spqcc[i][j]>>SQCX_EXP_SHIFT)&SQCX_EXP_MASK; str += "\tr="+i+",s="+j+" : "+exp+"\n"; } } } } else { str += " Exp / Mantissa : \n"; int exp; double mantissa; for (int i=0; i<spqcc.length; i++) { for(int j=0; j<spqcc[i].length; j++) { if (i==0 && j==0) { exp = (spqcc[0][0]>>11)&0x1f; mantissa = (-1f-((float)(spqcc[0][0]&0x07ff))/ (1<<11))/(-1<<exp); str += "\tr=0 : "+exp+" / "+mantissa+"\n"; } else if (i!=0 && j>0) { exp = (spqcc[i][j]>>11)&0x1f; mantissa = (-1f-((float)(spqcc[i][j]&0x07ff))/ (1<<11))/(-1<<exp); str += "\tr="+i+",s="+j+" : "+exp+" / "+ mantissa+"\n"; } } } } str += "\n"; return str; } } /** Returns a new instance of QCC */ public QCC getNewQCC() { return new QCC(); } /** Internal class holding information found in the POC marker segments */ public class POC { public int lpoc; public int[] rspoc; public int[] cspoc; public int[] lyepoc; public int[] repoc; public int[] cepoc; public int[] ppoc; /** Display information found in this POC marker segment */ public String toString() { String str = "\n --- POC ("+lpoc+" bytes) ---\n"; str += " Chg_idx RSpoc CSpoc LYEpoc REpoc CEpoc Ppoc\n"; for(int chg=0;chg<rspoc.length;chg++) {
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?