[Scummvm-cvs-logs] SF.net SVN: scummvm:[39795] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Wed Apr 1 22:55:27 CEST 2009


Revision: 39795
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39795&view=rev
Author:   buddha_
Date:     2009-04-01 20:55:24 +0000 (Wed, 01 Apr 2009)

Log Message:
-----------
Cine::Palette: Add saturatedAddNormalizedColor-function (Going to be used to combine FWRenderer's and OSRenderer's transformPalette-functions into one later on).

Modified Paths:
--------------
    scummvm/trunk/engines/cine/pal.cpp
    scummvm/trunk/engines/cine/pal.h

Modified: scummvm/trunk/engines/cine/pal.cpp
===================================================================
--- scummvm/trunk/engines/cine/pal.cpp	2009-04-01 20:32:45 UTC (rev 39794)
+++ scummvm/trunk/engines/cine/pal.cpp	2009-04-01 20:55:24 UTC (rev 39795)
@@ -259,6 +259,15 @@
 	return output;
 }
 
+Palette &Palette::saturatedAddNormalizedColor(Palette& output, byte firstIndex, byte lastIndex, signed rNormalized, signed gNormalized, signed bNormalized, signed dividend, signed denominator) {
+	assert(denominator != 0);
+	const signed r = _format.rMax() * rNormalized * dividend / denominator;
+	const signed g = _format.gMax() * gNormalized * dividend / denominator;
+	const signed b = _format.bMax() * bNormalized * dividend / denominator;
+
+	return saturatedAddColor(output, firstIndex, lastIndex, r, g, b);
+}
+
 Palette &Palette::saturatedAddNormalizedGray(Palette& output, byte firstIndex, byte lastIndex, int grayDividend, int grayDenominator) {
 	assert(grayDenominator != 0);
 	const signed r = _format.rMax() * grayDividend / grayDenominator;

Modified: scummvm/trunk/engines/cine/pal.h
===================================================================
--- scummvm/trunk/engines/cine/pal.h	2009-04-01 20:32:45 UTC (rev 39794)
+++ scummvm/trunk/engines/cine/pal.h	2009-04-01 20:55:24 UTC (rev 39795)
@@ -139,6 +139,20 @@
 	Palette &rotateRight(byte firstIndex, byte lastIndex);
 	Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b);
 
+	/*! \brief Saturated add a normalized RGB color to current palette's subset and save the modified colors in the given output palette.
+	 * \param output The output palette (Only this palette is modified)
+	 * \param firstIndex First color index of the palette's subset (Inclusive range)
+	 * \param lastIndex Last color index of the palette's subset (Inclusive range)
+	 * \param rNormalized The normalized red color component
+	 * \param gNormalized The normalized green color component
+	 * \param bNormalized The normalized blue color component
+	 * \param dividend Dividend of the normalized color component values
+	 * \param denominator Denominator of the normalized color component values
+	 * \note The normalized color component multiplier value (i.e. in range [-1, +1]) is given as a fractional number
+	 * so each input color component is multiplied by it and the color component's maximum (Specified by this palette's color format)
+	 */
+	Palette &saturatedAddNormalizedColor(Palette& output, byte firstIndex, byte lastIndex, signed rNormalized, signed gNormalized, signed bNormalized, signed dividend, signed denominator);
+
 	/*! \brief Saturated add a normalized gray value to current palette's subset and save the modified colors in the given output palette.
 	 * \param output The output palette (Only this palette is modified)
 	 * \param firstIndex First color index of the palette's subset (Inclusive range)


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