mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 19:16:21 +00:00
Slight fixes to comply with our coding guidelines.
svn-id: r47770
This commit is contained in:
parent
a13af0270b
commit
3dd46d50f5
@ -224,7 +224,7 @@ void Palette::setColorFormat(const Graphics::PixelFormat format) {
|
||||
}
|
||||
|
||||
// a.k.a. transformPaletteRange
|
||||
Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) const {
|
||||
Palette &Palette::saturatedAddColor(Palette &output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) const {
|
||||
assert(firstIndex < colorCount() && lastIndex < colorCount());
|
||||
assert(firstIndex < output.colorCount() && lastIndex < output.colorCount());
|
||||
assert(output.colorFormat() == colorFormat());
|
||||
@ -250,7 +250,7 @@ Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastI
|
||||
return output;
|
||||
}
|
||||
|
||||
Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) const {
|
||||
Palette &Palette::saturatedAddColor(Palette &output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) const {
|
||||
// Convert the source color to the internal color format ensuring that no divide by zero will happen
|
||||
const signed r = ((signed) _format.rMax()) * rSource / MAX<int>(sourceFormat.rMax(), 1);
|
||||
const signed g = ((signed) _format.gMax()) * gSource / MAX<int>(sourceFormat.gMax(), 1);
|
||||
@ -259,7 +259,7 @@ Palette &Palette::saturatedAddColor(Palette& output, byte firstIndex, byte lastI
|
||||
return saturatedAddColor(output, firstIndex, lastIndex, r, g, b);
|
||||
}
|
||||
|
||||
Palette &Palette::saturatedAddNormalizedGray(Palette& output, byte firstIndex, byte lastIndex, int grayDividend, int grayDenominator) const {
|
||||
Palette &Palette::saturatedAddNormalizedGray(Palette &output, byte firstIndex, byte lastIndex, int grayDividend, int grayDenominator) const {
|
||||
assert(grayDenominator != 0);
|
||||
const signed r = ((signed) _format.rMax()) * grayDividend / grayDenominator;
|
||||
const signed g = ((signed) _format.gMax()) * grayDividend / grayDenominator;
|
||||
@ -269,7 +269,7 @@ Palette &Palette::saturatedAddNormalizedGray(Palette& output, byte firstIndex, b
|
||||
}
|
||||
|
||||
// a.k.a. transformColor
|
||||
Cine::Palette::Color &Palette::saturatedAddColor(Cine::Palette::Color baseColor, signed r, signed g, signed b) const {
|
||||
Palette::Color &Palette::saturatedAddColor(Color baseColor, signed r, signed g, signed b) const {
|
||||
Cine::Palette::Color result;
|
||||
result.r = CLIP<int>(baseColor.r + r, 0, _format.rMax());
|
||||
result.g = CLIP<int>(baseColor.g + g, 0, _format.gMax());
|
||||
|
@ -132,7 +132,7 @@ public:
|
||||
* \param rotationAmount Amount to rotate the sub-palette to the right. Only values 0 and 1 are currently supported!
|
||||
*/
|
||||
Palette &rotateRight(byte firstIndex, byte lastIndex, signed rotationAmount = 1);
|
||||
Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) const;
|
||||
Palette &saturatedAddColor(Palette &output, byte firstIndex, byte lastIndex, signed r, signed g, signed b) const;
|
||||
|
||||
/*! \brief Saturated add an RGB color in given color format 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)
|
||||
@ -145,7 +145,7 @@ public:
|
||||
* \note This function basically converts the given color to the palette's internal color format
|
||||
* and adds that using the normal saturatedAddColor-function.
|
||||
*/
|
||||
Palette &saturatedAddColor(Palette& output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) const;
|
||||
Palette &saturatedAddColor(Palette &output, byte firstIndex, byte lastIndex, signed rSource, signed gSource, signed bSource, const Graphics::PixelFormat &sourceFormat) const;
|
||||
|
||||
/*! \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)
|
||||
@ -156,7 +156,7 @@ public:
|
||||
* \note The normalized gray value (i.e. in range [-1, +1]) is given as a fractional number
|
||||
* (i.e. the normalized gray value is calculated by dividing grayDividend by grayDenominator).
|
||||
*/
|
||||
Palette &saturatedAddNormalizedGray(Palette& output, byte firstIndex, byte lastIndex, signed grayDividend, signed grayDenominator) const;
|
||||
Palette &saturatedAddNormalizedGray(Palette &output, byte firstIndex, byte lastIndex, signed grayDividend, signed grayDenominator) const;
|
||||
|
||||
bool empty() const;
|
||||
uint colorCount() const;
|
||||
@ -186,7 +186,7 @@ public:
|
||||
|
||||
private:
|
||||
void setColorFormat(const Graphics::PixelFormat format);
|
||||
Cine::Palette::Color &saturatedAddColor(Cine::Palette::Color baseColor, signed r, signed g, signed b) const;
|
||||
Color &saturatedAddColor(Color baseColor, signed r, signed g, signed b) const;
|
||||
|
||||
private:
|
||||
Graphics::PixelFormat _format; ///< The used source color format
|
||||
|
Loading…
x
Reference in New Issue
Block a user