On Sun, 15 Apr 2001, Christoph Egger wrote:
> Brian pointed me to the matrox mystique doc, which describes its
> stretching algorithm. Xavier Hienne sent me his code, he wrote some
> time and Andy gave me a good comment (accidently to the list :).

As this is meant only for scaling without any filtering, the behavior 
is well defined so comments boil down to efficiency, of which I have 
only a few off the top of my head:

>               GetPixel((int)(bob_idx) - bob_ystart, (int)bob_y, &color);

...if for some reason you are emulating a stretch operation across a 
bus, you will want to cache the GetPixel results so you do not generate
uneccessary bus traffic.

Secondly, it is likely that using *HLine operations will give a speed
increase over the *Pixel operations on any targets that use either
accel or direct FB access, by reducing function call overhead.  Going as 
far to use the *Box operations would require allocation of a 
lot more RAM than the *HLine operations and would probably not be worth 
it.  However, the read/write areas could be split into smaller boxes of
the correct width, but with the height varied to make the allocation a 
known quantity, and THAT might be worth doing.  (It would even be likely
that the library could "tune" the size of the buffer used either based
on user request or based on profiling.)

--
Brian

Reply via email to