All Downloads are FREE. Search and download functionalities are using the official Maven repository.

icc.lut.LookUpTableFPGamma Maven / Gradle / Ivy

Go to download

Fork of jpeg2k code from https://code.google.com/p/jj2000/. This is a dependency for support of compression in Grib2 files in netCDF-java and TDS. We welcome bug fixes and other contributions to this code.

The newest version!
/*****************************************************************************
 *
 * $Id: LookUpTableFPGamma.java,v 1.1 2002/07/25 14:56:48 grosbois Exp $
 *
 * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650
 * $Date $
 *****************************************************************************/

package icc.lut;

import icc .tags.ICCCurveType;

/**
 * Class Description
 * 
 * @version	1.0
 * @author	Bruce A. Kern
 */

public class LookUpTableFPGamma extends LookUpTableFP {     

    double dfE = -1;
    private static final String eol = System.getProperty("line.separator");

    public LookUpTableFPGamma (
                 ICCCurveType curve,   // Pointer to the curve data            
                 int dwNumInput       // Number of input values in created LUT
                 ) {
        super (curve, dwNumInput); 

        // Gamma exponent for inverse transformation
        dfE = ICCCurveType.CurveGammaToDouble(curve.entry(0));
        for (int i = 0; i < dwNumInput; i++)
            lut[i] = (float) Math.pow((double)i / (dwNumInput - 1), dfE); }

    /**
     * Create an abbreviated string representation of a 16 bit lut.
     * @return the lut as a String
     */
    public String toString () {
        StringBuffer rep = new StringBuffer ("[LookUpTableGamma ");
        int row,col;
        rep .append("dfe= " + dfE);
        rep .append(", nentries= " + lut.length);
        return rep.append("]").toString(); }


    /* end class LookUpTableFPGamma */ }




















© 2015 - 2025 Weber Informatics LLC | Privacy Policy