#include "videoTEST.h" #include "plugins/PluginFactory.h" using namespace gem::plugins; REGISTER_VIDEOFACTORY("test", videoTEST); static double getRandom(void) { static unsigned int random_nextseed = 1489853723; random_nextseed = random_nextseed * 435898247 + 938284281; return random_nextseed * (1./4294967296.);; } videoTEST::videoTEST(void) : m_name(std::string("test")), m_open(false), m_type(0) { m_pixBlock.image.xsize = 64; m_pixBlock.image.ysize = 64; m_pixBlock.image.setCsizeByFormat(GL_RGBA); m_pixBlock.image.reallocate(); } videoTEST::~videoTEST(void) { } bool videoTEST::open(gem::Properties&props) { setProperties(props); return (m_open); } static void setNoise(unsigned char*data, unsigned int count) { unsigned int i=0; for(i=0; ivideoTEST::enumerate(void) { std::vectorresult; result.push_back("test"); return result; } bool videoTEST::setDevice(int ID) { m_open=(0==ID); return m_open; } bool videoTEST::setDevice(std::string device) { m_open=("test"==device); return m_open; } bool videoTEST::enumProperties(gem::Properties&readable, gem::Properties&writeable) { readable.clear(); writeable.clear(); writeable.set("width", 64); readable.set("width", 64); writeable.set("height", 64); readable.set("height", 64); writeable.set("type", std::string("noise")); return true; } void videoTEST::setProperties(gem::Properties&props) { m_props=props; double d; if(props.get("width", d)) { if(d>0) m_pixBlock.image.xsize = d; } if(props.get("height", d)) { if(d>0) m_pixBlock.image.ysize = d; } std::string s; if(props.get("type", s)) { if("noise"==s) m_type=0; else if("red"==s) m_type=1; else if("green"==s) m_type=2; else if("blue"==s) m_type=3; } } void videoTEST::getProperties(gem::Properties&props) { std::vectorkeys=props.keys(); unsigned int i; for(i=0; ivideoTEST::dialogs(void) { std::vectorresult; return result; } bool videoTEST::provides(const std::string name) { return (name==m_name); } std::vectorvideoTEST::provides(void) { std::vectorresult; result.push_back(m_name); return result; } const std::string videoTEST::getName(void) { return m_name; }