[mousetrap/ng] Added 2 init methods to MtpCapture



commit 056d73d80e1a6884d90bd807e04af197a126ec3a
Author: Flavio Percoco Premoli <flaper87 gmail com>
Date:   Sat Jan 16 21:38:31 2010 +0100

    Added 2 init methods to MtpCapture

 src/mousetrap/ocvfw/boost/PyMtpCapture.cpp |    2 +-
 src/mousetrap/ocvfw/dev/MtpCapture.cpp     |   11 +++++++++++
 src/mousetrap/ocvfw/include/MtpCapture.h   |    4 ++++
 3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/mousetrap/ocvfw/boost/PyMtpCapture.cpp b/src/mousetrap/ocvfw/boost/PyMtpCapture.cpp
index 1e19249..63bc55f 100644
--- a/src/mousetrap/ocvfw/boost/PyMtpCapture.cpp
+++ b/src/mousetrap/ocvfw/boost/PyMtpCapture.cpp
@@ -33,7 +33,7 @@ using namespace boost::python;
 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(color_overloads, color, 2, 3)
 
 BOOST_PYTHON_MODULE(camera)
-{ 
+{
 	class_<Mat>("Mat", init<>())
 		.def_readwrite("cols", &Mat::cols )
 		.def_readwrite("rows", &Mat::rows )
diff --git a/src/mousetrap/ocvfw/dev/MtpCapture.cpp b/src/mousetrap/ocvfw/dev/MtpCapture.cpp
index 6cfae40..a75f6c2 100644
--- a/src/mousetrap/ocvfw/dev/MtpCapture.cpp
+++ b/src/mousetrap/ocvfw/dev/MtpCapture.cpp
@@ -35,6 +35,17 @@ using namespace cv;
 MtpCapture::MtpCapture() {
 }
 
+MtpCapture::MtpCapture(IplImage *img) {
+	this->img = img;
+}
+
+MtpCapture::MtpCapture(MtpCapture& cap) {
+	this->webcam = cap.webcam;
+	this->syncSlot = cap.syncSlot;
+	this->timer = cap.timer;
+	this->img = cap.img;
+}
+
 void MtpCapture::init(int set_fps, bool set_async, int idx) {
 	fps = set_fps;
 	async = set_async;
diff --git a/src/mousetrap/ocvfw/include/MtpCapture.h b/src/mousetrap/ocvfw/include/MtpCapture.h
index 294a4e5..17c1be1 100644
--- a/src/mousetrap/ocvfw/include/MtpCapture.h
+++ b/src/mousetrap/ocvfw/include/MtpCapture.h
@@ -57,6 +57,10 @@ public:
 	 */
 	MtpCapture(void);
 
+	MtpCapture(IplImage *img);
+
+	MtpCapture(MtpCapture& cap);
+
 	/**
 	 * Used to init the camera and capture vars
 	 *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]