Changeset 121 in flair-src for trunk/lib/FlairSensorActuator/src/Camera.cpp
- Timestamp:
- 12/22/16 17:32:58 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/Camera.cpp
r15 r121 24 24 #include <DataPlot1D.h> 25 25 #include <Picture.h> 26 #include <Buffer.h> 26 27 #include <highgui.h> 27 28 #include <fstream> … … 38 39 : IODevice(parent, name) { 39 40 plot_tab = NULL; 41 jpgBuffer=NULL; 42 logFormat=LogFormat::NONE; 40 43 41 44 // do not allocate imagedata, allocation is done by the camera 42 45 output = new cvimage((IODevice *)this, width, height, format, "out", false); 43 46 44 47 // station sol 45 48 main_tab = new Tab(parent->GetTabWidget(), name); … … 50 53 } 51 54 55 //This contructor must only be called for a simulated device. 52 56 Camera::Camera(const IODevice *parent, std::string name) 53 57 : IODevice(parent, name) { … … 59 63 60 64 output = NULL; 65 jpgBuffer=NULL; 66 logFormat=LogFormat::NONE; 61 67 } 62 68 … … 64 70 if (main_tab != NULL) 65 71 delete main_tab; 72 } 73 74 void Camera::SetLogFormat(LogFormat logFormat) { 75 this->logFormat=logFormat; 76 switch(logFormat) { 77 case LogFormat::RAW: 78 AddDataToLog(output); 79 Warn("raw log of cvimage is not yet implemented\n"); 80 break; 81 case LogFormat::JPG: 82 if(jpgBuffer==NULL) { 83 jpgBuffer=new Buffer(this,"jpg_bufer"); 84 AddDataToLog(jpgBuffer); 85 }else{ 86 Warn("log format already defined\n"); 87 } 88 break; 89 } 66 90 } 67 91 … … 94 118 core::cvimage *Camera::Output(void) { return output; } 95 119 120 void Camera::ProcessUpdate(core::io_data* data) { 121 switch(logFormat) { 122 case LogFormat::JPG: 123 ajouter compression jpg 124 break; 125 } 126 IODevice::ProcessUpdate(data); 127 } 128 96 129 void Camera::SaveToFile(string filename) const { 97 130 Printf("saving %s, size %i\n", filename.c_str(), output->img->imageSize);
Note:
See TracChangeset
for help on using the changeset viewer.