SpatiaLite  4.0.0-RC1
 All Data Structures Files Functions Variables Typedefs Macros Pages
gaiaexif.h
Go to the documentation of this file.
1 /*
2  gaiaexif.h -- Gaia common EXIF Metadata reading functions
3 
4  version 4.0, 2012 August 6
5 
6  Author: Sandro Furieri a.furieri@lqt.it
7 
8  ------------------------------------------------------------------------------
9 
10  Version: MPL 1.1/GPL 2.0/LGPL 2.1
11 
12  The contents of this file are subject to the Mozilla Public License Version
13  1.1 (the "License"); you may not use this file except in compliance with
14  the License. You may obtain a copy of the License at
15  http://www.mozilla.org/MPL/
16 
17 Software distributed under the License is distributed on an "AS IS" basis,
18 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19 for the specific language governing rights and limitations under the
20 License.
21 
22 The Original Code is the SpatiaLite library
23 
24 The Initial Developer of the Original Code is Alessandro Furieri
25 
26 Portions created by the Initial Developer are Copyright (C) 2008-2012
27 the Initial Developer. All Rights Reserved.
28 
29 Contributor(s):
30 
31 Alternatively, the contents of this file may be used under the terms of
32 either the GNU General Public License Version 2 or later (the "GPL"), or
33 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
34 in which case the provisions of the GPL or the LGPL are applicable instead
35 of those above. If you wish to allow use of your version of this file only
36 under the terms of either the GPL or the LGPL, and not to allow others to
37 use your version of this file under the terms of the MPL, indicate your
38 decision by deleting the provisions above and replace them with the notice
39 and other provisions required by the GPL or the LGPL. If you do not delete
40 the provisions above, a recipient may use your version of this file under
41 the terms of any one of the MPL, the GPL or the LGPL.
42 
43 */
44 
51 #ifndef DOXYGEN_SHOULD_SKIP_THIS
52 #ifdef DLL_EXPORT
53 #define GAIAEXIF_DECLARE __declspec(dllexport)
54 #else
55 #define GAIAEXIF_DECLARE extern
56 #endif
57 #endif
58 
59 #ifndef _GAIAEXIF_H
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
61 #define _GAIAEXIF_H
62 #endif
63 
64 #ifdef __cplusplus
65 extern "C"
66 {
67 #endif
68 
69 /* constants used for BLOB value types */
71 #define GAIA_HEX_BLOB 0
72 
73 #define GAIA_GIF_BLOB 1
74 
75 #define GAIA_PNG_BLOB 2
76 
77 #define GAIA_JPEG_BLOB 3
78 
79 #define GAIA_EXIF_BLOB 4
80 
81 #define GAIA_EXIF_GPS_BLOB 5
82 
83 #define GAIA_ZIP_BLOB 6
84 
85 #define GAIA_PDF_BLOB 7
86 
87 #define GAIA_GEOMETRY_BLOB 8
88 
89 #define GAIA_TIFF_BLOB 9
90 
91 #define GAIA_WEBP_BLOB 10
92 
93 /* constants used for EXIF value types */
95 #define GAIA_EXIF_NONE 0
96 
97 #define GAIA_EXIF_BYTE 1
98 
99 #define GAIA_EXIF_SHORT 2
100 
101 #define GAIA_EXIF_STRING 3
102 
103 #define GAIA_EXIF_LONG 4
104 
105 #define GAIA_EXIF_RATIONAL 5
106 
107 #define GAIA_EXIF_SLONG 9
108 
109 #define GAIA_EXIF_SRATIONAL 10
110 
114  typedef struct gaiaExifTagStruct
115  {
116 /* an EXIF TAG */
118  char Gps;
120  unsigned short TagId;
122  unsigned short Type;
124  unsigned short Count;
126  unsigned char TagOffset[4];
128  unsigned char *ByteValue;
130  char *StringValue;
132  unsigned short *ShortValues;
134  unsigned int *LongValues;
136  unsigned int *LongRationals1;
138  unsigned int *LongRationals2;
148  float *FloatValues;
150  double *DoubleValues;
153  } gaiaExifTag;
160 
164  typedef struct gaiaExifTagListStruct
165  {
166 /* an EXIF TAG LIST */
168  gaiaExifTagPtr First;
170  gaiaExifTagPtr Last;
172  int NumTags;
174  gaiaExifTagPtr *TagsArray;
175  } gaiaExifTagList;
182 
183 /* function prototipes */
184 
197  GAIAEXIF_DECLARE gaiaExifTagListPtr gaiaGetExifTags (const unsigned char
198  *blob, int size);
199 
210  GAIAEXIF_DECLARE void gaiaExifTagsFree (gaiaExifTagListPtr tag_list);
211 
221  GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list);
222 
233  GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByPos (gaiaExifTagListPtr
234  tag_list,
235  const int pos);
236 
246  GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list);
247 
258  GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagById (const gaiaExifTagListPtr
259  tag_list,
260  const unsigned short
261  tag_id);
262 
273  GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifGpsTagById (const
274  gaiaExifTagListPtr
275  tag_list,
276  const unsigned short
277  tag_id);
278 
289  GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByName (const
290  gaiaExifTagListPtr
291  tag_list,
292  const char *tag_name);
293 
303  GAIAEXIF_DECLARE unsigned short gaiaExifTagGetId (const gaiaExifTagPtr tag);
304 
314  GAIAEXIF_DECLARE void gaiaExifTagGetName (const gaiaExifTagPtr tag,
315  char *tag_name, int len);
316 
326  GAIAEXIF_DECLARE int gaiaIsExifGpsTag (const gaiaExifTagPtr tag);
327 
339  GAIAEXIF_DECLARE unsigned short gaiaExifTagGetValueType (const
340  gaiaExifTagPtr
341  tag);
342 
352  GAIAEXIF_DECLARE unsigned short gaiaExifTagGetNumValues (const
353  gaiaExifTagPtr
354  tag);
355 
368  GAIAEXIF_DECLARE unsigned char gaiaExifTagGetByteValue (const gaiaExifTagPtr
369  tag, const int ind,
370  int *ok);
371 
383  GAIAEXIF_DECLARE void gaiaExifTagGetStringValue (const gaiaExifTagPtr tag,
384  char *str, int len,
385  int *ok);
386 
399  GAIAEXIF_DECLARE unsigned short gaiaExifTagGetShortValue (const
400  gaiaExifTagPtr
401  tag,
402  const int ind,
403  int *ok);
404 
417  GAIAEXIF_DECLARE unsigned int gaiaExifTagGetLongValue (const gaiaExifTagPtr
418  tag, const int ind,
419  int *ok);
420 
433  GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational1Value (const
434  gaiaExifTagPtr
435  tag,
436  const int ind,
437  int *ok);
438 
451  GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational2Value (const
452  gaiaExifTagPtr
453  tag,
454  const int ind,
455  int *ok);
456 
469  GAIAEXIF_DECLARE double gaiaExifTagGetRationalValue (const gaiaExifTagPtr
470  tag, const int ind,
471  int *ok);
472 
485  GAIAEXIF_DECLARE short gaiaExifTagGetSignedShortValue (const gaiaExifTagPtr
486  tag, const int ind,
487  int *ok);
488 
501  GAIAEXIF_DECLARE int gaiaExifTagGetSignedLongValue (const gaiaExifTagPtr
502  tag, const int ind,
503  int *ok);
504 
517  GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational1Value (const
518  gaiaExifTagPtr tag,
519  const int ind,
520  int *ok);
521 
534  GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational2Value (const
535  gaiaExifTagPtr tag,
536  const int ind,
537  int *ok);
538 
551  GAIAEXIF_DECLARE double gaiaExifTagGetSignedRationalValue (const
552  gaiaExifTagPtr
553  tag,
554  const int ind,
555  int *ok);
556 
569  GAIAEXIF_DECLARE float gaiaExifTagGetFloatValue (const gaiaExifTagPtr tag,
570  const int ind, int *ok);
571 
584  GAIAEXIF_DECLARE double gaiaExifTagGetDoubleValue (const gaiaExifTagPtr tag,
585  const int ind, int *ok);
586 
597  GAIAEXIF_DECLARE void gaiaExifTagGetHumanReadable (const gaiaExifTagPtr tag,
598  char *str, int len,
599  int *ok);
600 
611  GAIAEXIF_DECLARE int gaiaGuessBlobType (const unsigned char *blob,
612  int size);
626  GAIAEXIF_DECLARE int gaiaGetGpsCoords (const unsigned char *blob, int size,
627  double *longitude, double *latitude);
641  GAIAEXIF_DECLARE int gaiaGetGpsLatLong (const unsigned char *blob, int size,
642  char *latlong, int ll_size);
643 
644 #ifdef __cplusplus
645 }
646 #endif
647 
648 #endif /* _GAIAEXIF_H */