Blender V5.3
paint_mask.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_array.hh"
12#include "BLI_function_ref.hh"
13#include "BLI_index_mask_fwd.hh"
14#include "BLI_set.hh"
15
16namespace blender {
17
18struct BMesh;
19struct BMVert;
20struct CCGKey;
21struct Depsgraph;
22struct Object;
23struct SubdivCCG;
24struct wmOperatorType;
25namespace bke::pbvh {
26class Node;
27}
28
29namespace ed::sculpt_paint::mask {
30
31Array<float> duplicate_mask(const Object &object);
32void mix_new_masks(Span<float> new_masks, float factor, MutableSpan<float> masks);
33void mix_new_masks(Span<float> new_masks, Span<float> factors, MutableSpan<float> masks);
34void clamp_mask(MutableSpan<float> masks);
35void invert_mask(MutableSpan<float> masks);
36
37void gather_mask_grids(const SubdivCCG &subdiv_ccg, Span<int> grids, MutableSpan<float> r_mask);
38void gather_mask_bmesh(const BMesh &bm, const Set<BMVert *, 0> &verts, MutableSpan<float> r_mask);
39
40void scatter_mask_grids(Span<float> mask, SubdivCCG &subdiv_ccg, Span<int> grids);
41void scatter_mask_bmesh(Span<float> mask, const BMesh &bm, const Set<BMVert *, 0> &verts);
42
43void average_neighbor_mask_bmesh(int mask_offset,
44 const Set<BMVert *, 0> &verts,
45 MutableSpan<float> new_masks);
46
48void write_mask_mesh(const Depsgraph &depsgraph,
49 Object &object,
50 const IndexMask &node_mask,
51 FunctionRef<void(MutableSpan<float>, Span<int>)> write_fn);
52
57void update_mask_mesh(const Depsgraph &depsgraph,
58 Object &object,
59 const IndexMask &node_mask,
60 FunctionRef<void(MutableSpan<float>, Span<int>)> update_fn);
61
63bool mask_equals_array_grids(Span<float> masks,
64 const CCGKey &key,
65 Span<int> grids,
66 Span<float> values);
67bool mask_equals_array_bmesh(int mask_offset, const Set<BMVert *, 0> &verts, Span<float> values);
68
69void PAINT_OT_mask_flood_fill(wmOperatorType *ot);
70void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot);
71void PAINT_OT_mask_box_gesture(wmOperatorType *ot);
72void PAINT_OT_mask_line_gesture(wmOperatorType *ot);
73void PAINT_OT_mask_polyline_gesture(wmOperatorType *ot);
74} // namespace ed::sculpt_paint::mask
75
76} // namespace blender
bool mask_equals_array_bmesh(const int mask_offset, const Set< BMVert *, 0 > &verts, const Span< float > values)
void scatter_mask_grids(const Span< float > mask, SubdivCCG &subdiv_ccg, const Span< int > grids)
void PAINT_OT_mask_polyline_gesture(wmOperatorType *ot)
bool mask_equals_array_grids(const Span< float > masks, const CCGKey &key, const Span< int > grids, const Span< float > values)
void PAINT_OT_mask_line_gesture(wmOperatorType *ot)
void write_mask_mesh(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, FunctionRef< void(MutableSpan< float >, Span< int >)> write_fn)
void update_mask_mesh(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, FunctionRef< void(MutableSpan< float >, Span< int >)> update_fn)
void scatter_mask_bmesh(const Span< float > mask, const BMesh &bm, const Set< BMVert *, 0 > &verts)
void gather_mask_bmesh(const BMesh &bm, const Set< BMVert *, 0 > &verts, const MutableSpan< float > r_mask)
void mix_new_masks(const Span< float > new_masks, const float factor, const MutableSpan< float > masks)
Definition paint_mask.cc:96
Array< float > duplicate_mask(const Object &object)
Definition paint_mask.cc:56
void invert_mask(const MutableSpan< float > masks)
void gather_mask_grids(const SubdivCCG &subdiv_ccg, const Span< int > grids, const MutableSpan< float > r_mask)
void PAINT_OT_mask_box_gesture(wmOperatorType *ot)
void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot)
void clamp_mask(const MutableSpan< float > masks)
void PAINT_OT_mask_flood_fill(wmOperatorType *ot)
void average_neighbor_mask_bmesh(const int mask_offset, const Set< BMVert *, 0 > &verts, const MutableSpan< float > new_masks)
BMesh Iterators.