52 float color_linear[3];
59 params, use_selection_masking, memory);
60 if (!point_selection.
is_empty() && do_points) {
70 view_positions[point_i],
86 view_positions[point_i],
98 blend_mode, linearrgb_color,
mix_color, Traits::range * influence));
105 params, use_selection_masking, memory);
106 if (!fill_selection.is_empty() && do_fill) {
117 fill_selection.foreach_index(
119 const Span<int> fill_curves = fills[fill_i];
122 float influence = 0.0f;
124 const IndexRange points = points_by_curve[curve];
129 curve_view_positions,
135 color.a -= influence;
143 fill_selection.foreach_index(
145 const Span<int> fill_curves = fills[fill_i];
148 float influence = 0.0f;
150 const IndexRange points = points_by_curve[curve];
155 curve_view_positions,
168 blend_mode, linearrgb_color,
mix_color, Traits::range * influence));
183 return std::make_unique<VertexPaintOperation>(stroke_mode);
Low-level operations for curves.
Low-level operations for grease pencil.
Span< T > as_span() const
static IndexMask from_indices(Span< T > indices, LinearAllocator<> &memory)
constexpr const T & first() const
std::optional< GroupedSpan< int > > fills() const
const bke::CurvesGeometry & strokes() const
MutableSpan< ColorGeometry4f > fill_colors_for_write()
MutableSpan< ColorGeometry4f > vertex_colors_for_write()
bool is_inverted(const Brush &brush) const
GreasePencilStrokeOperationCommon()=default
void init_stroke(const bContext &C, const InputSample &start_sample)
void foreach_editable_drawing(const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams ¶ms, const DeltaProjectionFunc &projection_fn)> fn) const
void on_stroke_extended(const bContext &C, const InputSample &extension_sample) override
void on_stroke_done(const bContext &) override
void on_stroke_begin(const bContext &C, const InputSample &start_sample) override
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
void mix_color(float fac, float4 col1, float4 col2, float4 &outcol)
float2x2 invert(float2x2 mat)
ColorSceneLinear4f< eAlpha::Straight > unpremultiply_alpha(const ColorSceneLinear4f< Alpha > &color)
ColorSceneLinear4f< eAlpha::Premultiplied > premultiply_alpha(const ColorSceneLinear4f< Alpha > &color)
BLI_INLINE Color BLI_mix_colors(const IMB_BlendMode tool, const Color a, const Color b, const typename Traits::BlendType alpha)
typename TraitsType< T >::type Traits
IndexMask fill_mask_for_stroke_operation(const GreasePencilStrokeParams ¶ms, bool use_selection_masking, IndexMaskMemory &memory)
bool do_vertex_color_fill(const Brush &brush)
Array< float2 > view_positions_from_curve_mask(const GreasePencilStrokeParams ¶ms, const IndexMask &curve_mask)
std::unique_ptr< GreasePencilStrokeOperation > new_vertex_paint_operation(BrushStrokeMode stroke_mode)
IndexMask point_mask_for_stroke_operation(const GreasePencilStrokeParams ¶ms, bool use_selection_masking, IndexMaskMemory &memory)
float brush_point_influence(const Paint &paint, const Brush &brush, const float2 &co, const InputSample &sample, float multi_frame_falloff)
Array< float2 > view_positions_from_point_mask(const GreasePencilStrokeParams ¶ms, const IndexMask &point_mask)
float brush_fill_influence(const Paint &paint, const Brush &brush, Span< float2 > fill_positions, const InputSample &sample, float multi_frame_falloff)
bool do_vertex_color_points(const Brush &brush)
constexpr ParallelGrainSize grain_size(int grain_size)
void masked_fill(MutableSpan< T > data, const T &value, const IndexMask &mask)
T max(const T &a, const T &b)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE void copy_v3_v3(float r[3], const float a[3])
bool ED_grease_pencil_any_vertex_mask_selection(const ToolSettings *tool_settings)
ColorSceneLinear4f< eAlpha::Straight > ColorPaint4f
Paint * BKE_paint_get_active_from_context(const bContext *C)
Brush * BKE_paint_brush(Paint *paint)
Scene * CTX_data_scene(const bContext *C)
float3 BKE_brush_color_get(const Paint *paint, const Brush *brush)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
struct ToolSettings * toolsettings
float multi_frame_falloff
bke::greasepencil::Drawing & drawing