Enzo
Loading...
Searching...
No Matches
enzo::prm::Ramp Class Reference

A sampled snapshot of a ramp parameter read during cook. More...

#include <Ramp.h>

Classes

struct  Key
 A single ramp control point. More...
 

Public Member Functions

 Ramp (std::vector< Key > keys)
 
 Ramp (const Parameter &rampParameter)
 Snapshots a ramp parameter into a sorted ramp ready for sampling.
 
floatT sample (floatT position) const
 Samples the ramp at position.
 
bool empty () const
 
size_t size () const
 
const Keykey (size_t index) const
 

Detailed Description

A sampled snapshot of a ramp parameter read during cook.

Note
Construction bakes the curve into a dense lookup table, so sampling on the per point hotpath is just a clamp, an index, and a single blend between entries.

Member Function Documentation

◆ sample()

floatT enzo::prm::Ramp::sample ( floatT position) const
inline

Samples the ramp at position.

Returns
The interpolated value clamped to the end keys outside the ramp range.

The documentation for this class was generated from the following files: