Changeset 1140


Ignore:
Timestamp:
04/11/11 03:54:29 (2 years ago)
Author:
reyalP
Message:

split camera.h into individual files for each camera, from philmoz in http://chdk.setepontos.com/index.php?topic=650.msg64552#msg64552 + minor cleanup in camera.h

Location:
trunk
Files:
65 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/camera.h

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

    r1134 r1140  
    432432CTHUMB=-mthumb 
    433433CFLAGS+=-mthumb-interwork 
    434 CFLAGS+=-I$(topdir)include $(PLFLAGS) $(CPPFLAGS) 
     434CFLAGS+=-I$(topdir)include -I$(topdir)platform/$(PLATFORM) $(PLFLAGS) $(CPPFLAGS) 
    435435CFLAGS+=-DPLATFORM=\"$(PLATFORM)\" -DPLATFORMSUB=\"$(PLATFORMSUB)\" -DPLATFORMID=$(PLATFORMID) -DHDK_VERSION=\"$(VER)\" -DBUILD_NUMBER=\"$(BUILD_NUMBER)\" -DCAMERA_$(PLATFORM)=1 
    436436CFLAGS+=-Wall -Wno-unused -Wno-format 
Note: See TracChangeset for help on using the changeset viewer.