- Timestamp:
- 01/16/12 09:46:33 (16 months ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
core/gui.c (modified) (6 diffs)
-
core/gui_osd.c (modified) (1 diff)
-
core/luascript.c (modified) (1 diff)
-
include/camera.h (modified) (1 diff)
-
include/platform.h (modified) (1 diff)
-
platform/g12/platform_camera.h (modified) (1 diff)
-
platform/generic/shooting.c (modified) (4 diffs)
-
platform/generic/wrappers.c (modified) (2 diffs)
-
platform/ixus310_elph500hs/platform_camera.h (modified) (1 diff)
-
platform/sx30/platform_camera.h (modified) (1 diff)
-
platform/sx40hs/platform_camera.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/gui.c
r1569 r1570 183 183 static const char* gui_tv_override_value_enum(int change, int arg); 184 184 static const char* gui_tv_enum_type_enum(int change, int arg); 185 staticconst char* gui_subj_dist_override_value_enum(int change, int arg);186 staticconst char* gui_subj_dist_override_koef_enum(int change, int arg);185 const char* gui_subj_dist_override_value_enum(int change, int arg); 186 const char* gui_subj_dist_override_koef_enum(int change, int arg); 187 187 /* 188 188 static const char* gui_tv_exposure_order_enum(int change, int arg); … … 232 232 const char* gui_USB_switch_types[] = { "None","OnePush", "TwoPush", "CA-1", "P Width", "P Count" }; 233 233 const char* gui_USB_control_modes[] = { "None", "Normal", "Quick", "Burst", "Bracket","Zoom", "Video","gWIRE","Script" }; 234 234 235 235 236 236 static CMenuItem remote_submenu_items[] = { … … 1214 1214 1215 1215 const char* gui_subj_dist_override_value_enum(int change, int arg) { 1216 static const int koef[] = {0, 1,10,100,1000}; 1217 static char buf[8]; 1218 conf.subj_dist_override_value+=(change*koef[conf.subj_dist_override_koef]); 1219 if (conf.subj_dist_override_value<0) 1220 conf.subj_dist_override_value=MAX_DIST; 1221 else if (conf.subj_dist_override_value>MAX_DIST) 1222 conf.subj_dist_override_value=0; 1223 sprintf(buf, "%d", (int)conf.subj_dist_override_value); 1216 int koef = shooting_get_subject_distance_override_koef(); 1217 static char buf[9]; 1218 if (koef == -1) 1219 { 1220 // If 'Infinity' selected in the 'koef' setting then set SD to the infinity value 1221 // technically the same as MAX_DIST when it's sent to the firmware function 1222 // in the camera; but used here to alter the CHDK OSD display. 1223 conf.subj_dist_override_value = INFINITY_DIST; 1224 } 1225 else 1226 { 1227 // Increment / decrement the SD value, wrapping around from MIN_DIST to MAX_DIST 1228 conf.subj_dist_override_value += (change*koef); 1229 if (conf.subj_dist_override_value < MIN_DIST) 1230 conf.subj_dist_override_value = MAX_DIST; 1231 else if (conf.subj_dist_override_value > MAX_DIST) 1232 conf.subj_dist_override_value = MIN_DIST; 1233 } 1234 if (conf.subj_dist_override_value == INFINITY_DIST) 1235 strcpy(buf,"Inf."); 1236 else 1237 sprintf(buf, "%d", (int)conf.subj_dist_override_value); 1224 1238 return buf; 1225 1239 } … … 1227 1241 1228 1242 const char* gui_subj_dist_override_koef_enum(int change, int arg) { 1229 return gui_change_simple_enum(&conf.subj_dist_override_koef,change,gui_override_koef_modes,sizeof(gui_override_koef_modes)/sizeof(gui_override_koef_modes[0])); 1243 // Define the adjustment factor values for the subject distance override 1244 #if MAX_DIST > 1000000 // Superzoom - e.g. SX30, SX40 1245 static const char* modes[] = { "Off", "1", "10", "100", "1000", "10K", "100K", "1M", "Inf." }; 1246 #elif MAX_DIST > 100000 // G12, IXUS310 1247 static const char* modes[] = { "Off", "1", "10", "100", "1000", "10K", "100K", "Inf." }; 1248 #else // Original values (MAX_DIST = 65535) 1249 static const char* modes[] = { "Off", "1", "10", "100", "1000" }; 1250 #endif 1251 const char *rv = gui_change_simple_enum(&conf.subj_dist_override_koef,change,modes,sizeof(modes)/sizeof(modes[0])); 1252 // If we've selected 'Infinity' focus then set the SD override value 1253 // Otherwise if we had previously selected 'Infinity' then reset back to MAX_DIST 1254 if (shooting_get_subject_distance_override_koef() == -1) 1255 conf.subj_dist_override_value = INFINITY_DIST; 1256 else if (conf.subj_dist_override_value == INFINITY_DIST) 1257 conf.subj_dist_override_value = MAX_DIST; 1258 return rv; 1230 1259 } 1231 1260 … … 1665 1694 gui_subj_dist_override_koef_enum(direction,0); 1666 1695 #if !CAM_HAS_MANUAL_FOCUS 1667 if (conf.subj_dist_override_koef==0) conf.subj_dist_override_koef=1;1696 if (conf.subj_dist_override_koef==0) gui_subj_dist_override_koef_enum(direction,0); 1668 1697 #endif 1669 1698 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); … … 1705 1734 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 1706 1735 #else 1707 if (conf.subj_dist_override_koef==4) 1708 gui_subj_dist_override_koef_enum(-3,0); 1709 else 1710 gui_subj_dist_override_koef_enum(1,0); 1736 gui_subj_dist_override_koef_enum(1,0); 1711 1737 #endif 1712 1738 } -
trunk/core/gui_osd.c
r1569 r1570 601 601 gui_print_osd_state_string_chr("AUTOISO:", ((conf.autoiso_enable==1)?"ON":"OFF")); 602 602 if ((conf.subj_dist_override_value && conf.subj_dist_override_koef && shooting_can_focus() && !(conf.override_disable==1)) || ((gui_get_mode()==GUI_MODE_ALT) && shooting_get_common_focus_mode()) || gui_mode==GUI_MODE_OSD) { 603 gui_print_osd_state_string_int("SD:",shooting_get_subject_distance_override_value()); 603 extern const char* gui_subj_dist_override_value_enum(int change, int arg); 604 extern const char* gui_subj_dist_override_koef_enum(int change, int arg); 605 gui_print_osd_state_string_chr("SD:",gui_subj_dist_override_value_enum(0,0)); 604 606 if (gui_mode==GUI_MODE_ALT) 605 gui_print_osd_state_string_ int("FACTOR:",shooting_get_subject_distance_override_koef());607 gui_print_osd_state_string_chr("FACTOR:",gui_subj_dist_override_koef_enum(0,0)); 606 608 } 607 609 if ((conf.iso_override_value && conf.iso_override_koef && !(conf.override_disable==1)) || gui_mode==GUI_MODE_OSD) -
trunk/core/luascript.c
r1569 r1570 581 581 else shooting_set_focus(to, SET_LATER); 582 582 #else 583 if ( mode_video) shooting_set_focus(to, SET_NOW);583 if (shooting_get_common_focus_mode() || mode_video) shooting_set_focus(to, SET_NOW); 584 584 else shooting_set_focus(to, SET_LATER); 585 585 #endif -
trunk/include/camera.h
r1527 r1570 189 189 190 190 #define CAM_USB_EVENTID 0x902 // Levent ID for USB control. Changed to 0x202 in DryOS R49 so needs to be overridable. 191 192 #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 193 194 #define CAMERA_MIN_DIST 0 // Define min distance that can be set in _MoveFocusLensToDistance (allow override - e.g. G12 min dist = 1) 195 #define CAMERA_MAX_DIST 65535 // Define max distance that can be set in _MoveFocusLensToDistance (allow override for superzooms - SX30/SX40) 191 196 192 197 //---------------------------------------------------------- -
trunk/include/platform.h
r1569 r1570 33 33 #endif 34 34 35 #define MAX_DIST 65535 36 #define MAX_DIST_HYPER_FOCAL 999999 35 #define MIN_DIST CAMERA_MIN_DIST // Defined in camera.h (can be overridden in platform_camera.h) 36 #define MAX_DIST CAMERA_MAX_DIST // Defined in camera.h (can be overridden in platform_camera.h) 37 #define INFINITY_DIST 0xFFFFFFFF // Value to send to firmware to select 'infinity' focus 38 #define MAX_DIST_HYPER_FOCAL 999999 37 39 38 40 //******************** -
trunk/platform/g12/platform_camera.h
r1555 r1570 125 125 // #define REMOTE_SYNC_STATUS_LED 0xC0xxyyyy // specifies an LED that turns on while camera waits for USB remote to sync 126 126 127 #undef CAMERA_MIN_DIST 128 #define CAMERA_MIN_DIST 68 // Override min subject distance 129 #undef CAMERA_MAX_DIST 130 #define CAMERA_MAX_DIST 258065 // Override max subject distance 131 127 132 //---------------------------------------------------------- 128 133 -
trunk/platform/generic/shooting.c
r1568 r1570 764 764 return 1; 765 765 #endif 766 return (shooting_get_ focus_mode() || MODE_IS_VIDEO(m));766 return (shooting_get_common_focus_mode() || MODE_IS_VIDEO(m)); 767 767 #elif !CAM_CAN_SD_OVERRIDE 768 768 return MODE_IS_VIDEO(m); … … 938 938 dist = shooting_get_focus(); 939 939 lens_set_zoom_point(v); 940 #if defined(CAM_NEED_SET_ZOOM_DELAY) 941 msleep(CAM_NEED_SET_ZOOM_DELAY); 942 #endif 940 943 shooting_set_focus(dist, SET_NOW); 941 944 } … … 964 967 if ((is_now) && shooting_can_focus()) { 965 968 if (conf.dof_dist_from_lens) s+=shooting_get_lens_to_focal_plane_width(); 966 if ( (!conf.dof_subj_dist_as_near_limit) && (s>0)) lens_set_focus_pos((s<MAX_DIST)?s:MAX_DIST);969 if (!conf.dof_subj_dist_as_near_limit) lens_set_focus_pos(s); 967 970 else { 968 971 int near=shooting_get_near_limit_f(s,shooting_get_min_real_aperture(),get_focal_length(lens_get_zoom_point())); 969 if (near>0) lens_set_focus_pos( (near<MAX_DIST)?near:MAX_DIST);972 if (near>0) lens_set_focus_pos(near); 970 973 } 971 974 } … … 1084 1087 int shooting_get_subject_distance_override_koef() 1085 1088 { 1086 static const short koef[] = {0, 1,10,100,1000}; 1089 // Define the adjustment factor values for the subject distance override 1090 #if MAX_DIST > 1000000 // Superzoom - e.g. SX30, SX40 1091 static const int koef[] = {0,1,10,100,1000,10000,100000,1000000,-1}; 1092 #elif MAX_DIST > 100000 // G12, IXUS310 1093 static const int koef[] = {0,1,10,100,1000,10000,100000,-1}; 1094 #else // Original values (MAX_DIST = 65535) 1095 static const int koef[] = {0,1,10,100,1000}; 1096 #endif 1087 1097 return koef[(conf.subj_dist_override_koef)]; 1088 1089 1098 } 1090 1099 -
trunk/platform/generic/wrappers.c
r1569 r1570 182 182 zoom_status=ZOOM_OPTICAL_MAX; 183 183 184 #if defined(CAMERA_g12)|| defined(CAMERA_g10) 184 #if defined(CAMERA_g12)|| defined(CAMERA_g10) 185 185 _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt)); 186 186 #endif … … 212 212 void lens_set_focus_pos(long newpos) 213 213 { 214 _MoveFocusLensToDistance((short*)&newpos); 215 //while (focus_busy);216 while ((shooting_is_flash_ready()!=1) || (focus_busy)) ;214 if (newpos >= MAX_DIST) newpos = INFINITY_DIST; // Set to infinity value that will work on all cameras 215 _MoveFocusLensToDistance((short*)&newpos); 216 while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10); 217 217 newpos = _GetFocusLensSubjectDistance(); 218 218 _SetPropertyCase(PROPCASE_SUBJECT_DIST1, &newpos, sizeof(newpos)); -
trunk/platform/ixus310_elph500hs/platform_camera.h
r1555 r1570 127 127 128 128 // #define REMOTE_SYNC_STATUS_LED 0xC0xxyyyy // specifies an LED that turns on while camera waits for USB remote to sync 129 129 130 #undef CAMERA_MIN_DIST 131 #define CAMERA_MIN_DIST 71 // Override min subject distance 132 #undef CAMERA_MAX_DIST 133 #define CAMERA_MAX_DIST 125392 // Override max subject distance 134 130 135 //---------------------------------------------------------- 131 136 -
trunk/platform/sx30/platform_camera.h
r1555 r1570 124 124 125 125 // #define REMOTE_SYNC_STATUS_LED 0xC0xxyyyy // specifies an LED that turns on while camera waits for USB remote to sync 126 126 127 #define CAM_NEED_SET_ZOOM_DELAY 300 // SX30 needs a short delay after setting the zoom before resetting focus in shooting_set_zoom() 128 129 #undef CAMERA_MIN_DIST 130 #define CAMERA_MIN_DIST 95 // Override min subject distance 131 #undef CAMERA_MAX_DIST 132 #define CAMERA_MAX_DIST 9090910 // Override max subject distance 133 127 134 //---------------------------------------------------------- -
trunk/platform/sx40hs/platform_camera.h
r1555 r1570 133 133 134 134 // #define REMOTE_SYNC_STATUS_LED 0xC0xxyyyy // specifies an LED that turns on while camera waits for USB remote to sync 135 135 136 #undef CAMERA_MIN_DIST 137 #define CAMERA_MIN_DIST 95 // Override min subject distance 138 #undef CAMERA_MAX_DIST 139 #define CAMERA_MAX_DIST 9523810 // Override max subject distance 140 136 141 //----------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.