root/include/camera.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 // camera.h
   2 
   3 #ifdef CHDK_MODULE_CODE
   4 #error camera.h cannot be #included in module code (did you mean camera_info.h).
   5 #endif
   6 
   7 // This file contains the default values for various settings that may change across camera models.
   8 // Setting values specific to each camera model can be found in the platform/XXX/platform_camera.h file for camera.
   9 
  10 // If adding a new settings value put a suitable default value in here, along with documentation on
  11 // what the setting does and how to determine the correct value.
  12 // If the setting should not have a default value then add it here using the '#undef' directive
  13 // along with appropriate documentation.
  14 
  15 #ifndef CAMERA_H
  16 #define CAMERA_H
  17 
  18 //==========================================================
  19 // Camera-dependent settings
  20 //==========================================================
  21 
  22 //----------------------------------------------------------
  23 // Default values
  24 //----------------------------------------------------------
  25 
  26     #undef  CAM_DRYOS                           // Camera is DryOS-based
  27     #undef  CAM_PROPSET                         // Camera's properties group (the generation)
  28     #undef  CAM_ILC                             // Camera uses interchangable lenses (EOS M series)
  29     #define CAM_FLASHPARAMS_VERSION         3   // flash parameters structure version (every camera from 2005 on is version 3)
  30     #undef  CAM_DRYOS_2_3_R39                   // Define for cameras with DryOS release R39 or greater
  31     #undef  CAM_DRYOS_2_3_R47                   // Define for cameras with DryOS release R47 or greater -> Cameras can boot from FAT32
  32     #undef  CAM_DRYOS_2_3_R59                   // Define for cameras with DryOS release R59 or greater -> some support for 64bit files
  33 
  34     #define CAM_CIRCLE_OF_CONFUSION         5   // CoC value for camera/sensor (see http://www.dofmaster.com/digital_coc.html)
  35 
  36     #undef  CAM_HAS_CMOS                        // Camera has CMOS sensor
  37     #undef  CAM_SWIVEL_SCREEN                   // Camera has rotated LCD screen
  38     #define CAM_USE_ZOOM_FOR_MF             1   // Zoom lever can be used for manual focus adjustments
  39     #define CAM_DEFAULT_ALT_BUTTON  KEY_PRINT   // alt button for cameras without adjustable alt
  40                                                 // redefine if not print to avoid need for KEY_PRINT alias in keymap
  41     #undef  CAM_ADJUSTABLE_ALT_BUTTON           // ALT-button can be set from menu, must set next two values as well
  42     #undef  CAM_ALT_BUTTON_NAMES                // Define the list of names for the ALT button   - e.g. { "Print", "Display" }
  43     #undef  CAM_ALT_BUTTON_OPTIONS              // Define the list of options for the ALT button - e.g. { KEY_PRINT, KEY_DISPLAY }
  44     #define CAM_REMOTE                      1   // Camera supports a remote
  45     #undef  CAM_REMOTE_AtoD_CHANNEL             // Camera supports using 3rd battery terminal as well as USB for remote - value = A/D channel to poll (normally 5)
  46     #define CAM_REMOTE_AtoD_THRESHOLD       200 // 3rd battery terminal A/D reading threshold ( lower = 1, higher = 0 )
  47     #undef  CAM_REMOTE_HDMI_HPD                 // Camera supports using HDMI hotplug detect for remote signal
  48     #undef  CAM_REMOTE_HDMI_POWER_OVERRIDE      // Camera requires HDMI power to be forced on in rec mode
  49     #undef  CAM_REMOTE_ANALOG_AV                // Camera supports analog AV detect for remote signal
  50     #undef  CAM_REMOTE_USES_PRECISION_SYNC      // Disable experimental remote  precision sync patch
  51     #define CAM_ALLOWS_USB_PORT_FORCING     1   // USB remote state can be forced to be present (supported on all cameras that use common kbd code, others may undef)
  52     #define CAM_REMOTE_USB_HIGHSPEED        1   // Enable highspeed measurements of pulse width & counts on USB port 
  53     #define CAM_REMOTE_HIGHSPEED_LIMIT 1000     // Set lowest timer value settable by user
  54     #undef  GPIO_VSYNC_CURRENT                  // USB remote precision sync : might be 0xC0F070C8 or 0xC0F07008 (http://chdk.setepontos.com/index.php?topic=8312.msg104027#msg104027)
  55     #undef  CAM_MULTIPART                       // Camera supports SD-card multipartitioning
  56     #define CAM_HAS_ZOOM_LEVER              1   // Camera has dedicated zoom buttons
  57     #undef  CAM_DRAW_EXPOSITION                 // Output expo-pair on screen (for cameras which (sometimes) don't do that)
  58     #define CAM_HAS_ERASE_BUTTON            1   // Camera has dedicated erase button
  59     #define CAM_HAS_DISP_BUTTON             1   // Camera has dedicated DISP button
  60     #define CAM_HAS_IRIS_DIAPHRAGM          1   // Camera has real diaphragm mechanism (http://en.wikipedia.org/wiki/Diaphragm_%28optics%29)
  61     #undef  CAM_HAS_ND_FILTER                   // Camera has build-in ND filter
  62     #undef  CAM_HAS_NATIVE_ND_FILTER            // Camera has built-in ND filter with Canon menu support for enable/disable
  63     #undef  CAM_ND_SET_AV_VALUE                 // Camera needs AV propcase set to override ND. Only valid for cameras without iris. 1 if needed, undef if not
  64 
  65     #define CAM_HAS_MANUAL_FOCUS            1   // Camera has native manual focus mode (disables MF shortcut feature)
  66     #undef  CAM_SD_OVER_IN_AF                   // Camera allows SD override if MF & AFL not set
  67     #undef  CAM_SD_OVER_IN_AFL                  // Camera allows SD override when AFL is set
  68     #undef  CAM_SD_OVER_IN_MF                   // Camera allows SD override when MF is set
  69 
  70     #define CAM_HAS_USER_TV_MODES           1   // Camera has tv-priority or manual modes with ability to set tv value
  71     #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
  72     #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1 // Camera can unlock optical zoom in video (if it is locked in Canon firmare, do not define for cameras that already allow)
  73     #undef  CAM_FEATURE_FEATHER                 // Cameras with "feather" or touch wheel.
  74     #define CAM_HAS_IS                      1   // Camera has image stabilizer
  75     #undef  CAM_HAS_JOGDIAL                     // Camera has a "jog dial"
  76 
  77     #undef  CAM_CONSOLE_LOG_ENABLED             // Development: internal camera stdout -> A/stdout.txt
  78     #define CAM_CHDK_HAS_EXT_VIDEO_MENU     1   // In CHDK for this camera realized adjustable video compression
  79     #undef  CAM_CAN_MUTE_MICROPHONE             // Camera has function to mute microphone
  80 
  81     #define CAM_EMUL_KEYPRESS_DELAY         40  // Delay to interpret <alt>-button press as longpress
  82     #define CAM_EMUL_KEYPRESS_DURATION      5   // Length of keypress emulation
  83 
  84     #define CAM_MENU_BORDERWIDTH            10  // Defines the width of the border on each side of the CHDK menu. The CHDK menu will have this
  85                                                 // many pixels left blank to the on each side. Should not be less than 10 to allow room for the
  86                                                 // scroll bar on the right.
  87 
  88     #undef  CAM_TOUCHSCREEN_UI                  // Define to enable touch screen U/I (e.g. IXUS 310 HS)
  89     #define CAM_TS_BUTTON_BORDER            0   // Define this to leave a border on each side of the OSD display for touch screen buttons.
  90                                                 // Used on the IXUS 310 to stop the OSD from overlapping the on screen buttons on each side
  91     #define CAM_TS_MENU_BORDER              0   // Define this to leave a border at top and bottom of menu to avoid areas where touch sensor does not work
  92                                                 // Used on the IXUS 310 to allow touch selection of menu entries
  93     #define CAM_DISP_ALT_TEXT               1   // Display the '<ALT>' message at the bottom of the screen in ALT mode (IXUS 310 changes button color instead)
  94 
  95     #undef  CAM_AF_SCAN_DURING_VIDEO_RECORD     // CHDK can make single AF scan during video record
  96     #undef  CAM_RESET_AEL_AFTER_VIDEO_AF        // Cam needs AE Lock state reset after AF in video recording
  97     #undef  CAM_HAS_VIDEO_BUTTON                // Camera can take stills in video mode, and vice versa
  98     #define CAM_MASK_VID_REC_ACTIVE    0x0400   // mask so that Canon mode does not change when cam's with video button enter video recording mode
  99     #undef  CAM_EV_IN_VIDEO                     // CHDK can change exposure in video mode
 100     #define CAM_VIDEO_CONTROL               1   // pause / unpause video recordings
 101     #undef  CAM_VIDEO_QUALITY_ONLY              // Override Video Bitrate is not supported
 102     #undef  CAM_CHDK_HAS_EXT_VIDEO_TIME         // Camera can override time limit of video record -> sx220/230
 103     #undef  CAM_SIMPLE_MOVIE_STATUS             // Firmware movie_status nonzero when recording, zero when not - makes CAM_VIDEO_CONTROL ineffective
 104     #undef  CAM_MOVIEREC_NEWSTYLE               // Define for new style video recording code in fw (DIGIC 6)
 105     #undef  CAM_HAS_MOVIE_DIGEST_MODE           // The values in the 'movie_status' variable change if the camera has this mode (see is_video_recording())
 106     #undef  CAM_HAS_SPORTS_MODE                 // Define to enable the RAW exception override control for SPORTS mode (s3is, sx30, sx40, etc)
 107 
 108     #undef  CAM_REAR_CURTAIN                    // Camera do not have front/rear curtain flash sync in menu
 109     #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!)
 110     #define CAM_EXT_TV_RANGE                1   // CHDK can make exposure time longer than 64s
 111     #define CAM_EXT_AV_RANGE                6   // Number of 1/3 stop increments to extend the Av range beyond the Canon default smallest aperture
 112                                                 //  override in platform_camera.h for cameras with different range (e.g. G1X can't go below F/16 so set this to 0)
 113     #define CAM_CHDK_PTP                    1   // include CHDK PTP support
 114 
 115     #undef  CAM_HAS_FILEWRITETASK_HOOK          // FileWriteTask hook is available (local file write can be prevented)
 116     #undef  CAM_FILEWRITETASK_SEEKS             // Camera's FileWriteTask can do Lseek() - DryOS r50 or higher, implicitly enables CAM_FILEWRITETASK_MULTIPASS when defined
 117     #undef  CAM_FILEWRITETASK_MULTIPASS         // Camera may use multiple FileWriteTask invocations to write larger JPEGs (approx. DryOS r39..49)
 118 
 119     #define CAM_UNCACHED_BIT                0x10000000 // bit indicating the uncached memory
 120 
 121     #define CAM_SENSOR_BITS_PER_PIXEL       10  // Bits per pixel. 10 is standard, 12 is supported except for curves
 122     #define CAM_WHITE_LEVEL                 ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)      // 10bpp = 1023 ((1<<10)-1), 12bpp = 4095 ((1<<12)-1)
 123     #define CAM_BLACK_LEVEL                 ((1<<(CAM_SENSOR_BITS_PER_PIXEL-5))-1)  // 10bpp = 31 ((1<<5)-1),    12bpp = 127 ((1<<7)-1)
 124 
 125     #define CAM_DEFAULT_MENU_CURSOR_BG      IDX_COLOR_BLUE      // Default menu cursor colors
 126     #define CAM_DEFAULT_MENU_CURSOR_FG      IDX_COLOR_YELLOW    // Default menu cursor colors
 127 
 128     // Older cameras had a screen/bitmap buffer that was 360 pixels wide (or 480 for wide screen models)
 129     // CHDK was built around this 360 pixel wide display model
 130     // Newer cameras have a 720 pixel wide bitmap (960 for wide screen cameras)
 131     // To accomadate this the CHDK co-ordinate system assumes a 360/480 wide buffer and the
 132     // pixel drawing routines draw every pixel twice to scale the image up to the actual buffer size
 133     // Define CAM_USES_ASPECT_CORRECTION with a value of 1 to enable this scaled display
 134     #define CAM_USES_ASPECT_CORRECTION      0
 135     #define CAM_SCREEN_WIDTH                360 // Width of bitmap screen in CHDK co-ordinates (360 or 480)
 136     #define CAM_SCREEN_HEIGHT               240 // Height of bitmap screen in CHDK co-ordinates (always 240 on all cameras so far)
 137     #define CAM_BITMAP_WIDTH                360 // Actual width of bitmap screen in bytes (may be larger than displayed area)
 138     #define CAM_BITMAP_HEIGHT               240 // Actual height of bitmap screen in rows (240 or 270)
 139 
 140     #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
 141 
 142     #undef CAM_QUALITY_OVERRIDE                 // define this in platform_camera.h to enable 'Super Fine' JPEG compression mode
 143                                                 // used to allow super fine JPEG option on cameras where this has been removed
 144                                                 // from the Canon menu. Note: may not actually work on all cameras.
 145 
 146     #undef  CAM_ZEBRA_NOBUF                     // zebra draws directly on bitmap buffer.
 147     #undef  CAM_HAS_VARIABLE_ASPECT             // can switch between 16:9 and 4:3 (used by zebra code)
 148     
 149     #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
 150     
 151     #define CAM_KEY_PRESS_DELAY             30  // delay after a press - TODO can we combine this with above ?
 152     #define CAM_KEY_RELEASE_DELAY           30  // delay after a release - TODO do we really need to wait after release ?
 153     
 154     // RAW & DNG related values
 155     #define DEFAULT_RAW_EXT                 1   // extension to use for raw (see raw_exts in conf.c)
 156     #define DNG_BADPIXEL_VALUE_LIMIT        0   // Max value of 'bad' pixel - this value or lower is considered a defective pixel on the sensor
 157     #undef  CAM_RAW_ROWPIX                      // Number of pixels in RAW row (physical size of the sensor Note : as of July 2011, this value can be found in stub_entry.S for dryos cameras)
 158     #undef  CAM_RAW_ROWS                        // Number of rows in RAW (physical size of the sensor       Note : as of July 2011, this value can be found in stub_entry.S for dryos cameras)
 159     #undef  CAM_JPEG_WIDTH                      // Default crop size (width) stored in DNG (to match camera JPEG size. From dimensions of the largest size jpeg your camera produces)
 160     #undef  CAM_JPEG_HEIGHT                     // Default crop size (height) stored in DNG (to match camera JPEG size. From dimensions of the largest size jpeg your camera produces)
 161     #undef  CAM_ACTIVE_AREA_X1                  // Define usable area of the sensor - needs to be divisible by 4 - calibrate using a CHDK RAW image converted with rawconvert.exe (eg :rawconvert -12to8 -pgm -w=4480 -h=3348 photo.crw photo.pgm)
 162     #undef  CAM_ACTIVE_AREA_Y1                  // Define usable area of the sensor - needs to be divisible by 2 - "
 163     #undef  CAM_ACTIVE_AREA_X2                  // Define usable area of the sensor - needs to be divisible by 4 - "
 164     #undef  CAM_ACTIVE_AREA_Y2                  // Define usable area of the sensor - needs to be divisible by 2 = "
 165     #undef  cam_CFAPattern                      // Camera Bayer sensor data layout (DNG colors are messed up if not correct)
 166                                                 //   should be 0x01000201 = [Green Blue Red Green], 0x02010100 = [Red Green Green Blue] or 0x01020001 = [Green Red Blue Green]
 167     #undef  CAM_COLORMATRIX1                    // DNG color profile matrix
 168     #undef  cam_CalibrationIlluminant1          // DNG color profile illuminant - set it to 17 for standard light A
 169     #undef  CAM_COLORMATRIX2                    // DNG color profile matrix 2
 170     #undef  cam_CalibrationIlluminant2          // DNG color profile illuminant 2 - set it to 21 for D65
 171     #undef  CAM_CAMERACALIBRATION1              // DNG camera calibration matrix 1
 172     #undef  CAM_CAMERACALIBRATION2              // DNG camera calibration matrix 2
 173     #undef  CAM_FORWARDMATRIX1                  // DNG camera forward matrix 1
 174     #undef  CAM_FORWARDMATRIX2                  // DNG camera forward matrix 2
 175     #undef  CAM_DNG_EXPOSURE_BIAS               // Specify DNG exposure bias value (to override default of -0.5 in the dng.c code)
 176     #undef  CAM_CALC_BLACK_LEVEL                // Set this to enable dynamic Black Level calculation from RAW sensor data
 177                                                 // E.G. G1X may use black = 2048 for long exposures at high ISO
 178                                                 // TODO: Raw Merge code does not use this - merging files with different black points may give strange results
 179     #undef  DNG_EXT_FROM                        // Extension in the cameras known extensions to replace with .DNG to allow DNG
 180                                                 // files to be transfered over standard PTP. Only applicable to older cameras
 181 
 182     #undef  CAM_DNG_LENS_INFO                   // Define this to include camera lens information in DNG files
 183                                                 // Value should be an array of 4 DNG 'RATIONAL' values specifying
 184                                                 //   - min focal length in mm
 185                                                 //   - max focal length in mm
 186                                                 //   - max aperture at min focal length
 187                                                 //   - max aperture at max focal length
 188                                                 // E.G - SX30 = { 43,10, 1505,10, 27,10, 58,10 }
 189                                                 //            = 4.3 - 150.5mm, f/2.7 - f.5.8
 190                                                 // Each pair of integers is one 'RATIONAL' value (numerator,denominator)
 191 
 192     #undef  PARAM_CAMERA_NAME                   // parameter number for GetParameterData to get camera name
 193     #undef  PARAM_OWNER_NAME                    // parameter number for GetParameterData to get owner name
 194     #undef  PARAM_ARTIST_NAME                   // parameter number for GetParameterData to get artist name
 195     #undef  PARAM_COPYRIGHT                     // parameter number for GetParameterData to get copyright
 196     #undef  PARAM_DISPLAY_MODE1                 // param number for LCD display mode when camera in playback
 197     #undef  PARAM_DISPLAY_MODE2                 // param number for LCD display mode when camera in record view hold mode
 198     #define PARAMETER_DATA_FLAG     0x4000      // Added to 'id' value in calls to _GetParameterData & _SetParameterData
 199                                                 // Override if not needed or different value needed
 200 
 201     #undef  CAM_NO_MEMPARTINFO                  // VXWORKS camera does not have memPartInfoGet, fall back to memPartFindMax
 202 
 203     #undef  CAM_DRIVE_MODE_FROM_TIMER_MODE      // use PROPCASE_TIMER_MODE to check for multiple shot custom timer.
 204                                                 // Used to enabled bracketing in custom timer, required on many recent cameras
 205                                                 // see http://chdk.setepontos.com/index.php/topic,3994.405.html
 206 
 207     #undef  CAM_AV_OVERRIDE_IRIS_FIX            // for cameras that require _MoveIrisWithAv function to override Av (for bracketing).
 208 
 209     #undef  CAM_DISABLE_RAW_IN_LOW_LIGHT_MODE   // For cameras with 'low light' mode that does not work with raw define this
 210     #undef  CAM_DISABLE_RAW_IN_ISO_3200         // For cameras that don't have valid raw in ISO3200 mode (different from low light)
 211     #undef  CAM_DISABLE_RAW_IN_AUTO             // For cameras that don't have valid raw in AUTO mode
 212     #undef  CAM_DISABLE_RAW_IN_HQ_BURST         // For cameras with 'HQ Burst' mode that does not work with raw define this
 213     #undef  CAM_DISABLE_RAW_IN_HANDHELD_NIGHT_SCN // For cameras with 'HandHeld Night Scene' mode that does not work with raw define this
 214     #undef  CAM_DISABLE_RAW_IN_HYBRID_AUTO      // For cameras that lock up while saving raw in "Hybrid Auto" mode
 215     #undef  CAM_DISABLE_RAW_IN_MOVIE_DIGEST     // For cameras that lock up while saving raw in "Movie Digest" mode
 216     #undef  CAM_DISABLE_RAW_IN_DIGITAL_IS       // For cameras with 'Digital IS' mode that does not work with raw define this    
 217     #undef  CAM_DISABLE_RAW_IN_SPORTS           // For cameras that corrupt DNG/JPEG in Sports mode
 218     #undef  CAM_DISABLE_RAW_IN_HDR              // For cameras with multi-exposure HDR mode
 219     #undef  CAM_ISO_LIMIT_IN_HQ_BURST           // Defines max 'market' ISO override value for HQ Burst mode (higher values crash camera)
 220     #undef  CAM_MAX_ISO_OVERRIDE                // Defines max 'market' (non-zero) ISO override value - higher value may crash
 221     #undef  CAM_MIN_ISO_OVERRIDE                // Defines min 'market' (non-zero) ISO override value - lower value may crash if flash used [0 = AUTO, so always allowed]
 222     
 223     #undef  CAM_HAS_GPS                         // for cameras with GPS reseiver: includes the GPS coordinates in in DNG file
 224 
 225     #undef  CHDK_COLOR_BASE                     // Start color index for CHDK colors loaded into camera palette.
 226 
 227     #undef  CAM_LOAD_CUSTOM_COLORS              // Define to enable loading CHDK custom colors into the camera color palette
 228                                                 // requires load_chdk_palette() and vid_get_bitmap_active_palette() to be defined
 229                                                 // correctly for the camera along with
 230 
 231     #undef  CAM_CLEAN_OVERLAY                   // define when port supports making Canon overlay invisible (DIGIC 6)
 232 
 233     #define CAM_USB_EVENTID         0x902       // event ID for USB control. Changed to 0x202 in DryOS R49 so needs to be overridable.
 234                                                 // For DryOS only. These are "control events", and don't have the same IDs as "logical events"
 235 
 236     #undef CAM_USB_EVENTID_VXWORKS              // For vxworks cameras that need additional code to unlock mode switching
 237                                                 // this is the logical event "ConnectUSBCable", usually 0x1085
 238                                                 // different from CAM_USB_EVENTID since it should be undefined on most cameras
 239 
 240     #undef  CAM_NEED_SET_ZOOM_DELAY             // Define to add a delay after setting the zoom position before resetting the focus position in shooting_set_zoom 
 241                                                 // ignored if CAM_REFOCUS_AFTER_ZOOM is 0 (default when CAM_USE_ALT_SET_ZOOM_POINT set)
 242 
 243     #undef  CAM_USE_ALT_SET_ZOOM_POINT          // Define to use the alternate code in lens_set_zoom_point(). Defaults on for Digic 4 and above, may be used on earlier cams
 244     #undef  CAM_USE_OPTICAL_MAX_ZOOM_STATUS     // Use ZOOM_OPTICAL_MAX to reset zoom_status when switching from digital to optical zoom in gui_std_kbd_process(). Only meaningful with CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
 245     #undef  CAM_REFOCUS_AFTER_ZOOM              // save and restore focus distance after set_zoom, Defaults off (0) for CAM_USE_ALT_SET_ZOOM_POINT, on for others
 246 
 247     #undef  CAM_HAS_HI_ISO_AUTO_MODE            // Define if camera has 'HI ISO Auto' mode (as well as Auto ISO mode), needed for adjustment in user auto ISO menu 
 248 
 249     #define CAMERA_MIN_DIST         0           // Define min distance that can be set in _MoveFocusLensToDistance (allow override - e.g. G12 min dist = 1)
 250     #undef  CAMERA_MAX_DIST                     // Define max distance that can be set in _MoveFocusLensToDistance (allow override for superzooms - SX30/SX40, default defined below depending on OS)
 251 
 252     #undef  DRAW_ON_ACTIVE_BITMAP_BUFFER_ONLY   // Draw pixels on active bitmap buffer only.
 253                                                 // Requires bitmap_buffer & active_bitmap_buffer location in stubs_min.S or stubs_entry.S.
 254 
 255     #undef  CAM_SUPPORT_BITMAP_RES_CHANGE       // port can adapt to resolution change of the bitmap buffer (when composite or hdmi output is used)
 256 
 257     #undef  CAM_DETECT_BITMAP_UPDATE            // camera can detect if CHDK UI needs to be redrawn
 258 
 259     #undef  CAM_ZOOM_ASSIST_BUTTON_CONTROL      // Activate menu option to enable/disable the zoom assist button on the SX30/SX40
 260                                                 // For other cameras, requires additional support code in kbd.c (see the SX30 or SX40 version)
 261 
 262     #undef  CAM_MISSING_RAND                    // Define this if srand()/rand() functions not found in firmware (a810/a2300)
 263     #undef  MKDIR_RETURN_ONE_ON_SUCCESS         // Define this if mkdir() return 1 on success, 0 on fail (a810/a1300)
 264 
 265     #undef  CAM_OPTIONAL_EXTRA_BUTTON           // extra button (remapped, for use in ALT mode) can be set from menu, must set next two values as well
 266     #undef  CAM_EXTRA_BUTTON_NAMES              // Define the list of names for the extra button   - e.g. { "Off", "Display" }
 267     #undef  CAM_EXTRA_BUTTON_OPTIONS            // Define the list of button constants for the extra button, starting with 0 - e.g. { 0, KEY_DISPLAY }
 268 
 269     #undef  CAM_HOTSHOE_OVERRIDE                // the sense switch of the hot shoe can be overridden
 270 
 271     #define CAM_AF_LED                      -1  // ***** NOTE ***** Need to override this in platform_camera.h with correct value
 272                                                 // Defines 'led' Index value for camera_set_led function to control the AutoFocus assist LED
 273                                                 // Used for the Motion Detect & Live View buffer testing
 274 
 275     #undef CAM_FILE_COUNTER_IS_VAR              // file counter is variable file_counter_var in stubs, not a param
 276     
 277     #define CAM_GUI_FSELECT_SIZE  20, 6, 14     // filename, filesize, filedate camera file select window column widths
 278 
 279     #undef  CAM_IS_VID_REC_WORKS                // Define if the 'is_video_recording()' function works
 280 
 281     #undef  CAM_HAS_CANON_RAW                   // Define if the camera has native raw in the canon firmware
 282 
 283     // Keyboard repeat and initial delays (override in platform_camera.h if needed)
 284     #define KBD_REPEAT_DELAY                175
 285     #define KBD_INITIAL_DELAY               500
 286     #undef CAM_PTP_USE_NATIVE_BUFFER            // define to use native firmware buffers for PTP transfers
 287                                                 // for cameras that have problems transfering to cached RAM
 288                                                 // or specific alignment requirements
 289 
 290     #undef CAM_PTP_FILE_BUFFER_ID               // define to override default ID for file transfer buffer
 291 
 292     #undef CAM_UNLOCK_ANALOG_AV_IN_REC          // define to enable analog video out in rec mode for cameras without native support
 293                                                 // ANALOG_AV_IDX and ANALOG_AV_FLAG must be identified. Some cameras crash if AF point zoom enabled
 294 
 295 // Base 'market' ISO value. Most (all?) DryOS R49 and later use 200, use tests/isobase.lua to check
 296 #if defined(CAM_DRYOS_REL) && CAM_DRYOS_REL >= 49 // CAM_DRYOS_REL defined on command line, not from platform_camera.h
 297     #define CAM_MARKET_ISO_BASE             200
 298 #else
 299     #define CAM_MARKET_ISO_BASE             100
 300 #endif
 301 
 302     // Below limits are for the CHDK LFN support routines (DryOS only)
 303     // defaults can be overridden in camera_platform.h
 304     // file name limits used here based on what the OS functions can create/write without errors
 305     // in many cases, firmware can list, open and read longer paths
 306 #if defined(CAM_DRYOS_REL) // CAM_DRYOS_REL defined on command line, not from platform_camera.h
 307     // #if CAM_DRYOS_REL == 20 // unknown
 308     #if CAM_DRYOS_REL == 23
 309         #define CAM_MAX_FNAME_LENGTH        18 
 310         #define CAM_MAX_PATH_LENGTH         255
 311     #elif CAM_DRYOS_REL == 31
 312         #define CAM_MAX_FNAME_LENGTH        18 
 313         #define CAM_MAX_PATH_LENGTH         59
 314     #elif CAM_DRYOS_REL == 39
 315         #define CAM_MAX_FNAME_LENGTH        30 
 316         #define CAM_MAX_PATH_LENGTH         32
 317     #elif CAM_DRYOS_REL == 43
 318         #define CAM_MAX_FNAME_LENGTH        30
 319         #define CAM_MAX_PATH_LENGTH         32
 320     #elif CAM_DRYOS_REL == 45
 321         #define CAM_MAX_FNAME_LENGTH        57 
 322         #define CAM_MAX_PATH_LENGTH         59
 323     #elif CAM_DRYOS_REL == 47
 324         #define CAM_MAX_FNAME_LENGTH        31 // note sx220hs seems to allow longer
 325         #define CAM_MAX_PATH_LENGTH         59
 326     #else // >= r49, and those unknown above
 327         #define CAM_MAX_FNAME_LENGTH        99 // camera can safely use filenames not longer than this (99 is a CHDK limit actually)
 328         #define CAM_MAX_PATH_LENGTH         255 // maximum path+filename length. Some actually allow much longer
 329     #endif 
 330 #endif
 331 
 332 // default CAM_USE_ALT_SET_ZOOM_POINT for digic >= 4
 333 #if CAM_DIGIC >= 40
 334     #define  CAM_USE_ALT_SET_ZOOM_POINT       1   // Define to use the alternate code in lens_set_zoom_point()
 335 #endif
 336 
 337 //----------------------------------------------------------
 338 // Overridden values for each camera
 339 //----------------------------------------------------------
 340 
 341 // Include the settings file for the camera model currently being compiled.
 342 #include "platform_camera.h"
 343 
 344 // force off for ILC - CAM_ILC is a platform_camera define, not makefile, so has to be after
 345 // but otherwise default on (CAM_USE_ALT_SET_ZOOM_POINT for digic >= 4
 346 #ifdef CAM_ILC
 347 #undef CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
 348 #undef CAM_USE_ALT_SET_ZOOM_POINT
 349 #endif
 350 
 351 // DryOS r31 and later cameras use 32bit subject distance values
 352 // set a default limit that's high enough
 353 // earlier cameras need 65535 as default
 354 #if defined(CAM_DRYOS) && CAM_DRYOS_REL >= 31
 355     #ifndef CAMERA_MAX_DIST
 356         #define CAMERA_MAX_DIST 2000000
 357     #endif
 358 #else
 359     #ifndef CAMERA_MAX_DIST
 360         #define CAMERA_MAX_DIST 65535
 361     #endif
 362 #endif
 363 
 364 #if !defined(CAM_IS_VID_REC_WORKS)
 365 #if !defined(CAM_FILEIO_SEM_TIMEOUT)
 366     #define CAM_FILEIO_SEM_TIMEOUT          3000    // TakeSemaphore timeout
 367 #endif
 368 #else
 369 #if !defined(CAM_FILEIO_SEM_TIMEOUT)
 370     #define CAM_FILEIO_SEM_TIMEOUT          0       // TakeSemaphore timeout - is_video_recording() == false
 371 #endif
 372 #if !defined(CAM_FILEIO_SEM_TIMEOUT_VID)
 373     #define CAM_FILEIO_SEM_TIMEOUT_VID      200     // TakeSemaphore timeout - is_video_recording() == true
 374 #endif
 375 #endif
 376 
 377 #if defined(CAM_VIDEO_CONTROL) && defined(CAM_SIMPLE_MOVIE_STATUS)
 378     #error "CAM_VIDEO_CONTROL and CAM_SIMPLE_MOVIE_STATUS are mutually exclusive"
 379 #endif
 380 
 381 // video quality/bitrate defaults, moved here from conf.h
 382 #ifdef CAM_MOVIEREC_NEWSTYLE
 383     // video defaults.for D6
 384     #define VIDEO_DEFAULT_QUALITY   9   // VBR relative min bitrate, 9 = CBR
 385     #define VIDEO_MAX_QUALITY       9   // 0..9
 386     #define VIDEO_DEFAULT_BITRATE   3   // 3 = fw default
 387 
 388     #undef  CAM_VIDEO_QUALITY_ONLY
 389 #else
 390     // video quality defaults. Ideally, these should match the camera default settings
 391     #define VIDEO_DEFAULT_QUALITY   84  // ? where does 84 come from
 392     #define VIDEO_MAX_QUALITY       99
 393     #define VIDEO_DEFAULT_BITRATE   3   // should be 1 for all cams
 394 #endif
 395 
 396 // sanity check platform_camera.h defined values for some common errors
 397 #if (CAM_ACTIVE_AREA_X1&1) || (CAM_ACTIVE_AREA_Y1&1) || (CAM_ACTIVE_AREA_X2&1) || (CAM_ACTIVE_AREA_Y2&1)
 398     #error "CAM_ACTIVE_AREA values must be even"
 399 #endif
 400 
 401 #if (CAM_ACTIVE_AREA_X2 - CAM_ACTIVE_AREA_X1) < CAM_JPEG_WIDTH
 402     #error "CAM_JPEG_WIDTH larger than active area"
 403 #endif
 404 
 405 #if (CAM_ACTIVE_AREA_Y2 - CAM_ACTIVE_AREA_Y1) < CAM_JPEG_HEIGHT
 406     #error "CAM_JPEG_HEIGHT larger than active area"
 407 #endif
 408 
 409 // default PTP buffer id
 410 #ifndef CAM_PTP_FILE_BUFFER_ID
 411 #if defined(CAM_DRYOS) && CAM_DRYOS_REL >= 43 && CAM_DRYOS_REL <= 52
 412     #define CAM_PTP_FILE_BUFFER_ID 5
 413 #else
 414     #define CAM_PTP_FILE_BUFFER_ID 4
 415 #endif
 416 #endif // ifndef CAM_PTP_FILE_BUFFER_ID
 417 
 418 // set default refocus behavior if not set by port
 419 #ifndef CAM_REFOCUS_AFTER_ZOOM
 420 #ifdef CAM_USE_ALT_SET_ZOOM_POINT
 421     #define CAM_REFOCUS_AFTER_ZOOM 0
 422 #else
 423     #define CAM_REFOCUS_AFTER_ZOOM 1
 424 #endif
 425 #endif // CAM_REFOCUS_AFTER_ZOOM
 426 
 427 #if defined(CAM_USE_OPTICAL_MAX_ZOOM_STATUS) && !defined(CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO)
 428     #error "CAM_USE_OPTICAL_MAX_ZOOM_STATUS requires CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO"
 429 #endif
 430 
 431 //==========================================================
 432 // END of Camera-dependent settings
 433 //==========================================================
 434 
 435 // For newer cameras where the screen bitmap is double the width we need to scale
 436 // the CHDK horizontal (X) co-ordinates
 437 #if CAM_USES_ASPECT_CORRECTION
 438     #define ASPECT_XCORRECTION(x)   ((x)<<1)    // See comments for CAM_USES_ASPECT_CORRECTION above
 439 #else
 440     #define ASPECT_XCORRECTION(x)   (x)         // See comments for CAM_USES_ASPECT_CORRECTION above
 441 #endif
 442 
 443 // curves only work in 10bpp for now
 444 #if CAM_SENSOR_BITS_PER_PIXEL != 10
 445     #undef OPT_CURVES
 446 #endif
 447 
 448 #ifndef OPT_PTP
 449     #undef CAM_CHDK_PTP
 450 #endif
 451 
 452 #ifdef CAM_FILEWRITETASK_SEEKS
 453     #define CAM_FILEWRITETASK_MULTIPASS 1
 454 #endif
 455 
 456 // Define default video AF scan buttons if not already defined in platform_camera.h
 457 #if CAM_AF_SCAN_DURING_VIDEO_RECORD
 458     #ifndef CAM_VIDEO_AF_BUTTON_NAMES
 459         #define CAM_VIDEO_AF_BUTTON_NAMES   { "", "Shutter", "Set" }
 460         #define CAM_VIDEO_AF_BUTTON_OPTIONS { 0, KEY_SHOOT_HALF, KEY_SET }
 461     #endif
 462 #endif
 463 
 464 // Define default value for DISP button name in shortcut text unless aready set in platform_camera.h
 465 // e.g. G1X uses Meter button as DISP in CHDK
 466 #ifndef CAM_DISP_BUTTON_NAME
 467     #define CAM_DISP_BUTTON_NAME            "DISP"
 468 #endif
 469 
 470 // used for conditional LANG strings and convenience - defined if any non-USB remote input supported
 471 #if (defined(CAM_REMOTE_AtoD_CHANNEL) || defined(CAM_REMOTE_HDMI_HPD) || defined(CAM_REMOTE_ANALOG_AV))
 472 #define CAM_REMOTE_MULTICHANNEL 1
 473 #endif
 474 //------------------------------------------------------------------- 
 475 // Keyboard / Button shortcuts - define in platform_camera.h
 476 // if the default values are not suitable
 477 // Default values are set below if not overridden
 478 //------------------------------------------------------------------
 479 
 480 // For models without ZOOM_LEVER  (#if !CAM_HAS_ZOOM_LEVER)
 481 // SHORTCUT_SET_INFINITY is not used
 482 // KEY_DISPLAY is used for gui_subj_dist_override_koef_enum;
 483 // KEY_LEFT/KEY_RIGHT is used for gui_subj_dist_override_value_enum (because of no separate ZOOM_IN/OUT)
 484 
 485 // Define keyboard / button shortcut values not already set above
 486 
 487 //Alt mode
 488 #if !defined(SHORTCUT_TOGGLE_RAW)
 489     #if CAM_HAS_ERASE_BUTTON
 490         #define SHORTCUT_TOGGLE_RAW         KEY_ERASE
 491     #else
 492         #define SHORTCUT_TOGGLE_RAW         KEY_DISPLAY
 493     #endif
 494 #endif
 495 #if !defined(CAM_HAS_MANUAL_FOCUS) && !defined(SHORTCUT_MF_TOGGLE)
 496     #if CAM_HAS_ERASE_BUTTON
 497         #define SHORTCUT_MF_TOGGLE          KEY_DISPLAY
 498     #else
 499         #define SHORTCUT_MF_TOGGLE          KEY_UP
 500     #endif
 501 #endif
 502 
 503 //Half press shoot button    
 504 #if !defined(SHORTCUT_TOGGLE_HISTO)
 505     #if CAM_HAS_ERASE_BUTTON
 506         #define SHORTCUT_TOGGLE_HISTO       KEY_UP
 507     #else
 508         #define SHORTCUT_TOGGLE_HISTO       KEY_MENU
 509     #endif
 510 #endif
 511 #if !defined(SHORTCUT_TOGGLE_ZEBRA)
 512     #define SHORTCUT_TOGGLE_ZEBRA       KEY_LEFT
 513 #endif
 514 #if !defined(SHORTCUT_TOGGLE_OSD)
 515     #define SHORTCUT_TOGGLE_OSD         KEY_RIGHT
 516 #endif
 517 #if !defined(SHORTCUT_DISABLE_OVERRIDES)
 518     #define SHORTCUT_DISABLE_OVERRIDES  KEY_DOWN
 519 #endif
 520 
 521 //Alt mode & Manual mode  
 522 #if !defined(SHORTCUT_SET_INFINITY)
 523     #if CAM_HAS_ERASE_BUTTON
 524         #define SHORTCUT_SET_INFINITY       KEY_UP
 525     #else
 526         #define SHORTCUT_SET_INFINITY       KEY_DISPLAY
 527     #endif
 528 #endif
 529 #if !defined(SHORTCUT_SET_HYPERFOCAL)
 530     #define SHORTCUT_SET_HYPERFOCAL     KEY_DOWN
 531 #endif
 532 
 533 #if CAM_HAS_ZOOM_LEVER
 534     #define SHORTCUT_SD_SUB KEY_ZOOM_OUT
 535     #define SHORTCUT_SD_ADD KEY_ZOOM_IN
 536 #endif
 537 
 538 //==========================================================
 539 
 540 // DebugAssert
 541 #ifndef CAM_3ARG_DebugAssert
 542     #ifdef THUMB_FW
 543         #define CAM_3ARG_DebugAssert        1   // Digic6 - default is 3 arg version of DebugAssert
 544     #else
 545         #define CAM_3ARG_DebugAssert        0   // All others default is 2 arg version
 546     #endif
 547 #endif
 548 
 549 //==========================================================
 550 #include "camera_info.h"
 551 //==========================================================
 552 
 553 #endif /* CAMERA_H */

/* [<][>][^][v][top][bottom][index][help] */