コード例 #1
0
ファイル: color.cpp プロジェクト: 1726184339/code
color interpolate(const color& a, sample weight, const color& b)
noexcept
{
    auto pre_red =
                 interpolate(a.alpha() * a.red(), weight, b.alpha() * b.red());
    auto pre_green =
                 interpolate(a.alpha() * a.green(), weight, b.alpha() * b.green());
    auto pre_blue =
                 interpolate(a.alpha() * a.blue(), weight, b.alpha() * b.blue());
    auto new_alpha = interpolate(a.alpha(), weight, b.alpha());

    return {pre_red / new_alpha, pre_green / new_alpha, pre_blue / new_alpha,
            new_alpha};
}
コード例 #2
0
ファイル: color.hpp プロジェクト: cquest/mapnik
 inline bool operator==(color const& rhs) const
 {
     return (red_== rhs.red()) &&
            (green_ == rhs.green()) &&
            (blue_  == rhs.blue()) &&
            (alpha_ == rhs.alpha());
 }
コード例 #3
0
ファイル: color.cpp プロジェクト: 1726184339/code
color overlay(const color& fg, const color& bg) noexcept
{
    if (opaque(fg) || transparent(bg)) return fg;
    if (transparent(fg)) return bg;

    return interpolate(bg, fg.alpha(), color{fg.red(), fg.green(), fg.blue()});
}
コード例 #4
0
ファイル: color.hpp プロジェクト: 8l/x11
      void set ( color& c )
	{
	  free_color();
	  set_color ( c.red(), c.green(), c.blue() );
	}
コード例 #5
0
ファイル: cairo_context.cpp プロジェクト: lightmare/mapnik
void cairo_context::set_color(color const& color, double opacity)
{
    set_color(color.red()/255.0, color.green()/255.0, color.blue()/255.0, color.alpha() * opacity / 255.0);
}
コード例 #6
0
ファイル: mapnik_color.cpp プロジェクト: dhootha/mapnik
 static boost::python::tuple
 getinitargs(const color& c)
 {
     using namespace boost::python;
     return boost::python::make_tuple(c.red(),c.green(),c.blue(),c.alpha());
 }
コード例 #7
0
void api::clear_color( const color &c )
{
	glClearColor( c.red(), c.green(), c.blue(), c.alpha() );
}
コード例 #8
0
void texture::binding::set_border_color( const color &c )
{

	float color[] = { c.red(), c.green(), c.blue(), c.alpha() };
	glTexParameterfv( _target, GL_TEXTURE_BORDER_COLOR, color );
}