95 std::streamoff pos = in.tellg();
100 in.read((
char*)&
m_Ltlm, 2);
107 in.read((
char*)&
m_Ztlm, 1);
110 in.read((
char*)&
m_Stlm, 1);
124 in.read((
char*)p, tile_count);
130 in.read((
char*)p, tile_count*2);
133 endian->
swap(p, tile_count);
140 <<
"ossimJ2kTlmRecord::parseStream(...) Bad tlm ST value!" 149 in.read((
char*)p, tile_count*2);
152 endian->
swap(p, tile_count);
159 in.read((
char*)p, tile_count*4);
162 endian->
swap(p, tile_count);
169 <<
"ossimJ2kTlmRecord::parseStream(...) Bad tlm SP value!" 185 in.seekg(pos +
m_Ltlm, std::ios_base::beg);
222 out.write( (
char*)&
m_Ltlm, 2);
223 out.write( (
char*)&
m_Ztlm, 1);
224 out.write( (
char*)&
m_Stlm, 1);
229 out.write( (
char*)
m_Ttlm, tileCount );
233 out.write( (
char*)
m_Ttlm, tileCount*2 );
239 out.write( (
char*)
m_Ptlm, tileCount*2 );
243 out.write( (
char*)
m_Ptlm, tileCount*4 );
276 return (
m_Stlm & 0x30) >> 4;
289 else if ( bits == 1 )
294 else if ( bits == 2 )
342 bool result =
setSp( spBit );
349 std::memset(
m_Ptlm, 0, count*2 );
351 else if ( spBit == 1 )
354 std::memset(
m_Ptlm, 0, count*4 );
430 if ( (first >= 0) && (last>first) && (last <=
getTileCount()) )
457 return 4 + (
getSt() + (
getSp()==1?4:2) ) * tileCount;
461 const std::string& prefix)
const 464 std::ios_base::fmtflags f = out.flags();
466 std::string pfx = prefix;
469 out << pfx <<
"marker: 0xff55\n" 470 << pfx <<
"Ltlm: " <<
m_Ltlm <<
"\n" 471 << pfx <<
"Ztlm: " << int(
m_Ztlm) <<
"\n";
473 out.setf(std::ios_base::hex, std::ios_base::basefield);
474 out << pfx <<
"Stlm: 0x" << int(
m_Stlm) <<
"\n";
475 out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
476 out << pfx <<
"Stlm.ST: " << int(
getSt()) <<
"\n" 477 << pfx <<
"Stlm.SP: " << int(
getSp()) <<
"\n";
485 out << pfx <<
"Ttlm: null\n";
492 out << pfx <<
"Ttlm[" << i <<
"]: " << (int)p[i] <<
"\n";
500 out << pfx <<
"Ttlm[" << i <<
"]: " << p[i] <<
"\n";
510 out << pfx <<
"Ptlm[" << i <<
"]: " << p[i] <<
"\n";
518 out << pfx <<
"Ptlm[" << i <<
"]: " << p[i] <<
"\n";
533 return obj.
print(out);
ossim_uint8 m_Stlm
Indicator for Ttlm and Ptlm field sizes.
ossim_uint8 getSt() const
Get the ST portion of STLM field( bits 5 and 6).
~ossimJ2kTlmRecord()
destructor
void * m_Ptlm
The length, in bytes, from the beginning of the SOT marker of the tile-part to the end of the codestr...
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.
OSSIM_DLL ossimByteOrder byteOrder()
std::ostream & operator<<(std::ostream &out, const ossimJ2kTlmRecord &obj)
unsigned short ossim_uint16
void clearPtlm()
Deletes m_Ptlm array.
bool setTileLength(ossim_int32 index, ossim_uint32 length)
Sets the tile length for tile at x,y in ptlm array.
void writeStream(std::ostream &out)
Write method.
bool setSt(ossim_uint8 bits)
Set the ST bits of STLM field.
ossim_uint16 m_Ltlm
NOTE: tml segmet marker 0xff55 not stored.
void clearTtlm()
Deletes m_Ttlm array.
void clear()
Deletes m_Ttlm and m_Ptlm arrays.
ossim_uint16 computeLength(ossim_uint16 tileCount) const
Computes length of this segment minus marker itself.
ossim_uint8 getSp() const
void * m_Ttlm
Tile index for tile-parts.
void parseStream(ossim::istream &in)
Parse method.
ossim_uint16 getTileCount() const
unsigned int ossim_uint32
bool accumulate(ossim_int32 first, ossim_int32 last, std::streampos &init) const
Adds Ptlm array from first to last.
bool initPtlmArray(ossim_uint8 spBit, ossim_uint16 count)
Sets SP bit, initializes ptlm array, and ltlm(size).
bool getTileLength(ossim_int32 index, ossim_uint32 &length) const
Get the tile length for tile at index from ptlm array.
std::basic_istream< char > istream
Base class for char input streams.
ossim_uint8 m_Ztlm
Index of marker segment relative to all other TLM marker segments present in the current header...
ossim_uint8 getZtlm() const
bool setSp(ossim_uint8 bit)
Set the SP bit of Stlm field.
ossimJ2kTlmRecord()
default constructor
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.