|
numerics 0.1.0
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | Color |
| struct | Frame |
Functions | |
| inline ::Color | to_rl (Color c) |
| Color | from_rl (::Color c) |
| Color | unpack (uint32_t c) |
| Color | heat_color (float t) |
| t in [0,1]: blue -> cyan -> yellow -> red. | |
| Color | diverging_color (float t) |
| t in [-1,1]: deep blue -> black -> deep red. | |
| Color | phase_hsv_color (double prob, double phase, double max_prob) |
| Quantum wavefunction: hue = phase, brightness = sqrt(|psi|^2 / max). | |
| Color | lerp_color (Color a, Color b, float t) |
| Linear blend between two colors. | |
| template<class DrawFn > | |
| void | run (const char *title, int w, int h, DrawFn draw, Color bg={15, 15, 15, 255}) |
Variables | |
| constexpr Color | kBlack = {0, 0, 0, 255} |
| constexpr Color | kWhite = {255, 255, 255, 255} |
| constexpr Color | kRed = {220, 40, 40, 255} |
| constexpr Color | kGreen = {50, 200, 50, 255} |
| constexpr Color | kBlue = {50, 100, 230, 255} |
| constexpr Color | kYellow = {240, 220, 30, 255} |
| constexpr Color | kGray = {120, 120, 120, 255} |
| constexpr Color | kSkyBlue = {100, 180, 240, 255} |
|
inline |
|
inline |
|
inline |
Linear blend between two colors.
Definition at line 135 of file viz.hpp.
References num::viz::Color::a, num::viz::Color::b, num::viz::Color::g, and num::viz::Color::r.
|
inline |
| void num::viz::run | ( | const char * | title, |
| int | w, | ||
| int | h, | ||
| DrawFn | draw, | ||
| Color | bg = {15, 15, 15, 255} |
||
| ) |
| inline ::Color num::viz::to_rl | ( | Color | c | ) |
Definition at line 53 of file viz.hpp.
References num::viz::Color::a, num::viz::Color::b, num::viz::Color::g, and num::viz::Color::r.
Referenced by num::viz::Frame::circle(), num::viz::Frame::cube3d(), num::viz::Frame::dot(), num::viz::Frame::field(), num::viz::Frame::line(), num::viz::Frame::line3d(), num::viz::Frame::rect(), num::viz::Frame::rect_outline(), num::viz::Frame::sphere3d(), num::viz::Frame::sphere3d_wire(), num::viz::Frame::text(), and num::viz::Frame::textf().
|
inlineconstexpr |
Definition at line 43 of file viz.hpp.
Referenced by phase_hsv_color().
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |