PIRL.Image_Tools

## Class JPEG2000_Codestream_Info

- java.lang.Object
- - javax.swing.tree.DefaultMutableTreeNode
  - - PIRL.PVL.Parameter
    - - PIRL.Image_Tools.JPEG2000_Info
      - - PIRL.Image_Tools.JPEG2000_Codestream_Info

All Implemented Interfaces:
  Serializable, Cloneable, MutableTreeNode, TreeNode

    public class JPEG2000_Codestream_Info
    extends JPEG2000_Info

JPEG2000_Codestream_Info provides a set of PVL Parameters that describe the contents of a JPEG2000 codestream.

The JPEG2000 codestream 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 format is composed entirely of a contiguous sequence of codestream segment. Each segment is prefaced with a marker that identifies the segement. The marker is followed by length. Boxes may be nested within other boxes.

See Also:
  `JP2_Info`, `JPEG2000_Info`, Serialized Form

### Field Summary

Fields
`static String` `BINARY_DATA_PARAMETER`
`static String` `CAPABILITY_PARAMETER`
`static int` `COC_MARKER`
`static String` `COC_NAME`
`static int` `COD_FOUND` `Codestream validity` bit mask for the COD segment found flag.
`static int` `COD_MARKER`
`static String` `COD_NAME`
`static String` `CODE_BLOCK_HEIGHT_PARAMETER`
`static String` `CODE_BLOCK_STYLE_PARAMETER`
`static String` `CODE_BLOCK_WIDTH_PARAMETER`
`static String` `CODESTREAM`
`static int` `CODESTREAM_COMPLETE` `Codestream validity` value indicating that a complete codestream with all required segments were found.
`static String` `CODING_STYLE_PARAMETER`
`static int` `COM_MARKER`
`static String` `COM_NAME`
`static String` `COMPONENT_INDEX_PARAMETER`
`static String` `CONTINUATION_PARAMETER`
`static int` `CPRL_PROGRESSION_ORDER`
`static int` `CRG_MARKER`
`static String` `CRG_NAME`
`static int` `DATA_TYPE_BINARY`
`static String` `DATA_TYPE_PARAMETER`
`static int` `DATA_TYPE_TEXT`
`static int` `ENTROPY_CODER_FLAG`
`static int` `EOC_FOUND` `Codestream validity` bit mask for the EOC segment found flag.
`static int` `EOC_MARKER`
`static String` `EOC_NAME`
`static boolean` `EOC_Search` Flag for missing EOC search through the codestream.
`static int` `EPH_FLAG`
`static int` `EPH_MARKER`
`static String` `EPH_NAME`
`static String` `HORIZONTAL_COMPONENT_OFFSET_PARAMETER`
`static String` `HORIZONTAL_IMAGE_OFFSET_PARAMETER`
`static String` `HORIZONTAL_SAMPLE_SPACING_PARAMETER`
`static String` `HORIZONTAL_TILE_OFFSET_PARAMETER`
`static String` `ID`
`static String` `IMPLICIT_SHIFT_PARAMETER`
`static String` `INDEX_PARAMETER`
`static int` `IO_EXCEPTION`
`static String` `LAYER_INDEX_PARAMETER`
`static String` `LEVEL_INDEX_PARAMETER`
`static int` `LRCP_PROGRESSION_ORDER`
`static String` `MARKER_PARAMETER`
`static String` `MULTIPLE_COMPONENT_TRANSFORM_PARAMETER`
`static int` `NO_INFO`
`static int` `NO_QUANTIZATION`
`static String` `PACKET_LENGTH_PARAMETER`
`static int` `PCRL_PROGRESSION_ORDER`
`static int` `PLM_MARKER`
`static String` `PLM_NAME`
`static int` `PLT_MARKER`
`static String` `PLT_NAME`
`static int` `POC_MARKER`
`static String` `POC_NAME`
`static int` `PPM_MARKER`
`static String` `PPM_NAME`
`static int` `PPT_MARKER`
`static String` `PPT_NAME`
`static String` `PRECINCT_SIZE_PARAMETER`
`static int` `PREDICTABLE_TERMINATION_FLAG`
`static String` `PROGRESSION_ORDER_PARAMETER`
`static String[]` `PROGRESSION_ORDERS`
`static int` `PVL_ERROR`
`static int` `QCC_MARKER`
`static String` `QCC_NAME`
`static int` `QCD_FOUND` `Codestream validity` bit mask for the QCD segment found flag.
`static int` `QCD_MARKER`
`static String` `QCD_NAME`
`static int` `QUANTIZATION_SCALAR_DERIVED`
`static int` `QUANTIZATION_SCALAR_EXPOUNDED`
`static String` `QUANTIZATION_STYLE_PARAMETER`
`static String` `REFERENCE_GRID_HEIGHT_PARAMETER`
`static String` `REFERENCE_GRID_WIDTH_PARAMETER`
`static int` `RESERVED_DELIMITER_MARKER_MAX`
`static int` `RESERVED_DELIMITER_MARKER_MIN`
`static int` `RESET_CONTEXT_PROBABILITIES`
`static int` `RGN_MARKER`
`static String` `RGN_NAME`
`static int` `RLCP_PROGRESSION_ORDER`
`static String` `ROI_STYLE_PARAMETER`
`static int` `RPCL_PROGRESSION_ORDER`
`static int` `SEGMENTATION_SYMBOLS_FLAG`
`static int` `SELECTIVE_ARITHMETIC_BYPASS_FLAG`
`static int` `SIZ_FOUND` `Codestream validity` bit mask for the SIZ segment found flag.
`static int` `SIZ_MARKER`
`static String` `SIZ_NAME`
`static int` `SOC_FOUND` `Codestream validity` bit mask for the SOC segment found flag.
`static int` `SOC_MARKER`
`static String` `SOC_NAME`
`static int` `SOD_MARKER`
`static String` `SOD_NAME`
`static int` `SOP_FLAG`
`static int` `SOP_MARKER`
`static String` `SOP_NAME`
`static int` `SOT_MARKER`
`static String` `SOT_NAME`
`static String` `STEP_SIZE_PARAMETER`
`static int` `SUCCESS`
`static int` `SYNTAX_ERROR`
`static int` `TERMINATION_FLAG`
`static String` `TEXT_DATA_PARAMETER`
`static String` `TILE_HEIGHT_PARAMETER`
`static String` `TILE_INDEX_PARAMETER`
`static String` `TILE_INDEX_SIZE_PARAMETER`
`static String` `TILE_PART_INDEX_PARAMETER`
`static String` `TILE_PART_LENGTH_PARAMETER`
`static String` `TILE_PART_LENGTH_SIZE_PARAMETER`
`static String` `TILE_WIDTH_PARAMETER`
`static int` `TLM_MARKER`
`static String` `TLM_NAME`
`static String` `TOTAL_GUARD_BITS_PARAMETER`
`static String` `TOTAL_QUALITY_LAYERS_PARAMETER`
`static String` `TOTAL_RESOLUTION_LEVELS_PARAMETER`
`static String` `TOTAL_TILE_PARTS_PARAMETER`
`static int` `TRANSFORM_IRREVERSIBLE`
`static String` `TRANSFORM_PARAMETER`
`static int` `TRANSFORM_REVERSIBLE`
`static String` `VERTICAL_COMPONENT_OFFSET_PARAMETER`
`static String` `VERTICAL_IMAGE_OFFSET_PARAMETER`
`static String` `VERTICAL_SAMPLE_SPACING_PARAMETER`
`static String` `VERTICAL_TILE_OFFSET_PARAMETER`
`static int` `VERTICALLY_CAUSAL_CONTEXT_FLAG`

### 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

Constructors
Constructor and Description
`JPEG2000_Codestream_Info()` Construct a an empty JPEG2000_Codestream_Info Object.
`JPEG2000_Codestream_Info(File file)` Construct a JPEG2000_Codestream_Info for a File.
`JPEG2000_Codestream_Info(File file, boolean skip_tiles)` Construct a JPEG2000_Codestream_Info for a File.
`JPEG2000_Codestream_Info(ImageInputStream image_input_stream)` Construct a JPEG2000_Codestream_Info for an ImageInputStream.
`JPEG2000_Codestream_Info(ImageInputStream image_input_stream, boolean skip_tiles)` Construct a JPEG2000_Codestream_Info for an ImageInputStream.
`JPEG2000_Codestream_Info(ImageInputStream image_input_stream, long end_position, boolean skip_tiles)` Construct a JPEG2000_Codestream_Info for an ImageInputStream and Reads the stream up to an end position.
`JPEG2000_Codestream_Info(String filename)` Construct a JPEG2000_Codestream_Info for a named file.
`JPEG2000_Codestream_Info(String filename, boolean skip_tiles)` Construct a JPEG2000_Codestream_Info for a named file.

### Method Summary

Methods
`int` `Codestream_Validity()` Get the codestream validity flags.
`long` `Horizontal_Image_Offset()` Get the horizontal offset of the image on the reference grid.
`long` `Horizontal_Tile_Offset()` Get the horizontal offset of the tiles on the reference grid.
`long` `Image_Height()` Get the height of the image.
`long` `Image_Width()` Get the width of the image.
`boolean` `Is_Complete_Codestream()` Test if the Source file contains a complete codestream.
`static void` `main(String[] arguments)` Report the JPEG2000 codestream segments found in a raw codestream file.
`static String` `Marker_Name(int marker)`
`int[]` `Pixel_Height()` Get the height of a component's pixel.
`int[]` `Pixel_Width()` Get the width of a component's pixel.
`int` `Progression_Order()` Get the codestream default progression order.
`JPEG2000_Codestream_Info` `Read()` Read JPEG2000 codestream information from the Source file.
`JPEG2000_Codestream_Info` `Read(long end_position, boolean skip_tiles)` Read JPEG2000 codestream information from the Source file.
`long` `Reference_Grid_Height()` Get the height of the image components reference grid.
`long` `Reference_Grid_Width()` Get the width of the image components reference grid.
`static Parameter` `Segments(byte[] data)` Assemble a Parameter Aggregate describing a sequence of codestream segments from a byte array.
`static Parameter` `Segments(byte[] data, boolean skip_tiles)` Assemble a Parameter Aggregate describing a sequence of codestream segments from a byte array.
`static Parameter` `Segments(byte[] data, int offset, int length)` Assemble a Parameter Aggregate describing a sequence of codestream segments from a byte array.
`static Parameter` `Segments(byte[] data, int offset, int length, boolean skip_tiles)` Assemble a Parameter Aggregate describing a sequence of codestream segments from a byte array.
`long` `Tile_Height()` Get the tile height.
`long` `Tile_Width()` Get the tile width.
`int` `Total_Components()` Get the total number of components identified in the codestream.
`int` `Total_Quality_Layers()` Get the total number of quality layers in the codestream.
`int` `Total_Resolution_Levels()` Get the total number of resolution levels.
`int` `Total_Tiles()` Get the total tiles expected to be found in the codestream.
`int` `Transform()` Get the form of the codestream transformation.
`static void` `Usage()` Print the command line usage syntax.
`long` `Vertical_Image_Offset()` Get the vertical offset of the image on the reference grid.
`long` `Vertical_Tile_Offset()` Get the vertical offset of the tiles on the reference grid.
`boolean` `Zero_Length_Tile_Part()` Test if a final tile-part of zero (unknown) length 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

#### CODESTREAM

    public static final String CODESTREAM

See Also:
  Constant Field Values

#### RESERVED_DELIMITER_MARKER_MIN

    public static final int RESERVED_DELIMITER_MARKER_MIN

See Also:
  Constant Field Values

#### RESERVED_DELIMITER_MARKER_MAX

    public static final int RESERVED_DELIMITER_MARKER_MAX

See Also:
  Constant Field Values

#### SOC_MARKER

    public static final int SOC_MARKER

See Also:
  Constant Field Values

#### SOT_MARKER

    public static final int SOT_MARKER

See Also:
  Constant Field Values

#### SOD_MARKER

    public static final int SOD_MARKER

See Also:
  Constant Field Values

#### EOC_MARKER

    public static final int EOC_MARKER

See Also:
  Constant Field Values

#### SIZ_MARKER

    public static final int SIZ_MARKER

See Also:
  Constant Field Values

#### COD_MARKER

    public static final int COD_MARKER

See Also:
  Constant Field Values

#### COC_MARKER

    public static final int COC_MARKER

See Also:
  Constant Field Values

#### RGN_MARKER

    public static final int RGN_MARKER

See Also:
  Constant Field Values

#### QCD_MARKER

    public static final int QCD_MARKER

See Also:
  Constant Field Values

#### QCC_MARKER

    public static final int QCC_MARKER

See Also:
  Constant Field Values

#### POC_MARKER

    public static final int POC_MARKER

See Also:
  Constant Field Values

#### TLM_MARKER

    public static final int TLM_MARKER

See Also:
  Constant Field Values

#### PLM_MARKER

    public static final int PLM_MARKER

See Also:
  Constant Field Values

#### PLT_MARKER

    public static final int PLT_MARKER

See Also:
  Constant Field Values

#### PPM_MARKER

    public static final int PPM_MARKER

See Also:
  Constant Field Values

#### PPT_MARKER

    public static final int PPT_MARKER

See Also:
  Constant Field Values

#### SOP_MARKER

    public static final int SOP_MARKER

See Also:
  Constant Field Values

#### EPH_MARKER

    public static final int EPH_MARKER

See Also:
  Constant Field Values

#### CRG_MARKER

    public static final int CRG_MARKER

See Also:
  Constant Field Values

#### COM_MARKER

    public static final int COM_MARKER

See Also:
  Constant Field Values

#### SOC_NAME

    public static final String SOC_NAME

See Also:
  Constant Field Values

#### SOT_NAME

    public static final String SOT_NAME

See Also:
  Constant Field Values

#### SOD_NAME

    public static final String SOD_NAME

See Also:
  Constant Field Values

#### EOC_NAME

    public static final String EOC_NAME

See Also:
  Constant Field Values

#### SIZ_NAME

    public static final String SIZ_NAME

See Also:
  Constant Field Values

#### COD_NAME

    public static final String COD_NAME

See Also:
  Constant Field Values

#### COC_NAME

    public static final String COC_NAME

See Also:
  Constant Field Values

#### RGN_NAME

    public static final String RGN_NAME

See Also:
  Constant Field Values

#### QCD_NAME

    public static final String QCD_NAME

See Also:
  Constant Field Values

#### QCC_NAME

    public static final String QCC_NAME

See Also:
  Constant Field Values

#### POC_NAME

    public static final String POC_NAME

See Also:
  Constant Field Values

#### TLM_NAME

    public static final String TLM_NAME

See Also:
  Constant Field Values

#### PLM_NAME

    public static final String PLM_NAME

See Also:
  Constant Field Values

#### PLT_NAME

    public static final String PLT_NAME

See Also:
  Constant Field Values

#### PPM_NAME

    public static final String PPM_NAME

See Also:
  Constant Field Values

#### PPT_NAME

    public static final String PPT_NAME

See Also:
  Constant Field Values

#### SOP_NAME

    public static final String SOP_NAME

See Also:
  Constant Field Values

#### EPH_NAME

    public static final String EPH_NAME

See Also:
  Constant Field Values

#### CRG_NAME

    public static final String CRG_NAME

See Also:
  Constant Field Values

#### COM_NAME

    public static final String COM_NAME

See Also:
  Constant Field Values

#### MARKER_PARAMETER

    public static final String MARKER_PARAMETER

See Also:
  Constant Field Values

#### TILE_INDEX_PARAMETER

    public static final String TILE_INDEX_PARAMETER

See Also:
  Constant Field Values

#### TILE_PART_LENGTH_PARAMETER

    public static final String TILE_PART_LENGTH_PARAMETER

See Also:
  Constant Field Values

#### TILE_PART_INDEX_PARAMETER

    public static final String TILE_PART_INDEX_PARAMETER

See Also:
  Constant Field Values

#### TOTAL_TILE_PARTS_PARAMETER

    public static final String TOTAL_TILE_PARTS_PARAMETER

See Also:
  Constant Field Values

#### CAPABILITY_PARAMETER

    public static final String CAPABILITY_PARAMETER

See Also:
  Constant Field Values

#### REFERENCE_GRID_WIDTH_PARAMETER

    public static final String REFERENCE_GRID_WIDTH_PARAMETER

See Also:
  Constant Field Values

#### REFERENCE_GRID_HEIGHT_PARAMETER

    public static final String REFERENCE_GRID_HEIGHT_PARAMETER

See Also:
  Constant Field Values

#### HORIZONTAL_IMAGE_OFFSET_PARAMETER

    public static final String HORIZONTAL_IMAGE_OFFSET_PARAMETER

See Also:
  Constant Field Values

#### VERTICAL_IMAGE_OFFSET_PARAMETER

    public static final String VERTICAL_IMAGE_OFFSET_PARAMETER

See Also:
  Constant Field Values

#### TILE_WIDTH_PARAMETER

    public static final String TILE_WIDTH_PARAMETER

See Also:
  Constant Field Values

#### TILE_HEIGHT_PARAMETER

    public static final String TILE_HEIGHT_PARAMETER

See Also:
  Constant Field Values

#### HORIZONTAL_TILE_OFFSET_PARAMETER

    public static final String HORIZONTAL_TILE_OFFSET_PARAMETER

See Also:
  Constant Field Values

#### VERTICAL_TILE_OFFSET_PARAMETER

    public static final String VERTICAL_TILE_OFFSET_PARAMETER

See Also:
  Constant Field Values

#### HORIZONTAL_SAMPLE_SPACING_PARAMETER

    public static final String HORIZONTAL_SAMPLE_SPACING_PARAMETER

See Also:
  Constant Field Values

#### VERTICAL_SAMPLE_SPACING_PARAMETER

    public static final String VERTICAL_SAMPLE_SPACING_PARAMETER

See Also:
  Constant Field Values

#### CODING_STYLE_PARAMETER

    public static final String CODING_STYLE_PARAMETER

See Also:
  Constant Field Values

#### PROGRESSION_ORDER_PARAMETER

    public static final String PROGRESSION_ORDER_PARAMETER

See Also:
  Constant Field Values

#### TOTAL_QUALITY_LAYERS_PARAMETER

    public static final String TOTAL_QUALITY_LAYERS_PARAMETER

See Also:
  Constant Field Values

#### MULTIPLE_COMPONENT_TRANSFORM_PARAMETER

    public static final String MULTIPLE_COMPONENT_TRANSFORM_PARAMETER

See Also:
  Constant Field Values

#### TOTAL_RESOLUTION_LEVELS_PARAMETER

    public static final String TOTAL_RESOLUTION_LEVELS_PARAMETER

See Also:
  Constant Field Values

#### CODE_BLOCK_WIDTH_PARAMETER

    public static final String CODE_BLOCK_WIDTH_PARAMETER

See Also:
  Constant Field Values

#### CODE_BLOCK_HEIGHT_PARAMETER

    public static final String CODE_BLOCK_HEIGHT_PARAMETER

See Also:
  Constant Field Values

#### CODE_BLOCK_STYLE_PARAMETER

    public static final String CODE_BLOCK_STYLE_PARAMETER

See Also:
  Constant Field Values

#### TRANSFORM_PARAMETER

    public static final String TRANSFORM_PARAMETER

See Also:
  Constant Field Values

#### PRECINCT_SIZE_PARAMETER

    public static final String PRECINCT_SIZE_PARAMETER

See Also:
  Constant Field Values

#### ENTROPY_CODER_FLAG

    public static final int ENTROPY_CODER_FLAG

See Also:
  Constant Field Values

#### SOP_FLAG

    public static final int SOP_FLAG

See Also:
  Constant Field Values

#### EPH_FLAG

    public static final int EPH_FLAG

See Also:
  Constant Field Values

#### LRCP_PROGRESSION_ORDER

    public static final int LRCP_PROGRESSION_ORDER

See Also:
  Constant Field Values

#### RLCP_PROGRESSION_ORDER

    public static final int RLCP_PROGRESSION_ORDER

See Also:
  Constant Field Values

#### RPCL_PROGRESSION_ORDER

    public static final int RPCL_PROGRESSION_ORDER

See Also:
  Constant Field Values

#### PCRL_PROGRESSION_ORDER

    public static final int PCRL_PROGRESSION_ORDER

See Also:
  Constant Field Values

#### CPRL_PROGRESSION_ORDER

    public static final int CPRL_PROGRESSION_ORDER

See Also:
  Constant Field Values

#### PROGRESSION_ORDERS

    public static final String[] PROGRESSION_ORDERS

#### SELECTIVE_ARITHMETIC_BYPASS_FLAG

    public static final int SELECTIVE_ARITHMETIC_BYPASS_FLAG

See Also:
  Constant Field Values

#### RESET_CONTEXT_PROBABILITIES

    public static final int RESET_CONTEXT_PROBABILITIES

See Also:
  Constant Field Values

#### TERMINATION_FLAG

    public static final int TERMINATION_FLAG

See Also:
  Constant Field Values

#### VERTICALLY_CAUSAL_CONTEXT_FLAG

    public static final int VERTICALLY_CAUSAL_CONTEXT_FLAG

See Also:
  Constant Field Values

#### PREDICTABLE_TERMINATION_FLAG

    public static final int PREDICTABLE_TERMINATION_FLAG

See Also:
  Constant Field Values

#### SEGMENTATION_SYMBOLS_FLAG

    public static final int SEGMENTATION_SYMBOLS_FLAG

See Also:
  Constant Field Values

#### TRANSFORM_IRREVERSIBLE

    public static final int TRANSFORM_IRREVERSIBLE

See Also:
  Constant Field Values

#### TRANSFORM_REVERSIBLE

    public static final int TRANSFORM_REVERSIBLE

See Also:
  Constant Field Values

#### COMPONENT_INDEX_PARAMETER

    public static final String COMPONENT_INDEX_PARAMETER

See Also:
  Constant Field Values

#### ROI_STYLE_PARAMETER

    public static final String ROI_STYLE_PARAMETER

See Also:
  Constant Field Values

#### IMPLICIT_SHIFT_PARAMETER

    public static final String IMPLICIT_SHIFT_PARAMETER

See Also:
  Constant Field Values

#### QUANTIZATION_STYLE_PARAMETER

    public static final String QUANTIZATION_STYLE_PARAMETER

See Also:
  Constant Field Values

#### TOTAL_GUARD_BITS_PARAMETER

    public static final String TOTAL_GUARD_BITS_PARAMETER

See Also:
  Constant Field Values

#### STEP_SIZE_PARAMETER

    public static final String STEP_SIZE_PARAMETER

See Also:
  Constant Field Values

#### NO_QUANTIZATION

    public static final int NO_QUANTIZATION

See Also:
  Constant Field Values

#### QUANTIZATION_SCALAR_DERIVED

    public static final int QUANTIZATION_SCALAR_DERIVED

See Also:
  Constant Field Values

#### QUANTIZATION_SCALAR_EXPOUNDED

    public static final int QUANTIZATION_SCALAR_EXPOUNDED

See Also:
  Constant Field Values

#### LEVEL_INDEX_PARAMETER

    public static final String LEVEL_INDEX_PARAMETER

See Also:
  Constant Field Values

#### LAYER_INDEX_PARAMETER

    public static final String LAYER_INDEX_PARAMETER

See Also:
  Constant Field Values

#### INDEX_PARAMETER

    public static final String INDEX_PARAMETER

See Also:
  Constant Field Values

#### TILE_INDEX_SIZE_PARAMETER

    public static final String TILE_INDEX_SIZE_PARAMETER

See Also:
  Constant Field Values

#### TILE_PART_LENGTH_SIZE_PARAMETER

    public static final String TILE_PART_LENGTH_SIZE_PARAMETER

See Also:
  Constant Field Values

#### PACKET_LENGTH_PARAMETER

    public static final String PACKET_LENGTH_PARAMETER

See Also:
  Constant Field Values

#### CONTINUATION_PARAMETER

    public static final String CONTINUATION_PARAMETER

See Also:
  Constant Field Values

#### HORIZONTAL_COMPONENT_OFFSET_PARAMETER

    public static final String HORIZONTAL_COMPONENT_OFFSET_PARAMETER

See Also:
  Constant Field Values

#### VERTICAL_COMPONENT_OFFSET_PARAMETER

    public static final String VERTICAL_COMPONENT_OFFSET_PARAMETER

See Also:
  Constant Field Values

#### DATA_TYPE_PARAMETER

    public static final String DATA_TYPE_PARAMETER

See Also:
  Constant Field Values

#### BINARY_DATA_PARAMETER

    public static final String BINARY_DATA_PARAMETER

See Also:
  Constant Field Values

#### TEXT_DATA_PARAMETER

    public static final String TEXT_DATA_PARAMETER

See Also:
  Constant Field Values

#### DATA_TYPE_BINARY

    public static final int DATA_TYPE_BINARY

See Also:
  Constant Field Values

#### DATA_TYPE_TEXT

    public static final int DATA_TYPE_TEXT

See Also:
  Constant Field Values

#### SOC_FOUND

    public static final int SOC_FOUND

`Codestream validity` bit mask for the SOC segment found flag.

See Also:
  Constant Field Values

#### SIZ_FOUND

    public static final int SIZ_FOUND

`Codestream validity` bit mask for the SIZ segment found flag.

See Also:
  Constant Field Values

#### COD_FOUND

    public static final int COD_FOUND

`Codestream validity` bit mask for the COD segment found flag.

See Also:
  Constant Field Values

#### QCD_FOUND

    public static final int QCD_FOUND

`Codestream validity` bit mask for the QCD segment found flag.

See Also:
  Constant Field Values

#### EOC_FOUND

    public static final int EOC_FOUND

`Codestream validity` bit mask for the EOC segment found flag.

See Also:
  Constant Field Values

#### CODESTREAM_COMPLETE

    public static final int CODESTREAM_COMPLETE

`Codestream validity` value indicating that a complete codestream with all required segments were found. N.B.: The final EOC delimiter is not included as a required segment as it is usually not searched for.

See Also:
  Constant Field Values

#### EOC_Search

    public static boolean EOC_Search

Flag for missing EOC search through the codestream.

If true and the End of Codestream (`EOC`) is not found because the last tile-part segment has a zero length value, the remaining codestream data will be searched for the EOC marker. If false this search - which can be very time cosuming for a very large codestream segment - will not be done and the `codestream validity value` will not have the `EOC_FOUND` flag set.

By default the EOC search is disabled.

#### 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

#### JPEG2000_Codestream_Info

    public JPEG2000_Codestream_Info(String filename)
                             throws IOException

Construct a JPEG2000_Codestream_Info for a named file.

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

Parameters:
  `filename` - The filename from which to obtain the JPEG2000_Codestream_Info.
Throws:
  `IOException` - If there was a problem reading the file.
See Also:
  `Read(long, boolean)`

#### JPEG2000_Codestream_Info

    public JPEG2000_Codestream_Info(String filename,
                            boolean skip_tiles)
                             throws IOException

Construct a JPEG2000_Codestream_Info for a named file.

Parameters:
  `filename` - The filename from which to obtain the JPEG2000_Codestream_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.
See Also:
  `Read(long, boolean)`

#### JPEG2000_Codestream_Info

    public JPEG2000_Codestream_Info(File file)
                             throws IOException

Construct a JPEG2000_Codestream_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 JPEG2000_Codestream_Info.
Throws:
  `IOException` - If there was a problem reading the file.
See Also:
  `Read(long, boolean)`

#### JPEG2000_Codestream_Info

    public JPEG2000_Codestream_Info(File file,
                            boolean skip_tiles)
                             throws IOException

Construct a JPEG2000_Codestream_Info for a File.

Parameters:
  `file` - The File from which to obtain the JPEG2000_Codestream_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.
See Also:
  `Read(long, boolean)`

#### JPEG2000_Codestream_Info

    public JPEG2000_Codestream_Info(ImageInputStream image_input_stream)
                             throws IOException

Construct a JPEG2000_Codestream_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 JPEG2000_Codestream_Info.
Throws:
  `IOException` - If there was a problem reading the file.
See Also:
  `Read(long, boolean)`

#### JPEG2000_Codestream_Info

    public JPEG2000_Codestream_Info(ImageInputStream image_input_stream,
                            boolean skip_tiles)
                             throws IOException

Construct a JPEG2000_Codestream_Info for an ImageInputStream.

Parameters:
  `image_input_stream` - The ImageInputStream from which to obtain the JPEG2000_Codestream_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.
See Also:
  `Read(long, boolean)`

#### JPEG2000_Codestream_Info

    public JPEG2000_Codestream_Info(ImageInputStream image_input_stream,
                            long end_position,
                            boolean skip_tiles)
                             throws IOException

Construct a JPEG2000_Codestream_Info for an ImageInputStream and Reads the stream up to an end position.

Parameters:
  `image_input_stream` - The ImageInputStream containing a JPEG2000 codestream. The stream is presumed to be positioned at the beginning of the codestream.
  `end_position` - The byte position (exclusive) in the stream where the codestream ends.
  `skip_tiles` - true if tile segments are not to be included in the Parameters; false otherwise.
Throws:
  `IOException` - If a problem is encountered while reading the stream.
See Also:
  `Read(long, boolean)`

#### JPEG2000_Codestream_Info

    public JPEG2000_Codestream_Info()

Construct a an empty JPEG2000_Codestream_Info Object.

Use one of the Source methods to assign a source file. Then use a Read method to obtain the information parameters.

See Also:
  `JPEG2000_Info.Source(String)`, `Read(long, boolean)`

### Method Detail

#### Read

    public JPEG2000_Codestream_Info Read(long end_position,
                                boolean skip_tiles)
                                  throws IOException

Read JPEG2000 codestream information from the Source file.

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

The Source is read from its current position up to, but not including, the end position. If the end position is 0 the file is read until an End_of_Codestream segment is found, no more recognized segments are found, or the end of file. If an unrecognized marker is encountered the stream is repositioned back to the location where the marker was read.

Any information Parameters currently present are removed. Then the file is scanned for JPEG2000 codestream marker segments. Each segment 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 name associated with the marker. The Group always contains the following parameters:

Marker
  The marker code in numeric hexadecimal form.
^Position
  The position of the segment 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 segment in bytes.

The remaining Parameters in each Group depend on the segment 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_Info object.

N.B.: Unless `illegal state detection` is disabled, a `JPEG2000_Info.WARNING_PARAMETER` will be placed at the end of the Parameter set and further Source file scanning halted if the previous segment 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 codestream does not contain a valid Start_of_Codestream segment or the second segment is not a valid Size segment.

Parameters:
  `end_position` - The location in the Source stream before which reading is to stop. If 0 reading stops at the first unrecognized segment marker or the end of file.
  `skip_tiles` - true if tile segments are not to be included in the Parameters; false otherwise.
Returns:
  This JPEG2000_Codestream_Info.
Throws:
  `IOException` - If there was a problem reading the Source file.
See Also:
  `JPEG2000_Info`

#### Read

    public JPEG2000_Codestream_Info Read()
                                  throws IOException

Read JPEG2000 codestream information from the Source file.

Returns:
  This JPEG2000_Codestream_Info.
Throws:
  `IOException` - If there was a problem reading the Source.
See Also:
  `Read(long, boolean)`

#### Is_Complete_Codestream

    public boolean Is_Complete_Codestream()

Test if the Source file contains a complete codestream.

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

Returns:
  true if the `Codestream Validity` value has all the `CODESTREAM_COMPLETE` flags set; false otherwise.

#### Codestream_Validity

    public int Codestream_Validity()

Get the codestream validity flags.

Returns:
  An int value holding the codestream validity flags. This will be 0 if the value is not yet known.
See Also:
  `SIZ_FOUND`, `COD_FOUND`, `QCD_FOUND`, `EOC_FOUND`, `CODESTREAM_COMPLETE`

#### Total_Components

    public int Total_Components()

Get the total number of components identified in the codestream.

This value corresponds to the value of the `JPEG2000_Info.TOTAL_COMPONENTS_PARAMETER`.

Returns:
  The total number of components in the codestream. 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 .

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

#### Image_Height

    public long Image_Height()

Get the height of the image.

This value corresponds to the value of the `REFERENCE_GRID_HEIGHT_PARAMETER`.

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

#### Reference_Grid_Width

    public long Reference_Grid_Width()

Get the width of the image components reference grid.

This value corresponds to the value of the `REFERENCE_GRID_WIDTH_PARAMETER`.

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

#### Reference_Grid_Height

    public long Reference_Grid_Height()

Get the height of the image components reference grid.

This value corresponds to the value of the `REFERENCE_GRID_HEIGHT_PARAMETER`.

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

#### Horizontal_Image_Offset

    public long Horizontal_Image_Offset()

Get the horizontal offset of the image on the reference grid.

The horizontal offset to the upper left corner of the image area will always be positive (to the right relative to the reference grid origin at the upper left corner of the reference grid). This value corresponds to the value of the `HORIZONTAL_IMAGE_OFFSET_PARAMETER`.

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

#### Vertical_Image_Offset

    public long Vertical_Image_Offset()

Get the vertical offset of the image on the reference grid.

The vertical offset to the upper left corner of the image area will always be positive (downwards relative to the reference grid origin at the upper left corner of the reference grid). This value corresponds to the value of the `VERTICAL_IMAGE_OFFSET_PARAMETER`.

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

#### Pixel_Width

    public int[] Pixel_Width()

Get the width of a component's pixel.

The width of a pixel is measured in reference grid units. Each component of the image may have a differenct pixel width. This value array corresponds to the array of the `HORIZONTAL_SAMPLE_SPACING_PARAMETER`.

Returns:
  An int array of pixel width values in component order. This will be an empty array if the values are not yet known.

#### Pixel_Height

    public int[] Pixel_Height()

Get the height of a component's pixel.

The height of a pixel is measured in reference grid units. Each component of the image may have a differenct pixel height. This value array corresponds to the array of the `VERTICAL_SAMPLE_SPACING_PARAMETER`.

Returns:
  An int array of pixel height values in component order. This will be an empty array if the values are not yet known.

#### Tile_Width

    public long Tile_Width()

Get the tile width.

This value corresponds to the value of the `TILE_WIDTH_PARAMETER`.

Returns:
  The tile width measured in reference grid units. This will be -1 if the value is not yet known.

#### Tile_Height

    public long Tile_Height()

Get the tile height.

This value corresponds to the value of the `TILE_HEIGHT_PARAMETER`.

Returns:
  The tile height measured in reference grid units. This will be -1 if the value is not yet known.

#### Horizontal_Tile_Offset

    public long Horizontal_Tile_Offset()

Get the horizontal offset of the tiles on the reference grid.

The horizontal offset to the upper left corner of the upper left tile will always be positive (to the right relative to the reference grid origin at the upper left corner of the reference grid) and no greather than the `horizontal image offset`. This value corresponds to the value of the `HORIZONTAL_IMAGE_OFFSET_PARAMETER`.

Returns:
  The horizontal offset of the tiles on the reference grid. This will be -1 if the value is not yet known.

#### Vertical_Tile_Offset

    public long Vertical_Tile_Offset()

Get the vertical offset of the tiles on the reference grid.

The vertical offset to the upper left corner of the upper left tile will always be positive (downwards relative to the reference grid origin at the upper left corner of the reference grid) and no greather than the `vertical image offset`. This value corresponds to the value of the `VERTICAL_IMAGE_OFFSET_PARAMETER`.

Returns:
  The horizontal offset of the tiles on the reference grid. This will be -1 if the value is not yet known.

#### Total_Tiles

    public int Total_Tiles()

Get the total tiles expected to be found in the codestream.

Returns:
  The total number of tiles expected, but not necessarily found, in the codestream. This will be -1 if the value is not yet known.

#### Zero_Length_Tile_Part

    public boolean Zero_Length_Tile_Part()

Test if a final tile-part of zero (unknown) length was found in the codestream.

If a tile-part of zero length is found in the codestream it must be the last tile-part before the EOC marker. If `EOC_Search` has been set the tile-part will be searched for the final EOC delimiter segment.

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

#### Total_Quality_Layers

    public int Total_Quality_Layers()

Get the total number of quality layers in the codestream.

This value corresponds to the value of the `TOTAL_QUALITY_LAYERS_PARAMETER`.

Returns:
  The total number of quality layers in the codestream. This will be -1 if the value is not yet known.

#### Progression_Order

    public int Progression_Order()

Get the codestream default progression order.

Use the `PROGRESSION_ORDERS` String array to obtain a description of the progression order code.

This value corresponds to the value of the `PROGRESSION_ORDER_PARAMETER`.

Returns:
  The codestream progression order code from the COD segment. The value may be one of `LRCP_PROGRESSION_ORDER`, `RLCP_PROGRESSION_ORDER`, `RPCL_PROGRESSION_ORDER`, `PCRL_PROGRESSION_ORDER`, or `CPRL_PROGRESSION_ORDER`. This will be -1 if the value is not yet known.

#### Total_Resolution_Levels

    public int Total_Resolution_Levels()

Get the total number of resolution levels.

The value is obtained from the first coding style default (COD) segment encountered in the codestream. This is expected to be from the image and tile size (SIZ) segment. But if a tile header is independently parsed and it contains a COD segment then that will be used. N.B.: The value is never obtained from a coding style component (COC) segment. This value corresponds to the value of the `TOTAL_RESOLUTION_LEVELS_PARAMETER`.

The total number of resolution levels is one more than the maximum decomposition level.

Returns:
  The total number of resolution levels. This will be -1 if the value is not yet known.

#### Transform

    public int Transform()

Get the form of the codestream transformation.

The value is obtained from the first coding style default (COD) segment encountered in the codestream. This is expected to be from the image and tile size (SIZ) segment. But if a tile header is independently parsed and it contains a COD segment then that will be used. N.B.: The value is never obtained from a coding style component (COC) segment. This value corresponds to the value of the `TRANSFORM_PARAMETER`.

Returns:
  The codestream transformation indicator. This will be `TRANSFORM_IRREVERSIBLE` (0) for the 9-7 irreversible filter; it will be `TRANSFORM_REVERSIBLE` (1) for the 5-3 reversible filter. This will be -1 if the value is not yet known.

#### Segments

    public static Parameter Segments(byte[] data,
                     int offset,
                     int length,
                     boolean skip_tiles)

Assemble a Parameter Aggregate describing a sequence of codestream segments from a byte array.

A sequence of codestream segments is parsed from the byte data. All segments found are parsed. `Including data position` parameters is disabled as is `illegal codestream segment organizaion detection`.

Parameters:
  `data` - A byte array.
  `offset` - The offset where the codestream segments are 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.
  `skip_tiles` - true if tile segments are not to be included in the Parameters; false otherwise.
Returns:
  A Parameter Aggregate containing Parameters describing the codestream segment contents. This will be null if the contents of a recognized segment were not available within the data length.

#### Segments

    public static Parameter Segments(byte[] data,
                     int offset,
                     int length)

Assemble a Parameter Aggregate describing a sequence of codestream segments from a byte array.

The `JPEG2000_Info.Skip_Tiles_Default` flag determines if tile segments will be skipped.

Parameters:
  `data` - A byte array.
  `offset` - The offset where the codestream segments are 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 codestream segment contents. This will be null if the contents of a recognized segment were not available within the data length.
See Also:
  `Segments(byte[], int, int, boolean)`

#### Segments

    public static Parameter Segments(byte[] data,
                     boolean skip_tiles)

Assemble a Parameter Aggregate describing a sequence of codestream segments from a byte array.

Parameters:
  `data` - A byte array.
  `skip_tiles` - true if tile segments are not to be included in the Parameters; false otherwise.
Returns:
  A Parameter Aggregate containing Parameters describing the codestream segment contents. This will be null if the contents of a recognized segment were not available within the data length.
See Also:
  `Segments(byte[], int, int, boolean)`

#### Segments

    public static Parameter Segments(byte[] data)

Assemble a Parameter Aggregate describing a sequence of codestream segments from a byte array.

The `JPEG2000_Info.Skip_Tiles_Default` flag determines if tile segments will be skipped.

Parameters:
  `data` - A byte array.
Returns:
  A Parameter Aggregate containing Parameters describing the codestream segment contents. This will be null if the contents of a recognized segment were not available within the data length.
See Also:
  `Segments(byte[], int, int, boolean)`

#### Marker_Name

    public static String Marker_Name(int marker)
                              throws IOException

Throws:
  `IOException`

#### main

    public static void main(String[] arguments)

Report the JPEG2000 codestream segments found in a raw codestream file.

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

#### Usage

    public static void Usage()

Print the command line usage syntax.

### Usage

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

### Description

The contents of the specified file are scanned for raw (not contained within a JP2 file) 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.