SpatiaLite
3.0.0-stable
|
00001 /* 00002 gaiaexif.h -- Gaia common EXIF Metadata reading functions 00003 00004 version 3.0, 2011 July 20 00005 00006 Author: Sandro Furieri a.furieri@lqt.it 00007 00008 ------------------------------------------------------------------------------ 00009 00010 Version: MPL 1.1/GPL 2.0/LGPL 2.1 00011 00012 The contents of this file are subject to the Mozilla Public License Version 00013 1.1 (the "License"); you may not use this file except in compliance with 00014 the License. You may obtain a copy of the License at 00015 http://www.mozilla.org/MPL/ 00016 00017 Software distributed under the License is distributed on an "AS IS" basis, 00018 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 00019 for the specific language governing rights and limitations under the 00020 License. 00021 00022 The Original Code is the SpatiaLite library 00023 00024 The Initial Developer of the Original Code is Alessandro Furieri 00025 00026 Portions created by the Initial Developer are Copyright (C) 2008 00027 the Initial Developer. All Rights Reserved. 00028 00029 Contributor(s): 00030 00031 Alternatively, the contents of this file may be used under the terms of 00032 either the GNU General Public License Version 2 or later (the "GPL"), or 00033 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 00034 in which case the provisions of the GPL or the LGPL are applicable instead 00035 of those above. If you wish to allow use of your version of this file only 00036 under the terms of either the GPL or the LGPL, and not to allow others to 00037 use your version of this file under the terms of the MPL, indicate your 00038 decision by deleting the provisions above and replace them with the notice 00039 and other provisions required by the GPL or the LGPL. If you do not delete 00040 the provisions above, a recipient may use your version of this file under 00041 the terms of any one of the MPL, the GPL or the LGPL. 00042 00043 */ 00044 00051 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00052 #ifdef DLL_EXPORT 00053 #define GAIAEXIF_DECLARE __declspec(dllexport) 00054 #else 00055 #define GAIAEXIF_DECLARE extern 00056 #endif 00057 #endif 00058 00059 #ifndef _GAIAEXIF_H 00060 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00061 #define _GAIAEXIF_H 00062 #endif 00063 00064 #ifdef __cplusplus 00065 extern "C" 00066 { 00067 #endif 00068 00069 /* constants used for BLOB value types */ 00071 #define GAIA_HEX_BLOB 0 00072 00073 #define GAIA_GIF_BLOB 1 00074 00075 #define GAIA_PNG_BLOB 2 00076 00077 #define GAIA_JPEG_BLOB 3 00078 00079 #define GAIA_EXIF_BLOB 4 00080 00081 #define GAIA_EXIF_GPS_BLOB 5 00082 00083 #define GAIA_ZIP_BLOB 6 00084 00085 #define GAIA_PDF_BLOB 7 00086 00087 #define GAIA_GEOMETRY_BLOB 8 00088 00089 #define GAIA_TIFF_BLOB 9 00090 00091 /* constants used for EXIF value types */ 00093 #define GAIA_EXIF_NONE 0 00094 00095 #define GAIA_EXIF_BYTE 1 00096 00097 #define GAIA_EXIF_SHORT 2 00098 00099 #define GAIA_EXIF_STRING 3 00100 00101 #define GAIA_EXIF_LONG 4 00102 00103 #define GAIA_EXIF_RATIONAL 5 00104 00105 #define GAIA_EXIF_SLONG 9 00106 00107 #define GAIA_EXIF_SRATIONAL 10 00108 00112 typedef struct gaiaExifTagStruct 00113 { 00114 /* an EXIF TAG */ 00116 char Gps; 00118 unsigned short TagId; 00120 unsigned short Type; 00122 unsigned short Count; 00124 unsigned char TagOffset[4]; 00126 unsigned char *ByteValue; 00128 char *StringValue; 00130 unsigned short *ShortValues; 00132 unsigned int *LongValues; 00134 unsigned int *LongRationals1; 00136 unsigned int *LongRationals2; 00138 short *SignedShortValues; 00140 int *SignedLongValues; 00142 int *SignedLongRationals1; 00144 int *SignedLongRationals2; 00146 float *FloatValues; 00148 double *DoubleValues; 00150 struct gaiaExifTagStruct *Next; 00151 } gaiaExifTag; 00157 typedef gaiaExifTag *gaiaExifTagPtr; 00158 00162 typedef struct gaiaExifTagListStruct 00163 { 00164 /* an EXIF TAG LIST */ 00166 gaiaExifTagPtr First; 00168 gaiaExifTagPtr Last; 00170 int NumTags; 00172 gaiaExifTagPtr *TagsArray; 00173 } gaiaExifTagList; 00179 typedef gaiaExifTagList *gaiaExifTagListPtr; 00180 00181 /* function prototipes */ 00182 00195 GAIAEXIF_DECLARE gaiaExifTagListPtr gaiaGetExifTags (const unsigned char 00196 *blob, int size); 00197 00208 GAIAEXIF_DECLARE void gaiaExifTagsFree (gaiaExifTagListPtr tag_list); 00209 00219 GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list); 00220 00231 GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByPos (gaiaExifTagListPtr 00232 tag_list, 00233 const int pos); 00234 00244 GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list); 00245 00256 GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagById (const gaiaExifTagListPtr 00257 tag_list, 00258 const unsigned short 00259 tag_id); 00260 00271 GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifGpsTagById (const 00272 gaiaExifTagListPtr 00273 tag_list, 00274 const unsigned short 00275 tag_id); 00276 00287 GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByName (const 00288 gaiaExifTagListPtr 00289 tag_list, 00290 const char *tag_name); 00291 00301 GAIAEXIF_DECLARE unsigned short gaiaExifTagGetId (const gaiaExifTagPtr tag); 00302 00312 GAIAEXIF_DECLARE void gaiaExifTagGetName (const gaiaExifTagPtr tag, 00313 char *tag_name, int len); 00314 00324 GAIAEXIF_DECLARE int gaiaIsExifGpsTag (const gaiaExifTagPtr tag); 00325 00337 GAIAEXIF_DECLARE unsigned short gaiaExifTagGetValueType (const 00338 gaiaExifTagPtr 00339 tag); 00340 00350 GAIAEXIF_DECLARE unsigned short gaiaExifTagGetNumValues (const 00351 gaiaExifTagPtr 00352 tag); 00353 00366 GAIAEXIF_DECLARE unsigned char gaiaExifTagGetByteValue (const gaiaExifTagPtr 00367 tag, const int ind, 00368 int *ok); 00369 00381 GAIAEXIF_DECLARE void gaiaExifTagGetStringValue (const gaiaExifTagPtr tag, 00382 char *str, int len, 00383 int *ok); 00384 00397 GAIAEXIF_DECLARE unsigned short gaiaExifTagGetShortValue (const 00398 gaiaExifTagPtr 00399 tag, 00400 const int ind, 00401 int *ok); 00402 00415 GAIAEXIF_DECLARE unsigned int gaiaExifTagGetLongValue (const gaiaExifTagPtr 00416 tag, const int ind, 00417 int *ok); 00418 00431 GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational1Value (const 00432 gaiaExifTagPtr 00433 tag, 00434 const int ind, 00435 int *ok); 00436 00449 GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational2Value (const 00450 gaiaExifTagPtr 00451 tag, 00452 const int ind, 00453 int *ok); 00454 00467 GAIAEXIF_DECLARE double gaiaExifTagGetRationalValue (const gaiaExifTagPtr 00468 tag, const int ind, 00469 int *ok); 00470 00483 GAIAEXIF_DECLARE short gaiaExifTagGetSignedShortValue (const gaiaExifTagPtr 00484 tag, const int ind, 00485 int *ok); 00486 00499 GAIAEXIF_DECLARE int gaiaExifTagGetSignedLongValue (const gaiaExifTagPtr 00500 tag, const int ind, 00501 int *ok); 00502 00515 GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational1Value (const 00516 gaiaExifTagPtr tag, 00517 const int ind, 00518 int *ok); 00519 00532 GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational2Value (const 00533 gaiaExifTagPtr tag, 00534 const int ind, 00535 int *ok); 00536 00549 GAIAEXIF_DECLARE double gaiaExifTagGetSignedRationalValue (const 00550 gaiaExifTagPtr 00551 tag, 00552 const int ind, 00553 int *ok); 00554 00567 GAIAEXIF_DECLARE float gaiaExifTagGetFloatValue (const gaiaExifTagPtr tag, 00568 const int ind, int *ok); 00569 00582 GAIAEXIF_DECLARE double gaiaExifTagGetDoubleValue (const gaiaExifTagPtr tag, 00583 const int ind, int *ok); 00584 00595 GAIAEXIF_DECLARE void gaiaExifTagGetHumanReadable (const gaiaExifTagPtr tag, 00596 char *str, int len, 00597 int *ok); 00598 00609 GAIAEXIF_DECLARE int gaiaGuessBlobType (const unsigned char *blob, 00610 int size); 00624 GAIAEXIF_DECLARE int gaiaGetGpsCoords (const unsigned char *blob, int size, 00625 double *longitude, double *latitude); 00639 GAIAEXIF_DECLARE int gaiaGetGpsLatLong (const unsigned char *blob, int size, 00640 char *latlong, int ll_size); 00641 00642 #ifdef __cplusplus 00643 } 00644 #endif 00645 00646 #endif /* _GAIAEXIF_H */