[vlc-devel] commit: Request RGBA when you want that (and not RV32). (Laurent Aimar )

git version control git at videolan.org
Thu Aug 28 23:48:01 CEST 2008


vlc | branch: 0.9-bugfix | Laurent Aimar <fenrir at videolan.org> | Wed Aug 27 22:36:25 2008 +0200| [c7503bb1bb9d7d46cd34fd197ddf730aa807258b] | committer: Christophe Mutricy 

Request RGBA when you want that (and not RV32).

This fixes the skin loading. The color seems wrong but I think the skin
code is right (vlc RGBA is stored in memory R, B, G, A).
(cherry picked from commit 9818e276ccea91fe0190791e281d713fac4fe2f2)

Signed-off-by: Christophe Mutricy <xtophe at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c7503bb1bb9d7d46cd34fd197ddf730aa807258b
---

 modules/gui/skins2/src/file_bitmap.cpp |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/modules/gui/skins2/src/file_bitmap.cpp b/modules/gui/skins2/src/file_bitmap.cpp
index e46a61c..1724b49 100644
--- a/modules/gui/skins2/src/file_bitmap.cpp
+++ b/modules/gui/skins2/src/file_bitmap.cpp
@@ -39,7 +39,7 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
     video_format_t fmt_in = {0}, fmt_out = {0};
     picture_t *pPic;
 
-    fmt_out.i_chroma = VLC_FOURCC('R','V','3','2');
+    fmt_out.i_chroma = VLC_FOURCC('R','G','B','A');
 
     pPic = image_ReadUrl( pImageHandler, fileName.c_str(), &fmt_in, &fmt_out );
     if( !pPic ) return;
@@ -55,13 +55,14 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
     {
         for( int x = 0; x < m_width; x++ )
         {
-            uint32_t b = *(pSrc++);
-            uint32_t g = *(pSrc++);
-            uint32_t r = *(pSrc++);
-            uint8_t a = *(pSrc++);
-            *(pData++) = (b * a) >> 8;
-            *(pData++) = (g * a) >> 8;
-            *(pData++) = (r * a) >> 8;
+            uint32_t r = *pSrc++;
+            uint32_t g = *pSrc++;
+            uint32_t b = *pSrc++;
+            uint8_t  a = *pSrc++;
+
+            *(pData++) = b * a / 255;
+            *(pData++) = g * a / 255;
+            *(pData++) = r * a / 255;
 
             // Transparent pixel ?
             if( aColor == (r<<16 | g<<8 | b) )




More information about the vlc-devel mailing list