Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
ColormapService.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
12
13#include <cstdint>
14#include <optional>
15#include <span>
16#include <string_view>
17
19
21
26enum class ColormapType : uint8_t { Viridis = 0, Plasma = 1, Coolwarm = 2, Turbo = 3 };
27
36public:
37 ColormapService() = delete;
38
46 [[nodiscard]] static RgbaColor sample(double value, ColormapType type) noexcept;
47
53 [[nodiscard]] static std::span<const RgbaColor, 256> getLut(ColormapType type) noexcept;
54
60 [[nodiscard]] static std::string_view name(ColormapType type) noexcept;
61
67 [[nodiscard]] static std::optional<ColormapType> fromString(std::string_view name) noexcept;
68};
69
70} // namespace correlation::plotters
CPK color palette and visualization radii for atomic 3D rendering.
static std::span< const RgbaColor, 256 > getLut(ColormapType type) noexcept
Returns a non-owning span over the 256-entry precomputed look-up table.
Definition ColormapService.cpp:1072
static RgbaColor sample(double value, ColormapType type) noexcept
Samples a color from the specified colormap at normalized parameter value in [0.0,...
Definition ColormapService.cpp:1060
static std::string_view name(ColormapType type) noexcept
Returns the human-readable display name of a colormap.
Definition ColormapService.cpp:1086
static std::optional< ColormapType > fromString(std::string_view name) noexcept
Parses a colormap from its display name (case-insensitive).
Definition ColormapService.cpp:1100
Definition ColormapService.hpp:18
ColormapType
Supported scientific colormaps for scalar mapping.
Definition ColormapService.hpp:26
@ Turbo
Definition ColormapService.hpp:26
@ Viridis
Definition ColormapService.hpp:26
@ Plasma
Definition ColormapService.hpp:26
@ Coolwarm
Definition ColormapService.hpp:26
8-bit RGBA color representation for vertex colors and framebuffers.
Definition ElementColors.hpp:23