38 inline float32 grayAlpha(
const Rgba32_t &in)
40 return in.gray() * m_value[0];
43 inline void rgb2yuv(
const Rgba32_t &in, float32 &Y, float32 &U, float32 &V)
46 U =
static_cast<float32
>(-0.14713 * in.red() - 0.28886 * in.green() + 0.436 * in.blue());
47 V =
static_cast<float32
>(0.615 * in.red() - 0.51499 * in.green() - 0.10001 * in.blue());
51 inline void rgb2cmyk(
const Rgba32_t &in, float32 &C, float32 &M, float32 &Y, float32 &K)
53 K = (255 - (in.red() > in.blue() ? (in.red() > in.green() ? in.red() : in.green()) : (in.blue() > in.green() ? in.blue() : in.green()))) / 255.0;
55 if( fabs(K - 1) < std::numeric_limits<float32>::epsilon())
63 C = (1.0 - in.red()/ 255.0 - K) / (1.0 - K);
64 M = (1.0 - in.green()/ 255.0 - K) / (1.0 - K);
65 Y = (1.0 - in.green()/ 255.0 - K) / (1.0 - K);
71 template<u
int8 _CHANNEL>
inline Rgba32_t max(
const Rgba32_t &first,
const Rgba32_t &second)
const
73 if (((RGBChannel_t<_CHANNEL>)first) > ((RGBChannel_t<_CHANNEL>)second)
83 inline Rgba32_t max(
const Rgba32_t &first,
const Rgba32_t &second,
const uint8 &mode)
87 case Rgba32_t::RGBA_B:
88 case Rgba32_t::RGBA_G:
89 case Rgba32_t::RGBA_R:
90 case Rgba32_t::RGBA_A:
91 return max<mode>(first, second);
93 case Rgba32_t::RGBA_Y:
94 if(first.gray() < second.gray())
return second;
98 case Rgba32_t::RGBA_RGB:
100 uint8 max1 = (first.red() > first.blue() ? (first.red() > first.green() ? first.red() : first.green()) : (first.blue() > first.green() ? first.blue() : first.green()));
101 uint8 max2 = (second.red() > second.blue() ? (second.red() > second.green() ? second.red() : second.green()) : (second.blue() > second.green() ? second.blue() : second.green()));
102 if(max1 < max2)
return second;
Definition apiFunctionsGraph.cpp:40