From: Dominic L. <ma...@us...> - 2005-10-19 21:14:09
|
Update of /cvsroot/robotflow/RobotFlow/Devices/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27313/include Modified Files: V4L2Capture.h Log Message: using settings except image format Index: V4L2Capture.h =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Devices/include/V4L2Capture.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** V4L2Capture.h 19 Oct 2005 21:07:19 -0000 1.13 --- V4L2Capture.h 19 Oct 2005 21:14:01 -0000 1.14 *************** *** 26,29 **** --- 26,30 ---- #include "Image.h" #include "Object.h" + #include <iostream> namespace RobotFlow { *************** *** 602,704 **** } ! ! /* ! static void ! usage (FILE * fp, ! int argc, ! char ** argv) ! { ! fprintf (fp, ! "Usage: %s [options]\n\n" ! "Options:\n" ! "-d | --device name Video device name [/dev/video]\n" ! "-h | --help Print this message\n" ! "-m | --mmap Use memory mapped buffers\n" ! "-r | --read Use read() calls\n" ! "-u | --userp Use application allocated buffers\n" ! "", ! argv[0]); } - - static const char short_options [] = "d:hmru"; ! static const struct option ! long_options [] = { ! { "device", required_argument, NULL, 'd' }, ! { "help", no_argument, NULL, 'h' }, ! { "mmap", no_argument, NULL, 'm' }, ! { "read", no_argument, NULL, 'r' }, ! { "userp", no_argument, NULL, 'u' }, ! { 0, 0, 0, 0 } ! }; ! */ ! /* ! int ! main (int argc, ! char ** argv) ! { ! dev_name = "/dev/video"; ! ! for (;;) { ! int index; ! int c; ! ! c = getopt_long (argc, argv, ! short_options, long_options, ! &index); ! ! if (-1 == c) ! break; ! ! switch (c) { ! case 0: ! break; ! ! case 'd': ! dev_name = optarg; ! break; ! ! case 'h': ! usage (stdout, argc, argv); ! exit (EXIT_SUCCESS); ! ! case 'm': ! io = IO_METHOD_MMAP; ! break; ! ! case 'r': ! io = IO_METHOD_READ; ! break; ! ! case 'u': ! io = IO_METHOD_USERPTR; ! break; ! ! default: ! usage (stderr, argc, argv); ! exit (EXIT_FAILURE); ! } ! } ! ! open_device (); ! ! init_device (); ! ! start_capturing (); ! ! mainloop (); ! ! stop_capturing (); ! ! uninit_device (); ! ! close_device (); ! ! exit (EXIT_SUCCESS); ! return 0; ! } ! */ ! };//class capture }//namespace RobotFlow #endif --- 603,691 ---- } ! bool 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(fd,VIDIOC_S_CTRL,&control)) { ! perror("VIDIOC_S_CTR"); ! return false; ! } ! ! std::cerr<<"auto_white_balance value : "<<control.value<<std::endl; ! ! return true; } ! bool set_contrast(int contrast) { ! ! struct v4l2_control control; ! ! control.id =V4L2_CID_CONTRAST; ! control.value = contrast; ! ! if (EINVAL == ioctl(fd,VIDIOC_S_CTRL,&control)) { ! perror("VIDIOC_S_CTR"); ! return false; ! } ! ! std::cerr<<"contrast value : "<<control.value<<std::endl; ! ! return true; ! } ! ! bool set_brightness(int brightness) { ! ! struct v4l2_control control; ! ! control.id =V4L2_CID_BRIGHTNESS; ! control.value = brightness; ! ! if (EINVAL == ioctl(fd,VIDIOC_S_CTRL,&control)) { ! perror("VIDIOC_S_CTR"); ! return false; ! } ! ! std::cerr<<"brightness value : "<<control.value<<std::endl; ! ! return true; ! } ! bool set_hue(int hue) { ! ! struct v4l2_control control; ! ! control.id =V4L2_CID_HUE; ! control.value = hue; ! ! if (EINVAL == ioctl(fd,VIDIOC_S_CTRL,&control)) { ! perror("VIDIOC_S_CTR"); ! return false; ! } ! ! std::cerr<<"hue value : "<<control.value<<std::endl; ! ! return true; ! } ! ! bool set_saturation(int saturation) { ! ! struct v4l2_control control; ! ! control.id =V4L2_CID_SATURATION; ! control.value = saturation; ! ! if (EINVAL == ioctl(fd,VIDIOC_S_CTRL,&control)) { ! perror("VIDIOC_S_CTR"); ! return false; ! } ! ! std::cerr<<"saturation value : "<<control.value<<std::endl; ! ! return true; ! } ! };//class capture }//namespace RobotFlow #endif |