From: Dominic L. <ma...@us...> - 2005-10-19 21:14:09
|
Update of /cvsroot/robotflow/RobotFlow/Devices/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27313/src Modified Files: V4L2Capture.cc Log Message: using settings except image format Index: V4L2Capture.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Devices/src/V4L2Capture.cc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** V4L2Capture.cc 19 Oct 2005 20:54:33 -0000 1.18 --- V4L2Capture.cc 19 Oct 2005 21:14:01 -0000 1.19 *************** *** 157,160 **** --- 157,161 ---- throw new GeneralException("Image format must be RGB15 or RGB24 format",__FILE__,__LINE__); } + */ if (!m_captureDevice.set_contrast(m_contrast)) { *************** *** 177,225 **** throw new GeneralException(string("Unable to set auto white balance on V4L2 device : ") + m_device, __FILE__,__LINE__); } ! */ } virtual void calculate(int output_id, int count, Buffer &out) { - - - - - - - - - out[count] = m_captureDevice.mainloop(); ! ! ! ! /* ! Image *image = Image::alloc(m_width,m_height,m_pixelsize); //allocate image ! ! if (!m_continuous) { ! read(m_captureDevice.getFD(),image->get_data(),m_width * m_height * m_pixelsize); ! } ! else { ! int index,field; ! ! //capture & cpy data ! memcpy(image->get_data(),m_captureDevice.captureFrame(index,field),m_width * m_height * m_pixelsize); ! ! if (m_autoSoftBrightness) { ! automaticBrightness(image); ! } ! ! //release frame ! m_captureDevice.releaseFrame(NULL,index); ! } ! out[count] = ObjectRef(image); ! */ ! //out[count] = nilObject; } - - - - }; --- 178,189 ---- throw new GeneralException(string("Unable to set auto white balance on V4L2 device : ") + m_device, __FILE__,__LINE__); } ! } virtual void calculate(int output_id, int count, Buffer &out) { out[count] = m_captureDevice.mainloop(); ! } }; *************** *** 228,314 **** /* - bool capture::set_auto_white_balance(bool white_balance) { - - struct v4l2_control control; - - control.id =V4L2_CID_AUTO_WHITE_BALANCE; - control.value = (int) white_balance; - - if (EINVAL == ioctl(vid_fd,VIDIOC_S_CTRL,&control)) { - perror("VIDIOC_S_CTR"); - return false; - } - - cerr<<"auto_white_balance value : "<<control.value<<endl; - - return true; - } - - bool capture::set_contrast(int contrast) { - - struct v4l2_control control; - - control.id =V4L2_CID_CONTRAST; - control.value = contrast; - - if (EINVAL == ioctl(vid_fd,VIDIOC_S_CTRL,&control)) { - perror("VIDIOC_S_CTR"); - return false; - } - - cerr<<"contrast value : "<<control.value<<endl; - - return true; - } - - bool capture::set_brightness(int brightness) { - - struct v4l2_control control; - - control.id =V4L2_CID_BRIGHTNESS; - control.value = brightness; - - if (EINVAL == ioctl(vid_fd,VIDIOC_S_CTRL,&control)) { - perror("VIDIOC_S_CTR"); - return false; - } - - cerr<<"brightness value : "<<control.value<<endl; - - return true; - } - bool capture::set_hue(int hue) { - - struct v4l2_control control; - - control.id =V4L2_CID_HUE; - control.value = hue; - - if (EINVAL == ioctl(vid_fd,VIDIOC_S_CTRL,&control)) { - perror("VIDIOC_S_CTR"); - return false; - } - - cerr<<"hue value : "<<control.value<<endl; - - return true; - } - bool capture::set_saturation(int saturation) { - - struct v4l2_control control; - - control.id =V4L2_CID_SATURATION; - control.value = saturation; - - if (EINVAL == ioctl(vid_fd,VIDIOC_S_CTRL,&control)) { - perror("VIDIOC_S_CTR"); - return false; - } - - cerr<<"saturation value : "<<control.value<<endl; - - return true; - } */ --- 192,196 ---- |