#include #include #include #include #include #include #include #include #include "image.h" #include "jpeg_img.h" #include "webcam.h" #include "options.h" void overlayImage(Image& target, Image& tool) { if( target.size() != tool.size() || target.width != tool.width || target.channels != 3 ) throw std::runtime_error("Overlay Image needs to be same size as target"); else { for(uint32_t i = 0; i < target.size(); i+=3) { if(tool.data.get()[i] != 0xFF || tool.data.get()[i+1] != 0x00 || tool.data.get()[i+2] != 0xFF) { target.data.get()[i] = tool.data.get()[i]; target.data.get()[i+1] = tool.data.get()[i+1]; target.data.get()[i+2] = tool.data.get()[i+2]; } } } } void printUsage() { std::cout<<"useage:\nvideosender [video device] [ip] [port] [overlay]\n"; } int main(int argc, char* argv[]) { Config config; argp_parse(&argp, argc, argv, 0, 0, &config); bool passthough = config.mjpeg && config.overlay.empty(); std::cout<<"UVOS webcam sender v0.1\n"; Webcam webcam(config.device, config.Xres, config.Yres, config.mjpeg, passthough); std::stringstream ss; ss<<"nc "<