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
9
10#include <glm/glm.hpp>
11
12namespace 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 */
22{
23public:
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
Color space conversion utilities (sRGB <-> linear).
Definition: color_space.hpp:22
#define RE_API