source: trunk/include/camera.h @ 949

Revision 949, 113.0 KB checked in by reyalp, 3 years ago (diff)

add aspect correction for ixus95, should fix zebra and grids etc

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