00001 #ifndef FCAM_F2_FLASH_H 00002 #define FCAM_F2_FLASH_H 00003 00004 #include "../Flash.h" 00005 #include "../Time.h" 00006 #include <vector> 00007 #include <stdio.h> 00008 00012 namespace FCam { namespace F2 { 00013 00014 class PhidgetFlash; 00015 00017 class Flash : public FCam::Flash { 00018 public: 00019 00024 Flash(int phidgetOutputIndex = 0); 00025 ~Flash(); 00026 00027 // duration in us 00028 int minDuration() {return 0;} 00029 int maxDuration() {return 0;} 00030 00031 // brightness measured by average lumens over the duration 00032 float minBrightness() {return 0.0f;} // TODO: calibrate this 00033 float maxBrightness() {return 0.0f;} 00034 00035 00040 void fire(float brightness, int duration); 00042 int fireLatency() {return 127*1000;} // TODO: calibrate this 00044 void startStrobe(); 00046 void stopStrobe(); 00047 00048 // instantaneous brightness in lumens at some time in the past 00049 float getBrightness(Time) {return 0.0f;} // TODO: implement this 00050 00051 // total photometric energy (lumen-seconds or Talbots) emitted over some duration 00052 float getBrightness(Time, Time) {return 0.0f;} // TODO: implement this 00053 00054 void tagFrame(FCam::Frame); // TODO: implement this 00055 00056 int latencyGuess; 00057 00059 class StrobeStartAction : public CopyableAction<StrobeStartAction> { 00060 public: 00063 StrobeStartAction(Flash *f); 00066 StrobeStartAction(Flash *f, int t); 00069 virtual void doAction(); 00070 protected: 00072 Flash *flash; 00073 }; 00075 class StrobeStopAction : public CopyableAction<StrobeStopAction> { 00076 public: 00079 StrobeStopAction(Flash *f); 00082 StrobeStopAction(Flash *f, int time); 00085 virtual void doAction(); 00086 protected: 00088 Flash *flash; 00089 }; 00090 00091 00092 private: 00094 PhidgetFlash *phidgetFlash; 00095 private: 00097 int phidgetIndex; 00098 private: 00099 void setDuration(int); 00100 void setBrightness(float); 00101 00102 struct FlashState { 00103 Time time; 00104 bool state; 00105 }; 00106 }; 00107 00108 } 00109 } 00110 00111 00112 #endif