121 const float *
ptr =
nullptr;
179 this->
mask->float_buffer.data, m, this->mask->x, this->mask->y, 4, uv.x, uv.y);
190 this->
mask->float_buffer.data, m, this->mask->x, this->mask->y, 4, uv.x, uv.y);
191 float r =
min_fff(m.x, m.y, m.z);
224 this->
mask->byte_buffer.data, this->mask->x, this->mask->y, uv.x, uv.y);
236 this->
mask->byte_buffer.data, this->mask->x, this->mask->y, uv.x, uv.y);
237 float r =
float(
min_iii(m.x, m.y, m.z)) * (1.0f / 255.0f);
265 if (ibuf ==
nullptr) {
269 "Sequencer only supports 4 channel images");
271 "Sequencer only supports 4 channel images");
272 const bool direct_mask_sampling =
mask ==
nullptr || (
mask->x == ibuf->
x &&
mask->y == ibuf->
y &&
274 const int image_x = ibuf->
x;
276 uchar *image_byte = ibuf->byte_buffer.data;
277 float *image_float = ibuf->float_buffer.data;
278 const uchar *mask_byte = mask ? mask->byte_buffer.data : nullptr;
279 const float *mask_float = mask ? mask->float_buffer.data : nullptr;
285 if (direct_mask_sampling) {
286 MaskSamplerDirectByte sampler(mask);
287 op.apply(image_byte, sampler, image_x, y_range);
290 MaskSamplerTransformedByte sampler(mask, mask_transform);
291 op.apply(image_byte, sampler, image_x, y_range);
294 else if (mask_float) {
295 if (direct_mask_sampling) {
296 MaskSamplerDirectFloat sampler(mask);
297 op.apply(image_byte, sampler, image_x, y_range);
300 MaskSamplerTransformedFloat sampler(mask, mask_transform);
301 op.apply(image_byte, sampler, image_x, y_range);
305 MaskSamplerNone sampler;
306 op.apply(image_byte, sampler, image_x, y_range);
309 else if (image_float) {
311 if (direct_mask_sampling) {
313 op.apply(image_float, sampler, image_x, y_range);
317 op.apply(image_float, sampler, image_x, y_range);
320 else if (mask_float) {
321 if (direct_mask_sampling) {
323 op.apply(image_float, sampler, image_x, y_range);
327 op.apply(image_float, sampler, image_x, y_range);
332 op.apply(image_float, sampler, image_x, y_range);
#define BLI_assert_msg(a, msg)
MINLINE int min_iii(int a, int b, int c)
MINLINE float min_fff(float a, float b, float c)
MINLINE void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
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)
void store_pixel_raw(float4 pix, uchar *ptr)
void draw_mask_input_type_settings(const bContext *C, uiLayout *layout, PointerRNA *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, int timeline_frame)
bool modifier_ui_poll(const bContext *C, PanelType *)
void(*)(const bContext *, Panel *) PanelDrawFn
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))
blender::VecBase< uint8_t, 4 > uchar4
VecBase< float, 4 > float4
VecBase< float, 2 > float2
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3
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 &)
SeqRenderState & render_state
const RenderData & render_data
float2 result_translation
ModifierApplyContext(const RenderData &render_data, SeqRenderState &render_state, const Strip &strip, const float3x3 &transform, ImBuf *image)