The following is a C++ wrapper for a library, that does high-quality image scaling.
To use it, just add the gbas file to your project. The C++ lib is linked by REQUIRE.
Here's how to use it as a STRETCHSPRITE substitute:
FUNCTION HQStretchSprite: id%, x%, y%, w%, h%
LOCAL s2% = GENSPRITE()
ReSampler(id, s2, w,h)
DRAWSPRITE s2, x,y
GRABSPRITE s2, 0,0,0,0
ENDFUNCTION
Warning - the above does not work (yet), if you're currently on an offscreen (USESCREEN x).
It's cool and very useful, thanks Gernot :good:
I noticed that ReSampler source is no longer downloadable.
I would like to make available the optimized version that I modified and that avoids the transition from BGRA to RGBA and vice versa (for compatibility with the GLB standard) which makes it slow, but I don't know if I can share it.
Gernot are there problems to do it?
Ciao
I just tried to download the original as a test Qedo, seems to be working for me?
sorry bigsofty I did not understand but yours is a question or a statement?
Can you download the original source?
because if you can, I have a problem
My bad, I just tested the if the download was working. It did download(on my IPad), not sure if it contains the source though, my dumb Ipad can't open zips.
The great Resampler (thank Kitty Hello) is quite slow due to the different internal graphic format used between GLB and Resampler.
I raised the bottleneck of the transformation from the RGBA (GLB) to BGRA (Resampler) format and vice versa.
Now it's a little faster.
The modified files are ReSamplerF.gbas and resamplerF_wrapper.cpp where commented I left the old instructions
Furthermore it seems to me that the resampler.cpp code would also have to be optimized, but this is another matter and of greater complexity. We will see in the future.
Let me know, if you want, your feedback.
Ciao