My dither pt. 2

Howdy,

Can’t help but flap my yap again. I updated the dither code, so now it
works correctly. There’s still room for improvement, and the quality
will never get to the level of generating first and dithering second, but
it still has it’s benefits (hopefully more than bragging rights, I think
it could be faster and less memory intensive).

Any and all feedback is welcome.

=Pete
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: gradient.c
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030316/1b0f1614/attachment-0007.asc

Can’t help but flap my yap again. I updated the dither code, so now it
works correctly. There’s still room for improvement, and the quality
will never get to the level of generating first and dithering second, but
it still has it’s benefits (hopefully more than bragging rights, I think
it could be faster and less memory intensive).

Any and all feedback is welcome.

Well, it’s probably not the feedback you wanted but well… I think your
posts are pretty much off-topic. Even though your code seems to be well
done and all, it’s not that SDL specific and I’m not sure many people
need it. And by the way, I don’t understand why you are talking about
dithering while what you do (I only skimmed through your code, so I’m
not sure) seems to be a vertical gradient…

-Ga?tan.On Sun, 2003-03-16 at 21:59, Peter wrote:

Well, it’s probably not the feedback you wanted but well… I think your

Au contraire, I said “any and all” and I meant it.

posts are pretty much off-topic. Even though your code seems to be well
done and all, it’s not that SDL specific and I’m not sure many people
need it.

I’m working on a series of tutorials that teach useful
graphics techniques with SDL. I’m a novice programmer,
so I thought it prudent to consult the list of Wise Elders
before teaching my methods.

And by the way, I don’t understand why you are talking about
dithering while what you do (I only skimmed through your code, so I’m
not sure) seems to be a vertical gradient…

It is a vertical gradient, but it’s in hicolor mode.
Dithering is necessary to prevent the appearance
of gaudy looking bars. The traditional approach
would be to render the gradient to a 32bit surface,
then dither and transfer it to a 16bit surface. The
method in the code I attached dithers the gradient
while it is being generated, saving you a surface.

Peace,
=Pete