source: trunk/include/camera.h @ 1062

Revision 1062, 132.5 KB checked in by reyalP, 2 years ago (diff)

ixus120_sd940 doesn't have video button, adjustable alt

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