├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-ldpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── values │ └── strings.xml └── layout │ ├── reader.xml │ └── main.xml ├── README.md ├── project.properties ├── proguard-project.txt ├── src └── jj2000 │ ├── icc │ ├── ICCProfileException.java │ ├── lut │ │ ├── MonochromeTransformException.java │ │ ├── MatrixBasedTransformException.java │ │ ├── LookUpTableFPGamma.java │ │ ├── LookUpTable.java │ │ ├── LookUpTable32Gamma.java │ │ ├── LookUpTableFP.java │ │ ├── LookUpTableFPInterp.java │ │ ├── LookUpTable32Interp.java │ │ ├── LookUpTable32.java │ │ ├── LookUpTable32LinearSRGBtoSRGB.java │ │ └── MonochromeTransformTosRGB.java │ ├── ICCProfileInvalidException.java │ ├── MonochromeInputRestrictedProfile.java │ ├── tags │ │ ├── ICCXYZTypeReverse.java │ │ ├── ICCTextType.java │ │ ├── ICCTextDescriptionType.java │ │ ├── ICCXYZType.java │ │ ├── ICCCurveType.java │ │ ├── ICCCurveTypeReverse.java │ │ └── ICCTagTable.java │ ├── types │ │ ├── ICCProfileVersion.java │ │ ├── XYZNumber.java │ │ └── ICCDateTime.java │ ├── ICCMonochromeInputProfile.java │ ├── ICCMatrixBasedInputProfile.java │ ├── MatrixBasedRestrictedProfile.java │ └── RestrictedICCProfile.java │ ├── colorspace │ ├── ColorSpaceException.java │ └── boxes │ │ ├── ImageHeaderBox.java │ │ ├── ComponentMappingBox.java │ │ ├── ColorSpecificationBox.java │ │ ├── ChannelDefinitionBox.java │ │ ├── PaletteBox.java │ │ └── JP2Box.java │ ├── JJ2000Frontend.java │ └── j2k │ ├── wavelet │ ├── FilterTypes.java │ ├── synthesis │ │ ├── InvWTData.java │ │ ├── InvWT.java │ │ └── InverseWT.java │ └── WaveletTransform.java │ ├── util │ ├── StringFormatException.java │ └── ArrayUtil.java │ ├── roi │ └── MaxShiftSpec.java │ ├── quantization │ ├── dequantizer │ │ ├── DequantizerParams.java │ │ └── StdDequantizerParams.java │ └── QuantizationType.java │ ├── codestream │ ├── CBlkCoordInfo.java │ ├── CorruptedCodestreamException.java │ ├── CoordInfo.java │ ├── ProgressionType.java │ ├── PrecInfo.java │ └── reader │ │ └── CBlkInfo.java │ ├── NoNextElementException.java │ ├── image │ ├── Coord.java │ └── CompTransfSpec.java │ ├── io │ └── EndianType.java │ ├── NotImplementedError.java │ ├── entropy │ ├── CodedCBlk.java │ ├── decoder │ │ ├── DecLyrdCBlk.java │ │ └── CodedCBlkDataSrcDec.java │ └── StdEntropyCoderOptions.java │ ├── JJ2KInfo.java │ └── fileformat │ └── FileFormatBoxes.java └── AndroidManifest.xml /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soft-studio/NFC_DriversLicenseReader/HEAD/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soft-studio/NFC_DriversLicenseReader/HEAD/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soft-studio/NFC_DriversLicenseReader/HEAD/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soft-studio/NFC_DriversLicenseReader/HEAD/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | NFC_DriversLicenseReader 2 | ======================== 3 | 4 | AndroidNFC端末用の、運転免許証読み込みアプリです。 5 | アプリは、 6 | https://play.google.com/store/apps/details?id=jp.softstudio.DriversLicenseReader 7 | にて公開中。 8 | 9 | This software is released under the MIT License, 10 | 11 | AndroidStudio対応版は、 12 | https://github.com/soft-studio/NFC_DriversLicenseReader_AS 13 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-10 15 | -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /src/jj2000/icc/ICCProfileException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCProfileException.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | package jj2000.icc; 9 | 10 | /** 11 | * This exception is thrown when the content of a profile 12 | * is incorrect. 13 | * 14 | * @see jj2000.j2k.icc.ICCProfile 15 | * @version 1.0 16 | * @author Bruce A. Kern 17 | */ 18 | public class ICCProfileException extends Exception { 19 | 20 | /** 21 | * Contruct with message 22 | * @param msg returned by getMessage() 23 | */ 24 | public ICCProfileException (String msg) { 25 | super (msg); 26 | } 27 | 28 | 29 | /** 30 | * Empty constructor 31 | */ 32 | public ICCProfileException () { } 33 | } 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World, DriversLicenseReaderActivity! 5 | 運転免許証リーダー 6 | 7 | 暗証番号1 8 | 暗証番号2(本籍、写真) 9 | 読み取り開始 10 | 11 | 免許証をタッチしてください。 12 | 13 | 暗証番号が違います 14 | 正しく読み込めませんでした。 15 | 免許証がロックされてます。\n最寄りの警察署までご相談ください。 16 | 17 | 読み込み中です。運転免許証を離さないでください。 18 | 19 | 4桁 20 | 暗証番号2はオプションです。チェックボックスにチェックを入れることで有効となります。\n暗証番号を3回間違えると、以降読み出せなくなります。\nご注意ください。\n読み出せなくなった場合には、最寄りの警察署までご相談ください。\n暗証番号を設定されなかった場合には、空白のままで読み取り開始してください。(環境がないためテストしておりません。ご注意ください) 21 | 顔写真のデコードにはjj2000(https://code.google.com/p/jj2000/)を使用しております。 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/jj2000/icc/lut/MonochromeTransformException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: MonochromeTransformException.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.lut; 10 | 11 | /** 12 | * Exception thrown by MonochromeTransformTosRGB. 13 | * 14 | * @see jj2000.j2k.icc.lut.MonochromeTransformTosRGB 15 | * @version 1.0 16 | * @author Bruce A. Kern 17 | */ 18 | 19 | public class MonochromeTransformException extends Exception { 20 | 21 | /** 22 | * Contruct with message 23 | * @param msg returned by getMessage() 24 | */ 25 | MonochromeTransformException (String msg) { 26 | super (msg); } 27 | 28 | /** 29 | * Empty constructor 30 | */ 31 | MonochromeTransformException () { 32 | } 33 | 34 | /* end class MonochromeTransformException */ } 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/jj2000/icc/lut/MatrixBasedTransformException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: MatrixBasedTransformException.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.lut; 10 | 11 | /** 12 | * Thrown by MatrixBasedTransformTosRGB 13 | * 14 | * @see jj2000.j2k.icc.lut.MatrixBasedTransformTosRGB 15 | * @version 1.0 16 | * @author Bruce A. Kern 17 | */ 18 | 19 | public class MatrixBasedTransformException extends Exception { 20 | 21 | /** 22 | * Contruct with message 23 | * @param msg returned by getMessage() 24 | */ 25 | MatrixBasedTransformException (String msg) { 26 | super (msg); } 27 | 28 | 29 | /** 30 | * Empty constructor 31 | */ 32 | MatrixBasedTransformException () { 33 | } 34 | 35 | /* end class MatrixBasedTransformException */ } 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/jj2000/colorspace/ColorSpaceException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ColorSpaceException.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.colorspace; 10 | 11 | /** 12 | * This exception is thrown when the content of an 13 | * image contains an incorrect colorspace box 14 | * 15 | * @see jj2000.j2k.colorspace.ColorSpaceMapper 16 | * @version 1.0 17 | * @author Bruce A. Kern 18 | */ 19 | 20 | public class ColorSpaceException extends Exception { 21 | 22 | /** 23 | * Contruct with message 24 | * @param msg returned by getMessage() 25 | */ 26 | public ColorSpaceException (String msg) { 27 | super (msg); } 28 | 29 | 30 | /** 31 | * Empty constructor 32 | */ 33 | public ColorSpaceException () { 34 | } 35 | 36 | /* end class ColorSpaceException */ } 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/jj2000/icc/ICCProfileInvalidException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCProfileInvalidException.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc; 10 | 11 | /** 12 | * This exception is thrown when the content of an an icc profile 13 | * is in someway incorrect. 14 | * 15 | * @see jj2000.j2k.icc.ICCProfile 16 | * @version 1.0 17 | * @author Bruce A. Kern 18 | */ 19 | 20 | public class ICCProfileInvalidException extends ICCProfileException { 21 | 22 | /** 23 | * Contruct with message 24 | * @param msg returned by getMessage() 25 | */ 26 | ICCProfileInvalidException (String msg) { 27 | super (msg); } 28 | 29 | 30 | /** 31 | * Empty constructor 32 | */ 33 | ICCProfileInvalidException () { 34 | super ("icc profile is invalid"); } 35 | 36 | /* end class ICCProfileInvalidException */ } 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/jj2000/icc/lut/LookUpTableFPGamma.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: LookUpTableFPGamma.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.lut; 10 | 11 | import jj2000.icc.tags.ICCCurveType; 12 | 13 | /** 14 | * Class Description 15 | * 16 | * @version 1.0 17 | * @author Bruce A. Kern 18 | */ 19 | 20 | public class LookUpTableFPGamma extends LookUpTableFP { 21 | 22 | double dfE = -1; 23 | private static final String eol = System.getProperty("line.separator"); 24 | 25 | public LookUpTableFPGamma ( 26 | ICCCurveType curve, // Pointer to the curve data 27 | int dwNumInput // Number of input values in created LUT 28 | ) { 29 | super (curve, dwNumInput); 30 | 31 | // Gamma exponent for inverse transformation 32 | dfE = ICCCurveType.CurveGammaToDouble(curve.entry(0)); 33 | for (int i = 0; i < dwNumInput; i++) 34 | lut[i] = (float) Math.pow((double)i / (dwNumInput - 1), dfE); } 35 | 36 | 37 | /* end class LookUpTableFPGamma */ } 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /res/layout/reader.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 23 | 24 | 28 | 29 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/jj2000/icc/lut/LookUpTable.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: LookUpTable.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.lut; 10 | 11 | import jj2000.icc.tags.ICCCurveType; 12 | 13 | 14 | /** 15 | * Toplevel class for a lut. All lookup tables must 16 | * extend this class. 17 | * 18 | * @version 1.0 19 | * @author Bruce A. Kern 20 | */ 21 | public abstract class LookUpTable { 22 | 23 | /** End of line string. */ protected static final String eol = System.getProperty ("line.separator"); 24 | /** The curve data */ protected ICCCurveType curve = null; 25 | /** Number of values in created lut */ protected int dwNumInput = 0; 26 | 27 | 28 | /** 29 | * For subclass usage. 30 | * @param curve The curve data 31 | * @param dwNumInput Number of values in created lut 32 | */ 33 | protected LookUpTable ( 34 | ICCCurveType curve, 35 | int dwNumInput 36 | ) { 37 | this.curve = curve; 38 | this.dwNumInput = dwNumInput; } 39 | 40 | /* end class LookUpTable */ } 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/jj2000/icc/MonochromeInputRestrictedProfile.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: MonochromeInputRestrictedProfile.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc; 10 | 11 | import jj2000.icc.tags.ICCCurveType; 12 | 13 | /** 14 | * This class is a 1 component RestrictedICCProfile 15 | * 16 | * @version 1.0 17 | * @author Bruce A Kern 18 | */ 19 | public class MonochromeInputRestrictedProfile extends RestrictedICCProfile { 20 | 21 | /** 22 | * Factory method which returns a 1 component RestrictedICCProfile 23 | * @param c Gray TRC curve 24 | * @return the RestrictedICCProfile 25 | */ 26 | public static RestrictedICCProfile createInstance (ICCCurveType c) { 27 | return new MonochromeInputRestrictedProfile(c);} 28 | 29 | /** 30 | * Construct a 1 component RestrictedICCProfile 31 | * @param c Gray TRC curve 32 | */ 33 | private MonochromeInputRestrictedProfile (ICCCurveType c) { 34 | super (c); } 35 | 36 | /** 37 | * Get the type of RestrictedICCProfile for this object 38 | * @return kMonochromeInput 39 | */ 40 | public int getType () {return kMonochromeInput;} 41 | 42 | /* end class MonochromeInputRestrictedProfile */ } 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/jj2000/icc/tags/ICCXYZTypeReverse.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCXYZTypeReverse.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.tags; 10 | 11 | import jj2000.icc.ICCProfile; 12 | 13 | /** 14 | * A tag containing a triplet. 15 | * 16 | * @see jj2000.j2k.icc.tags.ICCXYZType 17 | * @see jj2000.j2k.icc.types.XYZNumber 18 | * @version 1.0 19 | * @author Bruce A. Kern 20 | */ 21 | public class ICCXYZTypeReverse extends ICCXYZType { 22 | 23 | /** x component */ public final long x; 24 | /** y component */ public final long y; 25 | /** z component */ public final long z; 26 | 27 | /** 28 | * Construct this tag from its constituant parts 29 | * @param signature tag id 30 | * @param data array of bytes 31 | * @param offset to data in the data array 32 | * @param length of data in the data array 33 | */ 34 | protected ICCXYZTypeReverse (int signature, byte [] data, int offset, int length) { 35 | super (signature, data, offset, length); 36 | z=ICCProfile.getInt (data, offset+2*ICCProfile.int_size); 37 | y=ICCProfile.getInt (data, offset+3*ICCProfile.int_size); 38 | x=ICCProfile.getInt (data, offset+4*ICCProfile.int_size); } 39 | 40 | 41 | /* end class ICCXYZTypeReverse */ } 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/jj2000/icc/tags/ICCTextType.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCTextType.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.tags; 10 | 11 | import jj2000.icc.ICCProfile; 12 | 13 | /** 14 | * A text based ICC tag 15 | * 16 | * @version 1.0 17 | * @author Bruce A. Kern 18 | */ 19 | public class ICCTextType extends ICCTag { 20 | 21 | /** Tag fields */ public final int type; 22 | /** Tag fields */ public final int reserved; 23 | /** Tag fields */ public final byte[] ascii; 24 | 25 | /** 26 | * Construct this tag from its constituant parts 27 | * @param signature tag id 28 | * @param data array of bytes 29 | * @param offset to data in the data array 30 | * @param length of data in the data array 31 | */ 32 | protected ICCTextType (int signature, byte [] data, int offset, int length) { 33 | super (signature, data, offset, length); 34 | type = ICCProfile.getInt (data, offset); 35 | offset += ICCProfile.int_size; 36 | reserved = ICCProfile.getInt (data, offset); 37 | offset += ICCProfile.int_size; 38 | int size = 0; 39 | while (data[offset+size]!=0) ++size; 40 | ascii = new byte [size]; 41 | System.arraycopy (data,offset,ascii,0,size); } 42 | 43 | 44 | /* end class ICCTextType */ } 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/jj2000/icc/lut/LookUpTable32Gamma.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: LookUpTable32Gamma.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.lut; 10 | 11 | import jj2000.icc.tags.ICCCurveType; 12 | 13 | /** 14 | * A Gamma based 32 bit lut. 15 | * 16 | * @see jj2000.j2k.icc.tags.ICCCurveType 17 | * @version 1.0 18 | * @author Bruce A. Kern 19 | */ 20 | 21 | public class LookUpTable32Gamma extends LookUpTable32 { 22 | 23 | 24 | /* Construct the lut 25 | * @param curve data 26 | * @param dwNumInput size of lut 27 | * @param dwMaxOutput max value of lut 28 | */ 29 | public LookUpTable32Gamma ( 30 | ICCCurveType curve, // Pointer to the curve data 31 | int dwNumInput, // Number of input values in created LUT 32 | int dwMaxOutput // Maximum output value of the LUT 33 | ) { 34 | super (curve, dwNumInput, dwMaxOutput); 35 | double dfE = ICCCurveType.CurveGammaToDouble(curve.entry(0)); // Gamma exponent for inverse transformation 36 | for (int i = 0; i < dwNumInput; i++) 37 | lut[i] = (int) Math.floor(Math.pow((double)i / (dwNumInput - 1), dfE) * dwMaxOutput + 0.5); } 38 | 39 | /* end class LookUpTable32Gamma */ } 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/jj2000/icc/types/ICCProfileVersion.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCProfileVersion.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.types; 10 | 11 | import java.io.IOException; 12 | import java.io.RandomAccessFile; 13 | import jj2000.icc.ICCProfile; 14 | 15 | /** 16 | * This class describes the ICCProfile Version as contained in 17 | * the header of the ICC Profile. 18 | * 19 | * @see jj2000.j2k.icc.ICCProfile 20 | * @see jj2000.j2k.icc.types.ICCProfileHeader 21 | * @version 1.0 22 | * @author Bruce A. Kern 23 | */ 24 | public class ICCProfileVersion { 25 | /** Field size */ public final static int size = 4 * ICCProfile.byte_size; 26 | 27 | /** Major revision number in binary coded decimal */ public byte uMajor; 28 | /** Minor revision in high nibble, bug fix revision 29 | in low nibble, both in binary coded decimal */ public byte uMinor; 30 | 31 | private byte reserved1; 32 | private byte reserved2; 33 | 34 | /** Construct from constituent parts. */ 35 | public ICCProfileVersion (byte major, byte minor, byte res1, byte res2) { 36 | uMajor = major; uMinor = minor; reserved1 = res1; reserved2 = res2; } 37 | 38 | /** Construct from file content. */ 39 | public void write (RandomAccessFile raf) throws IOException { 40 | raf.write(uMajor); raf.write(uMinor); raf.write(reserved1); raf.write(reserved2); } 41 | 42 | /* end class ICCProfileVersion */ } 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/jj2000/icc/types/XYZNumber.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: XYZNumber.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.types; 10 | 11 | import java.io.IOException; 12 | import java.io.RandomAccessFile; 13 | import jj2000.icc.ICCProfile; 14 | 15 | /** 16 | * A convientient representation for the contents of the 17 | * ICCXYZTypeTag class. 18 | * 19 | * @see jj2000.j2k.icc.tags.ICCXYZType 20 | * @version 1.0 21 | * @author Bruce A. Kern 22 | */ 23 | public class XYZNumber 24 | { 25 | public final static int size = 3 * ICCProfile.int_size; 26 | 27 | /** x value */public int dwX; // X tristimulus value 28 | /** y value */public int dwY; // Y tristimulus value 29 | /** z value */public int dwZ; // Z tristimulus value 30 | 31 | /** Construct from constituent parts. */ 32 | public XYZNumber (int x, int y, int z) { 33 | dwX = x; dwY = y; dwZ = z; } 34 | 35 | /** Normalization utility */ 36 | public static int DoubleToXYZ ( double x ) { 37 | return (int) Math.floor(x * 65536.0 + 0.5); } 38 | 39 | /** Normalization utility */ 40 | public static double XYZToDouble (int x) { 41 | return (double)x / 65536.0; } 42 | 43 | /** Write to a file */ 44 | public void write (RandomAccessFile raf) throws IOException { 45 | raf.writeInt (dwX); 46 | raf.writeInt (dwY); 47 | raf.writeInt (dwZ); } 48 | 49 | 50 | /* end class XYZNumber */ } 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/jj2000/icc/tags/ICCTextDescriptionType.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCTextDescriptionType.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.tags; 10 | 11 | import jj2000.icc.ICCProfile; 12 | 13 | /** 14 | * A text based ICC tag 15 | * 16 | * @version 1.0 17 | * @author Bruce A. Kern 18 | */ 19 | public class ICCTextDescriptionType extends ICCTag { 20 | 21 | /** Tag fields */ public final int type; 22 | /** Tag fields */ public final int reserved; 23 | /** Tag fields */ public final int size; 24 | /** Tag fields */ public final byte [] ascii; 25 | 26 | /** 27 | * Construct this tag from its constituant parts 28 | * @param signature tag id 29 | * @param data array of bytes 30 | * @param offset to data in the data array 31 | * @param length of data in the data array 32 | */ 33 | protected ICCTextDescriptionType (int signature, byte [] data, int offset, int length) { 34 | 35 | super (signature, data, offset, length); 36 | 37 | type = ICCProfile.getInt (data, offset); 38 | offset += ICCProfile.int_size; 39 | 40 | reserved = ICCProfile.getInt (data, offset); 41 | offset += ICCProfile.int_size; 42 | 43 | size = ICCProfile.getInt (data, offset); 44 | offset += ICCProfile.int_size; 45 | 46 | ascii = new byte [size-1]; 47 | System.arraycopy (data,offset,ascii,0,size-1); } 48 | 49 | /* end class ICCTextDescriptionType */ } 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/jj2000/icc/ICCMonochromeInputProfile.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCMonochromeInputProfile.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc; 10 | 11 | import java.io.InputStream; 12 | import java.io.File; 13 | import java.io.IOException; 14 | import jj2000.colorspace .ColorSpace; 15 | import jj2000.colorspace .ColorSpaceException; 16 | import jj2000.j2k.io.RandomAccessIO; 17 | 18 | /** 19 | * The monochrome ICCProfile. 20 | * 21 | * @version 1.0 22 | * @author Bruce A. Kern 23 | */ 24 | public class ICCMonochromeInputProfile extends ICCProfile { 25 | 26 | /** 27 | * Return the ICCProfile embedded in the input image 28 | * @param in jp2 image with embedded profile 29 | * @return ICCMonochromeInputProfile 30 | * @exception ColorSpaceICCProfileInvalidExceptionException 31 | * @exception 32 | */ 33 | public static ICCMonochromeInputProfile createInstance (ColorSpace csm) 34 | throws ColorSpaceException, ICCProfileInvalidException { 35 | return new ICCMonochromeInputProfile (csm); } 36 | 37 | /** 38 | * Construct a ICCMonochromeInputProfile corresponding to the profile file 39 | * @param f disk based ICCMonochromeInputProfile 40 | * @return theICCMonochromeInputProfile 41 | * @exception ColorSpaceException 42 | * @exception ICCProfileInvalidException 43 | */ 44 | protected ICCMonochromeInputProfile (ColorSpace csm) 45 | throws ColorSpaceException, ICCProfileInvalidException { 46 | super (csm); } 47 | 48 | /* end class ICCMonochromeInputProfile */ } 49 | -------------------------------------------------------------------------------- /src/jj2000/icc/types/ICCDateTime.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCDateTime.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.types; 10 | 11 | import java.io.IOException; 12 | import java.io.RandomAccessFile; 13 | import jj2000.icc.ICCProfile; 14 | 15 | /** 16 | * Date Time format for tags 17 | * 18 | * @version 1.0 19 | * @author Bruce A. Kern 20 | */ 21 | public class ICCDateTime 22 | { 23 | public final static int size = 6 * ICCProfile.short_size; 24 | 25 | /** Year datum. */ public short wYear; // Number of the actual year (i.e. 1994) 26 | /** Month datum. */ public short wMonth; // Number of the month (1-12) 27 | /** Day datum. */ public short wDay; // Number of the day 28 | /** Hour datum. */ public short wHours; // Number of hours (0-23) 29 | /** Minute datum. */ public short wMinutes; // Number of minutes (0-59) 30 | /** Second datum. */ public short wSeconds; // Number of seconds (0-59) 31 | 32 | /** Construct an ICCDateTime from parts */ 33 | public ICCDateTime (short year, short month, short day, short hour, short minute, short second) { 34 | wYear = year; wMonth = month; wDay = day; 35 | wHours = hour; wMinutes = minute; wSeconds = second; } 36 | 37 | /** Write an ICCDateTime to a file. */ 38 | public void write (RandomAccessFile raf) throws IOException { 39 | raf.writeShort(wYear); 40 | raf.writeShort(wMonth); 41 | raf.writeShort(wDay); 42 | raf.writeShort(wHours); 43 | raf.writeShort(wMinutes); 44 | raf.writeShort(wSeconds); } 45 | 46 | /* end class ICCDateTime*/ } 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/jj2000/icc/ICCMatrixBasedInputProfile.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCMatrixBasedInputProfile.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc; 10 | 11 | import java.io.InputStream; 12 | import java.io.File; 13 | import java.io.IOException; 14 | import jj2000.colorspace .ColorSpace; 15 | import jj2000.colorspace .ColorSpaceException; 16 | import jj2000.j2k.io.RandomAccessIO; 17 | 18 | /** 19 | * This class enables an application to construct an 3 component ICCProfile 20 | * 21 | * @version 1.0 22 | * @author Bruce A. Kern 23 | */ 24 | 25 | public class ICCMatrixBasedInputProfile extends ICCProfile { 26 | 27 | /** 28 | * Factory method to create ICCMatrixBasedInputProfile based on a 29 | * suppled profile file. 30 | * @param f contains a disk based ICCProfile. 31 | * @return the ICCMatrixBasedInputProfile 32 | * @exception ICCProfileInvalidException 33 | * @exception ColorSpaceException 34 | */ 35 | public static ICCMatrixBasedInputProfile createInstance (ColorSpace csm) 36 | throws ColorSpaceException, ICCProfileInvalidException { 37 | return new ICCMatrixBasedInputProfile (csm); } 38 | 39 | /** 40 | * Construct an ICCMatrixBasedInputProfile based on a 41 | * suppled profile file. 42 | * @param f contains a disk based ICCProfile. 43 | * @exception ColorSpaceException 44 | * @exception ICCProfileInvalidException 45 | */ 46 | protected ICCMatrixBasedInputProfile (ColorSpace csm) 47 | throws ColorSpaceException, ICCProfileInvalidException { 48 | super (csm); } 49 | 50 | /* end class ICCMatrixBasedInputProfile */ } 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/jj2000/icc/lut/LookUpTableFP.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: LookUpTableFP.java 166 2012-01-11 23:48:05Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.lut; 10 | 11 | import jj2000.icc.tags.ICCCurveType; 12 | 13 | /** 14 | * Toplevel class for a float [] lut. 15 | * 16 | * @version 1.0 17 | * @author Bruce A. Kern 18 | */ 19 | public abstract class LookUpTableFP extends LookUpTable { 20 | 21 | /** The lut values. */ public final float [] lut; 22 | 23 | /** 24 | * Factory method for getting a lut from a given curve. 25 | * @param curve the data 26 | * @param dwNumInput the size of the lut 27 | * @return the lookup table 28 | */ 29 | 30 | public static LookUpTableFP createInstance ( 31 | ICCCurveType curve, // Pointer to the curve data 32 | int dwNumInput // Number of input values in created LUT 33 | ) { 34 | 35 | if (curve.nEntries == 1) return new LookUpTableFPGamma (curve, dwNumInput); 36 | else return new LookUpTableFPInterp (curve, dwNumInput); } 37 | 38 | /** 39 | * Construct an empty lut 40 | * @param dwNumInput the size of the lut t lut. 41 | * @param dwMaxOutput max output value of the lut 42 | */ 43 | protected LookUpTableFP ( 44 | ICCCurveType curve, // Pointer to the curve data 45 | int dwNumInput // Number of input values in created LUT 46 | ) { 47 | super (curve, dwNumInput); 48 | lut = new float [dwNumInput]; } 49 | 50 | /** 51 | * lut accessor 52 | * @param index of the element 53 | * @return the lut [index] 54 | */ 55 | public final float elementAt ( int index ) { 56 | return lut [index]; } 57 | 58 | /* end class LookUpTableFP */ } 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/jj2000/colorspace/boxes/ImageHeaderBox.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ImageHeaderBox.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.colorspace.boxes; 10 | 11 | import jj2000.colorspace.ColorSpaceException; 12 | import jj2000.j2k.io.RandomAccessIO; 13 | import jj2000.icc.ICCProfile; 14 | 15 | import java.io.IOException; 16 | 17 | /** 18 | * This class models the Image Header box contained in a JP2 19 | * image. It is a stub class here since for colormapping the 20 | * knowlege of the existance of the box in the image is sufficient. 21 | * 22 | * @version 1.0 23 | * @author Bruce A. Kern 24 | */ 25 | public final class ImageHeaderBox extends JP2Box 26 | { 27 | static { type = 69686472; } 28 | 29 | long height; 30 | long width; 31 | int nc; 32 | short bpc; 33 | short c; 34 | boolean unk; 35 | boolean ipr; 36 | 37 | 38 | /** 39 | * Construct an ImageHeaderBox from an input image. 40 | * @param in RandomAccessIO jp2 image 41 | * @param boxStart offset to the start of the box in the image 42 | * @exception IOException, ColorSpaceException 43 | */ 44 | public ImageHeaderBox (RandomAccessIO in, int boxStart) 45 | throws IOException, ColorSpaceException { 46 | super (in, boxStart); 47 | readBox(); } 48 | 49 | 50 | /** Analyze the box content. */ 51 | void readBox() throws IOException { 52 | byte [] bfr = new byte [14]; 53 | in.seek(dataStart); 54 | in.readFully (bfr,0,14); 55 | 56 | height = ICCProfile.getInt(bfr,0); 57 | width = ICCProfile.getInt(bfr,4); 58 | nc = ICCProfile.getShort(bfr,8); 59 | bpc = (short) (bfr[10] & 0x00ff); 60 | c = (short) (bfr[11] & 0x00ff); 61 | unk = bfr[12]==0?true:false; 62 | ipr = bfr[13]==1?true:false; } 63 | 64 | /* end class ImageHeaderBox */ } 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/jj2000/icc/MatrixBasedRestrictedProfile.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: MatrixBasedRestrictedProfile.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc; 10 | 11 | import jj2000.icc.tags.ICCCurveType; 12 | import jj2000.icc.tags.ICCXYZType; 13 | 14 | /** 15 | * This class is a 3 component RestrictedICCProfile 16 | * 17 | * @version 1.0 18 | * @author Bruce A Kern 19 | */ 20 | public class MatrixBasedRestrictedProfile extends RestrictedICCProfile { 21 | 22 | /** 23 | * Factory method which returns a 3 component RestrictedICCProfile 24 | * @param rcurve Red TRC curve 25 | * @param gcurve Green TRC curve 26 | * @param bcurve Blue TRC curve 27 | * @param rcolorant Red colorant 28 | * @param gcolorant Green colorant 29 | * @param bcolorant Blue colorant 30 | * @return the RestrictedICCProfile 31 | */ 32 | public static RestrictedICCProfile createInstance (ICCCurveType rcurve, ICCCurveType gcurve, ICCCurveType bcurve, 33 | ICCXYZType rcolorant, ICCXYZType gcolorant, ICCXYZType bcolorant) { 34 | return new MatrixBasedRestrictedProfile(rcurve,gcurve,bcurve,rcolorant,gcolorant,bcolorant); } 35 | 36 | /** 37 | * Construct a 3 component RestrictedICCProfile 38 | * @param rcurve Red TRC curve 39 | * @param gcurve Green TRC curve 40 | * @param bcurve Blue TRC curve 41 | * @param rcolorant Red colorant 42 | * @param gcolorant Green colorant 43 | * @param bcolorant Blue colorant 44 | */ 45 | protected MatrixBasedRestrictedProfile (ICCCurveType rcurve, ICCCurveType gcurve, ICCCurveType bcurve, 46 | ICCXYZType rcolorant, ICCXYZType gcolorant, ICCXYZType bcolorant) { 47 | super (rcurve, gcurve, bcurve, rcolorant, gcolorant, bcolorant); } 48 | 49 | /** 50 | * Get the type of RestrictedICCProfile for this object 51 | * @return kThreeCompInput 52 | */ 53 | public int getType () {return kThreeCompInput;} 54 | 55 | /* end class MatrixBasedRestrictedProfile */ } 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/jj2000/icc/tags/ICCXYZType.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCXYZType.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.tags; 10 | 11 | import java.io.IOException; 12 | import java.io.RandomAccessFile; 13 | import jj2000.icc.ICCProfile; 14 | 15 | /** 16 | * A tag containing a triplet. 17 | * 18 | * @see jj2000.j2k.icc.tags.ICCXYZTypeReverse 19 | * @see jj2000.j2k.icc.types.XYZNumber 20 | * @version 1.0 21 | * @author Bruce A. Kern 22 | */ 23 | public class ICCXYZType extends ICCTag { 24 | 25 | /** x component */ public final long x; 26 | /** y component */ public final long y; 27 | /** z component */ public final long z; 28 | 29 | /** Normalization utility */ 30 | public static long DoubleToXYZ ( double x ) { 31 | return (long) Math.floor(x * 65536.0 + 0.5); } 32 | 33 | /** Normalization utility */ 34 | public static double XYZToDouble (long x) { 35 | return x / 65536.0; } 36 | 37 | /** 38 | * Construct this tag from its constituant parts 39 | * @param signature tag id 40 | * @param data array of bytes 41 | * @param offset to data in the data array 42 | * @param length of data in the data array 43 | */ 44 | protected ICCXYZType (int signature, byte [] data, int offset, int length) { 45 | super (signature, data, offset, length); 46 | x=ICCProfile.getInt (data, offset+2*ICCProfile.int_size); 47 | y=ICCProfile.getInt (data, offset+3*ICCProfile.int_size); 48 | z=ICCProfile.getInt (data, offset+4*ICCProfile.int_size); } 49 | 50 | 51 | /** Write to a file. */ 52 | public void write (RandomAccessFile raf) throws IOException { 53 | byte [] xb = ICCProfile.setLong (x); 54 | byte [] yb = ICCProfile.setLong (y); 55 | byte [] zb = ICCProfile.setLong (z); 56 | 57 | raf.write (xb, ICCProfile.int_size, 0); 58 | raf.write (yb, ICCProfile.int_size, 0); 59 | raf.write (zb, ICCProfile.int_size, 0); } 60 | 61 | 62 | /* end class ICCXYZType */ } 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/jj2000/icc/lut/LookUpTableFPInterp.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: LookUpTableFPInterp.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.lut; 10 | 11 | import jj2000.icc.tags.ICCCurveType; 12 | 13 | /** 14 | * An interpolated floating point lut 15 | * 16 | * @version 1.0 17 | * @author Bruce A.Kern 18 | */ 19 | public class LookUpTableFPInterp extends LookUpTableFP { 20 | 21 | /** 22 | * Construct the lut from the curve data 23 | * @oaram curve the data 24 | * @oaram dwNumInput the lut size 25 | */ 26 | public LookUpTableFPInterp ( 27 | ICCCurveType curve, // Pointer to the curve data 28 | int dwNumInput // Number of input values in created LUT 29 | ) { 30 | super (curve, dwNumInput); 31 | 32 | int dwLowIndex, dwHighIndex; // Indices of interpolation points 33 | double dfLowIndex, dfHighIndex; // FP indices of interpolation points 34 | double dfTargetIndex; // Target index into interpolation table 35 | double dfRatio; // Ratio of LUT input points to curve values 36 | double dfLow, dfHigh; // Interpolation values 37 | 38 | dfRatio = (double)(curve.nEntries-1) / (double)(dwNumInput-1); 39 | 40 | for (int i = 0; i < dwNumInput; i++) { 41 | dfTargetIndex = (double) i * dfRatio; 42 | dfLowIndex = Math.floor(dfTargetIndex); 43 | dwLowIndex = (int) dfLowIndex; 44 | dfHighIndex = Math.ceil(dfTargetIndex); 45 | dwHighIndex = (int) dfHighIndex; 46 | if (dwLowIndex == dwHighIndex) lut[i] = (float) ICCCurveType.CurveToDouble(curve.entry(dwLowIndex)); 47 | else { 48 | dfLow = ICCCurveType.CurveToDouble(curve.entry(dwLowIndex)); 49 | dfHigh = ICCCurveType.CurveToDouble(curve.entry(dwHighIndex)); 50 | lut[i] = (float) (dfLow + (dfHigh - dfLow) * (dfTargetIndex - dfLowIndex)); }}} 51 | 52 | /* end class LookUpTableFPInterp */ } 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/jj2000/icc/tags/ICCCurveType.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ICCCurveType.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.icc.tags; 10 | 11 | import jj2000.icc.ICCProfile; 12 | 13 | /** 14 | * The ICCCurve tag 15 | * 16 | * @version 1.0 17 | * @author Bruce A. Kern 18 | */ 19 | public class ICCCurveType extends ICCTag { 20 | 21 | private static final String eol = System.getProperty ("line.separator"); 22 | /** Tag fields */ public final int type; 23 | /** Tag fields */ public final int reserved; 24 | /** Tag fields */ public final int nEntries; 25 | /** Tag fields */ public final int [] entry; 26 | 27 | 28 | /** Normalization utility */ 29 | public static double CurveToDouble(int entry) 30 | { return (double) entry / 65535.0; } 31 | 32 | /** Normalization utility */ 33 | public static short DoubleToCurve(double entry) 34 | { return (short) Math.floor(entry * 65535.0 + 0.5); } 35 | 36 | /** Normalization utility */ 37 | public static double CurveGammaToDouble(int entry) 38 | { return (double)entry / 256.0; } 39 | 40 | 41 | /** 42 | * Construct this tag from its constituant parts 43 | * @param signature tag id 44 | * @param data array of bytes 45 | * @param offset to data in the data array 46 | * @param length of data in the data array 47 | */ 48 | protected ICCCurveType (int signature, byte [] data, int offset, int length) { 49 | super (signature, data, offset, offset+2*ICCProfile.int_size); 50 | type = ICCProfile.getInt (data, offset); 51 | reserved = ICCProfile.getInt (data, offset+ICCProfile.int_size); 52 | nEntries = ICCProfile.getInt (data, offset+2*ICCProfile.int_size); 53 | entry = new int [nEntries]; 54 | for (int i=0; i 5 | * 6 | * Copyright (c) 2012 Michael Roland 7 | * 8 | * ALL RIGHTS RESERVED. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 13 | * * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * * Neither the name Michael Roland nor the names of any contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | * DISCLAIMED. IN NO EVENT SHALL MICHAEL ROLAND BE LIABLE FOR ANY 26 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 29 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | package jj2000; 35 | 36 | import jj2000.j2k.decoder.Decoder; 37 | import jj2000.j2k.util.ParameterList; 38 | import android.graphics.Bitmap; 39 | 40 | /** 41 | * Frontend for JJ2000 library. 42 | */ 43 | public class JJ2000Frontend { 44 | /** The parameter info, with all possible options. */ 45 | private static String pinfoDecoder[][] = Decoder.getAllParameters(); 46 | 47 | public static Bitmap decode(byte[] input) { 48 | // Get the dfault parameter values 49 | ParameterList defpl = new ParameterList(); 50 | for (int i = pinfoDecoder.length - 1; i >= 0; --i) { 51 | if (pinfoDecoder[i][3] != null) { 52 | defpl.put(pinfoDecoder[i][0], pinfoDecoder[i][3]); 53 | } 54 | } 55 | 56 | ParameterList pl = new ParameterList(defpl); 57 | 58 | //pl.setProperty("rate", "3"); 59 | 60 | Decoder dec = new Decoder(pl); 61 | return dec.run(input); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/jj2000/j2k/wavelet/FilterTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CVS identifier: 3 | * 4 | * $Id: FilterTypes.java 166 2012-01-11 23:48:05Z mroland $ 5 | * 6 | * Class: FilterTypes 7 | * 8 | * Description: Defines the interface for Filter types 9 | * 10 | * 11 | * 12 | * COPYRIGHT: 13 | * 14 | * This software module was originally developed by Raphal Grosbois and 15 | * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel 16 | * Askelf (Ericsson Radio Systems AB); and Bertrand Berthelot, David 17 | * Bouchard, Flix Henry, Gerard Mozelle and Patrice Onno (Canon Research 18 | * Centre France S.A) in the course of development of the JPEG2000 19 | * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This 20 | * software module is an implementation of a part of the JPEG 2000 21 | * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio 22 | * Systems AB and Canon Research Centre France S.A (collectively JJ2000 23 | * Partners) agree not to assert against ISO/IEC and users of the JPEG 24 | * 2000 Standard (Users) any of their rights under the copyright, not 25 | * including other intellectual property rights, for this software module 26 | * with respect to the usage by ISO/IEC and Users of this software module 27 | * or modifications thereof for use in hardware or software products 28 | * claiming conformance to the JPEG 2000 Standard. Those intending to use 29 | * this software module in hardware or software products are advised that 30 | * their use may infringe existing patents. The original developers of 31 | * this software module, JJ2000 Partners and ISO/IEC assume no liability 32 | * for use of this software module or modifications thereof. No license 33 | * or right to this software module is granted for non JPEG 2000 Standard 34 | * conforming products. JJ2000 Partners have full right to use this 35 | * software module for his/her own purpose, assign or donate this 36 | * software module to any third party and to inhibit third parties from 37 | * using this software module for non JPEG 2000 Standard conforming 38 | * products. This copyright notice must be included in all copies or 39 | * derivative works of this software module. 40 | * 41 | * Copyright (c) 1999/2000 JJ2000 Partners. 42 | * */ 43 | package jj2000.j2k.wavelet; 44 | 45 | /** 46 | * This interface defines the identifiers for the different types of filters 47 | * that are supported. 48 | * 49 | *

The identifier values are the same as those used in the codestream 50 | * syntax, for the filters that are defined in the standard.

51 | * */ 52 | public interface FilterTypes { 53 | 54 | /** W7x9 filter: 0x00 */ 55 | public final static int W9X7 = 0; 56 | 57 | /** W5x3 filter: 0x01 */ 58 | public final static int W5X3 = 1; 59 | 60 | /** User-defined filter: -1 */ 61 | public final static int CUSTOM = -1; 62 | } 63 | -------------------------------------------------------------------------------- /src/jj2000/j2k/util/StringFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CVS identifier: 3 | * 4 | * $Id: StringFormatException.java 166 2012-01-11 23:48:05Z mroland $ 5 | * 6 | * Class: ArgumentFormatException 7 | * 8 | * Description: Exception for badly formatted string 9 | * argument exceptions. 10 | * 11 | * 12 | * 13 | * COPYRIGHT: 14 | * 15 | * This software module was originally developed by Raphal Grosbois and 16 | * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel 17 | * Askelf (Ericsson Radio Systems AB); and Bertrand Berthelot, David 18 | * Bouchard, Flix Henry, Gerard Mozelle and Patrice Onno (Canon Research 19 | * Centre France S.A) in the course of development of the JPEG2000 20 | * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This 21 | * software module is an implementation of a part of the JPEG 2000 22 | * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio 23 | * Systems AB and Canon Research Centre France S.A (collectively JJ2000 24 | * Partners) agree not to assert against ISO/IEC and users of the JPEG 25 | * 2000 Standard (Users) any of their rights under the copyright, not 26 | * including other intellectual property rights, for this software module 27 | * with respect to the usage by ISO/IEC and Users of this software module 28 | * or modifications thereof for use in hardware or software products 29 | * claiming conformance to the JPEG 2000 Standard. Those intending to use 30 | * this software module in hardware or software products are advised that 31 | * their use may infringe existing patents. The original developers of 32 | * this software module, JJ2000 Partners and ISO/IEC assume no liability 33 | * for use of this software module or modifications thereof. No license 34 | * or right to this software module is granted for non JPEG 2000 Standard 35 | * conforming products. JJ2000 Partners have full right to use this 36 | * software module for his/her own purpose, assign or donate this 37 | * software module to any third party and to inhibit third parties from 38 | * using this software module for non JPEG 2000 Standard conforming 39 | * products. This copyright notice must be included in all copies or 40 | * derivative works of this software module. 41 | * 42 | * Copyright (c) 1999/2000 JJ2000 Partners. 43 | * 44 | * 45 | * 46 | */ 47 | 48 | 49 | package jj2000.j2k.util; 50 | 51 | /** 52 | * Thrown to indicate that the application has attempted to parse a 53 | * badly formatted string. 54 | * */ 55 | public class StringFormatException extends IllegalArgumentException { 56 | 57 | /** 58 | * Creates the exception with an empty messgage. 59 | * 60 | * 61 | * */ 62 | public StringFormatException() { 63 | super(); 64 | } 65 | 66 | /** 67 | * Creates the exception with the specified detail message. 68 | * 69 | * @param s The detail message 70 | * 71 | * 72 | * */ 73 | public StringFormatException(String s) { 74 | super(s); 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /src/jj2000/colorspace/boxes/ComponentMappingBox.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: ComponentMappingBox.java 169 2012-01-15 18:33:24Z mroland $ 4 | * 5 | * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 6 | * $Date $ 7 | *****************************************************************************/ 8 | 9 | package jj2000.colorspace.boxes; 10 | 11 | import jj2000.colorspace.ColorSpaceException; 12 | import jj2000.icc.ICCProfile; 13 | import jj2000.j2k.io.RandomAccessIO; 14 | 15 | import java.io.IOException; 16 | import java.util.Vector; 17 | 18 | /** 19 | * This class maps the components in the codestream 20 | * to channels in the image. It models the Component 21 | * Mapping box in the JP2 header. 22 | * 23 | * @version 1.0 24 | * @author Bruce A. Kern 25 | */ 26 | public final class ComponentMappingBox extends JP2Box 27 | { 28 | static { type = 0x636d6170; } 29 | 30 | private int nChannels; 31 | private Vector map = new Vector(); 32 | 33 | /** 34 | * Construct a ComponentMappingBox from an input image. 35 | * @param in RandomAccessIO jp2 image 36 | * @param boxStart offset to the start of the box in the image 37 | * @exception IOException, ColorSpaceException 38 | */ 39 | public ComponentMappingBox (RandomAccessIO in, int boxStart) 40 | throws IOException, ColorSpaceException { 41 | super (in, boxStart); 42 | readBox(); } 43 | 44 | /** Analyze the box content. */ 45 | void readBox() throws IOException { 46 | nChannels = (boxEnd-dataStart) / 4; 47 | in.seek(dataStart); 48 | for (int offset=dataStart; offsetNoNextElementException exception with no 60 | * detail message. 61 | * 62 | * 63 | */ 64 | public NoNextElementException() { 65 | super(); 66 | } 67 | 68 | /** 69 | * Constructs a new NoNextElementException exception with 70 | * the specified detail message. 71 | * 72 | * @param s The detail message. 73 | * 74 | * */ 75 | public NoNextElementException(String s) { 76 | super(s); 77 | } 78 | 79 | } 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/jj2000/j2k/quantization/QuantizationType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CVS identifier: 3 | * 4 | * $Id: QuantizationType.java 166 2012-01-11 23:48:05Z mroland $ 5 | * 6 | * Class: QuantizationType 7 | * 8 | * Description: This interface defines the possible 9 | * quantization types. 10 | * 11 | * 12 | * 13 | * COPYRIGHT: 14 | * 15 | * This software module was originally developed by Raphal Grosbois and 16 | * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel 17 | * Askelf (Ericsson Radio Systems AB); and Bertrand Berthelot, David 18 | * Bouchard, Flix Henry, Gerard Mozelle and Patrice Onno (Canon Research 19 | * Centre France S.A) in the course of development of the JPEG2000 20 | * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This 21 | * software module is an implementation of a part of the JPEG 2000 22 | * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio 23 | * Systems AB and Canon Research Centre France S.A (collectively JJ2000 24 | * Partners) agree not to assert against ISO/IEC and users of the JPEG 25 | * 2000 Standard (Users) any of their rights under the copyright, not 26 | * including other intellectual property rights, for this software module 27 | * with respect to the usage by ISO/IEC and Users of this software module 28 | * or modifications thereof for use in hardware or software products 29 | * claiming conformance to the JPEG 2000 Standard. Those intending to use 30 | * this software module in hardware or software products are advised that 31 | * their use may infringe existing patents. The original developers of 32 | * this software module, JJ2000 Partners and ISO/IEC assume no liability 33 | * for use of this software module or modifications thereof. No license 34 | * or right to this software module is granted for non JPEG 2000 Standard 35 | * conforming products. JJ2000 Partners have full right to use this 36 | * software module for his/her own purpose, assign or donate this 37 | * software module to any third party and to inhibit third parties from 38 | * using this software module for non JPEG 2000 Standard conforming 39 | * products. This copyright notice must be included in all copies or 40 | * derivative works of this software module. 41 | * 42 | * Copyright (c) 1999/2000 JJ2000 Partners. 43 | * 44 | * 45 | * 46 | */ 47 | 48 | 49 | package jj2000.j2k.quantization; 50 | 51 | /** 52 | * This interface defines the IDs of the possible quantization types. JPEG 53 | * 2000 part I support only the scalar quantization with dead zone. However 54 | * other quantization type may be defined in JPEG 2000 extensions (for 55 | * instance Trellis Coded Quantization). 56 | * 57 | *

This interface defines the constants only. In order to use the 58 | * constants in any other class you can either use the fully qualified 59 | * name (e.g., QuantizationType.Q_TYPE_SCALAR_DZ) or declare 60 | * this interface in the implements clause of the class and then 61 | * access the identifier directly. 62 | * */ 63 | public interface QuantizationType { 64 | 65 | /** The ID of the scalar deadzone dequantizer */ 66 | public final static int Q_TYPE_SCALAR_DZ = 0; 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/jj2000/j2k/codestream/CorruptedCodestreamException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CVS identifier: 3 | * 4 | * $Id: CorruptedCodestreamException.java,v 1.6 2000/09/05 09:22:33 grosbois 5 | * Exp $ 6 | * 7 | * Class: CorruptedCodestreamException 8 | * 9 | * Description: Exception thrown when illegal bit stream 10 | * values are decoded. 11 | * 12 | * 13 | * 14 | * COPYRIGHT: 15 | * 16 | * This software module was originally developed by Raphal Grosbois and 17 | * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel 18 | * Askelf (Ericsson Radio Systems AB); and Bertrand Berthelot, David 19 | * Bouchard, Flix Henry, Gerard Mozelle and Patrice Onno (Canon Research 20 | * Centre France S.A) in the course of development of the JPEG2000 21 | * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This 22 | * software module is an implementation of a part of the JPEG 2000 23 | * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio 24 | * Systems AB and Canon Research Centre France S.A (collectively JJ2000 25 | * Partners) agree not to assert against ISO/IEC and users of the JPEG 26 | * 2000 Standard (Users) any of their rights under the copyright, not 27 | * including other intellectual property rights, for this software module 28 | * with respect to the usage by ISO/IEC and Users of this software module 29 | * or modifications thereof for use in hardware or software products 30 | * claiming conformance to the JPEG 2000 Standard. Those intending to use 31 | * this software module in hardware or software products are advised that 32 | * their use may infringe existing patents. The original developers of 33 | * this software module, JJ2000 Partners and ISO/IEC assume no liability 34 | * for use of this software module or modifications thereof. No license 35 | * or right to this software module is granted for non JPEG 2000 Standard 36 | * conforming products. JJ2000 Partners have full right to use this 37 | * software module for his/her own purpose, assign or donate this 38 | * software module to any third party and to inhibit third parties from 39 | * using this software module for non JPEG 2000 Standard conforming 40 | * products. This copyright notice must be included in all copies or 41 | * derivative works of this software module. 42 | * 43 | * Copyright (c) 1999/2000 JJ2000 Partners. 44 | * */ 45 | package jj2000.j2k.codestream; 46 | 47 | import java.io.*; 48 | 49 | /** 50 | * This exception is thrown whenever an illegal value is read from a bit 51 | * stream. The cause can be either a corrupted bit stream, or a a bit stream 52 | * which is illegal. 53 | * */ 54 | public class CorruptedCodestreamException extends IOException { 55 | 56 | /** 57 | * Constructs a new CorruptedCodestreamException exception with 58 | * no detail message. 59 | * */ 60 | public CorruptedCodestreamException() { 61 | super(); 62 | } 63 | 64 | /** 65 | * Constructs a new CorruptedCodestreamException exception with 66 | * the specified detail message. 67 | * 68 | * @param s The detail message. 69 | * */ 70 | public CorruptedCodestreamException(String s) { 71 | super(s); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/jj2000/j2k/image/Coord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CVS identifier: 3 | * 4 | * $Id: Coord.java 169 2012-01-15 18:33:24Z mroland $ 5 | * 6 | * Class: Coord 7 | * 8 | * Description: Class for storage of 2-D coordinates 9 | * 10 | * 11 | * 12 | * COPYRIGHT: 13 | * 14 | * This software module was originally developed by Raphal Grosbois and 15 | * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel 16 | * Askelf (Ericsson Radio Systems AB); and Bertrand Berthelot, David 17 | * Bouchard, Flix Henry, Gerard Mozelle and Patrice Onno (Canon Research 18 | * Centre France S.A) in the course of development of the JPEG2000 19 | * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This 20 | * software module is an implementation of a part of the JPEG 2000 21 | * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio 22 | * Systems AB and Canon Research Centre France S.A (collectively JJ2000 23 | * Partners) agree not to assert against ISO/IEC and users of the JPEG 24 | * 2000 Standard (Users) any of their rights under the copyright, not 25 | * including other intellectual property rights, for this software module 26 | * with respect to the usage by ISO/IEC and Users of this software module 27 | * or modifications thereof for use in hardware or software products 28 | * claiming conformance to the JPEG 2000 Standard. Those intending to use 29 | * this software module in hardware or software products are advised that 30 | * their use may infringe existing patents. The original developers of 31 | * this software module, JJ2000 Partners and ISO/IEC assume no liability 32 | * for use of this software module or modifications thereof. No license 33 | * or right to this software module is granted for non JPEG 2000 Standard 34 | * conforming products. JJ2000 Partners have full right to use this 35 | * software module for his/her own purpose, assign or donate this 36 | * software module to any third party and to inhibit third parties from 37 | * using this software module for non JPEG 2000 Standard conforming 38 | * products. This copyright notice must be included in all copies or 39 | * derivative works of this software module. 40 | * 41 | * Copyright (c) 1999/2000 JJ2000 Partners. 42 | * */ 43 | package jj2000.j2k.image; 44 | 45 | /** 46 | * This class represents 2-D coordinates. 47 | * */ 48 | public class Coord { 49 | /** The horizontal coordinate */ 50 | public int x; 51 | 52 | /** The vertical coordinate */ 53 | public int y; 54 | 55 | /** 56 | * Creates a new coordinate object given with the (0,0) coordinates 57 | * */ 58 | public Coord() { } 59 | 60 | /** 61 | * Creates a new coordinate object given the two coordinates. 62 | * 63 | * @param x The horizontal coordinate. 64 | * 65 | * @param y The vertical coordinate. 66 | * */ 67 | public Coord(int x, int y) { 68 | this.x = x; 69 | this.y = y; 70 | } 71 | 72 | /** 73 | * Creates a new coordinate object given another Coord object i.e. copy 74 | * constructor 75 | * 76 | * @param c The Coord object to be copied. 77 | * */ 78 | public Coord(Coord c) { 79 | this.x = c.x; 80 | this.y = c.y; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/jj2000/j2k/io/EndianType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CVS Identifier: 3 | * 4 | * $Id: EndianType.java 166 2012-01-11 23:48:05Z mroland $ 5 | * 6 | * Interface: EndianType 7 | * 8 | * Description: Defines the two types of endianess (i.e. byte 9 | * ordering). 10 | * 11 | * 12 | * 13 | * COPYRIGHT: 14 | * 15 | * This software module was originally developed by Raphal Grosbois and 16 | * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel 17 | * Askelf (Ericsson Radio Systems AB); and Bertrand Berthelot, David 18 | * Bouchard, Flix Henry, Gerard Mozelle and Patrice Onno (Canon Research 19 | * Centre France S.A) in the course of development of the JPEG2000 20 | * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This 21 | * software module is an implementation of a part of the JPEG 2000 22 | * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio 23 | * Systems AB and Canon Research Centre France S.A (collectively JJ2000 24 | * Partners) agree not to assert against ISO/IEC and users of the JPEG 25 | * 2000 Standard (Users) any of their rights under the copyright, not 26 | * including other intellectual property rights, for this software module 27 | * with respect to the usage by ISO/IEC and Users of this software module 28 | * or modifications thereof for use in hardware or software products 29 | * claiming conformance to the JPEG 2000 Standard. Those intending to use 30 | * this software module in hardware or software products are advised that 31 | * their use may infringe existing patents. The original developers of 32 | * this software module, JJ2000 Partners and ISO/IEC assume no liability 33 | * for use of this software module or modifications thereof. No license 34 | * or right to this software module is granted for non JPEG 2000 Standard 35 | * conforming products. JJ2000 Partners have full right to use this 36 | * software module for his/her own purpose, assign or donate this 37 | * software module to any third party and to inhibit third parties from 38 | * using this software module for non JPEG 2000 Standard conforming 39 | * products. This copyright notice must be included in all copies or 40 | * derivative works of this software module. 41 | * 42 | * Copyright (c) 1999/2000 JJ2000 Partners. 43 | * 44 | * 45 | * 46 | */ 47 | 48 | package jj2000.j2k.io; 49 | 50 | /** 51 | * This interface defines constants for the two types of byte 52 | * ordering: little- and big-endian. 53 | * 54 | *

Little-endian is least significant byte first. 55 | * 56 | *

Big-endian is most significant byte first. 57 | * 58 | *

This interface defines the constants only. In order to use the 59 | * constants in any other class you can either use the fully qualified 60 | * name (e.g., EndianType.LITTLE_ENDIAN) or declare this 61 | * interface in the implements clause of the class and then access the 62 | * identifier directly. 63 | * 64 | */ 65 | public interface EndianType { 66 | 67 | /** Identifier for big-endian byte ordering (i.e. most significant 68 | * byte first) */ 69 | public static final int BIG_ENDIAN = 0; 70 | 71 | /** Identifier for little-endian byte ordering (i.e. least 72 | * significant byte first) */ 73 | public static final int LITTLE_ENDIAN = 1; 74 | } 75 | -------------------------------------------------------------------------------- /src/jj2000/j2k/wavelet/synthesis/InvWTData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CVS identifier: 3 | * 4 | * $Id: InvWTData.java 166 2012-01-11 23:48:05Z mroland $ 5 | * 6 | * Class: InvWTData 7 | * 8 | * Description: 9 | * 10 | * 11 | * 12 | * COPYRIGHT: 13 | * 14 | * This software module was originally developed by Raphal Grosbois and 15 | * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel 16 | * Askelf (Ericsson Radio Systems AB); and Bertrand Berthelot, David 17 | * Bouchard, Flix Henry, Gerard Mozelle and Patrice Onno (Canon Research 18 | * Centre France S.A) in the course of development of the JPEG2000 19 | * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This 20 | * software module is an implementation of a part of the JPEG 2000 21 | * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio 22 | * Systems AB and Canon Research Centre France S.A (collectively JJ2000 23 | * Partners) agree not to assert against ISO/IEC and users of the JPEG 24 | * 2000 Standard (Users) any of their rights under the copyright, not 25 | * including other intellectual property rights, for this software module 26 | * with respect to the usage by ISO/IEC and Users of this software module 27 | * or modifications thereof for use in hardware or software products 28 | * claiming conformance to the JPEG 2000 Standard. Those intending to use 29 | * this software module in hardware or software products are advised that 30 | * their use may infringe existing patents. The original developers of 31 | * this software module, JJ2000 Partners and ISO/IEC assume no liability 32 | * for use of this software module or modifications thereof. No license 33 | * or right to this software module is granted for non JPEG 2000 Standard 34 | * conforming products. JJ2000 Partners have full right to use this 35 | * software module for his/her own purpose, assign or donate this 36 | * software module to any third party and to inhibit third parties from 37 | * using this software module for non JPEG 2000 Standard conforming 38 | * products. This copyright notice must be included in all copies or 39 | * derivative works of this software module. 40 | * 41 | * Copyright (c) 1999/2000 JJ2000 Partners. 42 | * */ 43 | package jj2000.j2k.wavelet.synthesis; 44 | 45 | /** 46 | * This interface extends the MultiResImgData interface with the methods that 47 | * are necessary for inverse wavelet data (i.e. data that is the source to an 48 | * inverse wavlet trasnform). 49 | * */ 50 | public interface InvWTData extends MultiResImgData { 51 | 52 | /** 53 | * Returns the subband tree, for the specified tile-component. This method 54 | * returns the root element of the subband tree structure, see 'Subband' 55 | * and 'SubbandSyn'. The tree comprises all the available resolution 56 | * levels. 57 | * 58 | * @param t The index of the tile, from 0 to T-1. 59 | * 60 | * @param c The index of the component, from 0 to C-1. 61 | * 62 | * @return The root of the tree structure. 63 | * */ 64 | public SubbandSyn getSynSubbandTree(int t,int c); 65 | 66 | /** 67 | * Returns the horizontal code-block partition origin. Allowable values 68 | * are 0 and 1, nothing else. 69 | * */ 70 | public int getCbULX(); 71 | 72 | /** 73 | * Returns the vertical code-block partition origin Allowable values are 0 74 | * and 1, nothing else. 75 | * */ 76 | public int getCbULY(); 77 | } 78 | -------------------------------------------------------------------------------- /res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 17 | 18 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 44 | 45 | 48 | 49 | 59 | 60 | 61 | 62 | 66 | 67 | 68 | 69 | 75 | 76 |