opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
color_space.h
Go to the documentation of this file.
1#pragma once
2
3namespace osc
4{
5 // Used to indicate the encoding used when converting the color components of
6 // a texture between color spaces.
7 //
8 // It's necessary to provide this as additional information when implementations
9 // can't discern the color encoding of the color components they're handling, but
10 // need to discern it for conversion purposes.
11 //
12 // For example, image loaders might be able to decode a bitstream into red, green,
13 // and blue color components, but the bitstream may not contain enough metadata
14 // to tell the image loader what the colorspace of those components are. If the
15 // image then plans on using the image with the graphics backend (e.g. via `Texture2D`),
16 // and the graphics backend "anchors" shaders into a linear color space, then the
17 // loader needs to be able to tell the graphics backend whether (or not) to
18 // perform (e.g.) sRGB-to-linear conversion when loading the color components
19 // into a shader.
20 enum class ColorSpace {
21
22 // Indicates that the color components are encoded in a linear color space. This
23 // encoding typical for (e.g.) normal maps and other vector-encoded image formats.
24 Linear,
25
26 // Indicates that the color components are encoded in a sRGB color space. This
27 // implies that (e.g.) shaders need to perform sRGB <-> linear conversion when
28 // sampling from, or rendering to, the texture. This encoding is typical for
29 // (e.g.) albedo textures.
30 sRGB,
31
33 };
34}
Definition custom_decoration_generator.h:5
ColorSpace
Definition color_space.h:20