SpatiaLite  4.1.0
 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.1, 2013 May 8
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-2013
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 #define GAIA_XML_BLOB 11
94 
95 /* constants used for EXIF value types */
97 #define GAIA_EXIF_NONE 0
98 
99 #define GAIA_EXIF_BYTE 1
100 
101 #define GAIA_EXIF_SHORT 2
102 
103 #define GAIA_EXIF_STRING 3
104 
105 #define GAIA_EXIF_LONG 4
106 
107 #define GAIA_EXIF_RATIONAL 5
108 
109 #define GAIA_EXIF_SLONG 9
110 
111 #define GAIA_EXIF_SRATIONAL 10
112 
116  typedef struct gaiaExifTagStruct
117  {
118 /* an EXIF TAG */
120  char Gps;
122  unsigned short TagId;
124  unsigned short Type;
126  unsigned short Count;
128  unsigned char TagOffset[4];
130  unsigned char *ByteValue;
132  char *StringValue;
134  unsigned short *ShortValues;
136  unsigned int *LongValues;
138  unsigned int *LongRationals1;
140  unsigned int *LongRationals2;
150  float *FloatValues;
152  double *DoubleValues;
155  } gaiaExifTag;
162 
166  typedef struct gaiaExifTagListStruct
167  {
168 /* an EXIF TAG LIST */
170  gaiaExifTagPtr First;
172  gaiaExifTagPtr Last;
174  int NumTags;
176  gaiaExifTagPtr *TagsArray;
177  } gaiaExifTagList;
184 
185 /* function prototipes */
186 
199  GAIAEXIF_DECLARE gaiaExifTagListPtr gaiaGetExifTags (const unsigned char
200  *blob, int size);
201 
212  GAIAEXIF_DECLARE void gaiaExifTagsFree (gaiaExifTagListPtr tag_list);
213 
223  GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list);
224 
235  GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByPos (gaiaExifTagListPtr
236  tag_list,
237  const int pos);
238 
248  GAIAEXIF_DECLARE int gaiaGetExifTagsCount (gaiaExifTagListPtr tag_list);
249 
260  GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagById (const gaiaExifTagListPtr
261  tag_list,
262  const unsigned short
263  tag_id);
264 
275  GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifGpsTagById (const
276  gaiaExifTagListPtr
277  tag_list,
278  const unsigned short
279  tag_id);
280 
291  GAIAEXIF_DECLARE gaiaExifTagPtr gaiaGetExifTagByName (const
292  gaiaExifTagListPtr
293  tag_list,
294  const char *tag_name);
295 
305  GAIAEXIF_DECLARE unsigned short gaiaExifTagGetId (const gaiaExifTagPtr tag);
306 
316  GAIAEXIF_DECLARE void gaiaExifTagGetName (const gaiaExifTagPtr tag,
317  char *tag_name, int len);
318 
328  GAIAEXIF_DECLARE int gaiaIsExifGpsTag (const gaiaExifTagPtr tag);
329 
341  GAIAEXIF_DECLARE unsigned short gaiaExifTagGetValueType (const
342  gaiaExifTagPtr
343  tag);
344 
354  GAIAEXIF_DECLARE unsigned short gaiaExifTagGetNumValues (const
355  gaiaExifTagPtr
356  tag);
357 
370  GAIAEXIF_DECLARE unsigned char gaiaExifTagGetByteValue (const gaiaExifTagPtr
371  tag, const int ind,
372  int *ok);
373 
385  GAIAEXIF_DECLARE void gaiaExifTagGetStringValue (const gaiaExifTagPtr tag,
386  char *str, int len,
387  int *ok);
388 
401  GAIAEXIF_DECLARE unsigned short gaiaExifTagGetShortValue (const
402  gaiaExifTagPtr
403  tag,
404  const int ind,
405  int *ok);
406 
419  GAIAEXIF_DECLARE unsigned int gaiaExifTagGetLongValue (const gaiaExifTagPtr
420  tag, const int ind,
421  int *ok);
422 
435  GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational1Value (const
436  gaiaExifTagPtr
437  tag,
438  const int ind,
439  int *ok);
440 
453  GAIAEXIF_DECLARE unsigned int gaiaExifTagGetRational2Value (const
454  gaiaExifTagPtr
455  tag,
456  const int ind,
457  int *ok);
458 
471  GAIAEXIF_DECLARE double gaiaExifTagGetRationalValue (const gaiaExifTagPtr
472  tag, const int ind,
473  int *ok);
474 
487  GAIAEXIF_DECLARE short gaiaExifTagGetSignedShortValue (const gaiaExifTagPtr
488  tag, const int ind,
489  int *ok);
490 
503  GAIAEXIF_DECLARE int gaiaExifTagGetSignedLongValue (const gaiaExifTagPtr
504  tag, const int ind,
505  int *ok);
506 
519  GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational1Value (const
520  gaiaExifTagPtr tag,
521  const int ind,
522  int *ok);
523 
536  GAIAEXIF_DECLARE int gaiaExifTagGetSignedRational2Value (const
537  gaiaExifTagPtr tag,
538  const int ind,
539  int *ok);
540 
553  GAIAEXIF_DECLARE double gaiaExifTagGetSignedRationalValue (const
554  gaiaExifTagPtr
555  tag,
556  const int ind,
557  int *ok);
558 
571  GAIAEXIF_DECLARE float gaiaExifTagGetFloatValue (const gaiaExifTagPtr tag,
572  const int ind, int *ok);
573 
586  GAIAEXIF_DECLARE double gaiaExifTagGetDoubleValue (const gaiaExifTagPtr tag,
587  const int ind, int *ok);
588 
599  GAIAEXIF_DECLARE void gaiaExifTagGetHumanReadable (const gaiaExifTagPtr tag,
600  char *str, int len,
601  int *ok);
602 
613  GAIAEXIF_DECLARE int gaiaGuessBlobType (const unsigned char *blob,
614  int size);
628  GAIAEXIF_DECLARE int gaiaGetGpsCoords (const unsigned char *blob, int size,
629  double *longitude, double *latitude);
643  GAIAEXIF_DECLARE int gaiaGetGpsLatLong (const unsigned char *blob, int size,
644  char *latlong, int ll_size);
645 
646 #ifdef __cplusplus
647 }
648 #endif
649 
650 #endif /* _GAIAEXIF_H */