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

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