* V4L2 capture example, gray color
@ 2010-10-27 15:30 Alex Ivasyuv
0 siblings, 0 replies; only message in thread
From: Alex Ivasyuv @ 2010-10-27 15:30 UTC (permalink / raw)
To: video4linux-list
Hi,
I've tried to use sample code example from
http://v4l2spec.bytesex.org/spec/capture-example.html
and save frame data to image, and found, that images are *gray* instead
of color.
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
int i = 0;
.....
static void process_image(const void * p) {
++i;
fputc('.', stdout);
fflush(stdout);
std::stringstream out;
out << "capt-" << i << ".raw";
ofstream outfile(out.str().c_str(), ofstream::binary);
outfile.write((const char*) p, buffers[0].length);
outfile.close();
}
....
Raw images I converted with "raw2tiff" application.
lspci: http://pastebin.com/raw.php?i=VVL8m2Gu
my code: http://pastebin.com/R3j3LL96
What' wrong with my code? Why I get in gray, instead of color?
Thanks,
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-10-27 15:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 15:30 V4L2 capture example, gray color Alex Ivasyuv
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.