37 if (wipe->
angle < 0.0f) {
46 if (wipe->
angle < 0.0f) {
49 this->
pos = this->
size * 0.5f + offset;
58 float blend_width = wipe->
edgeWidth * ((width + height) / 2.0f);
65 blend_width = std::min(blend_width, fac * this->
size.y);
66 blend_width = std::min(blend_width, this->
size.y - fac * this->size.y);
79 float delta_neg = angle_width * (this->
forward ? fac : (1.0f - fac));
80 float delta_pos = angle_width * (this->
forward ? (1.0f - fac) : fac);
81 this->
clock_angles.x = std::max(angle_cur - delta_neg, 0.0f);
100 if (inv_width == 0.0f) {
101 return dist < 0.0f ? 0.0f : 1.0f;
103 return dist * inv_width + 0.5f;
109 switch (
data->type) {
123 float dist = std::min(dist1, dist2);
155 if (!
data->forward) {
163 strip->effectdata = MEM_new<WipeVars>(
"wipevars");
168 if (strip->effectdata) {
169 MEM_delete(
static_cast<WipeVars *
>(strip->effectdata));
170 strip->effectdata =
nullptr;
176 const Strip *strip,
float fac,
int width,
int height,
const T *rect1,
const T *rect2,
T *
out)
183 const T *cp1 = rect1 + y_range.
first() * width * 4;
184 const T *cp2 = rect2 + y_range.
first() * width * 4;
185 T *rt =
out + y_range.
first() * width * 4;
186 for (
const int y : y_range) {
187 for (
int x = 0;
x < width;
x++) {
190 memcpy(rt, cp2,
sizeof(
T) * 4);
192 else if (blend >= 1.0f) {
193 memcpy(rt, cp1,
sizeof(
T) * 4);
198 float4 col = col1 * blend + col2 * (1.0f - blend);
221 if (
out.image->float_data()) {
228 out.image->float_data_for_write());
237 out.image->byte_data_for_write());
#define PRF_scope_with_name(ui_name, category)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
constexpr int64_t first() const
constexpr IndexRange()=default
T length_squared(const VecBase< T, Size > &a)
T distance(const T &a, const T &b)
T length(const VecBase< T, Size > &a)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
static void free_wipe_effect(Strip *strip, const bool)
void wipe_effect_get_handle(EffectHandle &rval)
float4 load_premul_pixel(const uchar *ptr)
static void init_wipe_effect(Strip *strip)
SeqResult prepare_effect_imbufs(const RenderData *context, const SeqResult &ibuf1, const SeqResult &ibuf2, bool uninitialized_pixels)
static void do_wipe_effect(const Strip *strip, float fac, int width, int height, const T *rect1, const T *rect2, T *out)
static float calc_wipe_blend(const WipeData *data, int x, int y)
static float calc_wipe_band(float dist, float inv_width)
void store_premul_pixel(const float4 &pix, uchar *dst)
StripEarlyOut early_out_fade(const Strip *, float fac)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< float, 4 > float4
VecBase< float, 2 > float2
BMesh const char void * data
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
const uint8_t * byte_data() const
const float * float_data() const
bool can_contain_alpha() const
void(*) free(Strip *strip, bool do_id_user)
void(*) init(Strip *strip)
StripEarlyOut(*) early_out(const Strip *strip, float fac)
SeqResult(*) execute(const RenderData *context, SeqRenderState *state, Strip *strip, float timeline_frame, float fac, const SeqResult &input1, const SeqResult &input2)
WipeData(const WipeVars *wipe, int width, int height, float fac)
float clock_angle_inv_dif