19 #ifndef FASTUIDRAW_BLEND_MODE_HPP 20 #define FASTUIDRAW_BLEND_MODE_HPP 217 m_value =
pack_bits(blending_on_bit, 1u, 1u)
219 |
pack_bits(equation_alpha_bit0, equation_num_bits,
ADD)
232 return m_value == rhs.m_value;
241 return m_value != rhs.m_value;
250 m_value |= (1u << invalid_bit);
260 m_value &= ~(1u << invalid_bit);
271 return !(m_value & (1u << invalid_bit));
282 m_value |=
pack_bits(blending_on_bit, 1u, uint32_t(v));
292 return unpack_bits(blending_on_bit, 1u, m_value) != 0u;
303 m_value |=
pack_bits(equation_rgb_bit0, equation_num_bits, v);
324 m_value |=
pack_bits(equation_alpha_bit0, equation_num_bits, v);
359 m_value |=
pack_bits(src_func_rgb_bit0, func_num_bits, v);
369 return static_cast<enum
func_t>(
unpack_bits(src_func_rgb_bit0, func_num_bits, m_value));
380 m_value |=
pack_bits(src_func_alpha_bit0, func_num_bits, v);
390 return static_cast<enum
func_t>(
unpack_bits(src_func_alpha_bit0, func_num_bits, m_value));
415 m_value |=
pack_bits(dst_func_rgb_bit0, func_num_bits, v);
425 return static_cast<enum
func_t>(
unpack_bits(dst_func_rgb_bit0, func_num_bits, m_value));
436 m_value |=
pack_bits(dst_func_alpha_bit0, func_num_bits, v);
446 return static_cast<enum
func_t>(
unpack_bits(dst_func_alpha_bit0, func_num_bits, m_value));
496 equation_num_bits = 3,
504 equation_rgb_bit0 = 1,
505 equation_alpha_bit0 = equation_rgb_bit0 + equation_num_bits,
507 src_func_rgb_bit0 = equation_alpha_bit0 + equation_num_bits,
508 src_func_alpha_bit0 = src_func_rgb_bit0 + func_num_bits,
510 dst_func_rgb_bit0 = src_func_alpha_bit0 + func_num_bits,
511 dst_func_alpha_bit0 = dst_func_rgb_bit0 + func_num_bits,
513 invalid_bit = dst_func_alpha_bit0 + func_num_bits,
#define FASTUIDRAW_MASK(BIT0, NUMBITS)
uint32_t unpack_bits(uint32_t bit0, uint32_t num_bits, uint32_t value)
bool is_valid(void) const
bool operator!=(BlendMode rhs) const
enum func_t func_src_alpha(void) const
all classes and functions of FastUIDraw are in the namespace fastuidraw.
enum equation_t equation_rgb(void) const
bool blending_on(void) const
BlendMode & equation(enum equation_t v)
BlendMode & func_src_rgb(enum func_t v)
enum equation_t equation_alpha(void) const
BlendMode & func_src_alpha(enum func_t v)
enum func_t func_dst_rgb(void) const
enum func_t func_dst_alpha(void) const
equation_t
Enumeration to specify blend equation, i.e. glBlendEquation.
BlendMode & func_dst(enum func_t v)
BlendMode & func_dst_rgb(enum func_t v)
BlendMode & func(enum func_t src, enum func_t dst)
uint32_t pack_bits(uint32_t bit0, uint32_t num_bits, uint32_t value)
static c_string label(enum equation_t v)
BlendMode & equation_alpha(enum equation_t v)
const char * c_string
Conveniant typedef for C-style strings.
BlendMode & set_as_valid(void)
BlendMode & func_src(enum func_t v)
enum func_t func_src_rgb(void) const
BlendMode & blending_on(bool v)
BlendMode & set_as_invalid(void)
bool operator==(BlendMode rhs) const
BlendMode & func_dst_alpha(enum func_t v)
Class to hold the blend mode as exposed by typical 3D APIs.
func_t
Enumeration to specify the blend coefficient factor, i.e. glBlendFunc.
BlendMode & equation_rgb(enum equation_t v)