Rendering Engine
0.2.9
Modular Graphics Rendering Engine | v0.2.9
color_space.hpp
Go to the documentation of this file.
1
// This file is part of the Rendering Engine project.
2
// Author: Alexander Obzherin <alexanderobzherin@gmail.com>
3
// Copyright (c) 2026 Alexander Obzherin
4
// Distributed under the terms of the zlib License. See LICENSE.md for details.
5
6
#pragma once
7
8
#include "
rendering_engine_export.hpp
"
9
10
#include <glm/glm.hpp>
11
12
namespace
rendering_engine
13
{
14
/**
15
* @brief Color space conversion utilities (sRGB <-> linear).
16
*
17
* The rendering engine operates internally in linear color space.
18
* Use these helpers when converting colors from UI/design tools
19
* (typically sRGB) to linear space before rendering.
20
*/
21
class
RE_API
ColorSpace
22
{
23
public
:
24
/**
25
* @brief Converts a single sRGB channel to linear space.
26
*/
27
static
float
SRGBToLinear(
float
c);
28
/**
29
* @brief Converts an sRGB RGB color to linear space.
30
*/
31
static
glm::vec3 SRGBToLinear(
const
glm::vec3& color);
32
/**
33
* @brief Converts a single linear channel to sRGB space.
34
*/
35
static
float
LinearToSRGB(
float
c);
36
/**
37
* @brief Converts a single linear channel to sRGB space.
38
*/
39
static
glm::vec3 LinearToSRGB(
const
glm::vec3& color);
40
};
41
42
}
// namespace rendering_engine
rendering_engine::ColorSpace
Color space conversion utilities (sRGB <-> linear).
Definition:
color_space.hpp:22
rendering_engine
Definition:
actor.hpp:13
rendering_engine_export.hpp
RE_API
#define RE_API
Definition:
rendering_engine_export.hpp:10
RenderingEngine
RenderingLibrary
Include
color_space.hpp
Generated by
1.9.4