* Introduced PaletteConverter::IndexForRGBA32() which checks if the alpha

component of a 32 bit color is below 128 and returns the special CMAP8 index
   for indicating transparency.
 * Changed the WriteCMAP() color conversion function to expext a 32bit RGBA
   value and use IndexForRGBA32().
 * Adapted B_CMAP8 target color space case of ConvertBits() to the new
   semantics.

This allows transparency in bitmaps when converting B_RGBA32 bitmaps to
B_CMAP8, tested only for this case and working as expected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36549 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2010-04-30 11:29:14 +00:00
parent 8cd3dac13e
commit 59d0c2e45e
2 changed files with 24 additions and 6 deletions
@@ -38,6 +38,7 @@ public:
inline uint8 IndexForRGB16(uint8 red, uint8 green, uint8 blue) const;
inline uint8 IndexForRGB24(uint32 rgb) const;
inline uint8 IndexForRGB24(uint8 red, uint8 green, uint8 blue) const;
inline uint8 IndexForRGBA32(uint32 rgba) const;
inline uint8 IndexForGray(uint8 gray) const;
inline const rgb_color &RGBColorForIndex(uint8 index) const;