<br><br><div class="gmail_quote">2009/6/20 Juan Vuletich <span dir="ltr">&lt;<a href="mailto:juan@jvuletich.org">juan@jvuletich.org</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi Folks,<div class="im"><br>
<br>
Andreas Raab wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Igor Stasenko wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/6/20 Andreas Raab &lt;<a href="mailto:andreas.raab@gmx.de" target="_blank">andreas.raab@gmx.de</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Easy. Make a color map that is set up such that<br>
<br>
cmap := Bitmap new: 256.<br>
0 to: 255 do:[:i|<br>
 cmap at: i+1 put: (constColor alpha: i/255.0) pixelValue32.<br>
].<br>
</blockquote>
<br>
That is possible, but the price is generating a color map each time<br>
the color changes :(<br>
Much less price than converting/using 32 bpp, but still is not perfect :)<br>
</blockquote>
<br>
It&#39;s utterly trivial to cache it. If you&#39;re using this for font display you&#39;ll only have a few colors to deal with so the cache won&#39;t be big.<br>
</blockquote>
<br></div>
You can see how to do all this in Cuis. It is what I do for font rendering. Take a look at GrafPort &gt;&gt; installStrikeFont:foregroundColor: . This works ok with source forms of any depth. For 8 bpp (and lower), it is considered to hold opacity (i.e. 1-alpha). It is trivial to adjust the colormaps for alpha instead. Take a look at the execution path for &quot;(Preferences subPixelRenderFonts and: [ foregroundColor = Color black or: [ Preferences subPixelRenderColorFonts ]]) ifTrue: [&quot;. I use two passes of bitblt. The first one is rgbMul, the second is rgbAdd. Together they do the proper AA as you specified it. This only works for destForm of 16 or 32 bpp. On 8bpp or less destination, I just use paint rule.<br>

<br>
If you want to test it with a soureForm that includes only opecity, evaluate<br>
   StrikeFont allInstances do: [ :f | f<br>
       setGlyphsDepthAtMost: 4 ].<br>
<br>
You&#39;ll see that it works ok for any font color / background color combination.<br>
</blockquote><div><br>Thanks for reply, Juan.<br>Yes, i did the color mapping and using rule 24 to blit the 8-bit opacity maps.<br>But i&#39;m still unhappy with that: there is no reason for doing that , if rule 41 would work as expected :(<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Cheers,<br><font color="#888888">
Juan Vuletich<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Igor Stasenko AKA sig.<br>