OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Public Attributes | Friends | List of all members
ossimJ2kCodRecord Class Reference

#include <ossimJ2kCodRecord.h>

Public Member Functions

 ossimJ2kCodRecord ()
 default constructor More...
 
 ~ossimJ2kCodRecord ()
 destructor More...
 
void parseStream (std::istream &in)
 Parse method. More...
 
std::ostream & print (std::ostream &out, const std::string &prefix=std::string()) const
 print method that outputs a key/value type format adding prefix to keys. More...
 
std::string getProgressionOrderAsString (ossim_uint8 progressionOrder) const
 
ossim_uint8 getProgressionOrder () const
 

Public Attributes

ossim_uint16 m_marker
 segmet marker 0xff52 (big endian) More...
 
ossim_uint16 m_lcod
 length of segment minus marker More...
 
ossim_uint8 m_scod
 Coding style. More...
 
ossim_uint8 m_progressionOrder
 SGcod - Progression order. More...
 
ossim_uint16 m_numberOfLayers
 SGcod - Number of layers. More...
 
ossim_uint8 m_multipleComponentTransform
 SGcod - Multiple component transform. More...
 
ossim_uint8 m_numberOfDecompositionLevels
 SPcod - Number of decomposition levels. More...
 
ossim_uint8 m_codeBlockWidth
 SPcod - Code-block width. More...
 
ossim_uint8 m_codeBlockHeight
 SPcod - Code-block height. More...
 
ossim_uint8 m_codeBlockStyle
 SPcod - Code-block height. More...
 
ossim_uint8 m_transformation
 SPcod - transformation (wavelet filter) More...
 
ossim_uint8 m_precinctSize
 SPcod - precinct size (only is defined, Scod = xxxx xxx1) More...
 

Friends

OSSIM_DLL std::ostream & operator<< (std::ostream &out, const ossimJ2kCodRecord &obj)
 operator<< More...
 

Detailed Description

Definition at line 23 of file ossimJ2kCodRecord.h.

Constructor & Destructor Documentation

◆ ossimJ2kCodRecord()

ossimJ2kCodRecord::ossimJ2kCodRecord ( )

default constructor

Definition at line 23 of file ossimJ2kCodRecord.cpp.

24  :
25  m_marker(0xff52),
26  m_lcod(0),
27  m_scod(0),
37 {
38 }
ossim_uint8 m_multipleComponentTransform
SGcod - Multiple component transform.
ossim_uint16 m_marker
segmet marker 0xff52 (big endian)
ossim_uint8 m_precinctSize
SPcod - precinct size (only is defined, Scod = xxxx xxx1)
ossim_uint8 m_codeBlockStyle
SPcod - Code-block height.
ossim_uint8 m_transformation
SPcod - transformation (wavelet filter)
ossim_uint16 m_lcod
length of segment minus marker
ossim_uint8 m_progressionOrder
SGcod - Progression order.
ossim_uint8 m_numberOfDecompositionLevels
SPcod - Number of decomposition levels.
ossim_uint8 m_codeBlockHeight
SPcod - Code-block height.
ossim_uint16 m_numberOfLayers
SGcod - Number of layers.
ossim_uint8 m_scod
Coding style.
ossim_uint8 m_codeBlockWidth
SPcod - Code-block width.

◆ ~ossimJ2kCodRecord()

ossimJ2kCodRecord::~ossimJ2kCodRecord ( )

destructor

Definition at line 40 of file ossimJ2kCodRecord.cpp.

41 {
42 }

Member Function Documentation

◆ getProgressionOrder()

ossim_uint8 ossimJ2kCodRecord::getProgressionOrder ( ) const

Definition at line 151 of file ossimJ2kCodRecord.cpp.

References m_progressionOrder.

152 {
153  return m_progressionOrder;
154 }
ossim_uint8 m_progressionOrder
SGcod - Progression order.

◆ getProgressionOrderAsString()

std::string ossimJ2kCodRecord::getProgressionOrderAsString ( ossim_uint8  progressionOrder) const
Returns
LRCP, RLCP, RPCL, PCRL, CPRL or unknown.

Definition at line 119 of file ossimJ2kCodRecord.cpp.

Referenced by print().

120 {
121  std::string result;
122 
123  if ( progressionOrder == 0x00 )
124  {
125  result = "LRCP";
126  }
127  else if ( progressionOrder == 0x01 )
128  {
129  result = "RLCP";
130  }
131  else if ( progressionOrder == 0x02 )
132  {
133  result = "RPCL";
134  }
135  else if ( progressionOrder == 0x03 )
136  {
137  result = "PCRL";
138  }
139  else if ( progressionOrder == 0x04 )
140  {
141  result = "CPRL";
142  }
143  else
144  {
145  result = "unknown";
146  }
147 
148  return result;
149 }

◆ parseStream()

void ossimJ2kCodRecord::parseStream ( std::istream &  in)

Parse method.

Performs byte swapping as needed.

Parameters
inStream to parse.
Note
COD Marker (0xff52) is not read.

Definition at line 44 of file ossimJ2kCodRecord.cpp.

References ossim::byteOrder(), m_codeBlockHeight, m_codeBlockStyle, m_codeBlockWidth, m_lcod, m_multipleComponentTransform, m_numberOfDecompositionLevels, m_numberOfLayers, m_precinctSize, m_progressionOrder, m_scod, m_transformation, OSSIM_LITTLE_ENDIAN, and ossimEndian::swap().

Referenced by ossimKakaduNitfReader::dumpTiles(), ossimOpjJp2Reader::initCodRecord(), and ossimJ2kInfo::printCodMarker().

45 {
46  // Get the stream posistion.
47  std::streamoff pos = in.tellg();
48 
49  // Note: Marker is not read.
50  in.read((char*)&m_lcod, 2);
51  in.read((char*)&m_scod, 1);
52  in.read((char*)&m_progressionOrder, 1);
53  in.read((char*)&m_numberOfLayers, 2);
54  in.read((char*)&m_multipleComponentTransform, 1);
55  in.read((char*)&m_numberOfDecompositionLevels, 1);
56  in.read((char*)&m_codeBlockWidth, 1);
57  in.read((char*)&m_codeBlockHeight, 1);
58  in.read((char*)&m_codeBlockStyle, 1);
59  in.read((char*)&m_transformation, 1);
60 
61  //---
62  // SPcod - precinct size (only is defined, Scod = xxxx xxx1)
63  //---
64  if ( 0 )
65  {
66  in.read((char*)&m_precinctSize, 1);
67  }
68 
70  {
71  // Stored big endian, must swap.
72  ossimEndian s;
73  s.swap(m_lcod);
75  }
76 
77  //---
78  // Seek to next record. This is needed because there are sometimes extra
79  // bytes.
80  //---
81  in.seekg(pos + m_lcod, std::ios_base::beg);
82 }
ossim_uint8 m_multipleComponentTransform
SGcod - Multiple component transform.
ossim_uint8 m_precinctSize
SPcod - precinct size (only is defined, Scod = xxxx xxx1)
ossim_uint8 m_codeBlockStyle
SPcod - Code-block height.
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossim_uint8 m_transformation
SPcod - transformation (wavelet filter)
ossim_uint16 m_lcod
length of segment minus marker
ossim_uint8 m_progressionOrder
SGcod - Progression order.
ossim_uint8 m_numberOfDecompositionLevels
SPcod - Number of decomposition levels.
ossim_uint8 m_codeBlockHeight
SPcod - Code-block height.
ossim_uint16 m_numberOfLayers
SGcod - Number of layers.
ossim_uint8 m_scod
Coding style.
ossim_uint8 m_codeBlockWidth
SPcod - Code-block width.
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26

◆ print()

std::ostream & ossimJ2kCodRecord::print ( std::ostream &  out,
const std::string &  prefix = std::string() 
) const

print method that outputs a key/value type format adding prefix to keys.

Parameters
outString to output to.
prefixThis will be prepended to key. e.g. Where prefix = "j2k." and key is "file_name" key becomes: "nitf.file_name:"
Returns
output stream.

Definition at line 84 of file ossimJ2kCodRecord.cpp.

References getProgressionOrderAsString(), m_codeBlockHeight, m_codeBlockStyle, m_codeBlockWidth, m_lcod, m_multipleComponentTransform, m_numberOfDecompositionLevels, m_numberOfLayers, m_precinctSize, m_progressionOrder, m_scod, and m_transformation.

Referenced by ossimKakaduNitfReader::dumpTiles(), operator<<(), and ossimJ2kInfo::printCodMarker().

86 {
87  // Capture the original flags.
88  std::ios_base::fmtflags f = out.flags();
89 
90  std::string pfx = prefix;
91  pfx += "cod.";
92 
93  out.setf(std::ios_base::hex, std::ios_base::basefield);
94  out << pfx << "marker: 0xff90\n";
95  out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
96 
97  out << pfx << "Lcod: " << m_lcod << "\n"
98  << pfx << "Scod: " << int(m_scod) << "\n"
99  << pfx << "SGcod_progression_order: "
101  << pfx << "SGcod_number_of_layers: " << m_numberOfLayers << "\n"
102  << pfx << "SGcod_multiple_component_transform: "
103  << int(m_multipleComponentTransform) << "\n"
104  << pfx << "SPcod_mumber_of_decomposition_levels: "
105  << int(m_numberOfDecompositionLevels) << "\n"
106  << pfx << "SPcod_code_block_width: " << int(m_codeBlockWidth) << "\n"
107  << pfx << "SPcod_code_block_height: " << int(m_codeBlockHeight) << "\n"
108  << pfx << "SPcod_code_block_style: " << int(m_codeBlockStyle) << "\n"
109  << pfx << "SPcod_transformation: " << int(m_transformation) << "\n"
110  << pfx << "SPcod_precinct_size: " << int(m_precinctSize)
111  << std::endl;
112 
113  // Reset flags.
114  out.setf(f);
115 
116  return out;
117 }
ossim_uint8 m_multipleComponentTransform
SGcod - Multiple component transform.
ossim_uint8 m_precinctSize
SPcod - precinct size (only is defined, Scod = xxxx xxx1)
ossim_uint8 m_codeBlockStyle
SPcod - Code-block height.
std::string getProgressionOrderAsString(ossim_uint8 progressionOrder) const
ossim_uint8 m_transformation
SPcod - transformation (wavelet filter)
ossim_uint16 m_lcod
length of segment minus marker
ossim_uint8 m_progressionOrder
SGcod - Progression order.
ossim_uint8 m_numberOfDecompositionLevels
SPcod - Number of decomposition levels.
ossim_uint8 m_codeBlockHeight
SPcod - Code-block height.
ossim_uint16 m_numberOfLayers
SGcod - Number of layers.
ossim_uint8 m_scod
Coding style.
ossim_uint8 m_codeBlockWidth
SPcod - Code-block width.

Friends And Related Function Documentation

◆ operator<<

OSSIM_DLL std::ostream& operator<< ( std::ostream &  out,
const ossimJ2kCodRecord obj 
)
friend

operator<<

Definition at line 156 of file ossimJ2kCodRecord.cpp.

157 {
158  return obj.print(out);
159 }
std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
print method that outputs a key/value type format adding prefix to keys.

Member Data Documentation

◆ m_codeBlockHeight

ossim_uint8 ossimJ2kCodRecord::m_codeBlockHeight

SPcod - Code-block height.

Definition at line 91 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_codeBlockStyle

ossim_uint8 ossimJ2kCodRecord::m_codeBlockStyle

SPcod - Code-block height.

Definition at line 94 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_codeBlockWidth

ossim_uint8 ossimJ2kCodRecord::m_codeBlockWidth

SPcod - Code-block width.

Definition at line 88 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_lcod

ossim_uint16 ossimJ2kCodRecord::m_lcod

length of segment minus marker

Definition at line 70 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_marker

ossim_uint16 ossimJ2kCodRecord::m_marker

segmet marker 0xff52 (big endian)

Definition at line 67 of file ossimJ2kCodRecord.h.

◆ m_multipleComponentTransform

ossim_uint8 ossimJ2kCodRecord::m_multipleComponentTransform

SGcod - Multiple component transform.

Definition at line 82 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_numberOfDecompositionLevels

ossim_uint8 ossimJ2kCodRecord::m_numberOfDecompositionLevels

SPcod - Number of decomposition levels.

Definition at line 85 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_numberOfLayers

ossim_uint16 ossimJ2kCodRecord::m_numberOfLayers

SGcod - Number of layers.

Definition at line 79 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_precinctSize

ossim_uint8 ossimJ2kCodRecord::m_precinctSize

SPcod - precinct size (only is defined, Scod = xxxx xxx1)

Definition at line 100 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_progressionOrder

ossim_uint8 ossimJ2kCodRecord::m_progressionOrder

SGcod - Progression order.

Definition at line 76 of file ossimJ2kCodRecord.h.

Referenced by getProgressionOrder(), parseStream(), and print().

◆ m_scod

ossim_uint8 ossimJ2kCodRecord::m_scod

Coding style.

Definition at line 73 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().

◆ m_transformation

ossim_uint8 ossimJ2kCodRecord::m_transformation

SPcod - transformation (wavelet filter)

Definition at line 97 of file ossimJ2kCodRecord.h.

Referenced by parseStream(), and print().


The documentation for this class was generated from the following files: