2 # pragma warning (disable: 4251) // STL MAP DLL warning noise (JW)
5 #include "VideoSource_Stereo.hh"
7 #include <Image/Camera.hh>
35 string::size_type pos = mname.find(
':', 0);
36 if (pos == string::npos){
37 BIASERR(
"invalid name \""<<name<<
"\"");
41 string lname = mname.substr(0, pos);
42 string rname = mname.substr(pos+1, mname.size()-pos-1);
43 cout <<
"lname = \""<<lname<<
"\"\trname = \""<<rname<<
"\"\n";
44 int resl = Left_->OpenDevice(lname.c_str());
45 int resr = Right_->OpenDevice(rname.c_str());
46 return (resl==0 && resr==0)?0:-1;
53 BIASERR(
"use OpenDevice(char *)");
61 int resl = Left_->PreGrab();
62 int resr = Right_->PreGrab();
63 return (resl==0 && resr==0)?0:-1;
69 int resl = Left_->GrabSingle(LeftIm_);
70 int resr = Right_->GrabSingle(RightIm_);
72 return (resl==0 && resr==0)?0:-1;
78 int resl = Left_->PostGrab();
79 int resr = Right_->PostGrab();
80 return (resl==0 && resr==0)?0:-1;
86 Left_->SetSize(w, h, bytesperpixel);
87 Right_->SetSize(w, h, bytesperpixel);
93 int resl = Left_->CloseDevice();
94 int resr = Right_->CloseDevice();
95 return (resl==0 && resr==0)?0:-1;
102 Left_->InitImage(LeftIm_);
103 Right_->InitImage(RightIm_);
104 return Left_->InitImage(img);
virtual int OpenDevice()
selects the first available device to open (e.g.
Defines a common interface to different devices.
VideoSource_Stereo & operator=(const VideoSource_Stereo &source)
prohibit default function (move to 'public' if needed)
virtual int InitImage(ImageBase &img)
bundles two video sources for stereo
virtual int PostGrab()
Stop anything started in PreGrab()
virtual int CloseDevice()
virtual int GrabSingle(Camera< unsigned char > &image)
Returns the left image and captures the right image from the camera.
VideoSource_Stereo()
prohibit default function (move to 'public' if needed)
virtual void SetSize(int w, int h, int bytesperpixel)
Set image size and number of bytes per pixel (e.g.
This is the base class for images in BIAS.
virtual int PreGrab()
Do last preparations before grabbing (e.g. start ISO transfer)
virtual ~VideoSource_Stereo()