Fix missing translation
[geeqie.git] / src / jpeg-parser.h
1 /*
2  * Copyright (C) 2004 John Ellis
3  * Copyright (C) 2008 - 2016 The Geeqie Team
4  *
5  * Author: Vladimir Nadvornik
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef JPEG_PARSER_H
23 #define JPEG_PARSER_H
24
25 #include <glib.h>
26
27 #define JPEG_MARKER             0xFF
28 #define JPEG_MARKER_SOI         0xD8
29 #define JPEG_MARKER_EOI         0xD9
30 #define JPEG_MARKER_APP1        0xE1
31 #define JPEG_MARKER_APP2        0xE2
32
33 /* jpeg container format:
34      all data markers start with 0XFF
35      2 byte long file start and end markers: 0xFFD8(SOI) and 0XFFD9(EOI)
36      4 byte long data segment markers in format: 0xFFTTSSSSNNN...
37        FF:   1 byte standard marker identifier
38        TT:   1 byte data type
39        SSSS: 2 bytes in Motorola byte alignment for length of the data.
40              This value includes these 2 bytes in the count, making actual
41              length of NN... == SSSS - 2.
42        NNN.: the data in this segment
43  */
44
45 gboolean jpeg_segment_find(const guchar *data, guint size,
46                             guchar app_marker, const gchar *magic, guint magic_len,
47                             guint *seg_offset, guint *seg_length);
48
49
50 struct MPOEntry {
51         guint type_code;
52         gboolean representative;
53         gboolean dependent_child;
54         gboolean dependent_parent;
55         guint offset;
56         guint length;
57         guint dep1;
58         guint dep2;
59
60         guint MPFVersion;
61         guint MPIndividualNum;
62         guint PanOrientation;
63         double PanOverlap_H;
64         double PanOverlap_V;
65         guint BaseViewpointNum;
66         double ConvergenceAngle;
67         double BaselineLength;
68         double VerticalDivergence;
69         double AxisDistance_X;
70         double AxisDistance_Y;
71         double AxisDistance_Z;
72         double YawAngle;
73         double PitchAngle;
74         double RollAngle;
75 };
76
77
78 struct MPOData {
79         guint mpo_offset;
80
81         guint version;
82         guint num_images;
83         MPOEntry *images;
84 };
85
86 MPOData* jpeg_get_mpo_data(const guchar *data, guint size);
87 void jpeg_mpo_data_free(MPOData *mpo);
88
89 #endif
90
91 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */