示例#1
0
文件: color.cpp 项目: 1726184339/code
static color32::byte to_byte(sample s) noexcept
{
    return static_cast<color32::byte>(color32::BYTE_MAX * s.value());
}
示例#2
0
文件: sample.cpp 项目: atakan196/code
sample operator/(sample a, sample b)
{
    return sample{a.value() / b.value()};
}
示例#3
0
文件: sample.cpp 项目: atakan196/code
sample operator-(sample a, sample b)
{
    return sample{a.value() - b.value()};
}
示例#4
0
文件: sample.cpp 项目: atakan196/code
sample operator+(sample a, sample b)
{
    return sample{a.value() + b.value()};
}
示例#5
0
文件: sample.cpp 项目: atakan196/code
sample sample::operator*(sample other) const
{
    sample result;
    result.value_ = value() * other.value(); // can't overflow
    return result;
}
示例#6
0
文件: sample.cpp 项目: atakan196/code
sample interpolate(sample a, sample weight, sample b)
{
    return sample{(1 - weight.value()) * a.value() + weight.value() * b.value()};
}