svn-gvsig-desktop / tags / v1_1_1_Build_1016 / libraries / libjni-ecw / include / NCSJPCCodeBlock.h @ 33925
History | View | Annotate | Download (3.67 KB)
1 |
/********************************************************
|
---|---|
2 |
** Copyright 2003 Earth Resource Mapping Ltd.
|
3 |
** This document contains proprietary source code of
|
4 |
** Earth Resource Mapping Ltd, and can only be used under
|
5 |
** one of the three licenses as described in the
|
6 |
** license.txt file supplied with this distribution.
|
7 |
** See separate license.txt file for license details
|
8 |
** and conditions.
|
9 |
**
|
10 |
** This software is covered by US patent #6,442,298,
|
11 |
** #6,102,897 and #6,633,688. Rights to use these patents
|
12 |
** is included in the license agreements.
|
13 |
**
|
14 |
** FILE: $Archive: /NCS/Source/include/NCSJPCCodeBlock.h $
|
15 |
** CREATED: 12/02/2003 3:27:34 PM
|
16 |
** AUTHOR: Simon Cope
|
17 |
** PURPOSE: CNCSJPCCodeBlock class header
|
18 |
** EDITS: [xx] ddMmmyy NAME COMMENTS
|
19 |
*******************************************************/
|
20 |
|
21 |
#ifndef NCSJPCCODEBLOCK_H
|
22 |
#define NCSJPCCODEBLOCK_H
|
23 |
|
24 |
#ifndef NCSJPCTYPES_H
|
25 |
#include "NCSJPCTypes.h" |
26 |
#endif // NCSJPCTYPES_H |
27 |
#include "NCSJPCCodingStyleParameter.h" |
28 |
#include "NCSJPCQuantizationParameter.h" |
29 |
#ifndef NCSJPCNODE_H
|
30 |
#include "NCSJPCNode.h" |
31 |
#endif // NCSJPCNODE_H |
32 |
#ifndef NCSJPCT1CODER_H
|
33 |
#include "NCSJPCT1Coder.h" |
34 |
#endif // NCSJPCT1CODER_H |
35 |
|
36 |
/**
|
37 |
* CNCSJPCCodeBlock class - the JPC codestream CodeBlock.
|
38 |
*
|
39 |
* @author Simon Cope
|
40 |
* @version $Revision: 3538 $ $Author: nacho $ $Date: 2006-01-09 12:56:54 +0100 (Mon, 09 Jan 2006) $
|
41 |
*/
|
42 |
class NCSJPC_EXPORT_ALL CNCSJPCCodeBlock: public CNCSJPCNode { |
43 |
public:
|
44 |
/** SubBand for this code block */
|
45 |
class CNCSJPCSubBand *m_pSubBand; |
46 |
|
47 |
/** Lblock value - UINT8 represents <=256bits LENGTH field, = 32 bytes */
|
48 |
UINT8 m_nLblock; |
49 |
/** Codeblock has zero width or height */
|
50 |
bool m_bZeroSize;
|
51 |
/** Segments for this codeblock */
|
52 |
std::vector<CNCSJPCSegment> m_Segments; |
53 |
/** Next Segments for this codeblock */
|
54 |
std::vector<CNCSJPCSegment> m_NextSegments; |
55 |
|
56 |
/** Codeblock number within subband */
|
57 |
UINT32 m_nCB; |
58 |
/** Layer # first included on */
|
59 |
UINT32 m_nLayerIncluded; |
60 |
/** Number of passes included */
|
61 |
UINT8 m_nPasses; |
62 |
/** Number of zero bits */
|
63 |
UINT8 m_nZeroBits; |
64 |
|
65 |
/** Default Constructor */
|
66 |
CNCSJPCCodeBlock(); |
67 |
/** Copy Constructor */
|
68 |
CNCSJPCCodeBlock(const CNCSJPCCodeBlock &s);
|
69 |
/**
|
70 |
* Constructor
|
71 |
* @param pSubBand Parent subband this block belongs to
|
72 |
* @param nCB Codeblock number within this subband
|
73 |
*/
|
74 |
CNCSJPCCodeBlock(CNCSJPCSubBand *pSubBand, UINT32 nCB); |
75 |
/** Virtual destructor */
|
76 |
virtual ~CNCSJPCCodeBlock(); |
77 |
/**
|
78 |
* Init
|
79 |
* @param pSubBand Parent subband this block belongs to
|
80 |
* @param nCB Codeblock number within this subband
|
81 |
*/
|
82 |
void Init(CNCSJPCSubBand *pSubBand, UINT32 nCB);
|
83 |
|
84 |
/**
|
85 |
* Read a BufferType line from the input.
|
86 |
* @param nCtx Read context
|
87 |
* @param pDst Destination buffer.
|
88 |
* @param iComponent Output Component
|
89 |
* @return bool true on succes, else false.
|
90 |
*/
|
91 |
virtual bool ReadLine(ContextID nCtx, CNCSJPCBuffer *pDst, UINT16 iComponent);
|
92 |
/**
|
93 |
* Write a BufferType line to the output.
|
94 |
* @param nCtx Context
|
95 |
* @param pSrc Source buffer.
|
96 |
* @param iComponent Output Component
|
97 |
* @return bool true on succes, else false.
|
98 |
*/
|
99 |
virtual bool WriteLine(ContextID nCtx, CNCSJPCBuffer *pSrc, UINT16 iComponent);
|
100 |
|
101 |
virtual INT32 ReadNewSegs(CNCSJPCIOStream &Stream); |
102 |
virtual INT32 WriteNewSegs(CNCSJPCIOStream &Stream); |
103 |
|
104 |
/** Decoded codeblock */
|
105 |
CNCSJPCBuffer m_DecBuf; |
106 |
|
107 |
static CNCSJPCT1Coder sm_Coder;
|
108 |
|
109 |
protected:
|
110 |
static CNCSJPCNodeTracker sm_Tracker;
|
111 |
|
112 |
/**
|
113 |
* Decode the codeblock.
|
114 |
* @return CNCSError NCS_SUCCESS, or Error code on failure.
|
115 |
*/
|
116 |
CNCSError Decode(Type eType); |
117 |
|
118 |
private:
|
119 |
friend class CNCSJP2FileView; |
120 |
static NCSTimeStampUs sm_usTotal;
|
121 |
static NCSTimeStampUs sm_usLast;
|
122 |
static UINT64 sm_nTotalSamples;
|
123 |
static UINT64 sm_nLastSamples;
|
124 |
}; |
125 |
|
126 |
#endif // !NCSJPCCODEBLOCK_H |