Re: COMPOSITE VALUES

On 8/7/12, Rik Cabanier <cabanier@gmail.com> wrote:
> Thanks!
> Good to know that we chose the right path.
In more ways than one. The number and variety of blending modes can
now be infinite with no concern about the alpha. It results in a zero
confusion design that will produce lots of different effects. perfect
for bitmap editors and

I am going to implement the Microsoft style modes like SRCINVERT used
with BitBlt as blending modes.
For SRCINVERT blend function...
Cs.r = 255 - Cs.r
Cs.g = 255 - Cs.g
Cs.b = 255 - Cs.b

Then also I can now implement per channel blend...
For example:
Cs.r = 255 - Cs.r
Cs.g = 255 or Cs.g
Cs.b = 255 and Cs.b

In other words the blend mode property of my canvas will actually be
implemented as three blend modes, one for each channel.
Setting Canvas.BlendMode will set all three to the same
Setting Canvas.BlendModeR will set just the red for example

So if they are all the same then it works like in the new spec,
otherwise it still "works the same" just the the blending function
actually calls into three different isolated channel blending
functions.

Thanks a lot for your help. Your design/engineering choice of the
split is perfect.
>
> On Mon, Aug 6, 2012 at 2:35 PM, Bob Holmes <rangsynth@gmail.com> wrote:
>
>> Thanks. I get that now. I first learned from places like Skia and Agg 2.4
>> source where the alpha is included in the MULTIPLY for example, so I have
>> been reading all these different versions and implementations. It was
>> hard
>> for me to see this actually but it is definitely much better with the
>> split
>> blend and composite and the blender only doing RGB.
>>
>>
>> On Mon, Aug 6, 2012 at 11:08 PM, Rik Cabanier <cabanier@gmail.com> wrote:
>>
>>> alpha of the source is unaffected by the blending.
>>>
>>>
>>> On Mon, Aug 6, 2012 at 10:17 AM, Bob Holmes <rangsynth@gmail.com> wrote:
>>>
>>>> In case it still was not 100% clear...
>>>>
>>>> This is composite for DSTOVER IN NEW SPEC
>>>>
>>>> co = ás x Cs x (1 - áb) + áb x Cb
>>>> áo = ás x (1 - áb) + áb
>>>>
>>>> Specifically where does "ás" come from. Does it come from "Cs" as is
>>>> after the blending or before the blending? Because the result of the
>>>> blending is Cs and so is the input color to the blending etc...
>>>>
>>>> On 8/6/12, Bob Holmes <rangsynth@gmail.com> wrote:
>>>> > For example...
>>>> >
>>>> > XOR...
>>>> >
>>>> >     co = ás x Cs x (1 - áb) + áb x Cb x (1 - ás)
>>>> >
>>>> > Is "as" the alpha of the input source or the alpha of Cs after
>>>> > blending function.
>>>> >
>>>> > If the blending function is implemented to return premultiplied value
>>>> > the formula can then be...
>>>> >
>>>> >     co = cs x (1 - áb) + cb x (1 - ás)
>>>> >
>>>> > ?
>>>> >
>>>>
>>>
>>>
>>
>

Received on Tuesday, 7 August 2012 09:42:34 UTC