[Cin] User Defined Blend Algebra

Georgy Salnikov sge at nmr.nioch.nsc.ru
Fri Feb 14 18:25:19 CET 2025


On Thu, 13 Feb 2025, Andrea paz wrote:

> Tomorrow I'm going to do some testing, including the change you
> suggested: \u201cOK, but now you can take the arith_subtract function,
> change the expression for alpha to something like A_OUT = A(s); or
> even A_OUT = 1;, and you'll get green\u201d

Andrea, I have found, the standard Overlay effect seems not to make
arithmetic with emulated transparencies if the project has no alpha channel.
Therefore I made a small correction: now the fact of having alpha (== 1) or
not having alpha (== 0) is also given to user functions as an additional
parameter HAS_ALPHA.

The patch to CGG source, cgg-blend-noalpha.diff.gz, is in attachment.

5 BlendAlgebra functions have to be changed due to this modification. For
CGG distribution, they are in that patch. For the 'ovl2' example the updated
functions are in the archive ovl2-upd.tar.gz, also in attachment.

And yes, arith_subtract without alpha became green:)

All the other functions are not affected by the modifications, either they
do not use alpha at all, or the arithmetic on it constantly gives 1.0
anyway.
_______________________________________________________________________________

Georgy Salnikov
NMR Group
Novosibirsk Institute of Organic Chemistry
Lavrentjeva, 9, 630090 Novosibirsk, Russia
Phone   +7-383-3307864
Email   sge at nmr.nioch.nsc.ru
_______________________________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cgg-blend-noalpha.diff.gz
Type: application/octet-stream
Size: 3098 bytes
Desc: 
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20250215/15b502e6/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ovl2-upd.tar.gz
Type: application/octet-stream
Size: 678 bytes
Desc: 
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20250215/15b502e6/attachment-0001.obj>


More information about the Cin mailing list