A way to get_zoom() found on EOS-M 100// core/shooting.c int shooting_get_zoom(){ if (conf.platformid==13009) return get_zoom_x(0); // M100_15_45_STM = 0..30 return lens_get_zoom_point();}// m100/main.cint get_zoom_x(int zp) { int wfl = _GetLensWideFocalLength(); if (!wfl) { return -1; // manual lens }// -- return _GetLensCurrentFocalLength()*100 / (wfl*100);// ++ M100_15-45_STM, CAN_EF-S_18-55, CAN_50 1:1.8 II, ...? return (_GetLensCurrentFocalLength()*10000) / (wfl*666) -15;}:...;....1....;....2....;....3....;....4.. print(get_zoom(),-dof.focal_length,dof.eff_focal_length)Step -FL EFL 0 -15000 24000 1 -16000 25600 2 -17000 27200 3 -18000 28800 4 -19000 30400 5 -20000 32000 6 -21000 33600 7 -22000 35200 8 -23000 36800 9 -24000 38400 10 -25000 40000 11 -26000 41600 12 -27000 43200 13 -28000 44800 14 -29000 46400 15 -30000 48000 16 -31000 49600 17 -32000 51200 18 -33000 52800 19 -34000 54400 20 -35000 56000 21 -36000 57600 22 -37000 59200 23 -38000 60800 24 -39000 62400 25 -40000 64000 26 -41000 65600 27 -42000 67200 28 -43000 68800 29 -44000 70400 30 -45000 72000 CAN_EF-S_18-55 0 -18000 28800 30 -55000 88000CAN_50 1:1.8 II 0 -50000 80000
core/shooting.cint shooting_get_zoom() -- { if (zoom_steps==1) return get_zoom_x(0); // EOS ext.lens // (M100_15_45_STM = 0..30 // EF-S 55-250mm IS STM=0..37 ) max. is valid for AVtable return lens_get_zoom_point();}void shooting_update_dof_values() -- line 1185{ int zoom_point = shooting_get_zoom(); //--lens_get_zoom_point(); int fl = get_focal_length(zoom_point); if (!min_av96_zoom_point_tbl) { short zp=zoom_points; if (zp==1) zp=51; // EF-S 55-250mm IS STM=0..37 + some bytes more for unk lenses. min_av96_zoom_point_tbl = (short *) malloc(zp * sizeof(short)); if (min_av96_zoom_point_tbl) { memset(min_av96_zoom_point_tbl, 0, zp * sizeof(short)); }platform/m???/main.cint get_zoom_x(int zp) { int wfl = _GetLensWideFocalLength(); if (!wfl) { return 1; // manual lens }// ++ M100_15-45_STM, CAN_EF-S_18-55, CAN_50 1:1.8 II, CAN_EF_100-300, ...? return (_GetLensCurrentFocalLength()*15) / wfl -15;}....;....2....;....3....;....4.. print(get_min_av96(),get_av96(),get_max_av96(),get_user_av96(),get_user_av_id(),-dof.aperture)
What else can i do?
EF-M 11-22mm IS STM
EF-S 55-250mm IS STMIf Your superzoom needs more steps zp=31 might be to low.
5560616470798489100109113117121124127135143146152157163166172175180183189191194200211216225227233237250
0 -15000 24000 1 0 -420348 456 864 384 384 -35131 0 7777 0 false 00 47 3386 0 -1 false 3386 -1 19 -- 1 -16000 25600 1 0 -420348 348 864 384 384 -35131 0 7777 0 false 01 51 3851 0 -1 false 3851 -1 19 -- 2 -17000 27200 1 1 -420348 348 864 384 384 -35131 0 7777 0 true 02 54 4347 0 -1 true 4347 -1 19 -- 3 -18000 28800 1 0 -420360 360 876 384 384 -36681 0 7777 0 true 03 56 4667 0 -1 true 4667 -1 19 -- 4 -19000 30400 1 1 -420372 360 888 384 384 -38301 0 7777 0 false 04 58 4980 0 -1 false 4980 -1 19 -- 5 -20000 32000 1 0 -420372 372 888 384 384 -38301 0 7777 0 false 05 62 5517 0 -1 false 5517 -1 19 -- 6 -21000 33600 1 0 -420384 384 900 384 384 -40001 0 7777 0 true 06 64 5824 0 -1 true 5824 -1 19 -- 7 -22000 35200 1 1 -420384 384 900 384 384 -40001 0 7777 0 false 07 67 6390 0 -1 false 6390 -1 19 -- 8 -23000 36800 1 1 -420396 396 912 384 384 -41771 0 7777 0 false 08 69 6689 0 -1 false 6689 -1 19 -- 9 -24000 38400 1 1 -420396 396 912 384 384 -41771 0 7777 0 false 09 72 7282 0 -1 false 7282 -1 19 -- 10 -25000 40000 1 1 -420408 408 924 384 384 -43621 0 7777 0 false 010 74 7566 0 -1 false 7566 -1 19 -- 11 -26000 41600 1 1 -420408 408 924 384 384 -43621 0 7777 0 false 011 76 8183 0 -1 false 8183 -1 19 -- 12 -27000 43200 1 1 -420420 420 936 384 384 -45551 0 7777 0 false 012 79 8450 0 -1 false 8450 -1 19 -- 13 -28000 44800 1 0 -420432 420 948 384 384 -47571 0 7777 0 true 013 80 8702 0 -1 true 8702 -1 19 -- 14 -29000 46400 1 0 -420444 432 960 384 384 -49671 0 7777 0 false 014 82 8940 0 -1 false 8940 -1 19 -- 15 -30000 48000 1 1 -420444 444 960 384 384 -49671 0 7777 0 true 015 84 9567 0 -1 true 9567 -1 19 -- 16 -31000 49600 1 0 -420444 444 960 384 384 -49671 0 7777 0 false 016 86 10214 0 -1 false 10214 -1 19 -- 17 -32000 51200 1 0 -420456 444 972 384 384 -51871 0 7777 0 false 017 88 10422 0 -1 false 10422 -1 19 -- 18 -33000 52800 1 0 -420456 456 972 384 384 -51871 0 7777 0 false 018 90 11083 0 -1 false 11083 -1 19 -- 19 -34000 54400 1 3612 -420468 456 984 384 384 -54171 0 7777 0 false 019 92 11266 0 -1 false 11266 -1 19 -- 20 -35000 56000 1 0 -420468 456 984 384 384 -54171 0 7777 0 false 020 95 11937 0 -1 false 11937 -1 19 -- 21 -36000 57600 1 7710 -420480 480 996 384 384 -56571 0 7777 0 false 021 96 12094 0 -1 false 12094 -1 19 -- 22 -37000 59200 1 0 -420480 480 996 384 384 -56571 0 7777 0 false 022 98 12774 0 -1 false 12774 -1 19 -- 23 -38000 60800 1 0 -420480 480 996 384 384 -56571 0 7777 0 true 023 101 13473 0 -1 true 13473 -1 19 -- 24 -39000 62400 1 -24770 -420492 492 1008 384 384 -59071 0 7777 0 false 024 103 13591 0 -1 false 13591 -1 19 -- 25 -40000 64000 1 3604 -420492 492 1008 384 384 -59071 0 7777 0 false 025 105 14296 0 -1 false 14296 -1 19 -- 26 -41000 65600 1 3612 -420504 504 1020 384 384 -61691 0 7777 0 false 026 107 14383 0 -1 false 14383 -1 19 -- 27 -42000 67200 1 0 -420516 504 1032 384 384 -64421 0 7777 0 false 027 107 14454 0 -1 false 14454 -1 19 -- 28 -43000 68800 1 0 -420516 504 1032 384 384 -64421 0 7777 0 true 028 110 15149 0 -1 true 15149 -1 19 -- 29 -44000 70400 1 0 -420516 516 1032 384 384 -64421 0 7777 0 true 029 112 15861 0 -1 true 15861 -1 19 -- 30 -45000 72000 1 0 -420516 516 1032 384 384 -64421 0 7777 0 false 030 115 16589 0 -1 false 16589 -1 19 --*** UNTERBROCHEN ***
In the first approach I would use an average get_focus_distace_upper and get_focus_distace_lower (from M3M10M100_Focus.lua) for the focus.
int shooting_get_exif_subject_dist() { if(conf.platformid==13009) // Edit: Compiler warning, added 2*( ) return (((unsigned short) *(unsigned short *)(0x001FC7FA)>>1)+ ((unsigned short) *(unsigned short *)(0x001FC7FC)>>1)); return shooting_get_prop_int(PROPCASE_SUBJECT_DIST1); }short shooting_is_infinity_distance(){ if (conf.platformid==13009) return ((unsigned short) *(unsigned short *)(0x001FC7FA)>65432)?1:0; return (shooting_get_lens_to_focal_plane_width() == 0)?1:0;}
// console.c#ifdef CAM_ILC // Eos-M #define MAX_CONSOLE_HISTORY 100#else#define MAX_CONSOLE_HISTORY 30#endif// * /-------------------------------------------------------------------static void save_console(){ FILE *fh = fopen("A/console.Log","wb"); if(!fh) return; short i=0; static char const *c; c=&console_buf[0][0];// fwrite((char *)&console_buf,sizeof(console_buf),1,fh); while (i<MAX_CONSOLE_HISTORY*(MAX_CONSOLE_LINE_LENGTH+1)) { while (*c=='\0') { c++; i++;} while (*c!='\0') {fwrite((char *)c,1,1,fh); c++; i++;} fwrite((char *)"\n",1,1,fh); while (i%(MAX_CONSOLE_LINE_LENGTH+1)!=0) {c++; i++;} } fclose(fh);}//-------------------------------------------------------------------* / case KEY_LEFT: save_console(); break;
//shooting.c#include "console.h" // for research monitor, lines not logged.#ifdef CAM_ILC // lines ~125 -->> lines ~~1400static unsigned short peeks(int a) {return (unsigned short) *(unsigned short *)(a);}static int eos_m=0x001FC7FA; // m100_100a, 13009//if (conf.platformid==12953) eos_m=0x00244916; // "m3"="101a"//if (conf.platformid==12953) eos_m=0x0024495A; // "m3"="120f" default :)//if (conf.platformid==12960) eos_m=0x00272016; // m10 110d, 110f, 110gint shooting_get_exif_subject_dist() { return (peeks(eos_m)>>1)+(peeks(eos_m+2)>>1); }#elseint shooting_get_exif_subject_dist() { return shooting_get_prop_int(PROPCASE_SUBJECT_DIST1); }#endif#ifdef CAM_ILC // ~~1200int shooting_get_canon_subject_distance(){ return shooting_get_exif_subject_dist() * ( // eos-M get_focal_length(get_zoom_x(0))*10 ) / get_focal_length(0);}short shooting_is_infinity_distance() {return (peeks(eos_m)>65432)?1:0;}#elseshort shooting_is_infinity_distance() {return (shooting_get_lens_to_focal_plane_width() == 0)?1:0;}int shooting_get_canon_subject_distance(){ return (lens_get_focus_pos_from_lens()); // not eos-M}#endif// temp. helper: set shooting_set_zoom_rel(1) at top of script.Lua to get cam.#ifdef CAM_ILC // lines ~~1400void shooting_set_zoom_rel(int v) { switch (conf.platformid) { case 13009: eos_m=0x001FC7FA; // m100_100a break; case 12953: eos_m=0x0024495A; // "m3"="120f" default :) if (v==101) eos_m=0x00244916; // "m3"="101a" break; case 12960: eos_m=0x00272016; // m10 110d, 110f, 110g break; default: if (v>0xfffff) eos_m=v; } // switch}void shooting_set_zoom_speed(int v) {}void shooting_set_zoom(int v) { char buf[88]; // defined MAX_CONSOLE_LINE_LENGTH 44 struct tm *ttm = get_localtime(); switch(v) { case 0: break; case 1: sprintf(buf, "%08d %05u <%05u, %2u", get_tick_count(), peeks(eos_m+2), peeks(eos_m), shooting_get_zoom() ); break; case 2: sprintf(buf, "%08d 0x%04x 0x%04x,%2u", get_tick_count(), peeks(eos_m+2), peeks(eos_m), shooting_get_zoom() ); break; default: sprintf(buf, "%08d :%02u:%02u:%02u,%6d", get_tick_count(), ttm->tm_hour, ttm->tm_min, ttm->tm_sec, v); } // switch(v) console_add_line(buf); if (conf.console_show) console_draw(1);}#else // not ILC
// tokenizer.h TOKENIZER_GET_EFF_FOCAL_LENGTH,// tokenizer.c#define MAX_NUMLEN 9 {"get_eff_focal_length", TOKENIZER_GET_EFF_FOCAL_LENGTH}, // eq 35mm// ubasic.c#define MAX_STRINGLEN 128 case TOKENIZER_GET_FOCAL_LENGTH: accept(TOKENIZER_GET_FOCAL_LENGTH); r = get_focal_length(shooting_get_zoom()); //--(lens_get_zoom_point()) wg. EOS-M break; case TOKENIZER_GET_EFF_FOCAL_LENGTH: accept(TOKENIZER_GET_EFF_FOCAL_LENGTH); r = get_effective_focal_length(shooting_get_zoom()); r = r * conf.zoom_scale / 100; // from gui_osd.c break;
// scale by users adapter lens eg. Canon Wide .42 or Canon Tele 1.75 fl = fl * conf.zoom_scale / 100; // gui_osd.c line...404
Started by Srboraa Feature Requests
Started by lordsutch General Help and Assistance on using CHDK stable releases
Started by johnuk General Help and Assistance on using CHDK stable releases
Started by dan-tron General Help and Assistance on using CHDK stable releases
Started by koshy « 1 2 3 » General Discussion and Assistance