CHDK_DE Vorschauversion  Trunk Rev. 5163
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
autoiso.h-Dateireferenz
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Funktionen

void shooting_set_autoiso (int iso_mode)
 
int live_histogram_read_y (unsigned short *buf)
 

Dokumentation der Funktionen

int live_histogram_read_y ( unsigned short *  buf)

Definiert in Zeile 47 der Datei autoiso.c.

48 {
49  int total;
50 
51  int vp_width = vid_get_viewport_width();
52  int vp_height = vid_get_viewport_height();
53  int vp_offset = vid_get_viewport_row_offset();
54 
55  total = (vp_width * vp_height) / (HISTO_STEP_SIZE * HISTO_BLOCK_SCALE);
56  memset(h, 0, sizeof(unsigned short)*256);
57 
58  unsigned char *img = vid_get_viewport_active_buffer();
59  if (!img) return total;
60 
61  img += vid_get_viewport_image_offset() + 1;
62 
63  int y;
64  for (y=0; y<vp_height; y++, img += vp_offset)
65  {
66  int x;
67  for (x=0; x<vp_width; x += HISTO_STEP_SIZE*HISTO_BLOCK_SCALE, img+=HISTO_STEP_SIZE*HISTO_BLOCK_BYTES)
68  {
69  ++h[*img];
70  }
71  }
72 
73  return total;
74 }
void shooting_set_autoiso ( int  iso_mode)

Definiert in Zeile 124 der Datei autoiso.c.

125 {
126  short max_iso;
127 
128  if (iso_mode<=0)
130 
131  switch (iso_mode)
132  {
133  case -1: // ISO HI
134  //max_iso = conf.autoiso_max_iso_hi*10;
135  max_iso = conf.autoiso_max_iso_hi_real;
136  break;
137  case 0: // ISO AUTO
138  //max_iso = conf.autoiso_max_iso_auto*10;
140  break;
141  default:
142  return;
143  }
144 
145  // TODO also long shutter ?
147  return; //Only operate outside of M and Tv
148 
149  int ev_overexp = 0;
150  if (conf.overexp_ev_enum)
151  {
152  // No shoot_histogram exist here because no future shot exist yet :)
154 
155  // step 32 is 1/3ev for tv96
157  ev_overexp = conf.overexp_ev_enum << 5;
158  }
159 
160  float current_shutter = shooting_get_shutter_speed_from_tv96(shooting_get_tv96());
161 
162  short current_iso = shooting_get_iso_real();
163 
164  short min_shutter = shutter1_values[conf.autoiso_shutter_enum];
165  if (min_shutter == 0)
166  {
167  short IS_factor = (shooting_get_is_mode()<=1)?conf.autoiso_is_factor:1;
168  min_shutter = get_focal_length(lens_get_zoom_point())*conf.autoiso_user_factor / (IS_factor*1000);
169  //min_shutter is NOT 1/Xs but optimized for the calculation.
171  shooting_calc_autoiso_coef( min_shutter );
172  }
173 
174  short target_iso = current_iso * min_shutter * current_shutter;
175  short min_iso = conf.autoiso_min_iso_real;
176 
177  if (target_iso > max_iso)
178  {
179  ev_overexp=0;
180 
181  // AutoISO2 if
182  // it is turned on (C2!=0.0)
183  // and it has valid iso2/shutter2 ( C2<0)
184  // and non-IsoHI mode
185  if ( !iso_mode && conf.autoiso2_coef < 0.0 )
186  {
187  target_iso = (max_iso - min_shutter*conf.autoiso2_coef) / ( 1.0 - conf.autoiso2_coef / (current_shutter * current_iso) );
188  if ( target_iso > conf.autoiso2_max_iso_auto_real )
189  target_iso = conf.autoiso2_max_iso_auto_real;
190  }
191  else
192  {
193  target_iso = max_iso;
194  }
195  }
196  else if (target_iso < min_iso)
197  {
198  target_iso = min_iso;
199  }
200 
201  float target_shutter = current_shutter * current_iso / target_iso;
202 
203  if (target_shutter > 0)
205 
206  shooting_set_iso_real(target_iso, SET_NOW);
207 }