qualpal 2.3.0
Loading...
Searching...
No Matches
qualpal Namespace Reference

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.
 

Detailed Description

Qualitative color palette generation library.

Typedef Documentation

◆ PaletteAnalysisMap

using qualpal::PaletteAnalysisMap = typedef std::map<std::string, PaletteAnalysis>

Map from vision deficiency type to palette analysis results.

The key is a string representing the vision type ("normal", "deutan", "protan", "tritan").

Definition at line 43 of file analyze.h.

Enumeration Type Documentation

◆ ColorspaceType

enum class qualpal::ColorspaceType
strong

Supported cylindrical color spaces for input colors.

This enum defines the available cylindrical color spaces that can be used for generating palettes. Currently, it supports HSL (Hue, Saturation, Lightness) and LCHab (Lightness, Chroma, Hue in CIE Lab).

Definition at line 45 of file qualpal.h.

Function Documentation

◆ analyzePalette()

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.

Parameters
colorsVector of RGB colors to analyze.
metricColor difference metric to use.
cvdMap of CVD type to severity.
bgOptional background color to include in the analysis.
max_memoryMaximum memory (in GB) allowed for the difference matrix.
Returns
Map from CvdType to PaletteAnalysisResult for each vision type.

◆ colorDifferenceMatrix() [1/2]

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.

Parameters
colorsVector of XYZ colors to compare.
metric_typeColor difference metric to use.
max_memoryMaximum memory (in GB) allowed for the matrix.
Returns
Symmetric matrix of pairwise color differences.
See also
metrics::MetricType

◆ colorDifferenceMatrix() [2/2]

template<typename ColorType , typename Metric = metrics::DIN99d>
Matrix< double > qualpal::colorDifferenceMatrix ( const std::vector< ColorType > &  colors,
const Metric &  metric = Metric{},
const double  max_memory = 1 
)

Generate a color difference matrix.

Template Parameters
ColorTypeAny color class (colors::RGB, colors::HSL, colors::XYZ, colors::Lab, colors::DIN99d)
MetricColor difference metric (defaults to metrics::DIN99d)
Parameters
colorsVector of colors to compare
metricColor difference metric to use
max_memoryMaximum memory (in GB) allowed for the matrix
Returns
Symmetric matrix of pairwise color differences

Definition at line 50 of file color_difference.h.