Blender  V3.3
Classes | Functions
blender::color Namespace Reference

Classes

struct  ByteTraits
 
struct  FloatTraits
 

Functions

static float get_luminance (ColorPaint4f c)
 
static int get_luminance (ColorPaint4b c)
 
Color Blending Modes
template<typename Color , typename Traits >
static Color mix_blend (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_add (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_sub (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_mul (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_lighten (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_darken (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_colordodge (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_difference (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_screen (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_hardlight (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_overlay (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_softlight (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_exclusion (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_luminosity (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_saturation (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_hue (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_alpha_add (Color col_src, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_alpha_sub (Color col_src, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_pinlight (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_linearlight (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_vividlight (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_color (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_colorburn (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
static Color mix_linearburn (Color col_src, Color col_dst, typename Traits::BlendType fac)
 
template<typename Color , typename Traits >
BLI_INLINE Color BLI_mix_colors (const IMB_BlendMode tool, const Color a, const Color b, const typename Traits::BlendType alpha)
 

Function Documentation

◆ BLI_mix_colors()

template<typename Color , typename Traits >
BLI_INLINE Color blender::color::BLI_mix_colors ( const IMB_BlendMode  tool,
const Color  a,
const Color  b,
const typename Traits::BlendType  alpha 
)

◆ get_luminance() [1/2]

static int blender::color::get_luminance ( ColorPaint4b  c)
static

Definition at line 94 of file BLI_color_mix.hh.

References Freestyle::c, and IMB_colormanagement_get_luminance_byte().

◆ get_luminance() [2/2]

static float blender::color::get_luminance ( ColorPaint4f  c)
static

Definition at line 89 of file BLI_color_mix.hh.

References Freestyle::c, and IMB_colormanagement_get_luminance().

Referenced by mix_darken(), and mix_lighten().

◆ mix_add()

template<typename Color , typename Traits >
static Color blender::color::mix_add ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 150 of file BLI_color_mix.hh.

References Color, and Value.

◆ mix_alpha_add()

template<typename Color , typename Traits >
static Color blender::color::mix_alpha_add ( Color  col_src,
typename Traits::BlendType  fac 
)
static

Definition at line 702 of file BLI_color_mix.hh.

References Color, and Value.

◆ mix_alpha_sub()

template<typename Color , typename Traits >
static Color blender::color::mix_alpha_sub ( Color  col_src,
typename Traits::BlendType  fac 
)
static

Definition at line 725 of file BLI_color_mix.hh.

References Color, and Value.

◆ mix_blend()

template<typename Color , typename Traits >
static Color blender::color::mix_blend ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 106 of file BLI_color_mix.hh.

References Color, sqrtf, and Value.

◆ mix_color()

template<typename Color , typename Traits >
static Color blender::color::mix_color ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 875 of file BLI_color_mix.hh.

References usdtokens::b(), Color, usdtokens::g(), hsv_to_rgb(), r, rgb_to_hsv(), v1, v2, and Value.

Referenced by dynamic_paint_border_cb().

◆ mix_colorburn()

template<typename Color , typename Traits >
static Color blender::color::mix_colorburn ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 925 of file BLI_color_mix.hh.

References Color, max, and Value.

◆ mix_colordodge()

template<typename Color , typename Traits >
static Color blender::color::mix_colordodge ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 312 of file BLI_color_mix.hh.

References Color, min, and Value.

◆ mix_darken()

template<typename Color , typename Traits >
static Color blender::color::mix_darken ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 276 of file BLI_color_mix.hh.

References Color, get_luminance(), and Value.

◆ mix_difference()

template<typename Color , typename Traits >
static Color blender::color::mix_difference ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 353 of file BLI_color_mix.hh.

References blender::math::abs(), Color, and Value.

◆ mix_exclusion()

template<typename Color , typename Traits >
static Color blender::color::mix_exclusion ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 529 of file BLI_color_mix.hh.

References Color, and Value.

◆ mix_hardlight()

template<typename Color , typename Traits >
static Color blender::color::mix_hardlight ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 423 of file BLI_color_mix.hh.

References Color, min, and Value.

◆ mix_hue()

template<typename Color , typename Traits >
static Color blender::color::mix_hue ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 655 of file BLI_color_mix.hh.

References usdtokens::b(), Color, usdtokens::g(), hsv_to_rgb(), r, rgb_to_hsv(), v1, v2, and Value.

◆ mix_lighten()

template<typename Color , typename Traits >
static Color blender::color::mix_lighten ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 239 of file BLI_color_mix.hh.

References Color, get_luminance(), and Value.

◆ mix_linearburn()

template<typename Color , typename Traits >
static Color blender::color::mix_linearburn ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 960 of file BLI_color_mix.hh.

References Color, max, and Value.

◆ mix_linearlight()

template<typename Color , typename Traits >
static Color blender::color::mix_linearlight ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 788 of file BLI_color_mix.hh.

References Color, max, min, and Value.

◆ mix_luminosity()

template<typename Color , typename Traits >
static Color blender::color::mix_luminosity ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 560 of file BLI_color_mix.hh.

References usdtokens::b(), Color, usdtokens::g(), hsv_to_rgb(), r, rgb_to_hsv(), v1, v2, and Value.

◆ mix_mul()

template<typename Color , typename Traits >
static Color blender::color::mix_mul ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 206 of file BLI_color_mix.hh.

References Color, and Value.

◆ mix_overlay()

template<typename Color , typename Traits >
static Color blender::color::mix_overlay ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 458 of file BLI_color_mix.hh.

References Color, min, and Value.

◆ mix_pinlight()

template<typename Color , typename Traits >
static Color blender::color::mix_pinlight ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 748 of file BLI_color_mix.hh.

References Color, max, min, and Value.

◆ mix_saturation()

template<typename Color , typename Traits >
static Color blender::color::mix_saturation ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

◆ mix_screen()

template<typename Color , typename Traits >
static Color blender::color::mix_screen ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 384 of file BLI_color_mix.hh.

References Color, max, and Value.

◆ mix_softlight()

template<typename Color , typename Traits >
static Color blender::color::mix_softlight ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 493 of file BLI_color_mix.hh.

References blender::bke::attribute_accessor_functions::add(), Color, and Value.

◆ mix_sub()

template<typename Color , typename Traits >
static Color blender::color::mix_sub ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 180 of file BLI_color_mix.hh.

References Color, and Value.

◆ mix_vividlight()

template<typename Color , typename Traits >
static Color blender::color::mix_vividlight ( Color  col_src,
Color  col_dst,
typename Traits::BlendType  fac 
)
static

Definition at line 828 of file BLI_color_mix.hh.

References Color, max, min, and Value.