Blender  V3.3
BKE_curves_utils.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
5 #include "BKE_curves.hh"
6 
12 #include "BLI_function_ref.hh"
13 #include "BLI_generic_pointer.hh"
14 
15 namespace blender::bke::curves {
16 
22 void copy_point_data(const CurvesGeometry &src_curves,
23  const CurvesGeometry &dst_curves,
24  Span<IndexRange> curve_ranges,
25  GSpan src,
26  GMutableSpan dst);
27 
28 void copy_point_data(const CurvesGeometry &src_curves,
29  const CurvesGeometry &dst_curves,
30  IndexMask src_curve_selection,
31  GSpan src,
32  GMutableSpan dst);
33 
34 template<typename T>
35 void copy_point_data(const CurvesGeometry &src_curves,
36  const CurvesGeometry &dst_curves,
37  const IndexMask src_curve_selection,
38  const Span<T> src,
39  MutableSpan<T> dst)
40 {
41  copy_point_data(src_curves, dst_curves, src_curve_selection, GSpan(src), GMutableSpan(dst));
42 }
43 
45  IndexMask curve_selection,
46  GPointer value,
47  GMutableSpan dst);
48 
49 template<typename T>
51  const IndexMask curve_selection,
52  const T &value,
53  MutableSpan<T> dst)
54 {
55  fill_points(curves, curve_selection, &value, dst);
56 }
57 
64 
69  Span<IndexRange> curve_ranges,
70  MutableSpan<int> counts);
71 
75 void accumulate_counts_to_offsets(MutableSpan<int> counts_to_offsets, int start_offset = 0);
76 
78  const std::array<int, CURVE_TYPES_NUM> &type_counts,
79  const CurveType type,
80  const IndexMask selection,
81  Vector<int64_t> &r_indices);
82 
84  const std::array<int, CURVE_TYPES_NUM> &type_counts,
85  IndexMask selection,
86  FunctionRef<void(IndexMask)> catmull_rom_fn,
87  FunctionRef<void(IndexMask)> poly_fn,
88  FunctionRef<void(IndexMask)> bezier_fn,
89  FunctionRef<void(IndexMask)> nurbs_fn);
90 
91 } // namespace blender::bke::curves
Low-level operations for curves.
CurveType
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
SyclQueue void void * src
static char ** types
Definition: makesdna.c:67
#define T
void fill_curve_counts(const bke::CurvesGeometry &curves, Span< IndexRange > curve_ranges, MutableSpan< int > counts)
Definition: curves_utils.cc:13
IndexMask indices_for_type(const VArray< int8_t > &types, const std::array< int, CURVE_TYPES_NUM > &type_counts, const CurveType type, const IndexMask selection, Vector< int64_t > &r_indices)
Definition: curves_utils.cc:99
void accumulate_counts_to_offsets(MutableSpan< int > counts_to_offsets, int start_offset=0)
Definition: curves_utils.cc:28
bke::CurvesGeometry copy_only_curve_domain(const bke::CurvesGeometry &src_curves)
Definition: curves_utils.cc:87
void fill_points(const CurvesGeometry &curves, IndexMask curve_selection, GPointer value, GMutableSpan dst)
Definition: curves_utils.cc:72
void copy_point_data(const CurvesGeometry &src_curves, const CurvesGeometry &dst_curves, Span< IndexRange > curve_ranges, GSpan src, GMutableSpan dst)
Definition: curves_utils.cc:40
void foreach_curve_by_type(const VArray< int8_t > &types, const std::array< int, CURVE_TYPES_NUM > &type_counts, IndexMask selection, FunctionRef< void(IndexMask)> catmull_rom_fn, FunctionRef< void(IndexMask)> poly_fn, FunctionRef< void(IndexMask)> bezier_fn, FunctionRef< void(IndexMask)> nurbs_fn)