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

◆ write_segment_attributes()

void MayaFlux::Nodes::GpuSync::PathGeneratorNode::write_segment_attributes ( const std::vector< LineVertex > &  curve_verts,
size_t  start_idx,
LineVertex *  dst 
) const
private

Write colour and thickness for one window, leaving positions intact.

Parameters
curve_vertsControl point source.
start_idxFirst control point of the window.
dstDestination for vertices_per_window() vertices.

Definition at line 79 of file PathGeneratorNode.cpp.

83{
84 if (m_samples_per_segment < 2) {
85 return;
86 }
87
88 const auto span = static_cast<size_t>(m_samples_per_segment - 1);
89
90 for (size_t i = 0; i < span; ++i) {
91 const size_t c0 = start_idx + std::min((i * 3) / span, size_t(3));
92 const size_t c1 = start_idx + std::min(((i + 1) * 3) / span, size_t(3));
93
94 LineVertex& v0 = dst[i * 2];
95 LineVertex& v1 = dst[i * 2 + 1];
96
97 v0.color = m_force_uniform_color ? m_current_color : curve_verts[c0].color;
98 v1.color = m_force_uniform_color ? m_current_color : curve_verts[c1].color;
99
100 v0.thickness = m_force_uniform_thickness ? m_current_thickness : curve_verts[c0].thickness;
101 v1.thickness = m_force_uniform_thickness ? m_current_thickness : curve_verts[c1].thickness;
102 }
103}
uint32_t * dst
Kakshya::LineVertex LineVertex
Definition VertexSpec.hpp:9

References MayaFlux::Kakshya::LineVertex::color, dst, m_current_color, m_current_thickness, m_force_uniform_color, m_force_uniform_thickness, m_samples_per_segment, and MayaFlux::Kakshya::LineVertex::thickness.

Referenced by refresh_attributes(), and write_curve_segment().

+ Here is the caller graph for this function: