PIRL

PIRL.Image_Tools
Class JP2_Info

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by PIRL.PVL.Parameter
          extended by PIRL.Image_Tools.JPEG2000_Info
              extended by PIRL.Image_Tools.JP2_Info
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode, TreeNode

public class JP2_Info
extends JPEG2000_Info

JP2_Info provides a set of PVL Parameters that describe the contents of a JP2 file.

The JP2 file format is defined in Part 1 of the JPEG2000 International Standard (ISO/IEC 15444-1:2004(E); "Information technology - JPEG 2000 image coding system: Core coding system"). This file format is composed entirely of a contiguous sequence of boxes. Each box has a type and length. Boxes may be nested within other boxes.

Version:
1.38
Author:
Bradford Castalia UA/PIRL
See Also:
JPEG2000_Info, JPEG2000_Codestream_Info, Serialized Form

Field Summary
static String ASSOCIATION_NAME
           
static int ASSOCIATION_TYPE
           
static String BIN_ID_PARAMETER
           
static String BITS_PER_COMPONENT_NAME
           
static int BITS_PER_COMPONENT_TYPE
           
static String BRAND_PARAMETER
           
static String CAPTURE_RESOLUTION_NAME
           
static int CAPTURE_RESOLUTION_TYPE
           
static int CHANNEL_ASSOCIATION_INDEX
           
static String CHANNEL_DEFINITION_NAME
           
static int CHANNEL_DEFINITION_TYPE
           
static int CHANNEL_INDEX
           
static int CHANNEL_TYPE_INDEX
           
static String CODESTREAM_ID_PARAMETER
           
static String CODESTREAM_PARAMETER
           
static String COLORSPACE_UNKNOWN_PARAMETER
           
static int COLOUR_IMAGE_DATA
           
static int COLOUR_SPECIFICATION_FOUND
           
static String COLOUR_SPECIFICATION_NAME
           
static int COLOUR_SPECIFICATION_TYPE
           
static String COLOURSPACE_APPROXIMATION_PARAMETER
           
static String COLUMNS_PARAMETER
           
static String COMPATIBILITY_LIST_PARAMETER
           
static int COMPONENT_INDEX
           
static String COMPONENT_MAPPING_NAME
           
static int COMPONENT_MAPPING_TYPE
           
static String COMPRESSION_TYPE_PARAMETER
           
static int CONTIGUOUS_CODESTREAM_FOUND
           
static String CONTIGUOUS_CODESTREAM_NAME
           
static int CONTIGUOUS_CODESTREAM_TYPE
           
static String DEFAULT_DISPLAY_RESOLUTION_NAME
           
static int DEFAULT_DISPLAY_RESOLUTION_TYPE
           
static int DIRECT_USE
           
static String ENTRIES_PARAMETER
           
static int ENUMERATED_COLOURSPACE
           
static String ENUMERATED_COLOURSPACE_PARAMETER
           
static String EQUIVALENT_BOX_PARAMETER
           
static String EXTENDED_BOX_LIST_PARAMETER
           
static String FILE_NAME
           
static int FILE_TYPE
           
static int FILE_TYPE_FOUND
           
static String FLAGS_PARAMETER
           
static String HEADER_NAME
           
static int HEADER_TYPE
           
static String HEIGHT_PARAMETER
           
static String HORIZONTAL_DENOMINATOR_PARAMETER
           
static String HORIZONTAL_EXPONENT_PARAMETER
           
static String HORIZONTAL_NUMERATOR_PARAMETER
           
static String ID
           
static int IMAGE_ASSOCIATION
           
static int IMAGE_HEADER_FOUND
           
static String IMAGE_HEADER_NAME
           
static int IMAGE_HEADER_TYPE
           
static String INTELLECTUAL_PROPERTY_NAME
           
static String INTELLECTUAL_PROPERTY_PARAMETER
           
static int INTELLECTUAL_PROPERTY_TYPE
           
static int IO_EXCEPTION
           
static String JP2_COMPATIBLE
           
static int JP2_COMPLETE
           
static int JP2_HEADER_FOUND
           
protected  int JP2_Validity
           
static String LABEL_NAME
           
static int LABEL_TYPE
           
static String MAP_PARAMETER
           
static int MAP_TYPE_INDEX
           
static String MINOR_VERSION_PARAMETER
           
static String NAME_PARAMETER
           
static int NO_ASSOCIATION
           
static int NO_INFO
           
static int NUMBER_OF_UUID_VALUES
           
static int OPACITY
           
static String ORIGINAL_BOX_PARAMETER
           
static int PALETTE_INDEX
           
static int PALETTE_MAPPING
           
static String PALETTE_NAME
           
static int PALETTE_TYPE
           
static int PLACEHOLDER_FLAGS_CODESTREAM_MASK
           
static int PLACEHOLDER_FLAGS_EQUIVALENT_MASK
           
static int PLACEHOLDER_FLAGS_MULTIPLE_CODESTREAM_MASK
           
static int PLACEHOLDER_FLAGS_ORIGINAL_MASK
           
static String PLACEHOLDER_NAME
           
static int PLACEHOLDER_TYPE
           
static String PRECEDENCE_PARAMETER
           
static int PREMULTIPLIED_OPACITY
           
static int PVL_ERROR
           
static String RESOLUTION_NAME
           
static int RESOLUTION_TYPE
           
static int RESTRICTED_ICC_PROFILE
           
static int SIGNATURE
           
static int SIGNATURE_FOUND
           
static String SIGNATURE_NAME
           
static String SIGNATURE_PARAMETER
           
static int SIGNATURE_TYPE
           
static String SPECIFICATION_METHOD_PARAMETER
           
static int SUCCESS
           
static int SYNTAX_ERROR
           
static String TEXT_PARAMETER
           
static String TOTAL_CODESTREAMS_PARAMETER
           
static String TYPE_PARAMETER
           
static String URL_NAME
           
static String URL_PARAMETER
           
static int URL_TYPE
           
static String UUID_INFO_NAME
           
static int UUID_INFO_TYPE
           
static String UUID_LIST_NAME
           
static int UUID_LIST_TYPE
           
static String UUID_NAME
           
static String UUID_PARAMETER
           
static int UUID_TYPE
           
static String VALUES_PARAMETER
           
static String VERSION_PARAMETER
           
static String VERTICAL_DENOMINATOR_PARAMETER
           
static String VERTICAL_EXPONENT_PARAMETER
           
static String VERTICAL_NUMERATOR_PARAMETER
           
static String WIDTH_PARAMETER
           
static String XML_NAME
           
static int XML_TYPE
           
 
Fields inherited from class PIRL.Image_Tools.JPEG2000_Info
BITS_VARIABLE, DATA_LENGTH_PARAMETER, DATA_OFFSET_PARAMETER, DATA_POSITION_PARAMETER, Image_Input_Stream, LENGTH_PARAMETER, POSITION_PARAMETER, Skip_Tiles, Skip_Tiles_Default, Stream_Position, Throw_Illegal_State, Throw_Illegal_State_Default, TOTAL_COMPONENTS_PARAMETER, UNKNOWN, Use_Data_Position, Use_Data_Position_Default, VALUE_BITS_PARAMETER, WARNING_PARAMETER
 
Fields inherited from class PIRL.PVL.Parameter
AGGREGATE, ASSIGNMENT, BEGIN_GROUP, BEGIN_OBJECT, END, END_AGGREGATE, END_GROUP, END_OBJECT, END_PVL, GROUP, HIGHEST_BIT, LOWEST_BIT, MASK, OBJECT, TOKEN
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
JP2_Info()
          Construct an empty JP2_Info Object.
JP2_Info(File file)
          Construct JP2_Info for a File.
JP2_Info(File file, boolean skip_tiles)
          Construct JP2_Info for a File.
JP2_Info(ImageInputStream image_input_stream)
          Construct JP2_Info for an ImageInputStream.
JP2_Info(ImageInputStream image_input_stream, boolean skip_tiles)
          Construct JP2_Info for an ImageInputStream.
JP2_Info(String source)
          Construct JP2_Info for a named source.
JP2_Info(String source, boolean skip_tiles)
          Construct JP2_Info for a named source.
 
Method Summary
 int[] Bits_per_Component()
          Get the number of bits per pixel for each component in the image.
static String Box_Name(int type_code)
          Get the descriptive box name for a box type.
static Parameter Box(byte[] data)
          Assemble a Parameter Aggregate from a byte array of JP2 box data.
static Parameter Box(byte[] data, int offset, int length)
          Assemble a Parameter Aggregate describing a JP2 box from a byte array.
 int Codestream_Validity()
          Get the JPEG2000_Codestream_Info.Codestream_Validity() value.
 long Horizontal_Image_Offset()
          Get the JPEG2000_Codestream_Info.Horizontal_Image_Offset() value.
 long Horizontal_Tile_Offset()
          Get the JPEG2000_Codestream_Info.Horizontal_Tile_Offset() value.
 long Image_Height()
          Get the height of the image.
 long Image_Width()
          Get the width of the image.
static String int_to_String(int value)
          Convert an int value to a String.
 boolean Is_Complete_JP2()
          Test if the Source file contains a complete JP2 format.
 boolean Is_JP2()
          Test if the Source is a file in JP2 format.
 int JP2_Validity()
          Get the current JP2 validity flags.
static void main(String[] arguments)
          Report the JP2_Info found in a file.
 int[] Pixel_Height()
          Get the JPEG2000_Codestream_Info.Pixel_Height() value.
 int[] Pixel_Width()
          Get the JPEG2000_Codestream_Info.Pixel_Width() value.
 int Progression_Order()
          Get the JPEG2000_Codestream_Info.Progression_Order() value.
 JP2_Info Read(boolean skip_tiles)
          Read all available information from the Source file.
 long Reference_Grid_Height()
          Get the JPEG2000_Codestream_Info.Reference_Grid_Height() value.
 long Reference_Grid_Width()
          Get the JPEG2000_Codestream_Info.Reference_Grid_Width() value.
 long Tile_Height()
          Get the JPEG2000_Codestream_Info.Tile_Height() value.
 long Tile_Width()
          Get the JPEG2000_Codestream_Info.Tile_Width() value.
 int Total_Components()
          Get the number of components (bands) in the image.
 int Total_Quality_Layers()
          Get the JPEG2000_Codestream_Info.Total_Quality_Layers() value.
 int Total_Resolution_Levels()
          Get the JPEG2000_Codestream_Info.Total_Resolution_Levels() value.
 int Total_Tiles()
          Get the JPEG2000_Codestream_Info.Total_Tiles() value.
 int Transform()
          Get the JPEG2000_Codestream_Info.Transform() value.
static void Usage()
          Print the command line usage syntax.
 long Vertical_Image_Offset()
          Get the JPEG2000_Codestream_Info.Vertical_Image_Offset() value.
 long Vertical_Tile_Offset()
          Get the JPEG2000_Codestream_Info.Vertical_Tile_Offset() value.
 boolean Zero_Length_Tile_Part()
          Test if a zero length tile-part was found in the codestream.
 
Methods inherited from class PIRL.Image_Tools.JPEG2000_Info
Data_Offset_Parameters, Data_Position_Parameters, int_Array, int_Array, int_Array, Read_byte, Read_int, Read_long, Read_short, Read_String, Read_Unsigned_byte, Read_Unsigned_int, Read_Unsigned_short, Read_Value, Skip_Tiles, Skip_Tiles, Source, Source, Source, Source, Stream_Position, Stream_Position, Throw_Illegal_State, Throw_Illegal_State, Use_Data_Position, Use_Data_Position, Value_Bits_Parameter, Value_Bits_Parameter
 
Methods inherited from class PIRL.PVL.Parameter
Absolute_Pathname, Absolute_Pathname, Add, add, Add, Add, adopt, Basename, Classification_Name, Classification_Name, Classification, Classification, Classification, clone, Comments, Comments, Data, Data, Data, Description, Description, equals, equalsIgnoreCase, Find, Find, Find, Find, Find, Find, Find, Find, Find, Find, Find, Find, First_Warning, First_Warning, graft, Has_List, Has_Value, Insert, insert, Insert, Is_Absolute_Pathname, Is_Aggregate, Is_Aggregate, Is_Assignment, Is_Assignment, Is_Begin_Aggregate, Is_Begin_Aggregate, Is_Begin_Group, Is_Begin_Group, Is_Begin_Object, Is_Begin_Object, Is_Empty, Is_End_Aggregate, Is_End_Aggregate, Is_End_Group, Is_End_Group, Is_End_Object, Is_End_Object, Is_End_PVL, Is_End_PVL, Is_End, Is_End, Is_Group, Is_Group, Is_Object, Is_Object, Is_Parameter_List, Is_Parameter_Value, Is_Parameter, Is_Token, Is_Token, Is_Unknown, Is_Unknown, iterator, iterator, Last_Warning, Last_Warning, List_Size, List, List, listIterator, listIterator, Match_Depth, Match, Name, Name, orphan, Parent_Pathname, Parent, Path_Delimiter, Path_Delimiter, Path_from, Path_Name, Path_to_Name, Remove_All, remove, Remove, remove, Remove, Reset_Warning, set_classification, set_data, setAllowsChildren, setUserObject, toString, Value, Value, Value, Value, Value, Value, Value, Value, Value, Warning, Write, Write, Write, Write, Write, Write, Write, Write
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
breadthFirstEnumeration, children, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, removeAllChildren, removeFromParent, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values

SIGNATURE_TYPE

public static final int SIGNATURE_TYPE
See Also:
Constant Field Values

FILE_TYPE

public static final int FILE_TYPE
See Also:
Constant Field Values

HEADER_TYPE

public static final int HEADER_TYPE
See Also:
Constant Field Values

IMAGE_HEADER_TYPE

public static final int IMAGE_HEADER_TYPE
See Also:
Constant Field Values

BITS_PER_COMPONENT_TYPE

public static final int BITS_PER_COMPONENT_TYPE
See Also:
Constant Field Values

COLOUR_SPECIFICATION_TYPE

public static final int COLOUR_SPECIFICATION_TYPE
See Also:
Constant Field Values

PALETTE_TYPE

public static final int PALETTE_TYPE
See Also:
Constant Field Values

COMPONENT_MAPPING_TYPE

public static final int COMPONENT_MAPPING_TYPE
See Also:
Constant Field Values

CHANNEL_DEFINITION_TYPE

public static final int CHANNEL_DEFINITION_TYPE
See Also:
Constant Field Values

RESOLUTION_TYPE

public static final int RESOLUTION_TYPE
See Also:
Constant Field Values

CAPTURE_RESOLUTION_TYPE

public static final int CAPTURE_RESOLUTION_TYPE
See Also:
Constant Field Values

DEFAULT_DISPLAY_RESOLUTION_TYPE

public static final int DEFAULT_DISPLAY_RESOLUTION_TYPE
See Also:
Constant Field Values

CONTIGUOUS_CODESTREAM_TYPE

public static final int CONTIGUOUS_CODESTREAM_TYPE
See Also:
Constant Field Values

INTELLECTUAL_PROPERTY_TYPE

public static final int INTELLECTUAL_PROPERTY_TYPE
See Also:
Constant Field Values

XML_TYPE

public static final int XML_TYPE
See Also:
Constant Field Values

UUID_TYPE

public static final int UUID_TYPE
See Also:
Constant Field Values

UUID_INFO_TYPE

public static final int UUID_INFO_TYPE
See Also:
Constant Field Values

UUID_LIST_TYPE

public static final int UUID_LIST_TYPE
See Also:
Constant Field Values

URL_TYPE

public static final int URL_TYPE
See Also:
Constant Field Values

ASSOCIATION_TYPE

public static final int ASSOCIATION_TYPE
See Also:
Constant Field Values

LABEL_TYPE

public static final int LABEL_TYPE
See Also:
Constant Field Values

PLACEHOLDER_TYPE

public static final int PLACEHOLDER_TYPE
See Also:
Constant Field Values

SIGNATURE_NAME

public static final String SIGNATURE_NAME
See Also:
Constant Field Values

FILE_NAME

public static final String FILE_NAME
See Also:
Constant Field Values

HEADER_NAME

public static final String HEADER_NAME
See Also:
Constant Field Values

IMAGE_HEADER_NAME

public static final String IMAGE_HEADER_NAME
See Also:
Constant Field Values

BITS_PER_COMPONENT_NAME

public static final String BITS_PER_COMPONENT_NAME
See Also:
Constant Field Values

COLOUR_SPECIFICATION_NAME

public static final String COLOUR_SPECIFICATION_NAME
See Also:
Constant Field Values

PALETTE_NAME

public static final String PALETTE_NAME
See Also:
Constant Field Values

COMPONENT_MAPPING_NAME

public static final String COMPONENT_MAPPING_NAME
See Also:
Constant Field Values

CHANNEL_DEFINITION_NAME

public static final String CHANNEL_DEFINITION_NAME
See Also:
Constant Field Values

RESOLUTION_NAME

public static final String RESOLUTION_NAME
See Also:
Constant Field Values

CAPTURE_RESOLUTION_NAME

public static final String CAPTURE_RESOLUTION_NAME
See Also:
Constant Field Values

DEFAULT_DISPLAY_RESOLUTION_NAME

public static final String DEFAULT_DISPLAY_RESOLUTION_NAME
See Also:
Constant Field Values

CONTIGUOUS_CODESTREAM_NAME

public static final String CONTIGUOUS_CODESTREAM_NAME
See Also:
Constant Field Values

INTELLECTUAL_PROPERTY_NAME

public static final String INTELLECTUAL_PROPERTY_NAME
See Also:
Constant Field Values

XML_NAME

public static final String XML_NAME
See Also:
Constant Field Values

UUID_NAME

public static final String UUID_NAME
See Also:
Constant Field Values

UUID_INFO_NAME

public static final String UUID_INFO_NAME
See Also:
Constant Field Values

UUID_LIST_NAME

public static final String UUID_LIST_NAME
See Also:
Constant Field Values

URL_NAME

public static final String URL_NAME
See Also:
Constant Field Values

ASSOCIATION_NAME

public static final String ASSOCIATION_NAME
See Also:
Constant Field Values

LABEL_NAME

public static final String LABEL_NAME
See Also:
Constant Field Values

PLACEHOLDER_NAME

public static final String PLACEHOLDER_NAME
See Also:
Constant Field Values

NAME_PARAMETER

public static final String NAME_PARAMETER
See Also:
Constant Field Values

TYPE_PARAMETER

public static final String TYPE_PARAMETER
See Also:
Constant Field Values

SIGNATURE_PARAMETER

public static final String SIGNATURE_PARAMETER
See Also:
Constant Field Values

SIGNATURE

public static final int SIGNATURE
See Also:
Constant Field Values

BRAND_PARAMETER

public static final String BRAND_PARAMETER
See Also:
Constant Field Values

MINOR_VERSION_PARAMETER

public static final String MINOR_VERSION_PARAMETER
See Also:
Constant Field Values

COMPATIBILITY_LIST_PARAMETER

public static final String COMPATIBILITY_LIST_PARAMETER
See Also:
Constant Field Values

JP2_COMPATIBLE

public static final String JP2_COMPATIBLE
See Also:
Constant Field Values

HEIGHT_PARAMETER

public static final String HEIGHT_PARAMETER
See Also:
Constant Field Values

WIDTH_PARAMETER

public static final String WIDTH_PARAMETER
See Also:
Constant Field Values

COMPRESSION_TYPE_PARAMETER

public static final String COMPRESSION_TYPE_PARAMETER
See Also:
Constant Field Values

COLORSPACE_UNKNOWN_PARAMETER

public static final String COLORSPACE_UNKNOWN_PARAMETER
See Also:
Constant Field Values

INTELLECTUAL_PROPERTY_PARAMETER

public static final String INTELLECTUAL_PROPERTY_PARAMETER
See Also:
Constant Field Values

SPECIFICATION_METHOD_PARAMETER

public static final String SPECIFICATION_METHOD_PARAMETER
See Also:
Constant Field Values

PRECEDENCE_PARAMETER

public static final String PRECEDENCE_PARAMETER
See Also:
Constant Field Values

COLOURSPACE_APPROXIMATION_PARAMETER

public static final String COLOURSPACE_APPROXIMATION_PARAMETER
See Also:
Constant Field Values

ENUMERATED_COLOURSPACE_PARAMETER

public static final String ENUMERATED_COLOURSPACE_PARAMETER
See Also:
Constant Field Values

ENUMERATED_COLOURSPACE

public static final int ENUMERATED_COLOURSPACE
See Also:
Constant Field Values

RESTRICTED_ICC_PROFILE

public static final int RESTRICTED_ICC_PROFILE
See Also:
Constant Field Values

ENTRIES_PARAMETER

public static final String ENTRIES_PARAMETER
See Also:
Constant Field Values

COLUMNS_PARAMETER

public static final String COLUMNS_PARAMETER
See Also:
Constant Field Values

VALUES_PARAMETER

public static final String VALUES_PARAMETER
See Also:
Constant Field Values

MAP_PARAMETER

public static final String MAP_PARAMETER
See Also:
Constant Field Values

COMPONENT_INDEX

public static final int COMPONENT_INDEX
See Also:
Constant Field Values

MAP_TYPE_INDEX

public static final int MAP_TYPE_INDEX
See Also:
Constant Field Values

PALETTE_INDEX

public static final int PALETTE_INDEX
See Also:
Constant Field Values

DIRECT_USE

public static final int DIRECT_USE
See Also:
Constant Field Values

PALETTE_MAPPING

public static final int PALETTE_MAPPING
See Also:
Constant Field Values

CHANNEL_INDEX

public static final int CHANNEL_INDEX
See Also:
Constant Field Values

CHANNEL_TYPE_INDEX

public static final int CHANNEL_TYPE_INDEX
See Also:
Constant Field Values

CHANNEL_ASSOCIATION_INDEX

public static final int CHANNEL_ASSOCIATION_INDEX
See Also:
Constant Field Values

COLOUR_IMAGE_DATA

public static final int COLOUR_IMAGE_DATA
See Also:
Constant Field Values

OPACITY

public static final int OPACITY
See Also:
Constant Field Values

PREMULTIPLIED_OPACITY

public static final int PREMULTIPLIED_OPACITY
See Also:
Constant Field Values

IMAGE_ASSOCIATION

public static final int IMAGE_ASSOCIATION
See Also:
Constant Field Values

NO_ASSOCIATION

public static final int NO_ASSOCIATION
See Also:
Constant Field Values

VERTICAL_NUMERATOR_PARAMETER

public static final String VERTICAL_NUMERATOR_PARAMETER
See Also:
Constant Field Values

VERTICAL_DENOMINATOR_PARAMETER

public static final String VERTICAL_DENOMINATOR_PARAMETER
See Also:
Constant Field Values

VERTICAL_EXPONENT_PARAMETER

public static final String VERTICAL_EXPONENT_PARAMETER
See Also:
Constant Field Values

HORIZONTAL_NUMERATOR_PARAMETER

public static final String HORIZONTAL_NUMERATOR_PARAMETER
See Also:
Constant Field Values

HORIZONTAL_DENOMINATOR_PARAMETER

public static final String HORIZONTAL_DENOMINATOR_PARAMETER
See Also:
Constant Field Values

HORIZONTAL_EXPONENT_PARAMETER

public static final String HORIZONTAL_EXPONENT_PARAMETER
See Also:
Constant Field Values

CODESTREAM_PARAMETER

public static final String CODESTREAM_PARAMETER
See Also:
Constant Field Values

UUID_PARAMETER

public static final String UUID_PARAMETER
See Also:
Constant Field Values

NUMBER_OF_UUID_VALUES

public static final int NUMBER_OF_UUID_VALUES
See Also:
Constant Field Values

VERSION_PARAMETER

public static final String VERSION_PARAMETER
See Also:
Constant Field Values

FLAGS_PARAMETER

public static final String FLAGS_PARAMETER
See Also:
Constant Field Values

URL_PARAMETER

public static final String URL_PARAMETER
See Also:
Constant Field Values

TEXT_PARAMETER

public static final String TEXT_PARAMETER
See Also:
Constant Field Values

ORIGINAL_BOX_PARAMETER

public static final String ORIGINAL_BOX_PARAMETER
See Also:
Constant Field Values

BIN_ID_PARAMETER

public static final String BIN_ID_PARAMETER
See Also:
Constant Field Values

EQUIVALENT_BOX_PARAMETER

public static final String EQUIVALENT_BOX_PARAMETER
See Also:
Constant Field Values

CODESTREAM_ID_PARAMETER

public static final String CODESTREAM_ID_PARAMETER
See Also:
Constant Field Values

TOTAL_CODESTREAMS_PARAMETER

public static final String TOTAL_CODESTREAMS_PARAMETER
See Also:
Constant Field Values

EXTENDED_BOX_LIST_PARAMETER

public static final String EXTENDED_BOX_LIST_PARAMETER
See Also:
Constant Field Values

PLACEHOLDER_FLAGS_ORIGINAL_MASK

public static final int PLACEHOLDER_FLAGS_ORIGINAL_MASK
See Also:
Constant Field Values

PLACEHOLDER_FLAGS_EQUIVALENT_MASK

public static final int PLACEHOLDER_FLAGS_EQUIVALENT_MASK
See Also:
Constant Field Values

PLACEHOLDER_FLAGS_CODESTREAM_MASK

public static final int PLACEHOLDER_FLAGS_CODESTREAM_MASK
See Also:
Constant Field Values

PLACEHOLDER_FLAGS_MULTIPLE_CODESTREAM_MASK

public static final int PLACEHOLDER_FLAGS_MULTIPLE_CODESTREAM_MASK
See Also:
Constant Field Values

JP2_Validity

protected int JP2_Validity

SIGNATURE_FOUND

public static final int SIGNATURE_FOUND
See Also:
Constant Field Values

FILE_TYPE_FOUND

public static final int FILE_TYPE_FOUND
See Also:
Constant Field Values

JP2_HEADER_FOUND

public static final int JP2_HEADER_FOUND
See Also:
Constant Field Values

IMAGE_HEADER_FOUND

public static final int IMAGE_HEADER_FOUND
See Also:
Constant Field Values

COLOUR_SPECIFICATION_FOUND

public static final int COLOUR_SPECIFICATION_FOUND
See Also:
Constant Field Values

CONTIGUOUS_CODESTREAM_FOUND

public static final int CONTIGUOUS_CODESTREAM_FOUND
See Also:
Constant Field Values

JP2_COMPLETE

public static final int JP2_COMPLETE
See Also:
Constant Field Values

SUCCESS

public static final int SUCCESS
See Also:
Constant Field Values

SYNTAX_ERROR

public static final int SYNTAX_ERROR
See Also:
Constant Field Values

IO_EXCEPTION

public static final int IO_EXCEPTION
See Also:
Constant Field Values

NO_INFO

public static final int NO_INFO
See Also:
Constant Field Values

PVL_ERROR

public static final int PVL_ERROR
See Also:
Constant Field Values
Constructor Detail

JP2_Info

public JP2_Info(String source)
         throws IOException,
                UnknownHostException,
                IllegalArgumentException
Construct JP2_Info for a named source.

The inclusion of tile segments in the Parameters is controlled by the JPEG2000_Info.Skip_Tiles_Default flag.

Parameters:
source - The source from which to obtain the JP2_Info.
Throws:
UnknownHostException - If the source is a URL but the hostname is specifies can not be resolved.
IllegalArgumentException - If the source is a URL but does not specify the http protocol or a source pahtname.
IOException - If there was a problem reading the source.

JP2_Info

public JP2_Info(String source,
                boolean skip_tiles)
         throws IOException,
                UnknownHostException,
                IllegalArgumentException
Construct JP2_Info for a named source.

Parameters:
source - The source from which to obtain the JP2_Info.
skip_tiles - true if tile segments are not to be included in the Parameters; false otherwise.
Throws:
UnknownHostException - If the source is a URL but the hostname is specifies can not be resolved.
IllegalArgumentException - If the source is a URL but does not specify the http protocol or a source pathname.
IOException - If there was a problem reading the source.

JP2_Info

public JP2_Info(File file)
         throws IOException
Construct JP2_Info for a File.

The inclusion of tile segments in the Parameters is controlled by the JPEG2000_Info.Skip_Tiles_Default flag.

Parameters:
file - The File from which to obtain the JP2_Info.
Throws:
IOException - If there was a problem reading the file.

JP2_Info

public JP2_Info(File file,
                boolean skip_tiles)
         throws IOException
Construct JP2_Info for a File.

Parameters:
file - The File from which to obtain the JP2_Info.
skip_tiles - true if tile segments are not to be included in the Parameters; false otherwise.
Throws:
IOException - If there was a problem reading the file.

JP2_Info

public JP2_Info(ImageInputStream image_input_stream)
         throws IOException
Construct JP2_Info for an ImageInputStream.

The inclusion of tile segments in the Parameters is controlled by the JPEG2000_Info.Skip_Tiles_Default flag.

Parameters:
image_input_stream - The ImageInputStream from which to obtain the JP2_Info.
Throws:
IOException - If there was a problem reading the file.

JP2_Info

public JP2_Info(ImageInputStream image_input_stream,
                boolean skip_tiles)
         throws IOException
Construct JP2_Info for an ImageInputStream.

Parameters:
image_input_stream - The ImageInputStream from which to obtain the JP2_Info.
skip_tiles - true if tile segments are not to be included in the Parameters; false otherwise.
Throws:
IOException - If there was a problem reading the file.

JP2_Info

public JP2_Info()
Construct an empty JP2_Info Object.

Use one of the Source methods to assign a source file. Then use a Read method to obtain the JP2_Info Parameter set for the file.

See Also:
JPEG2000_Info.Source(String), Read(boolean)
Method Detail

Read

public JP2_Info Read(boolean skip_tiles)
              throws IOException
Read all available information from the Source file.

If no Source file has been assigned, nothing is done.

The Source is read from the beginning. The Source stream will be repositioned back to its current position before the method returns.

Any information Parameters currently present are removed. Then the file is scanned for JP2 information boxes. Each box found is used to define the contents of a Parameter Group added to the base JPEG2000_Info Aggregate. The name of each Parameter Group is the JP2 box type composed of four characters (unprintable characters are represented by escape sequences). The Group always contains the following parameters:

Name
The box type name in descriptive token form.
Type
The box type code in numeric hexadecimal form.
^Position
The position of the box in the Source as a byte offset (from 0). N.B.: This parameter is not present if data position inclusion is disabled.
Length
The length of the box in bytes.

The remaining Parameters in each Group depend on the box type.

When JP2 information boxes are nested, the corresponding Parameter Groups are also nested. JPEG2000 codestream (Contiguous_Codestream, jp2c) boxes contain a Codestream Parameter Group that is defined by a JPEG2000_Codestream_Info object.

N.B.: A JPEG2000_Info.WARNING_PARAMETER will be placed at the end of the Parameter set and further Source file scanning halted if the previous JP2 box is invalid. The Value of the warning Parameter will be a String describing the problem. Possible sources of warning parameters are: The beginning of the Source file does not contain a valid Signature box or the second box of the Source file is not a valid File Type box.

Parameters:
skip_tiles - true if tile segments are not to be included in the Codestream Parameters; false otherwise.
Returns:
This JP2_Info.
Throws:
IOException - If there was a problem reading the Source file.
See Also:
JPEG2000_Codestream_Info

Is_JP2

public boolean Is_JP2()
Test if the Source is a file in JP2 format.

If the JP2 Validity value has already been determined by reading the Source file, then if both the SIGNATURE_FOUND and FILE_TYPE_FOUND validity flags have been set the file is in JP2 format. Otherwise an attempt is made to read the first two JP2 boxes from the beginning of the file which will provide the minimally necessary validity flags. In this case the Source is repositioned back to its previous position after the attempt to read the boxes. If no Source as been assigned then the return value is false.

Returns:
true if the beginning of the Source file contains a valid signature box followed immediately by a valid file type box; false otherwise.

Is_Complete_JP2

public boolean Is_Complete_JP2()
Test if the Source file contains a complete JP2 format.

The Source must be read for this test to be valid.

Returns:
true if the JP2 Validity value has all the JP2_COMPLETE flags set; false otherwise.

JP2_Validity

public int JP2_Validity()
Get the current JP2 validity flags.

The bit flags in this value are updated as the Source file is read:

SIGNATURE_FOUND
Set if the beginning of the file contains a Signature box.
FILE_TYPE_FOUND
Set if the second box of the file is a File Type box.
JP2_HEADER_FOUND
Set if the required JP2 Header box has been found.
IMAGE_HEADER_FOUND
Set if the required Image Header box has been found.
COLOUR_SPECIFICATION_FOUND
Set if the required Colour Specification box has been found.
CONTIGUOUS_CODESTREAM_FOUND
Set if a JPEG2000 Contiguous Codestream box has been found.

Returns:
The JP2 validity flags value.

Bits_per_Component

public int[] Bits_per_Component()
Get the number of bits per pixel for each component in the image.

Returns:
An int array containing the number of bits per pixel for each image component, as determined from the Image Header box. A negative bits per pixel value signals that the pixel values are signed; the number of bits per pixel is abs (value). The array will be empty if the values are not yet known.

Codestream_Validity

public int Codestream_Validity()
Get the JPEG2000_Codestream_Info.Codestream_Validity() value.

Returns:
The JPEG2000_Codestream_Info.Codestream_Validity value, or 0 if the value is not yet known.

Total_Components

public int Total_Components()
Get the number of components (bands) in the image.

If the value has not been obtained from the Image Header box the value will be obtained from a JPEG2000 codestream (Contiguous_Codestream, jp2c) box if available.

Returns:
The number of image components, as determined from the Image Header box. This will be -1 if the value is not yet known.

Image_Width

public long Image_Width()
Get the width of the image.

The image width is the distance on the reference grid from the horizontal image offset to the reference grid width. If the value has not been obtained from the Image Header box the value will be obtained from a JPEG2000 codestream (Contiguous_Codestream, jp2c) box if available.

N.B.: The image width is measured in terms of reference grid columns. However, an individual image pixel may occupy more than one reference grid column. The pixel width may be different for each image component.

Returns:
The reference grid width of the image. This will be -1 if the value is not yet known.

Image_Height

public long Image_Height()
Get the height of the image.

The image height is the distance on the reference grid from the vertical image offset to the reference grid height. If the value has not been obtained from the Image Header box the value will be obtained from a JPEG2000 codestream (Contiguous_Codestream, jp2c) box if available.

N.B.: The image height is measured in terms of reference grid rows. However, an individual image pixel may occupy more than one reference grid row. The pixel height may be different for each image component.

Returns:
The reference grid height of the image. This will be -1 if the value is not yet known.

Reference_Grid_Width

public long Reference_Grid_Width()
Get the JPEG2000_Codestream_Info.Reference_Grid_Width() value.

Returns:
The JPEG2000_Codestream_Info.Reference_Grid_Width value, or -1 if the value is not yet known.

Reference_Grid_Height

public long Reference_Grid_Height()
Get the JPEG2000_Codestream_Info.Reference_Grid_Height() value.

Returns:
The JPEG2000_Codestream_Info.Reference_Grid_Height value, or -1 if the value is not yet known.

Horizontal_Image_Offset

public long Horizontal_Image_Offset()
Get the JPEG2000_Codestream_Info.Horizontal_Image_Offset() value.

Returns:
The JPEG2000_Codestream_Info.Horizontal_Image_Offset value, or -1 if the value is not yet known.

Vertical_Image_Offset

public long Vertical_Image_Offset()
Get the JPEG2000_Codestream_Info.Vertical_Image_Offset() value.

Returns:
The JPEG2000_Codestream_Info.Vertical_Image_Offset value, or -1 if the value is not yet known.

Pixel_Width

public int[] Pixel_Width()
Get the JPEG2000_Codestream_Info.Pixel_Width() value.

Returns:
The JPEG2000_Codestream_Info.Pixel_Width value, or an empty int array if the value is not yet known.

Pixel_Height

public int[] Pixel_Height()
Get the JPEG2000_Codestream_Info.Pixel_Height() value.

Returns:
The JPEG2000_Codestream_Info.Pixel_Height value, or an empty int array if the value is not yet known.

Tile_Width

public long Tile_Width()
Get the JPEG2000_Codestream_Info.Tile_Width() value.

Returns:
The JPEG2000_Codestream_Info.Tile_Width value, or -1 if the value is not yet known.

Tile_Height

public long Tile_Height()
Get the JPEG2000_Codestream_Info.Tile_Height() value.

Returns:
The JPEG2000_Codestream_Info.Tile_Height value, or -1 if the value is not yet known.

Horizontal_Tile_Offset

public long Horizontal_Tile_Offset()
Get the JPEG2000_Codestream_Info.Horizontal_Tile_Offset() value.

Returns:
The JPEG2000_Codestream_Info.Horizontal_Tile_Offset value, or -1 if the value is not yet known.

Vertical_Tile_Offset

public long Vertical_Tile_Offset()
Get the JPEG2000_Codestream_Info.Vertical_Tile_Offset() value.

Returns:
The JPEG2000_Codestream_Info.Vertical_Tile_Offset value, or -1 if the value is not yet known.

Total_Tiles

public int Total_Tiles()
Get the JPEG2000_Codestream_Info.Total_Tiles() value.

Returns:
The JPEG2000_Codestream_Info.Total_Tiles value, or -1 if the value is not yet known.

Zero_Length_Tile_Part

public boolean Zero_Length_Tile_Part()
Test if a zero length tile-part was found in the codestream.

Returns:
true if a zero length tile-part was found; false otherwise.

Total_Quality_Layers

public int Total_Quality_Layers()
Get the JPEG2000_Codestream_Info.Total_Quality_Layers() value.

Returns:
The JPEG2000_Codestream_Info.Total_Quality_Layers value, or -1 if the value is not yet known.

Progression_Order

public int Progression_Order()
Get the JPEG2000_Codestream_Info.Progression_Order() value.

Returns:
The JPEG2000_Codestream_Info.Progression_Order value, or -1 if the value is not yet known.

Total_Resolution_Levels

public int Total_Resolution_Levels()
Get the JPEG2000_Codestream_Info.Total_Resolution_Levels() value.

Returns:
The JPEG2000_Codestream_Info.Total_Resolution_Levels value, or -1 if the value is not yet known.

Transform

public int Transform()
Get the JPEG2000_Codestream_Info.Transform() value.

Returns:
The JPEG2000_Codestream_Info.Transform value, or -1 if the value is not yet known.

Box

public static Parameter Box(byte[] data,
                            int offset,
                            int length)
Assemble a Parameter Aggregate describing a JP2 box from a byte array.

A single JP2 box is parsed from the byte data. If the data contains additional JP2 box contents they are ignored. Including data position parameters is disabled as is illegal box organizaion detection.

Parameters:
data - A byte array.
offset - The offset where the JP2 box is expected to start.
length - The maximum amount of byte data to be read. However, if the data array ends before length bytes after the starting offset, then only the available bytes will be read.
Returns:
A Parameter Aggregate containing Parameters describing the JP2 box contents. This will be null if the contents of a recognized box were not available within the data length.

Box

public static Parameter Box(byte[] data)
Assemble a Parameter Aggregate from a byte array of JP2 box data.

Parameters:
data - A byte array.
Returns:
A Parameter Aggregate containing Parameters describing the JP2 box contents. This will be null if the contents of a recognized box were not available within the data array.
See Also:
Box(byte[], int, int)

Box_Name

public static String Box_Name(int type_code)
Get the descriptive box name for a box type.

Parameters:
type_code - The box type code value. This may be obtained from the TYPE_PARAMETER present in each box Parameter Group.
Returns:
The box name String as used in the NAME_PARAMETER of each box Parameter Group.

int_to_String

public static String int_to_String(int value)
Convert an int value to a String.

Each byte, starting with the most significant byte, of the value is appended as a character to a String. Non-printable characters are expanded to escape sequences.

Parameters:
value - The int value to be converted.
Returns:
The String repesentation of the value.

main

public static void main(String[] arguments)
Report the JP2_Info found in a file.

Parameters:
arguments - The arguments String array.
See Also:
Usage()

Usage

public static void Usage()
Print the command line usage syntax.

Usage

JP2_Info [-[No_]Tiles] [-Gui] [-Find <parameter>] [-Pattern <regex>] <source>

Description

The contents of the specified file are scanned for JP2 file format boxes and JPEG2000 codestream segments. The information found is reported in the form of PVL parameters containing all the data element values.

Options

-[No_]Tiles

Tiles segment parameters are to be included (or not). The default is not to include tile segment parameters.

-Gui

The information PVL is provided in a GUI viewer. The default is to provide a terminal listing.

-Find <parameter>

The named parameter is listed. This option may be repeated to obtain a listing of all parameters specified.

-Pattern <regex>

The parameters with names that match the regular expression are listed. This option may also be repeated.

N.B.This method always results in a System.exit with a status of 1.


PIRL

Copyright (C) \ 2003-2009 Bradford Castalia, University of Arizona