Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
ColorFunction Struct Referencefinal
Collaboration diagram for ColorFunction:
[legend]

Public Member Functions

Triplet GetColor (uint32_t row, Triplet defaultColor) const noexcept
 
void SetStop (size_t index, graphics::Color color, uint32_t position)
 

Public Attributes

std::array< std::pair< Triplet, uint32_t >, ColorFunctionStopsStops
 

Detailed Description

Definition at line 60 of file WaveBitmapCache.cpp.

Member Function Documentation

◆ GetColor()

Triplet ColorFunction::GetColor ( uint32_t  row,
Triplet  defaultColor 
) const
inlinenoexcept

Definition at line 64 of file WaveBitmapCache.cpp.

65 {
66 for (auto stop : Stops)
67 {
68 if (row < stop.second)
69 return stop.first;
70 }
71
72 return defaultColor;
73 }
std::array< std::pair< Triplet, uint32_t >, ColorFunctionStops > Stops

References Stops.

◆ SetStop()

void ColorFunction::SetStop ( size_t  index,
graphics::Color  color,
uint32_t  position 
)
inline

Definition at line 75 of file WaveBitmapCache.cpp.

76 {
77 assert(index < Stops.size());
78
79 Stops[index].first.SetColor(color);
80 Stops[index].second = position;
81 }

References Stops.

Member Data Documentation

◆ Stops

std::array<std::pair<Triplet, uint32_t>, ColorFunctionStops> ColorFunction::Stops

Definition at line 62 of file WaveBitmapCache.cpp.

Referenced by GetColor(), and SetStop().


The documentation for this struct was generated from the following file: