From: Dominic L. <ma...@us...> - 2005-10-20 13:25:43
|
Update of /cvsroot/robotflow/RobotFlow/Devices/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1486/src Modified Files: V4L2Capture.cc Log Message: updated driver Index: V4L2Capture.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Devices/src/V4L2Capture.cc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** V4L2Capture.cc 19 Oct 2005 21:14:01 -0000 1.19 --- V4L2Capture.cc 20 Oct 2005 13:25:27 -0000 1.20 *************** *** 89,97 **** * @parameter_description Automatic white balance for V4L2 device. * - * @parameter_name AUTO_SOFT_BRIGHTNESS - * @parameter_type bool - * @parameter_value false - * @parameter_description Software adjustment of brightness (TEST) - * END*/ --- 89,92 ---- *************** *** 107,111 **** bool m_continuous; bool m_autoWhiteBalance; ! bool m_autoSoftBrightness; int m_width; int m_height; --- 102,106 ---- bool m_continuous; bool m_autoWhiteBalance; ! int m_width; int m_height; *************** *** 133,149 **** string format = object_cast<String>(parameters.get("FORMAT")); ! m_autoSoftBrightness = dereference_cast<bool>(parameters.get("AUTO_SOFT_BRIGHTNESS")); ! ! m_captureDevice.init(NULL); ! ! /* if (format == "GREYSCALE") { m_pixelsize = 1; ! if (!m_captureDevice.initialize(m_device.c_str(),m_width,m_height,V4L2_PIX_FMT_GREY,m_continuous)) { throw new GeneralException(string("Unable to initialize V4L2 device : ") + m_device, __FILE__,__LINE__); } }else if (format == "RGB15") { m_pixelsize = 2; ! if (!m_captureDevice.initialize(m_device.c_str(),m_width,m_height,V4L2_PIX_FMT_RGB555,m_continuous)) { throw new GeneralException(string("Unable to initialize V4L2 device : ") + m_device, __FILE__,__LINE__); } --- 128,141 ---- string format = object_cast<String>(parameters.get("FORMAT")); ! ! if (format == "GREYSCALE") { m_pixelsize = 1; ! if (!m_captureDevice.initialize(m_device,m_width,m_height,V4L2_PIX_FMT_GREY)) { throw new GeneralException(string("Unable to initialize V4L2 device : ") + m_device, __FILE__,__LINE__); } }else if (format == "RGB15") { m_pixelsize = 2; ! if (!m_captureDevice.initialize(m_device,m_width,m_height,V4L2_PIX_FMT_RGB555)) { throw new GeneralException(string("Unable to initialize V4L2 device : ") + m_device, __FILE__,__LINE__); } *************** *** 151,161 **** else if (format == "RGB24") { m_pixelsize = 3; ! if (!m_captureDevice.initialize(m_device.c_str(),m_width,m_height,V4L2_PIX_FMT_RGB24,m_continuous)) { throw new GeneralException(string("Unable to initialize V4L2 device : ") + m_device, __FILE__,__LINE__); } } else { ! throw new GeneralException("Image format must be RGB15 or RGB24 format",__FILE__,__LINE__); } ! */ if (!m_captureDevice.set_contrast(m_contrast)) { --- 143,153 ---- else if (format == "RGB24") { m_pixelsize = 3; ! if (!m_captureDevice.initialize(m_device,m_width,m_height,V4L2_PIX_FMT_RGB24)) { throw new GeneralException(string("Unable to initialize V4L2 device : ") + m_device, __FILE__,__LINE__); } } else { ! throw new GeneralException("Image format must be GREYSCALE, RGB15 or RGB24 format",__FILE__,__LINE__); } ! if (!m_captureDevice.set_contrast(m_contrast)) { *************** *** 183,187 **** virtual void calculate(int output_id, int count, Buffer &out) { ! out[count] = m_captureDevice.mainloop(); } --- 175,179 ---- virtual void calculate(int output_id, int count, Buffer &out) { ! out[count] = m_captureDevice.readFrame(); } |