Symbolic constants for the special effect fx in function bx_draw_image_fx(). Each bit of an opaque pixel of the image (noted A) is combined with the corresponding bit of the underlying pixel of the canvas (noted B) via a boolean function F(A,B). The 4 entries of the truth table (F(0,0),F(0,1),F(1,0),F(1,1)) of this function F correspond to the binary representation (fx3,fx2,fx1,fx0) of the integer fx. For example, if fx=7, then fx is written (0,1,1,1) in binary, which means F(0,0)=0 and F(A,B)=1 in any other case, that is, F(A,B)= A AND B. This produces a "burn" effect: the bits of the image and the canvas combine into a bitwise AND to produce darker pixels. Similarily, if fx=1, then fx is written (0,0,0,1) in binary, which means F(1,1)=0 and F(A,B)=0 in any other case, that is, F(A,B)= A OR B. This produces a "glow" effect: the bits of the image and the canvas combine into a bitwise OR to produce lighter pixels. This is naturally true in TrueColor, and this is also true in PseudoColor (where pixels are indexes in a palette of 256 entries) because bx-lib arranges the colors of a 6*6*6 RGB cube in this palette at indexes in such a way that bitwise operations on these indexes have the desired effect (that is, an index and its bitwise negation hold colors whose RGB triplets are bitwise negations of each other). List of special effects:
|