Re: How do I rotate a bitmap fast with high quality?
- From: "[Jongware]" <sorry@xxxxxxxxxxx>
- Date: Fri, 21 Nov 2008 14:32:23 +0100
hitxinyu wrote:
the following Demo method is know as this:
// method one is faster,but has a low quality.
// method two has a high quality, but It's too slow for me.
though,I could change double type to float type,
and change float to int using fixed point algorithm.
I want to know a new algorithm, with high quality and faster speed.
void CTestBmpRotateView::RotateAnyAngle(HDC dcSrc,int SrcWidth,int
SrcHeight,double angle,HDC hDC)
[snip heavy example, straight out of starters' manual]
Both methods use Windows functions, either BitBlt or GetPixel/PutPixel. Using your own buffer is msot likely faster than anything Windows can do.
Method 1: using a BitBlt to copy *a single pixel* from one image to another? Madness.
Method 2: this samples the pixels at the source image around the transformed (rotated) point and recalculates the target in RGB. Not bad, but using Windows' read/write methods, extremely slow. I did this in plain C, in true color, in real time, a decade ago.
>though,I could change double type to float type,
>and change float to int using fixed point algorithm.
About that same time, I learned that everything I knew about converting floats to fixed point was useless because the floating point calculations were made vastly faster. Currently, the same goes for converting doubles to floats -- the "native" format of FPUs is now double, and converting to /floats/ may take time.
To improve on /this/ algorithm, you should not concentrate on making it do its dumb stuff faster. Instead, re-write the routine to use incremental updating of its variables.
[Jongware]
.
- Follow-Ups:
- Re: How do I rotate a bitmap fast with high quality?
- From: hitxinyu
- Re: How do I rotate a bitmap fast with high quality?
- References:
- How do I rotate a bitmap fast with high quality?
- From: hitxinyu
- How do I rotate a bitmap fast with high quality?
- Prev by Date: Re: How do I rotate a bitmap fast with high quality?
- Next by Date: Re: searching for best dithering algorithms(rrom 16-bit bitmap to 24-bit bitmap)
- Previous by thread: Re: How do I rotate a bitmap fast with high quality?
- Next by thread: Re: How do I rotate a bitmap fast with high quality?
- Index(es):
Relevant Pages
|