131 float r = std::min({this->
ptr[0], this->
ptr[1], this->ptr[2]});
135 const float *
ptr =
nullptr;
162 float r =
float(std::min({this->
ptr[0], this->
ptr[1], this->ptr[2]})) * (1.0f / 255.0f);
193 this->
mask->
float_data(), m, this->mask->x, this->mask->y, 4, uv.x, uv.y);
204 this->
mask->
float_data(), m, this->mask->x, this->mask->y, 4, uv.x, uv.y);
205 float r = std::min({m.x, m.y, m.z});
238 this->
mask->
byte_data(), this->mask->x, this->mask->y, uv.x, uv.y);
250 this->
mask->
byte_data(), this->mask->x, this->mask->y, uv.x, uv.y);
251 float r =
float(std::min({m.x, m.y, m.z})) * (1.0f / 255.0f);
279 if (ibuf ==
nullptr) {
283 "Sequencer only supports 4 channel images");
285 "Sequencer only supports 4 channel images");
286 const bool direct_mask_sampling =
mask ==
nullptr || (
mask->x == ibuf->
x &&
mask->y == ibuf->
y &&
288 const int image_x = ibuf->
x;
292 const uchar *mask_byte = mask ? mask->byte_data() : nullptr;
293 const float *mask_float = mask ? mask->float_data() : nullptr;
299 if (direct_mask_sampling) {
300 MaskSamplerDirectByte sampler(mask);
301 op.apply(image_byte, sampler, image_x, y_range);
304 MaskSamplerTransformedByte sampler(mask, mask_transform);
305 op.apply(image_byte, sampler, image_x, y_range);
308 else if (mask_float) {
309 if (direct_mask_sampling) {
310 MaskSamplerDirectFloat sampler(mask);
311 op.apply(image_byte, sampler, image_x, y_range);
314 MaskSamplerTransformedFloat sampler(mask, mask_transform);
315 op.apply(image_byte, sampler, image_x, y_range);
319 MaskSamplerNone sampler;
320 op.apply(image_byte, sampler, image_x, y_range);
323 else if (image_float) {
325 if (direct_mask_sampling) {
327 op.apply(image_float,
sampler, image_x, y_range);
331 op.apply(image_float,
sampler, image_x, y_range);
334 else if (mask_float) {
335 if (direct_mask_sampling) {
337 op.apply(image_float,
sampler, image_x, y_range);
341 op.apply(image_float,
sampler, image_x, y_range);
346 op.apply(image_float,
sampler, image_x, y_range);
#define BLI_assert_msg(a, msg)
constexpr IndexRange()=default
float4 interpolate_bilinear_border_fl(const float *buffer, int width, int height, float u, float v)
T interpolate(const T &a, const T &b, const FactorT &t)
bool is_identity(const MatBase< T, NumCol, NumRow > &mat)
uchar4 interpolate_bilinear_border_byte(const uchar *buffer, int width, int height, float u, float v)
ImBuf * modifier_render_mask_input(const ModifierApplyContext &context, const StripModifierData &smd)
void store_pixel_raw(float4 pix, uchar *ptr)
void apply_modifier_op(T &op, ImBuf *ibuf, const ImBuf *mask, const float3x3 &mask_transform)
void store_pixel_premul(float4 pix, uchar *ptr)
bool modifier_persistent_uids_are_valid(const Strip &strip)
float4 load_pixel_raw(const uchar *ptr)
float4 load_pixel_premul(const uchar *ptr)
void modifier_apply_stack(ModifierApplyContext &context)
bool modifier_ui_poll(const bContext *C, PanelType *)
void(*)(const bContext *, Panel *) PanelDrawFn
void draw_mask_input_type_settings(const bContext *C, ui::Layout &layout, PointerRNA *ptr)
PanelType * modifier_panel_register(ARegionType *region_type, const eStripModifierType type, PanelDrawFn draw)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
VecBase< uint8_t, 4 > uchar4
VecBase< float, 4 > float4
VecBase< float, 2 > float2
MatBase< float, 3, 3 > float3x3
MINLINE void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
VecBase< float, 3 > float3
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
const uint8_t * byte_data() const
uint8_t * byte_data_for_write()
const float * float_data() const
float * float_data_for_write()
void begin_row(int64_t y)
MaskSamplerDirectByte(const ImBuf *mask)
void apply_mask(const float4 input, float4 &result)
void begin_row(int64_t y)
void apply_mask(const float4 input, float4 &result)
MaskSamplerDirectFloat(const ImBuf *mask)
void apply_mask(const float4, float4 &)
ModifierApplyContext(const RenderData &render_data, SeqRenderState &render_state, const Strip &strip, const float3x3 &transform, const float3x3 &transform_comp_result, const float timeline_frame, SeqResult &result)
SeqRenderState & render_state
const float timeline_frame
const RenderData & render_data
const float3x3 transform_comp_result