source: trunk/include/camera.h @ 995

Revision 995, 117.1 KB checked in by pixeldoc2000, 2 years ago (diff)

a610: CAM_MULTIPART added, downstream chdkde: 419, 420, 421

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