50 float &opacity = opacities[point_i];
52 paint, brush, view_positions[point_i], extension_sample,
params.multi_frame_falloff);
54 const float delta_opacity = (
invert ? -influence : influence) * 0.125f;
55 opacity = std::clamp(opacity + delta_opacity, 0.0f, 1.0f);
66 return std::make_unique<StrengthOperation>(stroke_mode);
Low-level operations for grease pencil.
Paint * BKE_paint_get_active_from_context(const bContext *C)
Brush * BKE_paint_brush(Paint *paint)
bool is_inverted(const Brush &brush) const
GreasePencilStrokeOperationCommon()=default
void foreach_editable_drawing_with_automask(const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams ¶ms, const IndexMask &points)> fn) const
void stroke_extended(const InputSample &extension_sample)
void init_stroke(const bContext &C, const InputSample &start_sample)
void init_auto_masking(const bContext &C, const InputSample &start_sample)
void on_stroke_extended(const bContext &C, const InputSample &extension_sample) override
GreasePencilStrokeOperationCommon()=default
void on_stroke_begin(const bContext &C, const InputSample &start_sample) override
void on_stroke_done(const bContext &) override
void foreach_index(Fn &&fn) const
CCL_NAMESPACE_BEGIN ccl_device float invert(const float color, const float factor)
std::unique_ptr< GreasePencilStrokeOperation > new_strength_operation(BrushStrokeMode stroke_mode)
float brush_point_influence(const Paint &paint, const Brush &brush, const float2 &co, const InputSample &sample, float multi_frame_falloff)
Array< float2 > calculate_view_positions(const GreasePencilStrokeParams ¶ms, const IndexMask &selection)