root/core/camera_info.c

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

DEFINITIONS

This source file includes following definitions.
  1. camera_info_init

   1 #include "platform.h"
   2 #include "module_def.h"
   3 
   4 //==========================================================
   5 // Data Structure to store camera specific information
   6 // Used by modules to ensure module code is platform independent
   7 
   8 _cam_sensor camera_sensor = 
   9 { 
  10     CAM_SENSOR_BITS_PER_PIXEL, 
  11     CAM_BLACK_LEVEL, CAM_WHITE_LEVEL,
  12     CAM_RAW_ROWS, CAM_RAW_ROWPIX, (CAM_RAW_ROWPIX*CAM_SENSOR_BITS_PER_PIXEL)/8, CAM_RAW_ROWS * ((CAM_RAW_ROWPIX*CAM_SENSOR_BITS_PER_PIXEL)/8),
  13 #if defined(CAM_ACTIVE_AREA_X1) && defined(CAM_JPEG_WIDTH)
  14     {{
  15 #if defined(CAM_CROP_ORIGIN_X)
  16         CAM_CROP_ORIGIN_X,
  17 #else
  18         (CAM_ACTIVE_AREA_X2-CAM_ACTIVE_AREA_X1-CAM_JPEG_WIDTH)/2,
  19 #endif
  20 #if defined(CAM_CROP_ORIGIN_Y)
  21         CAM_CROP_ORIGIN_Y,
  22 #else
  23         (CAM_ACTIVE_AREA_Y2-CAM_ACTIVE_AREA_Y1-CAM_JPEG_HEIGHT)/2,
  24 #endif
  25         CAM_JPEG_WIDTH, CAM_JPEG_HEIGHT
  26     }},
  27     { { CAM_ACTIVE_AREA_Y1, CAM_ACTIVE_AREA_X1, CAM_ACTIVE_AREA_Y2, CAM_ACTIVE_AREA_X2 } }, 
  28 #else
  29     {{
  30         0, 0,
  31         0, 0
  32     }},
  33     { { 0, 0, 0, 0 } }, 
  34 #endif
  35 #if defined(CAM_DNG_LENS_INFO)
  36     CAM_DNG_LENS_INFO,
  37 #else
  38     { 0, 0, 0, 0, 0, 0, 0, 0 },
  39 #endif
  40 #if defined(CAM_DNG_EXPOSURE_BIAS)
  41     { CAM_DNG_EXPOSURE_BIAS },
  42 #else
  43     { -1 , 2 },
  44 #endif
  45 #if defined(cam_CFAPattern)
  46     cam_CFAPattern, 
  47 #else
  48     0,
  49 #endif
  50 #if defined(CAM_COLORMATRIX1)
  51     cam_CalibrationIlluminant1,
  52     { CAM_COLORMATRIX1 },
  53 #else
  54     0,
  55     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  56 #endif
  57 #if defined(CAM_COLORMATRIX2)
  58     cam_CalibrationIlluminant2,
  59     { CAM_COLORMATRIX2 },
  60 #else
  61     0,
  62     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  63 #endif
  64 #if defined(CAM_CAMERACALIBRATION1)
  65     1,
  66     { CAM_CAMERACALIBRATION1 },
  67 #else
  68     0,
  69     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  70 #endif
  71 #if defined(CAM_CAMERACALIBRATION2)
  72     1,
  73     { CAM_CAMERACALIBRATION2 },
  74 #else
  75     0,
  76     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  77 #endif
  78 #if defined(CAM_FORWARDMATRIX1)
  79     1,
  80     { CAM_FORWARDMATRIX1 },
  81 #else
  82     0,
  83     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  84 #endif
  85 #if defined(CAM_FORWARDMATRIX2)
  86     1,
  87     { CAM_FORWARDMATRIX2 },
  88 #else
  89     0,
  90     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  91 #endif
  92     DNG_BADPIXEL_VALUE_LIMIT,
  93 };
  94 
  95 _cam_screen camera_screen =
  96 {
  97     CAM_SCREEN_WIDTH, CAM_SCREEN_HEIGHT, CAM_SCREEN_WIDTH * CAM_SCREEN_HEIGHT,
  98     ASPECT_XCORRECTION(CAM_SCREEN_WIDTH),
  99     CAM_BITMAP_WIDTH, CAM_BITMAP_HEIGHT, CAM_BITMAP_WIDTH * CAM_BITMAP_HEIGHT,
 100     CAM_TS_BUTTON_BORDER, CAM_SCREEN_WIDTH-CAM_TS_BUTTON_BORDER-1, CAM_SCREEN_WIDTH-CAM_TS_BUTTON_BORDER*2,
 101     EDGE_HMARGIN,
 102 #if defined(CAM_ZEBRA_NOBUF)
 103     1,
 104 #else
 105     0,
 106 #endif
 107     CAM_USES_ASPECT_CORRECTION,
 108 #if defined(CAM_HAS_VARIABLE_ASPECT)
 109     1,
 110 #else
 111     0,
 112 #endif
 113     CAM_TS_MENU_BORDER,
 114     CAM_MENU_BORDERWIDTH,
 115     CAM_GUI_FSELECT_SIZE,
 116 };
 117 
 118 _cam_info camera_info =
 119 {
 120     {
 121 #if defined(PARAM_CAMERA_NAME)
 122     PARAM_CAMERA_NAME,
 123 #else
 124     0,
 125 #endif
 126 #if defined(PARAM_OWNER_NAME)
 127     PARAM_OWNER_NAME,
 128 #else
 129     0,
 130 #endif
 131 #if defined(PARAM_ARTIST_NAME)
 132     PARAM_ARTIST_NAME,
 133 #else
 134     0,
 135 #endif
 136 #if defined(PARAM_COPYRIGHT)
 137     PARAM_COPYRIGHT,
 138 #else
 139     0,
 140 #endif
 141     },
 142     {
 143     CAM_PROPSET,
 144 #if defined(CAM_HAS_GPS)
 145     PROPCASE_GPS,
 146 #else
 147     0,
 148 #endif
 149     PROPCASE_ORIENTATION_SENSOR,
 150     PROPCASE_TV, PROPCASE_AV, PROPCASE_MIN_AV,
 151     PROPCASE_EV_CORRECTION_1, PROPCASE_EV_CORRECTION_2, 
 152     PROPCASE_FLASH_MODE, PROPCASE_FLASH_FIRE, 
 153     PROPCASE_METERING_MODE, PROPCASE_WB_ADJ,
 154 #if defined(PROPCASE_ASPECT_RATIO)
 155     PROPCASE_ASPECT_RATIO,
 156 #else
 157     0,
 158 #endif
 159     PROPCASE_SHOOTING, PROPCASE_RESOLUTION, PROPCASE_QUALITY, PROPCASE_AF_LOCK
 160     },
 161     ROMBASEADDR, MAXRAMADDR, 0, CAM_UNCACHED_BIT,
 162 #if defined(OPT_EXMEM_MALLOC) && !defined(OPT_EXMEM_TESTING)
 163     1,
 164 #else
 165     0,
 166 #endif
 167     0,0,0,0,0,
 168     PLATFORM, PLATFORMSUB,
 169     HDK_VERSION, BUILD_NUMBER, 
 170     HDK_VERSION" ver. "BUILD_NUMBER,
 171     BUILD_SVNREV, __DATE__, __TIME__,
 172 #if defined(CAM_DRYOS)
 173     "dryos",
 174 #else
 175     "vxworks",
 176 #endif
 177 #if CAM_EV_IN_VIDEO
 178     1,
 179 #else
 180     0,
 181 #endif
 182 #if defined(CAM_HAS_ND_FILTER)
 183     1,
 184 #else
 185     0,
 186 #endif
 187 #if defined(CAM_HAS_IRIS_DIAPHRAGM)
 188     1,
 189 #else
 190     0,
 191 #endif
 192 #if defined(CAM_HAS_VIDEO_BUTTON)
 193     1,
 194 #else
 195     0,
 196 #endif
 197 #if defined(CAM_HAS_ZOOM_LEVER)
 198     1,
 199 #else
 200     0,
 201 #endif
 202 #if defined(CAM_HAS_MANUAL_FOCUS)
 203     1,
 204 #else
 205     0,
 206 #endif
 207 #if defined(CAM_MULTIPART)
 208     1,
 209 #else
 210     0,
 211 #endif
 212 #if defined(REMOTE_SYNC_STATUS_LED)
 213     REMOTE_SYNC_STATUS_LED,
 214 #else
 215     0,
 216 #endif
 217     CAM_KEY_PRESS_DELAY, CAM_KEY_RELEASE_DELAY, 
 218     CAM_AF_LED,
 219     CAM_CIRCLE_OF_CONFUSION,
 220     CAM_DIGIC,
 221 #if defined(CAM_HAS_CANON_RAW)
 222     1,
 223 #else
 224     0,
 225 #endif
 226     { 0 },  // state
 227     { 0 },  // perf
 228     { 0 },  // dof_values
 229 #if defined(OPT_FILEIO_STATS)
 230     { 0 },  // fileio_stats
 231 #endif
 232 };
 233 
 234 //==========================================================
 235 
 236 /*
 237 note, from tools/link-boot.ld
 238     link_text_start = _start
 239     link_data_start = link_text_end
 240     link_bss_start = link_data_end
 241     link_bss_end = _end
 242 */
 243 extern long link_text_start;
 244 extern long link_data_start;
 245 extern long link_bss_start;
 246 extern long link_bss_end;
 247 
 248 // Initialise any camera_info values that need to be set at
 249 // startup
 250 void camera_info_init()
 251 {
 252     camera_info.memisosize = MEMISOSIZE;
 253     camera_info.text_start = (int)&link_text_start;
 254     camera_info.data_start = (int)&link_data_start;
 255     camera_info.bss_start = (int)&link_bss_start;
 256     camera_info.bss_end = (int)&link_bss_end;
 257 
 258     camera_info.perf.af_led.min = 0xFFFFFFFF;
 259     camera_info.state.osd_title_line = 1 ;
 260     camera_info.state.gui_mode_none = 1 ; // default state before gui initialized
 261     // gui_mode and gui_mode_alt default to 0, which is consistent
 262 }
 263 
 264 //==========================================================

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