Update of /cvsroot/robotflow/RobotFlow/Devices/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20554/include
Modified Files:
V4L2Capture.h
Log Message:
testing images grab
Index: V4L2Capture.h
===================================================================
RCS file: /cvsroot/robotflow/RobotFlow/Devices/include/V4L2Capture.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** V4L2Capture.h 19 Oct 2005 20:20:19 -0000 1.9
--- V4L2Capture.h 19 Oct 2005 20:41:35 -0000 1.10
***************
*** 24,27 ****
--- 24,28 ----
#include <linux/videodev2.h>
+ #include "Image.h"
namespace RobotFlow {
***************
*** 53,57 ****
buffer * buffers;
unsigned int n_buffers;
!
--- 54,58 ----
buffer * buffers;
unsigned int n_buffers;
! Image *m_image;
***************
*** 64,67 ****
--- 65,69 ----
buffers = NULL;
n_buffers = 0;
+ m_image = NULL;
}
***************
*** 79,82 ****
--- 81,87 ----
uninit_device ();
close_device ();
+ if (m_image) {
+ delete m_image;
+ }
}
***************
*** 99,102 ****
--- 104,111 ----
fputc ('.', stdout);
fflush (stdout);
+ //allocate image
+ m_image = Image::alloc(DEFAULT_WIDTH,DEFAULT_HEIGHT,2);
+ //copy image
+ memcpy(m_image->get_data(),p, DEFAULT_WIDTH * DEFAULT_HEIGHT * 2);
}
***************
*** 230,234 ****
}
! return NULL;
}
--- 239,243 ----
}
! return m_image;
}
|