source: trunk/include/camera.h @ 867

Revision 867, 83.4 KB checked in by fe50, 3 years ago (diff)
  • Property svn:eol-style set to native
Line 
1#ifndef CAMERA_H
2#define CAMERA_H
3
4//==========================================================
5// Camera-dependent settings
6//==========================================================
7
8//----------------------------------------------------------
9// Default values
10//----------------------------------------------------------
11    #undef  CAM_RAW_ROWPIX                  // Number of pixels in RAW row
12    #undef  CAM_RAW_ROWS                    // Number of rows in RAW
13   
14    #undef  CAM_DRYOS                       // Camera is DryOS-based
15    #undef  CAM_PROPSET                     // Camera's properties group (the generation)
16   
17    #undef  CAM_SWIVEL_SCREEN               // Camera has rotated LCD screen
18    #define CAM_USE_ZOOM_FOR_MF         1   // Zoom lever can be used for manual focus adjustments
19    #undef  CAM_ADJUSTABLE_ALT_BUTTON       // ALT-button can be set from menu
20    #define CAM_REMOTE                  1   // Camera supports USB-remote
21    #define CAM_SYNCH                   1   // Camera supports SDM precision synch
22    #undef  CAM_MULTIPART                   // Camera supports SD-card multipartitioning
23    #define CAM_HAS_ZOOM_LEVER          1   // Camera has dedicated zoom buttons
24    #undef  CAM_DRAW_EXPOSITION             // Output expo-pair on screen (for cameras which (sometimes) don't do that)
25    #define CAM_HAS_ERASE_BUTTON        1   // Camera has dedicated erase button
26    #define CAM_HAS_IRIS_DIAPHRAGM      1   // Camera has real diaphragm mechanism
27    #undef  CAM_HAS_ND_FILTER               // Camera has build-in ND filter
28    #define CAM_CAN_SD_OVER_NOT_IN_MF   1   // Camera allows subject distance (focus) override when not in manual focus mode
29    #define CAM_CAN_SD_OVERRIDE         1   // Camera allows to do subject distance override
30    #define CAM_HAS_MANUAL_FOCUS        1   // Camera has manual focus mode
31    #define CAM_HAS_USER_TV_MODES       1   // Camera has tv-priority or manual modes with ability to set tv value
32    #undef  CAM_SHOW_OSD_IN_SHOOT_MENU      // On some cameras Canon shoot menu has additional functionality and useful in this case to see CHDK OSD in this mode 
33    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO  1 // Camera can unlock optical zoom in video (if it is locked)
34    #undef  CAM_FEATURE_FEATHER             // Cameras with "feather" or touch wheel.
35    #define CAM_HAS_IS                  1   // Camera has image stabilizer
36    #undef  CAM_HAS_JOGDIAL                 // Camera has a "jog dial"
37
38    #undef  CAM_CONSOLE_LOG_ENABLED         // Development: internal camera stdout -> A/stdout.txt
39    #define CAM_CHDK_HAS_EXT_VIDEO_MENU 1   // In CHDK for this camera realized adjustable video compression
40    #undef  CAM_CAN_MUTE_MICROPHONE         // Camera has function to mute microphone
41
42    #define CAM_EMUL_KEYPRESS_DELAY     40  // Delay to interpret <alt>-button press as longpress
43    #define CAM_EMUL_KEYPRESS_DURATION  5   // Length of keypress emulation
44
45    #undef  CAM_AF_SCAN_DURING_VIDEO_RECORD // CHDK can make single AF scan during video record
46    #undef  CAM_HAS_VIDEO_BUTTON            // Camera can take stills in video mode, and vice versa
47    #undef  CAM_EV_IN_VIDEO                 // CHDK can change exposure in video mode
48    #define CAM_VIDEO_CONTROL      1   // pause / unpause video recordings
49
50    #define ZOOM_OVERRIDE               0   // Shall zoom-override be used? default 0 becoz not implemented right now
51    #undef  DNG_SUPPORT                 
52    #undef  CAM_REAR_CURTAIN                // Camera do not have front/rear curtain flash sync in menu
53    #undef  CAM_BRACKETING                // Cameras that have bracketing (focus & ev) in original firmware already, most likely s- & g-series (propcase for digic III not found yet!)
54    #undef  CAM_EXT_TV_RANGE             // CHDK can make exposure time longer than 64s
55
56    #define CAM_UNCACHED_BIT    0x10000000 // bit indicating the uncached memory
57
58    #define CAM_MAKE                    "Canon"
59    #define CAM_SENSOR_BITS_PER_PIXEL   10  // Bits per pixel. 10 is standard, 12 is supported except for curves
60    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
61    #define CAM_BLACK_LEVEL             31
62
63    #define CAM_BITMAP_PALETTE          1 // which color set is used for this camera
64               
65    #undef CAM_HAS_VARIABLE_ASPECT         // can switch between 16:9 and 4:3
66    #define DEFAULT_RAW_EXT             1  // extension to use for raw (see raw_exts in conf.c)
67
68    // by nandoide sept-2009
69    //zebra adjust buffer height: show use at sx200is: needed for save memory space
70    #define ZEBRA_HMARGIN0  0
71   
72    //aspect corrections
73    #define CAM_USES_ASPECT_CORRECTION   0   //if true, camera uses a modified graphics primitives to draw with exact display aspect-ratio.
74                                                                   // Could slow the graphics output (but not perceived on sx200is), but adds rectangle drawing optimizations to compensate.
75                                                                   // To extend to other cameras see sx200is camera.h comments in  and comments on core gui_draw.c
76    #define CAM_USES_ASPECT_YCORRECTION   0
77 
78    //menu, alt (default)
79    #define ASPECT_XCORRECTION(x)  ( ((x)<<1) )  //see comments on 200is
80    #define ASPECT_YCORRECTION(y)  ( (y) )         //no correction the same for coordinate y. I think there are no cameras actually needing both corrections.
81    //viewport, defaults used if there is no aspect correction
82//    #define ASPECT_VIEWPORT_XCORRECTION(x) ( ((x)<<1) ) // see comments on 200is
83    #define ASPECT_VIEWPORT_XCORRECTION(x) ( (x) ) // see comments on 200is
84    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )       //no correction
85    //grid - not used unless aspect correction is enabled, define as needed
86//    #define ASPECT_GRID_XCORRECTION(x) ( (x) )
87//    #define ASPECT_GRID_YCORRECTION(y) ( (y) )
88   
89   
90    #define EDGE_HMARGIN 0  //define sup and inf screen margins on edge overlay without overlay.  Necessary to save memory buffer space. sx200is needs values other than 0
91    // end of section by nandoid
92   
93    #undef CAM_QUALITY_OVERRIDE //camera may need shooting quality override (sx200is lacks SuperFine quality)
94//----------------------------------------------------------
95// Overridden values for each camera
96//----------------------------------------------------------
97
98//==========================================================
99// G-series
100//==========================================================
101#if   defined (CAMERA_g7)
102    #define CAM_PROPSET                 1
103
104    #define CAM_RAW_ROWPIX              3736   // for 10 MP
105    #define CAM_RAW_ROWS                2772   // for 10 MP
106   
107    #undef  CAM_USE_ZOOM_FOR_MF
108    #define CAM_ADJUSTABLE_ALT_BUTTON   1
109    #define CAM_MULTIPART               1
110    #define CAM_HAS_ND_FILTER           1
111    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
112        #define CAM_HAS_JOGDIAL             1
113    #define DNG_SUPPORT                 1
114    // pattern
115    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
116    // color
117    #define CAM_COLORMATRIX1                              \
118      575419, 1000000,-185557, 1000000, -77898,  1000000, \
119     -213702, 1000000, 733569, 1000000,   81514, 1000000, \
120      -24604, 1000000, 131906, 1000000,  280378, 1000000
121   
122    #define cam_CalibrationIlluminant1 1 // Daylight
123    // cropping
124    #define CAM_JPEG_WIDTH  3648
125    #define CAM_JPEG_HEIGHT 2736
126    #define CAM_ACTIVE_AREA_X1 14
127    #define CAM_ACTIVE_AREA_Y1 8
128    #define CAM_ACTIVE_AREA_X2 3682
129    #define CAM_ACTIVE_AREA_Y2 2764
130    // camera name
131    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
132    #define CAM_BRACKETING              1   
133    #define DNG_EXT_FROM ".DPS"
134 //----------------------------------------------------------
135#elif defined (CAMERA_g9)
136    #define CAM_PROPSET                 2
137    #define CAM_DRYOS                   1
138
139    #define CAM_RAW_ROWPIX              4104   // for 12 MP
140    #define CAM_RAW_ROWS                3048   // for 12 MP
141    #define CAM_HAS_ND_FILTER           1
142    #define CAM_ADJUSTABLE_ALT_BUTTON   1
143    #undef  CAM_EMUL_KEYPRESS_DURATION
144    #define CAM_EMUL_KEYPRESS_DURATION  10
145    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
146    #define CAM_HAS_JOGDIAL             1
147//      #define CAM_CONSOLE_LOG_ENABLED     1
148    #define CAM_BRACKETING              1
149    #define CAM_MULTIPART               1
150    #define CAM_EXT_TV_RANGE            1
151//==========================================================
152// A-series
153//==========================================================
154#elif defined (CAMERA_a450)
155    #define CAM_PROPSET                 2
156
157    #define CAM_RAW_ROWPIX              2664   // for 5 MP 1/3" sensor size
158    #define CAM_RAW_ROWS                1968   // for 5 MP 1/3" sensor size
159
160    #undef  CAM_USE_ZOOM_FOR_MF
161    #undef  CAM_HAS_ZOOM_LEVER
162    #define CAM_DRAW_EXPOSITION         1
163    #undef  CAM_HAS_ERASE_BUTTON
164    #undef  CAM_HAS_IRIS_DIAPHRAGM
165    #define CAM_HAS_ND_FILTER           1
166    #undef  CAM_HAS_MANUAL_FOCUS
167    #undef  CAM_HAS_USER_TV_MODES
168    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
169    #undef  CAM_HAS_IS
170    #define CAM_CAN_MUTE_MICROPHONE     1
171    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
172    #define CAM_EV_IN_VIDEO             1
173    #define DNG_SUPPORT                 1
174    // pattern
175    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
176    // color
177    #define CAM_COLORMATRIX1                               \
178      652279,  1000000,-199279, 1000000, -101833, 1000000, \
179     -159819,  1000000, 619308, 1000000,   78172, 1000000, \
180      -58827,  1000000, 150963, 1000000,  264216, 1000000
181   
182    #define cam_CalibrationIlluminant1 1 // Daylight
183    // cropping
184    #define CAM_JPEG_WIDTH  2592
185    #define CAM_JPEG_HEIGHT 1944
186    #define CAM_ACTIVE_AREA_X1 6
187    #define CAM_ACTIVE_AREA_Y1 6
188    #define CAM_ACTIVE_AREA_X2 2618
189    #define CAM_ACTIVE_AREA_Y2 1962
190    // camera name
191    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
192
193   
194//----------------------------------------------------------
195#elif defined (CAMERA_a460)
196    #define CAM_PROPSET                 2
197
198    #define CAM_RAW_ROWPIX              2664   // for 5 MP 1/3" sensor size
199    #define CAM_RAW_ROWS                1968   // for 5 MP 1/3" sensor size
200
201    #undef  CAM_USE_ZOOM_FOR_MF
202    #undef  CAM_HAS_ZOOM_LEVER
203    #define CAM_DRAW_EXPOSITION         1
204    #undef  CAM_HAS_ERASE_BUTTON
205    #undef  CAM_HAS_IRIS_DIAPHRAGM
206    #define CAM_HAS_ND_FILTER           1
207    #undef  CAM_HAS_MANUAL_FOCUS
208    #undef  CAM_HAS_USER_TV_MODES
209    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
210    #undef  CAM_HAS_IS
211    #define CAM_CAN_MUTE_MICROPHONE     1
212    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
213    #define CAM_EV_IN_VIDEO             1
214    #define DNG_SUPPORT                 1
215    // pattern
216    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
217    // color
218    #define CAM_COLORMATRIX1                               \
219      649324,  1000000,-233893, 1000000, -88521, 1000000,  \
220     -158955,  1000000, 593407, 1000000,  69775, 1000000,  \
221      -44551,  1000000, 136891, 1000000, 254362, 1000000   
222   
223    #define cam_CalibrationIlluminant1 1 // Daylight
224    // cropping
225    #define CAM_JPEG_WIDTH  2592
226    #define CAM_JPEG_HEIGHT 1944
227    #define CAM_ACTIVE_AREA_X1 6
228    #define CAM_ACTIVE_AREA_Y1 6
229    #define CAM_ACTIVE_AREA_X2 2618
230    #define CAM_ACTIVE_AREA_Y2 1962
231    // camera name
232    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
233    #define DNG_EXT_FROM ".DPS"
234
235//----------------------------------------------------------
236#elif defined (CAMERA_a470)
237        #define CAM_PROPSET                 2
238        #define CAM_DRYOS                   1
239
240    #define CAM_RAW_ROWPIX              3152   // for 7 MP
241    #define CAM_RAW_ROWS                2340   // for 7 MP
242
243        #undef  CAM_USE_ZOOM_FOR_MF
244        #undef  CAM_HAS_ZOOM_LEVER
245        #undef  CAM_HAS_ERASE_BUTTON
246        #undef  CAM_HAS_IRIS_DIAPHRAGM
247        #define CAM_HAS_ND_FILTER           1
248        #undef  CAM_HAS_MANUAL_FOCUS
249        #undef  CAM_HAS_USER_TV_MODES
250        #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
251        #undef  CAM_HAS_IS
252        #define CAM_CAN_MUTE_MICROPHONE     1
253        #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
254        #define CAM_EV_IN_VIDEO             1
255        #define DNG_SUPPORT                 1
256        #define CAM_MULTIPART               1
257       
258    // pattern
259    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
260    // color
261    #define CAM_COLORMATRIX1                             \
262        673251,  1000000,-200684, 1000000, -98680, 1000000,  \
263        -163638, 1000000, 651247, 1000000,  74004, 1000000,  \
264        14221,   1000000, 52979,  1000000, 265291, 1000000   
265    #define cam_CalibrationIlluminant1 1 // Daylight
266    // cropping
267        #define CAM_JPEG_WIDTH  3096
268        #define CAM_JPEG_HEIGHT 2324
269        #define CAM_ACTIVE_AREA_X1 12
270        #define CAM_ACTIVE_AREA_Y1 8
271        #define CAM_ACTIVE_AREA_X2 3108
272        #define CAM_ACTIVE_AREA_Y2 2332
273    // camera name
274    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
275    //#define DNG_EXT_FROM ".DPS"       
276       
277//----------------------------------------------------------
278#elif defined (CAMERA_a530)
279    #define CAM_PROPSET                 1
280
281//  2672x1968 image - like most other 5m sensors
282    #define CAM_RAW_ROWPIX              2672   // for 5 MP
283    #define CAM_RAW_ROWS                1968   // for 5 MP
284//  2672x1992 image - eventually probably real sensor size
285//  #define CAM_RAW_ROWPIX              2672   // for 5 MP
286//  #define CAM_RAW_ROWS                1992   // for 5 MP
287
288    #undef  CAM_USE_ZOOM_FOR_MF
289    #define CAM_HAS_ERASE_BUTTON        1
290    #undef  CAM_HAS_IRIS_DIAPHRAGM
291    #define CAM_HAS_ND_FILTER           1
292    #define CAM_HAS_MANUAL_FOCUS        1
293    #define CAM_DRAW_EXPOSITION         1
294    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
295    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
296    #undef  CAM_HAS_IS
297    #define CAM_CAN_MUTE_MICROPHONE     1
298    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
299    #define CAM_EV_IN_VIDEO             1
300    #define DNG_SUPPORT                 1
301    // pattern
302    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
303    // color
304    #define CAM_COLORMATRIX1                               \
305      725264,  1000000,-240542, 1000000, -122310, 1000000, \
306     -210248,  1000000, 656077, 1000000,  52390,  1000000, \
307      -11282,  1000000, 70400,  1000000,  300712, 1000000
308   
309    #define cam_CalibrationIlluminant1 1 // Daylight
310    // cropping
311    #define CAM_JPEG_WIDTH  2592
312    #define CAM_JPEG_HEIGHT 1944
313    #define CAM_ACTIVE_AREA_X1 12
314    #define CAM_ACTIVE_AREA_Y1 20
315    #define CAM_ACTIVE_AREA_X2 2628
316    #define CAM_ACTIVE_AREA_Y2 1968
317    // camera name
318    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
319    #define DNG_EXT_FROM ".DPS"
320
321    #define CAM_EXT_TV_RANGE            1
322
323//----------------------------------------------------------
324#elif defined (CAMERA_a540)
325    #define CAM_PROPSET                 1
326
327    #define CAM_RAW_ROWPIX              2888   // for 6 MP
328    #define CAM_RAW_ROWS                2136   // for 6 MP
329
330    #undef  CAM_USE_ZOOM_FOR_MF
331    #define CAM_HAS_ERASE_BUTTON        1
332    #define CAM_HAS_IRIS_DIAPHRAGM      1
333    #undef  CAM_HAS_ND_FILTER
334    #define CAM_HAS_MANUAL_FOCUS        1
335    #undef  CAM_DRAW_EXPOSITION
336    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
337    #undef  CAM_HAS_IS
338    #define CAM_CAN_MUTE_MICROPHONE     1
339    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
340    #define CAM_EV_IN_VIDEO             1
341    #define DNG_SUPPORT                 1
342    // pattern
343    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
344    // color
345    #define CAM_COLORMATRIX1                               \
346      687147,  1000000,-201964, 1000000, -125024, 1000000, \
347     -148403,  1000000, 566810, 1000000,   45401, 1000000, \
348     -9472,    1000000, 63186,  1000000,  208602, 1000000
349   
350    #define cam_CalibrationIlluminant1 1 // Daylight
351    // cropping
352    #define CAM_JPEG_WIDTH  2816
353    #define CAM_JPEG_HEIGHT 2112
354    #define CAM_ACTIVE_AREA_X1 44
355    #define CAM_ACTIVE_AREA_Y1 8
356    #define CAM_ACTIVE_AREA_X2 2884
357    #define CAM_ACTIVE_AREA_Y2 2136
358    // camera name
359    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
360    #define DNG_EXT_FROM ".DPS"
361
362    #define CAM_EXT_TV_RANGE            1
363
364//----------------------------------------------------------
365#elif defined (CAMERA_a550)
366    #define CAM_PROPSET                 2
367
368    #define CAM_RAW_ROWPIX              3152   // for 7 MP
369    #define CAM_RAW_ROWS                2340   // for 7 MP
370
371    #undef  CAM_USE_ZOOM_FOR_MF
372    #define CAM_MULTIPART               1
373    #undef  CAM_HAS_ERASE_BUTTON
374    #undef  CAM_HAS_IRIS_DIAPHRAGM
375    #define CAM_HAS_ND_FILTER           1
376    #undef  CAM_HAS_MANUAL_FOCUS
377    #undef  CAM_HAS_USER_TV_MODES
378    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
379    #undef  CAM_HAS_IS
380    #define CAM_CAN_MUTE_MICROPHONE     1
381    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
382    #define DNG_SUPPORT                 1
383    // pattern
384    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
385    // color
386    #define CAM_COLORMATRIX1                               \
387      673251,  1000000,-200684, 1000000, -98680, 1000000,  \
388     -163638,  1000000, 651247, 1000000,  74004, 1000000,  \
389      14221,   1000000, 52979,  1000000, 265291, 1000000
390   
391    #define cam_CalibrationIlluminant1 1 // Daylight
392    // cropping
393    #define CAM_JPEG_WIDTH  3072
394    #define CAM_JPEG_HEIGHT 2304
395    #define CAM_ACTIVE_AREA_X1 36
396    #define CAM_ACTIVE_AREA_Y1 12
397    #define CAM_ACTIVE_AREA_X2 3148
398    #define CAM_ACTIVE_AREA_Y2 2340
399    // camera name
400    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
401    #define DNG_EXT_FROM ".DPS"
402
403    #define CAM_EXT_TV_RANGE            1
404   
405//----------------------------------------------------------
406#elif defined (CAMERA_a560)
407    #define CAM_PROPSET                 2
408
409    #define CAM_RAW_ROWPIX              3152   // for 7 MP
410    #define CAM_RAW_ROWS                2340   // for 7 MP
411
412    #undef  CAM_USE_ZOOM_FOR_MF
413    #define CAM_MULTIPART               1
414    #undef  CAM_HAS_ERASE_BUTTON
415    #undef  CAM_HAS_IRIS_DIAPHRAGM
416    #define CAM_HAS_ND_FILTER           1
417    #undef  CAM_HAS_MANUAL_FOCUS
418    #undef  CAM_HAS_USER_TV_MODES
419    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
420    #undef  CAM_HAS_IS
421    #define CAM_CAN_MUTE_MICROPHONE     1
422    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
423    #define DNG_SUPPORT                 1
424    // pattern
425    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
426    // color
427    #define CAM_COLORMATRIX1                               \
428      15265, 1, -6193, 1, -1558, 1,                        \
429     -4125,  1, 12116, 1,  2010, 1,                        \
430     -888,   1, 1639,  1,  5220, 1                         
431   
432    #define cam_CalibrationIlluminant1 17 // Standard light A
433    // cropping
434    #define CAM_JPEG_WIDTH  3072
435    #define CAM_JPEG_HEIGHT 2304
436    #define CAM_ACTIVE_AREA_X1 38
437    #define CAM_ACTIVE_AREA_Y1 14
438    #define CAM_ACTIVE_AREA_X2 3146
439    #define CAM_ACTIVE_AREA_Y2 2338
440    // camera name
441    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
442    #define DNG_EXT_FROM ".DPS"
443   
444    #define CAM_EXT_TV_RANGE            1
445
446//----------------------------------------------------------
447#elif defined (CAMERA_a570)
448    #define CAM_PROPSET                 2
449
450    #define CAM_RAW_ROWPIX              3152   // for 7 MP
451    #define CAM_RAW_ROWS                2340   // for 7 MP
452    #define CAM_MULTIPART               1
453    #define CAM_CAN_MUTE_MICROPHONE     1
454    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
455    #define CAM_EV_IN_VIDEO             1
456    #define DNG_SUPPORT                 1
457    #define CAM_REAR_CURTAIN            1
458    // pattern
459    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
460    // color
461    #define CAM_COLORMATRIX1                               \
462      528283,  1000000,-144259, 1000000, -85966, 1000000,  \
463     -202789,  1000000, 736563, 1000000,  73008, 1000000,  \
464     -27130,   1000000, 107702, 1000000, 264543, 1000000
465   
466    #define cam_CalibrationIlluminant1 1 // Daylight
467    // cropping
468    #define CAM_JPEG_WIDTH  3072
469    #define CAM_JPEG_HEIGHT 2304
470    #define CAM_ACTIVE_AREA_X1 38
471    #define CAM_ACTIVE_AREA_Y1 14
472    #define CAM_ACTIVE_AREA_X2 3146
473    #define CAM_ACTIVE_AREA_Y2 2338
474    // camera name
475    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
476
477    #define DNG_EXT_FROM ".DPS"
478    #define CAM_EXT_TV_RANGE            1
479
480//----------------------------------------------------------
481#elif defined (CAMERA_a590)
482#define CAM_PROPSET                 2
483#define CAM_DRYOS                   1
484
485#define CAM_RAW_ROWPIX              3336   // for new 8 MP
486#define CAM_RAW_ROWS                2480   // for new 8 MP
487
488#define CAM_USE_ZOOM_FOR_MF         1
489
490// cannot mute during video-zoom through CHDK, it can mute in general firmware settings (non CHDK)
491#undef  CAM_CAN_MUTE_MICROPHONE            // Camera has no function to mute microphone
492
493#define CAM_HAS_IRIS_DIAPHRAGM      1
494#undef  CAM_HAS_ND_FILTER
495
496#define CAM_HAS_MANUAL_FOCUS        1
497
498#define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
499//#define CAM_EV_IN_VIDEO             1      // not working on 101b!!!
500#define DNG_SUPPORT                 1
501// pattern
502#define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
503// color                                                     
504#define CAM_COLORMATRIX1                              \
505 726857, 1000000, -176454, 1000000, -124118, 1000000, \
506 -71340, 1000000,  592001, 1000000,   75622, 1000000, \
507  63222, 1000000,   50547, 1000000,  219582, 1000000
508
509#define cam_CalibrationIlluminant1 1 // Daylight
510// cropping
511#define CAM_JPEG_WIDTH  3264
512#define CAM_JPEG_HEIGHT 2448
513#define CAM_ACTIVE_AREA_X1 12
514#define CAM_ACTIVE_AREA_Y1 10
515// note: the above contains some pixels which have valid data,
516// but are not at the same levels as the rest of the frame
517// the values below crop the "different" looking pixels.
518//#define CAM_ACTIVE_AREA_X1 16
519//#define CAM_ACTIVE_AREA_Y1 18
520#define CAM_ACTIVE_AREA_X2 3300
521#define CAM_ACTIVE_AREA_Y2 2480
522
523// camera name
524#define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
525
526#define CAM_EXT_TV_RANGE            1
527#define CAM_MULTIPART               1
528
529//----------------------------------------------------------
530#elif defined (CAMERA_a610)
531    #define CAM_PROPSET                 1
532
533    #define CAM_RAW_ROWPIX              2672   // for 5 MP
534    #define CAM_RAW_ROWS                1968   // for 5 MP
535   
536    #define CAM_SWIVEL_SCREEN           1
537    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
538    #undef  CAM_HAS_IS
539    #define CAM_CAN_MUTE_MICROPHONE     1
540    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
541    #define CAM_EV_IN_VIDEO             1
542    #define DNG_SUPPORT                 1
543    // pattern
544    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
545    // color
546    #define CAM_COLORMATRIX1                               \
547      15887,  10000, -6524, 10000, -1622, 10000,           \
548     -5467,   10000, 13449, 10000,  2209, 10000,           \
549     -1325,   10000, 1859,  10000,  5172, 10000
550   
551    #define cam_CalibrationIlluminant1 17 // Standard light A
552    // cropping
553    #define CAM_JPEG_WIDTH  2592
554    #define CAM_JPEG_HEIGHT 1944
555    #define CAM_ACTIVE_AREA_X1 14
556    #define CAM_ACTIVE_AREA_Y1 10
557    #define CAM_ACTIVE_AREA_X2 2626
558    #define CAM_ACTIVE_AREA_Y2 1966
559    // camera name
560    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
561
562    #define DNG_EXT_FROM ".DPS"
563
564
565//----------------------------------------------------------
566#elif defined (CAMERA_a620)
567    #define CAM_PROPSET                 1
568
569    #define CAM_RAW_ROWPIX              3152   // for 7 MP
570    #define CAM_RAW_ROWS                2340   // for 7 MP
571   
572    #define CAM_SWIVEL_SCREEN           1
573    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
574    #undef  CAM_HAS_IS   
575    #define CAM_CAN_MUTE_MICROPHONE     1
576    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
577    #define CAM_EV_IN_VIDEO             1
578    #define DNG_SUPPORT                 1
579    // pattern
580    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
581    // color
582    #define CAM_COLORMATRIX1                               \
583     15265, 10000, -6193, 10000, -1558, 10000,             \
584     -4125, 10000, 12116, 10000,  2010, 10000,             \
585     -888,  10000,  1639, 10000,  5220, 10000
586   
587    #define cam_CalibrationIlluminant1 17 // Standard light A
588    // cropping
589    #define CAM_JPEG_WIDTH  3072
590    #define CAM_JPEG_HEIGHT 2304
591    #define CAM_ACTIVE_AREA_X1 38
592    #define CAM_ACTIVE_AREA_Y1 14
593    #define CAM_ACTIVE_AREA_X2 3146
594    #define CAM_ACTIVE_AREA_Y2 2338
595    // camera name
596    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
597    #define DNG_EXT_FROM ".DPS"
598
599//----------------------------------------------------------
600#elif defined (CAMERA_a630)
601    #define CAM_PROPSET                 1
602
603    #define CAM_RAW_ROWPIX              3344   // for 8 MP
604    #define CAM_RAW_ROWS                2484   // for 8 MP
605   
606    #define CAM_SWIVEL_SCREEN           1
607    #define CAM_MULTIPART               1
608    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
609    #undef  CAM_HAS_IS
610    #define CAM_CAN_MUTE_MICROPHONE     1
611    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
612    #define CAM_EV_IN_VIDEO             1
613    #define DNG_SUPPORT                 1
614    // pattern
615    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
616    // color
617    #define CAM_COLORMATRIX1                               \
618      656080,  1000000,-226478, 1000000, -85884, 1000000,  \
619     -194636,  1000000, 687905, 1000000,  37862, 1000000,  \
620       22873,  1000000,  75523, 1000000, 265822, 1000000
621   
622    #define cam_CalibrationIlluminant1 1 // Daylight
623    // cropping
624    #define CAM_JPEG_WIDTH  3264
625    #define CAM_JPEG_HEIGHT 2448
626    #define CAM_ACTIVE_AREA_X1 14
627    #define CAM_ACTIVE_AREA_Y1 8
628    #define CAM_ACTIVE_AREA_X2 3298
629    #define CAM_ACTIVE_AREA_Y2 2476
630    // camera name
631    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
632    #define DNG_EXT_FROM ".DPS"
633    #define CAM_EXT_TV_RANGE            1
634
635//----------------------------------------------------------
636#elif defined (CAMERA_a640)
637    #define CAM_PROPSET                 1
638
639    #define CAM_RAW_ROWPIX              3736   // for 10 MP
640    #define CAM_RAW_ROWS                2772   // for 10 MP
641   
642    #define CAM_SWIVEL_SCREEN           1
643    #define CAM_MULTIPART               1
644    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
645    #undef  CAM_HAS_IS
646    #define CAM_CAN_MUTE_MICROPHONE     1
647    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
648    #define CAM_EV_IN_VIDEO             1
649    #define DNG_SUPPORT                 1
650    // pattern
651    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
652    // color
653    #define CAM_COLORMATRIX1                               \
654      13124,  10000, -5329, 10000, -1390, 10000,           \
655      -3602,  10000, 11658, 10000,  1944, 10000,           \
656      -1612,  10000,  2863, 10000,  4885, 10000
657   
658    #define cam_CalibrationIlluminant1 17 // Standard light A
659    // cropping
660    #define CAM_JPEG_WIDTH  3648
661    #define CAM_JPEG_HEIGHT 2736
662    #define CAM_ACTIVE_AREA_X1 14
663    #define CAM_ACTIVE_AREA_Y1 8
664    #define CAM_ACTIVE_AREA_X2 3682
665    #define CAM_ACTIVE_AREA_Y2 2764
666    // camera name
667    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
668    #define DNG_EXT_FROM ".DPS"
669
670//----------------------------------------------------------
671#elif defined (CAMERA_a650)
672    #define CAM_PROPSET                 2
673    #define CAM_DRYOS                   1
674
675    #define CAM_RAW_ROWPIX              4104   // for 12 MP
676    #define CAM_RAW_ROWS                3048   // for 12 MP
677   
678    #define CAM_ADJUSTABLE_ALT_BUTTON   1
679    #define CAM_SWIVEL_SCREEN           1
680    #define CAM_CAN_MUTE_MICROPHONE     1
681
682    #undef  CAM_EMUL_KEYPRESS_DURATION
683    #define CAM_EMUL_KEYPRESS_DURATION  10
684    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
685    #define CAM_EV_IN_VIDEO             1
686    #define DNG_SUPPORT                 1
687    // pattern
688    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
689    // color
690    #define CAM_COLORMATRIX1                               \
691      913762, 1000000, -261578, 1000000, -135582, 1000000, \
692     -99049,  1000000, 1067089, 1000000,   61442, 1000000, \
693      48717,  1000000, 96802,   1000000,  412056, 1000000
694   
695    #define cam_CalibrationIlluminant1 1 // Daylight
696    // cropping
697    #define CAM_JPEG_WIDTH  4000
698    #define CAM_JPEG_HEIGHT 3000
699    #define CAM_ACTIVE_AREA_X1 52
700    #define CAM_ACTIVE_AREA_Y1 14
701    #define CAM_ACTIVE_AREA_X2 4076
702    #define CAM_ACTIVE_AREA_Y2 3030
703    // camera name
704    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
705
706    #define DNG_EXT_FROM ".CR2"
707
708//----------------------------------------------------------
709#elif defined (CAMERA_a700)
710    #define CAM_PROPSET                 1
711
712    #define CAM_RAW_ROWPIX              2888   // for 6 MP
713    #define CAM_RAW_ROWS                2136   // for 6 MP
714
715    #undef  CAM_HAS_IS
716    #define CAM_CAN_MUTE_MICROPHONE     1
717    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
718    #define CAM_EV_IN_VIDEO             1
719    #define DNG_SUPPORT                 1
720    // pattern
721    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
722    // color
723    #define CAM_COLORMATRIX1                               \
724     14062, 10000, -5199, 10000, -1446, 10000,             \
725     -4712, 10000, 12470, 10000,  2243, 10000,             \
726     -1286, 10000,  2028, 10000,  4836, 10000
727   
728    #define cam_CalibrationIlluminant1 17 // Standard light A
729    // cropping
730    #define CAM_JPEG_WIDTH  2816
731    #define CAM_JPEG_HEIGHT 2112
732    #define CAM_ACTIVE_AREA_X1 44
733    #define CAM_ACTIVE_AREA_Y1 8
734    #define CAM_ACTIVE_AREA_X2 2884
735    #define CAM_ACTIVE_AREA_Y2 2136
736    // camera name
737    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
738    #define DNG_EXT_FROM ".DPS"
739
740//----------------------------------------------------------
741#elif defined (CAMERA_a710)
742    #define CAM_PROPSET                 1
743
744    #define CAM_RAW_ROWPIX              3152   // for 7 MP
745    #define CAM_RAW_ROWS                2340   // for 7 MP
746
747    #define CAM_MULTIPART               1
748    #define CAM_CAN_MUTE_MICROPHONE     1
749    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
750    #define CAM_EV_IN_VIDEO             1
751    #define DNG_SUPPORT                 1
752    // pattern
753    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
754    // color
755    #define CAM_COLORMATRIX1                   \
756     13349, 10000, -4141, 10000, -2128, 10000, \
757     -4189, 10000, 13178, 10000,  1044, 10000, \
758     -1037, 10000,  2326, 10000,  4720, 10000   
759   
760    #define cam_CalibrationIlluminant1 1 // Daylight
761    // cropping
762    #define CAM_JPEG_WIDTH  3072
763    #define CAM_JPEG_HEIGHT 2304
764    #define CAM_ACTIVE_AREA_X1 38
765    #define CAM_ACTIVE_AREA_Y1 14
766    #define CAM_ACTIVE_AREA_X2 3146
767    #define CAM_ACTIVE_AREA_Y2 2338
768    // camera name
769    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
770
771    #define DNG_EXT_FROM ".DPS"
772
773    #define CAM_EXT_TV_RANGE            1
774
775//----------------------------------------------------------
776#elif defined (CAMERA_a720)
777    #define CAM_PROPSET                 2
778    #define CAM_DRYOS                   1
779
780    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
781    #define CAM_RAW_ROWS                2480   // for new 8 MP
782    #define CAM_CAN_MUTE_MICROPHONE     1
783    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
784    #define CAM_EV_IN_VIDEO             1
785    #undef  CAM_VIDEO_CONTROL
786    #define DNG_SUPPORT                 1
787    // pattern
788    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
789    // color
790    #define CAM_COLORMATRIX1                               \
791      640019, 1000000, -220031, 1000000, -96241, 1000000,  \
792     -77419,  1000000, 639766,  1000000,  44009, 1000000,  \
793      17965,  1000000, 78396,   1000000, 231868, 1000000
794   
795    #define cam_CalibrationIlluminant1 1 // Daylight
796    // cropping
797    #define CAM_JPEG_WIDTH  3264
798    #define CAM_JPEG_HEIGHT 2448
799    #define CAM_ACTIVE_AREA_X1 10
800    #define CAM_ACTIVE_AREA_Y1 8
801    #define CAM_ACTIVE_AREA_X2 3302
802    #define CAM_ACTIVE_AREA_Y2 2474
803    // camera name
804    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
805
806    #define DNG_EXT_FROM ".CR2"
807
808//----------------------------------------------------------
809#elif defined (CAMERA_a2000)
810
811                ////////////////////////////////
812                // Sure values
813                ////////////////////////////////
814    #define CAM_MAKE                    "Canon"
815    #define CAM_PROPSET                 2
816    #define CAM_DRYOS                   1
817
818    #define CAM_RAW_ROWPIX              3720 
819    #define CAM_RAW_ROWS                2772 
820
821    #define CAM_JPEG_WIDTH  3648
822    #define CAM_JPEG_HEIGHT 2736
823   
824    #define DNG_SUPPORT                 1
825
826    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
827
828    #undef  CAM_HAS_IRIS_DIAPHRAGM
829    #define CAM_HAS_ND_FILTER           1
830
831    ////////////////////////////////
832    // Almost sure, sensor data taken from
833    // ixus870_sd880 which should have same sensor..
834    ////////////////////////////////
835    #undef CAM_SENSOR_BITS_PER_PIXEL
836    #undef CAM_WHITE_LEVEL
837    #undef CAM_BLACK_LEVEL
838    #define CAM_SENSOR_BITS_PER_PIXEL   12
839    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
840    #define CAM_BLACK_LEVEL             127
841   
842    #define cam_CFAPattern              0x02010100 // Red  Green  Green  Blue
843    #define CAM_COLORMATRIX1                               \
844      827547, 1000000, -290458, 1000000, -126086, 1000000, \
845     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
846      5181,   1000000, 48183,   1000000, 245014,  1000000
847    #define cam_CalibrationIlluminant1  1 // Daylight
848
849    // cropping (from ixus870_sd880)
850    #define CAM_ACTIVE_AREA_X1          14
851    #define CAM_ACTIVE_AREA_Y1          8
852    #define CAM_ACTIVE_AREA_X2          3682
853    #define CAM_ACTIVE_AREA_Y2          2764
854
855    #undef  CAM_HAS_MANUAL_FOCUS
856// for the purposes of CHDK, the FACE button is treated as the erase button
857//    #undef  CAM_HAS_ERASE_BUTTON
858
859//==========================================================
860// SD-Series (IXUS-Series)
861//==========================================================
862#elif defined (CAMERA_ixus40_sd300)
863    #define CAM_PROPSET                 1
864
865    #define CAM_RAW_ROWPIX              2400
866    #define CAM_RAW_ROWS                1766
867
868    #define CAM_USE_ZOOM_FOR_MF 1
869    #undef  CAM_HAS_ERASE_BUTTON
870    #undef  CAM_HAS_IRIS_DIAPHRAGM
871    #define CAM_HAS_ND_FILTER           1
872    #undef  CAM_HAS_MANUAL_FOCUS
873    #undef  CAM_HAS_USER_TV_MODES
874    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
875    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
876    #undef  CAM_HAS_IS
877    #undef CAM_CONSOLE_LOG_ENABLED
878
879
880    #define DNG_SUPPORT                 1
881    // pattern
882    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
883    // color
884    #define CAM_COLORMATRIX1                                 \
885      652674,  1000000, -172074, 1000000, -107575,  1000000, \
886      -139063, 1000000, 594517,  1000000,  60252,   1000000, \
887      -9088,   1000000, 82013,   1000000,  238080,  1000000
888   
889    #define cam_CalibrationIlluminant1 1 // Daylight
890    // cropping
891    #define CAM_JPEG_WIDTH  2272
892    #define CAM_JPEG_HEIGHT 1704
893    #define CAM_ACTIVE_AREA_X1 12
894    #define CAM_ACTIVE_AREA_Y1 12
895    #define CAM_ACTIVE_AREA_X2 2356
896    #define CAM_ACTIVE_AREA_Y2 1764
897    // camera name
898    #define PARAM_CAMERA_NAME 2 // parameter number for GetParameterData
899
900//----------------------------------------------------------
901
902#elif defined (CAMERA_ixus50_sd400)
903    #define CAM_PROPSET                 1
904
905    #define CAM_RAW_ROWPIX              2672   // for 5 MP
906    #define CAM_RAW_ROWS                1968   // for 5 MP
907
908    #undef  CAM_SYNCH 
909    #undef  CAM_USE_ZOOM_FOR_MF
910    #undef  CAM_HAS_ERASE_BUTTON
911    #undef  CAM_HAS_IRIS_DIAPHRAGM
912    #define CAM_HAS_ND_FILTER           1
913    #undef  CAM_HAS_MANUAL_FOCUS
914    #undef  CAM_HAS_USER_TV_MODES
915    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
916    #undef  CAM_HAS_IS
917        //#define CAM_CONSOLE_LOG_ENABLED     1
918    #undef  CAM_VIDEO_CONTROL
919    #define DNG_SUPPORT                 1
920    // pattern
921    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
922    // color
923    #define CAM_COLORMATRIX1                                  \
924      685247,  1000000, -204939,  1000000, -106531,  1000000, \
925     -267616,  1000000,  790509,  1000000,   73359,  1000000, \
926       32401,  1000000,   15655,  1000000,  314892,  1000000
927   
928    #define cam_CalibrationIlluminant1 1 // Daylight
929    // cropping
930    #define CAM_JPEG_WIDTH  2592
931    #define CAM_JPEG_HEIGHT 1944
932    #define CAM_ACTIVE_AREA_X1 12
933    #define CAM_ACTIVE_AREA_Y1 8
934    #define CAM_ACTIVE_AREA_X2 2628
935    #define CAM_ACTIVE_AREA_Y2 1968
936    // camera name
937    #define PARAM_CAMERA_NAME 2 // parameter number for GetParameterData
938
939
940//----------------------------------------------------------
941
942#elif defined (CAMERA_ixusizoom_sd30)
943    #define CAM_PROPSET                 1
944
945    #define CAM_RAW_ROWPIX              2672   // for 5 MP
946    #define CAM_RAW_ROWS                1968   // for 5 MP
947
948    #undef  CAM_SYNCH 
949    #undef  CAM_USE_ZOOM_FOR_MF
950    #undef  CAM_HAS_ERASE_BUTTON
951    #undef  CAM_HAS_IRIS_DIAPHRAGM
952    #define CAM_HAS_ND_FILTER           1
953    #undef  CAM_HAS_MANUAL_FOCUS
954    #undef  CAM_HAS_USER_TV_MODES
955    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
956    #undef  CAM_HAS_IS
957        //#define CAM_CONSOLE_LOG_ENABLED     1
958    #undef  CAM_VIDEO_CONTROL
959
960//----------------------------------------------------------
961
962//----------------------------------------------------------
963#elif defined (CAMERA_ixus55_sd450)
964    #define CAM_PROPSET                 1
965
966    #define CAM_RAW_ROWPIX              2672   // for 5 MP
967    #define CAM_RAW_ROWS                1968   // for 5 MP
968
969    #undef  CAM_USE_ZOOM_FOR_MF
970    #undef  CAM_HAS_ERASE_BUTTON
971    #undef  CAM_HAS_IRIS_DIAPHRAGM
972    #define CAM_HAS_ND_FILTER           1
973    #undef  CAM_HAS_MANUAL_FOCUS
974    #undef  CAM_HAS_USER_TV_MODES
975    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
976    #undef  CAM_HAS_IS
977    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
978    #define DNG_SUPPORT                 1
979    // pattern
980    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
981    // color
982    #define CAM_COLORMATRIX1                                \
983      536034,  1000000, -173429, 1000000, -89823,  1000000, \
984      -290416, 1000000, 735807,  1000000,  47894,  1000000, \
985      -71455,  1000000, 114314,  1000000,  274533, 1000000         
986   
987    #define cam_CalibrationIlluminant1 1 // Daylight
988    // cropping
989    #define CAM_JPEG_WIDTH  2592
990    #define CAM_JPEG_HEIGHT 1944
991    #define CAM_ACTIVE_AREA_X1 12
992    #define CAM_ACTIVE_AREA_Y1 8
993    #define CAM_ACTIVE_AREA_X2 2628
994    #define CAM_ACTIVE_AREA_Y2 1968
995    // camera name
996    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
997    #define DNG_EXT_FROM ".DPS"
998
999//----------------------------------------------------------
1000#elif defined (CAMERA_ixus60_sd600)
1001    #define CAM_PROPSET                 1
1002
1003    #define CAM_RAW_ROWPIX              2888   // for 6 MP
1004    #define CAM_RAW_ROWS                2136   // for 6 MP
1005
1006    #undef  CAM_SYNCH
1007    #undef  CAM_USE_ZOOM_FOR_MF
1008    #undef  CAM_HAS_ERASE_BUTTON
1009    #undef  CAM_HAS_IRIS_DIAPHRAGM
1010    #define CAM_HAS_ND_FILTER           1
1011    #undef  CAM_HAS_MANUAL_FOCUS
1012    #undef  CAM_HAS_USER_TV_MODES
1013    #define CAM_DRAW_EXPOSITION             1
1014    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1015    #define CAM_FEATURE_FEATHER         1
1016
1017//    #define CAM_CONSOLE_LOG_ENABLED     1  //100a won't compile if this is defined ("undefined reference to `_iosDevFind'")
1018    #undef  CAM_CHDK_HAS_EXT_VIDEO_MENU
1019    #undef  CAM_HAS_IS
1020    #define DNG_SUPPORT                 1
1021    // pattern
1022    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1023    // color
1024    #define CAM_COLORMATRIX1                                \
1025      767398,  1000000, -227658, 1000000, -144213, 1000000, \
1026      -217466, 1000000, 669319,  1000000,  38180,  1000000, \
1027      -23152,  1000000, 77743,  1000000,   238669, 1000000
1028   
1029    #define cam_CalibrationIlluminant1 1 // Daylight
1030    // cropping
1031    #define CAM_JPEG_WIDTH  2816
1032    #define CAM_JPEG_HEIGHT 2112
1033    #define CAM_ACTIVE_AREA_X1 44
1034    #define CAM_ACTIVE_AREA_Y1 8
1035    #define CAM_ACTIVE_AREA_X2 2884
1036    #define CAM_ACTIVE_AREA_Y2 2136
1037    // camera name
1038    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1039
1040//----------------------------------------------------------
1041#elif defined (CAMERA_ixus65_sd630)
1042    #define CAM_PROPSET                 1
1043
1044    #define CAM_RAW_ROWPIX              2888   // for 6 MP
1045    #define CAM_RAW_ROWS                2136   // for 6 MP
1046
1047    #undef  CAM_USE_ZOOM_FOR_MF
1048    #undef  CAM_HAS_ERASE_BUTTON
1049    #undef  CAM_HAS_IRIS_DIAPHRAGM
1050    #define CAM_HAS_ND_FILTER           1
1051    #undef  CAM_HAS_MANUAL_FOCUS
1052    #undef  CAM_HAS_USER_TV_MODES
1053    #define CAM_DRAW_EXPOSITION             1
1054    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1055    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1056    #define CAM_FEATURE_FEATHER         1
1057
1058    #define CAM_CONSOLE_LOG_ENABLED     1
1059    #undef  CAM_HAS_IS
1060    #undef  CAM_CHDK_HAS_EXT_VIDEO_MENU
1061    #define DNG_SUPPORT                 1
1062    // pattern
1063    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1064    // color
1065    #define CAM_COLORMATRIX1                                \
1066      783384,  1000000, -227078, 1000000, -127919, 1000000, \
1067      -181247, 1000000, 661743,  1000000,  58868,  1000000, \
1068       25727,  1000000, 43891,   1000000,  247655, 1000000         
1069   
1070    #define cam_CalibrationIlluminant1 1 // Daylight
1071    // cropping
1072    #define CAM_JPEG_WIDTH  2816
1073    #define CAM_JPEG_HEIGHT 2112
1074    #define CAM_ACTIVE_AREA_X1 44
1075    #define CAM_ACTIVE_AREA_Y1 8
1076    #define CAM_ACTIVE_AREA_X2 2884
1077    #define CAM_ACTIVE_AREA_Y2 2136
1078    // camera name
1079    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1080    #define DNG_EXT_FROM ".DPS"
1081
1082//----------------------------------------------------------
1083
1084#elif defined (CAMERA_ixus75_sd750)
1085    #define CAM_PROPSET                 2
1086
1087    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1088    #define CAM_RAW_ROWS                2340   // for 7 MP
1089
1090/*
1091    #undef  CAM_USE_ZOOM_FOR_MF
1092    #undef  CAM_HAS_ERASE_BUTTON
1093    #undef  CAM_HAS_IRIS_DIAPHRAGM
1094    #define CAM_HAS_ND_FILTER           1
1095    #undef  CAM_HAS_MANUAL_FOCUS
1096    #undef  CAM_HAS_USER_TV_MODES
1097    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1098    #undef  CAM_HAS_IS
1099    */
1100   
1101    #undef  CAM_SWIVEL_SCREEN               // Camera has rotated LCD screen
1102    #undef CAM_USE_ZOOM_FOR_MF            // Zoom lever can be used for manual focus adjustments
1103    #undef  CAM_ADJUSTABLE_ALT_BUTTON       // ALT-button can be set from menu
1104    #undef CAM_REMOTE                     // Camera supports USB-remote
1105    #define CAM_MULTIPART               1   // Camera supports SD-card multipartitioning
1106    #define CAM_HAS_ZOOM_LEVER          1   // Camera has dedicated zoom buttons
1107    #undef  CAM_DRAW_EXPOSITION             // Output expo-pair on screen (for cameras which (sometimes) don't do that)
1108    #undef CAM_HAS_ERASE_BUTTON           // Camera has dedicated erase button
1109    #undef  CAM_HAS_IRIS_DIAPHRAGM
1110    #define  CAM_HAS_ND_FILTER         1      // Camera has build-in ND filter
1111    #undef CAM_CAN_SD_OVER_NOT_IN_MF      // Camera allows subject distance (focus) override when not in manual focus mode
1112    #undef CAM_CAN_SD_OVERRIDE            // Camera allows to do subject distance override
1113    #undef CAM_HAS_MANUAL_FOCUS           // Camera has manual focus mode
1114    #define CAM_HAS_USER_TV_MODES       1   // Camera has tv-priority or manual modes with ability to set tv value
1115    #define  CAM_SHOW_OSD_IN_SHOOT_MENU   1   // On some cameras Canon shoot menu has additional functionality and useful in this case to see CHDK OSD in this mode 
1116//    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO // adress for zoom_status missing, probably more
1117    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO  1 // Camera can unlock optical zoom in video (if it is locked)
1118    #define  CAM_FEATURE_FEATHER        1     // Cameras with "feather" or touch wheel.
1119    #undef CAM_HAS_IS                     // Camera has image stabilizer
1120
1121//    #define  CAM_CONSOLE_LOG_ENABLED   1      // Development: internal camera stdout -> A/stdout.txt       
1122    #define DNG_SUPPORT                 1
1123    // pattern
1124    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1125    // color
1126    #define CAM_COLORMATRIX1                                \
1127      689833,  1000000, -198299, 1000000, -101299, 1000000, \
1128      -164267, 1000000, 667466,  1000000,  74132,  1000000, \
1129       -36515,  1000000, 123872,   1000000,  248498, 1000000
1130   
1131    #define cam_CalibrationIlluminant1 1 // Daylight
1132    // cropping
1133    #define CAM_JPEG_WIDTH  3072
1134    #define CAM_JPEG_HEIGHT 2304
1135    #define CAM_ACTIVE_AREA_X1 38
1136    #define CAM_ACTIVE_AREA_Y1 14
1137    #define CAM_ACTIVE_AREA_X2 3146
1138    #define CAM_ACTIVE_AREA_Y2 2338
1139    // camera name
1140    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1141   
1142    #define DNG_EXT_FROM ".DPS"
1143
1144//----------------------------------------------------------
1145#elif defined (CAMERA_ixus70_sd1000)
1146    #define CAM_PROPSET                 2
1147
1148    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1149    #define CAM_RAW_ROWS                2340   // for 7 MP
1150
1151    #undef  CAM_USE_ZOOM_FOR_MF
1152    #undef  CAM_HAS_ERASE_BUTTON
1153    #undef  CAM_HAS_IRIS_DIAPHRAGM
1154    #define CAM_HAS_ND_FILTER           1
1155    #undef  CAM_HAS_MANUAL_FOCUS
1156    #undef  CAM_HAS_USER_TV_MODES
1157    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1158    #undef  CAM_HAS_IS
1159    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1160    #define DNG_SUPPORT                 1
1161    #define CAM_MULTIPART               1
1162    // pattern
1163    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1164    // color
1165    #define CAM_COLORMATRIX1                                \
1166      652674,  1000000, -172074, 1000000, -107575, 1000000, \
1167      -139063, 1000000, 594517,  1000000,  60252,  1000000, \
1168       -9088,  1000000, 82013,   1000000,  238048, 1000000
1169   
1170    #define cam_CalibrationIlluminant1 1 // Daylight
1171    // cropping
1172    #define CAM_JPEG_WIDTH  3072
1173    #define CAM_JPEG_HEIGHT 2304
1174    #define CAM_ACTIVE_AREA_X1 38
1175    #define CAM_ACTIVE_AREA_Y1 14
1176    #define CAM_ACTIVE_AREA_X2 3146
1177    #define CAM_ACTIVE_AREA_Y2 2338
1178    // camera name
1179    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1180
1181    #define DNG_EXT_FROM ".DPS"
1182
1183    #define CAM_EXT_TV_RANGE            1
1184
1185//----------------------------------------------------------
1186#elif defined (CAMERA_ixus80_sd1100)
1187    #define CAM_PROPSET                 2
1188    #define CAM_DRYOS                   1
1189
1190    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
1191    #define CAM_RAW_ROWS                2480   // for new 8 MP
1192
1193    #undef  CAM_USE_ZOOM_FOR_MF
1194    #undef  CAM_HAS_ERASE_BUTTON
1195    #undef  CAM_HAS_IRIS_DIAPHRAGM
1196    #define CAM_HAS_ND_FILTER           1
1197    #undef  CAM_HAS_MANUAL_FOCUS
1198    #undef  CAM_HAS_USER_TV_MODES
1199    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1200        // TODO / test
1201        #undef  CAM_REMOTE
1202        #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1203    #undef  CAM_CAN_MUTE_MICROPHONE
1204    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 0
1205    #define DNG_SUPPORT                 1
1206    // pattern
1207    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1208    // color
1209    #define CAM_COLORMATRIX1                                \
1210      893969,  1000000, -343107, 1000000, -119590, 1000000, \
1211      -41350,  1000000, 581255,  1000000,  49523,  1000000, \
1212       24221,  1000000, 47554,   1000000,  209996, 1000000
1213   
1214    #define cam_CalibrationIlluminant1 1 // Daylight
1215    // cropping
1216    #define CAM_JPEG_WIDTH  3264
1217    #define CAM_JPEG_HEIGHT 2448
1218    #define CAM_ACTIVE_AREA_X1 6
1219    #define CAM_ACTIVE_AREA_Y1 6
1220    #define CAM_ACTIVE_AREA_X2 3304
1221    #define CAM_ACTIVE_AREA_Y2 2476
1222    // camera name
1223    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1224
1225    #define CAM_EXT_TV_RANGE            1
1226
1227//----------------------------------------------------------
1228#elif defined (CAMERA_ixus700_sd500)
1229    #define CAM_PROPSET                 1
1230
1231    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1232    #define CAM_RAW_ROWS                2340   // for 7 MP
1233
1234    #undef  CAM_SYNCH
1235    #undef  CAM_USE_ZOOM_FOR_MF
1236    #define CAM_DRAW_EXPOSITION         1
1237    #undef  CAM_HAS_ERASE_BUTTON
1238    #undef  CAM_HAS_IRIS_DIAPHRAGM
1239    #define CAM_HAS_ND_FILTER           1
1240    #undef  CAM_HAS_MANUAL_FOCUS
1241    #undef  CAM_HAS_USER_TV_MODES
1242    #undef  CAM_CAN_SD_OVERRIDE
1243    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1244    #undef  CAM_HAS_IS
1245    #define CAM_MULTIPART               1
1246    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1247    #define DNG_SUPPORT                 1
1248    // pattern
1249    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1250    // color
1251    #define CAM_COLORMATRIX1         \
1252      15265, 1, -6193,  1, -1558, 1, \
1253     -4125,  1,  12116, 1,  2010, 1, \
1254      -888,  1,  1639,  1,  5220, 1
1255   
1256    #define cam_CalibrationIlluminant1 17 // Standard light A
1257    // cropping
1258    #define CAM_JPEG_WIDTH  3072
1259    #define CAM_JPEG_HEIGHT 2304
1260    #define CAM_ACTIVE_AREA_X1 38
1261    #define CAM_ACTIVE_AREA_Y1 14
1262    #define CAM_ACTIVE_AREA_X2 3146
1263    #define CAM_ACTIVE_AREA_Y2 2338
1264    // camera name
1265    #define PARAM_CAMERA_NAME 2 // parameter number for GetParameterData
1266    #define DNG_EXT_FROM ".DPS"
1267
1268//----------------------------------------------------------
1269
1270#elif defined (CAMERA_ixus750_sd550)
1271    #define CAM_PROPSET                1
1272
1273    #define CAM_RAW_ROWPIX              3152  // for 7 MP
1274    #define CAM_RAW_ROWS                2340  // for 7 MP
1275
1276    #define  CAM_USE_ZOOM_FOR_MF    1
1277    #define CAM_DRAW_EXPOSITION        1
1278    #undef  CAM_HAS_ERASE_BUTTON
1279    #undef  CAM_HAS_IRIS_DIAPHRAGM
1280    #define CAM_HAS_ND_FILTER          1
1281    #undef  CAM_HAS_MANUAL_FOCUS
1282    #undef  CAM_HAS_USER_TV_MODES
1283    #define  CAM_CAN_SD_OVERRIDE    1
1284    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1285    #undef  CAM_HAS_IS
1286    #define CAM_MULTIPART              1
1287    #undef CAM_SYNCH
1288    #define DNG_SUPPORT                 1
1289    // pattern
1290    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1291    // color
1292    #define CAM_COLORMATRIX1                               \
1293      580280, 1000000, -172239, 1000000, -89707,  1000000, \
1294     -206596, 1000000,  634926, 1000000,  63877,  1000000, \
1295      10377,  1000000,  62053,  1000000,  242646, 1000000
1296   
1297    #define cam_CalibrationIlluminant1 1 // Daylight
1298    // cropping
1299    #define CAM_JPEG_WIDTH  3072
1300    #define CAM_JPEG_HEIGHT 2304
1301    #define CAM_ACTIVE_AREA_X1 36
1302    #define CAM_ACTIVE_AREA_Y1 12
1303    #define CAM_ACTIVE_AREA_X2 3148
1304    #define CAM_ACTIVE_AREA_Y2 2340
1305    // camera name
1306    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1307
1308//----------------------------------------------------------
1309#elif defined (CAMERA_ixus800_sd700)
1310    #define CAM_PROPSET                 1
1311
1312    #define CAM_RAW_ROWPIX              2888   // for 6 MP
1313    #define CAM_RAW_ROWS                2136   // for 6 MP
1314
1315    #undef  CAM_USE_ZOOM_FOR_MF
1316    #define CAM_DRAW_EXPOSITION         1
1317    #undef  CAM_HAS_ERASE_BUTTON
1318    #undef  CAM_HAS_IRIS_DIAPHRAGM
1319    #define CAM_HAS_ND_FILTER           1
1320    #undef  CAM_HAS_MANUAL_FOCUS
1321    #undef  CAM_HAS_USER_TV_MODES
1322    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1323    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
1324    #define DNG_SUPPORT                 1
1325
1326 // Warning! DNG4PS2 has both ixus800 and sd700 support with different CFA patterns and color matrices.
1327 // Used settings for IXUS800
1328
1329    // pattern
1330    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1331    // color
1332    #define CAM_COLORMATRIX1          \
1333      14062, 1, -5199,  1, -1446,  1, \
1334      -4712, 1,  12470, 1,  2243,  1, \
1335      -1286, 1,  2028,  1,  4836,  1
1336   
1337    #define cam_CalibrationIlluminant1 17 // Standard light A
1338    // cropping
1339    #define CAM_JPEG_WIDTH  2816
1340    #define CAM_JPEG_HEIGHT 2112
1341    #define CAM_ACTIVE_AREA_X1 44
1342    #define CAM_ACTIVE_AREA_Y1 8
1343    #define CAM_ACTIVE_AREA_X2 2884
1344    #define CAM_ACTIVE_AREA_Y2 2136
1345    // camera name
1346    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1347    #define DNG_EXT_FROM ".DPS"
1348   
1349//----------------------------------------------------------
1350#elif defined (CAMERA_ixus850_sd800)
1351    #define CAM_PROPSET                 1
1352
1353    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1354    #define CAM_RAW_ROWS                2340   // for 7 MP
1355
1356    #undef  CAM_USE_ZOOM_FOR_MF
1357    #undef  CAM_HAS_ERASE_BUTTON
1358    #undef  CAM_HAS_IRIS_DIAPHRAGM
1359    #define CAM_HAS_ND_FILTER           1
1360    #undef  CAM_HAS_MANUAL_FOCUS
1361    #undef  CAM_HAS_USER_TV_MODES
1362    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1363    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1364    #define CAM_MULTIPART               1
1365    #define DNG_SUPPORT                 1
1366    // pattern
1367    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1368    // color
1369    #define CAM_COLORMATRIX1                               \
1370      661014, 1000000, -189364, 1000000, -115797, 1000000, \
1371     -168772, 1000000,  661827, 1000000,   47392, 1000000, \
1372      -35846, 1000000,  107148, 1000000,  233705, 1000000
1373   
1374    #define cam_CalibrationIlluminant1 17 // Standard light A
1375    // cropping
1376    #define CAM_JPEG_WIDTH  3072
1377    #define CAM_JPEG_HEIGHT 2304
1378    #define CAM_ACTIVE_AREA_X1 12
1379    #define CAM_ACTIVE_AREA_Y1 8
1380    #define CAM_ACTIVE_AREA_X2 3108
1381    #define CAM_ACTIVE_AREA_Y2 2332
1382    // camera name
1383    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1384
1385    #define DNG_EXT_FROM ".DPS"
1386   
1387//----------------------------------------------------------
1388#elif defined (CAMERA_ixus860_sd870)
1389    #define CAM_PROPSET                 2
1390    #define CAM_DRYOS                   1
1391
1392    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
1393    #define CAM_RAW_ROWS                2480   // for new 8 MP
1394
1395    #undef  CAM_USE_ZOOM_FOR_MF
1396    #undef  CAM_HAS_ERASE_BUTTON
1397    #undef  CAM_HAS_IRIS_DIAPHRAGM
1398    #define CAM_HAS_ND_FILTER           1
1399    #undef  CAM_HAS_MANUAL_FOCUS
1400    #undef  CAM_HAS_USER_TV_MODES
1401    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1402        #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1403    #undef  CAM_CAN_MUTE_MICROPHONE
1404    #undef  CAM_VIDEO_CONTROL
1405    #define DNG_SUPPORT                 1
1406    // pattern
1407    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1408    // color
1409    #define CAM_COLORMATRIX1                               \
1410      747939, 1000000, -268233, 1000000, -129266, 1000000, \
1411     -50633,  1000000, 515687,  1000000,  23509,  1000000, \
1412     -21341,  1000000, 76495,   1000000, 186385,  1000000
1413   
1414    #define cam_CalibrationIlluminant1 1 // Daylight                   
1415    // cropping
1416    #define CAM_JPEG_WIDTH  3264
1417    #define CAM_JPEG_HEIGHT 2448
1418    #define CAM_ACTIVE_AREA_X1 10
1419    #define CAM_ACTIVE_AREA_Y1 8
1420    #define CAM_ACTIVE_AREA_X2 3302
1421    #define CAM_ACTIVE_AREA_Y2 2474
1422    // camera name
1423    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1424
1425    #define DNG_EXT_FROM ".CR2"
1426
1427//----------------------------------------------------------
1428#elif defined (CAMERA_ixus870_sd880)
1429
1430    // Camera details
1431    #define CAM_MAKE                    "Canon"
1432    #define CAM_DRYOS                   1
1433    #define CAM_PROPSET                 2
1434
1435    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1436    #define CAM_BITMAP_PALETTE          1
1437    #define CAM_BRACKETING              1   // XXX
1438    #define CAM_CAN_SD_OVER_NOT_IN_MF   1
1439    #define CAM_CAN_SD_OVERRIDE         1
1440    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1441    #define CAM_EXT_TV_RANGE            1
1442    #define CAM_HAS_IS                  1
1443    #define CAM_HAS_JOGDIAL             1
1444    #define CAM_HAS_ND_FILTER           1
1445    #define CAM_HAS_ZOOM_LEVER          1
1446    #define CAM_MULTIPART               1
1447    #define CAM_REMOTE                  1
1448    #define CAM_SYNCH                   1   // XXX
1449    #undef CAM_UNCACHED_BIT
1450    #define CAM_UNCACHED_BIT            0x40000000  // 0xFF874198 (via ExMem.FreeCacheable
1451    #define PARAM_CAMERA_NAME           4 // parameter number for GetParameterData
1452   
1453    #undef  CAM_CAN_MUTE_MICROPHONE         // XXX
1454    #undef  CAM_HAS_ERASE_BUTTON
1455    #undef  CAM_HAS_IRIS_DIAPHRAGM
1456    #undef  CAM_HAS_MANUAL_FOCUS
1457    #undef  CAM_HAS_USER_TV_MODES           // XXX
1458    #undef  CAM_HAS_VIDEO_BUTTON            // XXX
1459    #undef  CAM_EV_IN_VIDEO                 // XXX
1460    #undef  CAM_REAR_CURTAIN
1461
1462    #define CAM_JPEG_WIDTH              3648
1463    #define CAM_JPEG_HEIGHT             2736
1464    #define CAM_RAW_ROWPIX              3720
1465    #define CAM_RAW_ROWS                2772
1466    #define CAM_ACTIVE_AREA_X1          14       // XXX
1467    #define CAM_ACTIVE_AREA_Y1          8        // XXX
1468    #define CAM_ACTIVE_AREA_X2          3682     // XXX
1469    #define CAM_ACTIVE_AREA_Y2          2764     // XXX
1470   
1471    #undef CAM_SENSOR_BITS_PER_PIXEL
1472    #undef CAM_WHITE_LEVEL
1473    #undef CAM_BLACK_LEVEL
1474    #define CAM_SENSOR_BITS_PER_PIXEL   12
1475    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1) // XXX
1476    #define CAM_BLACK_LEVEL             127 // XXX
1477
1478    #define cam_CFAPattern              0x02010100 // Red  Green  Green  Blue
1479    #define CAM_COLORMATRIX1                               \
1480      827547, 1000000, -290458, 1000000, -126086, 1000000, \
1481     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
1482      5181,   1000000, 48183,   1000000, 245014,  1000000    // XXX
1483    #define cam_CalibrationIlluminant1  1 // Daylight       XXX
1484
1485
1486    // CHDK functionality
1487    #define CAM_CHDK_HAS_EXT_VIDEO_MENU 1   // XXX
1488    #define CAM_EMUL_KEYPRESS_DELAY     40
1489    #define CAM_EMUL_KEYPRESS_DURATION  5
1490    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1491    #undef  DEFAULT_RAW_EXT
1492    #define DEFAULT_RAW_EXT             2   // use .CR2
1493    #define DNG_SUPPORT                 1
1494   
1495    #undef  CAM_ADJUSTABLE_ALT_BUTTON
1496    #undef  CAM_CONSOLE_LOG_ENABLED
1497    #undef  CAM_DRAW_EXPOSITION             // XXX
1498    #undef  CAM_FEATURE_FEATHER             // XXX
1499    #undef  CAM_USE_ZOOM_FOR_MF
1500    #undef  CAM_VIDEO_CONTROL               // XXX
1501
1502
1503//----------------------------------------------------------
1504#elif defined (CAMERA_ixus950_sd850)
1505
1506    #define CAM_EXT_TV_RANGE            1
1507    #define CAM_PROPSET                 2
1508
1509    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
1510    #define CAM_RAW_ROWS                2480   // for new 8 MP
1511
1512    #undef  CAM_USE_ZOOM_FOR_MF
1513    #undef  CAM_HAS_ERASE_BUTTON
1514    #undef  CAM_HAS_IRIS_DIAPHRAGM
1515    #define CAM_HAS_ND_FILTER           1
1516    #undef  CAM_HAS_MANUAL_FOCUS
1517    #undef  CAM_HAS_USER_TV_MODES
1518    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1519    #define CAM_MULTIPART               1
1520    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1521    #define DNG_SUPPORT                 1
1522    // pattern
1523    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1524    // color
1525    #define CAM_COLORMATRIX1        \
1526      14573, 1, -5482, 1, -1546, 1, \
1527     -1266,  1, 9799,  1, 1468,  1, \
1528     -1040,  1, 1912,  1, 3810,  1
1529   
1530    #define cam_CalibrationIlluminant1 1 // Daylight                   
1531    // cropping
1532    #define CAM_JPEG_WIDTH  3264
1533    #define CAM_JPEG_HEIGHT 2448
1534    #define CAM_ACTIVE_AREA_X1 10
1535    #define CAM_ACTIVE_AREA_Y1 8
1536    #define CAM_ACTIVE_AREA_X2 3302
1537    #define CAM_ACTIVE_AREA_Y2 2474
1538    // camera name
1539    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1540    #define DNG_EXT_FROM ".DPS"
1541   
1542//----------------------------------------------------------
1543#elif defined (CAMERA_ixus960_sd950)
1544    #define CAM_PROPSET                 2
1545    #define CAM_DRYOS                   1
1546
1547    #define CAM_RAW_ROWPIX              4104   
1548    #define CAM_RAW_ROWS                3048   
1549
1550    #undef  CAM_USE_ZOOM_FOR_MF
1551    #undef  CAM_HAS_ERASE_BUTTON
1552    #undef  CAM_HAS_IRIS_DIAPHRAGM
1553    #define CAM_HAS_ND_FILTER           1
1554    #undef  CAM_HAS_MANUAL_FOCUS
1555    #undef  CAM_HAS_USER_TV_MODES
1556    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1557    #define DNG_SUPPORT                 1
1558    // pattern
1559    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1560    // color
1561    #define CAM_COLORMATRIX1                               \
1562      913762, 1000000, -261578, 1000000, -135582, 1000000, \
1563      -99049, 1000000, 1067089, 1000000,  61442,  1000000, \
1564      48717,  1000000, 96802,   1000000,  412056, 1000000
1565   
1566    #define cam_CalibrationIlluminant1 1 // Daylight
1567    // cropping
1568    #define CAM_JPEG_WIDTH  4000
1569    #define CAM_JPEG_HEIGHT 3000
1570    #define CAM_ACTIVE_AREA_X1 48
1571    #define CAM_ACTIVE_AREA_Y1 12
1572    #define CAM_ACTIVE_AREA_X2 4080
1573    #define CAM_ACTIVE_AREA_Y2 3036
1574    // camera name
1575    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1576
1577    #define DNG_EXT_FROM ".CR2"
1578
1579//----------------------------------------------------------
1580 #elif defined (CAMERA_ixus970_sd890)
1581    #define CAM_PROPSET                 2
1582    #define CAM_DRYOS                   1
1583
1584    #define CAM_RAW_ROWPIX              3720
1585    #define CAM_RAW_ROWS                2772
1586
1587    #undef CAM_USE_ZOOM_FOR_MF
1588    #undef CAM_HAS_ERASE_BUTTON
1589    #undef CAM_HAS_IRIS_DIAPHRAGM
1590    #define CAM_HAS_ND_FILTER           1
1591    #undef CAM_HAS_MANUAL_FOCUS
1592    #define CAM_MULTIPART               1
1593    #define CAM_HAS_JOGDIAL             1
1594    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1595    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1596    #define DNG_SUPPORT                 1
1597    #define CAM_EXT_TV_RANGE            1
1598
1599    // pattern
1600    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1601
1602    // color
1603    #define CAM_COLORMATRIX1                               \
1604      827547, 1000000, -290458, 1000000, -126086, 1000000, \
1605     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
1606      5181,   1000000, 48183,   1000000, 245014,  1000000
1607    #define cam_CalibrationIlluminant1 1 // Daylight
1608
1609    // cropping
1610    #define CAM_JPEG_WIDTH  3648
1611    #define CAM_JPEG_HEIGHT 2736
1612    #define CAM_ACTIVE_AREA_X1 6
1613    #define CAM_ACTIVE_AREA_Y1 12
1614    #define CAM_ACTIVE_AREA_X2 3690
1615    #define CAM_ACTIVE_AREA_Y2 2772
1616
1617    // camera name
1618    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1619
1620    // 12 bit support
1621    #undef  CAM_SENSOR_BITS_PER_PIXEL
1622    #undef  CAM_WHITE_LEVEL
1623    #undef  CAM_BLACK_LEVEL
1624    #define CAM_SENSOR_BITS_PER_PIXEL   12
1625    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1626    #define CAM_BLACK_LEVEL             127
1627
1628#elif defined (CAMERA_ixus980_sd990)
1629    #define CAM_PROPSET                 2 // all values checked so far match propset 2
1630    #define CAM_DRYOS                   1
1631
1632    #define CAM_RAW_ROWPIX              4480 // 14.7 MP 12bpp
1633    #define CAM_RAW_ROWS                3348   
1634
1635    #undef  CAM_USE_ZOOM_FOR_MF
1636    #undef  CAM_HAS_ERASE_BUTTON
1637    #define CAM_MULTIPART               1
1638    #undef  CAM_HAS_IRIS_DIAPHRAGM
1639    #define CAM_HAS_ND_FILTER           1
1640    #define  CAM_HAS_MANUAL_FOCUS               1
1641    #define  CAM_HAS_USER_TV_MODES              1 //include M/P ? needed to make Tv bracketing work
1642    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1643    #define CAM_CHDK_HAS_EXT_VIDEO_MENU 1
1644    #undef  CAM_VIDEO_CONTROL
1645    #undef CAM_UNCACHED_BIT  // shut up compiler
1646    #define CAM_UNCACHED_BIT    0x40000000
1647    #undef CAM_BITMAP_PALETTE
1648    #define CAM_BITMAP_PALETTE    2
1649
1650        #undef CAM_BLACK_LEVEL
1651    #define CAM_BLACK_LEVEL             127
1652    #define CAM_HAS_JOGDIAL             1
1653//    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1654    #define CAM_VIDEO_QUALITY_ONLY          1 
1655    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1656        #undef CAM_SENSOR_BITS_PER_PIXEL
1657    #define CAM_SENSOR_BITS_PER_PIXEL   12
1658        #undef CAM_WHITE_LEVEL
1659    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1660
1661    #define DNG_SUPPORT                 1
1662    // pattern
1663    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1664    // color preliminary
1665    #define CAM_COLORMATRIX1                               \
1666      837237, 1000000, -290137, 1000000, -128156, 1000000, \
1667      -127762, 1000000, 643909, 1000000,  52973,  1000000, \
1668      4446,  1000000, 88354,   1000000,  224246, 1000000
1669   
1670    #define cam_CalibrationIlluminant1 1 // Daylight
1671    // cropping
1672    #define CAM_JPEG_WIDTH  4416
1673    #define CAM_JPEG_HEIGHT 3312
1674    #define CAM_ACTIVE_AREA_X1 12
1675    #define CAM_ACTIVE_AREA_Y1 12
1676    #define CAM_ACTIVE_AREA_X2 4444
1677    #define CAM_ACTIVE_AREA_Y2 3324
1678    // camera name
1679    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData sd990: OK
1680
1681//    #define DNG_EXT_FROM ".CR2"
1682
1683//----------------------------------------------------------
1684 #elif defined (CAMERA_ixus90_sd790)
1685    #define CAM_PROPSET                 2
1686    #define CAM_DRYOS                   1
1687
1688    #define CAM_RAW_ROWPIX              3720
1689    #define CAM_RAW_ROWS                2772
1690
1691    #undef CAM_USE_ZOOM_FOR_MF
1692    #undef CAM_HAS_ERASE_BUTTON
1693    #define CAM_MULTIPART               1
1694    #undef CAM_HAS_IRIS_DIAPHRAGM
1695    #undef CAM_HAS_MANUAL_FOCUS
1696
1697    #define CAM_HAS_ND_FILTER           1
1698    #undef CAM_HAS_USER_TV_MODES
1699    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1700         #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1701    #define CAM_HAS_JOGDIAL             1
1702
1703    #define DNG_SUPPORT                 1
1704    // pattern
1705    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1706    // color
1707    #define CAM_COLORMATRIX1                               \
1708      650591, 1000000, -199585, 1000000, -123118, 1000000, \
1709     -69617,  1000000, 583926,  1000000,  34354,  1000000, \
1710     -19113,  1000000, 82163,   1000000, 210786,  1000000
1711    #define cam_CalibrationIlluminant1 1 // Daylight
1712
1713    // cropping
1714    #define CAM_JPEG_WIDTH  3648
1715    #define CAM_JPEG_HEIGHT 2736
1716    #define CAM_ACTIVE_AREA_X1 6
1717    #define CAM_ACTIVE_AREA_Y1 12
1718    #define CAM_ACTIVE_AREA_X2 3690
1719    #define CAM_ACTIVE_AREA_Y2 2772
1720
1721    // camera name
1722    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1723    #undef  CAM_SENSOR_BITS_PER_PIXEL
1724    #undef  CAM_WHITE_LEVEL
1725    #undef  CAM_BLACK_LEVEL
1726    #define CAM_SENSOR_BITS_PER_PIXEL   12
1727    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1728    #define CAM_BLACK_LEVEL             127
1729
1730//==========================================================
1731// S-Series
1732//==========================================================
1733#elif defined (CAMERA_s2is)
1734    #define CAM_PROPSET                 1
1735
1736    #define CAM_RAW_ROWPIX              2672   // for 5 MP
1737    #define CAM_RAW_ROWS                1968   // for 5 MP
1738   
1739    #undef  CAM_SYNCH   
1740    #define CAM_SWIVEL_SCREEN           1
1741    #define CAM_ADJUSTABLE_ALT_BUTTON   1
1742    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1743    #define  CAM_HAS_VIDEO_BUTTON       1
1744    #undef  CAM_VIDEO_CONTROL
1745    #define DNG_SUPPORT                 1
1746    // pattern
1747    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1748    // color
1749    #define CAM_COLORMATRIX1                                \
1750      547708,  1000000, -143462, 1000000,  -99243, 1000000, \
1751     -186838,  1000000, 663925,  1000000,   50970, 1000000, \
1752     -5810,    1000000, 79162,   1000000,  266988, 1000000
1753   
1754    #define cam_CalibrationIlluminant1 1 // Daylight
1755    // cropping
1756    #define CAM_JPEG_WIDTH  2592
1757    #define CAM_JPEG_HEIGHT 1944
1758    #define CAM_ACTIVE_AREA_X1 14
1759    #define CAM_ACTIVE_AREA_Y1 10
1760    #define CAM_ACTIVE_AREA_X2 2626
1761    #define CAM_ACTIVE_AREA_Y2 1966
1762    // camera name
1763    #define PARAM_CAMERA_NAME 2 // parameter number for GetParameterData
1764    #define CAM_BRACKETING              1
1765    #define DNG_EXT_FROM ".DPS"
1766
1767//----------------------------------------------------------
1768#elif defined (CAMERA_s3is)
1769    #define CAM_PROPSET                 1
1770
1771    #define CAM_RAW_ROWPIX              2888   // for 6 MP
1772    #define CAM_RAW_ROWS                2136   // for 6 MP
1773   
1774    #undef  CAM_SYNCH 
1775    #define CAM_SWIVEL_SCREEN           1
1776    #define CAM_ADJUSTABLE_ALT_BUTTON   1
1777    #define CAM_MULTIPART               1
1778    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
1779    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1780    #define  CAM_HAS_VIDEO_BUTTON       1
1781    #define DNG_SUPPORT                 1
1782    // pattern
1783    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1784    // color
1785    #define CAM_COLORMATRIX1                               \
1786     14062, 10000, -5199, 10000, -1446, 10000,             \
1787     -4712, 10000, 12470, 10000,  2243, 10000,             \
1788     -1286, 10000,  2028, 10000,  4836, 10000
1789   
1790    #define cam_CalibrationIlluminant1 17 // Standard light A
1791    // cropping
1792    #define CAM_JPEG_WIDTH  2816
1793    #define CAM_JPEG_HEIGHT 2112
1794    #define CAM_ACTIVE_AREA_X1 44
1795    #define CAM_ACTIVE_AREA_Y1 8
1796    #define CAM_ACTIVE_AREA_X2 2884
1797    #define CAM_ACTIVE_AREA_Y2 2136
1798    // camera name
1799    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1800    #define CAM_BRACKETING              1
1801    #define DNG_EXT_FROM ".DPS"
1802
1803    #define CAM_EXT_TV_RANGE            1
1804
1805//----------------------------------------------------------
1806#elif defined (CAMERA_s5is)
1807    #define CAM_PROPSET                 2
1808    #define CAM_DRYOS                   1
1809
1810    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
1811    #define CAM_RAW_ROWS                2480   // for new 8 MP
1812   
1813    #define CAM_SWIVEL_SCREEN           1
1814    #define CAM_ADJUSTABLE_ALT_BUTTON   1
1815    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
1816    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1817    #define CAM_HAS_VIDEO_BUTTON       1
1818    #define CAM_EXT_TV_RANGE            1
1819    #define DNG_SUPPORT                 1
1820    // pattern
1821    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1822    // color
1823    #define CAM_COLORMATRIX1                               \
1824      650591, 1000000, -199585, 1000000, -123118, 1000000, \
1825     -69617,  1000000, 583926,  1000000,  34354,  1000000, \
1826     -19113,  1000000, 82163,   1000000, 210786,  1000000
1827   
1828    #define cam_CalibrationIlluminant1 1 // Daylight
1829    // cropping
1830    #define CAM_JPEG_WIDTH  3264
1831    #define CAM_JPEG_HEIGHT 2448
1832    #define CAM_ACTIVE_AREA_X1 10
1833    #define CAM_ACTIVE_AREA_Y1 8
1834    #define CAM_ACTIVE_AREA_X2 3302
1835    #define CAM_ACTIVE_AREA_Y2 2474
1836    // camera name
1837    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1838    #define CAM_BRACKETING              1
1839    #define DNG_EXT_FROM ".DPS"
1840
1841//==========================================================
1842// TX-Series
1843//==========================================================
1844#elif defined (CAMERA_tx1)
1845    #define CAM_PROPSET                 2
1846   
1847    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1848    #define CAM_RAW_ROWS                2340   // for 7 MP
1849
1850    #define CAM_SWIVEL_SCREEN           1
1851    #define CAM_HAS_ND_FILTER           1
1852    #undef  CAM_HAS_ERASE_BUTTON
1853    #undef  CAM_HAS_MANUAL_FOCUS
1854    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1855    #define CAM_MULTIPART               1
1856    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1857    #define  CAM_HAS_VIDEO_BUTTON       1
1858    #define DNG_SUPPORT                 1
1859    // pattern
1860    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1861    // color
1862    #define CAM_COLORMATRIX1                                \
1863      510370,  1000000, -68998,  1000000, -86859,  1000000, \
1864      -279980, 1000000, 766686,  1000000,  67944,  1000000, \
1865      -14382,  1000000, 113688,  1000000, 239853,  1000000
1866   
1867    #define cam_CalibrationIlluminant1 1 // Daylight
1868    // cropping
1869    #define CAM_JPEG_WIDTH  3072
1870    #define CAM_JPEG_HEIGHT 2304
1871    #define CAM_ACTIVE_AREA_X1 12
1872    #define CAM_ACTIVE_AREA_Y1 8
1873    #define CAM_ACTIVE_AREA_X2 3108
1874    #define CAM_ACTIVE_AREA_Y2 2332
1875    // camera name
1876    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1877    #define DNG_EXT_FROM ".DPS"
1878
1879//==========================================================
1880// SX-Series
1881//==========================================================
1882#elif defined (CAMERA_sx100is)
1883    #define CAM_PROPSET                 2
1884    #define CAM_DRYOS                   1
1885
1886    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
1887    #define CAM_RAW_ROWS                2480   // for new 8 MP
1888    #undef CAM_SYNCH
1889    #define CAM_CAN_MUTE_MICROPHONE     1
1890    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1891    #define CAM_ADJUSTABLE_ALT_BUTTON   1
1892    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1893    #undef  CAM_VIDEO_CONTROL
1894    #define DNG_SUPPORT                 1
1895    #define CAM_REAR_CURTAIN            1
1896    #define CAM_HAS_JOGDIAL             1
1897    // pattern
1898    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1899    // color
1900    #define CAM_COLORMATRIX1                               \
1901      656793, 1000000, -168702, 1000000, -108030, 1000000, \
1902      -2711,  1000000, 661538,  1000000,  37919,  1000000, \
1903      77255,  1000000, 48834,   1000000, 241797,  1000000
1904   
1905    #define cam_CalibrationIlluminant1 1 // Daylight
1906    // cropping
1907    #define CAM_JPEG_WIDTH  3264
1908    #define CAM_JPEG_HEIGHT 2448
1909    #define CAM_ACTIVE_AREA_X1 10
1910    #define CAM_ACTIVE_AREA_Y1 8
1911    #define CAM_ACTIVE_AREA_X2 3302
1912    #define CAM_ACTIVE_AREA_Y2 2474
1913    // camera name
1914    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1915
1916    #define DNG_EXT_FROM ".CR2"
1917    #define CAM_MULTIPART               1
1918
1919
1920//----------------------------------------------------------
1921
1922#elif defined (CAMERA_sx10)
1923    #define CAM_PROPSET                 2
1924    #define CAM_DRYOS                   1
1925
1926    #define CAM_RAW_ROWPIX              3720   
1927    #define CAM_RAW_ROWS                2772   
1928   
1929    #define CAM_SWIVEL_SCREEN           1
1930    #define CAM_ADJUSTABLE_ALT_BUTTON   1
1931    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
1932    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1933    #define CAM_HAS_VIDEO_BUTTON       1
1934    #define CAM_VIDEO_QUALITY_ONLY          1 
1935    #define CAM_BRACKETING              1
1936    #undef  CAM_VIDEO_CONTROL
1937    #define CAM_MULTIPART               1
1938    #define CAM_HAS_JOGDIAL             1
1939    #undef  CAM_USE_ZOOM_FOR_MF
1940    #undef  CAM_UNCACHED_BIT  // shut up compiler
1941    #define CAM_UNCACHED_BIT    0x40000000
1942
1943
1944    #define DNG_SUPPORT                 1
1945    // pattern
1946    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1947    // color
1948
1949    #define CAM_COLORMATRIX1                               \
1950      827547, 1000000, -290458, 1000000, -126086, 1000000, \
1951     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
1952      5181,   1000000, 48183,   1000000, 245014,  1000000
1953
1954    #define cam_CalibrationIlluminant1 1 // Daylight
1955    // cropping
1956    #define CAM_JPEG_WIDTH  3648
1957    #define CAM_JPEG_HEIGHT 2736
1958    #define CAM_ACTIVE_AREA_X1 6
1959    #define CAM_ACTIVE_AREA_Y1 12
1960    #define CAM_ACTIVE_AREA_X2 3690
1961    #define CAM_ACTIVE_AREA_Y2 2772
1962    // camera name
1963    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1964    #undef  CAM_SENSOR_BITS_PER_PIXEL
1965    #undef  CAM_WHITE_LEVEL
1966    #undef  CAM_BLACK_LEVEL
1967    #define CAM_SENSOR_BITS_PER_PIXEL   12
1968    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1969    #define CAM_BLACK_LEVEL             127
1970
1971    #define CAM_EXT_TV_RANGE            1
1972
1973#elif defined (CAMERA_sx1)
1974    #define CAM_PROPSET                 2
1975    #define CAM_DRYOS                   1
1976
1977    #define CAM_RAW_ROWPIX              4152
1978    #define CAM_RAW_ROWS                2772 
1979   
1980    #define CAM_SWIVEL_SCREEN           1
1981    #define CAM_ADJUSTABLE_ALT_BUTTON   1
1982    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
1983    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1984    #define CAM_HAS_VIDEO_BUTTON       1
1985    #define CAM_VIDEO_QUALITY_ONLY          1 
1986    #define CAM_BRACKETING              1
1987    #undef  CAM_VIDEO_CONTROL
1988    #define CAM_MULTIPART               1
1989    #define CAM_HAS_JOGDIAL             1
1990    #undef  CAM_USE_ZOOM_FOR_MF
1991    #undef  CAM_UNCACHED_BIT  // shut up compiler
1992    #define CAM_UNCACHED_BIT    0x40000000
1993
1994
1995    #define DNG_SUPPORT                 1
1996    // pattern
1997    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1998    // color
1999
2000    #define CAM_COLORMATRIX1                               \
2001      827547, 1000000, -290458, 1000000, -126086, 1000000, \
2002     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
2003      5181,   1000000, 48183,   1000000, 245014,  1000000
2004
2005    #define cam_CalibrationIlluminant1 1 // Daylight
2006    // cropping
2007    #define CAM_JPEG_WIDTH  3648
2008    #define CAM_JPEG_HEIGHT 2736
2009    #define CAM_ACTIVE_AREA_X1 344
2010    #define CAM_ACTIVE_AREA_Y1 24
2011    #define CAM_ACTIVE_AREA_X2 3991
2012    #define CAM_ACTIVE_AREA_Y2 2759 
2013    // camera name
2014    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2015    #undef  CAM_SENSOR_BITS_PER_PIXEL
2016    #undef  CAM_WHITE_LEVEL
2017    #undef  CAM_BLACK_LEVEL
2018    #define CAM_SENSOR_BITS_PER_PIXEL   12
2019    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2020    #define CAM_BLACK_LEVEL             127
2021 
2022    #define CAM_EXT_TV_RANGE            1
2023                 
2024    #define CAM_HAS_VARIABLE_ASPECT 1
2025//----------------------------------------------------------
2026        //********
2027        /////SX110
2028        //********
2029#elif defined (CAMERA_sx110is)
2030        #define CAM_COLORMATRIX1                               \
2031      530200, 1000000, -42600,  1000000, -33000,  1000000, \
2032     -525400,  1000000, 1092700,  1000000,  223700,  1000000, \
2033     -103700,  1000000, 117900,   1000000,  421600,  1000000
2034    #define CAM_ACTIVE_AREA_X1 8
2035    #define CAM_ACTIVE_AREA_Y1 14
2036    #define CAM_ACTIVE_AREA_X2 3688
2037    #define CAM_ACTIVE_AREA_Y2 2772
2038
2039    #define CAM_PROPSET                 2
2040    #define CAM_DRYOS                   1
2041    #define CAM_RAW_ROWPIX              3720 
2042    #define CAM_RAW_ROWS                2772 
2043    #undef CAM_SYNCH
2044    #define CAM_CAN_MUTE_MICROPHONE     1
2045    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
2046    #define CAM_REAR_CURTAIN            1
2047    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2048    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
2049    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
2050    #undef  CAM_VIDEO_CONTROL                                   
2051    #define CAM_MULTIPART               1
2052    #define CAM_HAS_JOGDIAL             1
2053    #undef  CAM_USE_ZOOM_FOR_MF
2054    #undef  CAM_UNCACHED_BIT  // shut up compiler
2055    #define CAM_UNCACHED_BIT    0x40000000
2056        #undef CAM_SENSOR_BITS_PER_PIXEL
2057    #define CAM_SENSOR_BITS_PER_PIXEL   12
2058        #undef CAM_WHITE_LEVEL
2059    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2060        // black level set to 128 per reports on the forum
2061    #undef  CAM_BLACK_LEVEL
2062    #define CAM_BLACK_LEVEL             128
2063    #define DNG_SUPPORT                 1
2064    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2065    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2066    #define cam_CalibrationIlluminant1 1 // Daylight
2067    #define CAM_JPEG_WIDTH  3456
2068    #define CAM_JPEG_HEIGHT 2592
2069       
2070//----------------------------------------------------------
2071        //********
2072        /////SX200
2073        //********
2074#elif defined (CAMERA_sx200is)
2075
2076  // copied from SX10 and modified
2077
2078    #define CAM_PROPSET                 2
2079    #define CAM_DRYOS                   1
2080    #define CAM_RAW_ROWPIX              4080 // from calcs see 100C lib.c
2081    #define CAM_RAW_ROWS                3048 //  "     "    "    "    " 
2082   
2083  //  #define CAM_ADJUSTABLE_ALT_BUTTON   1
2084    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
2085    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2086    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
2087  //  #define CAM_HAS_VIDEO_BUTTON       1
2088    #define CAM_VIDEO_QUALITY_ONLY          1 
2089// reyalp - from the manual, i guess no native bracketing
2090//    #define CAM_BRACKETING              1
2091    #undef  CAM_VIDEO_CONTROL
2092    #define CAM_MULTIPART               1
2093    #define CAM_HAS_JOGDIAL             1
2094    #undef  CAM_USE_ZOOM_FOR_MF
2095    #undef  CAM_UNCACHED_BIT  // shut up compiler
2096    #define CAM_UNCACHED_BIT    0x40000000
2097    #define DNG_SUPPORT                 1
2098    // pattern
2099    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2100    // color
2101    //need fixing *****************************************************
2102    #define CAM_COLORMATRIX1                               \
2103      14134, 1000000, -5576, 1000000, -1527, 1000000, \
2104     -1991,  1000000, 10719,  1000000, 1273,   1000000, \
2105      -1158,   1000000, 1929,   1000000, 3581,  1000000
2106
2107    #define cam_CalibrationIlluminant1 17 // Standard Light A
2108    // cropping
2109    #define CAM_JPEG_WIDTH  4000
2110    #define CAM_JPEG_HEIGHT 3000
2111    #define CAM_ACTIVE_AREA_X1 52
2112    #define CAM_ACTIVE_AREA_Y1 14
2113    #define CAM_ACTIVE_AREA_X2 4052
2114    #define CAM_ACTIVE_AREA_Y2 3014
2115    // camera name
2116    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2117    #undef  CAM_SENSOR_BITS_PER_PIXEL
2118    #undef  CAM_WHITE_LEVEL
2119    #undef  CAM_BLACK_LEVEL
2120    #define CAM_SENSOR_BITS_PER_PIXEL   12
2121    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2122    #define CAM_BLACK_LEVEL             127
2123
2124    #define CAM_EXT_TV_RANGE            1
2125    #undef CAM_BITMAP_PALETTE
2126    #define CAM_BITMAP_PALETTE    3
2127    #undef CAM_HAS_ERASE_BUTTON
2128    #define  CAM_SHOW_OSD_IN_SHOOT_MENU  1
2129       
2130    //nandoide sept-2009
2131    #undef CAM_USES_ASPECT_CORRECTION   
2132    #undef CAM_USES_ASPECT_YCORRECTION 
2133    #define CAM_USES_ASPECT_CORRECTION  1  //camera uses the modified graphics primitives to map screens an viewports to buffers more sized
2134    #define CAM_USES_ASPECT_YCORRECTION  0  //only uses mappings on x coordinate
2135
2136   
2137// reyalp TODO not sure this stuff belongs in camera.h there will probably only be a few different setups
2138// maybe we can just have one CAM_ options that picks what to use ?
2139// values need to be better documented
2140        // reyalp - I guess these are bitmap ?
2141    //default mappings
2142//    #define BUFFERX 720 // not used ?
2143//    #define BUFFERY 240 // not used ?
2144// why have these when we already have vid_get_bitmap_screen_* which just return these ?!?
2145//    #define SCREENX 320
2146//    #define SCREENY 240
2147    #undef ASPECT_XCORRECTION
2148    #define ASPECT_XCORRECTION(x)  ( ( ((x)<<3) + (x) )  >>2 )   //correction x*screen_buffer_width/screen_width = x*720/320 = x*9/4 = (x<<3 + x)>>2
2149    //~ #undef ASPECT_YCORRECTION
2150    //~ #define ASPECT_YCORRECTION(y)  ( (y) ) //none
2151   
2152    //grids
2153// not used ?
2154//    #define GRIDX 360
2155//    #define GRIDY 240
2156    #undef ASPECT_GRID_XCORRECTION
2157    #define ASPECT_GRID_XCORRECTION(x)  ( ((x)<<3)/9  )  //grids are designed on a 360x240 basis and screen is 320x240, we need x*320/360=x*8/9
2158    #undef ASPECT_GRID_YCORRECTION
2159    #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here.
2160   
2161    //viewport
2162// not used ?
2163//    #define VIEWPORTX 360
2164//    #define VIEWPORTY 240
2165    #undef ASPECT_VIEWPORT_XCORRECTION
2166    #define ASPECT_VIEWPORT_XCORRECTION(x) ASPECT_GRID_XCORRECTION(x) //viewport is 360x240 and screen 320x240, we need x*320/360=x*8/9, equal than grids, used by edgeoverlay
2167    #undef ASPECT_VIEWPORT_YCORRECTION
2168    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
2169    #undef EDGE_HMARGIN
2170    #define EDGE_HMARGIN 20
2171   
2172    //games mappings
2173        // renamed GAMES_SCREEN_WIDTH / GAMES_SCREEN_HEIGHT
2174   #undef GAMES_SCREEN_WIDTH
2175   #undef GAMES_SCREEN_HEIGHT
2176   #define GAMES_SCREEN_WIDTH 360
2177   #define GAMES_SCREEN_HEIGHT 240
2178   #undef ASPECT_GAMES_XCORRECTION
2179   // 720/360=2 same aspect than grids and viewport but another approach: there is a lot of corrections to do in game's code, and we decide to paint directly on display buffer wirh another resolution
2180   // used by gui.c that configures the draw environment (trhough new draw_gui function) depending on gui_mode: we have then 360x240 for games (but deformed output:circles are not circles) and 320x240 for
2181   // other modes in perfect aspect ratio 4/3: slightly better visualization: file menus more readable, ...
2182   #define ASPECT_GAMES_XCORRECTION(x)   ( ((x)<<1) ) 
2183   #undef ASPECT_GAMES_YCORRECTION
2184   #define ASPECT_GAMES_YCORRECTION(y)   ( (y) )  //none
2185   
2186   //zebra letterbox for saving memory
2187   #undef ZEBRA_HMARGIN0
2188   #define ZEBRA_HMARGIN0  30 //this 30 rows are not used by the display buffer is 720x240 effective, no 960x270, i.e. (270-240) reduction in widht possible but not done (more difficult to manage it and slower).
2189     
2190   //end nandoide sept-2009
2191   #define CAM_QUALITY_OVERRIDE 1
2192   #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
2193//----------------------------------------------------------
2194#else
2195    #error camera type not defined
2196
2197#endif
2198
2199// curves only work in 10bpp for now
2200#if CAM_SENSOR_BITS_PER_PIXEL != 10
2201#undef OPT_CURVES
2202#endif
2203
2204#endif /* CAMERA_H */
Note: See TracBrowser for help on using the repository browser.