[SDL] Re: SDL_Image export image capability?
damian_rajkowski at technologyonecorp.com
Tue Jan 18 14:25:18 PST 2005
Bill Kendrick <nbs <at> sonic.net> writes:
> > Are there any plans to enhance SDL_Image to save images to disk?
> Probably not in SDL_Image, because it would add a bloat
> (small amount, at least), that most people wouldn't take advantage of.
I don't see why not. The neccessary libraries (libjpeg/libpng) are already used
by SDL_Image to load those formats, and the actual saving routine (using
libpng) is fairly short.
Besides, there's plenty of stuff in all the SDL libraries that i don't use, but
you take it all if you want a part.
> > It would be really useful if it could save PNG (and possibly JPEG
> > and BMP, but mostly PNG) from a surface or specified memory location
> > or something like that.
> I wrote a function in Tux Paint to export to PNG, using the libPNG functions.
> It wasn't very hard, I just followed the libPNG instructions. ;)
Same here. It wasn't that hard, although i haven't fully got it working yet - i
think the problem is the format i'm reading the SDL_Surface information in.
Its just that it would be clear, more portable and undoubtably more efficient
if it were a part of the library rather than a hack by the user.
(Please Sam, make my day! Add png writing. You know you want to! ;) )
More information about the SDL