Panda3D
colorSpace.h
1 // Filename: colorSpace.h
2 // Created by: rdb (02Jun14)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef COLORSPACE_H
16 #define COLORSPACE_H
17 
18 #include "pandabase.h"
19 
20 #include "typedef.h"
21 
22 BEGIN_PUBLISH
23 
24 enum ColorSpace {
25  // This value is not a color space, but is used to indicate that
26  // a color space has not been specified.
27  CS_unspecified = 0,
28 
29  // CS_linear is not a color space per se, but represents the
30  // working color space of graphics APIs, which is linearized. Since
31  // the conversion from sRGB to linear is defined, one could posit
32  // that it has the ITU-R BT.709 primaries, but this isn't meaningful
33  // as modern graphics APIs do not perform color management.
34  // All colors in Panda3D are linear unless otherwise specified.
35  CS_linear,
36 
37  // This is the standard, gamma-2.2-corrected sRGB color space, as
38  // used by the majority of image formats.
39  CS_sRGB,
40 
41  // This is a 16-bit encoded linear color space capable of encoding
42  // color values in the -0.5...7.4999 range.
43  CS_scRGB,
44 };
45 
46 EXPCL_PANDA_PUTIL ColorSpace parse_color_space_string(const string &str);
47 EXPCL_PANDA_PUTIL string format_color_space(ColorSpace cs);
48 
49 END_PUBLISH
50 
51 EXPCL_PANDA_PUTIL ostream &operator << (ostream &out, ColorSpace cs);
52 EXPCL_PANDA_PUTIL istream &operator >> (istream &in, ColorSpace &cs);
53 
54 #endif