00001 /* 00002 * The information in this file is 00003 * Copyright(c) 2007 Ball Aerospace & Technologies Corporation 00004 * and is subject to the terms and conditions of the 00005 * GNU Lesser General Public License Version 2.1 00006 * The license text is available from 00007 * http://www.gnu.org/licenses/lgpl.html 00008 */ 00009 00010 #ifndef GEOGRAPHICDATA_H__ 00011 #define GEOGRAPHICDATA_H__ 00012 00013 #include "AppConfig.h" 00014 00015 #if !defined(WIN_API) 00016 #include <stdint.h> 00017 #endif 00018 00019 class GcpList; 00020 00021 #ifdef __cplusplus 00022 extern "C" 00023 { 00024 #endif 00025 /** \addtogroup simple_api */ 00026 /*@{*/ 00027 00028 /** 00029 * @file GeographicData.h 00030 * This file contains functions and type definitions for accessing geographic (GCP) and tie point data. 00031 */ 00032 00033 /** 00034 * The in-memory definition of a GCP point. 00035 * 00036 * This is exactly the same memory layout as the GcpPoint class. It is redefined 00037 * here since a class is not a valid C type definition. 00038 */ 00039 struct Gcp 00040 { 00041 double mPixelX; /*< The pixel X position (column) in the data set */ 00042 double mPixelY; /*< The pixel Y position (row) in the data set */ 00043 double reserved1; /*< This offset is reserved for future expansion. The value is undefined. */ 00044 double mLatitude; /*< The corresponding latitude for the GCP point */ 00045 double mLongitude; /*< The corresponding longitude for the GCP point */ 00046 double reserved2; /*< This offset is reserved for future expansion. The value is undefined. */ 00047 double mRmsErrorLatitude; /*< The RMS error for the latitude value. 00048 This is generally non-zero if georeferencing has occured. */ 00049 double mRmsErrorLongitude; /*< The RMS error for the longitude value. 00050 This is generally non-zero if georeferencing has occured. */ 00051 double reserved3; /*< This offset is reserved for future expansion. The value is undefined. */ 00052 }; 00053 00054 /** 00055 * Get the number of GCP points in a GcpList. 00056 * 00057 * @param pList 00058 * Handle for the GcpList being accessed. 00059 * This handle should be obtained using getDataElement(). 00060 * 00061 * @return The number of GCP points in the specified GCP list. This will be 00062 * 0 if an error occurs but getLastError() must still be called as 00063 * 0 may be returned if no error occurs. 00064 */ 00065 EXPORT_SYMBOL uint32_t getGcpCount(DataElement* pList); 00066 00067 /** 00068 * Get a GCP point from a GcpList. 00069 * 00070 * @param pList 00071 * Handle for the GcpList being accessed. 00072 * This handle should be obtained using getDataElement(). 00073 * 00074 * @param index 00075 * The zero based index for the requested GcpPoint. This must be 00076 * less than the size returned by getGcpCount() 00077 * 00078 * @return The GcpPoint at location index. This is undefined if an error occurs. 00079 */ 00080 EXPORT_SYMBOL struct Gcp getGcpPoint(DataElement* pList, uint32_t index); 00081 00082 /** 00083 * Get an array of all the GCP points in a GcpList. 00084 * 00085 * @param pList 00086 * Handle for the GcpList being accessed. 00087 * This handle should be obtained using getDataElement(). 00088 * 00089 * @param pPoints 00090 * Output parameter which will contain the array of GcpPoints in pList. 00091 * This shall be pre-allocated and must be at least 00092 * (sizeof(struct Gcp) * getGcpCount()) bytes long. 00093 * 00094 * @return The number of GcpPoints placed in pPoints. If an error occurs, this will be 0 00095 * but getLastError() should be checked as 0 may be returned if no error occurs. 00096 */ 00097 EXPORT_SYMBOL uint32_t getGcpPoints(DataElement* pList, struct Gcp* pPoints); 00098 00099 /** 00100 * Set the GCP points in a GcpList, replacing any existing points. 00101 * 00102 * @param pList 00103 * Handle for the GcpList being modified. 00104 * This handle should be obtained using getDataElement(). 00105 * 00106 * @param count 00107 * The number of GCP points in pPoints. 00108 * 00109 * @param pPoints 00110 * The array of GcpPoints to set in pList. 00111 * This shall be at least (sizeof(struct Gcp) * count) bytes long. 00112 * This may be \c NULL if count is 0. 00113 * 00114 * @return The number of GcpPoints placed in the GcpList. If an error occurs, this will be 0 00115 * but getLastError() should be checked as 0 may be returned if no error occurs. 00116 */ 00117 EXPORT_SYMBOL uint32_t setGcpPoints(DataElement* pList, uint32_t count, struct Gcp* pPoints); 00118 00119 /*@}*/ 00120 #ifdef __cplusplus 00121 } 00122 #endif 00123 00124 #endif