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

◆ apply_color_gradient()

void MayaFlux::Nodes::Network::PointCloudNetwork::apply_color_gradient ( const glm::vec3 &  start_color,
const glm::vec3 &  end_color 
)

Set colors for all points.

Parameters
colorsVector of RGB colors

Apply linear color gradient across points

Parameters
start_colorColor for first point
end_colorColor for last point

Definition at line 228 of file PointCloudNetwork.cpp.

229{
230 const size_t count = m_cached_vertices.size();
231
232 for (size_t i = 0; i < count; ++i) {
233 const float t = count > 1 ? static_cast<float>(i) / static_cast<float>(count - 1) : 0.0F;
234 m_cached_vertices[i].color = glm::mix(start_color, end_color, t);
235 }
236
238
240 "Applied linear color gradient to {} points", count);
241}
#define MF_DEBUG(comp, ctx,...)
Eigen::Index count
void set_vertices(const std::vector< LineVertex > &vertices)
Set all point vertices.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References count, m_cached_vertices, MF_DEBUG, MayaFlux::Journal::NodeProcessing, MayaFlux::Journal::Nodes, and set_vertices().

+ Here is the call graph for this function: