split jpeg parser functions to separate file
[geeqie.git] / src / jpeg_parser.h
1 #ifndef JPEG_PARSER_H
2 #define JPEG_PARSER_H
3
4 #define JPEG_MARKER             0xFF
5 #define JPEG_MARKER_SOI         0xD8
6 #define JPEG_MARKER_EOI         0xD9
7 #define JPEG_MARKER_APP1        0xE1
8 #define JPEG_MARKER_APP2        0xE2
9
10 /* jpeg container format:
11      all data markers start with 0XFF
12      2 byte long file start and end markers: 0xFFD8(SOI) and 0XFFD9(EOI)
13      4 byte long data segment markers in format: 0xFFTTSSSSNNN...
14        FF:   1 byte standard marker identifier
15        TT:   1 byte data type
16        SSSS: 2 bytes in Motorola byte alignment for length of the data.
17              This value includes these 2 bytes in the count, making actual
18              length of NN... == SSSS - 2.
19        NNN.: the data in this segment
20  */
21
22 gboolean jpeg_segment_find(guchar *data, guint size,
23                             guchar app_marker, const gchar *magic, guint magic_len,
24                             guint *seg_offset, guint *seg_length);
25
26 #endif