The Allegro Wiki is migrating to github at

Alpha channel

From Allegro Wiki
Revision as of 13:41, February 15, 2008 by CGamesPlay (talk | contribs) (vfd)
Jump to: navigation, search

This article has been proposed for deletion.

  • Reason: Not really a useful article in current form, and I don't think that this is in the scope of the Allegro Wiki. An article on translucent drawing would be more appropriate.
  • Marked by: CGamesPlay 13:41, February 15, 2008 (UTC)

This article may be removed if the voting approves the decision. To discuss the deletion of this page, use Talk:Alpha channel.

Bitmaps are represented as an array of pixels, representing colors. I Allegro, each color consists of 3 to 4 channels (or a palette entry pointing to a actual color). Channels are red, green, blue and optional alpha. While the aim of the first 3 channels is clearly defined, programmers are allowed to interpret alpha channel whatever they like. There is no strict rule saying what it does. It can even be ignored.

Alpha in color blending

A common use of a alpha channel in color blending is the indicator of pixel transparency. In allegro, a value of 0 indicates fully transparent (invisible) pixel and a value of 255 a fully opaque pixel. The interpolation is linear so a value of 127 indicates semitransparent pixel. Function that interprets alpha channel in such way is draw_trans_sprite() when set_alpha_blender() is called.