本文整理汇总了C++中CColor::getRed方法的典型用法代码示例。如果您正苦于以下问题:C++ CColor::getRed方法的具体用法?C++ CColor::getRed怎么用?C++ CColor::getRed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CColor
的用法示例。
在下文中一共展示了CColor::getRed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: contains
bool DeltaRGB::contains(const CColor &c1, const CColor &c2) const {
double rdiff = fabs(c1.getRed()-c2.getRed());
double gdiff = fabs(c1.getGreen()-c2.getGreen());
double bdiff = fabs(c1.getBlue()-c2.getBlue());
if (rdiff <= delta_red && gdiff <= delta_green && bdiff <= delta_blue)
return true;
return false;
}
示例2: modulate
CColor CColor::modulate ( const CColor& color ) const
{
unsigned char R = static_cast<unsigned char> ( getRed() * color.getRed() / 255 );
unsigned char G = static_cast<unsigned char> ( getGreen() * color.getGreen() / 255 );
unsigned char B = static_cast<unsigned char> ( getBlue() * color.getBlue() / 255 );
unsigned char A = static_cast<unsigned char> ( getAlpha() * color.getAlpha() / 255 );
return CColor ( R , G , B , A );
}
示例3: getRed
CColor CColor::operator - ( const CColor& color ) const
{
int R = getRed() - color.getRed();
int G = getGreen() - color.getGreen();
int B = getBlue() - color.getBlue();
int A = getAlpha() - color.getAlpha();
CColor newc;
newc.setInt ( R , G , B , A );
return newc;
}
示例4: L2dist2
double L2dist2(const CColor &c1, const CColor &c2) {
double dr = c1.getRed() - c2.getRed();
double dg = c1.getGreen() - c2.getGreen();
double db = c1.getBlue() - c2.getBlue();
return dr*dr + dg*dg + db*db;
}
示例5: L1dist
double L1dist(const CColor &c1, const CColor &c2) {
return ((fabs(c1.getRed() - c2.getRed()) +
fabs(c1.getGreen() - c2.getGreen()) +
fabs(c1.getBlue() - c2.getBlue()))/3.0);
}