MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ refresh_attributes()

void MayaFlux::Nodes::GpuSync::PathGeneratorNode::refresh_attributes ( )
private

Rewrite colour and thickness over existing geometry, no curve evaluation.

Definition at line 173 of file PathGeneratorNode.cpp.

174{
176 const size_t n = std::min(m_vertices.size(), m_control_points.size());
177 for (size_t i = 0; i < n; ++i) {
180 }
181 return;
182 }
183
185 const size_t num_points = m_control_points.size();
186 const size_t total = m_vertices.size();
187 if (num_points == 0 || total < 2) {
188 return;
189 }
190 for (size_t i = 0; i < total; ++i) {
191 const size_t ctrl_idx = std::min((i * (num_points - 1)) / (total - 1), num_points - 1);
193 m_vertices[i].thickness = m_force_uniform_thickness ? m_current_thickness : m_control_points[ctrl_idx].thickness;
194 }
195 return;
196 }
197
198 if (m_control_points.size() < 4) {
199 return;
200 }
201
202 const size_t per_window = vertices_per_window();
203 const size_t windows = m_control_points.size() - 3;
204
205 if (m_vertices.size() < windows * per_window) {
206 return;
207 }
208
209 for (size_t w = 0; w < windows; ++w) {
210 write_segment_attributes(m_control_points, w, m_vertices.data() + w * per_window);
211 }
212}
uint32_t total
size_t vertices_per_window() const
Vertices emitted per four-point window.
std::vector< LineVertex > m_control_points
Control points, newest first: index 0 is the most recently added.
void write_segment_attributes(const std::vector< LineVertex > &curve_verts, size_t start_idx, LineVertex *dst) const
Write colour and thickness for one window, leaving positions intact.

References MayaFlux::Kinesis::CUSTOM, MayaFlux::Kinesis::LINEAR, m_control_points, m_current_color, m_current_thickness, m_force_uniform_color, m_force_uniform_thickness, m_mode, m_vertices, total, vertices_per_window(), and write_segment_attributes().

Referenced by compute_frame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: