iVS3D v2.0.0
Loading...
Searching...
No Matches
exportexif.h
1#ifndef EXPORTEXIF_H
2#define EXPORTEXIF_H
3
4#include <QObject>
5#include <QVariant>
6#include <QFileInfo>
7#include "stringcontainer.h"
8#include <cstring>
9#include <QtMath>
10#include <numeric>
11#include <variant>
12
14{
15public:
16 std::vector<char> saveExif(QString Path, QVariant exifData);
17
18private:
19 //ByteOrder (2 Bytes), 42 (2 Bytes), Offset of 0th IFD (4 Bytes)
20 const unsigned char TIFFHeader[8] = { 0x49,0x49,0x2A,0x00,0x08,0x00,0x00,0x00 };
21 //4Bytes length of Data Only 172-12 = 160///////////(without PNGChunkHeader and crc) --> total length - 8B PNGChunkHeader - 4B CRC
22 //TODO Size does change
23// const unsigned char PNGChunkHeader[8] = { 0x00,0x00,0x00,0x00,
24// //eXIf Tag PNG --> eXIf
25// 101,88,73,102 };
26// const unsigned char JPEGMarker[10] = { 0xFF,0xE1,
27// //Length of APP1 Field
28// 0x00,0xAA,
29// //Exif
30// 0x45,0x78,0x69,0x66,
31// //Offset
32// 0x00,0x00 };
33 //The IFD used in this standard consists of a 2-byte count (number of fields), 12-byte field Interoperability arrays, and 4-byte offset to the next IFD
34 const unsigned char GPSIFD[18] = { //Number of fields in this IFD, 2 bytes --> only gps ifd
35 0x01,0x00,
36 //GPS IFD Tag, next 12Bytes is the IFD 12-byte field Interoperability array
37 0x25,0x88,
38 //Type -> long
39 0x04,0x00,
40 //Count
41 0x01,0x00,0x00,0x00,
42 //Value -> Pointer to gps tags 0x1A = 26: Offset from TIFF Header to GPSValues --> 8Byte TIFF + 18Bytes GPSIFD = 26Bytes
43 0x1A,0x00,0x00,0x00,
44 //4 Byte offset to new segment -> GPS only segment
45 0x00,0x00,0x00,0x00};
46
47 bool useAltitude;
48 bool usePNG;
49 int exifSize;
50
51 QPair<int, int> getFraction(double d);
52
53 /* Table of CRCs of all 8-bit messages. */
54 unsigned long crc_table[256];
55
56 /* Flag: has the table been computed? Initially false. */
57 int crc_table_computed = 0;
58
59
60 void make_crc_table();
61 unsigned long update_crc(unsigned long crc, char *buf, int len);
62 unsigned long crc(char *buf, int len);
63};
64
65#endif // EXPORTEXIF_H
Definition exportexif.h:14