[SDL] Re: scaling images
pete at visionart.com
Thu Jun 22 11:03:15 PDT 2000
> SDL_SoftStretch only seems to use nearest-neighbour interpolation, and
> I agree that it should be a parameter. I don't know what other methods
> of interpolation (besides that, bilinear, and bicubic) you had in mind.
i've found algorithms for some different filters. mainly i assume
they try to make tradoffs in quality for speed. i haven't tried
any of them yet, so i was planning on seeing what they offered.
> FOR ALL PEOPLE WHO WANT TO STRETCH IMAGES
> AND DO FORMAT CONVERSION PLEASE CHECKOUT
> MY STRETCHLIB ....
> PS: i am quite tired about that!
heh, sorry to hit a sore spot. your stretching looks good, and
maybe someone (not me, i'm too afraid to go that "lowlevel")
can implement that stretching as the default stretching for
the software video driver?
Sam Lantinga wrote:
> This function isn't exported because of the wide variety of issues
> surrounding stretching, such as hardware acceleration, filtering,
> and format conversion. If some people are interested in investigating
> all these issues to "do it right", I'll be happy to lend whatever
> assistance I can.
it seems there would be a need for another function pointer in
the graphics driver structure that would handle the hardware
scaling of images. what's scary is that different windows gfx
cards do different scaling. most are "nearest neighbor", but
the newer cards seem to do filtered scaling. i think i remember
some API commands to check what type of scaling the card will
do. under windows GDI there is a scaled blit operation, and
directx offers scaling as part of it's standard blitting tools.
i'm not sure what X & Mac have to offer, but there should be a
good middleground for all platforms?
being able to scale an individual surface and scale an image
during blit would both be handy!
i'm afraid i wouldn't be a lot of help getting this going.
i'm quite new to the SDL library, and this is all lower level
stuff. it would behoove everyone to get this right the first
i believe i'll still write my "filtered" scaling. if people
are interested i'll release it as a library, or try to get
it adopted into standard SDL
More information about the SDL