00001 #include "FCam/Sensor.h" 00002 #include "FCam/Lens.h" 00003 #include "FCam/Shot.h" 00004 00005 #include "Debug.h" 00006 00007 namespace FCam { 00008 00009 Sensor::Sensor() { 00010 // A sensor affects the frames it returns, so it is attached 00011 // to itself. This is pointless for the base sensor, but is 00012 // useful for fancier derived sensors so that they get a 00013 // chance to tag the frames they return. 00014 attach(this); 00015 dropPolicy = Sensor::DropOldest; 00016 frameLimit = 128; 00017 } 00018 00019 Sensor::~Sensor() {} 00020 00021 void Sensor::attach(Device *d) { 00022 devices.push_back(d); 00023 } 00024 00025 void Sensor::setFrameLimit(int l) { 00026 frameLimit = l; 00027 enforceDropPolicy(); 00028 } 00029 00030 int Sensor::getFrameLimit() { 00031 return frameLimit; 00032 } 00033 00034 void Sensor::setDropPolicy(Sensor::DropPolicy d) { 00035 dropPolicy = d; 00036 } 00037 00038 Sensor::DropPolicy Sensor::getDropPolicy() { 00039 return dropPolicy; 00040 } 00041 00042 }