From: Alex Ivasyuv <industral@gmail.com>
To: video4linux-list@redhat.com
Subject: V4L2 capture example, gray color
Date: Wed, 27 Oct 2010 18:30:30 +0300 [thread overview]
Message-ID: <4CC84596.2000704@gmail.com> (raw)
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
reply other threads:[~2010-10-27 15:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CC84596.2000704@gmail.com \
--to=industral@gmail.com \
--cc=video4linux-list@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.