⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 icccurvetype.java

📁 jpeg2000编解码
💻 JAVA
字号:
/***************************************************************************** * * $Id: ICCCurveType.java,v 1.1.1.1 2002/08/02 09:51:48 grosbois Exp $ * * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650 * $Date $ *****************************************************************************/package icc.tags;import java.io.RandomAccessFile;import java.io.IOException;import icc .ICCProfile;/** * The ICCCurve tag *  * @version	1.0 * @author	Bruce A. Kern */public class ICCCurveType extends ICCTag {    private static final String eol = System.getProperty ("line.separator");    /** Tag fields */ public final int type;    /** Tag fields */ public final int reserved;    /** Tag fields */ public final int nEntries;    /** Tag fields */ public final int [] entry;    /** Return the string rep of this tag. */    public String toString () {        StringBuffer rep = new StringBuffer("[").append (super.toString())            .append(" nentries = ").append(String.valueOf(nEntries))            .append(", length = " + String.valueOf(entry.length) + " ... ");        return rep.append("]").toString(); }            /** Normalization utility */    public static double CurveToDouble(int entry)        { return (double) entry / 65535.0; }    /** Normalization utility */    public static short DoubleToCurve(double entry)        { return (short) Math.floor(entry * 65535.0 + 0.5); }            /** Normalization utility */    public static double CurveGammaToDouble(int entry)        {	return (double)entry / 256.0; }            /**     * Construct this tag from its constituant parts     *   @param signature tag id     *   @param data array of bytes     *   @param offset to data in the data array     *   @param length of data in the data array     */    protected ICCCurveType (int signature, byte [] data, int offset, int length) {        super (signature, data, offset, offset+2*ICCProfile.int_size);        type = ICCProfile.getInt (data, offset);        reserved = ICCProfile.getInt (data, offset+ICCProfile.int_size);        nEntries = ICCProfile.getInt (data, offset+2*ICCProfile.int_size);        entry = new int [nEntries];        for (int i=0; i<nEntries; ++i)             entry[i] = ICCProfile.getShort(data, offset+                                           3*ICCProfile.int_size+                                           i*ICCProfile.short_size)&0xFFFF; }    /** Accessor for curve entry at index. */    public final int entry (int i) {        return entry[i]; }            /* end class ICCCurveType */ }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -