svn-gvsig-desktop / trunk / libraries / libjni-readecw-linux / include / NCSJP2Box.h @ 1458
History | View | Annotate | Download (3.77 KB)
1 |
/********************************************************
|
---|---|
2 |
** Copyright 2002 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/NCSJP2Box.h $
|
15 |
** CREATED: 28/11/2002 3:27:34 PM
|
16 |
** AUTHOR: Simon Cope
|
17 |
** PURPOSE: CNCSJP2Box class header
|
18 |
** EDITS: [xx] ddMmmyy NAME COMMENTS
|
19 |
*******************************************************/
|
20 |
|
21 |
#ifndef NCSJP2BOX_H
|
22 |
#define NCSJP2BOX_H
|
23 |
|
24 |
|
25 |
// Our own 64bit IOSTREAM class
|
26 |
#ifndef NCSJPCIOSTREAM_H
|
27 |
#include "NCSJPCIOStream.h" |
28 |
#endif // NCSJPCIOSTREAM_H |
29 |
|
30 |
// STD list template
|
31 |
#include <list> |
32 |
|
33 |
|
34 |
|
35 |
/**
|
36 |
* CNCSJP2Box class - the basic JP2 file box.
|
37 |
*
|
38 |
* @author Simon Cope
|
39 |
* @version $Revision: 1458 $ $Author: igbrotru $ $Date: 2005-02-15 08:52:16 +0100 (Tue, 15 Feb 2005) $
|
40 |
*/
|
41 |
class NCSJPC_EXPORT_ALL CNCSJP2Box { |
42 |
public:
|
43 |
/** A list of boxes. */
|
44 |
typedef std::vector<CNCSJP2Box *> CNCSJP2BoxList;
|
45 |
|
46 |
/** Absolute file Offset to the Box in bytes */
|
47 |
UINT64 m_nBoxOffset; |
48 |
/** Length of this box in bytes. */
|
49 |
UINT64 m_nXLBox; |
50 |
/** Type of box, 4 char code stored in a UINT32. */
|
51 |
UINT32 m_nTBox; |
52 |
/** Absolute file Offset to the DBox in bytes */
|
53 |
UINT64 m_nDBoxOffset; |
54 |
/** Length of box data in bytes */
|
55 |
UINT64 m_nLDBox; |
56 |
/** We have parsed this box */
|
57 |
bool m_bHaveBox;
|
58 |
/** This box is valid */
|
59 |
bool m_bValid;
|
60 |
/** Is a superbox */
|
61 |
bool m_bIsSuperBox;
|
62 |
/** Box(es) that must preceed this one in the file */
|
63 |
CNCSJP2BoxList m_Prev; |
64 |
/** Box(es) that must proceed this one in the file */
|
65 |
CNCSJP2BoxList m_Next; |
66 |
|
67 |
|
68 |
/** Default constructor for a box. Initialises members */
|
69 |
CNCSJP2Box(); |
70 |
/** Copy constructor for a box. Initialises members */
|
71 |
CNCSJP2Box(const CNCSJP2Box &s);
|
72 |
/** Virtual destructor for a box. Releases members */
|
73 |
virtual ~CNCSJP2Box(); |
74 |
|
75 |
/**
|
76 |
* Set which Box(es) preceed this one in the file
|
77 |
* @param pFirst NULL terminated varargs list of boxes that must preceed this one
|
78 |
* @return CNCSError NCS_SUCCESS, or Error code on failure.
|
79 |
*/
|
80 |
virtual CNCSError SetPrevBoxes(CNCSJP2Box *pFirst, ...); |
81 |
/**
|
82 |
* Set which Box(es) proceed this one in the file
|
83 |
* @param pFirst NULL terminated varargs list of boxes that must proceed this one
|
84 |
* @return CNCSError NCS_SUCCESS, or Error code on failure.
|
85 |
*/
|
86 |
virtual CNCSError SetNextBoxes(CNCSJP2Box *pFirst, ...); |
87 |
|
88 |
/**
|
89 |
* Update the extended length of the box before writing
|
90 |
*/
|
91 |
virtual void UpdateXLBox(void); |
92 |
/**
|
93 |
* Parse the base box from the JP2 file.
|
94 |
* @param JP2File JP2 file being parsed
|
95 |
* @param Stream IOStream to use to parse file.
|
96 |
* @return CNCSError NCS_SUCCESS, or Error code on failure.
|
97 |
*/
|
98 |
virtual CNCSError Parse(class CNCSJP2File &JP2File, CNCSJPCIOStream &Stream); |
99 |
/**
|
100 |
* UnParse the box to the JP2 file.
|
101 |
* @param JP2File JP2 file being parsed
|
102 |
* @param Stream IOStream to use to parse file.
|
103 |
* @return CNCSError NCS_SUCCESS, or Error code on failure.
|
104 |
*/
|
105 |
virtual CNCSError UnParse(class CNCSJP2File &JP2File, CNCSJPCIOStream &Stream); |
106 |
|
107 |
/**
|
108 |
* assignment operator
|
109 |
* @param s Source CNCSJP2Box
|
110 |
* @return CNCSJP2Box& Reference to post-assigned CNCSJP2Box
|
111 |
*/
|
112 |
CNCSJP2Box& operator=(const CNCSJP2Box& s) {
|
113 |
m_nBoxOffset = s.m_nBoxOffset; |
114 |
m_nXLBox = s.m_nXLBox; |
115 |
m_nTBox = s.m_nTBox; |
116 |
m_nDBoxOffset = s.m_nDBoxOffset; |
117 |
m_nLDBox = s.m_nLDBox; |
118 |
m_bHaveBox = s.m_bHaveBox; |
119 |
m_bValid = s.m_bValid; |
120 |
return(*this);
|
121 |
}; |
122 |
}; |
123 |
|
124 |
#endif // !NCSJP2BOX_H |