base aspect calculation on 702 instead of 720 pixel
[vuplus_dvbapp] / lib / gdi / picexif.h
1 #ifndef __exif_h__
2 #define __exif_h__
3
4 #include <stdlib.h>
5 #include <memory.h>
6 #include <string.h>
7 #include <stdio.h>
8
9 #define MAX_COMMENT 1000
10 #define MAX_SECTIONS 20
11
12
13 typedef struct tag_ExifInfo {
14         char  Version        [5];
15         char  CameraMake     [32];
16         char  CameraModel    [40];
17         char  DateTime       [20];
18         char  Orientation    [20];
19         char  MeteringMode   [30];
20         char  Comments[MAX_COMMENT];
21         char  FlashUsed      [20];
22         char  IsColor        [5];
23         char  ResolutionUnit [20];
24         char  ExposureProgram[30];
25         char  LightSource    [20];
26         float Xresolution;
27         float Yresolution;
28         float Brightness;
29         float ExposureTime;
30         float ExposureBias;
31         float Distance;
32         float CCDWidth;                 //in milimeters
33         float FocalplaneXRes;
34         float FocalplaneYRes;
35         float FocalplaneUnits;
36         float FocalLength;
37         float ApertureFNumber;
38         int   Height, Width;
39         int   CompressionLevel;
40         int   ISOequivalent;
41         int   Process;
42         int   Orient;
43         unsigned char * ThumbnailPointer;
44         unsigned ThumbnailSize;
45         bool  IsExif;
46 } EXIFINFO;
47
48 static const int BytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8};
49
50 class Cexif
51 {
52         typedef struct tag_Section_t{
53         unsigned char* Data;
54         int Type;
55         unsigned Size;
56         } Section_t;
57 public:
58         EXIFINFO* m_exifinfo;
59         char m_szLastError[256];
60         Cexif();
61         ~Cexif();
62         bool DecodeExif(const char *filename);
63         void ClearExif();
64 protected:
65         bool process_EXIF(unsigned char * CharBuf, unsigned int length);
66         void process_COM (const unsigned char * Data, int length);
67         void process_SOFn (const unsigned char * Data, int marker);
68         int Get16u(void * Short);
69         int Get16m(void * Short);
70         long Get32s(void * Long);
71         unsigned long Get32u(void * Long);
72         double ConvertAnyFormat(void * ValuePtr, int Format);
73         bool ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength, EXIFINFO * const pInfo, unsigned         char ** const LastExifRefdP);
74         int ExifImageWidth;
75         int MotorolaOrder;
76         Section_t Sections[MAX_SECTIONS];
77         int SectionsRead;
78         bool freeinfo;
79 };
80
81 #endif// __exif_h__