IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
peak_icv_chromatic_adaption_algorithm.hpp
Go to the documentation of this file.
1
10#pragma once
11
12#include <peak_common_c/detail/peak_common_defines.h>
14#include <peak_icv_c/algorithms/preprocessing/peak_icv_color_matrix_transformation.h>
15
16#include <ostream>
17#include <string>
18
19namespace peak
20{
21namespace pipeline
22{
30{
32 Legacy = PEAK_ICV_CHROMATIC_ADAPTION_ALGORITHM_LEGACY,
33
35 Bradford = PEAK_ICV_CHROMATIC_ADAPTION_ALGORITHM_BRADFORD
36};
37
41PEAK_COMMON_NO_DISCARD inline std::string ToString(ChromaticAdaptionAlgorithm algorithm)
42{
44 {
45 return "Legacy";
46 }
48 {
49 return "Bradford";
50 }
51 const auto algStr = std::to_string(static_cast<int>(algorithm));
52 throw peak::icv::NotSupportedException("The given adaption algorithm " + algStr + " is unknown!");
53}
54
55inline std::ostream& operator<<(std::ostream& os, ChromaticAdaptionAlgorithm algorithm)
56{
57 return os << ToString(algorithm);
58}
59
60namespace detail
61{
62PEAK_COMMON_NO_DISCARD inline ChromaticAdaptionAlgorithm ToChromaticAdaptionAlgorithm(const std::string& algorithm)
63{
64 if (algorithm == "Legacy")
65 {
67 }
68 if (algorithm == "Bradford")
69 {
71 }
72 throw peak::icv::NotSupportedException("The given adaption algorithm " + algorithm + " is unknown!");
73}
74} // namespace detail
75} // namespace pipeline
76} // namespace peak
Occurs when a requested operation is not implemented or supported (e.g., exporting to an unsupported ...
ChromaticAdaptionAlgorithm
Algorithm used for chromatic adaption.
@ Legacy
Legacy adaption algorithm.
@ Bradford
Bradford adaption algorithm (Default).
ChromaticAdaptionAlgorithm ToChromaticAdaptionAlgorithm(const std::string &algorithm)
std::string ToString(BinningMode mode)
Converts a BinningMode enum value to its string representation.
std::ostream & operator<<(std::ostream &os, BinningMode mode)
Stream output operator for BinningMode enum.