// Includes, project. #include "VislabCamera.hpp" // Includes, qt.imageformat #include // Includes, standard. #include #include // Includes lib3dv #include #include "DiskWriter.h" #include "Display.h" #include "VislabImageProcessor.h" #include #include #include #include #include using namespace pacpus; //ComponentFactory sFactory("VislabComponent"); VislabCamera::VislabCamera(const QString& name) :diskwriterVideo(name,lib3dv::image::type::RIGHT_RECTIFIED), diskwriterDisparite(name,lib3dv::image::type::DSI), displayVideo("Video",lib3dv::image::type::RIGHT_RECTIFIED), displayDisparite("Disparite",lib3dv::image::type::DSI) { } VislabCamera::~VislabCamera() { } void VislabCamera::open() { curr_devices = lib3dv::device::enumerate(boost::asio::ip::address_v4::from_string("192.168.0.2"), 1, error); if(error != lib3dv::error::NONE) std::cout << "[EE] 3dv-client: error detected: " << error << std::endl; if(curr_devices.empty()) { std::cout << "[EE] 3dv-client: no devices found" << std::endl; //return lib3dv::error::NONE; } //disk_writer = boost::shared_ptr< ::disk_writer>(new ::disk_writer(paths, data_format, autonumber, params, guid_type, log_level)); curr_devices[0].connect_image_callback(boost::function, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &displayVideo, _1, _2))); curr_devices[0].connect_image_callback(boost::function, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &displayDisparite, _1, _2))); curr_devices[0].connect_image_callback(boost::function, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterVideo, _1, _2))); curr_devices[0].connect_image_callback(boost::function, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterDisparite, _1, _2))); curr_devices[0].start_transmission(error); if(error != lib3dv::error::NONE) std::cout << "[EE] 3dv-client: error detected: " << error << std::endl; } void VislabCamera::close() { curr_devices[0].stop_transmission(error); //curr_devices[0].poweroff(error); }