15 #include "colorSpace.h"
16 #include "config_util.h"
17 #include "configVariableEnum.h"
18 #include "string_utils.h"
26 parse_color_space_string(
const string &str) {
27 if (cmp_nocase_uh(str,
"linear") == 0 ||
28 cmp_nocase_uh(str,
"linear-rgb") == 0 ||
29 cmp_nocase_uh(str,
"lrgb") == 0) {
32 }
else if (cmp_nocase_uh(str,
"srgb") == 0) {
35 }
else if (cmp_nocase_uh(str,
"scrgb") == 0) {
38 }
else if (cmp_nocase_uh(str,
"unspecified") == 0) {
39 return CS_unspecified;
41 }
else if (cmp_nocase_uh(str,
"non-color") == 0) {
47 <<
"Invalid color_space string: " << str <<
"\n";
52 format_color_space(ColorSpace cs) {
59 operator << (ostream &out, ColorSpace cs) {
62 return out <<
"linear";
68 return out <<
"scRGB";
71 return out <<
"unspecified";
75 <<
"Invalid color_space value: " << (int)cs <<
"\n";
81 operator >> (istream &in, ColorSpace &cs) {
84 cs = parse_color_space_string(word);