root/tags/gdal_1_3_2/gcore/gdaljp2metadata.h

Revision 9537, 4.0 kB (checked in by fwarmerdam, 3 years ago)

Added ReadAndParse?() method, which includes worldfile reading.
Actually set HaveGeoTransform? flag properly.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /******************************************************************************
2  * $Id$
3  *
4  * Project:  GDAL
5  * Purpose:  JP2 Box Reader (and GMLJP2 Interpreter)
6  * Author:   Frank Warmerdam, warmerdam@pobox.com
7  *
8  ******************************************************************************
9  * Copyright (c) 2005, Frank Warmerdam <warmerdam@pobox.com>
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included
19  * in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  *****************************************************************************
29  *
30  * $Log$
31  * Revision 1.4  2006/04/07 05:35:25  fwarmerdam
32  * Added ReadAndParse() method, which includes worldfile reading.
33  * Actually set HaveGeoTransform flag properly.
34  *
35  * Revision 1.3  2005/07/05 22:09:00  fwarmerdam
36  * add preliminary support for MSIG boxes
37  *
38  * Revision 1.2  2005/05/05 20:17:15  fwarmerdam
39  * support dictionary lookups
40  *
41  * Revision 1.1  2005/05/03 21:10:59  fwarmerdam
42  * New
43  *
44  */
45
46 #ifndef _JP2READER_H_INCLUDED
47 #define _JP2READER_H_INCLUDED
48
49 #include "cpl_conv.h"
50 #include "cpl_vsi.h"
51 #include "gdal.h"
52
53 /************************************************************************/
54 /*                              GDALJP2Box                              */
55 /************************************************************************/
56
57 class CPL_DLL GDALJP2Box
58 {
59
60     FILE        *fpVSIL;
61
62     char        szBoxType[5];
63
64     GIntBig     nBoxOffset;
65     GIntBig     nBoxLength;
66
67     GIntBig     nDataOffset;
68
69     GByte       abyUUID[16];
70
71 public:
72                 GDALJP2Box( FILE * );
73                 ~GDALJP2Box();
74
75     int         SetOffset( GIntBig nNewOffset );
76     int         ReadBox();
77
78     int         ReadFirst();
79     int         ReadNext();
80
81     int         ReadFirstChild( GDALJP2Box *poSuperBox );
82     int         ReadNextChild( GDALJP2Box *poSuperBox );
83
84     GIntBig     GetDataLength();
85     const char *GetType() { return szBoxType; }
86    
87     GByte      *ReadBoxData();
88
89     int         IsSuperBox();
90
91     int         DumpReadable( FILE * );
92
93     FILE        *GetFILE() { return fpVSIL; }
94
95     const GByte *GetUUID() { return abyUUID; }
96 };
97
98 /************************************************************************/
99 /*                           GDALJP2Metadata                            */
100 /************************************************************************/
101
102 class CPL_DLL GDALJP2Metadata
103
104 {
105   private:
106     void    CollectGMLData( GDALJP2Box * );
107     int     GMLSRSLookup( const char *pszURN );
108
109   public:
110     int     bHaveGeoTransform;
111     double  adfGeoTransform[6];
112
113     char    *pszProjection;
114
115     int         nGCPCount;
116     GDAL_GCP    *pasGCPList;
117
118     char   **papszGMLMetadata;
119    
120     int    nGeoTIFFSize;
121     GByte  *pabyGeoTIFFData;
122
123     int    nMSIGSize;
124     GByte  *pabyMSIGData;
125
126             GDALJP2Metadata();
127            ~GDALJP2Metadata();
128
129     int     ReadBoxes( FILE * fpVSIL );
130
131     int     ParseJP2GeoTIFF();
132     int     ParseMSIG();
133     int     ParseGMLCoverageDesc();
134
135     int     ReadAndParse( const char *pszFilename );
136 };
137
138 #endif /* ndef _JP2READER_H_INCLUDED */
139
140
Note: See TracBrowser for help on using the browser.