From: Bill Kendrick <nbs@so...> - 2006-11-02 20:19:47
I committed a simple 2x2 bilinear interpolation routine last night that
does a little smoothing to PNG stamps when you scale them up. (e.g., if the
original bitmap is kind of small, but you want to make it larger on the
canvas, before it would simply scale the pixels up, resulting in a blocky,
This can be disabled by setting "NO_BILINEAR" somewhere in the code.
(I need to add a Makefile option for this, still.) It uses a lot of
floats and mult/division, so can be very slow on slower machines, and
certainly cause intense lag on machines with no FPU (e.g., the Nokia 770).
Here's a before and after :)
The code was based on example code posted to "The Code Project"
website ('free source code and tutorials')...
ObLicense: Stuff on The Code Project site is covered as follows:
"All code that is available from our site must be available for use
without registration or licence fees and without time restrictions"
"If you post to CodeProject then you retain copyright of your
article and code. You also ... permit other developers to use the
sourcecode associated with your articles in their own applications as
long as they do not remove your copyright notices or try and take credit
for your work."
I have, of course, credited the author, and linked to the article
in (1) the C source file, near the code in question, (2) in the 'CHANGES.txt'
changelog record of the new feature, and (3) in the 'AUTHORS.txt' credits doc.
Should cover it, no? (If not, I'll yank it and we can try to find something
else. Most bilinear stuff I've seen is fairly complicated, and closely
attached to other graphics kits, not SDL.)