47 const float fac = this->
factor;
49 memcpy(dst, src2,
sizeof(
T) * 4 *
size);
54 if (src1[3] <= 0.0f) {
56 memcpy(dst, src2,
sizeof(
T) * 4);
60 memcpy(dst, src1,
sizeof(
T) * 4);
64 float mfac = 1.0f - fac * col1.w;
100 const float fac = this->
factor;
102 memcpy(dst, src2,
sizeof(
T) * 4 *
size);
107 if (src2[3] <= 0.0f && fac >= 1.0f) {
108 memcpy(dst, src1,
sizeof(
T) * 4);
111 memcpy(dst, src2,
sizeof(
T) * 4);
115 float mfac = fac * (1.0f - col2.w);
147template<
typename T,
typename Func>
149 float fac,
int64_t size,
const T *src1,
const T *src2,
T *dst, Func blend_function)
152 T achannel = src2[3];
153 ((
T *)src2)[3] =
T(achannel * fac);
154 blend_function(dst, src1, src2);
155 ((
T *)src2)[3] = achannel;
318 if constexpr (std::is_same_v<T, float>) {
MINLINE void blend_color_add_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_exclusion_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_linearburn_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_overlay_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_saturation_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_burn_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_color_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_linearlight_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_sub_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4])
MINLINE void blend_color_saturation_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_hue_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_difference_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_dodge_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_luminosity_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_pinlight_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_mul_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_pinlight_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_screen_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_screen_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_vividlight_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_linearburn_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_mul_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4])
MINLINE void blend_color_vividlight_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_darken_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4])
MINLINE void blend_color_luminosity_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_difference_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_burn_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_color_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_overlay_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_dodge_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_hardlight_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_sub_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_darken_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_softlight_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_add_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4])
MINLINE void blend_color_hue_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_lighten_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4])
MINLINE void blend_color_exclusion_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_hardlight_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_linearlight_byte(unsigned char dst[4], const uchar src1[4], const uchar src2[4])
MINLINE void blend_color_lighten_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_softlight_float(float dst[4], const float src1[4], const float src2[4])
@ STRIP_BLEND_LINEAR_BURN
@ STRIP_BLEND_VIVID_LIGHT
@ STRIP_BLEND_BLEND_COLOR
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
static void copy_effect_default(Strip *dst, const Strip *src, const int)
void alpha_under_effect_get_handle(EffectHandle &rval)
static ImBuf * do_alphaunder_effect(const RenderData *context, SeqRenderState *, Strip *, float, float fac, ImBuf *src1, ImBuf *src2)
StripEarlyOut early_out_mul_input2(const Strip *, float fac)
static void do_blend_effect_float(float fac, int64_t size, const float *rect1, const float *rect2, StripBlendMode btype, float *out)
static bool alpha_opaque(uchar alpha)
void store_premul_pixel(const blender::float4 &pix, uchar *dst)
ImBuf * prepare_effect_imbufs(const RenderData *context, ImBuf *ibuf1, ImBuf *ibuf2, bool uninitialized_pixels)
void blend_mode_effect_get_handle(EffectHandle &rval)
static ImBuf * do_blend_mode_effect(const RenderData *context, SeqRenderState *, Strip *strip, float, float fac, ImBuf *src1, ImBuf *src2)
blender::float4 load_premul_pixel(const uchar *ptr)
static void init_colormix_effect(Strip *strip)
static void do_blend_effect_byte(float fac, int64_t size, const uchar *rect1, const uchar *rect2, StripBlendMode btype, uchar *out)
static ImBuf * do_colormix_effect(const RenderData *context, SeqRenderState *, Strip *strip, float, float, ImBuf *src1, ImBuf *src2)
StripEarlyOut early_out_mul_input1(const Strip *, float fac)
static void init_alpha_over_or_under(Strip *strip)
static void free_effect_default(Strip *strip, const bool)
static void apply_effect_op(const OpT &op, const ImBuf *src1, const ImBuf *src2, ImBuf *dst)
static ImBuf * do_alphaover_effect(const RenderData *context, SeqRenderState *, Strip *, float, float fac, ImBuf *src1, ImBuf *src2)
void color_mix_effect_get_handle(EffectHandle &rval)
static void apply_blend_function(float fac, int64_t size, const T *src1, const T *src2, T *dst, Func blend_function)
void alpha_over_effect_get_handle(EffectHandle &rval)
VecBase< float, 4 > float4
void apply(const T *src1, const T *src2, T *dst, int64_t size) const
void apply(const T *src1, const T *src2, T *dst, int64_t size) const
StripBlendMode blend_mode
void apply(const T *src1, const T *src2, T *dst, int64_t size) const
void(* copy)(Strip *dst, const Strip *src, int flag)
ImBuf *(* execute)(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame, float fac, ImBuf *ibuf1, ImBuf *ibuf2)
void(* free)(Strip *strip, bool do_id_user)
StripEarlyOut(* early_out)(const Strip *strip, float fac)
void(* init)(Strip *strip)