Changeset 1515


Ignore:
Timestamp:
12/30/11 09:29:54 (17 months ago)
Author:
philmoz
Message:

Update for modules system for DNG module:

  • fix code to compile on cameras with missing entries in platform_camera.h
  • added camera_info structure to hold PARAM and PROPCASE values.
Location:
branches/reyalp-flt
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/reyalp-flt/core/dng.c

    r1514 r1515  
    229229 // filling EXIF fields 
    230230 
    231  if (camera_sensor.gps_propcase) 
    232     get_property_case(camera_sensor.gps_propcase, &gps_data, sizeof(tGPS)); 
     231 if (camera_info.props.gps) 
     232    get_property_case(camera_info.props.gps, &gps_data, sizeof(tGPS)); 
    233233 else 
    234234    memset(&gps_data, 0, sizeof(tGPS)); 
     
    424424 
    425425 // Shutter speed tags 
    426  get_property_case(PROPCASE_TV, &short_prop_val, sizeof(short_prop_val)); 
     426 get_property_case(camera_info.props.tv, &short_prop_val, sizeof(short_prop_val)); 
    427427 cam_shutter[0]      = pow_calc( 1000000, 2, 1, -short_prop_val, 96); 
    428428 cam_apex_shutter[0] = short_prop_val; 
     
    434434 sprintf(cam_datetime, "%04d:%02d:%02d %02d:%02d:%02d", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday, ttm->tm_hour, ttm->tm_min, ttm->tm_sec); 
    435435 
    436  get_property_case(PROPCASE_AV, &short_prop_val, sizeof(short_prop_val)); 
     436 get_property_case(camera_info.props.av, &short_prop_val, sizeof(short_prop_val)); 
    437437 cam_aperture[0]      = pow_calc( 10, 2, 1, short_prop_val, 192); 
    438438 cam_apex_aperture[0] = short_prop_val; 
    439439 
    440  get_property_case(PROPCASE_MIN_AV, &short_prop_val, sizeof(short_prop_val)); 
     440 get_property_case(camera_info.props.min_av, &short_prop_val, sizeof(short_prop_val)); 
    441441 cam_max_av[0] = short_prop_val; 
    442442 
    443  get_property_case(PROPCASE_EV_CORRECTION_2, &short_prop_val, sizeof(short_prop_val)); 
     443 get_property_case(camera_info.props.ev_correction_2, &short_prop_val, sizeof(short_prop_val)); 
    444444 cam_exp_bias[0] = short_prop_val; 
    445445 
     
    449449 exif_data.effective_focal_length = get_effective_focal_length(shooting_get_zoom()) / 1000; 
    450450 
    451  get_property_case(PROPCASE_ORIENTATION_SENSOR, &exif_data.orientation, sizeof(exif_data.orientation)); 
    452  get_parameter_data(PARAM_CAMERA_NAME, &cam_name, sizeof(cam_name)); 
    453  get_property_case(PROPCASE_FLASH_MODE, &exif_data.flash_mode, sizeof(exif_data.flash_mode)); 
    454  get_property_case(PROPCASE_FLASH_FIRE, &exif_data.flash_fired, sizeof(exif_data.flash_fired)); 
    455  get_property_case(PROPCASE_METERING_MODE, &exif_data.metering_mode, sizeof(exif_data.metering_mode)); 
    456  
    457  get_property_case(PROPCASE_WB_ADJ, &wb, sizeof(wb));   
     451 get_property_case(camera_info.props.orientation_sensor, &exif_data.orientation, sizeof(exif_data.orientation)); 
     452 get_parameter_data(camera_info.params.camera_name, &cam_name, sizeof(cam_name)); 
     453 get_property_case(camera_info.props.flash_mode, &exif_data.flash_mode, sizeof(exif_data.flash_mode)); 
     454 get_property_case(camera_info.props.flash_fire, &exif_data.flash_fired, sizeof(exif_data.flash_fired)); 
     455 get_property_case(camera_info.props.metering_mode, &exif_data.metering_mode, sizeof(exif_data.metering_mode)); 
     456 
     457 get_property_case(camera_info.props.wb_adj, &wb, sizeof(wb));   
    458458 cam_AsShotNeutral[1]=wb[1]; 
    459459 cam_AsShotNeutral[3]=wb[0]; 
  • branches/reyalp-flt/core/dng.h

    r1511 r1515  
    1717}; 
    1818 
    19  
    20 #if DNG_SUPPORT 
    21  
    2219// Defines of exported to chdk symbols 
    2320#ifdef THIS_IS_CHDK_CORE 
     
    2825         
    2926        extern void create_badpixel_bin(); 
    30 extern int raw_init_badpixel_bin(); 
    31 extern void capture_data_for_exif(void); 
     27    extern int raw_init_badpixel_bin(); 
     28    extern void capture_data_for_exif(void); 
    3229        extern void load_bad_pixels_list_b(char* filename); 
    3330        extern int  badpixel_list_loaded_b(void); 
    3431 
    35 extern void convert_dng_to_chdk_raw(char* fn); 
     32    extern void convert_dng_to_chdk_raw(char* fn); 
    3633        extern void write_dng(int fd, char* rawadr, char* altrawadr, unsigned long uncachedbit); 
    3734 
     
    4037#endif 
    4138 
    42  
    43 #endif //DNG_SUPPORT 
    44  
    45  
    46  
    4739#endif 
  • branches/reyalp-flt/core/main.c

    r1514 r1515  
    2222    CAM_BLACK_LEVEL, CAM_WHITE_LEVEL, 
    2323    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), 
     24#if defined(CAM_ACTIVE_AREA_X1) && defined(CAM_JPEG_WIDTH) 
    2425    {{ 
    2526        (CAM_ACTIVE_AREA_X2-CAM_ACTIVE_AREA_X1-CAM_JPEG_WIDTH)/2, (CAM_ACTIVE_AREA_Y2-CAM_ACTIVE_AREA_Y1-CAM_JPEG_HEIGHT)/2, 
     
    2728    }}, 
    2829    { { CAM_ACTIVE_AREA_Y1, CAM_ACTIVE_AREA_X1, CAM_ACTIVE_AREA_Y2, CAM_ACTIVE_AREA_X2 } },  
     30#else 
     31    {{ 
     32        0, 0, 
     33        0, 0 
     34    }}, 
     35    { { 0, 0, 0, 0 } },  
     36#endif 
    2937#if defined(CAM_DNG_LENS_INFO) 
    3038    CAM_DNG_LENS_INFO, 
     
    3745    { -1 , 2 }, 
    3846#endif 
     47#if defined(CAM_COLORMATRIX1) 
    3948    { CAM_COLORMATRIX1 }, 
    4049    cam_CFAPattern, cam_CalibrationIlluminant1, 
    41 #if defined(OPT_GPS) 
    42     PROPCASE_GPS, 
    43 #else 
    44     0, 
     50#else 
     51    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 
     52    0, 0, 
    4553#endif 
    4654}; 
     
    5159    CAM_BITMAP_WIDTH, CAM_BITMAP_HEIGHT, CAM_BITMAP_WIDTH * CAM_BITMAP_HEIGHT, 
    5260    EDGE_HMARGIN, CAM_TS_BUTTON_BORDER, 
     61}; 
     62 
     63_cam_info camera_info = 
     64{ 
     65    { 
     66#if defined(PARAM_CAMERA_NAME) 
     67    PARAM_CAMERA_NAME, 
     68#else 
     69    0, 
     70#endif 
     71    }, 
     72    { 
     73#if defined(OPT_GPS) 
     74    PROPCASE_GPS, 
     75#else 
     76    0, 
     77#endif 
     78    PROPCASE_ORIENTATION_SENSOR, 
     79    PROPCASE_TV, PROPCASE_AV, PROPCASE_MIN_AV, 
     80    PROPCASE_EV_CORRECTION_2,  
     81    PROPCASE_FLASH_MODE, PROPCASE_FLASH_FIRE,  
     82    PROPCASE_METERING_MODE, PROPCASE_WB_ADJ, 
     83    }, 
    5384}; 
    5485 
  • branches/reyalp-flt/core/module_exportlist.c

    r1514 r1515  
    297297                        pow_calc_2, 
    298298 
     299            &camera_info, 
    299300            &camera_screen, 
    300301            &camera_sensor, 
  • branches/reyalp-flt/include/camera.h

    r1514 r1515  
    252252    int color_matrix1[18];      // DNG Color Matrix 
    253253    int cfa_pattern, calibration_illuminant1; 
    254     int gps_propcase; 
    255254} _cam_sensor; 
    256255 
     
    266265extern _cam_screen camera_screen; 
    267266 
     267typedef struct 
     268{ 
     269    struct 
     270    { 
     271        int camera_name; 
     272    } params; 
     273    struct 
     274    { 
     275        int gps; 
     276        int orientation_sensor; 
     277        int tv; 
     278        int av; 
     279        int min_av; 
     280        int ev_correction_2; 
     281        int flash_mode; 
     282        int flash_fire; 
     283        int metering_mode; 
     284        int wb_adj; 
     285    } props; 
     286} _cam_info; 
     287 
     288extern _cam_info camera_info; 
     289 
    268290//========================================================== 
    269291 
Note: See TracChangeset for help on using the changeset viewer.