[Q] Exact WarpBlt (etc.) transformation to 1/3 width?

Henrik Gedenryd Henrik.Gedenryd at lucs.lu.se
Tue Jan 4 21:37:43 UTC 2000


Thanks for your responses; speed is now at some 700x without compiling! Next
would be a new BitBlt transfer mode...

Dan Ingalls wrote:

> I spent quite a while getting this right for the scaling and rotation
> operations in class Form.  This required care in choosing the source
> quadrilateral points, but I believe they are bit-perfect now.  Did you try
> those routines exactly as presented?

Yes, I tried them, and it seemed to work. However, as absence of proof isn't
proof of absence (of misalignment)... It does work as advertised.

Another question: Is there a reason why the BitBlt mode #addRgb adds the
three color components, but always leaves alpha at 0 (transparent)? The sum
of the alphas (or perhaps always fully opaque) would seem more logical.

Andreas Raab wrote:

> You need to use 4x1 -> 1x1 transformation of the form AaaaRrrrGgggBbbb
> because otherwise the resulting pixel word will not fill the entire 32bit
> depth range.works since R, G and B levels are equal, since:

Thanks for your advice. You are answering something other than my actual
question, but the 32-as-8 bit depth was a neat idea indeed.

What you suggest isn't possible, however, since there are no LCD picture
elements for the Alpha component ;-) so this would distort the image. One
might do some really advanced surgery to insert alphas between every three
pixels just before the final step -- but I don't think it would end up being
faster...

However, luckily I didn't realize this at first, so I tried to do it. When
it failed I realized that since the source contains grays where r=g=b, you
can do it anyway with 3x1!! If you take every third byte, you get:

ArgB arGb aRgb ArgB -> ABGR ABGR etc. instead of ARGB ARGB ..., but since
B=G=R for each of these, BGR is equivalent to if RGB were extracted instead!
Note how ArgB picks both alpha and the first color component from the first
of every three pixels! Incredible coincidence, or?? A neat trick, still.


And Andreas, btw, regarding using PostScript (cubic) font outlines, you
wrote that they would be slow to convert to squared ones. But you only do
this once, ie. on import, right? So is there any other problem?

Henrik

< = > .






More information about the Squeak-dev mailing list