qualpal 2.3.0
|
Qualitative color palette generation library. More...
Namespaces | |
namespace | colors |
Color representation classes for various color spaces. | |
namespace | metrics |
Color difference metrics for perceptual color comparison. | |
Classes | |
class | FixedMatrix |
Fixed-size matrix class with compile-time dimensions. More... | |
class | Matrix |
Dynamic matrix class with runtime-determined dimensions. More... | |
struct | PaletteAnalysis |
Holds analysis results for a color palette. More... | |
class | Qualpal |
Builder for qualitative color palette generation. More... | |
class | Threads |
Manages OpenMP thread settings across qualpal. More... | |
Typedefs | |
using | PaletteAnalysisMap = std::map< std::string, PaletteAnalysis > |
Map from vision deficiency type to palette analysis results. | |
Enumerations | |
enum class | ColorspaceType { HSL , LCHab } |
Supported cylindrical color spaces for input colors. More... | |
Functions | |
PaletteAnalysisMap | analyzePalette (const std::vector< colors::RGB > &colors, const metrics::MetricType &metric=metrics::MetricType::DIN99d, const std::map< std::string, double > &cvd={ { "deutan", 1.0 }, { "protan", 1.0 }, { "tritan", 1.0 } }, const std::optional< colors::RGB > &bg=std::nullopt, double max_memory=1.0) |
Analyze a color palette for normal and simulated color vision deficiencies. | |
template<typename ColorType , typename Metric = metrics::DIN99d> | |
Matrix< double > | colorDifferenceMatrix (const std::vector< ColorType > &colors, const Metric &metric=Metric{}, const double max_memory=1) |
Generate a color difference matrix. | |
Matrix< double > | colorDifferenceMatrix (const std::vector< colors::XYZ > &colors, const metrics::MetricType &metric_type, const double max_memory=1) |
Generate a color difference matrix for Lab colors with runtime metric selection. | |
Qualitative color palette generation library.
using qualpal::PaletteAnalysisMap = typedef std::map<std::string, PaletteAnalysis> |
|
strong |
PaletteAnalysisMap qualpal::analyzePalette | ( | const std::vector< colors::RGB > & | colors, |
const metrics::MetricType & | metric = metrics::MetricType::DIN99d , |
||
const std::map< std::string, double > & | cvd = { { "deutan", 1.0 }, { "protan", 1.0 }, { "tritan", 1.0 } } , |
||
const std::optional< colors::RGB > & | bg = std::nullopt , |
||
double | max_memory = 1.0 |
||
) |
Analyze a color palette for normal and simulated color vision deficiencies.
Computes color difference matrices and minimum color distances for the input palette, for normal vision as well as common color vision deficiencies (deutan, protan, tritan) at the specified severity. Results are returned as a map keyed by deficiency type.
colors | Vector of RGB colors to analyze. |
metric | Color difference metric to use. |
cvd | Map of CVD type to severity. |
bg | Optional background color to include in the analysis. |
max_memory | Maximum memory (in GB) allowed for the difference matrix. |
Matrix< double > qualpal::colorDifferenceMatrix | ( | const std::vector< colors::XYZ > & | colors, |
const metrics::MetricType & | metric_type, | ||
const double | max_memory = 1 |
||
) |
Generate a color difference matrix for Lab colors with runtime metric selection.
colors | Vector of XYZ colors to compare. |
metric_type | Color difference metric to use. |
max_memory | Maximum memory (in GB) allowed for the matrix. |
Matrix< double > qualpal::colorDifferenceMatrix | ( | const std::vector< ColorType > & | colors, |
const Metric & | metric = Metric{} , |
||
const double | max_memory = 1 |
||
) |
Generate a color difference matrix.
ColorType | Any color class (colors::RGB, colors::HSL, colors::XYZ, colors::Lab, colors::DIN99d) |
Metric | Color difference metric (defaults to metrics::DIN99d) |
colors | Vector of colors to compare |
metric | Color difference metric to use |
max_memory | Maximum memory (in GB) allowed for the matrix |
Definition at line 50 of file color_difference.h.