1 /****************************************************************************** 2 * $Id: gxfopen.h 013acb5f84267ffb6e42b03ccdb09045243cdf1a 2017-05-20 16:15:44Z Even Rouault $ 3 * 4 * Project: GXF Reader 5 * Purpose: GXF-3 access function declarations. 6 * Author: Frank Warmerdam, warmerdam@pobox.com 7 * 8 ****************************************************************************** 9 * Copyright (c) 1998, Global Geomatics 10 * Copyright (c) 1998, Frank Warmerdam 11 * 12 * Permission is hereby granted, free of charge, to any person obtaining a 13 * copy of this software and associated documentation files (the "Software"), 14 * to deal in the Software without restriction, including without limitation 15 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 16 * and/or sell copies of the Software, and to permit persons to whom the 17 * Software is furnished to do so, subject to the following conditions: 18 * 19 * The above copyright notice and this permission notice shall be included 20 * in all copies or substantial portions of the Software. 21 * 22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 28 * DEALINGS IN THE SOFTWARE. 29 ****************************************************************************/ 30 31 #ifndef GXFOPEN_H_INCLUDED 32 #define GXFOPEN_H_INCLUDED 33 34 /** 35 * \file gxfopen.h 36 * 37 * Public GXF-3 function definitions. 38 */ 39 40 /* -------------------------------------------------------------------- */ 41 /* Include standard portability stuff. */ 42 /* -------------------------------------------------------------------- */ 43 #include "cpl_conv.h" 44 #include "cpl_string.h" 45 46 CPL_C_START 47 48 typedef void *GXFHandle; 49 50 GXFHandle GXFOpen( const char * pszFilename ); 51 52 CPLErr GXFGetRawInfo( GXFHandle hGXF, int *pnXSize, int *pnYSize, 53 int *pnSense, double * pdfZMin, double * pdfZMax, 54 double * pdfDummy ); 55 CPLErr GXFGetInfo( GXFHandle hGXF, int *pnXSize, int *pnYSize ); 56 57 CPLErr GXFGetRawScanline( GXFHandle, int iScanline, double * padfLineBuf ); 58 CPLErr GXFGetScanline( GXFHandle, int iScanline, double * padfLineBuf ); 59 60 char **GXFGetMapProjection( GXFHandle ); 61 char **GXFGetMapDatumTransform( GXFHandle ); 62 char *GXFGetMapProjectionAsPROJ4( GXFHandle ); 63 char *GXFGetMapProjectionAsOGCWKT( GXFHandle ); 64 65 CPLErr GXFGetRawPosition( GXFHandle, double *, double *, double *, double *, 66 double * ); 67 CPLErr GXFGetPosition( GXFHandle, double *, double *, double *, double *, 68 double * ); 69 70 CPLErr GXFGetPROJ4Position( GXFHandle, double *, double *, double *, double *, 71 double * ); 72 73 void GXFClose( GXFHandle hGXF ); 74 75 #define GXFS_LL_UP -1 76 #define GXFS_LL_RIGHT 1 77 #define GXFS_UL_RIGHT -2 78 #define GXFS_UL_DOWN 2 79 #define GXFS_UR_DOWN -3 80 #define GXFS_UR_LEFT 3 81 #define GXFS_LR_LEFT -4 82 #define GXFS_LR_UP 4 83 84 CPL_C_END 85 86 /* -------------------------------------------------------------------- */ 87 /* This is consider to be a private structure. */ 88 /* -------------------------------------------------------------------- */ 89 typedef struct { 90 VSILFILE *fp; 91 92 int nRawXSize; 93 int nRawYSize; 94 int nSense; /* GXFS_ codes */ 95 int nGType; /* 0 is uncompressed */ 96 97 double dfXPixelSize; 98 double dfYPixelSize; 99 double dfRotation; 100 double dfXOrigin; /* lower left corner */ 101 double dfYOrigin; /* lower left corner */ 102 103 char szDummy[64]; 104 double dfSetDummyTo; 105 106 char *pszTitle; 107 108 double dfTransformScale; 109 double dfTransformOffset; 110 char *pszTransformName; 111 112 char **papszMapProjection; 113 char **papszMapDatumTransform; 114 115 char *pszUnitName; 116 double dfUnitToMeter; 117 118 double dfZMaximum; 119 double dfZMinimum; 120 121 vsi_l_offset *panRawLineOffset; 122 } GXFInfo_t; 123 124 #endif /* ndef GXFOPEN_H_INCLUDED */ 125