svn-gvsig-desktop / tags / v1_1_1_Build_1016 / libraries / libjni-ecw / include / NCSJPCTagTree.h @ 33925
History | View | Annotate | Download (3.02 KB)
1 | 3538 | nacho | /********************************************************
|
---|---|---|---|
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/NCSJPCTagTree.h $
|
||
15 | ** CREATED: 28/01/2003 3:27:34 PM
|
||
16 | ** AUTHOR: Simon Cope
|
||
17 | ** PURPOSE: CNCSJPCTagTree class header
|
||
18 | ** EDITS: [xx] ddMmmyy NAME COMMENTS
|
||
19 | *******************************************************/
|
||
20 | |||
21 | #ifndef NCSJPCTAGTREE_H
|
||
22 | #define NCSJPCTAGTREE_H
|
||
23 | |||
24 | #ifndef NCSJPCIOSTREAM_H
|
||
25 | #include "NCSJPCIOStream.h" |
||
26 | #endif
|
||
27 | #ifdef NOTDEF
|
||
28 | #ifndef NCSJPCDUMP_H
|
||
29 | #include "NCSJPCDump.h" |
||
30 | #endif // NCSJPCDUMP_H |
||
31 | #endif
|
||
32 | |||
33 | #include <vector> |
||
34 | |||
35 | /**
|
||
36 | * CNCSJPCTagTree class - the JPC codestream TagTree Header.
|
||
37 | *
|
||
38 | * @author Simon Cope
|
||
39 | * @version $Revision$ $Author$ $Date$
|
||
40 | */
|
||
41 | class NCSJPC_EXPORT_ALL CNCSJPCTagTree |
||
42 | #ifdef NOTDEF
|
||
43 | : public CNCSJPCDump |
||
44 | #endif //_DEBUG |
||
45 | { |
||
46 | public:
|
||
47 | /** Default constructor, initialises members */
|
||
48 | CNCSJPCTagTree(); |
||
49 | /** Virtual destructor */
|
||
50 | virtual ~CNCSJPCTagTree(); |
||
51 | |||
52 | /**
|
||
53 | * Set the dimensions of the 2D tag tree.
|
||
54 | * @param nWidth Number of columns in the tag tree.
|
||
55 | * @param nHeight Number of rows in the tag tree.
|
||
56 | * @return CNCSError NCS_SUCCESS, or Error code on failure.
|
||
57 | */
|
||
58 | virtual void SetDimensions(INT32 nWidth, INT32 nHeight);
|
||
59 | /**
|
||
60 | * Parse the tree from the JPC codestream.
|
||
61 | * @param Stream IOStream to use to parse file.
|
||
62 | * @param nX X coordinate of cell to terminate parsing on.
|
||
63 | * @param nY Y coordinate of cell to terminate parsing on.
|
||
64 | * @param nAbort Abort parsing when cell value >= this value
|
||
65 | * @return bool NCS_SUCCESS, or Error code on failure.
|
||
66 | */
|
||
67 | virtual bool Parse(CNCSJPCIOStream &Stream, INT32 nX, INT32 nY, INT32 nAbort, bool &bVal); |
||
68 | /**
|
||
69 | * UnParse the tree to the JPC codestream.
|
||
70 | * @param Stream IOStream to use to parse file.
|
||
71 | * @param nX X coordinate of cell to terminate unparsing on.
|
||
72 | * @param nY Y coordinate of cell to terminate unparsing on.
|
||
73 | * @return bool NCS_SUCCESS, or Error code on failure.
|
||
74 | */
|
||
75 | virtual bool UnParse(CNCSJPCIOStream &Stream, INT32 nX, INT32 nY, INT32 nThreshold);
|
||
76 | virtual bool SetValue(INT32 nX, INT32 nY, INT32 value);
|
||
77 | |||
78 | /**
|
||
79 | * Dump the tag tree.
|
||
80 | * @return CNCSError NCS_SUCCESS, or Error code on failure.
|
||
81 | */
|
||
82 | virtual bool Dump();
|
||
83 | protected:
|
||
84 | class Node { |
||
85 | public:
|
||
86 | Node(); |
||
87 | |||
88 | void Dump(void); |
||
89 | |||
90 | Node *m_pParent; |
||
91 | |||
92 | UINT16 m_nValue; |
||
93 | UINT16 m_nState; // lower bound on the value associated with this node
|
||
94 | |||
95 | bool m_bKnown;
|
||
96 | }; |
||
97 | |||
98 | protected:
|
||
99 | std::vector<Node> m_Nodes; |
||
100 | |||
101 | UINT32 m_nWidth; |
||
102 | UINT32 m_nHeight; |
||
103 | UINT16 m_nLevels; |
||
104 | }; |
||
105 | |||
106 | #endif // NCSJPCTAGTREE_H |