libcvd-members
[Top][All Lists]
Advanced

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

[libcvd-members] libcvd configure configure.in cvd/colourspace_c...


From: Edward Rosten
Subject: [libcvd-members] libcvd configure configure.in cvd/colourspace_c...
Date: Mon, 26 Oct 2009 15:44:59 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Edward Rosten <edrosten>        09/10/26 15:44:58

Modified files:
        .              : configure configure.in 
        cvd            : colourspace_convert.h colourspaces.h 
                         image_convert.h videobufferwithdata.h 
                         videosource.h 
        cvd/internal   : convert_pixel_types.h 
        cvd_src        : globlist.cxx videosource.cpp 
Added files:
        cvd_src        : videosource_dvbuffer.cc 
                         videosource_nodvbuffer.cc 
                         videosource_novideofilebuffer.cc 
                         videosource_videofilebuffer.cc 
        cvd_src/Linux  : videosource_nov4l1buffer.cc 
                         videosource_nov4lbuffer.cc 
                         videosource_v4l1buffer.cc 
                         videosource_v4lbuffer.cc 
        cvd_src/OSX    : videosource_noqtbuffer.cc 
                         videosource_qtbuffer.cc 

Log message:
        Colourspace conversion in open_video_source. This is implemented by the
        pseudo-device "colourspace". The identifier is then passed to
        open_video_source.
        
        For instance:
        
        colourspace:[from=yuv411]//dc1394://0
        
        from defaults to mono.
        
        - Also cleaned up open_video_source to remove #ifdefs and speed up 
compiling.
        
        - Added DefaultConvertible to see if a type is in the range accessible 
by 
          DefaultConversion
        - Added IsConvertible to see if one type can be converted to another
        - Improved the range of type names available

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure?cvsroot=libcvd&r1=1.147&r2=1.148
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure.in?cvsroot=libcvd&r1=1.148&r2=1.149
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/colourspace_convert.h?cvsroot=libcvd&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/colourspaces.h?cvsroot=libcvd&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/image_convert.h?cvsroot=libcvd&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/videobufferwithdata.h?cvsroot=libcvd&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/videosource.h?cvsroot=libcvd&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/internal/convert_pixel_types.h?cvsroot=libcvd&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/globlist.cxx?cvsroot=libcvd&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/videosource.cpp?cvsroot=libcvd&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/videosource_dvbuffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/videosource_nodvbuffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/videosource_novideofilebuffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/videosource_videofilebuffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/Linux/videosource_nov4l1buffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/Linux/videosource_nov4lbuffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/Linux/videosource_v4l1buffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/Linux/videosource_v4lbuffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/OSX/videosource_noqtbuffer.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/OSX/videosource_qtbuffer.cc?cvsroot=libcvd&rev=1.1

Patches:
Index: configure
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -b -r1.147 -r1.148
--- configure   2 Jul 2009 15:19:07 -0000       1.147
+++ configure   26 Oct 2009 15:44:57 -0000      1.148
@@ -12813,12 +12813,23 @@
 cvd_src/Linux/dvbuffer                                                 
dvbuffer END
 cvd_src/Linux/dvbuffer3_dc1394v2                                       
dvbuffer3 dc1394v2
 cvd_src/Linux/dvbuffer3_dc1394v1                                       
dvbuffer3 dvbuffer END
-cvd_src/Linux/v4l1buffer                                               
v4l1buffer END
-cvd_src/Linux/v4lbuffer,V4LBUFFER                              v4l2buffer 
linux_2_6 END
+cvd_src/videosource_dvbuffer                    dvbuffer3
+cvd_src/videosource_nodvbuffer                  END
+
+cvd_src/Linux/v4l1buffer,cvd_src/Linux/videosource_v4l1buffer           
v4l1buffer
+cvd_src/Linux/videosource_nov4l1buffer                               END
+
+
+cvd_src/Linux/v4lbuffer,V4LBUFFER,cvd_src/Linux/videosource_v4lbuffer   
v4l2buffer linux_2_6
+cvd_src/Linux/videosource_nov4lbuffer                                   END
 cvd_src/Linux/v4l2buffer                               v4l2buffer END
 cvd_src/Linux/v4lcontrol                                               
v4l2buffer linux_2_6 END
+
+
 cvd_src/IRIX/O2buffer,cvd_src/IRIX/sgi-video   o2buffer END
-cvd_src/OSX/qtbuffer                                                   
qtbuffer END
+
+cvd_src/OSX/qtbuffer,cvd_src/OSX/videosource_qtbuffer     qtbuffer
+cvd_src/OSX/videosource_noqtbuffer                                END
 
 cvd_src/posix/timer                                                            
posix_rt
 cvd_src/cvd_timer                                                              
END
@@ -12834,7 +12845,8 @@
 pnm_src/jpeg                                                                   
jpeg END
 pnm_src/tiff,pnm_src/tiffwrite                                 tiff END
 pnm_src/png                                                                    
        png END
-cvd_src/videofilebuffer                                                        
ffmpeg END
+cvd_src/videofilebuffer,cvd_src/videosource_videofilebuffer     ffmpeg
+cvd_src/videosource_novideofilebuffer           END
 cvd_src/globlist                                                       glob END
 
 #Numerics dependencies

Index: configure.in
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure.in,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -b -r1.148 -r1.149
--- configure.in        2 Jul 2009 15:19:07 -0000       1.148
+++ configure.in        26 Oct 2009 15:44:57 -0000      1.149
@@ -1004,12 +1004,23 @@
 cvd_src/Linux/dvbuffer                                                 
dvbuffer END
 cvd_src/Linux/dvbuffer3_dc1394v2                                       
dvbuffer3 dc1394v2
 cvd_src/Linux/dvbuffer3_dc1394v1                                       
dvbuffer3 dvbuffer END
-cvd_src/Linux/v4l1buffer                                               
v4l1buffer END
-cvd_src/Linux/v4lbuffer,V4LBUFFER                              v4l2buffer 
linux_2_6 END
+cvd_src/videosource_dvbuffer                    dvbuffer3
+cvd_src/videosource_nodvbuffer                  END
+
+cvd_src/Linux/v4l1buffer,cvd_src/Linux/videosource_v4l1buffer           
v4l1buffer
+cvd_src/Linux/videosource_nov4l1buffer                               END
+
+
+cvd_src/Linux/v4lbuffer,V4LBUFFER,cvd_src/Linux/videosource_v4lbuffer   
v4l2buffer linux_2_6 
+cvd_src/Linux/videosource_nov4lbuffer                                   END
 cvd_src/Linux/v4l2buffer                               v4l2buffer END
 cvd_src/Linux/v4lcontrol                                               
v4l2buffer linux_2_6 END
+
+
 cvd_src/IRIX/O2buffer,cvd_src/IRIX/sgi-video   o2buffer END
-cvd_src/OSX/qtbuffer                                                   
qtbuffer END
+
+cvd_src/OSX/qtbuffer,cvd_src/OSX/videosource_qtbuffer     qtbuffer
+cvd_src/OSX/videosource_noqtbuffer                                END 
 
 cvd_src/posix/timer                                                            
posix_rt
 cvd_src/cvd_timer                                                              
END
@@ -1025,7 +1036,8 @@
 pnm_src/jpeg                                                                   
jpeg END
 pnm_src/tiff,pnm_src/tiffwrite                                 tiff END
 pnm_src/png                                                                    
        png END
-cvd_src/videofilebuffer                                                        
ffmpeg END
+cvd_src/videofilebuffer,cvd_src/videosource_videofilebuffer     ffmpeg 
+cvd_src/videosource_novideofilebuffer           END
 cvd_src/globlist                                                       glob END
 
 #Numerics dependencies

Index: cvd/colourspace_convert.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/colourspace_convert.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- cvd/colourspace_convert.h   11 Mar 2009 21:35:12 -0000      1.10
+++ cvd/colourspace_convert.h   26 Oct 2009 15:44:58 -0000      1.11
@@ -18,6 +18,8 @@
        Foundation, Inc., 
     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
+#ifndef CVD_INCLUDE_COLOURSPACE_CONVERT_H
+#define CVD_INCLUDE_COLOURSPACE_CONVERT_H
 #include <cvd/image_convert_fwd.h>
 #include <cvd/colourspaces.h>
 #include <cvd/byte.h>
@@ -93,4 +95,20 @@
        /// @param to The output data
        /// @ingroup gImageIO
        template<> void convert_image(const BasicImage<vuy422>& from, 
BasicImage<byte>& to);    
+
+
+       template<> struct IsConvertible<yuv411,      Rgb<byte> > { static const 
bool is=1; };
+       template<> struct IsConvertible<yuv411,      byte>       { static const 
bool is=1; };
+       template<> struct IsConvertible<yuv422,      Rgb<byte> > { static const 
bool is=1; };
+       template<> struct IsConvertible<yuv422,      byte>       { static const 
bool is=1; };
+       template<> struct IsConvertible<bayer_bggr,  byte>       { static const 
bool is=1; };
+       template<> struct IsConvertible<bayer_grbg,  byte>       { static const 
bool is=1; };
+       template<> struct IsConvertible<bayer_gbrg,  byte>       { static const 
bool is=1; };
+       template<> struct IsConvertible<bayer_rggb,  byte>       { static const 
bool is=1; };
+       template<> struct IsConvertible<bayer_bggr,  Rgb<byte> > { static const 
bool is=1; };
+       template<> struct IsConvertible<bayer_grbg,  Rgb<byte> > { static const 
bool is=1; };
+       template<> struct IsConvertible<bayer_gbrg,  Rgb<byte> > { static const 
bool is=1; };
+       template<> struct IsConvertible<bayer_rggb,  Rgb<byte> > { static const 
bool is=1; };
 }
+
+#endif

Index: cvd/colourspaces.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/colourspaces.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- cvd/colourspaces.h  11 Mar 2009 22:39:37 -0000      1.15
+++ cvd/colourspaces.h  26 Oct 2009 15:44:58 -0000      1.16
@@ -24,6 +24,7 @@
 #include <cvd/internal/is_pod.h>
 #include <cvd/internal/builtin_components.h>
 #include <cvd/internal/pixel_traits.h>
+#include <cvd/internal/name_builtin_types.h>
 
 namespace CVD
 {
@@ -104,6 +105,18 @@
                unsigned short val;
        };
 
+       namespace PNM{
+               template<> struct type_name<bayer_bggr> { static std::string 
name(){return "bayer_bggr" ;}};
+               template<> struct type_name<bayer_gbrg> { static std::string 
name(){return "bayer_gbrg" ;}};
+               template<> struct type_name<bayer_grbg> { static std::string 
name(){return "bayer_grbg" ;}};
+               template<> struct type_name<bayer_rggb> { static std::string 
name(){return "bayer_rggb" ;}};
+
+               template<> struct type_name<yuv411> { static std::string 
name(){return "yuv411" ;}};
+               template<> struct type_name<yuv422> { static std::string 
name(){return "yuv422" ;}};
+               template<> struct type_name<yuv420p>{ static std::string 
name(){return "yuv420p";}};
+               template<> struct type_name<vuy422> { static std::string 
name(){return "vuy422" ;}};
+       }
+
   namespace Pixel {
         template<int LIFT> struct traits<bayer_bggr, LIFT>
         {

Index: cvd/image_convert.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/image_convert.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- cvd/image_convert.h 12 Jan 2009 11:53:49 -0000      1.14
+++ cvd/image_convert.h 26 Oct 2009 15:44:58 -0000      1.15
@@ -180,6 +180,13 @@
        template<class D> Image<D> convert_image(const BasicImage<C>& from);
 
   #endif
+    /// Can teo types be converted with CVD::convert_image?
+    /// @ingroup gImageIO
+       template<class In, class Out> struct IsConvertible
+       { 
+               static const bool is=Pixel::DefaultConvertible<In>::is && 
Pixel::DefaultConvertible<Out>::is;
+       };
+
 }
 
 #endif

Index: cvd/videobufferwithdata.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/videobufferwithdata.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- cvd/videobufferwithdata.h   23 Oct 2009 14:49:43 -0000      1.1
+++ cvd/videobufferwithdata.h   26 Oct 2009 15:44:58 -0000      1.2
@@ -36,8 +36,8 @@
 class VideoBufferWithData: public VideoBuffer<T> 
 {
        public: 
-               VideoBufferWithData(std::auto_ptr<VideoBuffer<T> > buf_, 
std::auto_ptr<D> d)
-               :VideoBuffer<T>(buf->type()), buf(buf_),extra_data(d)
+               VideoBufferWithData(std::auto_ptr<VideoBuffer<T> >& buf_, 
std::auto_ptr<D>& d)
+               :VideoBuffer<T>(buf_->type()), buf(buf_),extra_data(d)
                {}
 
                ImageRef size()

Index: cvd/videosource.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/videosource.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- cvd/videosource.h   23 Oct 2009 17:18:34 -0000      1.21
+++ cvd/videosource.h   26 Oct 2009 15:44:58 -0000      1.22
@@ -10,33 +10,14 @@
 
 #include <cvd/config.h>
 
+#include <cvd/colourspacebuffer.h>
+#include <cvd/colourspaces.h>
 #include <cvd/videobufferwithdata.h>
 #include <cvd/readaheadvideobuffer.h>
-#include <cvd/colourspaces.h>
 
 #include <cvd/diskbuffer2.h>
 #include <cvd/serverpushjpegbuffer.h>
 
-#if CVD_HAVE_FFMPEG
-#include <cvd/videofilebuffer.h>
-#endif
-
-#if CVD_INTERNAL_HAVE_V4LBUFFER
-#include <cvd/Linux/v4lbuffer.h>
-#endif
-
-#if CVD_HAVE_V4L1BUFFER
-#include <cvd/Linux/v4l1buffer.h>
-#endif
-
-#if CVD_HAVE_DVBUFFER
-#include <cvd/Linux/dvbuffer3.h>
-#endif
-
-#if CVD_HAVE_QTBUFFER
-#include <cvd/OSX/qtbuffer.h>
-#endif
-
 namespace CVD {
        struct ParseException : public Exceptions::All
        {
@@ -59,8 +40,16 @@
        std::ostream& operator<<(std::ostream& out, const VideoSource& vs);
 
        void parse(std::istream& in, VideoSource& vs);
+       template <class T> VideoBuffer<T>* open_video_source(const std::string& 
src);
 
-       template <class T> VideoBuffer<T>* makeJPEGStream(const std::string& 
filename)
+       
////////////////////////////////////////////////////////////////////////////////
+       //
+       // Server push JPEG buffer
+       //
+
+       template<class T, bool Implemented = Pixel::DefaultConvertible<T>::is> 
struct makeJPEGStream
+       {
+               static VideoBuffer<T>* make(const std::string& filename)
        {
                using std::auto_ptr;
                using std::ifstream;
@@ -70,55 +59,131 @@
                auto_ptr<VideoBuffer<T> > buf(static_cast<VideoBuffer<T>*>(new 
ServerPushJpegBuffer<T>(*stream)));
                return new VideoBufferWithData<T, std::ifstream>(buf, stream);
        }
+       };
 
-       template <> inline VideoBuffer<vuy422> * makeJPEGStream(const 
std::string&)
+       template<class T> struct makeJPEGStream<T, false>
+       {
+               static VideoBuffer<T>* make(const std::string&)
        {
-               throw VideoSourceException("DiskBuffer2 cannot handle type 
vuy422");
+                       throw VideoSourceException("ServerPushJpegBuffer cannot 
handle type " + PNM::type_name<T>::name());
+               }
+       };
+
+       void get_jpegstream_options(const VideoSource& vs, int& fps);
+
+ 
+    
////////////////////////////////////////////////////////////////////////////////
+       //
+       // Colourspace conversion buffer
+       //
+    
+       void get_colourspace_options(const VideoSource& vs, std::string& from);
+
+       template<class Out, class In, bool can_convert> struct MakeConverter{
+               static VideoBuffer<Out>* make(const std::string& r)
+               {
+                       std::auto_ptr<VideoBuffer<In> > buf  = 
std::auto_ptr<VideoBuffer<In> > 
(static_cast<VideoBuffer<In>*>(open_video_source<In>(r)));
+                       std::auto_ptr<VideoBuffer<Out> > cvt = 
std::auto_ptr<VideoBuffer<Out> >(static_cast<VideoBuffer<Out>*>( new 
ColourspaceBuffer<Out, In>(*buf)));
+                       return new VideoBufferWithData<Out, VideoBuffer<In> 
>(cvt, buf);
        }
+       };
 
-       template <> inline VideoBuffer<yuv422> * makeJPEGStream(const 
std::string&)
+       template<class Out, class In> struct MakeConverter<Out, In, false>
+       {
+               static VideoBuffer<Out>* make(const std::string&)
        {
-               throw VideoSourceException("DiskBuffer2 cannot handle type 
yuv422");
+                       throw VideoSourceException("ColorspaceBuffer cannot 
convert from " + PNM::type_name<In>::name() + " to " + 
PNM::type_name<Out>::name());
        }
-       void get_jpegstream_options(const VideoSource& vs, int& fps);
+       };
+
+       template<class T> struct MakeConverter<T, T, true>{
+               static VideoBuffer<T>* make(const std::string& r)
+               {
+                       return open_video_source<T>(r);
+               }
+       };
+
+       template<class Out, class In> VideoBuffer<Out>* 
makeConvertBufferBit(const std::string& r)
+       {
+               return MakeConverter<Out, In, IsConvertible<In, Out>::is 
>::make(r);
+       };
 
+       template<class T> VideoBuffer<T>* makeColourspaceBuffer(const 
std::string& c, const std::string& r)
+       {
+
+               if(c == "byte" || c == "mono" || c == "gray" || c == "grey")
+                       return makeConvertBufferBit<T, byte>(r);
+               else if(c == "rgb<byte>" || c == "rgb")
+                       return makeConvertBufferBit<T, Rgb<byte> >(r);
+               else if(c == "yuv411")
+                       return makeConvertBufferBit<T, yuv411>(r);
+               else if(c == "yuv422")
+                       return makeConvertBufferBit<T, yuv422>(r);
+               else if(c == "yuv420p")
+                       return makeConvertBufferBit<T, yuv420p>(r);
+               else if(c == "vuy422")
+                       return makeConvertBufferBit<T, vuy422>(r);
+               else if(c == "bayer_bggr")
+                       return makeConvertBufferBit<T, bayer_bggr>(r);
+               else if(c == "bayer_gbrg")
+                       return makeConvertBufferBit<T, bayer_gbrg>(r);
+               else if(c == "bayer_grbg")
+                       return makeConvertBufferBit<T, bayer_grbg>(r);
+               else if(c == "bayer_rggb")
+                       return makeConvertBufferBit<T, bayer_rggb>(r);
+               else
+                       throw  VideoSourceException("ColorspaceBuffer cannot 
handle type " + c);
+       }
 
+       
////////////////////////////////////////////////////////////////////////////////
+       //
+       // DiskBuffer2 buffer
+       //
                
 #ifdef CVD_HAVE_GLOB
-       template <class T> VideoBuffer<T>* makeDiskBuffer2(const 
std::vector<std::string>& files, double fps, VideoBufferFlags::OnEndOfBuffer 
eob)
+       template<class T, bool Implemented = Pixel::DefaultConvertible<T>::is> 
struct makeDiskBuffer2
+       {
+               static VideoBuffer<T>* make(const std::vector<std::string>& 
files, double fps, VideoBufferFlags::OnEndOfBuffer eob)
        {
                return new DiskBuffer2<T>(files, fps, eob);    
        }
-       template <> inline VideoBuffer<vuy422> * makeDiskBuffer2(const 
std::vector<std::string>& , double , VideoBufferFlags::OnEndOfBuffer )
+       };
+
+       template<class T> struct makeDiskBuffer2<T, false>
        {
-               throw VideoSourceException("DiskBuffer2 cannot handle type 
vuy422");
-       }
-       template <> inline VideoBuffer<yuv422> * makeDiskBuffer2(const 
std::vector<std::string>& , double , VideoBufferFlags::OnEndOfBuffer )
+               static VideoBuffer<T>* make(const std::vector<std::string>& , 
double , VideoBufferFlags::OnEndOfBuffer)
        {
-               throw VideoSourceException("DiskBuffer2 cannot handle type 
yuv422");
+                       throw VideoSourceException("DiskBuffer2 cannot handle 
type " + PNM::type_name<T>::name());
        }
+       };
+
 #endif
 
        void get_files_options(const VideoSource& vs, int& fps, int& ra_frames, 
VideoBufferFlags::OnEndOfBuffer& eob);
        
-#if CVD_HAVE_V4L1BUFFER
+       
////////////////////////////////////////////////////////////////////////////////
+       //
+       // v4l1 buffer
+       //
+
        template <class T> VideoBuffer<T>* makeV4L1Buffer(const std::string&, 
const ImageRef& )
        {
                throw VideoSourceException("V4L1Buffer cannot handle types 
other than byte, bayer, yuv422, Rgb<byte>");
        }
 
        template <> VideoBuffer<byte>* makeV4L1Buffer(const std::string& dev, 
const ImageRef& size);
-       template <> VideoBuffer<bayer_grbg>* makeV4L1Buffer(const std::string& 
dev, const ImageRef& size);
+       template <> VideoBuffer<bayer>* makeV4L1Buffer(const std::string& dev, 
const ImageRef& size);
        template <> VideoBuffer<yuv422>* makeV4L1Buffer(const std::string& dev, 
const ImageRef& size);
        template <> VideoBuffer<Rgb<byte> >* makeV4L1Buffer(const std::string& 
dev, const ImageRef& size);
 
        void get_v4l1_options(const VideoSource& vs, ImageRef& size);
 
-#endif
-
+       
////////////////////////////////////////////////////////////////////////////////
+       //
+       // v4l buffer
+       //
        
-#if CVD_INTERNAL_HAVE_V4LBUFFER
-       template <class T> VideoBuffer<T>* makeV4LBuffer(const std::string& 
dev, const ImageRef& size, int input, bool interlaced, bool verbose)
+       template <class T> VideoBuffer<T>* makeV4LBuffer(const std::string&, 
const ImageRef&, int, bool, bool)
        {
                throw VideoSourceException("V4LBuffer cannot handle types other 
than byte, bayer, yuv422, vuy422, Rgb<byte>");
        }
@@ -132,10 +197,12 @@
 
        void get_v4l2_options(const VideoSource& vs, ImageRef& size, int& 
input, bool& interlaced, bool& verbose);
 
-#endif
 
+       
////////////////////////////////////////////////////////////////////////////////
+       //
+       // video file buffer
+       //
 
-#if CVD_HAVE_FFMPEG    
        template <class T> VideoBuffer<T>* makeVideoFileBuffer(const 
std::string& , VideoBufferFlags::OnEndOfBuffer )
        {
                throw VideoSourceException("VideoFileBuffer cannot handle types 
other than byte, Rgb<byte>");
@@ -146,22 +213,32 @@
 
        void get_file_options(const VideoSource& vs, int& ra_frames, 
VideoBufferFlags::OnEndOfBuffer& eob);
 
-#endif
-
-#if CVD_HAVE_DVBUFFER
+       
////////////////////////////////////////////////////////////////////////////////
+       //
+       // DC1394 buffer
+       //
        template <class T> VideoBuffer<T>* makeDVBuffer2(int , ImageRef , float 
, ImageRef)
        {
-               throw VideoSourceException("DVBuffer2 cannot handle types other 
than byte, Rgb<byte>");
+               throw VideoSourceException("DVBuffer2 cannot handle " + 
PNM::type_name<T>::name());
        }
        
        template <> VideoBuffer<byte>* makeDVBuffer2(int cam, ImageRef size, 
float fps, ImageRef offset);
+       template <> VideoBuffer<unsigned short>* makeDVBuffer2(int cam, 
ImageRef size, float fps, ImageRef offset);
+       template <> VideoBuffer<yuv411>* makeDVBuffer2(int cam, ImageRef size, 
float fps, ImageRef offset);
+       template <> VideoBuffer<yuv422>* makeDVBuffer2(int cam, ImageRef size, 
float fps, ImageRef offset);
        template <> VideoBuffer<Rgb<byte> >* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset);
+       template <> VideoBuffer<bayer_bggr>* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset);
+       template <> VideoBuffer<bayer_gbrg>* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset);
+       template <> VideoBuffer<bayer_grbg>* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset);
+       template <> VideoBuffer<bayer_rggb>* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset);
 
        void get_dc1394_options(const VideoSource& vs, ImageRef& size, float& 
fps, ImageRef& offset);
 
-#endif
+       
////////////////////////////////////////////////////////////////////////////////
+       //
+       // QuickTime buffer
+       //
 
-#if CVD_HAVE_QTBUFFER
        template <class T> VideoBuffer<T> * makeQTBuffer( const ImageRef & , 
int , bool )
        {
                throw VideoSourceException("QTBuffer cannot handle types other 
than vuy422");
@@ -170,9 +247,12 @@
        template <> VideoBuffer<yuv422> * makeQTBuffer( const ImageRef & size, 
int input, bool showsettings);
        
        void get_qt_options(const VideoSource & vs, ImageRef & size, bool & 
showsettings);
-#endif
 
   
+       
////////////////////////////////////////////////////////////////////////////////
+       //
+       // video source handler
+       //
 
        template <class T> VideoBuffer<T>* open_video_source(const VideoSource& 
vs)
        {
@@ -182,7 +262,7 @@
                        int ra_frames=0;
                        get_jpegstream_options(vs, ra_frames);
 
-                       auto_ptr<VideoBuffer<T> > 
jpeg_buffer(makeJPEGStream<T>(vs.identifier));
+                       auto_ptr<VideoBuffer<T> > 
jpeg_buffer(makeJPEGStream<T>::make(vs.identifier));
 
                        if(ra_frames == 0)
                                return jpeg_buffer.release();
@@ -192,19 +272,24 @@
                                return new VideoBufferWithData<T, 
VideoBuffer<T> >(b, jpeg_buffer);
                        }
                }
+               else if(vs.protocol == "colourspace")
+               {
+                       std::string from = "byte";
+                       get_colourspace_options(vs, from);
+
+                       return makeColourspaceBuffer<T>(from, vs.identifier);
+               }
 #if CVD_HAVE_GLOB
                else if (vs.protocol == "files") {
                        int fps, ra_frames=0;
                        VideoBufferFlags::OnEndOfBuffer eob;
                        get_files_options(vs, fps, ra_frames, eob);
-                       VideoBuffer<T>* vb = 
makeDiskBuffer2<T>(globlist(vs.identifier), fps, eob);
+                       VideoBuffer<T>* vb = 
makeDiskBuffer2<T>::make(globlist(vs.identifier), fps, eob);
                        if (ra_frames)
                                vb = new ReadAheadVideoBuffer<T>(*vb, 
ra_frames);
                        return vb;
                }
 #endif
-
-
 #if CVD_HAVE_V4L1BUFFER
                else if (vs.protocol == "v4l1") {
                        ImageRef size;
@@ -252,7 +337,7 @@
 #endif
                else
                        throw VideoSourceException("undefined video source 
protocol: '" + vs.protocol + "'\n\t valid protocols: "
-                                                                          
"jpegstream, "
+                                                                          
"colourspace, jpegstream, "
 #if CVD_HAVE_FFMPEG
                                                                           
"file, "
 #endif

Index: cvd/internal/convert_pixel_types.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/internal/convert_pixel_types.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- cvd/internal/convert_pixel_types.h  24 Jun 2009 09:46:13 -0000      1.12
+++ cvd/internal/convert_pixel_types.h  26 Oct 2009 15:44:58 -0000      1.13
@@ -286,5 +286,34 @@
     }
   };
   
+  ///All pixel types which are DefaultConvertible can be converted freely from 
one
+  ///to another. This struct indicated which types are DefaultConvertible. All 
+  ///bulitin numeric types, Rgb of them, Rgba and Rgb8 etc fall in to this 
class.
+  /// @ingroup gImageIO
+  template<class C> struct DefaultConvertible
+  {
+       static const int is = std::numeric_limits<C>::is_specialized;
+  };
+
+  template<class C> struct DefaultConvertible<Rgb<C> >
+  {
+       static const int is = std::numeric_limits<C>::is_specialized;
+  };
+
+  template<class C> struct DefaultConvertible<Argb<C> >
+  {
+       static const int is = std::numeric_limits<C>::is_specialized;
+  };
+
+  template<class C> struct DefaultConvertible<Rgba<C> >
+  {
+       static const int is = std::numeric_limits<C>::is_specialized;
+  };
+
+  template<> struct DefaultConvertible<Rgb8>
+  {
+       static const int is = 1;
+  };
+  
 }}
 #endif

Index: cvd_src/globlist.cxx
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/globlist.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- cvd_src/globlist.cxx        26 Nov 2006 00:03:20 -0000      1.6
+++ cvd_src/globlist.cxx        26 Oct 2009 15:44:58 -0000      1.7
@@ -31,7 +31,8 @@
 // GLOBLIST
 // Makes a list of files matching a pattern
 //
-vector<string> CVD::globlist(const string& gl)
+namespace CVD{
+vector<string> globlist(const string& gl)
 {
        vector<string> ret;
 
@@ -54,3 +55,4 @@
 
        return ret;
 }
+}

Index: cvd_src/videosource.cpp
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/videosource.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- cvd_src/videosource.cpp     23 Oct 2009 17:10:12 -0000      1.13
+++ cvd_src/videosource.cpp     26 Oct 2009 15:44:58 -0000      1.14
@@ -265,6 +265,20 @@
                }
        }
 
+       void get_colourspace_options(const VideoSource& vs, string& colourspace)
+       {
+               colourspace = "mono";
+
+               for (VideoSource::option_list::const_iterator 
it=vs.options.begin(); it != vs.options.end(); ++it) {            
+                       if (it->first == "from") {
+                               colourspace = it->second;
+                       }
+                       else
+                               throw VideoSourceException("invalid option for 
files protocol: "+it->first +
+                                                                               
   "\n\t valid options: from");
+               }
+       }
+
        void get_files_options(const VideoSource& vs, int& fps, int& ra_frames, 
VideoBufferFlags::OnEndOfBuffer& eob)
        {
                fps = 30;
@@ -293,27 +307,6 @@
        }
 
 
-
-#if CVD_HAVE_V4L1BUFFER
-       template <> CVD::VideoBuffer<CVD::byte>* makeV4L1Buffer(const 
std::string& dev, const CVD::ImageRef& size)
-       {
-               return new CVD::V4L1Buffer<CVD::byte>(dev, size);
-       }
-
-       template <> CVD::VideoBuffer<CVD::yuv422>* makeV4L1Buffer(const 
std::string& dev, const CVD::ImageRef& size)
-       {
-               return new CVD::V4L1Buffer<CVD::yuv422>(dev, size);
-       }
-       template <> CVD::VideoBuffer<CVD::Rgb<CVD::byte> >* 
makeV4L1Buffer(const std::string& dev, const CVD::ImageRef& size)
-       {
-               return new CVD::V4L1Buffer<CVD::Rgb<CVD::byte> >(dev, size);
-       }
-
-       template <> CVD::VideoBuffer<CVD::bayer_grbg>* makeV4L1Buffer(const 
std::string& dev, const CVD::ImageRef& size)
-       {
-               return new CVD::V4LBuffer<CVD::bayer_grbg>(dev, size);
-       }
-
        void get_v4l1_options(const VideoSource& vs, ImageRef& size)
        {
                size = ImageRef(0,0);
@@ -326,38 +319,6 @@
                }
        }
 
-#endif
-
-
-#if CVD_INTERNAL_HAVE_V4LBUFFER
-       template <> CVD::VideoBuffer<CVD::byte>* makeV4LBuffer(const 
std::string& dev, const CVD::ImageRef& size, int input, bool interlaced, bool 
verbose)
-       {
-               return new CVD::V4LBuffer<CVD::byte>(dev, size, input, 
interlaced, 0, verbose);
-       }
-
-       #ifdef V4L2_PIX_FMT_SBGGR8
-               template <> CVD::VideoBuffer<CVD::bayer_grbg>* 
makeV4LBuffer(const std::string& dev, const CVD::ImageRef& size, int input, 
bool interlaced, bool verbose)
-               {
-                       return new CVD::V4LBuffer<CVD::bayer_grbg>(dev, size, 
input, interlaced, 0, verbose);
-               }
-       #endif
-       template <> CVD::VideoBuffer<CVD::yuv422>* makeV4LBuffer(const 
std::string& dev, const CVD::ImageRef& size, int input, bool interlaced, bool 
verbose)
-       {
-               return new CVD::V4LBuffer<CVD::yuv422>(dev, size, input, 
interlaced, 0, verbose);
-       }
-       template <> CVD::VideoBuffer<CVD::vuy422>* makeV4LBuffer(const 
std::string& dev, const CVD::ImageRef& size, int input, bool interlaced, bool 
verbose)
-       {
-               return new CVD::V4LBuffer<CVD::vuy422>(dev, size, input, 
interlaced, 0, verbose);
-       }
-       template <> CVD::VideoBuffer<CVD::Rgb<CVD::byte> >* makeV4LBuffer(const 
std::string& dev, const CVD::ImageRef& size, int input, bool interlaced, bool 
verbose)
-       {
-               return new CVD::V4LBuffer<CVD::Rgb<CVD::byte> >(dev, size, 
input, interlaced, 0, verbose);
-       }
-
-       template <> CVD::VideoBuffer<CVD::Rgb8>* makeV4LBuffer(const 
std::string& dev, const CVD::ImageRef& size, int input, bool interlaced, bool 
verbose)
-       {
-               return new CVD::V4LBuffer<CVD::Rgb8>(dev, size, input, 
interlaced, 0, verbose);
-       }
 
        void get_v4l2_options(const VideoSource& vs, ImageRef& size, int& 
input, bool& interlaced, bool& verbose)
        {
@@ -379,22 +340,7 @@
                }
        }
 
-#endif
 
-#if CVD_HAVE_FFMPEG
-       template <> CVD::VideoBuffer<CVD::byte>* makeVideoFileBuffer(const 
std::string& file, CVD::VideoBufferFlags::OnEndOfBuffer eob)
-       {
-               CVD::VideoFileBuffer<CVD::byte>* vb = new 
CVD::VideoFileBuffer<CVD::byte>(file);
-               vb->on_end_of_buffer(eob);
-               return vb;
-       }
-
-       template <> CVD::VideoBuffer<CVD::Rgb<CVD::byte> >* 
makeVideoFileBuffer(const std::string& file, 
CVD::VideoBufferFlags::OnEndOfBuffer eob)
-       {
-               CVD::VideoFileBuffer<CVD::Rgb<CVD::byte> >* vb = new 
CVD::VideoFileBuffer<CVD::Rgb<CVD::byte> >(file);
-               vb->on_end_of_buffer(eob);
-               return vb;
-       }
 
        void get_file_options(const VideoSource& vs, int& ra_frames, 
VideoBufferFlags::OnEndOfBuffer& eob)
        {
@@ -418,18 +364,6 @@
                }
        }
 
-#endif
-
-#if CVD_HAVE_DVBUFFER
-       template <> CVD::VideoBuffer<CVD::byte>* makeDVBuffer2(int cam, 
ImageRef size, float fps, ImageRef offset)
-       {
-               return new CVD::DVBuffer3<CVD::byte>(cam,size, fps, offset);
-       }
-
-       template <> CVD::VideoBuffer<CVD::Rgb<CVD::byte> >* makeDVBuffer2(int 
cam, ImageRef size, float fps, ImageRef offset)
-       {
-               return new CVD::DVBuffer3<CVD::Rgb<CVD::byte> >(cam, size, fps, 
offset);
-       }
 
        void get_dc1394_options(const VideoSource& vs, ImageRef& size, float& 
fps, ImageRef& offset)
        { 
@@ -447,18 +381,6 @@
                                throw VideoSourceException("invalid option for 
dc1394 protocol: "+it->first+"\n\t valid options: fps, size, offset");
                }
    }
-#endif
-
-#if CVD_HAVE_QTBUFFER
-       template <> VideoBuffer<vuy422> * makeQTBuffer( const ImageRef & size, 
int input, bool showsettings)
-       {
-               return new CVD::QTBuffer<vuy422>(size, input, showsettings);
-       }
-
-       template <> VideoBuffer<yuv422> * makeQTBuffer( const ImageRef & size, 
int input, bool showsettings)
-       {
-               return new CVD::QTBuffer<yuv422>(size, input, showsettings);
-       }
        
        void get_qt_options(const VideoSource & vs, ImageRef & size, bool & 
showsettings){
                size = ImageRef(640, 480);
@@ -472,6 +394,4 @@
                                throw VideoSourceException("invalid option for 
'qt' protocol: "+it->first+"\n\t valid options: size, showsettings");
                }
        }
-#endif
-
 }

Index: cvd_src/videosource_dvbuffer.cc
===================================================================
RCS file: cvd_src/videosource_dvbuffer.cc
diff -N cvd_src/videosource_dvbuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/videosource_dvbuffer.cc     26 Oct 2009 15:44:58 -0000      1.1
@@ -0,0 +1,51 @@
+#include <cvd/videosource.h>
+#include <cvd/Linux/dvbuffer3.h>
+
+namespace CVD{
+
+       template <> VideoBuffer<byte>* makeDVBuffer2(int cam, ImageRef size, 
float fps, ImageRef offset)
+       {
+               return new DVBuffer3<byte>(cam,size, fps, offset);
+       }
+
+       template <> VideoBuffer<unsigned short>* makeDVBuffer2(int cam, 
ImageRef size, float fps, ImageRef offset)
+       {
+               return new DVBuffer3<unsigned short>(cam,size, fps, offset);
+       }
+
+       template <> VideoBuffer<yuv411>* makeDVBuffer2(int cam, ImageRef size, 
float fps, ImageRef offset)
+       {
+               return new DVBuffer3<yuv411>(cam,size, fps, offset);
+       }
+
+       template <> VideoBuffer<yuv422>* makeDVBuffer2(int cam, ImageRef size, 
float fps, ImageRef offset)
+       {
+               return new DVBuffer3<yuv422>(cam,size, fps, offset);
+       }
+
+       template <> VideoBuffer<bayer_grbg>* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset)
+       {
+               return new DVBuffer3<bayer_grbg>(cam,size, fps, offset);
+       }
+
+       template <> VideoBuffer<bayer_gbrg>* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset)
+       {
+               return new DVBuffer3<bayer_gbrg>(cam,size, fps, offset);
+       }
+
+       template <> VideoBuffer<bayer_rggb>* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset)
+       {
+               return new DVBuffer3<bayer_rggb>(cam,size, fps, offset);
+       }
+
+       template <> VideoBuffer<bayer_bggr>* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset)
+       {
+               return new DVBuffer3<bayer_bggr>(cam,size, fps, offset);
+       }
+
+       template <> VideoBuffer<Rgb<byte> >* makeDVBuffer2(int cam, ImageRef 
size, float fps, ImageRef offset)
+       {
+               return new DVBuffer3<Rgb<byte> >(cam, size, fps, offset);
+       }
+
+}

Index: cvd_src/videosource_nodvbuffer.cc
===================================================================
RCS file: cvd_src/videosource_nodvbuffer.cc
diff -N cvd_src/videosource_nodvbuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/videosource_nodvbuffer.cc   26 Oct 2009 15:44:58 -0000      1.1
@@ -0,0 +1,50 @@
+#include <cvd/videosource.h>
+
+namespace CVD{
+
+       template <> VideoBuffer<byte>* makeDVBuffer2(int, ImageRef, float, 
ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<unsigned short>* makeDVBuffer2(int, ImageRef, 
float, ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<yuv411>* makeDVBuffer2(int, ImageRef, float, 
ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<yuv422>* makeDVBuffer2(int, ImageRef, float, 
ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<bayer_grbg>* makeDVBuffer2(int, ImageRef, 
float, ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<bayer_gbrg>* makeDVBuffer2(int, ImageRef, 
float, ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<bayer_rggb>* makeDVBuffer2(int, ImageRef, 
float, ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<bayer_bggr>* makeDVBuffer2(int, ImageRef, 
float, ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<Rgb<byte> >* makeDVBuffer2(int, ImageRef, 
float, ImageRef)
+       {
+               throw VideoSourceException("DVBuffer3 is not compiled in to 
libcvd.");
+       }
+
+}

Index: cvd_src/videosource_novideofilebuffer.cc
===================================================================
RCS file: cvd_src/videosource_novideofilebuffer.cc
diff -N cvd_src/videosource_novideofilebuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/videosource_novideofilebuffer.cc    26 Oct 2009 15:44:58 -0000      
1.1
@@ -0,0 +1,13 @@
+#include <cvd/videosource.h>
+namespace CVD{
+
+       template <> VideoBuffer<byte>* makeVideoFileBuffer(const std::string&, 
VideoBufferFlags::OnEndOfBuffer)
+       {
+               throw VideoSourceException("VideoFileBuffer is not compiled in 
to libcvd.");
+       }
+
+       template <> VideoBuffer<Rgb<byte> >* makeVideoFileBuffer(const 
std::string&, VideoBufferFlags::OnEndOfBuffer)
+       {
+               throw VideoSourceException("VideoFileBuffer is not compiled in 
to libcvd.");
+       }
+}

Index: cvd_src/videosource_videofilebuffer.cc
===================================================================
RCS file: cvd_src/videosource_videofilebuffer.cc
diff -N cvd_src/videosource_videofilebuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/videosource_videofilebuffer.cc      26 Oct 2009 15:44:58 -0000      
1.1
@@ -0,0 +1,20 @@
+#include <cvd/videosource.h>
+#include <cvd/videofilebuffer.h>
+
+namespace CVD{
+
+       template <> VideoBuffer<byte>* makeVideoFileBuffer(const std::string& 
file, VideoBufferFlags::OnEndOfBuffer eob)
+       {
+               VideoFileBuffer<byte>* vb = new VideoFileBuffer<byte>(file);
+               vb->on_end_of_buffer(eob);
+               return vb;
+       }
+
+       template <> VideoBuffer<Rgb<byte> >* makeVideoFileBuffer(const 
std::string& file, VideoBufferFlags::OnEndOfBuffer eob)
+       {
+               VideoFileBuffer<Rgb<byte> >* vb = new VideoFileBuffer<Rgb<byte> 
>(file);
+               vb->on_end_of_buffer(eob);
+               return vb;
+       }
+}
+

Index: cvd_src/Linux/videosource_nov4l1buffer.cc
===================================================================
RCS file: cvd_src/Linux/videosource_nov4l1buffer.cc
diff -N cvd_src/Linux/videosource_nov4l1buffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/Linux/videosource_nov4l1buffer.cc   26 Oct 2009 15:44:58 -0000      
1.1
@@ -0,0 +1,24 @@
+#include <cvd/videosource.h>
+#include <cvd/Linux/v4l1buffer.h>
+
+namespace CVD{
+
+       template <> VideoBuffer<byte>* makeV4L1Buffer(const std::string& , 
const ImageRef&)
+       {
+               throw VideoSourceException("V4L1Buffer is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<yuv422>* makeV4L1Buffer(const std::string& , 
const ImageRef&)
+       {
+               throw VideoSourceException("V4L1Buffer is not compiled in to 
libcvd.");
+       }
+       template <> VideoBuffer<Rgb<byte> >* makeV4L1Buffer(const std::string& 
, const ImageRef&)
+       {
+               throw VideoSourceException("V4L1Buffer is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<bayer_grbg>* makeV4L1Buffer(const std::string& 
, const ImageRef&)
+       {
+               throw VideoSourceException("V4L1Buffer is not compiled in to 
libcvd.");
+       }
+}

Index: cvd_src/Linux/videosource_nov4lbuffer.cc
===================================================================
RCS file: cvd_src/Linux/videosource_nov4lbuffer.cc
diff -N cvd_src/Linux/videosource_nov4lbuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/Linux/videosource_nov4lbuffer.cc    26 Oct 2009 15:44:58 -0000      
1.1
@@ -0,0 +1,36 @@
+#include <cvd/videosource.h>
+#include <cvd/Linux/v4lbuffer.h>
+
+namespace CVD{
+
+       template <> VideoBuffer<byte>* makeV4LBuffer(const std::string&, const 
ImageRef&, int, bool, bool)
+       {
+               throw VideoSourceException("V4LBuffer is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<bayer_grbg>* makeV4LBuffer(const std::string&, 
const ImageRef&, int, bool, bool)
+       {
+               throw VideoSourceException("V4LBuffer is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<yuv422>* makeV4LBuffer(const std::string&, 
const ImageRef&, int, bool, bool)
+       {
+               throw VideoSourceException("V4LBuffer is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<vuy422>* makeV4LBuffer(const std::string&, 
const ImageRef&, int, bool, bool)
+       {
+               throw VideoSourceException("V4LBuffer is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<Rgb<byte> >* makeV4LBuffer(const std::string&, 
const ImageRef&, int, bool, bool)
+       {
+               throw VideoSourceException("V4LBuffer is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<Rgb8>* makeV4LBuffer(const std::string&, const 
ImageRef&, int, bool, bool)
+       {
+               throw VideoSourceException("V4LBuffer is not compiled in to 
libcvd.");
+       }
+
+}

Index: cvd_src/Linux/videosource_v4l1buffer.cc
===================================================================
RCS file: cvd_src/Linux/videosource_v4l1buffer.cc
diff -N cvd_src/Linux/videosource_v4l1buffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/Linux/videosource_v4l1buffer.cc     26 Oct 2009 15:44:58 -0000      
1.1
@@ -0,0 +1,24 @@
+#include <cvd/videosource.h>
+#include <cvd/Linux/v4l1buffer.h>
+
+namespace CVD{
+       template <> VideoBuffer<byte>* makeV4L1Buffer(const std::string& dev, 
const ImageRef& size)
+       {
+               return new V4L1Buffer<byte>(dev, size);
+       }
+
+       template <> VideoBuffer<yuv422>* makeV4L1Buffer(const std::string& dev, 
const ImageRef& size)
+       {
+               return new V4L1Buffer<yuv422>(dev, size);
+       }
+       template <> VideoBuffer<Rgb<byte> >* makeV4L1Buffer(const std::string& 
dev, const ImageRef& size)
+       {
+               return new V4L1Buffer<Rgb<byte> >(dev, size);
+       }
+
+       template <> VideoBuffer<bayer>* makeV4L1Buffer(const std::string& dev, 
const ImageRef& size)
+       {
+               return new V4L1Buffer<bayer>(dev, size);
+       }
+
+}

Index: cvd_src/Linux/videosource_v4lbuffer.cc
===================================================================
RCS file: cvd_src/Linux/videosource_v4lbuffer.cc
diff -N cvd_src/Linux/videosource_v4lbuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/Linux/videosource_v4lbuffer.cc      26 Oct 2009 15:44:58 -0000      
1.1
@@ -0,0 +1,37 @@
+#include <cvd/videosource.h>
+#include <cvd/Linux/v4lbuffer.h>
+namespace CVD{
+
+       template <> VideoBuffer<byte>* makeV4LBuffer(const std::string& dev, 
const ImageRef& size, int input, bool interlaced, bool verbose)
+       {
+               return new V4LBuffer<byte>(dev, size, input, interlaced, 0, 
verbose);
+       }
+
+       template <> VideoBuffer<bayer_grbg>* makeV4LBuffer(const std::string& 
dev, const ImageRef& size, int input, bool interlaced, bool verbose)
+       {
+               #ifdef V4L2_PIX_FMT_SBGGR8
+                       return new V4LBuffer<bayer_grbg>(dev, size, input, 
interlaced, 0, verbose);
+               #else
+                       throw VideoSourceException("Bayer video grabbing is not 
available in this kernel version.");
+               #endif
+       }
+
+       template <> VideoBuffer<yuv422>* makeV4LBuffer(const std::string& dev, 
const ImageRef& size, int input, bool interlaced, bool verbose)
+       {
+               return new V4LBuffer<yuv422>(dev, size, input, interlaced, 0, 
verbose);
+       }
+       template <> VideoBuffer<vuy422>* makeV4LBuffer(const std::string& dev, 
const ImageRef& size, int input, bool interlaced, bool verbose)
+       {
+               return new V4LBuffer<vuy422>(dev, size, input, interlaced, 0, 
verbose);
+       }
+       template <> VideoBuffer<Rgb<byte> >* makeV4LBuffer(const std::string& 
dev, const ImageRef& size, int input, bool interlaced, bool verbose)
+       {
+               return new V4LBuffer<Rgb<byte> >(dev, size, input, interlaced, 
0, verbose);
+       }
+
+       template <> VideoBuffer<Rgb8>* makeV4LBuffer(const std::string& dev, 
const ImageRef& size, int input, bool interlaced, bool verbose)
+       {
+               return new V4LBuffer<Rgb8>(dev, size, input, interlaced, 0, 
verbose);
+       }
+
+}

Index: cvd_src/OSX/videosource_noqtbuffer.cc
===================================================================
RCS file: cvd_src/OSX/videosource_noqtbuffer.cc
diff -N cvd_src/OSX/videosource_noqtbuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/OSX/videosource_noqtbuffer.cc       26 Oct 2009 15:44:58 -0000      
1.1
@@ -0,0 +1,14 @@
+#include <cvd/videosource.h>
+#include <cvd/OSX/qtbuffer.h>
+namespace CVD{
+
+       template <> VideoBuffer<vuy422> * makeQTBuffer( const ImageRef & size, 
int input, bool showsettings)
+       {
+               throw VideoSourceException("QTBuffer is not compiled in to 
libcvd.");
+       }
+
+       template <> VideoBuffer<yuv422> * makeQTBuffer( const ImageRef & size, 
int input, bool showsettings)
+       {
+               throw VideoSourceException("QTBuffer is not compiled in to 
libcvd.");
+       }
+}

Index: cvd_src/OSX/videosource_qtbuffer.cc
===================================================================
RCS file: cvd_src/OSX/videosource_qtbuffer.cc
diff -N cvd_src/OSX/videosource_qtbuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cvd_src/OSX/videosource_qtbuffer.cc 26 Oct 2009 15:44:58 -0000      1.1
@@ -0,0 +1,14 @@
+#include <cvd/videosource.h>
+#include <cvd/OSX/qtbuffer.h>
+namespace CVD{
+
+       template <> VideoBuffer<vuy422> * makeQTBuffer( const ImageRef & size, 
int input, bool showsettings)
+       {
+               return new CVD::QTBuffer<vuy422>(size, input, showsettings);
+       }
+
+       template <> VideoBuffer<yuv422> * makeQTBuffer( const ImageRef & size, 
int input, bool showsettings)
+       {
+               return new CVD::QTBuffer<yuv422>(size, input, showsettings);
+       }
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]