Statistics
| Revision:

svn-gvsig-desktop / tags / v1_1_1_Build_1016 / libraries / libjni-ecw / include / NCSJPC.h @ 33925

History | View | Annotate | Download (4.03 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/NCSJPC.h $
15
** CREATED:  05/12/2002 3:27:34 PM
16
** AUTHOR:   Simon Cope
17
** PURPOSE:  CNCSJPC class header
18
** EDITS:    [xx] ddMmmyy NAME COMMENTS
19
 *******************************************************/
20

    
21
#ifndef NCSJPC_H
22
#define NCSJPC_H
23

    
24
#ifndef NCSJPCMAINHEADER_H
25
#include "NCSJPCMainHeader.h"
26
#endif // NCSJPCMAINHEADER_H
27
#ifndef NCSJPCTILEPARTHEADER_H
28
#include "NCSJPCTilePartHeader.h"
29
#endif // NCSJPCTILEPARTHEADER_H
30

    
31
#include <map>
32

    
33
        /**
34
         * CNCSJPC class - the JPC codestream class.
35
         * 
36
         * @author       Simon Cope
37
         * @version      $Revision: 3538 $ $Author: nacho $ $Date: 2006-01-09 12:56:54 +0100 (Mon, 09 Jan 2006) $ 
38
         */        
39
class NCSJPC_EXPORT_ALL CNCSJPC: public CNCSJPCMainHeader {
40
public:
41
        typedef enum {
42
                        /** Profile 0 */
43
                BASELINE_0                = 0,
44
                        /** Profile 1 */
45
                BASELINE_1                = 1,
46
                        /** Profile 2 - unrestricted */
47
                BASELINE_2                = 2,
48
                        /** NITF NPJE profile */
49
                NITF_BIIF_NPJE        = 3,
50
                        /** NITF EPJE Profile */
51
                NITF_BIIF_EPJE        = 4
52
        } Profile;
53

    
54
                /** Pointer to IO Stream instance for this codestream */
55
        CNCSJPCIOStream *m_pStream;
56
                /** Tile Parts */
57
        std::map<UINT32, CNCSJPCTilePartHeader *> m_TileParts;
58
                /** Current Tile-Part being decoded */
59
        CNCSJPCTilePartHeader        *m_pCurrentTilePart;
60
                /** Next tilepart index */
61
        UINT32        m_nNextZtp;
62

    
63
                /** performing low-memory compression */
64
        bool m_bLowMemCompression;
65
                /** Reconstruction parameter */
66
        IEEE4 m_fReconstructionParameter;
67

    
68
                /** Default constructor, initialises members */
69
        CNCSJPC();
70
                /** Virtual destructor */
71
        virtual ~CNCSJPC();
72

    
73
                /** 
74
                 * Parse the JPC codestream.
75
                 * @param                Stream                IOStream to use to parse file.
76
                 * @return      CNCSError        NCS_SUCCESS, or Error code on failure.
77
                 */
78
        virtual CNCSError Parse(CNCSJPCIOStream &Stream);
79
                /** 
80
                 * UnParse the JPC codestream.
81
                 * @param                Stream                IOStream to use to parse file.
82
                 * @return      CNCSError        NCS_SUCCESS, or Error code on failure.
83
                 */
84
        virtual CNCSError UnParse(CNCSJPCIOStream &Stream);
85

    
86
                /**
87
                 * Get the Tile from the index and part index
88
                 * @param                INT32                Tile Index, >= 0, -1 == current tile main tile header
89
                 * @param                INT32                Tile Part Index, >= 0
90
                 * @return                CNCSJPCTilePartHeader*                Pointer to tile part
91
                 */
92
        CNCSJPCTilePartHeader *GetTile(INT32 iIndex = -1, INT32 iPart = 0);
93
                /** 
94
                 * Get length of a packet in the file.
95
                 * @param                nPacket                Absolute Packet number to determine length for
96
                 * @return      UINT32                Packet length or 0 on failure.
97
                 */
98
        UINT32 GetPacketLength(UINT32 nPacket);
99
                /** 
100
                 * Read a packet from the file.
101
                 * @param                nPacket                Absolute Packet number to determine length for
102
                 * @param                pLength                Returned length of packet (header+data)
103
                 * @return      void *                NCSMalloc()'d pointer to read packet (header+data).
104
                 */
105
        void *GetPacket(UINT32 nPacket, UINT32 *pLength);
106
                /** 
107
                 * Get packet header for the specified absolute packet index.
108
                 * @param                nPacket                Absolute Packet number 
109
                 * @return      class CNCSJPCPacket*                Packet header
110
                 */
111
        class CNCSJPCPacket *GetPacketHeader(UINT32 nPacket);
112
                /** 
113
                 * Fnid the RCPL for the specified packet index 
114
                 * @param                nPacket                Absolute Packet number 
115
                 * @param                nTile                Tile index 
116
                 * @param                nResolution Resolution number
117
                 * @param                nComponent        Component index 
118
                 * @param                nPrecinctX        Precinct X index 
119
                 * @param                nPrecinctY  Precinct Y index 
120
                 * @param                nLayer                Quality Layer
121
                 * @return      bool                 true, or false on failure
122
                 */
123
        bool FindPacketRCPL(UINT32 nPacket, UINT16 &nTile, UINT8 &nResolution, UINT16 &nComponent, UINT32 &nPrecinctX, UINT32 &nPrecinctY, UINT16 &nLayer);
124
private:
125
};
126

    
127
#endif // !NCSJPC_H