Re: How do I rotate a bitmap fast with high quality?
- From: hitxinyu <hitxinyu@xxxxxxxxx>
- Date: Fri, 21 Nov 2008 05:59:44 -0800 (PST)
On Nov 21, 9:32 pm, "[Jongware]" <so...@xxxxxxxxxxx> wrote:
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]
1. Get(Set) pixel;
Method 1: using a BitBlt to copy *a single pixel* from one image
to
another? Madness.
I have said that this just a demo to show bilinear interpolation.and I
also don't know the name of the method one
2.incremental? how to do it in detail?
3.this method may be using in a device with no hardware implement of
the floating point calculations
4.waite later, I will show another implement for bilinear
interpolation.
it will be complex for some reason.
.
- 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?
- 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
- Re: How do I rotate a bitmap fast with high quality?
- From: [Jongware]
- How do I rotate a bitmap fast with high quality?
- Prev by Date: Re: searching for best dithering algorithms(rrom 16-bit bitmap to 24-bit bitmap)
- Next by Date: Re: How do I rotate a bitmap fast with high quality?
- 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
|