RE: adding noise to an image
- From: "Foster, Gareth" <gareth foster siemens com>
- To: Paul Davis <pjdavis engineering uiowa edu>
- Cc: gtkmm-list gnome org
- Subject: RE: adding noise to an image
- Date: Wed, 19 Oct 2005 11:21:13 +0100
> > uint8 * p_buf = get_buf_blah_pseudo();
> > uint8 by_val = rand()%std::numeric_limits<uint8>::max_val;
> > std::fill(p_buf, p_buf + 3, by_val);
> >
[ snip ]
> If I'm not mistaken, that would create an image of one pixel value.
>
I meant ...
// up front ...
uint8 * p_buf = get_buf_blah_pseudo();
// ... then later, per pixel ...
uint8 by_val = rand()%std::numeric_limits<uint8>::max_val;
std::fill(p_buf, p_buf + 3, by_val);
It was just meant to illustrate the statement about settings rgb to the same
values.
Nice tip on the 'randomness' btw, cheers.
Gaz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]