]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/file_bitmap.cpp
Message deactivation in Interface due to new API. Not functionnal change but compiles.
[vlc] / modules / gui / skins2 / src / file_bitmap.cpp
index b41a79650fc8e90754fc31ad4e1e8f931a11c684..1724b49844ff19b00cf25b3ee242c09c8c86dd68 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include "vlc_image.h"
 #include "file_bitmap.hpp"
 
@@ -35,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;
@@ -51,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) )
@@ -73,7 +78,7 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
         pSrc += pPic->p->i_pitch - m_width * 4;
     }
 
-    pPic->pf_release( pPic );
+    picture_Release( pPic );
     return;
 }