Blender V4.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
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
16struct BMesh;
17struct BMVert;
18struct CCGKey;
19struct Depsgraph;
20struct Object;
21struct SubdivCCG;
22struct wmOperatorType;
23namespace blender::bke::pbvh {
24class Node;
25}
26
28
29Array<float> duplicate_mask(const Object &object);
30void mix_new_masks(Span<float> new_masks, Span<float> factors, MutableSpan<float> masks);
31void clamp_mask(MutableSpan<float> masks);
32void invert_mask(MutableSpan<float> masks);
33
34void gather_mask_grids(const SubdivCCG &subdiv_ccg, Span<int> grids, MutableSpan<float> r_mask);
35void gather_mask_bmesh(const BMesh &bm, const Set<BMVert *, 0> &verts, MutableSpan<float> r_mask);
36
37void scatter_mask_grids(Span<float> mask, SubdivCCG &subdiv_ccg, Span<int> grids);
38void scatter_mask_bmesh(Span<float> mask, const BMesh &bm, const Set<BMVert *, 0> &verts);
39
40void average_neighbor_mask_bmesh(int mask_offset,
41 const Set<BMVert *, 0> &verts,
42 MutableSpan<float> new_masks);
43
45void write_mask_mesh(const Depsgraph &depsgraph,
46 Object &object,
47 const IndexMask &node_mask,
48 FunctionRef<void(MutableSpan<float>, Span<int>)> write_fn);
49
54void update_mask_mesh(const Depsgraph &depsgraph,
55 Object &object,
56 const IndexMask &node_mask,
57 FunctionRef<void(MutableSpan<float>, Span<int>)> update_fn);
58
60bool mask_equals_array_grids(Span<float> masks,
61 const CCGKey &key,
62 Span<int> grids,
63 Span<float> values);
64bool mask_equals_array_bmesh(int mask_offset, const Set<BMVert *, 0> &verts, Span<float> values);
65
71} // namespace blender::ed::sculpt_paint::mask
ATTR_WARN_UNUSED_RESULT BMesh * bm
const Depsgraph * depsgraph
static float verts[][3]
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 mix_new_masks(const Span< float > new_masks, const Span< float > factors, const MutableSpan< float > masks)
Definition paint_mask.cc:98
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)
Array< float > duplicate_mask(const Object &object)
Definition paint_mask.cc:58
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)
wmOperatorType * ot
Definition wm_files.cc:4125