Procházet zdrojové kódy

auto: display values in known units

Pavel Machek před 2 měsíci
rodič
revize
16092880d0
1 změnil soubory, kde provedl 26 přidání a 0 odebrání
  1. 26 0
      src/process_pipeline.c

+ 26 - 0
src/process_pipeline.c

@@ -489,6 +489,31 @@ update_exp(controlstate *control, int direction)
 	control->value_req = control->value + (step * direction);
 }
 
+static void
+summarize()
+{
+	double time, gain;
+
+	/* FIXME: may be approximate -- width/height should include blank areas */
+	double PCK = state_proc.mode->width * state_proc.mode->height * 30;
+	double per_line = state_proc.mode->width / PCK;
+	time = state_proc.exposure.value * per_line;
+	  
+	//Then the exposure time = (exposure line) * (time per line ).
+
+	/* Frame time in seconds */
+	//time = state_proc.exposure.value * state_proc.mode->height;
+
+	/* */
+	gain = state_proc.gain.value / 32.; /* FIXME: .min */
+	if (0) /* dgain */
+		gain *= state_proc.dgain.value / 256.;
+
+	printf("1/%.0f sec, ISO %.0f, t=%f, g=%f %d %d\n",
+	       (float) (1.0/time), (float) (gain*100),
+	       (float) time, (float) gain, state_proc.gain.value, state_proc.dgain.value);
+}
+
 static void
 process_aaa()
 {
@@ -562,6 +587,7 @@ process_aaa()
                 update_control(&state_proc.gain);
                 update_control(&state_proc.dgain);
                 update_control(&state_proc.exposure);
+		summarize();
         }
 
         if (auto_balance) {