|
SpatiaLite 4.3.0a
|
00001 /* 00002 gaiaexif.h -- Gaia common EXIF Metadata reading functions 00003 00004 version 4.3, 2015 June 29 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-2015 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 #define GAIA_WEBP_BLOB 10 00092 00093 #define GAIA_JP2_BLOB 11 00094 00095 #define GAIA_XML_BLOB 12 00096 00097 #define GAIA_GPB_BLOB 13 00098 00099 /* constants used for EXIF value types */ 00101 #define GAIA_EXIF_NONE 0 00102 00103 #define GAIA_EXIF_BYTE 1 00104 00105 #define GAIA_EXIF_SHORT 2 00106 00107 #define GAIA_EXIF_STRING 3 00108 00109 #define GAIA_EXIF_LONG 4 00110 00111 #define GAIA_EXIF_RATIONAL 5 00112 00113 #define GAIA_EXIF_SLONG 9 00114 00115 #define GAIA_EXIF_SRATIONAL 10 00116 00120 typedef struct gaiaExifTagStruct 00121 { 00122 /* an EXIF TAG */ 00124 char Gps; 00126 unsigned short TagId; 00128 unsigned short Type; 00130 unsigned short Count; 00132 unsigned char TagOffset[4]; 00134 unsigned char *ByteValue; 00136 char *StringValue; 00138 unsigned short *ShortValues; 00140 unsigned int *LongValues; 00142 unsigned int *LongRationals1; 00144 unsigned int *LongRationals2; 00146 short *SignedShortValues; 00148 int *SignedLongValues; 00150 int *SignedLongRationals1; 00152 int *SignedLongRationals2; 00154 float *FloatValues; 00156 double *DoubleValues; 00158 struct gaiaExifTagStruct *Next; 00159 } gaiaExifTag; 00165 typedef gaiaExifTag *gaiaExifTagPtr; 00166 00170 typedef struct gaiaExifTagListStruct 00171 { 00172 /* an EXIF TAG LIST */ 00174 gaiaExifTagPtr First; 00176 gaiaExifTagPtr Last; 00178 int NumTags; 00180 gaiaExifTagPtr *TagsArray; 00181 } gaiaExifTagList; 00187 typedef gaiaExifTagList *gaiaExifTagListPtr; 00188 00189 /* function prototipes */ 00190 00203 GAIAEXIF_DECLARE gaiaExifTagListPtr gaiaGetExifTags (const unsigned char 00204 *blob, int size); 00205 00216 GAIAEXIF_DECLARE void gaiaExifTagsFree (gaiaExifTagListPtr tag_list); 00217 00227 GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list); 00228 00239 GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByPos (gaiaExifTagListPtr 00240 tag_list, 00241 const int pos); 00242 00252 GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list); 00253 00264 GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagById (const gaiaExifTagListPtr 00265 tag_list, 00266 const unsigned short 00267 tag_id); 00268 00279 GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifGpsTagById (const 00280 gaiaExifTagListPtr 00281 tag_list, 00282 const unsigned short 00283 tag_id); 00284 00295 GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByName (const 00296 gaiaExifTagListPtr 00297 tag_list, 00298 const char *tag_name); 00299 00309 GAIAEXIF_DECLARE unsigned short gaiaExifTagGetId (const gaiaExifTagPtr tag); 00310 00320 GAIAEXIF_DECLARE void gaiaExifTagGetName (const gaiaExifTagPtr tag, 00321 char *tag_name, int len); 00322 00332 GAIAEXIF_DECLARE int gaiaIsExifGpsTag (const gaiaExifTagPtr tag); 00333 00345 GAIAEXIF_DECLARE unsigned short gaiaExifTagGetValueType (const 00346 gaiaExifTagPtr 00347 tag); 00348 00358 GAIAEXIF_DECLARE unsigned short gaiaExifTagGetNumValues (const 00359 gaiaExifTagPtr 00360 tag); 00361 00374 GAIAEXIF_DECLARE unsigned char gaiaExifTagGetByteValue (const gaiaExifTagPtr 00375 tag, const int ind, 00376 int *ok); 00377 00389 GAIAEXIF_DECLARE void gaiaExifTagGetStringValue (const gaiaExifTagPtr tag, 00390 char *str, int len, 00391 int *ok); 00392 00405 GAIAEXIF_DECLARE unsigned short gaiaExifTagGetShortValue (const 00406 gaiaExifTagPtr 00407 tag, 00408 const int ind, 00409 int *ok); 00410 00423 GAIAEXIF_DECLARE unsigned int gaiaExifTagGetLongValue (const gaiaExifTagPtr 00424 tag, const int ind, 00425 int *ok); 00426 00439 GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational1Value (const 00440 gaiaExifTagPtr 00441 tag, 00442 const int ind, 00443 int *ok); 00444 00457 GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational2Value (const 00458 gaiaExifTagPtr 00459 tag, 00460 const int ind, 00461 int *ok); 00462 00475 GAIAEXIF_DECLARE double gaiaExifTagGetRationalValue (const gaiaExifTagPtr 00476 tag, const int ind, 00477 int *ok); 00478 00491 GAIAEXIF_DECLARE short gaiaExifTagGetSignedShortValue (const gaiaExifTagPtr 00492 tag, const int ind, 00493 int *ok); 00494 00507 GAIAEXIF_DECLARE int gaiaExifTagGetSignedLongValue (const gaiaExifTagPtr 00508 tag, const int ind, 00509 int *ok); 00510 00523 GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational1Value (const 00524 gaiaExifTagPtr tag, 00525 const int ind, 00526 int *ok); 00527 00540 GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational2Value (const 00541 gaiaExifTagPtr tag, 00542 const int ind, 00543 int *ok); 00544 00557 GAIAEXIF_DECLARE double gaiaExifTagGetSignedRationalValue (const 00558 gaiaExifTagPtr 00559 tag, 00560 const int ind, 00561 int *ok); 00562 00575 GAIAEXIF_DECLARE float gaiaExifTagGetFloatValue (const gaiaExifTagPtr tag, 00576 const int ind, int *ok); 00577 00590 GAIAEXIF_DECLARE double gaiaExifTagGetDoubleValue (const gaiaExifTagPtr tag, 00591 const int ind, int *ok); 00592 00603 GAIAEXIF_DECLARE void gaiaExifTagGetHumanReadable (const gaiaExifTagPtr tag, 00604 char *str, int len, 00605 int *ok); 00606 00618 GAIAEXIF_DECLARE int gaiaGuessBlobType (const unsigned char *blob, 00619 int size); 00633 GAIAEXIF_DECLARE int gaiaGetGpsCoords (const unsigned char *blob, int size, 00634 double *longitude, double *latitude); 00648 GAIAEXIF_DECLARE int gaiaGetGpsLatLong (const unsigned char *blob, int size, 00649 char *latlong, int ll_size); 00650 00651 #ifdef __cplusplus 00652 } 00653 #endif 00654 00655 #endif /* _GAIAEXIF_H */
1.7.3