34 #include <VideoSource/VideoSource_Centaurus.hh>
35 #include <Base/Image/ImageIO.hh>
40 int main(
int argc,
char** argv)
45 image1.
Init(1920, 1080, 2, ImageBase::ST_unsignedchar);
49 image2.
Init(1920, 1080, 2, ImageBase::ST_unsignedchar);
53 char setup[] =
"PCI,card=0";
55 sv_handle* cam_handleP1_= NULL;
57 cam_handleP1_ = sv_open(&setup[0]);
61 if (cam_handleP1_==NULL) {
62 cout <<
"failed to open cam, camera handle = " << cam_handleP1_ << endl;
65 cout <<
"opened cam " << cam_handleP1_ << endl;
72 int mode = SV_MODE_COLOR_YUV422_YUYV
73 | SV_MODE_SMPTE274_25sF | SV_MODE_STORAGE_FRAME;
77 res = sv_jack_option_set(cam_handleP1_, 1, SV_OPTION_VIDEOMODE, mode);
79 BIASERR(sv_geterrortext(res) << endl);
81 res = sv_jack_option_set(cam_handleP1_, 1, SV_OPTION_IOMODE, SV_IOMODE_YUV422);
83 BIASERR(sv_geterrortext(res) << endl);
86 res = sv_option_set(cam_handleP1_,SV_OPTION_MULTICHANNEL,SV_MULTICHANNEL_INPUT);
88 BIASERR(sv_geterrortext(res) << endl);
94 res = sv_jack_option_set(cam_handleP1_, 3, SV_OPTION_VIDEOMODE, mode);
96 BIASERR(sv_geterrortext(res) << endl);
98 res = sv_jack_option_set(cam_handleP1_, 3, SV_OPTION_IOMODE, SV_IOMODE_YUV422);
100 BIASERR(sv_geterrortext(res) << endl);
121 sv_fifo* inputFifoP1_;
122 res = sv_fifo_init(cam_handleP1_, &inputFifoP1_,1, 0, 1,
123 SV_FIFO_FLAG_VIDEOONLY, 0);
125 BIASERR(sv_geterrortext(res) << endl);
129 sv_fifo* inputFifoP2_;
130 res = sv_fifo_init(cam_handleP1_, &inputFifoP2_,3, 0, 1,
131 SV_FIFO_FLAG_VIDEOONLY, 0);
133 BIASERR(sv_geterrortext(res) << endl);
138 res = sv_fifo_start(cam_handleP1_, inputFifoP1_);
140 BIASERR(sv_geterrortext(res) << endl);
143 res = sv_fifo_start(cam_handleP1_, inputFifoP2_);
145 BIASERR(sv_geterrortext(res) << endl);
149 flags |= SV_FIFO_FLAG_VSYNCWAIT;
150 flags |= SV_FIFO_FLAG_FLUSH;
154 sv_fifo_buffer* sv_buffer1;
155 res = sv_fifo_getbuffer(cam_handleP1_, inputFifoP1_, &sv_buffer1,
158 BIASERR(sv_geterrortext(res) << endl);
166 res = sv_fifo_putbuffer(cam_handleP1_, inputFifoP1_, sv_buffer1, NULL);
168 BIASERR(sv_geterrortext(res) << endl);
172 sv_fifo_buffer* sv_buffer2;
173 res = sv_fifo_getbuffer(cam_handleP1_, inputFifoP2_, &sv_buffer2,
176 BIASERR(sv_geterrortext(res) << endl);
184 res = sv_fifo_putbuffer(cam_handleP1_, inputFifoP2_, sv_buffer2, NULL);
186 BIASERR(sv_geterrortext(res) << endl);
200 ImageIO::Save(
"testGrab1.mip",image1);
201 cout <<
"saved testGrab1.mip" << endl;
203 ImageIO::Save(
"testGrab2.mip",image2);
204 cout <<
"saved testGrab2.mip" << endl;
206 res = sv_close(cam_handleP1_);
208 BIASERR(
"sv_close : " << sv_geterrortext(res) << endl);
void SetColorModel(EColorModel Model)
unsigned int GetWidth() const
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.
unsigned int GetHeight() const
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
const StorageType * GetImageData() const
overloaded GetImageData() from ImageBase