source: trunk/include/camera.h @ 901

Revision 901, 104.6 KB checked in by fe50, 3 years ago (diff)
  • For now, this Ixus85/SD770 port is commented out in the main makefile - therefore the Autobuild Server will not deliver binaries yet
  • 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) ) // see comments on 200is
83    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )       //no correction
84
85    #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
86    // end of section by nandoid
87
88    #undef CAM_QUALITY_OVERRIDE //camera may need shooting quality override (sx200is lacks SuperFine quality)
89
90
91//----------------------------------------------------------
92// Overridden values for each camera
93//----------------------------------------------------------
94
95//==========================================================
96// G-series
97//==========================================================
98#if   defined (CAMERA_g7)
99    #define CAM_PROPSET                 1
100
101    #define CAM_RAW_ROWPIX              3736   // for 10 MP
102    #define CAM_RAW_ROWS                2772   // for 10 MP
103
104    #undef  CAM_USE_ZOOM_FOR_MF
105    #define CAM_ADJUSTABLE_ALT_BUTTON   1
106    #define CAM_MULTIPART               1
107    #define CAM_HAS_ND_FILTER           1
108    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
109    #define CAM_HAS_JOGDIAL             1
110    #define DNG_SUPPORT                 1
111    // pattern
112    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
113    // color
114    #define CAM_COLORMATRIX1                              \
115      575419, 1000000,-185557, 1000000, -77898,  1000000, \
116     -213702, 1000000, 733569, 1000000,   81514, 1000000, \
117      -24604, 1000000, 131906, 1000000,  280378, 1000000
118
119    #define cam_CalibrationIlluminant1 1 // Daylight
120    // cropping
121    #define CAM_JPEG_WIDTH  3648
122    #define CAM_JPEG_HEIGHT 2736
123    #define CAM_ACTIVE_AREA_X1 14
124    #define CAM_ACTIVE_AREA_Y1 8
125    #define CAM_ACTIVE_AREA_X2 3682
126    #define CAM_ACTIVE_AREA_Y2 2764
127    // camera name
128    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
129    #define CAM_BRACKETING              1   
130    #define DNG_EXT_FROM ".DPS"
131//----------------------------------------------------------
132
133#elif defined (CAMERA_g9)
134    #define CAM_PROPSET                 2
135    #define CAM_DRYOS                   1
136
137    #define CAM_RAW_ROWPIX              4104   // for 12 MP
138    #define CAM_RAW_ROWS                3048   // for 12 MP
139    #define CAM_HAS_ND_FILTER           1
140    #define CAM_ADJUSTABLE_ALT_BUTTON   1
141    #undef  CAM_EMUL_KEYPRESS_DURATION
142    #define CAM_EMUL_KEYPRESS_DURATION  10
143    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
144    #define CAM_HAS_JOGDIAL             1
145//  #define CAM_CONSOLE_LOG_ENABLED     1
146    #define CAM_BRACKETING              1
147    #define CAM_MULTIPART               1
148    #define CAM_EXT_TV_RANGE            1
149//----------------------------------------------------------
150
151
152//==========================================================
153// A-series
154//==========================================================
155#elif defined (CAMERA_a450)
156    #define CAM_PROPSET                 2
157
158    #define CAM_RAW_ROWPIX              2664   // for 5 MP 1/3" sensor size
159    #define CAM_RAW_ROWS                1968   // for 5 MP 1/3" sensor size
160
161    #undef  CAM_USE_ZOOM_FOR_MF
162    #undef  CAM_HAS_ZOOM_LEVER
163    #define CAM_DRAW_EXPOSITION         1
164    #undef  CAM_HAS_ERASE_BUTTON
165    #undef  CAM_HAS_IRIS_DIAPHRAGM
166    #define CAM_HAS_ND_FILTER           1
167    #undef  CAM_HAS_MANUAL_FOCUS
168    #undef  CAM_HAS_USER_TV_MODES
169    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
170    #undef  CAM_HAS_IS
171    #define CAM_CAN_MUTE_MICROPHONE     1
172    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
173    #define CAM_EV_IN_VIDEO             1
174    #define DNG_SUPPORT                 1
175    // pattern
176    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
177    // color
178    #define CAM_COLORMATRIX1                               \
179      652279,  1000000,-199279, 1000000, -101833, 1000000, \
180     -159819,  1000000, 619308, 1000000,   78172, 1000000, \
181      -58827,  1000000, 150963, 1000000,  264216, 1000000
182
183    #define cam_CalibrationIlluminant1 1 // Daylight
184    // cropping
185    #define CAM_JPEG_WIDTH  2592
186    #define CAM_JPEG_HEIGHT 1944
187    #define CAM_ACTIVE_AREA_X1 6
188    #define CAM_ACTIVE_AREA_Y1 6
189    #define CAM_ACTIVE_AREA_X2 2618
190    #define CAM_ACTIVE_AREA_Y2 1962
191    // camera name
192    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
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_a480)
279    #define CAM_PROPSET                 2
280    #define CAM_DRYOS                   1
281
282    #define CAM_RAW_ROWPIX              3720   
283    #define CAM_RAW_ROWS                2772   
284
285    #undef  CAM_USE_ZOOM_FOR_MF
286    #undef  CAM_HAS_ERASE_BUTTON
287    #undef  CAM_HAS_IRIS_DIAPHRAGM
288    #define CAM_HAS_ND_FILTER           1
289    #undef  CAM_HAS_MANUAL_FOCUS
290    #undef  CAM_HAS_USER_TV_MODES
291    #undef  CAM_HAS_IS
292    #define CAM_MULTIPART               1
293    #undef  CAM_VIDEO_CONTROL
294    #define CAM_REAR_CURTAIN            1
295    #undef  DEFAULT_RAW_EXT
296    #define DEFAULT_RAW_EXT             2   // use .CR2
297    #define CAM_EXT_TV_RANGE            1
298    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
299    #define CAM_CAN_MUTE_MICROPHONE     1
300    #define CAM_EV_IN_VIDEO             1
301
302    #define DNG_SUPPORT                 1
303    // pattern
304    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
305    // color
306
307    #define CAM_COLORMATRIX1                               \
308      827547, 1000000, -290458, 1000000, -126086, 1000000, \
309     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
310      5181,   1000000, 48183,   1000000, 245014,  1000000
311
312    #define cam_CalibrationIlluminant1 1 // Daylight
313    // cropping
314    #define CAM_JPEG_WIDTH  3648
315    #define CAM_JPEG_HEIGHT 2736
316    #define CAM_ACTIVE_AREA_X1 6
317    #define CAM_ACTIVE_AREA_Y1 12
318    #define CAM_ACTIVE_AREA_X2 3690
319    #define CAM_ACTIVE_AREA_Y2 2772
320
321    // camera name
322    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
323    #undef  CAM_SENSOR_BITS_PER_PIXEL
324    #undef  CAM_WHITE_LEVEL
325    #undef  CAM_BLACK_LEVEL
326    #define CAM_SENSOR_BITS_PER_PIXEL   12
327    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
328    #define CAM_BLACK_LEVEL             127
329//----------------------------------------------------------
330
331#elif defined (CAMERA_a530)
332    #define CAM_PROPSET                 1
333
334//  2672x1968 image - like most other 5m sensors
335    #define CAM_RAW_ROWPIX              2672   // for 5 MP
336    #define CAM_RAW_ROWS                1968   // for 5 MP
337//  2672x1992 image - eventually probably real sensor size
338//  #define CAM_RAW_ROWPIX              2672   // for 5 MP
339//  #define CAM_RAW_ROWS                1992   // for 5 MP
340
341    #undef  CAM_USE_ZOOM_FOR_MF
342    #define CAM_HAS_ERASE_BUTTON        1
343    #undef  CAM_HAS_IRIS_DIAPHRAGM
344    #define CAM_HAS_ND_FILTER           1
345    #define CAM_HAS_MANUAL_FOCUS        1
346    #define CAM_DRAW_EXPOSITION         1
347    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
348    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
349    #undef  CAM_HAS_IS
350    #define CAM_CAN_MUTE_MICROPHONE     1
351    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
352    #define CAM_EV_IN_VIDEO             1
353    #define DNG_SUPPORT                 1
354    // pattern
355    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
356    // color
357    #define CAM_COLORMATRIX1                               \
358      725264,  1000000,-240542, 1000000, -122310, 1000000, \
359     -210248,  1000000, 656077, 1000000,  52390,  1000000, \
360      -11282,  1000000, 70400,  1000000,  300712, 1000000
361
362    #define cam_CalibrationIlluminant1 1 // Daylight
363    // cropping
364    #define CAM_JPEG_WIDTH  2592
365    #define CAM_JPEG_HEIGHT 1944
366    #define CAM_ACTIVE_AREA_X1 12
367    #define CAM_ACTIVE_AREA_Y1 20
368    #define CAM_ACTIVE_AREA_X2 2628
369    #define CAM_ACTIVE_AREA_Y2 1968
370    // camera name
371    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
372    #define DNG_EXT_FROM ".DPS"
373
374    #define CAM_EXT_TV_RANGE            1
375//----------------------------------------------------------
376
377#elif defined (CAMERA_a540)
378    #define CAM_PROPSET                 1
379
380    #define CAM_RAW_ROWPIX              2888   // for 6 MP
381    #define CAM_RAW_ROWS                2136   // for 6 MP
382
383    #undef  CAM_USE_ZOOM_FOR_MF
384    #define CAM_HAS_ERASE_BUTTON        1
385    #define CAM_HAS_IRIS_DIAPHRAGM      1
386    #undef  CAM_HAS_ND_FILTER
387    #define CAM_HAS_MANUAL_FOCUS        1
388    #undef  CAM_DRAW_EXPOSITION
389    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
390    #undef  CAM_HAS_IS
391    #define CAM_CAN_MUTE_MICROPHONE     1
392    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
393    #define CAM_EV_IN_VIDEO             1
394    #define DNG_SUPPORT                 1
395    // pattern
396    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
397    // color
398    #define CAM_COLORMATRIX1                               \
399      687147,  1000000,-201964, 1000000, -125024, 1000000, \
400     -148403,  1000000, 566810, 1000000,   45401, 1000000, \
401     -9472,    1000000, 63186,  1000000,  208602, 1000000
402
403    #define cam_CalibrationIlluminant1 1 // Daylight
404    // cropping
405    #define CAM_JPEG_WIDTH  2816
406    #define CAM_JPEG_HEIGHT 2112
407    #define CAM_ACTIVE_AREA_X1 44
408    #define CAM_ACTIVE_AREA_Y1 8
409    #define CAM_ACTIVE_AREA_X2 2884
410    #define CAM_ACTIVE_AREA_Y2 2136
411    // camera name
412    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
413    #define DNG_EXT_FROM ".DPS"
414
415    #define CAM_EXT_TV_RANGE            1
416//----------------------------------------------------------
417
418#elif defined (CAMERA_a550)
419    #define CAM_PROPSET                 2
420
421    #define CAM_RAW_ROWPIX              3152   // for 7 MP
422    #define CAM_RAW_ROWS                2340   // for 7 MP
423
424    #undef  CAM_USE_ZOOM_FOR_MF
425    #define CAM_MULTIPART               1
426    #undef  CAM_HAS_ERASE_BUTTON
427    #undef  CAM_HAS_IRIS_DIAPHRAGM
428    #define CAM_HAS_ND_FILTER           1
429    #undef  CAM_HAS_MANUAL_FOCUS
430    #undef  CAM_HAS_USER_TV_MODES
431    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
432    #undef  CAM_HAS_IS
433    #define CAM_CAN_MUTE_MICROPHONE     1
434    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
435    #define DNG_SUPPORT                 1
436    // pattern
437    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
438    // color
439    #define CAM_COLORMATRIX1                               \
440      673251,  1000000,-200684, 1000000, -98680, 1000000,  \
441     -163638,  1000000, 651247, 1000000,  74004, 1000000,  \
442      14221,   1000000, 52979,  1000000, 265291, 1000000
443
444    #define cam_CalibrationIlluminant1 1 // Daylight
445    // cropping
446    #define CAM_JPEG_WIDTH  3072
447    #define CAM_JPEG_HEIGHT 2304
448    #define CAM_ACTIVE_AREA_X1 36
449    #define CAM_ACTIVE_AREA_Y1 12
450    #define CAM_ACTIVE_AREA_X2 3148
451    #define CAM_ACTIVE_AREA_Y2 2340
452    // camera name
453    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
454    #define DNG_EXT_FROM ".DPS"
455
456    #define CAM_EXT_TV_RANGE            1
457//----------------------------------------------------------
458
459#elif defined (CAMERA_a560)
460    #define CAM_PROPSET                 2
461
462    #define CAM_RAW_ROWPIX              3152   // for 7 MP
463    #define CAM_RAW_ROWS                2340   // for 7 MP
464
465    #undef  CAM_USE_ZOOM_FOR_MF
466    #define CAM_MULTIPART               1
467    #undef  CAM_HAS_ERASE_BUTTON
468    #undef  CAM_HAS_IRIS_DIAPHRAGM
469    #define CAM_HAS_ND_FILTER           1
470    #undef  CAM_HAS_MANUAL_FOCUS
471    #undef  CAM_HAS_USER_TV_MODES
472    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
473    #undef  CAM_HAS_IS
474    #define CAM_CAN_MUTE_MICROPHONE     1
475    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
476    #define DNG_SUPPORT                 1
477    // pattern
478    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
479    // color
480    #define CAM_COLORMATRIX1                               \
481      15265, 1, -6193, 1, -1558, 1,                        \
482     -4125,  1, 12116, 1,  2010, 1,                        \
483     -888,   1, 1639,  1,  5220, 1                         
484   
485    #define cam_CalibrationIlluminant1 17 // Standard light A
486    // cropping
487    #define CAM_JPEG_WIDTH  3072
488    #define CAM_JPEG_HEIGHT 2304
489    #define CAM_ACTIVE_AREA_X1 38
490    #define CAM_ACTIVE_AREA_Y1 14
491    #define CAM_ACTIVE_AREA_X2 3146
492    #define CAM_ACTIVE_AREA_Y2 2338
493    // camera name
494    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
495    #define DNG_EXT_FROM ".DPS"
496
497    #define CAM_EXT_TV_RANGE            1
498//----------------------------------------------------------
499
500#elif defined (CAMERA_a570)
501    #define CAM_PROPSET                 2
502
503    #define CAM_RAW_ROWPIX              3152   // for 7 MP
504    #define CAM_RAW_ROWS                2340   // for 7 MP
505    #define CAM_MULTIPART               1
506    #define CAM_CAN_MUTE_MICROPHONE     1
507    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
508    #define CAM_EV_IN_VIDEO             1
509    #define DNG_SUPPORT                 1
510    #define CAM_REAR_CURTAIN            1
511    // pattern
512    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
513    // color
514    #define CAM_COLORMATRIX1                               \
515      528283,  1000000,-144259, 1000000, -85966, 1000000,  \
516     -202789,  1000000, 736563, 1000000,  73008, 1000000,  \
517     -27130,   1000000, 107702, 1000000, 264543, 1000000
518
519    #define cam_CalibrationIlluminant1 1 // Daylight
520    // cropping
521    #define CAM_JPEG_WIDTH  3072
522    #define CAM_JPEG_HEIGHT 2304
523    #define CAM_ACTIVE_AREA_X1 38
524    #define CAM_ACTIVE_AREA_Y1 14
525    #define CAM_ACTIVE_AREA_X2 3146
526    #define CAM_ACTIVE_AREA_Y2 2338
527    // camera name
528    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
529
530    #define DNG_EXT_FROM ".DPS"
531    #define CAM_EXT_TV_RANGE            1
532//----------------------------------------------------------
533
534#elif defined (CAMERA_a590)
535#define CAM_PROPSET                 2
536#define CAM_DRYOS                   1
537
538#define CAM_RAW_ROWPIX              3336   // for new 8 MP
539#define CAM_RAW_ROWS                2480   // for new 8 MP
540
541#define CAM_USE_ZOOM_FOR_MF         1
542
543#define CAM_CAN_MUTE_MICROPHONE     1
544#define CAM_HAS_IRIS_DIAPHRAGM      1
545#undef  CAM_HAS_ND_FILTER
546
547#define CAM_HAS_MANUAL_FOCUS        1
548
549#define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
550//#define CAM_EV_IN_VIDEO             1      // not working on 101b!!!
551#define DNG_SUPPORT                 1
552// pattern
553#define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
554// color                                                     
555#define CAM_COLORMATRIX1                              \
556 726857, 1000000, -176454, 1000000, -124118, 1000000, \
557 -71340, 1000000,  592001, 1000000,   75622, 1000000, \
558  63222, 1000000,   50547, 1000000,  219582, 1000000
559
560#define cam_CalibrationIlluminant1 1 // Daylight
561// cropping
562#define CAM_JPEG_WIDTH  3264
563#define CAM_JPEG_HEIGHT 2448
564#define CAM_ACTIVE_AREA_X1 12
565#define CAM_ACTIVE_AREA_Y1 10
566// note: the above contains some pixels which have valid data,
567// but are not at the same levels as the rest of the frame
568// the values below crop the "different" looking pixels.
569//#define CAM_ACTIVE_AREA_X1 16
570//#define CAM_ACTIVE_AREA_Y1 18
571#define CAM_ACTIVE_AREA_X2 3300
572#define CAM_ACTIVE_AREA_Y2 2480
573
574// camera name
575#define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
576
577#define CAM_EXT_TV_RANGE            1
578#define CAM_MULTIPART               1
579//----------------------------------------------------------
580
581#elif defined (CAMERA_a610)
582    #define CAM_PROPSET                 1
583
584    #define CAM_RAW_ROWPIX              2672   // for 5 MP
585    #define CAM_RAW_ROWS                1968   // for 5 MP
586   
587    #define CAM_SWIVEL_SCREEN           1
588    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
589    #undef  CAM_HAS_IS
590    #define CAM_CAN_MUTE_MICROPHONE     1
591    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
592    #define CAM_EV_IN_VIDEO             1
593    #define DNG_SUPPORT                 1
594    // pattern
595    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
596    // color
597    #define CAM_COLORMATRIX1                               \
598      15887,  10000, -6524, 10000, -1622, 10000,           \
599     -5467,   10000, 13449, 10000,  2209, 10000,           \
600     -1325,   10000, 1859,  10000,  5172, 10000
601   
602    #define cam_CalibrationIlluminant1 17 // Standard light A
603    // cropping
604    #define CAM_JPEG_WIDTH  2592
605    #define CAM_JPEG_HEIGHT 1944
606    #define CAM_ACTIVE_AREA_X1 14
607    #define CAM_ACTIVE_AREA_Y1 10
608    #define CAM_ACTIVE_AREA_X2 2626
609    #define CAM_ACTIVE_AREA_Y2 1966
610    // camera name
611    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
612
613    #define DNG_EXT_FROM ".DPS"
614//----------------------------------------------------------
615
616#elif defined (CAMERA_a620)
617    #define CAM_PROPSET                 1
618
619    #define CAM_RAW_ROWPIX              3152   // for 7 MP
620    #define CAM_RAW_ROWS                2340   // for 7 MP
621
622    #define CAM_SWIVEL_SCREEN           1
623    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
624    #undef  CAM_HAS_IS   
625    #define CAM_CAN_MUTE_MICROPHONE     1
626    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
627    #define CAM_EV_IN_VIDEO             1
628    #define DNG_SUPPORT                 1
629    // pattern
630    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
631    // color
632    #define CAM_COLORMATRIX1                               \
633     15265, 10000, -6193, 10000, -1558, 10000,             \
634     -4125, 10000, 12116, 10000,  2010, 10000,             \
635     -888,  10000,  1639, 10000,  5220, 10000
636
637    #define cam_CalibrationIlluminant1 17 // Standard light A
638    // cropping
639    #define CAM_JPEG_WIDTH  3072
640    #define CAM_JPEG_HEIGHT 2304
641    #define CAM_ACTIVE_AREA_X1 38
642    #define CAM_ACTIVE_AREA_Y1 14
643    #define CAM_ACTIVE_AREA_X2 3146
644    #define CAM_ACTIVE_AREA_Y2 2338
645    // camera name
646    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
647    #define DNG_EXT_FROM ".DPS"
648//----------------------------------------------------------
649
650#elif defined (CAMERA_a630)
651    #define CAM_PROPSET                 1
652
653    #define CAM_RAW_ROWPIX              3344   // for 8 MP
654    #define CAM_RAW_ROWS                2484   // for 8 MP
655   
656    #define CAM_SWIVEL_SCREEN           1
657    #define CAM_MULTIPART               1
658    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
659    #undef  CAM_HAS_IS
660    #define CAM_CAN_MUTE_MICROPHONE     1
661    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
662    #define CAM_EV_IN_VIDEO             1
663    #define DNG_SUPPORT                 1
664    // pattern
665    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
666    // color
667    #define CAM_COLORMATRIX1                               \
668      656080,  1000000,-226478, 1000000, -85884, 1000000,  \
669     -194636,  1000000, 687905, 1000000,  37862, 1000000,  \
670       22873,  1000000,  75523, 1000000, 265822, 1000000
671   
672    #define cam_CalibrationIlluminant1 1 // Daylight
673    // cropping
674    #define CAM_JPEG_WIDTH  3264
675    #define CAM_JPEG_HEIGHT 2448
676    #define CAM_ACTIVE_AREA_X1 14
677    #define CAM_ACTIVE_AREA_Y1 8
678    #define CAM_ACTIVE_AREA_X2 3298
679    #define CAM_ACTIVE_AREA_Y2 2476
680    // camera name
681    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
682    #define DNG_EXT_FROM ".DPS"
683    #define CAM_EXT_TV_RANGE            1
684//----------------------------------------------------------
685
686#elif defined (CAMERA_a640)
687    #define CAM_PROPSET                 1
688
689    #define CAM_RAW_ROWPIX              3736   // for 10 MP
690    #define CAM_RAW_ROWS                2772   // for 10 MP
691   
692    #define CAM_SWIVEL_SCREEN           1
693    #define CAM_MULTIPART               1
694    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
695    #undef  CAM_HAS_IS
696    #define CAM_CAN_MUTE_MICROPHONE     1
697    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
698    #define CAM_EV_IN_VIDEO             1
699    #define DNG_SUPPORT                 1
700    // pattern
701    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
702    // color
703    #define CAM_COLORMATRIX1                               \
704      13124,  10000, -5329, 10000, -1390, 10000,           \
705      -3602,  10000, 11658, 10000,  1944, 10000,           \
706      -1612,  10000,  2863, 10000,  4885, 10000
707   
708    #define cam_CalibrationIlluminant1 17 // Standard light A
709    // cropping
710    #define CAM_JPEG_WIDTH  3648
711    #define CAM_JPEG_HEIGHT 2736
712    #define CAM_ACTIVE_AREA_X1 14
713    #define CAM_ACTIVE_AREA_Y1 8
714    #define CAM_ACTIVE_AREA_X2 3682
715    #define CAM_ACTIVE_AREA_Y2 2764
716    // camera name
717    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
718    #define DNG_EXT_FROM ".DPS"
719//----------------------------------------------------------
720
721#elif defined (CAMERA_a650)
722    #define CAM_PROPSET                 2
723    #define CAM_DRYOS                   1
724
725    #define CAM_RAW_ROWPIX              4104   // for 12 MP
726    #define CAM_RAW_ROWS                3048   // for 12 MP
727   
728    #define CAM_ADJUSTABLE_ALT_BUTTON   1
729    #define CAM_SWIVEL_SCREEN           1
730    #define CAM_CAN_MUTE_MICROPHONE     1
731
732    #undef  CAM_EMUL_KEYPRESS_DURATION
733    #define CAM_EMUL_KEYPRESS_DURATION  10
734    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
735    #define CAM_EV_IN_VIDEO             1
736    #define DNG_SUPPORT                 1
737    // pattern
738    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
739    // color
740    #define CAM_COLORMATRIX1                               \
741      913762, 1000000, -261578, 1000000, -135582, 1000000, \
742     -99049,  1000000, 1067089, 1000000,   61442, 1000000, \
743      48717,  1000000, 96802,   1000000,  412056, 1000000
744   
745    #define cam_CalibrationIlluminant1 1 // Daylight
746    // cropping
747    #define CAM_JPEG_WIDTH  4000
748    #define CAM_JPEG_HEIGHT 3000
749    #define CAM_ACTIVE_AREA_X1 52
750    #define CAM_ACTIVE_AREA_Y1 14
751    #define CAM_ACTIVE_AREA_X2 4076
752    #define CAM_ACTIVE_AREA_Y2 3030
753    // camera name
754    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
755
756    #define DNG_EXT_FROM ".CR2"
757//----------------------------------------------------------
758
759#elif defined (CAMERA_a700)
760    #define CAM_PROPSET                 1
761
762    #define CAM_RAW_ROWPIX              2888   // for 6 MP
763    #define CAM_RAW_ROWS                2136   // for 6 MP
764
765    #undef  CAM_HAS_IS
766    #define CAM_CAN_MUTE_MICROPHONE     1
767    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
768    #define CAM_EV_IN_VIDEO             1
769    #define DNG_SUPPORT                 1
770    // pattern
771    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
772    // color
773    #define CAM_COLORMATRIX1                               \
774     14062, 10000, -5199, 10000, -1446, 10000,             \
775     -4712, 10000, 12470, 10000,  2243, 10000,             \
776     -1286, 10000,  2028, 10000,  4836, 10000
777   
778    #define cam_CalibrationIlluminant1 17 // Standard light A
779    // cropping
780    #define CAM_JPEG_WIDTH  2816
781    #define CAM_JPEG_HEIGHT 2112
782    #define CAM_ACTIVE_AREA_X1 44
783    #define CAM_ACTIVE_AREA_Y1 8
784    #define CAM_ACTIVE_AREA_X2 2884
785    #define CAM_ACTIVE_AREA_Y2 2136
786    // camera name
787    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
788    #define DNG_EXT_FROM ".DPS"
789//----------------------------------------------------------
790
791#elif defined (CAMERA_a710)
792    #define CAM_PROPSET                 1
793
794    #define CAM_RAW_ROWPIX              3152   // for 7 MP
795    #define CAM_RAW_ROWS                2340   // for 7 MP
796
797    #define CAM_MULTIPART               1
798    #define CAM_CAN_MUTE_MICROPHONE     1
799    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
800    #define CAM_EV_IN_VIDEO             1
801    #define DNG_SUPPORT                 1
802    // pattern
803    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
804    // color
805    #define CAM_COLORMATRIX1                   \
806     13349, 10000, -4141, 10000, -2128, 10000, \
807     -4189, 10000, 13178, 10000,  1044, 10000, \
808     -1037, 10000,  2326, 10000,  4720, 10000   
809   
810    #define cam_CalibrationIlluminant1 1 // Daylight
811    // cropping
812    #define CAM_JPEG_WIDTH  3072
813    #define CAM_JPEG_HEIGHT 2304
814    #define CAM_ACTIVE_AREA_X1 38
815    #define CAM_ACTIVE_AREA_Y1 14
816    #define CAM_ACTIVE_AREA_X2 3146
817    #define CAM_ACTIVE_AREA_Y2 2338
818    // camera name
819    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
820
821    #define DNG_EXT_FROM ".DPS"
822
823    #define CAM_EXT_TV_RANGE            1
824//----------------------------------------------------------
825
826#elif defined (CAMERA_a720)
827    #define CAM_PROPSET                 2
828    #define CAM_DRYOS                   1
829
830    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
831    #define CAM_RAW_ROWS                2480   // for new 8 MP
832    #define CAM_CAN_MUTE_MICROPHONE     1
833    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
834    #define CAM_EV_IN_VIDEO             1
835    #undef  CAM_VIDEO_CONTROL
836    #define DNG_SUPPORT                 1
837    // pattern
838    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
839    // color
840    #define CAM_COLORMATRIX1                               \
841      640019, 1000000, -220031, 1000000, -96241, 1000000,  \
842     -77419,  1000000, 639766,  1000000,  44009, 1000000,  \
843      17965,  1000000, 78396,   1000000, 231868, 1000000
844   
845    #define cam_CalibrationIlluminant1 1 // Daylight
846    // cropping
847    #define CAM_JPEG_WIDTH  3264
848    #define CAM_JPEG_HEIGHT 2448
849    #define CAM_ACTIVE_AREA_X1 10
850    #define CAM_ACTIVE_AREA_Y1 8
851    #define CAM_ACTIVE_AREA_X2 3302
852    #define CAM_ACTIVE_AREA_Y2 2474
853    // camera name
854    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
855
856    #define DNG_EXT_FROM ".CR2"
857//----------------------------------------------------------
858
859#elif defined (CAMERA_a2000)
860        ////////////////////////////////
861        // Sure values
862        ////////////////////////////////
863    #define CAM_PROPSET                 2
864    #define CAM_DRYOS                   1
865
866    #define CAM_RAW_ROWPIX              3720 
867    #define CAM_RAW_ROWS                2772 
868
869    #define CAM_JPEG_WIDTH  3648
870    #define CAM_JPEG_HEIGHT 2736
871
872    #define DNG_SUPPORT                 1
873
874    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
875
876    #undef  CAM_HAS_IRIS_DIAPHRAGM
877    #define CAM_HAS_ND_FILTER           1
878
879    ////////////////////////////////
880    // Almost sure, sensor data taken from
881    // ixus870_sd880 which should have same sensor..
882    ////////////////////////////////
883    #undef CAM_SENSOR_BITS_PER_PIXEL
884    #undef CAM_WHITE_LEVEL
885    #undef CAM_BLACK_LEVEL
886    #define CAM_SENSOR_BITS_PER_PIXEL   12
887    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
888    #define CAM_BLACK_LEVEL             127
889
890    #define cam_CFAPattern              0x02010100 // Red  Green  Green  Blue
891    #define CAM_COLORMATRIX1                               \
892      827547, 1000000, -290458, 1000000, -126086, 1000000, \
893     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
894      5181,   1000000, 48183,   1000000, 245014,  1000000
895    #define cam_CalibrationIlluminant1  1 // Daylight
896
897    // cropping (from ixus870_sd880)
898    #define CAM_ACTIVE_AREA_X1          14
899    #define CAM_ACTIVE_AREA_Y1          8
900    #define CAM_ACTIVE_AREA_X2          3682
901    #define CAM_ACTIVE_AREA_Y2          2764
902
903    #undef  CAM_HAS_MANUAL_FOCUS
904// for the purposes of CHDK, the FACE button is treated as the erase button
905//    #undef  CAM_HAS_ERASE_BUTTON
906//----------------------------------------------------------
907
908#elif defined (CAMERA_d10)
909    #define CAM_PROPSET                 2
910    #define CAM_DRYOS                   1
911
912    #define CAM_RAW_ROWPIX              4104            // 12 MP 12bpp
913    #define CAM_RAW_ROWS                3048            // from " CrwAddress %lx, CrwSize H %ld V %ld\r"
914
915    #undef  CAM_HAS_ERASE_BUTTON
916    #undef  CAM_USE_ZOOM_FOR_MF
917// TODO
918//    #define CAM_MULTIPART               1
919    #undef  CAM_HAS_IRIS_DIAPHRAGM
920    #define CAM_HAS_ND_FILTER           1
921
922// TODO
923    #undef CAM_REMOTE
924    #undef CAM_SYNCH
925
926    #define CAM_HAS_ZOOM_LEVER          1 // note, has zoom in/out buttons, not lever
927
928// TODO
929    #undef CAM_CHDK_HAS_EXT_VIDEO_MENU   // In CHDK for this camera realized adjustable video compression
930// TODO
931//    #define CAM_CAN_SD_OVER_NOT_IN_MF   1                     // Camera allows subject distance (focus) override when not in manual focus mode
932//    #define CAM_CAN_SD_OVERRIDE         1                     // Camera allows to do subject distance override
933
934    #define CAM_HAS_MANUAL_FOCUS                1
935// long shutter is acutally user TV
936    #undef      CAM_HAS_USER_TV_MODES
937    #define CAM_SHOW_OSD_IN_SHOOT_MENU            1
938//    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO  1
939 //   #define CAM_AF_SCAN_DURING_VIDEO_RECORD       1
940//    #define CAM_CHDK_HAS_EXT_VIDEO_MENU           1
941
942    #define CAM_HAS_IS                  1
943    #undef CAM_HAS_JOGDIAL
944
945    #undef  CAM_VIDEO_CONTROL
946    #define CAM_VIDEO_QUALITY_ONLY      1
947// TODO
948//    #define DNG_SUPPORT                 1
949
950//    #define CAM_EXT_TV_RANGE            1
951
952    #undef CAM_UNCACHED_BIT
953    #define CAM_UNCACHED_BIT            0x40000000
954
955    #undef CAM_BITMAP_PALETTE
956// OK looks similar to ixus100 based on forum posts
957    #define CAM_BITMAP_PALETTE          5
958
959// TODO all zebra stuff
960//    #undef ZEBRA_HMARGIN0
961//    #define ZEBRA_HMARGIN0              150                   //zebra adjust buffer height: show use at sx200is: needed for save memory space
962
963//    #define CAM_QUALITY_OVERRIDE 1
964    #undef CAM_SENSOR_BITS_PER_PIXEL
965    #define CAM_SENSOR_BITS_PER_PIXEL   12
966    #undef CAM_WHITE_LEVEL
967    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
968    #undef CAM_BLACK_LEVEL
969    #define CAM_BLACK_LEVEL             127
970
971        //all DNG stuff TODO, copied from ixus 100. Ixus960 may be closer, same sesnor res
972    // pattern
973    //RealRom:FFA99FB4                    ADR     R0, aObRG1G2BLdLdLd ; "\n  OB : (R, G1, G2, B) = (%ld, %ld, %ld"...
974    #define cam_CFAPattern              0x02010100              // Red  Green  Green  Blue
975
976    // color preliminary (see DNG4PS2 wiki)
977    #define CAM_COLORMATRIX1                               \
978      661840,  1000000, -185671, 1000000, -97110,  1000000, \
979      -83661,  1000000, 578860, 1000000,   32308,  1000000, \
980      -8681,    1000000, 70356,   1000000, 207341, 1000000
981
982    //Here is an alternate CAM_COLORMATRIX1 - Current one is nice for me but hey I'm no colour expert.
983    //XYZ -> Camera matrix:
984    //0.459395 -0.129083 -0.068085
985    //-0.055837 0.400827 0.020378
986    //-0.004622 0.048662 0.139970
987
988    #define cam_CalibrationIlluminant1  17                      // Standard Light A
989
990        // cropping
991    #define CAM_JPEG_WIDTH              4000
992    #define CAM_JPEG_HEIGHT             3000
993    #define CAM_ACTIVE_AREA_X1          40
994    #define CAM_ACTIVE_AREA_Y1          24
995    #define CAM_ACTIVE_AREA_X2          4056
996    #define CAM_ACTIVE_AREA_Y2          3040
997
998    // camera name OK
999    #define PARAM_CAMERA_NAME           4                       // parameter number for GetParameterData
1000//----------------------------------------------------------
1001
1002
1003//==========================================================
1004// SD-Series (IXUS-Series)
1005//==========================================================
1006#elif defined (CAMERA_ixus40_sd300)
1007    #define CAM_PROPSET                 1
1008
1009    #define CAM_RAW_ROWPIX              2400
1010    #define CAM_RAW_ROWS                1766
1011
1012    #define CAM_USE_ZOOM_FOR_MF 1
1013    #undef  CAM_HAS_ERASE_BUTTON
1014    #undef  CAM_HAS_IRIS_DIAPHRAGM
1015    #define CAM_HAS_ND_FILTER           1
1016    #undef  CAM_HAS_MANUAL_FOCUS
1017    #undef  CAM_HAS_USER_TV_MODES
1018    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1019    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1020    #undef  CAM_HAS_IS
1021    #undef CAM_CONSOLE_LOG_ENABLED
1022
1023
1024    #define DNG_SUPPORT                 1
1025    // pattern
1026    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1027    // color
1028    #define CAM_COLORMATRIX1                                 \
1029      652674,  1000000, -172074, 1000000, -107575,  1000000, \
1030      -139063, 1000000, 594517,  1000000,  60252,   1000000, \
1031      -9088,   1000000, 82013,   1000000,  238080,  1000000
1032   
1033    #define cam_CalibrationIlluminant1 1 // Daylight
1034    // cropping
1035    #define CAM_JPEG_WIDTH  2272
1036    #define CAM_JPEG_HEIGHT 1704
1037    #define CAM_ACTIVE_AREA_X1 12
1038    #define CAM_ACTIVE_AREA_Y1 12
1039    #define CAM_ACTIVE_AREA_X2 2356
1040    #define CAM_ACTIVE_AREA_Y2 1764
1041    // camera name
1042    #define PARAM_CAMERA_NAME 2 // parameter number for GetParameterData
1043//----------------------------------------------------------
1044
1045#elif defined (CAMERA_ixus50_sd400)
1046    #define CAM_PROPSET                 1
1047
1048    #define CAM_RAW_ROWPIX              2672   // for 5 MP
1049    #define CAM_RAW_ROWS                1968   // for 5 MP
1050
1051    #undef  CAM_SYNCH 
1052    #undef  CAM_USE_ZOOM_FOR_MF
1053    #undef  CAM_HAS_ERASE_BUTTON
1054    #undef  CAM_HAS_IRIS_DIAPHRAGM
1055    #define CAM_HAS_ND_FILTER           1
1056    #undef  CAM_HAS_MANUAL_FOCUS
1057    #undef  CAM_HAS_USER_TV_MODES
1058    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1059    #undef  CAM_HAS_IS
1060        //#define CAM_CONSOLE_LOG_ENABLED     1
1061    #undef  CAM_VIDEO_CONTROL
1062    #define DNG_SUPPORT                 1
1063    // pattern
1064    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1065    // color
1066    #define CAM_COLORMATRIX1                                  \
1067      685247,  1000000, -204939,  1000000, -106531,  1000000, \
1068     -267616,  1000000,  790509,  1000000,   73359,  1000000, \
1069       32401,  1000000,   15655,  1000000,  314892,  1000000
1070   
1071    #define cam_CalibrationIlluminant1 1 // Daylight
1072    // cropping
1073    #define CAM_JPEG_WIDTH  2592
1074    #define CAM_JPEG_HEIGHT 1944
1075    #define CAM_ACTIVE_AREA_X1 12
1076    #define CAM_ACTIVE_AREA_Y1 8
1077    #define CAM_ACTIVE_AREA_X2 2628
1078    #define CAM_ACTIVE_AREA_Y2 1968
1079    // camera name
1080    #define PARAM_CAMERA_NAME 2 // parameter number for GetParameterData
1081//----------------------------------------------------------
1082
1083#elif defined (CAMERA_ixusizoom_sd30)
1084    #define CAM_PROPSET                 1
1085
1086    #define CAM_RAW_ROWPIX              2672   // for 5 MP
1087    #define CAM_RAW_ROWS                1968   // for 5 MP
1088
1089    #undef  CAM_SYNCH 
1090    #undef  CAM_USE_ZOOM_FOR_MF
1091    #undef  CAM_HAS_ERASE_BUTTON
1092    #undef  CAM_HAS_IRIS_DIAPHRAGM
1093    #define CAM_HAS_ND_FILTER           1
1094    #undef  CAM_HAS_MANUAL_FOCUS
1095    #undef  CAM_HAS_USER_TV_MODES
1096    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1097    #undef  CAM_HAS_IS
1098        //#define CAM_CONSOLE_LOG_ENABLED     1
1099    #undef  CAM_VIDEO_CONTROL
1100//----------------------------------------------------------
1101
1102#elif defined (CAMERA_ixus55_sd450)
1103    #define CAM_PROPSET                 1
1104
1105    #define CAM_RAW_ROWPIX              2672   // for 5 MP
1106    #define CAM_RAW_ROWS                1968   // for 5 MP
1107
1108    #undef  CAM_USE_ZOOM_FOR_MF
1109    #undef  CAM_HAS_ERASE_BUTTON
1110    #undef  CAM_HAS_IRIS_DIAPHRAGM
1111    #define CAM_HAS_ND_FILTER           1
1112    #undef  CAM_HAS_MANUAL_FOCUS
1113    #undef  CAM_HAS_USER_TV_MODES
1114    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1115    #undef  CAM_HAS_IS
1116    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
1117    #define DNG_SUPPORT                 1
1118    // pattern
1119    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1120    // color
1121    #define CAM_COLORMATRIX1                                \
1122      536034,  1000000, -173429, 1000000, -89823,  1000000, \
1123      -290416, 1000000, 735807,  1000000,  47894,  1000000, \
1124      -71455,  1000000, 114314,  1000000,  274533, 1000000         
1125   
1126    #define cam_CalibrationIlluminant1 1 // Daylight
1127    // cropping
1128    #define CAM_JPEG_WIDTH  2592
1129    #define CAM_JPEG_HEIGHT 1944
1130    #define CAM_ACTIVE_AREA_X1 12
1131    #define CAM_ACTIVE_AREA_Y1 8
1132    #define CAM_ACTIVE_AREA_X2 2628
1133    #define CAM_ACTIVE_AREA_Y2 1968
1134    // camera name
1135    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1136    #define DNG_EXT_FROM ".DPS"
1137//----------------------------------------------------------
1138
1139#elif defined (CAMERA_ixus60_sd600)
1140    #define CAM_PROPSET                 1
1141
1142    #define CAM_RAW_ROWPIX              2888   // for 6 MP
1143    #define CAM_RAW_ROWS                2136   // for 6 MP
1144
1145    #undef  CAM_SYNCH
1146    #undef  CAM_USE_ZOOM_FOR_MF
1147    #undef  CAM_HAS_ERASE_BUTTON
1148    #undef  CAM_HAS_IRIS_DIAPHRAGM
1149    #define CAM_HAS_ND_FILTER           1
1150    #undef  CAM_HAS_MANUAL_FOCUS
1151    #undef  CAM_HAS_USER_TV_MODES
1152    #define CAM_DRAW_EXPOSITION             1
1153    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1154    #define CAM_FEATURE_FEATHER         1
1155
1156//    #define CAM_CONSOLE_LOG_ENABLED     1  //100a won't compile if this is defined ("undefined reference to `_iosDevFind'")
1157    #undef  CAM_CHDK_HAS_EXT_VIDEO_MENU
1158    #undef  CAM_HAS_IS
1159    #define DNG_SUPPORT                 1
1160    // pattern
1161    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1162    // color
1163    #define CAM_COLORMATRIX1                                \
1164      767398,  1000000, -227658, 1000000, -144213, 1000000, \
1165      -217466, 1000000, 669319,  1000000,  38180,  1000000, \
1166      -23152,  1000000, 77743,  1000000,   238669, 1000000
1167   
1168    #define cam_CalibrationIlluminant1 1 // Daylight
1169    // cropping
1170    #define CAM_JPEG_WIDTH  2816
1171    #define CAM_JPEG_HEIGHT 2112
1172    #define CAM_ACTIVE_AREA_X1 44
1173    #define CAM_ACTIVE_AREA_Y1 8
1174    #define CAM_ACTIVE_AREA_X2 2884
1175    #define CAM_ACTIVE_AREA_Y2 2136
1176    // camera name
1177    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1178//----------------------------------------------------------
1179
1180#elif defined (CAMERA_ixus65_sd630)
1181    #define CAM_PROPSET                 1
1182
1183    #define CAM_RAW_ROWPIX              2888   // for 6 MP
1184    #define CAM_RAW_ROWS                2136   // for 6 MP
1185
1186    #undef  CAM_USE_ZOOM_FOR_MF
1187    #undef  CAM_HAS_ERASE_BUTTON
1188    #undef  CAM_HAS_IRIS_DIAPHRAGM
1189    #define CAM_HAS_ND_FILTER           1
1190    #undef  CAM_HAS_MANUAL_FOCUS
1191    #undef  CAM_HAS_USER_TV_MODES
1192    #define CAM_DRAW_EXPOSITION             1
1193    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1194    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
1195    #define CAM_FEATURE_FEATHER         1
1196
1197    #define CAM_CONSOLE_LOG_ENABLED     1
1198    #undef  CAM_HAS_IS
1199    #undef  CAM_CHDK_HAS_EXT_VIDEO_MENU
1200    #define DNG_SUPPORT                 1
1201    // pattern
1202    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1203    // color
1204    #define CAM_COLORMATRIX1                                \
1205      783384,  1000000, -227078, 1000000, -127919, 1000000, \
1206      -181247, 1000000, 661743,  1000000,  58868,  1000000, \
1207       25727,  1000000, 43891,   1000000,  247655, 1000000         
1208   
1209    #define cam_CalibrationIlluminant1 1 // Daylight
1210    // cropping
1211    #define CAM_JPEG_WIDTH  2816
1212    #define CAM_JPEG_HEIGHT 2112
1213    #define CAM_ACTIVE_AREA_X1 44
1214    #define CAM_ACTIVE_AREA_Y1 8
1215    #define CAM_ACTIVE_AREA_X2 2884
1216    #define CAM_ACTIVE_AREA_Y2 2136
1217    // camera name
1218    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1219    #define DNG_EXT_FROM ".DPS"
1220//----------------------------------------------------------
1221
1222#elif defined (CAMERA_ixus75_sd750)
1223    #define CAM_PROPSET                 2
1224
1225    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1226    #define CAM_RAW_ROWS                2340   // for 7 MP
1227
1228/*
1229    #undef  CAM_USE_ZOOM_FOR_MF
1230    #undef  CAM_HAS_ERASE_BUTTON
1231    #undef  CAM_HAS_IRIS_DIAPHRAGM
1232    #define CAM_HAS_ND_FILTER           1
1233    #undef  CAM_HAS_MANUAL_FOCUS
1234    #undef  CAM_HAS_USER_TV_MODES
1235    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1236    #undef  CAM_HAS_IS
1237    */
1238   
1239    #undef  CAM_SWIVEL_SCREEN               // Camera has rotated LCD screen
1240    #undef CAM_USE_ZOOM_FOR_MF            // Zoom lever can be used for manual focus adjustments
1241    #undef  CAM_ADJUSTABLE_ALT_BUTTON       // ALT-button can be set from menu
1242    #undef CAM_REMOTE                     // Camera supports USB-remote
1243    #define CAM_MULTIPART               1   // Camera supports SD-card multipartitioning
1244    #define CAM_HAS_ZOOM_LEVER          1   // Camera has dedicated zoom buttons
1245    #undef  CAM_DRAW_EXPOSITION             // Output expo-pair on screen (for cameras which (sometimes) don't do that)
1246    #undef CAM_HAS_ERASE_BUTTON           // Camera has dedicated erase button
1247    #undef  CAM_HAS_IRIS_DIAPHRAGM
1248    #define  CAM_HAS_ND_FILTER         1      // Camera has build-in ND filter
1249    #undef CAM_CAN_SD_OVER_NOT_IN_MF      // Camera allows subject distance (focus) override when not in manual focus mode
1250    #undef CAM_CAN_SD_OVERRIDE            // Camera allows to do subject distance override
1251    #undef CAM_HAS_MANUAL_FOCUS           // Camera has manual focus mode
1252    #define CAM_HAS_USER_TV_MODES       1   // Camera has tv-priority or manual modes with ability to set tv value
1253    #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 
1254//    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO // adress for zoom_status missing, probably more
1255    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO  1 // Camera can unlock optical zoom in video (if it is locked)
1256    #define  CAM_FEATURE_FEATHER        1     // Cameras with "feather" or touch wheel.
1257    #undef CAM_HAS_IS                     // Camera has image stabilizer
1258
1259//    #define  CAM_CONSOLE_LOG_ENABLED   1      // Development: internal camera stdout -> A/stdout.txt       
1260    #define DNG_SUPPORT                 1
1261    // pattern
1262    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1263    // color
1264    #define CAM_COLORMATRIX1                                \
1265      689833,  1000000, -198299, 1000000, -101299, 1000000, \
1266      -164267, 1000000, 667466,  1000000,  74132,  1000000, \
1267       -36515,  1000000, 123872,   1000000,  248498, 1000000
1268   
1269    #define cam_CalibrationIlluminant1 1 // Daylight
1270    // cropping
1271    #define CAM_JPEG_WIDTH  3072
1272    #define CAM_JPEG_HEIGHT 2304
1273    #define CAM_ACTIVE_AREA_X1 38
1274    #define CAM_ACTIVE_AREA_Y1 14
1275    #define CAM_ACTIVE_AREA_X2 3146
1276    #define CAM_ACTIVE_AREA_Y2 2338
1277    // camera name
1278    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1279   
1280    #define DNG_EXT_FROM ".DPS"
1281//----------------------------------------------------------
1282
1283#elif defined (CAMERA_ixus70_sd1000)
1284    #define CAM_PROPSET                 2
1285
1286    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1287    #define CAM_RAW_ROWS                2340   // for 7 MP
1288
1289    #undef  CAM_USE_ZOOM_FOR_MF
1290    #undef  CAM_HAS_ERASE_BUTTON
1291    #undef  CAM_HAS_IRIS_DIAPHRAGM
1292    #define CAM_HAS_ND_FILTER           1
1293    #undef  CAM_HAS_MANUAL_FOCUS
1294    #undef  CAM_HAS_USER_TV_MODES
1295    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1296    #undef  CAM_HAS_IS
1297    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1298    #define DNG_SUPPORT                 1
1299    #define CAM_MULTIPART               1
1300    // pattern
1301    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1302    // color
1303    #define CAM_COLORMATRIX1                                \
1304      652674,  1000000, -172074, 1000000, -107575, 1000000, \
1305      -139063, 1000000, 594517,  1000000,  60252,  1000000, \
1306       -9088,  1000000, 82013,   1000000,  238048, 1000000
1307   
1308    #define cam_CalibrationIlluminant1 1 // Daylight
1309    // cropping
1310    #define CAM_JPEG_WIDTH  3072
1311    #define CAM_JPEG_HEIGHT 2304
1312    #define CAM_ACTIVE_AREA_X1 38
1313    #define CAM_ACTIVE_AREA_Y1 14
1314    #define CAM_ACTIVE_AREA_X2 3146
1315    #define CAM_ACTIVE_AREA_Y2 2338
1316    // camera name
1317    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1318
1319    #define DNG_EXT_FROM ".DPS"
1320
1321    #define CAM_EXT_TV_RANGE            1
1322//----------------------------------------------------------
1323
1324#elif defined (CAMERA_ixus80_sd1100)
1325    #define CAM_PROPSET                 2
1326    #define CAM_DRYOS                   1
1327
1328    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
1329    #define CAM_RAW_ROWS                2480   // for new 8 MP
1330
1331    #undef  CAM_USE_ZOOM_FOR_MF
1332    #undef  CAM_HAS_ERASE_BUTTON
1333    #undef  CAM_HAS_IRIS_DIAPHRAGM
1334    #define CAM_HAS_ND_FILTER           1
1335    #undef  CAM_HAS_MANUAL_FOCUS
1336    #undef  CAM_HAS_USER_TV_MODES
1337    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1338        // TODO / test
1339        #undef  CAM_REMOTE
1340        #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1341    #undef  CAM_CAN_MUTE_MICROPHONE
1342    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 0
1343    #define DNG_SUPPORT                 1
1344    // pattern
1345    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1346    // color
1347    #define CAM_COLORMATRIX1                                \
1348      893969,  1000000, -343107, 1000000, -119590, 1000000, \
1349      -41350,  1000000, 581255,  1000000,  49523,  1000000, \
1350       24221,  1000000, 47554,   1000000,  209996, 1000000
1351   
1352    #define cam_CalibrationIlluminant1 1 // Daylight
1353    // cropping
1354    #define CAM_JPEG_WIDTH  3264
1355    #define CAM_JPEG_HEIGHT 2448
1356    #define CAM_ACTIVE_AREA_X1 6
1357    #define CAM_ACTIVE_AREA_Y1 6
1358    #define CAM_ACTIVE_AREA_X2 3304
1359    #define CAM_ACTIVE_AREA_Y2 2476
1360    // camera name
1361    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1362
1363    #define CAM_EXT_TV_RANGE            1
1364//----------------------------------------------------------
1365
1366#elif defined (CAMERA_ixus700_sd500)
1367    #define CAM_PROPSET                 1
1368
1369    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1370    #define CAM_RAW_ROWS                2340   // for 7 MP
1371
1372    #undef  CAM_SYNCH
1373    #undef  CAM_USE_ZOOM_FOR_MF
1374    #define CAM_DRAW_EXPOSITION         1
1375    #undef  CAM_HAS_ERASE_BUTTON
1376    #undef  CAM_HAS_IRIS_DIAPHRAGM
1377    #define CAM_HAS_ND_FILTER           1
1378    #undef  CAM_HAS_MANUAL_FOCUS
1379    #undef  CAM_HAS_USER_TV_MODES
1380    #undef  CAM_CAN_SD_OVERRIDE
1381    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1382    #undef  CAM_HAS_IS
1383    #define CAM_MULTIPART               1
1384    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1385    #define DNG_SUPPORT                 1
1386    // pattern
1387    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1388    // color
1389    #define CAM_COLORMATRIX1         \
1390      15265, 1, -6193,  1, -1558, 1, \
1391     -4125,  1,  12116, 1,  2010, 1, \
1392      -888,  1,  1639,  1,  5220, 1
1393   
1394    #define cam_CalibrationIlluminant1 17 // Standard light A
1395    // cropping
1396    #define CAM_JPEG_WIDTH  3072
1397    #define CAM_JPEG_HEIGHT 2304
1398    #define CAM_ACTIVE_AREA_X1 38
1399    #define CAM_ACTIVE_AREA_Y1 14
1400    #define CAM_ACTIVE_AREA_X2 3146
1401    #define CAM_ACTIVE_AREA_Y2 2338
1402    // camera name
1403    #define PARAM_CAMERA_NAME 2 // parameter number for GetParameterData
1404    #define DNG_EXT_FROM ".DPS"
1405//----------------------------------------------------------
1406
1407#elif defined (CAMERA_ixus750_sd550)
1408    #define CAM_PROPSET                1
1409
1410    #define CAM_RAW_ROWPIX              3152  // for 7 MP
1411    #define CAM_RAW_ROWS                2340  // for 7 MP
1412
1413    #define  CAM_USE_ZOOM_FOR_MF    1
1414    #define CAM_DRAW_EXPOSITION        1
1415    #undef  CAM_HAS_ERASE_BUTTON
1416    #undef  CAM_HAS_IRIS_DIAPHRAGM
1417    #define CAM_HAS_ND_FILTER          1
1418    #undef  CAM_HAS_MANUAL_FOCUS
1419    #undef  CAM_HAS_USER_TV_MODES
1420    #define  CAM_CAN_SD_OVERRIDE    1
1421    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1422    #undef  CAM_HAS_IS
1423    #define CAM_MULTIPART              1
1424    #undef CAM_SYNCH
1425    #define DNG_SUPPORT                 1
1426    // pattern
1427    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1428    // color
1429    #define CAM_COLORMATRIX1                               \
1430      580280, 1000000, -172239, 1000000, -89707,  1000000, \
1431     -206596, 1000000,  634926, 1000000,  63877,  1000000, \
1432      10377,  1000000,  62053,  1000000,  242646, 1000000
1433   
1434    #define cam_CalibrationIlluminant1 1 // Daylight
1435    // cropping
1436    #define CAM_JPEG_WIDTH  3072
1437    #define CAM_JPEG_HEIGHT 2304
1438    #define CAM_ACTIVE_AREA_X1 36
1439    #define CAM_ACTIVE_AREA_Y1 12
1440    #define CAM_ACTIVE_AREA_X2 3148
1441    #define CAM_ACTIVE_AREA_Y2 2340
1442    // camera name
1443    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1444//----------------------------------------------------------
1445
1446#elif defined (CAMERA_ixus800_sd700)
1447    #define CAM_PROPSET                 1
1448
1449    #define CAM_RAW_ROWPIX              2888   // for 6 MP
1450    #define CAM_RAW_ROWS                2136   // for 6 MP
1451
1452    #undef  CAM_USE_ZOOM_FOR_MF
1453    #define CAM_DRAW_EXPOSITION         1
1454    #undef  CAM_HAS_ERASE_BUTTON
1455    #undef  CAM_HAS_IRIS_DIAPHRAGM
1456    #define CAM_HAS_ND_FILTER           1
1457    #undef  CAM_HAS_MANUAL_FOCUS
1458    #undef  CAM_HAS_USER_TV_MODES
1459    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1460    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 2
1461    #define DNG_SUPPORT                 1
1462
1463 // Warning! DNG4PS2 has both ixus800 and sd700 support with different CFA patterns and color matrices.
1464 // Used settings for IXUS800
1465
1466    // pattern
1467    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1468    // color
1469    #define CAM_COLORMATRIX1          \
1470      14062, 1, -5199,  1, -1446,  1, \
1471      -4712, 1,  12470, 1,  2243,  1, \
1472      -1286, 1,  2028,  1,  4836,  1
1473   
1474    #define cam_CalibrationIlluminant1 17 // Standard light A
1475    // cropping
1476    #define CAM_JPEG_WIDTH  2816
1477    #define CAM_JPEG_HEIGHT 2112
1478    #define CAM_ACTIVE_AREA_X1 44
1479    #define CAM_ACTIVE_AREA_Y1 8
1480    #define CAM_ACTIVE_AREA_X2 2884
1481    #define CAM_ACTIVE_AREA_Y2 2136
1482    // camera name
1483    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
1484    #define DNG_EXT_FROM ".DPS"
1485//----------------------------------------------------------
1486
1487#elif defined (CAMERA_ixus850_sd800)
1488    #define CAM_PROPSET                 1
1489
1490    #define CAM_RAW_ROWPIX              3152   // for 7 MP
1491    #define CAM_RAW_ROWS                2340   // for 7 MP
1492
1493    #undef  CAM_USE_ZOOM_FOR_MF
1494    #undef  CAM_HAS_ERASE_BUTTON
1495    #undef  CAM_HAS_IRIS_DIAPHRAGM
1496    #define CAM_HAS_ND_FILTER           1
1497    #undef  CAM_HAS_MANUAL_FOCUS
1498    #undef  CAM_HAS_USER_TV_MODES
1499    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1500    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1501    #define CAM_MULTIPART               1
1502    #define DNG_SUPPORT                 1
1503    // pattern
1504    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1505    // color
1506    #define CAM_COLORMATRIX1                               \
1507      661014, 1000000, -189364, 1000000, -115797, 1000000, \
1508     -168772, 1000000,  661827, 1000000,   47392, 1000000, \
1509      -35846, 1000000,  107148, 1000000,  233705, 1000000
1510
1511    #define cam_CalibrationIlluminant1 17 // Standard light A
1512    // cropping
1513    #define CAM_JPEG_WIDTH  3072
1514    #define CAM_JPEG_HEIGHT 2304
1515    #define CAM_ACTIVE_AREA_X1 12
1516    #define CAM_ACTIVE_AREA_Y1 8
1517    #define CAM_ACTIVE_AREA_X2 3108
1518    #define CAM_ACTIVE_AREA_Y2 2332
1519    // camera name
1520    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1521
1522    #define DNG_EXT_FROM ".DPS"
1523//----------------------------------------------------------
1524
1525#elif defined (CAMERA_ixus860_sd870)
1526    #define CAM_PROPSET                 2
1527    #define CAM_DRYOS                   1
1528
1529    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
1530    #define CAM_RAW_ROWS                2480   // for new 8 MP
1531
1532    #undef  CAM_USE_ZOOM_FOR_MF
1533    #undef  CAM_HAS_ERASE_BUTTON
1534    #undef  CAM_HAS_IRIS_DIAPHRAGM
1535    #define CAM_HAS_ND_FILTER           1
1536    #undef  CAM_HAS_MANUAL_FOCUS
1537    #undef  CAM_HAS_USER_TV_MODES
1538    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1539        #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1540    #undef  CAM_CAN_MUTE_MICROPHONE
1541    #undef  CAM_VIDEO_CONTROL
1542    #define DNG_SUPPORT                 1
1543    // pattern
1544    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1545    // color
1546    #define CAM_COLORMATRIX1                               \
1547      747939, 1000000, -268233, 1000000, -129266, 1000000, \
1548     -50633,  1000000, 515687,  1000000,  23509,  1000000, \
1549     -21341,  1000000, 76495,   1000000, 186385,  1000000
1550
1551    #define cam_CalibrationIlluminant1 1 // Daylight                   
1552    // cropping
1553    #define CAM_JPEG_WIDTH  3264
1554    #define CAM_JPEG_HEIGHT 2448
1555    #define CAM_ACTIVE_AREA_X1 10
1556    #define CAM_ACTIVE_AREA_Y1 8
1557    #define CAM_ACTIVE_AREA_X2 3302
1558    #define CAM_ACTIVE_AREA_Y2 2474
1559    // camera name
1560    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1561
1562    #define DNG_EXT_FROM ".CR2"
1563//----------------------------------------------------------
1564
1565#elif defined (CAMERA_ixus870_sd880)
1566    // Camera details
1567    #define CAM_DRYOS                   1
1568    #define CAM_PROPSET                 2
1569
1570    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1571    #define CAM_BITMAP_PALETTE          1
1572    #define CAM_BRACKETING              1   // XXX
1573    #define CAM_CAN_SD_OVER_NOT_IN_MF   1
1574    #define CAM_CAN_SD_OVERRIDE         1
1575    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1576    #define CAM_EXT_TV_RANGE            1
1577    #define CAM_HAS_IS                  1
1578    #define CAM_HAS_JOGDIAL             1
1579    #define CAM_HAS_ND_FILTER           1
1580    #define CAM_HAS_ZOOM_LEVER          1
1581    #define CAM_MULTIPART               1
1582    #define CAM_REMOTE                  1
1583    #define CAM_SYNCH                   1   // XXX
1584    #undef CAM_UNCACHED_BIT
1585    #define CAM_UNCACHED_BIT            0x40000000  // 0xFF874198 (via ExMem.FreeCacheable
1586    #define PARAM_CAMERA_NAME           4 // parameter number for GetParameterData
1587
1588    #undef  CAM_CAN_MUTE_MICROPHONE         // XXX
1589    #undef  CAM_HAS_ERASE_BUTTON
1590    #undef  CAM_HAS_IRIS_DIAPHRAGM
1591    #undef  CAM_HAS_MANUAL_FOCUS
1592    #undef  CAM_HAS_USER_TV_MODES           // XXX
1593    #undef  CAM_HAS_VIDEO_BUTTON            // XXX
1594    #undef  CAM_EV_IN_VIDEO                 // XXX
1595    #undef  CAM_REAR_CURTAIN
1596
1597    #define CAM_JPEG_WIDTH              3648
1598    #define CAM_JPEG_HEIGHT             2736
1599    #define CAM_RAW_ROWPIX              3720
1600    #define CAM_RAW_ROWS                2772
1601    #define CAM_ACTIVE_AREA_X1          14       // XXX
1602    #define CAM_ACTIVE_AREA_Y1          8        // XXX
1603    #define CAM_ACTIVE_AREA_X2          3682     // XXX
1604    #define CAM_ACTIVE_AREA_Y2          2764     // XXX
1605
1606    #undef CAM_SENSOR_BITS_PER_PIXEL
1607    #undef CAM_WHITE_LEVEL
1608    #undef CAM_BLACK_LEVEL
1609    #define CAM_SENSOR_BITS_PER_PIXEL   12
1610    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1) // XXX
1611    #define CAM_BLACK_LEVEL             127 // XXX
1612
1613    #define cam_CFAPattern              0x02010100 // Red  Green  Green  Blue
1614    #define CAM_COLORMATRIX1                               \
1615      827547, 1000000, -290458, 1000000, -126086, 1000000, \
1616     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
1617      5181,   1000000, 48183,   1000000, 245014,  1000000    // XXX
1618    #define cam_CalibrationIlluminant1  1 // Daylight       XXX
1619
1620
1621    // CHDK functionality
1622    #define CAM_CHDK_HAS_EXT_VIDEO_MENU 1   // XXX
1623    #define CAM_EMUL_KEYPRESS_DELAY     40
1624    #define CAM_EMUL_KEYPRESS_DURATION  5
1625    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1626    #undef  DEFAULT_RAW_EXT
1627    #define DEFAULT_RAW_EXT             2   // use .CR2
1628    #define DNG_SUPPORT                 1
1629   
1630    #undef  CAM_ADJUSTABLE_ALT_BUTTON
1631    #undef  CAM_CONSOLE_LOG_ENABLED
1632    #undef  CAM_DRAW_EXPOSITION             // XXX
1633    #undef  CAM_FEATURE_FEATHER             // XXX
1634    #undef  CAM_USE_ZOOM_FOR_MF
1635    #undef  CAM_VIDEO_CONTROL               // XXX
1636//----------------------------------------------------------
1637
1638#elif defined (CAMERA_ixus950_sd850)
1639    #define CAM_EXT_TV_RANGE            1
1640    #define CAM_PROPSET                 2
1641
1642    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
1643    #define CAM_RAW_ROWS                2480   // for new 8 MP
1644
1645    #undef  CAM_USE_ZOOM_FOR_MF
1646    #undef  CAM_HAS_ERASE_BUTTON
1647    #undef  CAM_HAS_IRIS_DIAPHRAGM
1648    #define CAM_HAS_ND_FILTER           1
1649    #undef  CAM_HAS_MANUAL_FOCUS
1650    #undef  CAM_HAS_USER_TV_MODES
1651    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1652    #define CAM_MULTIPART               1
1653    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1654    #define DNG_SUPPORT                 1
1655    // pattern
1656    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1657    // color
1658    #define CAM_COLORMATRIX1        \
1659      14573, 1, -5482, 1, -1546, 1, \
1660     -1266,  1, 9799,  1, 1468,  1, \
1661     -1040,  1, 1912,  1, 3810,  1
1662
1663    #define cam_CalibrationIlluminant1 1 // Daylight                   
1664    // cropping
1665    #define CAM_JPEG_WIDTH  3264
1666    #define CAM_JPEG_HEIGHT 2448
1667    #define CAM_ACTIVE_AREA_X1 10
1668    #define CAM_ACTIVE_AREA_Y1 8
1669    #define CAM_ACTIVE_AREA_X2 3302
1670    #define CAM_ACTIVE_AREA_Y2 2474
1671    // camera name
1672    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1673    #define DNG_EXT_FROM ".DPS"
1674//----------------------------------------------------------
1675
1676#elif defined (CAMERA_ixus960_sd950)
1677    #define CAM_PROPSET                 2
1678    #define CAM_DRYOS                   1
1679
1680    #define CAM_RAW_ROWPIX              4104   
1681    #define CAM_RAW_ROWS                3048   
1682
1683    #undef  CAM_USE_ZOOM_FOR_MF
1684    #undef  CAM_HAS_ERASE_BUTTON
1685    #undef  CAM_HAS_IRIS_DIAPHRAGM
1686    #define CAM_HAS_ND_FILTER           1
1687    #undef  CAM_HAS_MANUAL_FOCUS
1688    #undef  CAM_HAS_USER_TV_MODES
1689    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1690    #define DNG_SUPPORT                 1
1691    // pattern
1692    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1693    // color
1694    #define CAM_COLORMATRIX1                               \
1695      913762, 1000000, -261578, 1000000, -135582, 1000000, \
1696      -99049, 1000000, 1067089, 1000000,  61442,  1000000, \
1697      48717,  1000000, 96802,   1000000,  412056, 1000000
1698   
1699    #define cam_CalibrationIlluminant1 1 // Daylight
1700    // cropping
1701    #define CAM_JPEG_WIDTH  4000
1702    #define CAM_JPEG_HEIGHT 3000
1703    #define CAM_ACTIVE_AREA_X1 48
1704    #define CAM_ACTIVE_AREA_Y1 12
1705    #define CAM_ACTIVE_AREA_X2 4080
1706    #define CAM_ACTIVE_AREA_Y2 3036
1707    // camera name
1708    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1709
1710    #define DNG_EXT_FROM ".CR2"
1711//----------------------------------------------------------
1712
1713#elif defined (CAMERA_ixus970_sd890)
1714    #define CAM_PROPSET                 2
1715    #define CAM_DRYOS                   1
1716
1717    #define CAM_RAW_ROWPIX              3720
1718    #define CAM_RAW_ROWS                2772
1719
1720    #undef CAM_USE_ZOOM_FOR_MF
1721    #undef CAM_HAS_ERASE_BUTTON
1722    #undef CAM_HAS_IRIS_DIAPHRAGM
1723    #define CAM_HAS_ND_FILTER           1
1724    #undef CAM_HAS_MANUAL_FOCUS
1725    #define CAM_MULTIPART               1
1726    #define CAM_HAS_JOGDIAL             1
1727    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1728    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1729    #define DNG_SUPPORT                 1
1730    #define CAM_EXT_TV_RANGE            1
1731
1732    // pattern
1733    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1734
1735    // color
1736    #define CAM_COLORMATRIX1                               \
1737      827547, 1000000, -290458, 1000000, -126086, 1000000, \
1738     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
1739      5181,   1000000, 48183,   1000000, 245014,  1000000
1740    #define cam_CalibrationIlluminant1 1 // Daylight
1741
1742    // cropping
1743    #define CAM_JPEG_WIDTH  3648
1744    #define CAM_JPEG_HEIGHT 2736
1745    #define CAM_ACTIVE_AREA_X1 6
1746    #define CAM_ACTIVE_AREA_Y1 12
1747    #define CAM_ACTIVE_AREA_X2 3690
1748    #define CAM_ACTIVE_AREA_Y2 2772
1749
1750    // camera name
1751    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1752
1753    // 12 bit support
1754    #undef  CAM_SENSOR_BITS_PER_PIXEL
1755    #undef  CAM_WHITE_LEVEL
1756    #undef  CAM_BLACK_LEVEL
1757    #define CAM_SENSOR_BITS_PER_PIXEL   12
1758    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1759    #define CAM_BLACK_LEVEL             127
1760//----------------------------------------------------------
1761
1762#elif defined (CAMERA_ixus980_sd990)
1763    #define CAM_PROPSET                 2 // all values checked so far match propset 2
1764    #define CAM_DRYOS                   1
1765
1766    #define CAM_RAW_ROWPIX              4480 // 14.7 MP 12bpp
1767    #define CAM_RAW_ROWS                3348   
1768
1769    #undef  CAM_USE_ZOOM_FOR_MF
1770    #undef  CAM_HAS_ERASE_BUTTON
1771    #define CAM_MULTIPART               1
1772    #undef  CAM_HAS_IRIS_DIAPHRAGM
1773    #define CAM_HAS_ND_FILTER           1
1774    #define  CAM_HAS_MANUAL_FOCUS               1
1775    #define  CAM_HAS_USER_TV_MODES              1 //include M/P ? needed to make Tv bracketing work
1776    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1777    #define CAM_CHDK_HAS_EXT_VIDEO_MENU 1
1778    #undef  CAM_VIDEO_CONTROL
1779    #undef CAM_UNCACHED_BIT  // shut up compiler
1780    #define CAM_UNCACHED_BIT    0x40000000
1781    #undef CAM_BITMAP_PALETTE
1782    #define CAM_BITMAP_PALETTE    2
1783
1784        #undef CAM_BLACK_LEVEL
1785    #define CAM_BLACK_LEVEL             127
1786    #define CAM_HAS_JOGDIAL             1
1787//    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
1788    #define CAM_VIDEO_QUALITY_ONLY          1 
1789    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1790        #undef CAM_SENSOR_BITS_PER_PIXEL
1791    #define CAM_SENSOR_BITS_PER_PIXEL   12
1792        #undef CAM_WHITE_LEVEL
1793    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1794
1795    #define DNG_SUPPORT                 1
1796    // pattern
1797    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
1798    // color preliminary
1799    #define CAM_COLORMATRIX1                               \
1800      837237, 1000000, -290137, 1000000, -128156, 1000000, \
1801      -127762, 1000000, 643909, 1000000,  52973,  1000000, \
1802      4446,  1000000, 88354,   1000000,  224246, 1000000
1803   
1804    #define cam_CalibrationIlluminant1 1 // Daylight
1805    // cropping
1806    #define CAM_JPEG_WIDTH  4416
1807    #define CAM_JPEG_HEIGHT 3312
1808    #define CAM_ACTIVE_AREA_X1 12
1809    #define CAM_ACTIVE_AREA_Y1 12
1810    #define CAM_ACTIVE_AREA_X2 4444
1811    #define CAM_ACTIVE_AREA_Y2 3324
1812    // camera name
1813    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData sd990: OK
1814
1815//    #define DNG_EXT_FROM ".CR2"
1816//----------------------------------------------------------
1817
1818#elif defined (CAMERA_ixus100_sd780)
1819    #define CAM_PROPSET                 2
1820    #define CAM_DRYOS                   1
1821
1822    #define CAM_RAW_ROWPIX              4080            // 12 MP 12bpp
1823    #define CAM_RAW_ROWS                3048            // VERIFY_SD780 Found RAW #s by searching " CrwAddress %lx, CrwSize H %ld V %ld\r"
1824
1825    #undef  CAM_HAS_ERASE_BUTTON
1826    #undef  CAM_USE_ZOOM_FOR_MF
1827    #define CAM_MULTIPART               1
1828    #undef  CAM_HAS_IRIS_DIAPHRAGM
1829    #define CAM_HAS_ND_FILTER           1
1830
1831    #undef CAM_REMOTE
1832    #undef CAM_SYNCH
1833
1834    #define CAM_HAS_ZOOM_LEVER          1
1835
1836//    #define CAM_CAN_SD_OVER_NOT_IN_MF   1                     // Camera allows subject distance (focus) override when not in manual focus mode
1837//    #define CAM_CAN_SD_OVERRIDE         1                     // Camera allows to do subject distance override
1838
1839    #undef  CAM_HAS_MANUAL_FOCUS
1840    #define CAM_HAS_USER_TV_MODES                 1
1841    #define CAM_SHOW_OSD_IN_SHOOT_MENU            1
1842    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO  1
1843    #define CAM_AF_SCAN_DURING_VIDEO_RECORD       1
1844    #define CAM_CHDK_HAS_EXT_VIDEO_MENU           1
1845
1846    #define CAM_HAS_IS                  1
1847    #undef CAM_HAS_JOGDIAL
1848
1849    #undef  CAM_VIDEO_CONTROL
1850    #define CAM_VIDEO_QUALITY_ONLY      1
1851    #define DNG_SUPPORT                 1
1852
1853    #define CAM_EXT_TV_RANGE            1
1854
1855    #undef CAM_UNCACHED_BIT
1856    #define CAM_UNCACHED_BIT            0x40000000
1857
1858    #undef CAM_BITMAP_PALETTE
1859    #define CAM_BITMAP_PALETTE          5
1860
1861    #undef ZEBRA_HMARGIN0
1862    #define ZEBRA_HMARGIN0              150                     //zebra adjust buffer height: show use at sx200is: needed for save memory space
1863
1864    #define CAM_QUALITY_OVERRIDE 1
1865    #undef CAM_SENSOR_BITS_PER_PIXEL
1866    #define CAM_SENSOR_BITS_PER_PIXEL   12
1867    #undef CAM_WHITE_LEVEL
1868    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1869    #undef CAM_BLACK_LEVEL
1870    #define CAM_BLACK_LEVEL             127
1871
1872    // pattern
1873    //RealRom:FFA99FB4                    ADR     R0, aObRG1G2BLdLdLd ; "\n  OB : (R, G1, G2, B) = (%ld, %ld, %ld"...
1874    #define cam_CFAPattern              0x02010100              // Red  Green  Green  Blue
1875
1876    // color preliminary (see DNG4PS2 wiki)
1877    #define CAM_COLORMATRIX1                               \
1878      661840,  1000000, -185671, 1000000, -97110,  1000000, \
1879      -83661,  1000000, 578860, 1000000,   32308,  1000000, \
1880      -8681,    1000000, 70356,   1000000, 207341, 1000000
1881
1882    //Here is an alternate CAM_COLORMATRIX1 - Current one is nice for me but hey I'm no colour expert.
1883    //XYZ -> Camera matrix:
1884    //0.459395 -0.129083 -0.068085
1885    //-0.055837 0.400827 0.020378
1886    //-0.004622 0.048662 0.139970
1887
1888    #define cam_CalibrationIlluminant1  17                      // Standard Light A
1889
1890        // cropping
1891    #define CAM_JPEG_WIDTH              4000
1892    #define CAM_JPEG_HEIGHT             3000
1893    #define CAM_ACTIVE_AREA_X1          40
1894    #define CAM_ACTIVE_AREA_Y1          24
1895    #define CAM_ACTIVE_AREA_X2          4056
1896    #define CAM_ACTIVE_AREA_Y2          3040
1897    // camera name
1898    #define PARAM_CAMERA_NAME           4                       // parameter number for GetParameterData sd990: OK
1899//----------------------------------------------------------
1900
1901#elif defined (CAMERA_ixus90_sd790)
1902    #define CAM_PROPSET                 2
1903    #define CAM_DRYOS                   1
1904
1905    #define CAM_RAW_ROWPIX              3720
1906    #define CAM_RAW_ROWS                2772
1907
1908    #undef CAM_USE_ZOOM_FOR_MF
1909    #undef CAM_HAS_ERASE_BUTTON
1910    #define CAM_MULTIPART               1
1911    #undef CAM_HAS_IRIS_DIAPHRAGM
1912    #undef CAM_HAS_MANUAL_FOCUS
1913
1914    #define CAM_HAS_ND_FILTER           1
1915    #undef CAM_HAS_USER_TV_MODES
1916    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1917         #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1918    #define CAM_HAS_JOGDIAL             1
1919    #undef CAM_VIDEO_CONTROL
1920    #define CAM_EXT_TV_RANGE            1          // CHDK can make exposure time longer than 64s
1921
1922    #define DNG_SUPPORT                 1
1923    // pattern
1924    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1925    // color
1926    #define CAM_COLORMATRIX1                               \
1927      827547, 1000000, -290458, 1000000, -126086, 1000000, \
1928     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
1929      5181,   1000000, 48183,   1000000, 245014,  1000000
1930    #define cam_CalibrationIlluminant1 1 // Daylight
1931
1932    // cropping
1933    #define CAM_JPEG_WIDTH  3648
1934    #define CAM_JPEG_HEIGHT 2736
1935    #define CAM_ACTIVE_AREA_X1 6
1936    #define CAM_ACTIVE_AREA_Y1 12
1937    #define CAM_ACTIVE_AREA_X2 3690
1938    #define CAM_ACTIVE_AREA_Y2 2772
1939
1940    // camera name
1941    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1942    #undef  CAM_SENSOR_BITS_PER_PIXEL
1943    #undef  CAM_WHITE_LEVEL
1944    #undef  CAM_BLACK_LEVEL
1945    #define CAM_SENSOR_BITS_PER_PIXEL   12
1946    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1947    #define CAM_BLACK_LEVEL             127
1948//----------------------------------------------------------
1949
1950#elif defined (CAMERA_ixus85_sd770)
1951        #define CAM_PROPSET                 2
1952        #define CAM_DRYOS                   1
1953
1954        #define CAM_RAW_ROWPIX              3720
1955        #define CAM_RAW_ROWS                2772
1956
1957        #undef CAM_USE_ZOOM_FOR_MF
1958        #undef CAM_HAS_ERASE_BUTTON
1959        #define CAM_MULTIPART               1
1960        #undef CAM_HAS_IRIS_DIAPHRAGM
1961        #undef CAM_HAS_MANUAL_FOCUS
1962
1963        #define CAM_HAS_ND_FILTER           1
1964        #undef CAM_HAS_USER_TV_MODES
1965        #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
1966         #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
1967        #undef CAM_HAS_JOGDIAL
1968        #undef CAM_VIDEO_CONTROL
1969        #define CAM_EXT_TV_RANGE            1          // CHDK can make exposure time longer than 64s
1970
1971        #define DNG_SUPPORT                 1
1972        // pattern
1973        #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
1974        // color
1975        #define CAM_COLORMATRIX1                               \
1976      827547, 1000000, -290458, 1000000, -126086, 1000000, \
1977     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
1978      5181,   1000000, 48183,   1000000, 245014,  1000000
1979        #define cam_CalibrationIlluminant1 1 // Daylight
1980
1981        // cropping
1982        #define CAM_JPEG_WIDTH  3648
1983        #define CAM_JPEG_HEIGHT 2736
1984        #define CAM_ACTIVE_AREA_X1 6
1985        #define CAM_ACTIVE_AREA_Y1 12
1986        #define CAM_ACTIVE_AREA_X2 3690
1987        #define CAM_ACTIVE_AREA_Y2 2772
1988
1989        // camera name
1990        #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
1991        #undef  CAM_SENSOR_BITS_PER_PIXEL
1992        #undef  CAM_WHITE_LEVEL
1993        #undef  CAM_BLACK_LEVEL
1994        #define CAM_SENSOR_BITS_PER_PIXEL   12
1995        #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
1996        #define CAM_BLACK_LEVEL             127
1997//----------------------------------------------------------
1998
1999
2000//==========================================================
2001// S-Series
2002//==========================================================
2003#elif defined (CAMERA_s2is)
2004    #define CAM_PROPSET                 1
2005
2006    #define CAM_RAW_ROWPIX              2672   // for 5 MP
2007    #define CAM_RAW_ROWS                1968   // for 5 MP
2008
2009    #undef  CAM_SYNCH   
2010    #define CAM_SWIVEL_SCREEN           1
2011    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2012    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2013    #define  CAM_HAS_VIDEO_BUTTON       1
2014    #undef  CAM_VIDEO_CONTROL
2015    #define DNG_SUPPORT                 1
2016    // pattern
2017    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2018    // color
2019    #define CAM_COLORMATRIX1                                \
2020      547708,  1000000, -143462, 1000000,  -99243, 1000000, \
2021     -186838,  1000000, 663925,  1000000,   50970, 1000000, \
2022     -5810,    1000000, 79162,   1000000,  266988, 1000000
2023
2024    #define cam_CalibrationIlluminant1 1 // Daylight
2025    // cropping
2026    #define CAM_JPEG_WIDTH  2592
2027    #define CAM_JPEG_HEIGHT 1944
2028    #define CAM_ACTIVE_AREA_X1 14
2029    #define CAM_ACTIVE_AREA_Y1 10
2030    #define CAM_ACTIVE_AREA_X2 2626
2031    #define CAM_ACTIVE_AREA_Y2 1966
2032    // camera name
2033    #define PARAM_CAMERA_NAME 2 // parameter number for GetParameterData
2034    #define CAM_BRACKETING              1
2035    #define DNG_EXT_FROM ".DPS"
2036//----------------------------------------------------------
2037
2038#elif defined (CAMERA_s3is)
2039    #define CAM_PROPSET                 1
2040
2041    #define CAM_RAW_ROWPIX              2888   // for 6 MP
2042    #define CAM_RAW_ROWS                2136   // for 6 MP
2043   
2044    #undef  CAM_SYNCH 
2045    #define CAM_SWIVEL_SCREEN           1
2046    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2047    #define CAM_MULTIPART               1
2048    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
2049    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2050    #define  CAM_HAS_VIDEO_BUTTON       1
2051    #define DNG_SUPPORT                 1
2052    // pattern
2053    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2054    // color
2055    #define CAM_COLORMATRIX1                               \
2056     14062, 10000, -5199, 10000, -1446, 10000,             \
2057     -4712, 10000, 12470, 10000,  2243, 10000,             \
2058     -1286, 10000,  2028, 10000,  4836, 10000
2059   
2060    #define cam_CalibrationIlluminant1 17 // Standard light A
2061    // cropping
2062    #define CAM_JPEG_WIDTH  2816
2063    #define CAM_JPEG_HEIGHT 2112
2064    #define CAM_ACTIVE_AREA_X1 44
2065    #define CAM_ACTIVE_AREA_Y1 8
2066    #define CAM_ACTIVE_AREA_X2 2884
2067    #define CAM_ACTIVE_AREA_Y2 2136
2068    // camera name
2069    #define PARAM_CAMERA_NAME 3 // parameter number for GetParameterData
2070    #define CAM_BRACKETING              1
2071    #define DNG_EXT_FROM ".DPS"
2072
2073    #define CAM_EXT_TV_RANGE            1
2074//----------------------------------------------------------
2075
2076#elif defined (CAMERA_s5is)
2077    #define CAM_PROPSET                 2
2078    #define CAM_DRYOS                   1
2079
2080    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
2081    #define CAM_RAW_ROWS                2480   // for new 8 MP
2082   
2083    #define CAM_SWIVEL_SCREEN           1
2084    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2085    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
2086    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2087    #define CAM_HAS_VIDEO_BUTTON       1
2088    #define CAM_EXT_TV_RANGE            1
2089    #define DNG_SUPPORT                 1
2090    // pattern
2091    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
2092    // color
2093    #define CAM_COLORMATRIX1                               \
2094      650591, 1000000, -199585, 1000000, -123118, 1000000, \
2095     -69617,  1000000, 583926,  1000000,  34354,  1000000, \
2096     -19113,  1000000, 82163,   1000000, 210786,  1000000
2097   
2098    #define cam_CalibrationIlluminant1 1 // Daylight
2099    // cropping
2100    #define CAM_JPEG_WIDTH  3264
2101    #define CAM_JPEG_HEIGHT 2448
2102    #define CAM_ACTIVE_AREA_X1 10
2103    #define CAM_ACTIVE_AREA_Y1 8
2104    #define CAM_ACTIVE_AREA_X2 3302
2105    #define CAM_ACTIVE_AREA_Y2 2474
2106    // camera name
2107    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2108    #define CAM_BRACKETING              1
2109    #define DNG_EXT_FROM ".DPS"
2110//----------------------------------------------------------
2111
2112
2113//==========================================================
2114// TX-Series
2115//==========================================================
2116#elif defined (CAMERA_tx1)
2117    #define CAM_PROPSET                 2
2118   
2119    #define CAM_RAW_ROWPIX              3152   // for 7 MP
2120    #define CAM_RAW_ROWS                2340   // for 7 MP
2121
2122    #define CAM_SWIVEL_SCREEN           1
2123    #define CAM_HAS_ND_FILTER           1
2124    #undef  CAM_HAS_ERASE_BUTTON
2125    #undef  CAM_HAS_MANUAL_FOCUS
2126    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2127    #define CAM_MULTIPART               1
2128    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
2129    #define  CAM_HAS_VIDEO_BUTTON       1
2130    #define DNG_SUPPORT                 1
2131    // pattern
2132    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2133    // color
2134    #define CAM_COLORMATRIX1                                \
2135      510370,  1000000, -68998,  1000000, -86859,  1000000, \
2136      -279980, 1000000, 766686,  1000000,  67944,  1000000, \
2137      -14382,  1000000, 113688,  1000000, 239853,  1000000
2138   
2139    #define cam_CalibrationIlluminant1 1 // Daylight
2140    // cropping
2141    #define CAM_JPEG_WIDTH  3072
2142    #define CAM_JPEG_HEIGHT 2304
2143    #define CAM_ACTIVE_AREA_X1 12
2144    #define CAM_ACTIVE_AREA_Y1 8
2145    #define CAM_ACTIVE_AREA_X2 3108
2146    #define CAM_ACTIVE_AREA_Y2 2332
2147    // camera name
2148    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2149    #define DNG_EXT_FROM ".DPS"
2150//----------------------------------------------------------
2151
2152
2153//==========================================================
2154// SX-Series
2155//==========================================================
2156#elif defined (CAMERA_sx100is)
2157    #define CAM_PROPSET                 2
2158    #define CAM_DRYOS                   1
2159
2160    #define CAM_RAW_ROWPIX              3336   // for new 8 MP
2161    #define CAM_RAW_ROWS                2480   // for new 8 MP
2162    #undef CAM_SYNCH
2163    #define CAM_CAN_MUTE_MICROPHONE     1
2164    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
2165    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2166    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
2167    #undef  CAM_VIDEO_CONTROL
2168    #define DNG_SUPPORT                 1
2169    #define CAM_REAR_CURTAIN            1
2170    #define CAM_HAS_JOGDIAL             1
2171    // pattern
2172    #define cam_CFAPattern 0x01000201 // Green  Blue  Red  Green
2173    // color
2174    #define CAM_COLORMATRIX1                               \
2175      656793, 1000000, -168702, 1000000, -108030, 1000000, \
2176      -2711,  1000000, 661538,  1000000,  37919,  1000000, \
2177      77255,  1000000, 48834,   1000000, 241797,  1000000
2178   
2179    #define cam_CalibrationIlluminant1 1 // Daylight
2180    // cropping
2181    #define CAM_JPEG_WIDTH  3264
2182    #define CAM_JPEG_HEIGHT 2448
2183    #define CAM_ACTIVE_AREA_X1 10
2184    #define CAM_ACTIVE_AREA_Y1 8
2185    #define CAM_ACTIVE_AREA_X2 3302
2186    #define CAM_ACTIVE_AREA_Y2 2474
2187    // camera name
2188    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2189
2190    #define DNG_EXT_FROM ".CR2"
2191    #define CAM_MULTIPART               1
2192//----------------------------------------------------------
2193
2194#elif defined (CAMERA_sx10)
2195    #define CAM_PROPSET                 2
2196    #define CAM_DRYOS                   1
2197
2198    #define CAM_RAW_ROWPIX              3720   
2199    #define CAM_RAW_ROWS                2772   
2200
2201    #define CAM_SWIVEL_SCREEN           1
2202    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2203    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
2204    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2205    #define CAM_HAS_VIDEO_BUTTON       1
2206    #define CAM_VIDEO_QUALITY_ONLY          1 
2207    #define CAM_BRACKETING              1
2208    #undef  CAM_VIDEO_CONTROL
2209    #define CAM_MULTIPART               1
2210    #define CAM_HAS_JOGDIAL             1
2211    #undef  CAM_USE_ZOOM_FOR_MF
2212    #undef  CAM_UNCACHED_BIT  // shut up compiler
2213    #define CAM_UNCACHED_BIT    0x40000000
2214
2215    #define DNG_SUPPORT                 1
2216    // pattern
2217    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2218    // color
2219
2220    #define CAM_COLORMATRIX1                               \
2221      827547, 1000000, -290458, 1000000, -126086, 1000000, \
2222     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
2223      5181,   1000000, 48183,   1000000, 245014,  1000000
2224
2225    #define cam_CalibrationIlluminant1 1 // Daylight
2226    // cropping
2227    #define CAM_JPEG_WIDTH  3648
2228    #define CAM_JPEG_HEIGHT 2736
2229    #define CAM_ACTIVE_AREA_X1 6
2230    #define CAM_ACTIVE_AREA_Y1 12
2231    #define CAM_ACTIVE_AREA_X2 3690
2232    #define CAM_ACTIVE_AREA_Y2 2772
2233    // camera name
2234    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2235    #undef  CAM_SENSOR_BITS_PER_PIXEL
2236    #undef  CAM_WHITE_LEVEL
2237    #undef  CAM_BLACK_LEVEL
2238    #define CAM_SENSOR_BITS_PER_PIXEL   12
2239    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2240    #define CAM_BLACK_LEVEL             127
2241
2242    #define CAM_EXT_TV_RANGE            1
2243//----------------------------------------------------------
2244
2245#elif defined (CAMERA_sx1)
2246    #define CAM_PROPSET                 2
2247    #define CAM_DRYOS                   1
2248
2249    #define CAM_RAW_ROWPIX              4152
2250    #define CAM_RAW_ROWS                2772 
2251
2252    #define CAM_SWIVEL_SCREEN           1
2253    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2254    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
2255    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2256    #define CAM_HAS_VIDEO_BUTTON       1
2257    #define CAM_VIDEO_QUALITY_ONLY          1 
2258    #define CAM_BRACKETING              1
2259    #undef  CAM_VIDEO_CONTROL
2260    #define CAM_MULTIPART               1
2261    #define CAM_HAS_JOGDIAL             1
2262    #undef  CAM_USE_ZOOM_FOR_MF
2263    #undef  CAM_UNCACHED_BIT  // shut up compiler
2264    #define CAM_UNCACHED_BIT    0x40000000
2265
2266    #define DNG_SUPPORT                 1
2267    // pattern
2268    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2269    // color
2270
2271    #define CAM_COLORMATRIX1                               \
2272      827547, 1000000, -290458, 1000000, -126086, 1000000, \
2273     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
2274      5181,   1000000, 48183,   1000000, 245014,  1000000
2275
2276    #define cam_CalibrationIlluminant1 1 // Daylight
2277    // cropping
2278    #define CAM_JPEG_WIDTH  3648
2279    #define CAM_JPEG_HEIGHT 2736
2280    #define CAM_ACTIVE_AREA_X1 344
2281    #define CAM_ACTIVE_AREA_Y1 24
2282    #define CAM_ACTIVE_AREA_X2 3991
2283    #define CAM_ACTIVE_AREA_Y2 2759 
2284    // camera name
2285    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2286    #undef  CAM_SENSOR_BITS_PER_PIXEL
2287    #undef  CAM_WHITE_LEVEL
2288    #undef  CAM_BLACK_LEVEL
2289    #define CAM_SENSOR_BITS_PER_PIXEL   12
2290    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2291    #define CAM_BLACK_LEVEL             127
2292 
2293    #define CAM_EXT_TV_RANGE            1
2294 
2295    #define CAM_HAS_VARIABLE_ASPECT 1
2296//----------------------------------------------------------
2297
2298        //********
2299        /////SX110
2300        //********
2301#elif defined (CAMERA_sx110is)
2302        #define CAM_COLORMATRIX1                               \
2303      530200, 1000000, -42600,  1000000, -33000,  1000000, \
2304     -525400,  1000000, 1092700,  1000000,  223700,  1000000, \
2305     -103700,  1000000, 117900,   1000000,  421600,  1000000
2306    #define CAM_ACTIVE_AREA_X1 8
2307    #define CAM_ACTIVE_AREA_Y1 14
2308    #define CAM_ACTIVE_AREA_X2 3688
2309    #define CAM_ACTIVE_AREA_Y2 2772
2310
2311    #define CAM_PROPSET                 2
2312    #define CAM_DRYOS                   1
2313    #define CAM_RAW_ROWPIX              3720 
2314    #define CAM_RAW_ROWS                2772 
2315    #undef CAM_SYNCH
2316    #define CAM_CAN_MUTE_MICROPHONE     1
2317    #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
2318    #define CAM_REAR_CURTAIN            1
2319    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2320    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
2321    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
2322    #undef  CAM_VIDEO_CONTROL
2323    #define CAM_MULTIPART               1
2324    #define CAM_HAS_JOGDIAL             1
2325    #undef  CAM_USE_ZOOM_FOR_MF
2326    #undef  CAM_UNCACHED_BIT  // shut up compiler
2327    #define CAM_UNCACHED_BIT    0x40000000
2328        #undef CAM_SENSOR_BITS_PER_PIXEL
2329    #define CAM_SENSOR_BITS_PER_PIXEL   12
2330        #undef CAM_WHITE_LEVEL
2331    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2332        // black level set to 128 per reports on the forum
2333    #undef  CAM_BLACK_LEVEL
2334    #define CAM_BLACK_LEVEL             128
2335    #define DNG_SUPPORT                 1
2336    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2337    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2338    #define cam_CalibrationIlluminant1 1 // Daylight
2339    #define CAM_JPEG_WIDTH  3456
2340    #define CAM_JPEG_HEIGHT 2592
2341//----------------------------------------------------------
2342
2343        //********
2344        /////SX200
2345        //********
2346#elif defined (CAMERA_sx200is)
2347    // copied from SX10 and modified
2348    #define CAM_PROPSET                 2
2349    #define CAM_DRYOS                   1
2350    #define CAM_RAW_ROWPIX              4080 // from calcs see 100C lib.c
2351    #define CAM_RAW_ROWS                3048 //  "     "    "    "    " 
2352   
2353    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
2354    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2355    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1
2356
2357    #define CAM_VIDEO_QUALITY_ONLY          1 
2358
2359    #undef  CAM_VIDEO_CONTROL
2360    #define CAM_MULTIPART               1
2361    #define CAM_HAS_JOGDIAL             1
2362    #undef  CAM_USE_ZOOM_FOR_MF
2363    #undef  CAM_UNCACHED_BIT  // shut up compiler
2364    #define CAM_UNCACHED_BIT    0x40000000
2365    #define DNG_SUPPORT                 1
2366    // pattern
2367    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2368    // color
2369    //need fixing *****************************************************
2370    #define CAM_COLORMATRIX1                               \
2371      14134, 1000000, -5576, 1000000, -1527, 1000000, \
2372     -1991,  1000000, 10719,  1000000, 1273,   1000000, \
2373      -1158,   1000000, 1929,   1000000, 3581,  1000000
2374
2375    #define cam_CalibrationIlluminant1 17 // Standard Light A
2376    // cropping
2377    #define CAM_JPEG_WIDTH  4000
2378    #define CAM_JPEG_HEIGHT 3000
2379    #define CAM_ACTIVE_AREA_X1 52
2380    #define CAM_ACTIVE_AREA_Y1 14
2381    #define CAM_ACTIVE_AREA_X2 4052
2382    #define CAM_ACTIVE_AREA_Y2 3014
2383    // camera name
2384    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2385    #undef  CAM_SENSOR_BITS_PER_PIXEL
2386    #undef  CAM_WHITE_LEVEL
2387    #undef  CAM_BLACK_LEVEL
2388    #define CAM_SENSOR_BITS_PER_PIXEL   12
2389    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2390    #define CAM_BLACK_LEVEL             127
2391
2392    #define CAM_EXT_TV_RANGE            1
2393    #undef CAM_BITMAP_PALETTE
2394    #define CAM_BITMAP_PALETTE    3
2395    #undef CAM_HAS_ERASE_BUTTON
2396    #define  CAM_SHOW_OSD_IN_SHOOT_MENU  1
2397       
2398    //nandoide sept-2009
2399    #undef CAM_USES_ASPECT_CORRECTION   
2400    #undef CAM_USES_ASPECT_YCORRECTION 
2401    #define CAM_USES_ASPECT_CORRECTION  1  //camera uses the modified graphics primitives to map screens an viewports to buffers more sized
2402    #define CAM_USES_ASPECT_YCORRECTION  0  //only uses mappings on x coordinate
2403
2404// reyalp TODO not sure this stuff belongs in camera.h there will probably only be a few different setups
2405// maybe we can just have one CAM_ options that picks what to use ?
2406// values need to be better documented
2407        // reyalp - I guess these are bitmap ?
2408    //default mappings
2409    #undef ASPECT_XCORRECTION
2410    #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
2411   
2412    //grids
2413    #undef ASPECT_GRID_XCORRECTION
2414    #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
2415    #undef ASPECT_GRID_YCORRECTION
2416    #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here.
2417   
2418    //viewport
2419    #undef ASPECT_VIEWPORT_XCORRECTION
2420    #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
2421    #undef ASPECT_VIEWPORT_YCORRECTION
2422    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
2423    #undef EDGE_HMARGIN
2424    #define EDGE_HMARGIN 20
2425   
2426    //games mappings
2427   #undef GAMES_SCREEN_WIDTH
2428   #undef GAMES_SCREEN_HEIGHT
2429   #define GAMES_SCREEN_WIDTH 360
2430   #define GAMES_SCREEN_HEIGHT 240
2431   #undef ASPECT_GAMES_XCORRECTION
2432   // 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
2433   // 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
2434   // other modes in perfect aspect ratio 4/3: slightly better visualization: file menus more readable, ...
2435   #define ASPECT_GAMES_XCORRECTION(x)   ( ((x)<<1) ) 
2436   #undef ASPECT_GAMES_YCORRECTION
2437   #define ASPECT_GAMES_YCORRECTION(y)   ( (y) )  //none
2438
2439   //zebra letterbox for saving memory
2440   #undef ZEBRA_HMARGIN0
2441   #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).
2442
2443   //end nandoide sept-2009
2444   #define CAM_QUALITY_OVERRIDE 1
2445   #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
2446//----------------------------------------------------------
2447
2448#elif defined (CAMERA_g11)
2449    #define CAM_DRYOS_2_3_R39                   1
2450    #define CAM_PROPSET                 3
2451    #define CAM_DRYOS                   1
2452    #undef  CAM_USE_ZOOM_FOR_MF
2453    #define CAM_RAW_ROWPIX              3744   // See g11 lib.c
2454    #define CAM_RAW_ROWS                2784   // See g11 lib.c
2455    #undef  CAM_EMUL_KEYPRESS_DURATION
2456    #define CAM_EMUL_KEYPRESS_DURATION  10
2457
2458        #define CAM_QUALITY_OVERRIDE 1
2459    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
2460    #define CAM_HAS_JOGDIAL             1
2461    #undef  CAM_CONSOLE_LOG_ENABLED         // Development: internal camera stdout -> A/stdout.txt
2462    #define CAM_BRACKETING              1
2463    #define CAM_MULTIPART               1
2464    #define CAM_EXT_TV_RANGE            1
2465    #undef OPT_CURVES
2466    #undef CAM_UNCACHED_BIT
2467    #define CAM_UNCACHED_BIT            0x40000000  // G11 @FF888204(via ExMem.FreeCacheable)
2468
2469        #define CAM_SWIVEL_SCREEN                       1
2470        #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
2471
2472    // camera name
2473    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2474    #undef  CAM_SENSOR_BITS_PER_PIXEL
2475    #undef  CAM_WHITE_LEVEL
2476    #undef  CAM_BLACK_LEVEL
2477    #define CAM_SENSOR_BITS_PER_PIXEL   12
2478    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2479    #define CAM_BLACK_LEVEL             127
2480
2481    #undef CAM_USES_ASPECT_CORRECTION   
2482    #undef CAM_USES_ASPECT_YCORRECTION 
2483    #define CAM_USES_ASPECT_CORRECTION  1  //camera uses the modified graphics primitives to map screens an viewports to buffers more sized
2484    #define CAM_USES_ASPECT_YCORRECTION  0  //only uses mappings on x coordinate
2485    //games mappings
2486        #undef GAMES_SCREEN_WIDTH
2487        #undef GAMES_SCREEN_HEIGHT
2488        #define GAMES_SCREEN_WIDTH 360
2489        #define GAMES_SCREEN_HEIGHT 240
2490
2491    #undef CAM_BITMAP_PALETTE
2492    #define CAM_BITMAP_PALETTE    4
2493
2494
2495    #undef ASPECT_XCORRECTION
2496        #define ASPECT_XCORRECTION(x)  ( ( ((x)<<3) + (x) )  >>2 )
2497        #undef ASPECT_GAMES_XCORRECTION
2498        #define ASPECT_GAMES_XCORRECTION(x)   ( ((x)<<1) ) 
2499        #undef ASPECT_GAMES_YCORRECTION
2500        #define ASPECT_GAMES_YCORRECTION(y)   ( (y) )  //none
2501
2502    #undef ASPECT_GRID_XCORRECTION
2503    #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
2504    #undef ASPECT_GRID_YCORRECTION
2505    #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here.
2506
2507    #undef ASPECT_VIEWPORT_XCORRECTION
2508    #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
2509    #undef ASPECT_VIEWPORT_YCORRECTION
2510    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
2511    #undef EDGE_HMARGIN
2512    #define EDGE_HMARGIN 20
2513
2514        /**** From SX200IS, ok for G11 ?*/
2515    #define DNG_SUPPORT    1
2516    // pattern
2517    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2518    // color
2519    //need fixing *****************************************************
2520    #define CAM_COLORMATRIX1                               \
2521      14134, 1000000, -5576, 1000000, -1527, 1000000, \
2522     -1991,  1000000, 10719,  1000000, 1273,   1000000, \
2523      -1158,   1000000, 1929,   1000000, 3581,  1000000
2524    #define cam_CalibrationIlluminant1 17 // Standard Light A
2525
2526    // cropping
2527    #define CAM_JPEG_WIDTH  3600
2528    #define CAM_JPEG_HEIGHT 2700
2529    #define CAM_ACTIVE_AREA_X1 52
2530    #define CAM_ACTIVE_AREA_Y1 14
2531    #define CAM_ACTIVE_AREA_X2 3648
2532    #define CAM_ACTIVE_AREA_Y2 2736
2533          /**** From SX200IS, ok for G11 END?*/
2534//----------------------------------------------------------
2535
2536#elif defined (CAMERA_s90)
2537    #define CAM_DRYOS_2_3_R39                   1
2538    #define CAM_PROPSET                 3
2539    #define CAM_DRYOS                   1
2540    #undef  CAM_USE_ZOOM_FOR_MF
2541    #define CAM_RAW_ROWPIX              3744   // See g11 lib.c
2542    #define CAM_RAW_ROWS                2784   // See g11 lib.c
2543    #undef  CAM_EMUL_KEYPRESS_DURATION
2544    #define CAM_EMUL_KEYPRESS_DURATION  10
2545
2546        #define CAM_QUALITY_OVERRIDE 1
2547    #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
2548    #define CAM_HAS_JOGDIAL             1
2549        #undef CAM_HAS_ERASE_BUTTON
2550    #undef  CAM_CONSOLE_LOG_ENABLED         // Development: internal camera stdout -> A/stdout.txt
2551    #define CAM_BRACKETING              1
2552    #define CAM_MULTIPART               1
2553    #define CAM_EXT_TV_RANGE            1
2554    #undef OPT_CURVES
2555    #undef CAM_UNCACHED_BIT
2556    #define CAM_UNCACHED_BIT            0x40000000  // S90 @FF8875FC(via ExMem.FreeCacheable)
2557
2558        #define CAM_SHOW_OSD_IN_SHOOT_MENU  1
2559
2560    // camera name
2561    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2562    #undef  CAM_SENSOR_BITS_PER_PIXEL
2563    #undef  CAM_WHITE_LEVEL
2564    #undef  CAM_BLACK_LEVEL
2565    #define CAM_SENSOR_BITS_PER_PIXEL   12
2566    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2567    #define CAM_BLACK_LEVEL             127
2568
2569    #undef CAM_USES_ASPECT_CORRECTION   
2570    #undef CAM_USES_ASPECT_YCORRECTION 
2571    #define CAM_USES_ASPECT_CORRECTION  1  //camera uses the modified graphics primitives to map screens an viewports to buffers more sized
2572    #define CAM_USES_ASPECT_YCORRECTION  0  //only uses mappings on x coordinate
2573    //games mappings
2574        #undef GAMES_SCREEN_WIDTH
2575        #undef GAMES_SCREEN_HEIGHT
2576        #define GAMES_SCREEN_WIDTH 360
2577        #define GAMES_SCREEN_HEIGHT 240
2578
2579    #undef CAM_BITMAP_PALETTE
2580    #define CAM_BITMAP_PALETTE    4
2581
2582    #undef ASPECT_XCORRECTION
2583        #define ASPECT_XCORRECTION(x)  ( ( ((x)<<3) + (x) )  >>2 )
2584        #undef ASPECT_GAMES_XCORRECTION
2585        #define ASPECT_GAMES_XCORRECTION(x)   ( ((x)<<1) ) 
2586        #undef ASPECT_GAMES_YCORRECTION
2587        #define ASPECT_GAMES_YCORRECTION(y)   ( (y) )  //none
2588
2589    #undef ASPECT_GRID_XCORRECTION
2590    #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
2591    #undef ASPECT_GRID_YCORRECTION
2592    #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here.
2593
2594    #undef ASPECT_VIEWPORT_XCORRECTION
2595    #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
2596    #undef ASPECT_VIEWPORT_YCORRECTION
2597    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
2598    #undef EDGE_HMARGIN
2599    #define EDGE_HMARGIN 20
2600
2601        /**** From SX200IS, ok for S90 ?*/
2602    #define DNG_SUPPORT    1
2603    // pattern
2604    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2605    // color
2606    //need fixing *****************************************************
2607    #define CAM_COLORMATRIX1                               \
2608      14134, 1000000, -5576, 1000000, -1527, 1000000, \
2609     -1991,  1000000, 10719,  1000000, 1273,   1000000, \
2610      -1158,   1000000, 1929,   1000000, 3581,  1000000
2611    #define cam_CalibrationIlluminant1 17 // Standard Light A
2612
2613    // cropping
2614    #define CAM_JPEG_WIDTH  3600
2615    #define CAM_JPEG_HEIGHT 2700
2616    #define CAM_ACTIVE_AREA_X1 52
2617    #define CAM_ACTIVE_AREA_Y1 14
2618    #define CAM_ACTIVE_AREA_X2 3648
2619    #define CAM_ACTIVE_AREA_Y2 2736
2620    /**** From SX200IS, ok for S90 END?*/
2621//----------------------------------------------------------
2622
2623#elif defined (CAMERA_sx20)
2624    #define CAM_PROPSET                 3
2625    #define CAM_DRYOS                   1
2626    #define CAM_DRYOS_2_3_R39           1
2627
2628    #define CAM_RAW_ROWPIX              4080
2629    #define CAM_RAW_ROWS                3048
2630
2631    #define CAM_SWIVEL_SCREEN           1
2632    #define CAM_ADJUSTABLE_ALT_BUTTON   1
2633    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
2634    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
2635    #define CAM_HAS_VIDEO_BUTTON                1
2636    #define CAM_VIDEO_QUALITY_ONLY      1 
2637    #define CAM_BRACKETING              1
2638    #undef  CAM_VIDEO_CONTROL
2639    #define CAM_MULTIPART               1
2640    #define CAM_HAS_JOGDIAL             1
2641    #undef  CAM_USE_ZOOM_FOR_MF
2642    #undef  CAM_UNCACHED_BIT  // shut up compiler
2643    #define CAM_UNCACHED_BIT    0x40000000
2644
2645    #define DNG_SUPPORT                 1
2646    // pattern
2647    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
2648    // color
2649
2650    #define CAM_COLORMATRIX1                               \
2651      827547, 1000000, -290458, 1000000, -126086, 1000000, \
2652     -12829,  1000000, 530507,  1000000, 50537,   1000000, \
2653      5181,   1000000, 48183,   1000000, 245014,  1000000
2654
2655    #define cam_CalibrationIlluminant1 1 // Daylight
2656    // cropping
2657    #define CAM_JPEG_WIDTH      4000
2658    #define CAM_JPEG_HEIGHT 3000
2659    #define CAM_ACTIVE_AREA_X1 24
2660    #define CAM_ACTIVE_AREA_Y1 12
2661    #define CAM_ACTIVE_AREA_X2 4080-48
2662    #define CAM_ACTIVE_AREA_Y2 3048-24
2663    // camera name
2664    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
2665    #undef  CAM_SENSOR_BITS_PER_PIXEL
2666    #undef  CAM_WHITE_LEVEL
2667    #undef  CAM_BLACK_LEVEL
2668    #define CAM_SENSOR_BITS_PER_PIXEL   12
2669    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
2670    #define CAM_BLACK_LEVEL             127
2671
2672    #define CAM_EXT_TV_RANGE            1
2673    #define CAM_QUALITY_OVERRIDE        1
2674
2675    // copied from the SX200 which has the same video buffer size
2676    #undef CAM_USES_ASPECT_CORRECTION   
2677    #undef CAM_USES_ASPECT_YCORRECTION 
2678    #define CAM_USES_ASPECT_CORRECTION  1  //camera uses the modified graphics primitives to map screens an viewports to buffers more sized
2679    #define CAM_USES_ASPECT_YCORRECTION  0  //only uses mappings on x coordinate
2680
2681    #undef ASPECT_XCORRECTION
2682    #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
2683
2684    #undef ASPECT_GRID_XCORRECTION
2685    #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
2686    #undef ASPECT_GRID_YCORRECTION
2687    #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here.
2688
2689    #undef ASPECT_VIEWPORT_XCORRECTION
2690    #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
2691    #undef ASPECT_VIEWPORT_YCORRECTION
2692    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
2693
2694    //games mappings
2695    #undef GAMES_SCREEN_WIDTH
2696    #undef GAMES_SCREEN_HEIGHT
2697        #define GAMES_SCREEN_WIDTH 360
2698    #define GAMES_SCREEN_HEIGHT 240
2699    #undef ASPECT_GAMES_XCORRECTION
2700    // 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
2701    // 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
2702    // other modes in perfect aspect ratio 4/3: slightly better visualization: file menus more readable, ...
2703    #define ASPECT_GAMES_XCORRECTION(x)   ( ((x)<<1) ) 
2704    #undef ASPECT_GAMES_YCORRECTION
2705    #define ASPECT_GAMES_YCORRECTION(y)   ( (y) )  //none
2706
2707    #undef CAM_BITMAP_PALETTE
2708    #define CAM_BITMAP_PALETTE    6
2709
2710   //zebra letterbox for saving memory
2711   #undef ZEBRA_HMARGIN0
2712   #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).
2713 
2714   #undef EDGE_HMARGIN
2715   #define EDGE_HMARGIN 20
2716
2717   // the SX20 has a very small amount of free ram once CHDK is loaded - probably due to the large display buffers in use
2718   // The RAM is so low that edge detection and zebra crash the device
2719   // unloading the games from this build free's 14k of ram allowing zebra and edge to
2720   // work normally and the random crashes to go away
2721   #undef OPT_GAME_REVERSI
2722   #undef OPT_GAME_SOKOBAN
2723   #undef OPT_GAME_CONNECT4
2724   #undef OPT_GAME_MASTERMIND
2725   #undef OPT_CALENDAR
2726//----------------------------------------------------------
2727
2728
2729#else
2730    #error camera type not defined
2731#endif
2732//==========================================================
2733// END of Camera-dependent settings
2734//==========================================================
2735
2736
2737// curves only work in 10bpp for now
2738#if CAM_SENSOR_BITS_PER_PIXEL != 10
2739#undef OPT_CURVES
2740#endif
2741
2742#endif /* CAMERA_H */
Note: See TracBrowser for help on using the repository browser.