enum bx_effect

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:

  • 0: (0000) BX_ZERO, results in an all-black shape (black shadow),
  • 1: (0001) BX_A_AND_B, a "burn" effect, image and canvas combine to produce darker pixels,
  • 2: (0010) BX_A_AND_NOT_B,
  • 3: (0011) BX_A, same as without special effect,

  • 4: (0100) BX_NOT_A_AND_B,
  • 5: (0101) BX_B, nothing happens, the canvas is copied over itself,
  • 6: (0110) BX_A_XOR_B, the "mouse selection" or "text cursor" effect,
  • 7: (0111) BX_A_OR_B, a "glow" effect, image and canvas combine to produce lighter pixels,

  • 8: (1000) BX_A_NOR_B, the video-inversion of the "glow" effect,
  • 9: (1001) BX_A_EQV_B, the video-inversion of the "mouse selection" or "text cursor" effect,
  • 10: (1010) BX_NOT_B, video-inversion of the canvas restricted to the shape of the image,
  • 11: (1011) BX_A_OR_NOT_B,

  • 12: (1100) BX_NOT_A, video-inversion of the image,
  • 13: (1101) BX_NOT_A_OR_B,
  • 14: (1110) BX_A_NAND_B, the video-inversion of the "burn" effect,
  • 15: (1111) BX_ONE, results in an all-white shape (white shadow).


Generated on Fri Oct 10 00:01:00 2008 for bx-lib : the Basic X11 Library tuned for C beginners by  doxygen 1.5.6