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

colorspace.boxes.ComponentMappingBox 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: ComponentMappingBox.java,v 1.1 2002/07/25 14:50:46 grosbois Exp $
 *
 * Copyright Eastman Kodak Company, 343 State Street, Rochester, NY 14650
 * $Date $
 *****************************************************************************/

package colorspace.boxes;

import colorspace .ColorSpaceException;
import icc .ICCProfile;
import jj2000.j2k.util.ParameterList;
import jj2000.j2k.io.RandomAccessIO;

import java.io.IOException;
import java.util.Enumeration;
import java.util.Vector;

/**
 * This class maps the components in the codestream
 * to channels in the image.  It models the Component
 * Mapping box in the JP2 header.
 * 
 * @version	1.0
 * @author	Bruce A. Kern
 */
public final class ComponentMappingBox extends JP2Box
{
    static { type = 0x636d6170; }

    private int nChannels;
    private Vector map = new Vector();

    /**
     * Construct a ComponentMappingBox from an input image.
     *   @param in RandomAccessIO jp2 image
     *   @param boxStart offset to the start of the box in the image
     * @exception IOException, ColorSpaceException 
     */
    public ComponentMappingBox (RandomAccessIO in, int boxStart)
        throws IOException, ColorSpaceException {
        super (in, boxStart); 
        readBox(); }

    /** Analyze the box content. */
    void readBox() throws IOException {
        nChannels = (boxEnd-dataStart) / 4;
        in.seek(dataStart);
        for (int offset=dataStart; offset




© 2015 - 2025 Weber Informatics LLC | Privacy Policy