MayaFlux 0.5.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 196 of file PathGeneratorNode.cpp.

197{
199 const size_t n = std::min(m_vertices.size(), m_control_points.size());
200 for (size_t i = 0; i < n; ++i) {
203 }
204 return;
205 }
206
208 const size_t num_points = m_control_points.size();
209 const size_t total = m_vertices.size();
210 if (num_points == 0 || total < 2) {
211 return;
212 }
213 for (size_t i = 0; i < total; ++i) {
214 const size_t ctrl_idx = std::min((i * (num_points - 1)) / (total - 1), num_points - 1);
216 m_vertices[i].thickness = m_force_uniform_thickness ? m_current_thickness : m_control_points[ctrl_idx].thickness;
217 }
218 return;
219 }
220
221 if (m_control_points.size() < 4) {
222 return;
223 }
224
225 const size_t per_window = vertices_per_window();
226 const size_t windows = m_control_points.size() - 3;
227
228 if (m_vertices.size() < windows * per_window) {
229 return;
230 }
231
232 for (size_t w = 0; w < windows; ++w) {
233 write_segment_attributes(m_control_points, w, m_vertices.data() + w * per_window);
234 }
235}
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, 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: