Cumulia Illustrator Rendering Engine v2.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
variantmaker.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 2025-08-05
15// Version V2.1.0
16//##################################################################################################
17
18#pragma once
19
20#include "../variant/types.h"
21
22#include <string>
23
24namespace cil
25{
26 // box2i
28 Box2iPtr _box2i(int xmin, int xmax, int ymin, int ymax);
29 Box2iPtr _box2i(const Vector2i& min, const Vector2i& max);
30 Box2iPtr _box2i(const Box2i& other);
31
32 // box2f
34 Box2fPtr _box2f(float xmin, float xmax, float ymin, float ymax);
35 Box2fPtr _box2f(const Vector2f& min, const Vector2f& max);
36 Box2fPtr _box2f(const Box2f& other);
37
38 // box3i
40 Box3iPtr _box3i(int xmin, int xmax, int ymin, int ymax, int zmin, int zmax);
41 Box3iPtr _box3i(const Vector3i& min, const Vector3i& max);
42 Box3iPtr _box3i(const Box3i& other);
43
44 // box3f
46 Box3fPtr _box3f(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax);
47 Box3fPtr _box3f(const Vector3f& min, const Vector3f& max);
48 Box3fPtr _box3f(const Box3f& other);
49
50 // boundingbox
52 BoundingBoxPtr _bbox(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax);
53 BoundingBoxPtr _bbox(const Vector3f& min, const Vector3f& max);
55
56 // clr3
58 Color3fPtr _clr3(float r, float g, float b);
59 Color3fPtr _clr3(const Color3f& other);
60 Color3fPtr _clr3(const Color3ub& other);
61 Color3fPtr _clr3(const Color4f& other);
62 Color3fPtr _clr3(const Color4ub& other);
63
64 // clr3ub
66 Color3ubPtr _clr3ub(unsigned char r, unsigned char g, unsigned char b);
71
72 // clr4
74 Color4fPtr _clr4(float r, float g, float b, float a);
75 Color4fPtr _clr4(const Color3f& other);
76 Color4fPtr _clr4(const Color3ub& other);
77 Color4fPtr _clr4(const Color4f& other);
78 Color4fPtr _clr4(const Color4ub& other);
79
80 // clr4ub
82 Color4ubPtr _clr4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
87
88 // image2d
89 Image2DPtr _image2d(int width, int height, unsigned char* data = nullptr);
90
91 // imageCube
92 ImageCubePtr _imageCube(const std::vector<Image2D>& images);
93
94 // integer
98
99 // mat2
101 Matrix2fPtr _mat2(float e00, float e01,
102 float e10, float e11);
104 const Vector2f& c1);
108
109 // mat3
111 Matrix3fPtr _mat3(float e00, float e01, float e02,
112 float e10, float e11, float e12,
113 float e20, float e21, float e22);
115 const Vector3f& c1,
116 const Vector3f& c2);
120
121 // mat4
123 Matrix4fPtr _mat4(float e00, float e01, float e02, float e03,
124 float e10, float e11, float e12, float e13,
125 float e20, float e21, float e22, float e23,
126 float e30, float e31, float e32, float e33);
128 const Vector4f& c1,
129 const Vector4f& c2,
130 const Vector4f& c3);
134
135 // minmax
137 MinMaxPtr _minmax(float min, float max);
138 MinMaxPtr _minmax(const MinMax& other);
139
140 // plane
142 PlanePtr _plane(float x, float y, float z, float w);
143 PlanePtr _plane(const Vector3f& origin, const Vector3f& normal);
144 PlanePtr _plane(const Plane& other);
145
146 // quat
148 QuaternionPtr _quat(float x, float y, float z, float w);
149 QuaternionPtr _quat(const Vector3f& axis, float angle);
151
152 // ray
154 RayPtr _ray(const Vector3f& origin, const Vector3f& normal);
155 RayPtr _ray(const Ray& other);
156
157 // real
159 RealPtr _real(float v);
160 RealPtr _real(const Real& other);
161
162 // source
163 VertexSourcePtr _vert(const std::string& text);
164 FragmentSourcePtr _frag(const std::string& text);
165 GeometrySourcePtr _geom(const std::string& text);
166
167 // i8array
168 Int8ArrayPtr _i8array(int size = 0, char* data = nullptr, bool copy = true);
169 Int8ArrayPtr _i8array(const std::initializer_list<char>& array);
170
171 // u8array
172 Uint8ArrayPtr _u8array(int size = 0, unsigned char* data = nullptr, bool copy = true);
173 Uint8ArrayPtr _u8array(const std::initializer_list<unsigned char>& array);
174
175 // i16array
176 Int16ArrayPtr _i16array(int size = 0, short* data = nullptr, bool copy = true);
177 Int16ArrayPtr _i16array(const std::initializer_list<short>& array);
178
179 // u16array
180 Uint16ArrayPtr _u16array(int size = 0, unsigned short* data = nullptr, bool copy = true);
181 Uint16ArrayPtr _u16array(const std::initializer_list<unsigned short>& array);
182
183 // i32array
184 Int32ArrayPtr _i32array(int size = 0, int* data = nullptr, bool copy = true);
185 Int32ArrayPtr _i32array(const std::initializer_list<int>& array);
186
187 // u32array
188 Uint32ArrayPtr _u32array(int size = 0, unsigned int* data = nullptr, bool copy = true);
189 Uint32ArrayPtr _u32array(const std::initializer_list<unsigned int>& array);
190
191 // f32array
192 Float32ArrayPtr _f32array(int size = 0, float* data = nullptr, bool copy = true);
193 Float32ArrayPtr _f32array(const std::initializer_list<float>& array);
194
195 // f64array
196 Float64ArrayPtr _f64array(int size = 0, double* data = nullptr, bool copy = true);
197 Float64ArrayPtr _f64array(const std::initializer_list<double>& array);
198
199 // ivec2
201 Vector2iPtr _ivec2(int x, int y);
205
206 // vec2
208 Vector2fPtr _vec2(float x, float y);
212
213 // ivec3
215 Vector3iPtr _ivec3(int x, int y, int z);
216 Vector3iPtr _ivec3(const Vector2i& other, int z = 0);
219
220 // vec3
222 Vector3fPtr _vec3(float x, float y, float z);
223 Vector3fPtr _vec3(const Vector2f& other, float z = 0);
226
227 // ivec4
229 Vector4iPtr _ivec4(int x, int y, int z, int w);
230 Vector4iPtr _ivec4(const Vector2i& other, int z = 0, int w = 0);
231 Vector4iPtr _ivec4(const Vector3i& other, int w = 0);
233
234 // vec4
236 Vector4fPtr _vec4(float x, float y, float z, float w);
237 Vector4fPtr _vec4(const Vector2f& other, float z = 0, float w = 0);
238 Vector4fPtr _vec4(const Vector3f& other, float w = 0);
240}
The BoundingBox class inherits from Box3, specilizing the template parameters to float for element ty...
Definition box.h:224
The Box2f class inherits from Box2, specilizing the template parameters to float for element type and...
Definition box.h:128
The Box2i class inherits from Box2, specilizing the template parameters to int for element type and V...
Definition box.h:119
The Box3f class inherits from Box3, specilizing the template parameters to float for element type and...
Definition box.h:214
The Box3i class inherits from Box3, specilizing the template parameters to int for element type and V...
Definition box.h:204
The Color3f class inherits from Color3, specilizing the template parameters to float for element type...
Definition color.h:105
The Color3ub class inherits from Color3, specilizing the template parameters to unsigned char for ele...
Definition color.h:116
The Color4f class inherits from Color4, specilizing the template parameters to float for element type...
Definition color.h:146
The Color4ub class inherits from Color4, specilizing the template parameters to unsigned char for ele...
Definition color.h:157
The Integer class inherits from the Tuple class and stores a single integer.
Definition integer.h:26
The Matrix2f class is 2 X 2 matrix.
Definition matrix.h:169
The Matrix3f class is 3 X 3 matrix.
Definition matrix.h:194
The Matrix4f class is 4 X 4 matrix.
Definition matrix.h:226
The MinMax class inherits from Tuple, specilizing the template parameters to float for element type.
Definition minmax.h:31
The Plane class inherits from the Tuple class, specilizing the templated parameter to float for eleme...
Definition plane.h:30
The Quaternion class inherits from the Tuple class, specilizing the templated parameter to float for ...
Definition quaternion.h:28
The Ray class inherits from the Tuple class, specilizing the templated parameter to float for element...
Definition ray.h:31
The Real class inherits from the Tuple class and stores a single float.
Definition real.h:26
The class Vector2f inherits from the templated class of Vector2, and the template parameters are spec...
Definition vector.h:268
The class Vector2i inherits from the templated class of Vector2, and the template parameters are spec...
Definition vector.h:255
The class Vector3f inherits from the templated class of Vector3, and the template parameters are spec...
Definition vector.h:322
The class Vector3i inherits from the templated class of Vector3, and the template parameters are spec...
Definition vector.h:312
The class Vector4f inherits from the templated class of Vector4, and the template parameters are spec...
Definition vector.h:366
The class Vector4i inherits from the templated class of Vector4, and the template parameters are spec...
Definition vector.h:354
Definition decal.h:23
std::shared_ptr< Integer > IntegerPtr
Definition types.h:60
Color3ubPtr _clr3ub()
std::shared_ptr< BoundingBox > BoundingBoxPtr
Definition types.h:36
Matrix2fPtr _mat2()
RayPtr _ray()
Float64ArrayPtr _f64array(int size=0, double *data=nullptr, bool copy=true)
std::shared_ptr< GeometrySource > GeometrySourcePtr
Definition types.h:98
Vector2fPtr _vec2()
std::shared_ptr< Float64Array > Float64ArrayPtr
Definition types.h:120
Uint32ArrayPtr _u32array(int size=0, unsigned int *data=nullptr, bool copy=true)
Uint16ArrayPtr _u16array(int size=0, unsigned short *data=nullptr, bool copy=true)
ImageCubePtr _imageCube(const std::vector< Image2D > &images)
Vector2iPtr _ivec2()
Vector4iPtr _ivec4()
std::shared_ptr< Color3ub > Color3ubPtr
Definition types.h:44
Matrix4fPtr _mat4()
Vector3iPtr _ivec3()
IntegerPtr _integer()
VertexSourcePtr _vert(const std::string &text)
std::shared_ptr< Float32Array > Float32ArrayPtr
Definition types.h:119
std::shared_ptr< Int8Array > Int8ArrayPtr
Definition types.h:113
Float32ArrayPtr _f32array(int size=0, float *data=nullptr, bool copy=true)
BoundingBoxPtr _bbox()
std::shared_ptr< Vector2f > Vector2fPtr
Definition types.h:133
QuaternionPtr _quat()
std::shared_ptr< Vector2i > Vector2iPtr
Definition types.h:136
std::shared_ptr< Plane > PlanePtr
Definition types.h:76
Box2fPtr _box2f()
std::shared_ptr< Matrix3f > Matrix3fPtr
Definition types.h:67
std::shared_ptr< Box2f > Box2fPtr
Definition types.h:32
std::shared_ptr< Int32Array > Int32ArrayPtr
Definition types.h:117
std::shared_ptr< Color4ub > Color4ubPtr
Definition types.h:46
std::shared_ptr< Box3i > Box3iPtr
Definition types.h:35
std::shared_ptr< Uint16Array > Uint16ArrayPtr
Definition types.h:116
Color3fPtr _clr3()
Vector3fPtr _vec3()
Int8ArrayPtr _i8array(int size=0, char *data=nullptr, bool copy=true)
std::shared_ptr< Box3f > Box3fPtr
Definition types.h:34
Int32ArrayPtr _i32array(int size=0, int *data=nullptr, bool copy=true)
std::shared_ptr< Uint8Array > Uint8ArrayPtr
Definition types.h:114
std::shared_ptr< Vector3f > Vector3fPtr
Definition types.h:134
std::shared_ptr< Matrix4f > Matrix4fPtr
Definition types.h:68
FragmentSourcePtr _frag(const std::string &text)
std::shared_ptr< Vector4i > Vector4iPtr
Definition types.h:138
std::shared_ptr< Real > RealPtr
Definition types.h:88
std::shared_ptr< ImageCube > ImageCubePtr
Definition types.h:55
GeometrySourcePtr _geom(const std::string &text)
std::shared_ptr< Box2i > Box2iPtr
Definition types.h:33
Matrix3fPtr _mat3()
std::shared_ptr< Color4f > Color4fPtr
Definition types.h:45
PlanePtr _plane()
std::shared_ptr< Color3f > Color3fPtr
Definition types.h:43
std::shared_ptr< MinMax > MinMaxPtr
Definition types.h:72
Color4ubPtr _clr4ub()
RealPtr _real()
std::shared_ptr< Image2D > Image2DPtr
Definition types.h:54
std::shared_ptr< FragmentSource > FragmentSourcePtr
Definition types.h:97
std::shared_ptr< Quaternion > QuaternionPtr
Definition types.h:80
std::shared_ptr< Ray > RayPtr
Definition types.h:84
Uint8ArrayPtr _u8array(int size=0, unsigned char *data=nullptr, bool copy=true)
Color4fPtr _clr4()
Box3iPtr _box3i()
std::shared_ptr< Uint32Array > Uint32ArrayPtr
Definition types.h:118
std::shared_ptr< Vector3i > Vector3iPtr
Definition types.h:137
std::shared_ptr< Int16Array > Int16ArrayPtr
Definition types.h:115
Vector4fPtr _vec4()
Image2DPtr _image2d(int width, int height, unsigned char *data=nullptr)
Box2iPtr _box2i()
Box3fPtr _box3f()
Int16ArrayPtr _i16array(int size=0, short *data=nullptr, bool copy=true)
std::shared_ptr< Matrix2f > Matrix2fPtr
Definition types.h:66
std::shared_ptr< VertexSource > VertexSourcePtr
Definition types.h:96
std::shared_ptr< Vector4f > Vector4fPtr
Definition types.h:135
MinMaxPtr _minmax()