Cumulia Illustrator Rendering Engine v1.0.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
converter.h
1//##################################################################################################
2//
3// Copyright (c) 2024 Beijing Qiongqi Tech Co.,Ltd. All rights reserved.
4
5// This source code is confidential and proprietary to Beijing Qiongqi Tech Co.,Ltd(The Holder).
6// Any unauthorized use, copying, modification, or distribution of the code is strictly prohibited.
7// Any user shall obtain authorizaition from the Holder before modifying the source code. And the user shall not
8// sublicense, sell, distribute, or transfer the source code, whether in original or modified form, to any third party
9// without the prior written consent of the Holder.
10
11// This copyright notice and permission grant shall be included in all copies or substantial portions of the source code.
12
13// Author Cumulia Illustrator
14// Date 2024-05-01
15// Version V1.0.0
16//##################################################################################################
17
18#pragma once
19
20#include <cilcore.h>
21
22#include <string>
23
24namespace cil
25{
26 class Rgb
27 {
28 public:
29 float r;
30 float g;
31 float b;
32 };
33
34 class Hsv
35 {
36 public:
37 float h;
38 float s;
39 float v;
40 };
41
42 class Hsl
43 {
44 public:
45 float h;
46 float s;
47 float l;
48 };
49
50 class Yuv
51 {
52 public:
53 float y;
54 float u;
55 float v;
56 };
57
58 Rgb toRgb(const Color3f& color);
59 Rgb toRgb(const Color4f& color);
60 Hsv toHsv(const Color3f& color);
61 Hsv toHsv(const Color4f& color);
62 Hsl toHsl(const Color3f& color);
63 Hsl toHsl(const Color4f& color);
64 Yuv toYuv(const Color3f& color);
65 Yuv toYuv(const Color4f& color);
66 std::string toHex(const Color3f& color);
67 std::string toHex(const Color4f& color);
68 Color3f fromRgb(const Rgb& rgb);
69 Color3f fromHsv(const Hsv& hsv);
70 Color3f fromHsl(const Hsl& hsl);
71 Color3f fromYuv(const Yuv& yuv);
72 Color3f fromHex(const std::string& hex);
73}
The Color3f class inherits from Color3, specilizing the template parameters to float for element type...
Definition color.h:105
The Color4f class inherits from Color4, specilizing the template parameters to float for element type...
Definition color.h:146
Definition converter.h:43
float l
Definition converter.h:47
float h
Definition converter.h:45
float s
Definition converter.h:46
Definition converter.h:35
float s
Definition converter.h:38
float h
Definition converter.h:37
float v
Definition converter.h:39
Definition converter.h:27
float g
Definition converter.h:30
float b
Definition converter.h:31
float r
Definition converter.h:29
Definition converter.h:51
float v
Definition converter.h:55
float u
Definition converter.h:54
float y
Definition converter.h:53
Definition decal.h:23
Color3f fromHex(const std::string &hex)
std::string toHex(const Color3f &color)
Color3f fromRgb(const Rgb &rgb)
Color3f fromYuv(const Yuv &yuv)
Hsl toHsl(const Color3f &color)
Yuv toYuv(const Color3f &color)
Color3f fromHsv(const Hsv &hsv)
Color3f fromHsl(const Hsl &hsl)
Hsv toHsv(const Color3f &color)
Rgb toRgb(const Color3f &color)