source: trunk/include/camera.h @ 889

Revision 889, 95.5 KB checked in by reyalp, 3 years ago (diff)

from err99: undef CAM_HAS_ERASE_BUTTON for s90

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