2 GENERATED FILE, DO NOT EDIT
3 Generated from dcraw/dcraw.c at Sun Mar 15 13:33:55 2009
4 Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c)
5 for copyright information.
8 #line 28 "dcraw/dcraw.c"
10 #line 33 "dcraw/dcraw.c"
11 #define VERSION "8.93"
14 #define _USE_MATH_DEFINES
26 #include <sys/types.h>
31 NO_JPEG disables decoding of compressed Kodak DC120 files.
32 NO_LCMS disables the "-p" option.
42 #define _(String) gettext(String)
44 #define _(String) (String)
46 #line 76 "dcraw/dcraw.c"
51 #include <sys/utime.h>
53 #pragma comment(lib, "ws2_32.lib")
54 #define snprintf _snprintf
55 #define strcasecmp _stricmp
56 #define strncasecmp strnicmp
57 typedef __int64 INT64
;
58 typedef unsigned __int64 UINT64
;
62 #include <netinet/in.h>
63 typedef long long INT64
;
64 typedef unsigned long long UINT64
;
68 #error Please compile dcraw.c by itself.
69 #error Do not link it with ljpeg_decode.
73 #define LONG_BIT (8 * sizeof (long))
75 #line 170 "dcraw/dcraw.c"
76 #define FORC(cnt) for (c=0; c < cnt; c++)
79 #define FORCC FORC(colors)
81 #define SQR(x) ((x)*(x))
82 #define ABS(x) (((int)(x) ^ ((int)(x) >> 31)) - ((int)(x) >> 31))
83 #define MIN(a,b) ((a) < (b) ? (a) : (b))
84 #define MAX(a,b) ((a) > (b) ? (a) : (b))
85 #define LIM(x,min,max) MAX(min,MIN(x,max))
86 #define ULIM(x,y,z) ((y) < (z) ? LIM(x,y,z) : LIM(x,z,y))
87 #define CLIP(x) LIM(x,0,65535)
88 #define SWAP(a,b) { a ^= b; a ^= (b ^= a); }
91 In order to inline this calculation, I make the risky
92 assumption that all filter patterns can be described
93 by a repeating pattern of eight rows and two columns
95 Do not use the FC or BAYER macros with the Leaf CatchLight,
96 because its pattern is 16x16, not 2x8.
98 Return values are either 0/1/2/3 = G/M/C/Y or 0/1/2/3 = R/G1/B/G2
100 PowerShot 600 PowerShot A50 PowerShot Pro70 Pro90 & G1
101 0xe1e4e1e4: 0x1b4e4b1e: 0x1e4b4e1b: 0xb4b4b4b4:
103 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5
104 0 G M G M G M 0 C Y C Y C Y 0 Y C Y C Y C 0 G M G M G M
105 1 C Y C Y C Y 1 M G M G M G 1 M G M G M G 1 Y C Y C Y C
106 2 M G M G M G 2 Y C Y C Y C 2 C Y C Y C Y
107 3 C Y C Y C Y 3 G M G M G M 3 G M G M G M
108 4 C Y C Y C Y 4 Y C Y C Y C
109 PowerShot A5 5 G M G M G M 5 G M G M G M
110 0x1e4e1e4e: 6 Y C Y C Y C 6 C Y C Y C Y
111 7 M G M G M G 7 M G M G M G
118 All RGB cameras use one of these Bayer grids:
120 0x16161616: 0x61616161: 0x49494949: 0x94949494:
122 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5
123 0 B G B G B G 0 G R G R G R 0 G B G B G B 0 R G R G R G
124 1 G R G R G R 1 B G B G B G 1 R G R G R G 1 G B G B G B
125 2 B G B G B G 2 G R G R G R 2 G B G B G B 2 R G R G R G
126 3 G R G R G R 3 B G B G B G 3 R G R G R G 3 G B G B G B
129 #line 228 "dcraw/dcraw.c"
130 #define BAYER(row,col) \
131 image[((row) >> shrink)*iwidth + ((col) >> shrink)][FC(row,col)]
133 #define BAYER2(row,col) \
134 image[((row) >> shrink)*iwidth + ((col) >> shrink)][fc(row,col)]