AVBlocks for C++  3.0
Audio and Video Software Development Kit
Loading...
Searching...
No Matches
primo::codecs::AlphaCompositingMode Namespace Reference

Defines the way a foreground image will be combined with background video. More...

Enumerations

enum  Enum {
  Over = 1 ,
  In = 2 ,
  Out = 3 ,
  Atop = 4 ,
  Xor = 5 ,
  Plus = 6
}
 

Detailed Description

Defines the way a foreground image will be combined with background video.

Enumeration Type Documentation

◆ Enum

enum Enum
Enumerator
Over 

Foreground over Background - in effect, normal painting operation.

Remarks
If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result:

Rrgb = (Fa * Frgb) + (1 - Fa ) * (Ba * Brgb)

Normally, alpha blending implies a background alpha of 1.0 (Ba = 1.0), so the compositing result Rrgb becomes:

Rrgb = (Fa * Frgb) + (1 - Fa) * Brgb

Fa and Ba are alpha density value with range from 0.0 to 1.0

In 

Foreground in Background - the alpha compositing equivalent of clipping / itersection.

Remarks
If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result:

Rrgb = (Fa * Frgb) * Ba

Fa and Ba are alpha density value with range from 0.0 to 1.0

Out 

Foreground outside Background.

Remarks
If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result:

Rrgb = (Fa * Frgb) * (1 - Ba)

Fa and Ba are alpha density value with range from 0.0 to 1.0

Atop 

Foreground atop Background.

Remarks
If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result:

Rrgb = (Fa * Frgb) * Ba + (1 - Fa) * (Ba * Brgb)

Fa and Ba are alpha density value with range from 0.0 to 1.0

Xor 

Foreground xor Background.

Remarks
If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result:

Rrgb = (Fa * Frgb) * (1 - Ba) + (1 - Fa) * (Ba * Brgb)

Fa and Ba are alpha density value with range from 0.0 to 1.0

Plus 

Foreground plus Background.

Remarks
If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result:

Rrgb = (Fa * Frgb) + (Ba * Brgb)

Fa and Ba are alpha density value with range from 0.0 to 1.0