[Scummvm-cvs-logs] SF.net SVN: scummvm: [25472] scummvm/trunk/gui/ThemeModern.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Feb 10 19:09:14 CET 2007


Revision: 25472
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25472&view=rev
Author:   fingolfin
Date:     2007-02-10 10:09:13 -0800 (Sat, 10 Feb 2007)

Log Message:
-----------
Added small note to ThemeModern::calcLuminance

Modified Paths:
--------------
    scummvm/trunk/gui/ThemeModern.cpp

Modified: scummvm/trunk/gui/ThemeModern.cpp
===================================================================
--- scummvm/trunk/gui/ThemeModern.cpp	2007-02-10 17:45:25 UTC (rev 25471)
+++ scummvm/trunk/gui/ThemeModern.cpp	2007-02-10 18:09:13 UTC (rev 25472)
@@ -1454,6 +1454,10 @@
 	uint8 r, g, b;
 	_system->colorToRGB(col, r, g, b);
 
+	// A better (but slower) formula to calculate the luminance would be:
+	//uint lum = (byte)((0.299 * r + 0.587 * g + 0.114 * b) + 0.5);
+	// Note that the approximation below will only produce values between
+	// (and including) 0 and 221.
 	uint lum = (r >> 2) + (g >> 1) + (b >> 3);
 	
 	return _system->RGBToColor(lum, lum, lum);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list