source: trunk/include/camera.h @ 822

Revision 822, 81.5 KB checked in by reyalp, 4 years ago (diff)

sx110 updates from chdkj in http://chdk.setepontos.com/index.php/topic,2838.msg42208.html#msg42208

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