Resize image in SDL_Surface

Can I resize an image loaded in a SDL_Surface?
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030123/ef4aaa3a/attachment.pgp

The basic SDL API can’t do it; it just loads, converts, and blits
surfaces. There is an add-on library for SDL that can, however. :slight_smile:

http://www.ferzkopp.net/Software/SDL_gfx-2.0/ includes image
stretching, among afew other things. Just be aware that rotozoom
doesn’t stretch the original image - it produces a new, stretched image
in memory that’ll have to be freed once you’re done with it by
SDL_FreeSurface().

Riccardo wrote:> Can I resize an image loaded in a SDL_Surface?

Also be aware that it’s very low-quality; unacceptably low for some size
ratios and uses. (It’s written for speed, not quality.)

I’ve modified the RGBA zoom to do an actual 2:1 sample. It’s slower, but
looks better as long as the size ratio isn’t worse than 2:1 or 1:2.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/checkout/stepmania/stepmania/src/SDL_rotozoom.cpp?rev=1.10

I still need to add options to handle clamp vs. wrap filtering.

I’m still hoping someone’s written a triangle filter resize …On Thu, Jan 23, 2003 at 01:10:51PM -0600, Corona688 wrote:

The basic SDL API can’t do it; it just loads, converts, and blits
surfaces. There is an add-on library for SDL that can, however. :slight_smile:

http://www.ferzkopp.net/Software/SDL_gfx-2.0/ includes image
stretching, among afew other things. Just be aware that rotozoom
doesn’t stretch the original image - it produces a new, stretched image
in memory that’ll have to be freed once you’re done with it by
SDL_FreeSurface().


Glenn Maynard

Dnia 2003.01.23 20:10 Corona688 napisa?(a):

The basic SDL API can’t do it; it just loads, converts, and blits
surfaces. There is an add-on library for SDL that can, however. :slight_smile:

http://www.ferzkopp.net/Software/SDL_gfx-2.0/ includes image
stretching, among afew other things. Just be aware that rotozoom
doesn’t stretch the original image - it produces a new, stretched
image
in memory that’ll have to be freed once you’re done with it by
SDL_FreeSurface().

Riccardo wrote:

Can I resize an image loaded in a SDL_Surface?

Ok.
Maybe I’m boring with that I say but I make little speedup of this zoom
code from SDL_gfx-2.0.
AA Zoom is make in the same pixel coding that source ( support to
8,15/16, 24 ,32 bit ) not only in 32bits , and work faster :slight_smile:

current freeciv cvs … freeciv/client/gui-sdl/gui_zoom.c

Rafal----------------------------------------------------------------------
Rajd MONTE CARLO >>> http://link.interia.pl/f16c1
Najswiezsze doniesienia, zapowiedzi, relacje, galerie zdjec, atrakcje!

Message: 6Date: Thu, 23 Jan 2003 14:24:17 -0500
From: Glenn Maynard <g_sdl at zewt.org>
To: sdl at libsdl.org
Subject: Re: [SDL] Resize image in SDL_Surface
Reply-To: sdl at libsdl.org

On Thu, Jan 23, 2003 at 01:10:51PM -0600, Corona688 wrote:
> The basic SDL API can't do it;  it just loads, converts, and blits
> surfaces.  There *is* an add-on library for SDL that can, however.  :)
> 
> http://www.ferzkopp.net/Software/SDL_gfx-2.0/  includes image
> stretching, among afew other things.  Just be aware that rotozoom
> doesn't stretch the original image - it produces a new, stretched image
> in memory that'll have to be freed once you're done with it by
> SDL_FreeSurface().

Also be aware that it's very low-quality; unacceptably low for some size
ratios and uses.  (It's written for speed, not quality.)

I've modified the RGBA zoom to do an actual 2:1 sample.  It's slower, but
looks better as long as the size ratio isn't worse than 2:1 or 1:2.

Slower?
I must resize one text image, a pair of times for all the program
I think that will work well.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/stepmania/stepmania/src/SDL_rotozoom.cpp?rev=1.10

I still need to add options to handle clamp vs. wrap filtering.

I'm still hoping someone's written a triangle filter resize ...

-- 
Glenn Maynard

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030123/f54c352c/attachment.pgp