source: trunk/include/camera.h @ 936

Revision 936, 111.4 KB checked in by reyalp, 3 years ago (diff)

camera specific ifdef cleanup from DavidB, comment by me.

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