annotate src/format_raw.h @ 154:6bcd037bf176

fixed image focus
author nadvornik
date Sun, 09 Dec 2007 21:20:27 +0000
parents 71e1ebee420e
children 695e1ad3b169
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
1 /*
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
2 * GQView
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
3 * (C) 2005 John Ellis
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
4 *
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
5 * Authors:
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
6 * Original version 2005 Lars Ellenberg, base on dcraw by David coffin.
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
7 *
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
11 */
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
12
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
13 #ifndef __FORMAT_RAW_H
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
14 #define __FORMAT_RAW_H
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
15
51
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
16 #include "exif.h"
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
17
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
18
54
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
19 typedef enum {
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
20 FORMAT_RAW_MATCH_MAGIC,
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
21 FORMAT_RAW_MATCH_TIFF_MAKE
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
22 } FormatRawMatchType;
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
23
101
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
24 typedef enum {
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
25 FORMAT_RAW_EXIF_NONE,
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
26 FORMAT_RAW_EXIF_TIFF,
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
27 FORMAT_RAW_EXIF_JPEG,
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
28 FORMAT_RAW_EXIF_IFD_II,
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
29 FORMAT_RAW_EXIF_IFD_MM,
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
30 FORMAT_RAW_EXIF_PROPRIETARY
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
31 } FormatRawExifType;
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
32
54
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
33 typedef gint (* FormatRawParseFunc)(unsigned char *data, const guint len,
45
7cfa60beda76 Thu May 26 13:57:19 2005 John Ellis <johne@verizon.net>
gqview
parents: 43
diff changeset
34 guint *image_offset, guint *exif_offset);
7cfa60beda76 Thu May 26 13:57:19 2005 John Ellis <johne@verizon.net>
gqview
parents: 43
diff changeset
35
101
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
36 typedef gint (* FormatRawExifParseFunc)(unsigned char *data, const guint len,
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
37 ExifData *exif);
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
38
54
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
39 gint format_raw_img_exif_offsets(unsigned char *data, const guint len,
43
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
40 guint *image_offset, guint *exif_offset);
54
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
41 gint format_raw_img_exif_offsets_fd(int fd, const gchar *path,
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
42 unsigned char *header_data, const guint header_len,
45
7cfa60beda76 Thu May 26 13:57:19 2005 John Ellis <johne@verizon.net>
gqview
parents: 43
diff changeset
43 guint *image_offset, guint *exif_offset);
7cfa60beda76 Thu May 26 13:57:19 2005 John Ellis <johne@verizon.net>
gqview
parents: 43
diff changeset
44
101
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
45 FormatRawExifType format_raw_exif_offset(unsigned char *data, const guint len, guint *exif_offset,
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
46 FormatRawExifParseFunc *exif_parse_func);
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
47
43
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
48
51
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
49 typedef enum {
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
50 FORMAT_EXIF_MATCH_MAKE,
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
51 FORMAT_EXIF_MATCH_MAKERNOTE
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
52 } FormatExifMatchType;
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
53
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
54 typedef gint (* FormatExifParseFunc)(ExifData *exif, unsigned char *tiff, guint offset,
54
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
55 guint size, ExifByteOrder bo);
51
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
56
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
57 gint format_exif_makernote_parse(ExifData *exif, unsigned char *tiff, guint offset,
54
b58cac75ad12 Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents: 51
diff changeset
58 guint size, ExifByteOrder bo);
51
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
59
276ea4c98d33 Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents: 45
diff changeset
60
101
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
61 #define DEBUG_RAW_TIFF 0
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
62
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
63 #if DEBUG_RAW_TIFF
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
64
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
65 #define FORMAT_RAW_DEBUG_TIFF { "", \
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
66 FORMAT_RAW_MATCH_MAGIC, 0, "II", 2, \
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
67 FORMAT_RAW_EXIF_NONE, NULL, \
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
68 "Tiff debugger II", format_debug_tiff_raw }, \
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
69 { "", \
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
70 FORMAT_RAW_MATCH_MAGIC, 0, "MM", 2, \
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
71 FORMAT_RAW_EXIF_NONE, NULL, \
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
72 "Tiff debugger MM", format_debug_tiff_raw }
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
73
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
74 /* used for debugging only */
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
75 gint format_debug_tiff_raw(unsigned char *data, const guint len,
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
76 guint *image_offset, guint *exif_offset);
43
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
77 #endif
ee03f36e9e4b Sun May 15 21:40:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
diff changeset
78
101
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
79 #endif
847e4bc6b54c Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents: 54
diff changeset
80