| 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 | |
|---|
| 11 | #ifndef CAMERA_H |
|---|
| 12 | #define CAMERA_H |
|---|
| 13 | |
|---|
| 14 | //========================================================== |
|---|
| 15 | // Camera-dependent settings |
|---|
| 16 | //========================================================== |
|---|
| 17 | |
|---|
| 18 | //---------------------------------------------------------- |
|---|
| 19 | // Default values |
|---|
| 20 | //---------------------------------------------------------- |
|---|
| 21 | |
|---|
| 22 | #undef CAM_DRYOS // Camera is DryOS-based |
|---|
| 23 | #undef CAM_PROPSET // Camera's properties group (the generation) |
|---|
| 24 | #undef CAM_DRYOS_2_3_R39 // Define for cameras with DryOS release R39 or greater |
|---|
| 25 | #undef CAM_DRYOS_2_3_R47 // Define for cameras with DryOS release R47 or greater |
|---|
| 26 | |
|---|
| 27 | #undef CAM_SWIVEL_SCREEN // Camera has rotated LCD screen |
|---|
| 28 | #define CAM_USE_ZOOM_FOR_MF 1 // Zoom lever can be used for manual focus adjustments |
|---|
| 29 | #undef CAM_ADJUSTABLE_ALT_BUTTON // ALT-button can be set from menu |
|---|
| 30 | #define CAM_REMOTE 1 // Camera supports USB-remote |
|---|
| 31 | #undef SYNCHABLE_REMOTE_NOT_ENABLED // Disable support for synchable remote switch (in kbd.c) TODO only used by one camera ??? |
|---|
| 32 | #define CAM_SYNCH 1 // Camera supports SDM precision synch |
|---|
| 33 | #undef CAM_MULTIPART // Camera supports SD-card multipartitioning |
|---|
| 34 | #define CAM_HAS_ZOOM_LEVER 1 // Camera has dedicated zoom buttons |
|---|
| 35 | #undef CAM_DRAW_EXPOSITION // Output expo-pair on screen (for cameras which (sometimes) don't do that) |
|---|
| 36 | #define CAM_HAS_ERASE_BUTTON 1 // Camera has dedicated erase button |
|---|
| 37 | #define CAM_HAS_IRIS_DIAPHRAGM 1 // Camera has real diaphragm mechanism |
|---|
| 38 | #undef CAM_HAS_ND_FILTER // Camera has build-in ND filter |
|---|
| 39 | #define CAM_CAN_SD_OVER_NOT_IN_MF 1 // Camera allows subject distance (focus) override when not in manual focus mode |
|---|
| 40 | #define CAM_CAN_SD_OVERRIDE 1 // Camera allows to do subject distance override |
|---|
| 41 | #define CAM_HAS_MANUAL_FOCUS 1 // Camera has manual focus mode |
|---|
| 42 | #define CAM_HAS_USER_TV_MODES 1 // Camera has tv-priority or manual modes with ability to set tv value |
|---|
| 43 | #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 |
|---|
| 44 | #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1 // Camera can unlock optical zoom in video (if it is locked) |
|---|
| 45 | #undef CAM_FEATURE_FEATHER // Cameras with "feather" or touch wheel. |
|---|
| 46 | #define CAM_HAS_IS 1 // Camera has image stabilizer |
|---|
| 47 | #undef CAM_HAS_JOGDIAL // Camera has a "jog dial" |
|---|
| 48 | |
|---|
| 49 | #undef CAM_CONSOLE_LOG_ENABLED // Development: internal camera stdout -> A/stdout.txt |
|---|
| 50 | #define CAM_CHDK_HAS_EXT_VIDEO_MENU 1 // In CHDK for this camera realized adjustable video compression |
|---|
| 51 | #undef CAM_CAN_MUTE_MICROPHONE // Camera has function to mute microphone |
|---|
| 52 | |
|---|
| 53 | #define CAM_EMUL_KEYPRESS_DELAY 40 // Delay to interpret <alt>-button press as longpress |
|---|
| 54 | #define CAM_EMUL_KEYPRESS_DURATION 5 // Length of keypress emulation |
|---|
| 55 | |
|---|
| 56 | #define CAM_MENU_BORDERWIDTH 30 // Defines the width of the border on each side of the CHDK menu. The CHDK menu will have this |
|---|
| 57 | // many pixels left blank to the on each side. Should not be less than 10 to allow room for the |
|---|
| 58 | // scroll bar on the right. |
|---|
| 59 | |
|---|
| 60 | #undef CAM_DETECT_SCREEN_ERASE // Define this to add 'guard' pixel to the screen bitmap to help detect if the firmware has erase the screen |
|---|
| 61 | // If the guard pixel changes the CHDK ALT menu is forced to redraw. |
|---|
| 62 | // Take care not to place CHDK OSD elements over the guard pixel. |
|---|
| 63 | // The guard pixel is the first pixel of the top row in the screen bitmap. |
|---|
| 64 | |
|---|
| 65 | #undef CAM_AF_SCAN_DURING_VIDEO_RECORD // CHDK can make single AF scan during video record |
|---|
| 66 | #undef CAM_HAS_VIDEO_BUTTON // Camera can take stills in video mode, and vice versa |
|---|
| 67 | #undef CAM_EV_IN_VIDEO // CHDK can change exposure in video mode |
|---|
| 68 | #define CAM_VIDEO_CONTROL 1 // pause / unpause video recordings |
|---|
| 69 | #undef CAM_VIDEO_QUALITY_ONLY // Override Video Bitrate is not supported |
|---|
| 70 | |
|---|
| 71 | #define ZOOM_OVERRIDE 0 // Shall zoom-override be used? default 0 becoz not implemented right now |
|---|
| 72 | |
|---|
| 73 | #undef CAM_REAR_CURTAIN // Camera do not have front/rear curtain flash sync in menu |
|---|
| 74 | #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!) |
|---|
| 75 | #undef CAM_EXT_TV_RANGE // CHDK can make exposure time longer than 64s |
|---|
| 76 | #define CAM_CHDK_PTP 1 // include CHDK PTP support |
|---|
| 77 | |
|---|
| 78 | #define CAM_UNCACHED_BIT 0x10000000 // bit indicating the uncached memory |
|---|
| 79 | |
|---|
| 80 | #define CAM_MAKE "Canon" |
|---|
| 81 | #define CAM_SENSOR_BITS_PER_PIXEL 10 // Bits per pixel. 10 is standard, 12 is supported except for curves |
|---|
| 82 | #define CAM_WHITE_LEVEL ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1) // 10bpp = 1023 ((1<<10)-1), 12bpp = 4095 ((1<<12)-1) |
|---|
| 83 | #define CAM_BLACK_LEVEL ((1<<(CAM_SENSOR_BITS_PER_PIXEL-5))-1) // 10bpp = 31 ((1<<5)-1), 12bpp = 127 ((1<<7)-1) |
|---|
| 84 | |
|---|
| 85 | #define CAM_BITMAP_PALETTE 1 // which color set is used for this camera |
|---|
| 86 | |
|---|
| 87 | #undef CAM_HAS_VARIABLE_ASPECT // can switch between 16:9 and 4:3 |
|---|
| 88 | |
|---|
| 89 | // by nandoide sept-2009 |
|---|
| 90 | // zebra adjust buffer height: show use at sx200is: needed for save memory space |
|---|
| 91 | #define ZEBRA_HMARGIN0 0 |
|---|
| 92 | |
|---|
| 93 | // aspect corrections |
|---|
| 94 | #define CAM_USES_ASPECT_CORRECTION 0 // if true, camera uses a modified graphics primitives to draw with exact display aspect-ratio. |
|---|
| 95 | // Could slow the graphics output (but not perceived on sx200is), but adds rectangle drawing optimizations to compensate. |
|---|
| 96 | // To extend to other cameras see sx200is camera.h comments in and comments on core gui_draw.c |
|---|
| 97 | #define CAM_USES_ASPECT_YCORRECTION 0 |
|---|
| 98 | |
|---|
| 99 | // menu, alt (default) |
|---|
| 100 | #define ASPECT_XCORRECTION(x) ( ((x)<<1) ) // see comments on 200is |
|---|
| 101 | #define ASPECT_YCORRECTION(y) ( (y) ) // no correction the same for coordinate y. I think there are no cameras actually needing both corrections. |
|---|
| 102 | // viewport, defaults used if there is no aspect correction |
|---|
| 103 | #define ASPECT_VIEWPORT_XCORRECTION(x) ( (x) ) // see comments on 200is |
|---|
| 104 | #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) ) // no correction |
|---|
| 105 | |
|---|
| 106 | #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 |
|---|
| 107 | // end of section by nandoid |
|---|
| 108 | |
|---|
| 109 | #undef CAM_QUALITY_OVERRIDE // define this in platform_camera.h to enable 'Super Fine' JPEG compression mode |
|---|
| 110 | // used to allow super fine JPEG option on cameras where this has been removed |
|---|
| 111 | // from the Canon menu. Note: may not actually work on all cameras. |
|---|
| 112 | |
|---|
| 113 | #undef CAM_ZEBRA_ASPECT_ADJUST // zebra needs to account for real bitmap size being different from what lib.c reports |
|---|
| 114 | // also used by some cameras with normal bitmap layouts for memory saving ? |
|---|
| 115 | #undef CAM_ZEBRA_NOBUF // zebra draws directly on bitmap buffer. Requires above as well |
|---|
| 116 | |
|---|
| 117 | #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 |
|---|
| 118 | |
|---|
| 119 | #undef CAM_KEY_CLICK_DELAY // additional delay between press and release for scripted click |
|---|
| 120 | #define CAM_KEY_PRESS_DELAY 20 // delay after a press - TODO can we combine this with above ? |
|---|
| 121 | #define CAM_KEY_RELEASE_DELAY 20 // delay after a release - TODO do we really need to wait after release ? |
|---|
| 122 | |
|---|
| 123 | #undef CAM_DATE_FOLDER_NAMING // Camera uses date for naming image folders |
|---|
| 124 | |
|---|
| 125 | #undef CAM_STARTUP_CRASH_FILE_OPEN_FIX // enable fix for camera crash at startup when opening the conf / font files |
|---|
| 126 | // see http://chdk.setepontos.com/index.php?topic=6179.0 |
|---|
| 127 | |
|---|
| 128 | // RAW & DNG related values |
|---|
| 129 | #define DNG_SUPPORT 1 // Camera supports DNG format for saving of RAW images |
|---|
| 130 | #define DEFAULT_RAW_EXT 1 // extension to use for raw (see raw_exts in conf.c) |
|---|
| 131 | #undef CAM_RAW_ROWPIX // Number of pixels in RAW row (physical size of the sensor) |
|---|
| 132 | #undef CAM_RAW_ROWS // Number of rows in RAW (physical size of the sensor) |
|---|
| 133 | #undef CAM_JPEG_WIDTH // Default crop size (width) stored in DNG (to match camera JPEG size) |
|---|
| 134 | #undef CAM_JPEG_HEIGHT // Default crop size (height) stored in DNG (to match camera JPEG size) |
|---|
| 135 | #undef CAM_ACTIVE_AREA_X1 // Define usable area of the sensor |
|---|
| 136 | #undef CAM_ACTIVE_AREA_Y1 // Define usable area of the sensor |
|---|
| 137 | #undef CAM_ACTIVE_AREA_X2 // Define usable area of the sensor |
|---|
| 138 | #undef CAM_ACTIVE_AREA_Y2 // Define usable area of the sensor |
|---|
| 139 | #undef cam_CFAPattern // Camera Bayer sensor data layout (DNG colors are messed up if not correct) |
|---|
| 140 | #undef CAM_COLORMATRIX1 // DNG color profile matrix |
|---|
| 141 | #undef cam_CalibrationIlluminant1 // DNG color profile illuminant |
|---|
| 142 | #undef CAM_DNG_EXPOSURE_BIAS // Specify DNG exposure bias value (to override default of -0.5 in the dng.c code) |
|---|
| 143 | #undef DNG_EXT_FROM // Extension in the cameras known extensions to replace with .DNG to allow DNG |
|---|
| 144 | // files to be transfered over standard PTP. Only applicable to older cameras |
|---|
| 145 | #undef DNG_VERT_RLE_BADPIXELS // Enable vertical run length compression of badpixel data for DNG |
|---|
| 146 | // IXUS 310 HS bad pixels tend to be grouped into vertical lines of 1-4 pixels |
|---|
| 147 | // This reduces the file size by approx 45% |
|---|
| 148 | |
|---|
| 149 | // Games definitions |
|---|
| 150 | #define GAMES_SCREEN_WIDTH 360 // Logical screen width for games |
|---|
| 151 | #define GAMES_SCREEN_HEIGHT 240 // Logical screen height for games |
|---|
| 152 | #define ASPECT_GAMES_XCORRECTION(x) ((x)<<1) // Aspect ratio correction for games. Default for games is 360x240 logical screen. Physical camera screen is |
|---|
| 153 | #define ASPECT_GAMES_YCORRECTION(y) (y) // 720x240 so x*2 needed for X axis correction, no correction for Y. |
|---|
| 154 | |
|---|
| 155 | // Grid definitions |
|---|
| 156 | #define ASPECT_GRID_XCORRECTION(x) (x) // Aspect ratio correction for grids. Grids are designed on a 360x240 logical screen size which matches the |
|---|
| 157 | #define ASPECT_GRID_YCORRECTION(y) (y) // default CHDK logical screen size so no correction needed. |
|---|
| 158 | |
|---|
| 159 | #undef PARAM_CAMERA_NAME // parameter number for GetParameterData to get camera name |
|---|
| 160 | |
|---|
| 161 | |
|---|
| 162 | #undef CAM_FIRMWARE_MEMINFO // Use 'GetMemInfo' (dryos) or 'memPartInfoGet'/'memPartFindMax' (vxworks) |
|---|
| 163 | // function in firmware to get free memory details |
|---|
| 164 | // GetMemInfo should be found correctly by the gensig/finsig signature |
|---|
| 165 | // finder for all dryos based cameras. |
|---|
| 166 | |
|---|
| 167 | #undef CAM_NO_MEMPARTINFO // VXWORKS camera does not have memPartInfoGet, fall back to memPartFindMax |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | #undef CAM_DRIVE_MODE_FROM_TIMER_MODE // use PROPCASE_TIMER_MODE to check for multiple shot custom timer. |
|---|
| 171 | // Used to enabled bracketing in custom timer, required on many recent cameras |
|---|
| 172 | // see http://chdk.setepontos.com/index.php/topic,3994.405.html |
|---|
| 173 | |
|---|
| 174 | #undef CAM_AV_OVERRIDE_IRIS_FIX // for cameras that require _MoveIrisWithAv function to override Av (for bracketing). |
|---|
| 175 | |
|---|
| 176 | #undef CAM_DISABLE_RAW_IN_LOW_LIGHT_MODE // For cameras with 'low light' mode that does now work with raw define this |
|---|
| 177 | |
|---|
| 178 | //---------------------------------------------------------- |
|---|
| 179 | // Override Default values for Camera if necessary |
|---|
| 180 | //---------------------------------------------------------- |
|---|
| 181 | |
|---|
| 182 | // Include the settings file for the camera model currently being compiled. |
|---|
| 183 | #include "platform_camera.h" |
|---|
| 184 | |
|---|
| 185 | //========================================================== |
|---|
| 186 | // END of Camera-dependent settings |
|---|
| 187 | //========================================================== |
|---|
| 188 | |
|---|
| 189 | |
|---|
| 190 | // curves only work in 10bpp for now |
|---|
| 191 | #if CAM_SENSOR_BITS_PER_PIXEL != 10 |
|---|
| 192 | #undef OPT_CURVES |
|---|
| 193 | #endif |
|---|
| 194 | |
|---|
| 195 | #ifndef OPT_PTP |
|---|
| 196 | #undef CAM_CHDK_PTP |
|---|
| 197 | #endif |
|---|
| 198 | |
|---|
| 199 | #endif /* CAMERA_H */ |
|---|