Statistics
| Revision:

svn-gvsig-desktop / tags / gvsig_topologia-0_1_0-1232 / libraries / libjni-readecw-linux / include / NCSJPCProgression.h @ 39764

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

    
21
#ifndef NCSJPCPROGRESSION_H
22
#define NCSJPCPROGRESSION_H
23

    
24
#include "NCSDefs.h"
25
#include "NCSJPCTypes.h"
26
#include "NCSJPCPOCMarker.h"
27

    
28
        /**
29
         * CNCSJPCProgression class - Implements JPC progressions.
30
         * 
31
         * @author       Simon Cope
32
         * @version      $Revision: 1458 $ $Author: igbrotru $ $Date: 2005-02-15 08:52:16 +0100 (Tue, 15 Feb 2005) $ 
33
         */        
34
class NCSJPC_EXPORT_ALL CNCSJPCProgression {
35
public:
36
                        /** Current Layer being decoded */
37
        UINT16        m_nCurTile;
38
                        /** Current Layer being decoded */
39
        UINT16        m_nCurLayer;
40
                /** Current Resolution being decoded */
41
        UINT8        m_nCurResolution;
42
                /** Current Component being decoded */
43
        UINT16        m_nCurComponent;
44
                /** Current Precinct X being decoded */
45
        UINT32        m_nCurPrecinctX;
46
                /** Current Precinct Y being decoded */
47
        UINT32        m_nCurPrecinctY;
48
                /** Current Packet Number */
49
        NCSJPCPacketId m_nCurPacket;
50
                /** Current TX being decoded */
51
        INT32        m_nCurTX;
52
                /** Current TY being decoded */
53
        INT32        m_nCurTY;
54
                /** Current TX increment amount */
55
        INT32        m_nIncTX;
56
                /** Current TY increment amount */
57
        INT32        m_nIncTY;
58

    
59
                /** Default constructor, initialises members */
60
        CNCSJPCProgression();
61
                /** Virtual destructor */
62
        virtual ~CNCSJPCProgression();
63
        
64
                /** 
65
                 * Get the current POC marker PO if present.
66
                 * @return      CNCSJPCPOCMarker::ProgressionOrder        Current PO.
67
                 */
68
        CNCSJPCPOCMarker::ProgressionOrder *CurrentPO(class CNCSJPCTilePartHeader *pMainTP);
69
                /** 
70
                 * Increment the current POC marker PO if present and current PO is complete.
71
                 * @param                bComplete        Flag indicating if current PO is complete
72
                 * @return      CNCSError        NCS_SUCCESS or error on failure.
73
                 */
74
        CNCSError IncrementPO(CNCSJPCTilePartHeader *pMainTP, bool &bComplete);
75

    
76
                /** 
77
                 * Start the progression order from the beginning.
78
                 * @return      CNCSError        NCS_SUCCESS, or Error code on failure.
79
                 */
80
        virtual CNCSError Start(CNCSJPCTilePartHeader *pMainTP);
81
        virtual CNCSError Start(CNCSJPCTilePartHeader *pMainTP, INT32 nComponent, INT32 nResolution);
82

    
83
                /** 
84
                 * Increment the progression order from the current location, parsing packet headers in the process.
85
                 * @param                pData                Data for Step function
86
                 * @param                bComplete        Progression order is complete.
87
                 * @return      CNCSError        NCS_SUCCESS, or Error code on failure.
88
                 */
89
        virtual CNCSError Iterate(CNCSJPCTilePartHeader *pMainTP, void *pData, bool &bComplete);
90

    
91
                /** 
92
                 * Perform the "Step" for this progression.
93
                 * @return      bool                true, or false on error & m_Error is set to actual error code.
94
                 */
95
        virtual bool Step(class CNCSJPCComponent *pComponent,
96
                                          class CNCSJPCResolution *pResolution,
97
                                          class CNCSJPCPrecinct *pPrecinct);
98
                /** 
99
                 * Perform the "StepRow" for this progression.
100
                 * The progression stepper can return true here to skip the entire row
101
                 * 
102
                 * @return      bool                true, or false on row not skipped.
103
                 */
104
        virtual bool StepRow(class CNCSJPCComponent *pComponent,
105
                                                 class CNCSJPCResolution *pResolution);
106

    
107
                /**
108
                 * Calculate the Precinct 'k' X from the current progression
109
                 * @return                INT32                Precinct 'k' X
110
                 */
111
        UINT32 CalculatePrecinctX(CNCSJPCTilePartHeader *pMainTP, class CNCSJPCComponent *pComponent, class CNCSJPCResolution *pResolution);
112
                /**
113
                 * Calculate the Precinct 'k' Y from the current progression
114
                 * @return                INT32                Precinct 'k' Y
115
                 */
116
        UINT32 CalculatePrecinctY(CNCSJPCTilePartHeader *pMainTP, class CNCSJPCComponent *pComponent, class CNCSJPCResolution *pResolution);
117
protected:
118
        // Data for step function
119
        void *m_pData;
120
        // Progression order is complete
121
        bool m_bDone;
122
        // Error code when Step() returns false
123
        CNCSError m_Error;
124
};
125

    
126

    
127

    
128
#endif // !NCSJPCPROGRESSION_H