[Cuis-dev] Transparent Form ?

Juan Vuletich juan at jvuletich.org
Mon Jun 1 05:28:43 PDT 2020


Hi Hilaire,

As you saw, this problem is not related to VectorGraphics. BitBlt with 
alpha blending to translucent targets is also broken. For each pixel, it 
should divide the r, g, b values of the result by the alpha. That is 
exactly what I just fixed in the VectorGraphics engine. Fixing this in 
the BitBlt plugin is harder and unlikely, because it would change the 
behavior of existing code, perhaps in unexpected ways. So, the attach. 
It fixes the result of #imageForm:, in Smalltalk. It will have a 
performance impact. Fortunately, #imageForm: is usually called only to 
cache stuff, so a bit of performance loss will not be a problem.

Please try it.

Thanks,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich


On 5/30/2020 3:06 PM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi Juan,
>
> When I ask a form to my circular toolbar morph with the imageForm: 
> message, the colors are a bit different in the returned form.
>
> The toolbar is build from chevron morphs. Those ones cache the 
> vectorgraphic drawing in forms, then the central part is just a normal 
> circle with alpha (not vector graphics).
>
> See bellow, at the left the morph and the right the image form. The 
> colors are a bit different:
>
>
> I think this is the alpha that got it wrong, see this simple test:
>
> (RectangleLikeMorph new color: (Color orange alpha: 0.5); imageForm: 
> 32) display
>
>
> Thanks
>
> Hilaire
>
>
>
> Le 24/05/2020 à 22:55, Juan Vuletich a écrit :
>> Please try the attaches. SVG now includes #examplesClinton, that 
>> shows another use case for correctly blending to translucent target.
>>
>> This just came out from the oven. Haven't yet reviewed it carefully. 
>> But it seems to work, so please try it.
>>
>> Cheers,
> -- 
> GNU Dr. Geo
> http://drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200601/e07bf758/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 49893 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200601/e07bf758/attachment-0001.jpe>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4196-translucent-imageForm-fix-JuanVuletich-2020Jun01-09h25m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200601/e07bf758/attachment-0001.ksh>


More information about the Cuis-dev mailing list