CADI.Common.LogicalTarget.JPEG2000.File
Class ReadJP2HeaderBox

java.lang.Object
  extended by CADI.Common.LogicalTarget.JPEG2000.File.ReadJP2HeaderBox

public class ReadJP2HeaderBox
extends java.lang.Object

Version:
1.0 2008/10/07
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
private  boolean bppVariation
          Boolean indicating if there are components with different bit depths from others
private  int CTType
          Definition in CADI.Common.LogicalTarget.JPEG2000.Parameters.CODParameters#CTType
private  BufferedDataInputStream in
          Is an object with the input stream where the main header is read from.
private  boolean isExtension
          Indicates whether JP2 header box is conform with the Part-1 of the standard or with the Part-2 (extensions)
private  long length
           
private  boolean[] LSSignedComponents
          Definition in SIZParameters.signed
private  int[] QComponentsBits
          Definition in SIZParameters.precision
private  int xSize
          Definition in SIZParameters.xSize
private  int ySize
          Definition in SIZParameters.ySize
private  int zSize
          Definition in SIZParameters.zSize
 
Constructor Summary
ReadJP2HeaderBox(BufferedDataInputStream in, long length)
          Constructor.
ReadJP2HeaderBox(BufferedDataInputStream in, long length, boolean isExtension)
           
 
Method Summary
 boolean isBppVariation()
           
 void list(java.io.PrintStream out)
          Prints this Read JP2 Header Box fields out to the specified output stream.
private  void readBitsPerComponentBox(long length)
          Reads the Bits Per Component Box and retrieves the parameters contained.
private  void readChannelDefinitionBox(long length)
          Reads the Channel Definition Box and retrives the parameters contained.
private  void readColourSpecificationBox(long length)
          Reads the Colour Specification Box and retrieves the parameters contained.
private  void readComponentMappingBox(long length)
          Reads the Component Mapping Box and retrieves the parameters contained.
private  boolean readImageHeaderBox()
          Reads the Image Header Box and retrieves the parameters contained.
private  void readLabelBox(long length)
          Reads the Label Box and retrieves the parameters contained.
private  void readPaletteBox(long length)
          Reads the Palette Box and retrives the parameters contained.
private  void readResolutionSuperBox(long length)
          Read the resolution box.
 void run()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

in

private BufferedDataInputStream in
Is an object with the input stream where the main header is read from.


length

private long length

isExtension

private boolean isExtension
Indicates whether JP2 header box is conform with the Part-1 of the standard or with the Part-2 (extensions)


bppVariation

private boolean bppVariation
Boolean indicating if there are components with different bit depths from others


zSize

private int zSize
Definition in SIZParameters.zSize


ySize

private int ySize
Definition in SIZParameters.ySize


xSize

private int xSize
Definition in SIZParameters.xSize


LSSignedComponents

private boolean[] LSSignedComponents
Definition in SIZParameters.signed


CTType

private int CTType
Definition in CADI.Common.LogicalTarget.JPEG2000.Parameters.CODParameters#CTType


QComponentsBits

private int[] QComponentsBits
Definition in SIZParameters.precision

Constructor Detail

ReadJP2HeaderBox

public ReadJP2HeaderBox(BufferedDataInputStream in,
                        long length)
Constructor.

Parameters:
in - input stream where data will be read from.
length -

ReadJP2HeaderBox

public ReadJP2HeaderBox(BufferedDataInputStream in,
                        long length,
                        boolean isExtension)
Parameters:
in -
length -
isExtension -
Method Detail

run

public void run()
         throws java.io.EOFException,
                ErrorException,
                java.io.IOException
Throws:
java.io.IOException
ErrorException
java.io.EOFException

isBppVariation

public boolean isBppVariation()
Returns:
the bppVariation attribute.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

list

public void list(java.io.PrintStream out)
Prints this Read JP2 Header Box fields out to the specified output stream. This method is useful for debugging.

Parameters:
out - an output stream.

readLabelBox

private void readLabelBox(long length)
                   throws ErrorException,
                          java.io.EOFException,
                          java.io.IOException
Reads the Label Box and retrieves the parameters contained.

Throws:
ErrorException - when the header information is ambiguous or incorrect
java.io.EOFException
java.io.IOException

readImageHeaderBox

private boolean readImageHeaderBox()
                            throws ErrorException,
                                   java.io.EOFException,
                                   java.io.IOException
Reads the Image Header Box and retrieves the parameters contained.

Returns:
bppVariation - definition in bppVariation
Throws:
ErrorException - when the header information is ambiguous or incorrect
java.io.EOFException
java.io.IOException

readBitsPerComponentBox

private void readBitsPerComponentBox(long length)
                              throws ErrorException,
                                     java.io.EOFException,
                                     java.io.IOException
Reads the Bits Per Component Box and retrieves the parameters contained.

Throws:
ErrorException - when the header information is ambiguous or incorrect
java.io.EOFException
java.io.IOException

readColourSpecificationBox

private void readColourSpecificationBox(long length)
                                 throws ErrorException,
                                        java.io.EOFException,
                                        java.io.IOException
Reads the Colour Specification Box and retrieves the parameters contained.

Parameters:
length - the length of the box content
Throws:
ErrorException - when the header information is ambiguous or incorrect
java.io.EOFException
java.io.IOException

readPaletteBox

private void readPaletteBox(long length)
                     throws ErrorException,
                            java.io.IOException
Reads the Palette Box and retrives the parameters contained. NOTICE: This method is not finished.

Parameters:
length - the length of the box.
Throws:
java.io.IOException
ErrorException

readComponentMappingBox

private void readComponentMappingBox(long length)
                              throws ErrorException,
                                     java.io.IOException
Reads the Component Mapping Box and retrieves the parameters contained.

Parameters:
length - lenth of the box content.
Throws:
java.io.IOException
ErrorException

readChannelDefinitionBox

private void readChannelDefinitionBox(long length)
                               throws ErrorException,
                                      java.io.IOException
Reads the Channel Definition Box and retrives the parameters contained.

Parameters:
length - length of the box content.
Throws:
ErrorException
java.io.IOException

readResolutionSuperBox

private void readResolutionSuperBox(long length)
                             throws ErrorException,
                                    java.io.IOException
Read the resolution box. NOTICE: This method only read the values but they are not saved.

Parameters:
length -
Throws:
java.io.IOException
ErrorException


CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) (contact)