]> git.vomp.tv Git - vompclient.git/commitdiff
Bitmap and VPictureBanner CWFs
authorChris Tallon <chris@vomp.tv>
Fri, 22 May 2020 15:55:58 +0000 (16:55 +0100)
committerChris Tallon <chris@vomp.tv>
Fri, 22 May 2020 15:55:58 +0000 (16:55 +0100)
bitmap.cc
vpicturebanner.cc

index cd60cdd57002d4436f1bfc0b2a6e24e8e0468a60..7947994ebe62d5d7ded6dfdea2fe77d1db9b2a7b 100644 (file)
--- a/bitmap.cc
+++ b/bitmap.cc
@@ -38,13 +38,13 @@ Palette::Palette(UCHAR tBpp)
 
 void Palette::argb2yrba(ULONG argb, UCHAR& y, UCHAR& cr, UCHAR& cb, UCHAR& a)
 {
-  a = ((argb & 0xFF000000) >> 24);
+  a = static_cast<UCHAR>((argb & 0xFF000000) >> 24);
   int r = (argb & 0x00FF0000) >> 16;
   int g = (argb & 0x0000FF00) >> 8;
   int b = (argb & 0x000000FF);
-  y  = (1052*r + 2065*g + 401*b + 4096*16 + 2048) / 4096;
-  cr = (1799*r - 1508*g - 291*b + 4096*128 + 2048) / 4096;
-  cb = (-608*r - 1191*g + 1799*b + 4096*128 + 2048) / 4096;
+  y  = static_cast<UCHAR>((1052*r + 2065*g + 401*b + 4096*16 + 2048) / 4096);
+  cr = static_cast<UCHAR>((1799*r - 1508*g - 291*b + 4096*128 + 2048) / 4096);
+  cb = static_cast<UCHAR>((-608*r - 1191*g + 1799*b + 4096*128 + 2048) / 4096);
 }
 
 ULONG Palette::yrba2argb(UCHAR y, UCHAR cr, UCHAR cb, UCHAR a)
index 5a99be4e2a5ae7f1f2c30d619ed6ade374d5fc7b..9d34c2f4f7883e555a4cb20b4d028c6a1e50e027 100644 (file)
@@ -111,7 +111,7 @@ void VPictureBanner::processMessage(Message* m)
     {
       BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
     }
-    else if (y>=(int)area.h-24 && y<=(int)area.h-6)
+    else if (y >= (static_cast<int>(area.h) - 24) && y <= static_cast<int>(area.h) - 6)
     {
       //y coordinate is right!
       if (x>=7 &&x<=25)