Blender V5.3
curves_masks.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10
11#include "BKE_attribute.hh"
12#include "BKE_curves.hh"
13
14#include "ED_curves.hh"
15
16namespace blender::ed::curves {
17
19 const IndexMask &curves_mask,
20 const int amount_start,
21 const int amount_end,
22 const bool inverted,
23 IndexMaskMemory &memory)
24{
25 const OffsetIndices points_by_curve = curves.points_by_curve();
26
27 Array<bool> end_points(curves.points_num(), inverted ? false : true);
28 curves_mask.foreach_index(
29 [&](const int64_t curve_i) {
30 end_points.as_mutable_span()
31 .slice(points_by_curve[curve_i].drop_front(amount_start).drop_back(amount_end))
32 .fill(inverted ? true : false);
33 },
35
36 return IndexMask::from_bools(end_points, memory);
37}
38
40 const int amount_start,
41 const int amount_end,
42 const bool inverted,
43 IndexMaskMemory &memory)
44{
45 return end_points(curves, curves.curves_range(), amount_start, amount_end, inverted, memory);
46}
47
48} // namespace blender::ed::curves
Low-level operations for curves.
static IndexMask from_bools(Span< bool > bools, LinearAllocator<> &memory)
IndexMask slice(IndexRange range) const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
ccl_device_inline float3x3 inverted(const float3x3 m)
IndexMask end_points(const bke::CurvesGeometry &curves, const IndexMask &curves_mask, const int amount_start, const int amount_end, const bool inverted, IndexMaskMemory &memory)
constexpr ParallelGrainSize grain_size(int grain_size)
__int64 int64_t
Definition BKE_text.h:90