[vox-tech] Success with fltk and SDL_image

Bill Kendrick vox-tech@lists.lugod.org
Tue, 11 May 2004 17:26:26 -0700


On Tue, May 11, 2004 at 05:11:25PM -0700, Jan W wrote:
> Hi all:
> 
> Just a question:
> 
> Has anyone used SDL_image to do scaling and rotation?  If so, is there anything
> that I could use to do basic image manipulations?  I am looking for code
> examples/basic theories so that I can start off down a (more or less)
> reasonable path...

SDL_image itself doesn't do scaling and rotation.  Just loading. :^)


<snip>
> Now, SDL does the work for me, and just leaves me with a surface... awesome.
> 
> So if anyone has any hints/tips/tricks/caveats on SDL surface manipulation,
> I would love any tidbits that might float my way...  and if anyone is
> interested in seeing my code (yea, I have the coding style of an 8 year old),
> just don't laugh when you do.... (write me off list and I'll send a copy)

Hehe :^)

Look into "setpixel()" and "getpixel()", a coupla chunks of demo code that
are floating around SDL's docs or FAQ...

That'll get you at the raw bits of a surface (regardless of its depth)
and then you can manipulate them all you want.

90-degree rotation is pretty trivial.  When you start doing zoom-in our -out,
it gets trickier, but it really ends up being only as complicated as you make
it (e.g., do you do interpolation, averaging, or just skip pixels?)


Hint: See Tux Paint ;)

  http://www.newbreedsoftware.com/tuxpaint/download/source/

-bill!