68 svs_video = getVideoObject();
89 if (!ppImages || !ppImages[0] || !ppImages[1] ||
90 ppImages[0]->width != width || ppImages[0]->height != height ||
91 ppImages[1]->width != width || ppImages[1]->height != height )
103 svsStereoImage *svs_image = svs_video->GetImage(10);
110 unsigned int *dstL = (
unsigned int *) ppImages[0]->pixels;
111 unsigned int *dstR = (
unsigned int *) ppImages[1]->pixels;
114 unsigned int *srcL = (
unsigned int *) svs_image->color;
115 unsigned int *srcR = (
unsigned int *) svs_image->color_right;
118 int max = width * height / 4;
123 *dstL++ = (srcL[0] & 0x00FFFFFF) | (srcL[1] & 0x000000FF) << 24;
124 *dstL++ = (srcL[1] & 0x00FFFF00) >> 8 | (srcL[2] & 0x0000FFFF) << 16;
125 *dstL++ = (srcL[2] & 0x00FF0000) >> 16 | (srcL[3] & 0x00FFFFFF) << 8;
128 *dstR++ = (srcR[0] & 0x00FFFFFF) | (srcR[1] & 0x000000FF) << 24;
129 *dstR++ = (srcR[1] & 0x00FFFF00) >> 8 | (srcR[2] & 0x0000FFFF) << 16;
130 *dstR++ = (srcR[2] & 0x00FF0000) >> 16 | (srcR[3] & 0x00FFFFFF) << 8;
139 memcpy(ppImages[1]->pixels, svs_image->left, width * height * m_nBytesPerPixel);
140 memcpy(ppImages[0]->pixels, svs_image->right, width * height * m_nBytesPerPixel);
160 int maxSizeFactor = 0;
187 m_nBytesPerPixel = 3;
190 if (!svs_video->Open(m_nIndex))
194 svs_video->SetSize(320, 240);
195 svs_video->SetSample(2, 2);
197 if (svs_video->Start())
207 svsImageParams *ip = 0;
213 svs_video->SetSize(320, 240);
214 svs_video->SetFrameDiv(1);
215 svs_video->SetSample(1, 4 / maxSizeFactor);
220 svs_video->SetSize(320, 240);
221 svs_video->SetFrameDiv(1);
222 svs_video->SetSample(2/maxSizeFactor, 2);
227 svs_video->SetSize(320, 240);
228 svs_video->SetFrameDiv(1);
229 svs_video->SetSample(4 / (maxSizeFactor * maxSizeFactor), maxSizeFactor);
234 svs_video->SetSize(640, 480);
235 svs_video->SetFrameDiv(1);
236 svs_video->SetSample(1, 2 / maxSizeFactor);
241 svs_video->SetSize(640, 480);
242 svs_video->SetFrameDiv(1);
243 svs_video->SetSample(2 / maxSizeFactor, 1);
248 svs_video->SetSize(1280, 960);
249 svs_video->SetFrameDiv(1);
250 svs_video->SetSample(1, 1);
258 svs_video->SetBalance(
false, 20, 10);
259 svs_video->SetColor(
true,
true);
260 svs_video->SetRect(
false);
261 svs_video->exposure = 100;
262 svs_video->gain = 30;
263 svs_video->SetRate(30);
264 svs_video->SetDigitization();
267 if (!svs_video->Start())
278 if (val < -40 || val > 40)
281 svs_video->red = val;
282 svs_video->SetDigitization();
287 if (val < -40 || val > 40)
290 svs_video->blue = val;
291 svs_video->SetDigitization();
296 if (val < 0 || val > 100)
299 svs_video->exposure = val;
300 svs_video->SetDigitization();
305 if (val < 0 || val > 100)
308 svs_video->gain = val;
309 svs_video->SetDigitization();
314 svs_video->SetColor(bColor, bColor);
315 svs_video->SetDigitization();
319 m_nBytesPerPixel = 3;
323 m_nBytesPerPixel = 1;
331 svs_video->SetRect(bRectify);
332 svs_video->SetDigitization();
CSVSCapture(VideoMode, int nIndex=0)
bool CaptureImage(CByteImage **ppImages)
void SetExposure(int val)
void SetRectify(bool bRectify)
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
void SetColor(bool bColor)