diff options
| author | jhurst <jhurst@cinecert.com> | 2013-11-20 00:09:47 +0000 |
|---|---|---|
| committer | jhurst <> | 2013-11-20 00:09:47 +0000 |
| commit | 4dcacd557953d6976a6fd0fd389e3aeb95b38c7f (patch) | |
| tree | ee98910d00ff85eef4dbd150889021976ad4066d /src/JP2K.h | |
| parent | eee42b6d7ce3d0857f96612919a1852e8c45283b (diff) | |
added COD decoding to the JP2K parser, fixed interpreter lock bug in text writer
Diffstat (limited to 'src/JP2K.h')
| -rwxr-xr-x | src/JP2K.h | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -127,6 +127,37 @@ namespace JP2K void Dump(FILE* stream = 0); }; + const int SGcodOFST = 1; + const int SPcodOFST = 5; + + // coding style + class COD + { + const byte_t* m_MarkerData; + + KM_NO_COPY_CONSTRUCT(COD); + COD(); + + public: + COD(const Marker& M) + { + assert(M.m_Type == MRK_COD); + m_MarkerData = M.m_Data; + } + + ~COD() {} + + inline ui8_t ProgOrder() { return *(m_MarkerData + SGcodOFST ); } + inline ui16_t Layers() { return KM_i16_BE(*(ui16_t*)(m_MarkerData + SGcodOFST + 1));} + inline ui8_t DecompLevels() { return *(m_MarkerData + SPcodOFST); } + inline ui8_t CodeBlockWidth() { return *(m_MarkerData + SPcodOFST + 1) + 2; } + inline ui8_t CodeBlockHeight() { return *(m_MarkerData + SPcodOFST + 2) + 2; } + inline ui8_t CodeBlockStyle() { return *(m_MarkerData + SPcodOFST + 3); } + inline ui8_t Transformation() { return *(m_MarkerData + SPcodOFST + 4); } + + void Dump(FILE* stream = 0); + }; + // a comment class COM { |
