本文整理汇总了C++中video::SColor::setBlue方法的典型用法代码示例。如果您正苦于以下问题:C++ SColor::setBlue方法的具体用法?C++ SColor::setBlue怎么用?C++ SColor::setBlue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类video::SColor
的用法示例。
在下文中一共展示了SColor::setBlue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finalColorBlend
/*
Converts from day + night color values (0..255)
and a given daynight_ratio to the final SColor shown on screen.
*/
void finalColorBlend(video::SColor& result,
u8 day, u8 night, u32 daynight_ratio)
{
s32 rg = (day * daynight_ratio + night * (1000-daynight_ratio)) / 1000;
s32 b = rg;
// Moonlight is blue
b += (day - night) / 13;
rg -= (day - night) / 23;
// Emphase blue a bit in darker places
// Each entry of this array represents a range of 8 blue levels
static const u8 emphase_blue_when_dark[35] = {
1, 4, 6, 6, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0
};
b += emphase_blue_when_dark[b / 8];
b = irr::core::clamp (b, 0, 255);
// Artificial light is yellow-ish
static const u8 emphase_yellow_when_artificial[16] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 10, 15, 15, 15
};
rg += emphase_yellow_when_artificial[night/16];
rg = irr::core::clamp (rg, 0, 255);
result.setRed(rg);
result.setGreen(rg);
result.setBlue(b);
}
示例2: applyFacesShading
static void applyFacesShading(video::SColor& color, float factor)
{
color.setRed(core::clamp(core::round32(color.getRed()*factor), 0, 255));
color.setGreen(core::clamp(core::round32(color.getGreen()*factor), 0, 255));
color.setBlue(core::clamp(core::round32(color.getBlue()*factor), 0, 255));
}