Add missing vim modeline.
[geeqie.git] / src / jpeg_parser.h
1 /*
2  * Geeqie
3  * (C) 2004 John Ellis
4  * Copyright (C) 2008 - 2012 The Geeqie Team
5  *
6  * Author: Vladimir Nadvornik
7  *
8  * This software is released under the GNU General Public License (GNU GPL).
9  * Please read the included file COPYING for more information.
10  * This software comes with no warranty of any kind, use at your own risk!
11  */
12
13 #ifndef JPEG_PARSER_H
14 #define JPEG_PARSER_H
15
16 #define JPEG_MARKER             0xFF
17 #define JPEG_MARKER_SOI         0xD8
18 #define JPEG_MARKER_EOI         0xD9
19 #define JPEG_MARKER_APP1        0xE1
20 #define JPEG_MARKER_APP2        0xE2
21
22 /* jpeg container format:
23      all data markers start with 0XFF
24      2 byte long file start and end markers: 0xFFD8(SOI) and 0XFFD9(EOI)
25      4 byte long data segment markers in format: 0xFFTTSSSSNNN...
26        FF:   1 byte standard marker identifier
27        TT:   1 byte data type
28        SSSS: 2 bytes in Motorola byte alignment for length of the data.
29              This value includes these 2 bytes in the count, making actual
30              length of NN... == SSSS - 2.
31        NNN.: the data in this segment
32  */
33
34 gboolean jpeg_segment_find(const guchar *data, guint size,
35                             guchar app_marker, const gchar *magic, guint magic_len,
36                             guint *seg_offset, guint *seg_length);
37
38
39 typedef struct _MPOData MPOData;
40 typedef struct _MPOEntry MPOEntry;
41
42 struct _MPOEntry {
43         guint type_code;
44         gboolean representative;
45         gboolean dependent_child;
46         gboolean dependent_parent;
47         guint offset;
48         guint length;
49         guint dep1;
50         guint dep2;
51
52         guint MPFVersion;
53         guint MPIndividualNum;  
54         guint PanOrientation;   
55         double PanOverlap_H;    
56         double PanOverlap_V;    
57         guint BaseViewpointNum; 
58         double ConvergenceAngle;
59         double BaselineLength;
60         double VerticalDivergence;
61         double AxisDistance_X;
62         double AxisDistance_Y;
63         double AxisDistance_Z;
64         double YawAngle;
65         double PitchAngle;
66         double RollAngle;
67
68 };
69
70
71 struct _MPOData {
72         guint mpo_offset;
73
74         guint version;
75         guint num_images;
76         MPOEntry *images;
77 };
78
79 MPOData* jpeg_get_mpo_data(const guchar *data, guint size);
80 void jpeg_mpo_data_free(MPOData *mpo);
81
82 #endif
83
84 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */