IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
peak_icv_processing_policy.hpp
Go to the documentation of this file.
1
11#pragma once
12
13#include <peak_common_c/detail/peak_common_defines.h>
15
16#include <string>
17
18namespace peak
19{
20namespace pipeline
21{
22
38{
44 Fast,
45
52
59};
60
69PEAK_COMMON_NO_DISCARD inline std::string ToString(ProcessingPolicy policy)
70{
71 switch (policy)
72 {
74 return "Fast";
76 return "Balanced";
78 return "Enhanced";
79 }
80
81 const auto policyStr = std::to_string(static_cast<int>(policy));
82 throw peak::icv::NotSupportedException("The given processing policy " + policyStr + " is unknown!");
83}
84
93inline std::ostream& operator<<(std::ostream& os, ProcessingPolicy policy)
94{
95 return os << ToString(policy);
96}
97
98namespace detail
99{
108PEAK_COMMON_NO_DISCARD inline ProcessingPolicy ToProcessingPolicy(const std::string& policy)
109{
110 if (policy == "Fast")
111 {
113 }
114 if (policy == "Balanced")
115 {
117 }
118 if (policy == "Enhanced")
119 {
121 }
122 throw peak::icv::NotSupportedException("The given processing policy " + policy + " is unknown! ");
123}
124} // namespace detail
125
126} // namespace pipeline
127} // namespace peak
Thrown when a requested operation is not implemented or supported.
ProcessingPolicy
Specifies the processing policy.
@ Balanced
Balance speed and quality.
ProcessingPolicy ToProcessingPolicy(const std::string &policy)
Converts a string representation to a ProcessingPolicy enum value.
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.