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

125{
126 if (m_samples_per_segment < 2) {
127 return;
128 }
129
130 const auto span = static_cast<size_t>(m_samples_per_segment - 1);
131
132 for (size_t i = 0; i < span; ++i) {
133 const size_t c0 = start_idx + std::min((i * 3) / span, size_t(3));
134 const size_t c1 = start_idx + std::min(((i + 1) * 3) / span, size_t(3));
135
136 LineVertex& v0 = dst[i * 2];
137 LineVertex& v1 = dst[i * 2 + 1];
138
139 v0.color = m_force_uniform_color ? m_current_color : curve_verts[c0].color;
140 v1.color = m_force_uniform_color ? m_current_color : curve_verts[c1].color;
141
142 v0.thickness = m_force_uniform_thickness ? m_current_thickness : curve_verts[c0].thickness;
143 v1.thickness = m_force_uniform_thickness ? m_current_thickness : curve_verts[c1].thickness;
144 }
145}
Kakshya::LineVertex LineVertex
Definition VertexSpec.hpp:8

References MayaFlux::Kakshya::LineVertex::color, 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: