1 /******************************************************************************
2  * $Id: rpftoclib.h 27044 2014-03-16 23:41:27Z rouault $
3  *
4  * Project:  RPF A.TOC read Library
5  * Purpose:  Main GDAL independent include file for RPF TOC support.
6  * Author:   Even Rouault, even.rouault at mines-paris.org
7  *
8  **********************************************************************
9  * Copyright (c) 2007-2010, Even Rouault <even dot rouault at mines-paris dot org>
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 #ifndef RPFTOCLIB_H_INCLUDED
31 #define RPFTOCLIB_H_INCLUDED
32 
33 #include "nitflib.h"
34 
35 #include "cpl_port.h"
36 #include "cpl_error.h"
37 
38 CPL_C_START
39 
40 
41 typedef struct
42 {
43   int              exists;
44   int              fileExists;
45   unsigned short   frameRow;
46   unsigned short   frameCol;
47   char            *directory;
48   char             filename[12+1];
49   char             georef[6+1];
50   char            *fullFilePath;
51 } RPFTocFrameEntry;
52 
53 
54 typedef struct
55 {
56     char          type[5+1];
57     char          compression[5+1];
58     char          scale[12+1];
59     char          zone[1+1];
60     char          producer[5+1];
61     double        nwLat;
62     double        nwLong;
63     double        swLat;
64     double        swLong;
65     double        neLat;
66     double        neLong;
67     double        seLat;
68     double        seLong;
69     double        vertResolution;
70     double        horizResolution;
71     double        vertInterval;
72     double        horizInterval;
73     unsigned int  nVertFrames;
74     unsigned int  nHorizFrames;
75 
76     int           boundaryId;
77     int           isOverviewOrLegend;
78 
79     const char*   seriesAbbreviation;  /* (may be NULL) eg "GNC" */
80     const char*   seriesName;          /* (may be NULL) eg "Global Navigation Chart" */
81 
82     RPFTocFrameEntry* frameEntries;
83 } RPFTocEntry;
84 
85 typedef struct
86 {
87     int            nEntries;
88     RPFTocEntry  *entries;
89 } RPFToc;
90 
91 /* -------------------------------------------------------------------- */
92 /*      TOC file API                                                    */
93 /* -------------------------------------------------------------------- */
94 
95 /** Get the TOC information from a NITF TOC file */
96 RPFToc     CPL_DLL *RPFTOCRead(const char* pszFilename, NITFFile* psFile);
97 
98 /** Get the TOC information from a NITF TOC file or a non NITF TOC file */
99 RPFToc     CPL_DLL *RPFTOCReadFromBuffer(const char* pszFilename, VSILFILE* fp, const char* tocHeader);
100 
101 void       CPL_DLL  RPFTOCFree(RPFToc*  nitfToc);
102 
103 CPL_C_END
104 
105 #endif /* ndef RPFTOCLIB_H_INCLUDED */
106 
107