Unravel Engine C++ Reference
Loading...
Searching...
No Matches
texture.cpp
Go to the documentation of this file.
1#include "texture.hpp"
2#include "entt/core/fwd.hpp"
3#include "graphics/texture.h"
5
6namespace gfx
7{
8
10{
11
12 entt::meta_factory<texture_format>{}
13 .type("texture_format"_hs)
15 entt::attribute{"name", "texture_format"},
16 entt::attribute{"pretty_name", "Texture Format"},
17 })
18 .data<texture_format::BC1>("BC1"_hs)
20 entt::attribute{"name", "BC1"},
21 entt::attribute{"pretty_name", "BC1 (DXT1 R5G6B5A1)"},
22 })
23 .data<texture_format::BC2>("BC2"_hs)
25 entt::attribute{"name", "BC2"},
26 entt::attribute{"pretty_name", "BC2 (DXT3 R5G6B5A4)"},
27 })
28 .data<texture_format::BC3>("BC3"_hs)
30 entt::attribute{"name", "BC3"},
31 entt::attribute{"pretty_name", "BC3 (DXT5 R5G6B5A8)"},
32 })
33 .data<texture_format::BC4>("BC4"_hs)
35 entt::attribute{"name", "BC4"},
36 entt::attribute{"pretty_name", "BC4 (LATC1/ATI1 R8)"},
37 })
38 .data<texture_format::BC5>("BC5"_hs)
40 entt::attribute{"name", "BC5"},
41 entt::attribute{"pretty_name", "BC5 (LATC2/ATI2 RG8)"},
42 })
43 .data<texture_format::BC6H>("BC6H"_hs)
45 entt::attribute{"name", "BC6H"},
46 entt::attribute{"pretty_name", "BC6H (BC6H RGB16F)"},
47 })
48 .data<texture_format::BC7>("BC7"_hs)
50 entt::attribute{"name", "BC7"},
51 entt::attribute{"pretty_name", "BC7 (BC7 RGB 4-7 bits per color channel, 0-8 bits alpha)"},
52 })
53 .data<texture_format::ETC1>("ETC1"_hs)
55 entt::attribute{"name", "ETC1"},
56 entt::attribute{"pretty_name", "ETC1 (ETC1 RGB8)"},
57 })
58 .data<texture_format::ETC2>("ETC2"_hs)
60 entt::attribute{"name", "ETC2"},
61 entt::attribute{"pretty_name", "ETC2 (ETC2 RGB8)"},
62 })
63 .data<texture_format::ETC2A>("ETC2A"_hs)
65 entt::attribute{"name", "ETC2A"},
66 entt::attribute{"pretty_name", "ETC2A (ETC2 RGBA8)"},
67 })
68 .data<texture_format::ETC2A1>("ETC2A1"_hs)
70 entt::attribute{"name", "ETC2A1"},
71 entt::attribute{"pretty_name", "ETC2A1 (ETC2 RGB8A1)"},
72 })
73 .data<texture_format::PTC12>("PTC12"_hs)
75 entt::attribute{"name", "PTC12"},
76 entt::attribute{"pretty_name", "PTC12 (PVRTC1 RGB 2BPP)"},
77 })
78 .data<texture_format::PTC14>("PTC14"_hs)
80 entt::attribute{"name", "PTC14"},
81 entt::attribute{"pretty_name", "PTC14 (PVRTC1 RGB 4BPP)"},
82 })
83 .data<texture_format::PTC12A>("PTC12A"_hs)
85 entt::attribute{"name", "PTC12A"},
86 entt::attribute{"pretty_name", "PTC12A (PVRTC1 RGBA 2BPP)"},
87 })
88 .data<texture_format::PTC14A>("PTC14A"_hs)
90 entt::attribute{"name", "PTC14A"},
91 entt::attribute{"pretty_name", "PTC14A (PVRTC1 RGBA 4BPP)"},
92 })
93 .data<texture_format::PTC22>("PTC22"_hs)
95 entt::attribute{"name", "PTC22"},
96 entt::attribute{"pretty_name", "PTC22 (PVRTC2 RGBA 2BPP)"},
97 })
98 .data<texture_format::PTC24>("PTC24"_hs)
100 entt::attribute{"name", "PTC24"},
101 entt::attribute{"pretty_name", "PTC24 (PVRTC2 RGBA 4BPP)"},
102 })
103 .data<texture_format::ATC>("ATC"_hs)
105 entt::attribute{"name", "ATC"},
106 entt::attribute{"pretty_name", "ATC (ATC RGB 4BPP)"},
107 })
108 .data<texture_format::ATCE>("ATCE"_hs)
110 entt::attribute{"name", "ATCE"},
111 entt::attribute{"pretty_name", "ATCE (ATCE RGBA 8 BPP explicit alpha)"},
112 })
113 .data<texture_format::ATCI>("ATCI"_hs)
115 entt::attribute{"name", "ATCI"},
116 entt::attribute{"pretty_name", "ATCI (ATCI RGBA 8 BPP interpolated alpha)"},
117 })
118 .data<texture_format::ASTC4x4>("ASTC4x4"_hs)
120 entt::attribute{"name", "ASTC4x4"},
121 entt::attribute{"pretty_name", "ASTC4x4 (ASTC 4x4 8.0 BPP)"},
122 })
123 .data<texture_format::ASTC5x4>("ASTC5x4"_hs)
125 entt::attribute{"name", "ASTC5x4"},
126 entt::attribute{"pretty_name", "ASTC5x4 (ASTC 5x4 6.40 BPP)"},
127 })
128 .data<texture_format::ASTC5x5>("ASTC5x5"_hs)
130 entt::attribute{"name", "ASTC5x5"},
131 entt::attribute{"pretty_name", "ASTC5x5 (ASTC 5x5 5.12 BPP)"},
132 })
133 .data<texture_format::ASTC6x5>("ASTC6x5"_hs)
135 entt::attribute{"name", "ASTC6x5"},
136 entt::attribute{"pretty_name", "ASTC6x5 (ASTC 6x5 4.27 BPP)"},
137 })
138 .data<texture_format::ASTC6x6>("ASTC6x6"_hs)
140 entt::attribute{"name", "ASTC6x6"},
141 entt::attribute{"pretty_name", "ASTC6x6 (ASTC 6x6 3.56 BPP)"},
142 })
143 .data<texture_format::ASTC8x5>("ASTC8x5"_hs)
145 entt::attribute{"name", "ASTC8x5"},
146 entt::attribute{"pretty_name", "ASTC8x5 (ASTC 8x5 3.20 BPP)"},
147 })
148 .data<texture_format::ASTC8x6>("ASTC8x6"_hs)
150 entt::attribute{"name", "ASTC8x6"},
151 entt::attribute{"pretty_name", "ASTC8x6 (ASTC 8x6 2.67 BPP)"},
152 })
153 .data<texture_format::ASTC8x8>("ASTC8x8"_hs)
155 entt::attribute{"name", "ASTC8x8"},
156 entt::attribute{"pretty_name", "ASTC8x8 (ASTC 8x8 2.00 BPP)"},
157 })
158 .data<texture_format::ASTC10x5>("ASTC10x5"_hs)
160 entt::attribute{"name", "ASTC10x5"},
161 entt::attribute{"pretty_name", "ASTC10x5 (ASTC 10x5 2.56 BPP)"},
162 })
163 .data<texture_format::ASTC10x6>("ASTC10x6"_hs)
165 entt::attribute{"name", "ASTC10x6"},
166 entt::attribute{"pretty_name", "ASTC10x6 (ASTC 10x6 2.13 BPP)"},
167 })
168 .data<texture_format::ASTC10x8>("ASTC10x8"_hs)
170 entt::attribute{"name", "ASTC10x8"},
171 entt::attribute{"pretty_name", "ASTC10x8 (ASTC 10x8 1.60 BPP)"},
172 })
173 .data<texture_format::ASTC10x10>("ASTC10x10"_hs)
175 entt::attribute{"name", "ASTC10x10"},
176 entt::attribute{"pretty_name", "ASTC10x10 (ASTC 10x10 1.28 BPP)"},
177 })
178 .data<texture_format::ASTC12x10>("ASTC12x10"_hs)
180 entt::attribute{"name", "ASTC12x10"},
181 entt::attribute{"pretty_name", "ASTC12x10 (ASTC 12x10 1.07 BPP)"},
182 })
183 .data<texture_format::ASTC12x12>("ASTC12x12"_hs)
185 entt::attribute{"name", "ASTC12x12"},
186 entt::attribute{"pretty_name", "ASTC12x12 (ASTC 12x12 0.89 BPP)"},
187 })
188 .data<texture_format::Unknown>("Unknown"_hs)
190 entt::attribute{"name", "Unknown"},
191 entt::attribute{"pretty_name", "Unknown"},
192 })
193 .data<texture_format::R1>("R1"_hs)
195 entt::attribute{"name", "R1"},
196 entt::attribute{"pretty_name", "R1"},
197 })
198 .data<texture_format::A8>("A8"_hs)
200 entt::attribute{"name", "A8"},
201 entt::attribute{"pretty_name", "A8"},
202 })
203 .data<texture_format::R8>("R8"_hs)
205 entt::attribute{"name", "R8"},
206 entt::attribute{"pretty_name", "R8"},
207 })
208 .data<texture_format::R8I>("R8I"_hs)
210 entt::attribute{"name", "R8I"},
211 entt::attribute{"pretty_name", "R8I"},
212 })
213 .data<texture_format::R8U>("R8U"_hs)
215 entt::attribute{"name", "R8U"},
216 entt::attribute{"pretty_name", "R8U"},
217 })
218 .data<texture_format::R8S>("R8S"_hs)
220 entt::attribute{"name", "R8S"},
221 entt::attribute{"pretty_name", "R8S"},
222 })
223 .data<texture_format::R16>("R16"_hs)
225 entt::attribute{"name", "R16"},
226 entt::attribute{"pretty_name", "R16"},
227 })
228 .data<texture_format::R16I>("R16I"_hs)
230 entt::attribute{"name", "R16I"},
231 entt::attribute{"pretty_name", "R16I"},
232 })
233 .data<texture_format::R16U>("R16U"_hs)
235 entt::attribute{"name", "R16U"},
236 entt::attribute{"pretty_name", "R16U"},
237 })
238 .data<texture_format::R16F>("R16F"_hs)
240 entt::attribute{"name", "R16F"},
241 entt::attribute{"pretty_name", "R16F"},
242 })
243 .data<texture_format::R16S>("R16S"_hs)
245 entt::attribute{"name", "R16S"},
246 entt::attribute{"pretty_name", "R16S"},
247 })
248 .data<texture_format::R32I>("R32I"_hs)
250 entt::attribute{"name", "R32I"},
251 entt::attribute{"pretty_name", "R32I"},
252 })
253 .data<texture_format::R32U>("R32U"_hs)
255 entt::attribute{"name", "R32U"},
256 entt::attribute{"pretty_name", "R32U"},
257 })
258 .data<texture_format::R32F>("R32F"_hs)
260 entt::attribute{"name", "R32F"},
261 entt::attribute{"pretty_name", "R32F"},
262 })
263 .data<texture_format::RG8>("RG8"_hs)
265 entt::attribute{"name", "RG8"},
266 entt::attribute{"pretty_name", "RG8"},
267 })
268 .data<texture_format::RG8I>("RG8I"_hs)
270 entt::attribute{"name", "RG8I"},
271 entt::attribute{"pretty_name", "RG8I"},
272 })
273 .data<texture_format::RG8U>("RG8U"_hs)
275 entt::attribute{"name", "RG8U"},
276 entt::attribute{"pretty_name", "RG8U"},
277 })
278 .data<texture_format::RG8S>("RG8S"_hs)
280 entt::attribute{"name", "RG8S"},
281 entt::attribute{"pretty_name", "RG8S"},
282 })
283 .data<texture_format::RG16>("RG16"_hs)
285 entt::attribute{"name", "RG16"},
286 entt::attribute{"pretty_name", "RG16"},
287 })
288 .data<texture_format::RG16I>("RG16I"_hs)
290 entt::attribute{"name", "RG16I"},
291 entt::attribute{"pretty_name", "RG16I"},
292 })
293 .data<texture_format::RG16U>("RG16U"_hs)
295 entt::attribute{"name", "RG16U"},
296 entt::attribute{"pretty_name", "RG16U"},
297 })
298 .data<texture_format::RG16F>("RG16F"_hs)
300 entt::attribute{"name", "RG16F"},
301 entt::attribute{"pretty_name", "RG16F"},
302 })
303 .data<texture_format::RG16S>("RG16S"_hs)
305 entt::attribute{"name", "RG16S"},
306 entt::attribute{"pretty_name", "RG16S"},
307 })
308 .data<texture_format::RG32I>("RG32I"_hs)
310 entt::attribute{"name", "RG32I"},
311 entt::attribute{"pretty_name", "RG32I"},
312 })
313 .data<texture_format::RG32U>("RG32U"_hs)
315 entt::attribute{"name", "RG32U"},
316 entt::attribute{"pretty_name", "RG32U"},
317 })
318 .data<texture_format::RG32F>("RG32F"_hs)
320 entt::attribute{"name", "RG32F"},
321 entt::attribute{"pretty_name", "RG32F"},
322 })
323 .data<texture_format::RGB8>("RGB8"_hs)
325 entt::attribute{"name", "RGB8"},
326 entt::attribute{"pretty_name", "RGB8"},
327 })
328 .data<texture_format::RGB8I>("RGB8I"_hs)
330 entt::attribute{"name", "RGB8I"},
331 entt::attribute{"pretty_name", "RGB8I"},
332 })
333 .data<texture_format::RGB8U>("RGB8U"_hs)
335 entt::attribute{"name", "RGB8U"},
336 entt::attribute{"pretty_name", "RGB8U"},
337 })
338 .data<texture_format::RGB8S>("RGB8S"_hs)
340 entt::attribute{"name", "RGB8S"},
341 entt::attribute{"pretty_name", "RGB8S"},
342 })
343 .data<texture_format::RGB9E5F>("RGB9E5F"_hs)
345 entt::attribute{"name", "RGB9E5F"},
346 entt::attribute{"pretty_name", "RGB9E5F"},
347 })
348 .data<texture_format::BGRA8>("BGRA8"_hs)
350 entt::attribute{"name", "BGRA8"},
351 entt::attribute{"pretty_name", "BGRA8"},
352 })
353 .data<texture_format::RGBA8>("RGBA8"_hs)
355 entt::attribute{"name", "RGBA8"},
356 entt::attribute{"pretty_name", "RGBA8"},
357 })
358 .data<texture_format::RGBA8I>("RGBA8I"_hs)
360 entt::attribute{"name", "RGBA8I"},
361 entt::attribute{"pretty_name", "RGBA8I"},
362 })
363 .data<texture_format::RGBA8U>("RGBA8U"_hs)
365 entt::attribute{"name", "RGBA8U"},
366 entt::attribute{"pretty_name", "RGBA8U"},
367 })
368 .data<texture_format::RGBA8S>("RGBA8S"_hs)
370 entt::attribute{"name", "RGBA8S"},
371 entt::attribute{"pretty_name", "RGBA8S"},
372 })
373 .data<texture_format::RGBA16>("RGBA16"_hs)
375 entt::attribute{"name", "RGBA16"},
376 entt::attribute{"pretty_name", "RGBA16"},
377 })
378 .data<texture_format::RGBA16I>("RGBA16I"_hs)
380 entt::attribute{"name", "RGBA16I"},
381 entt::attribute{"pretty_name", "RGBA16I"},
382 })
383 .data<texture_format::RGBA16U>("RGBA16U"_hs)
385 entt::attribute{"name", "RGBA16U"},
386 entt::attribute{"pretty_name", "RGBA16U"},
387 })
388 .data<texture_format::RGBA16F>("RGBA16F"_hs)
390 entt::attribute{"name", "RGBA16F"},
391 entt::attribute{"pretty_name", "RGBA16F"},
392 })
393 .data<texture_format::RGBA16S>("RGBA16S"_hs)
395 entt::attribute{"name", "RGBA16S"},
396 entt::attribute{"pretty_name", "RGBA16S"},
397 })
398 .data<texture_format::RGBA32I>("RGBA32I"_hs)
400 entt::attribute{"name", "RGBA32I"},
401 entt::attribute{"pretty_name", "RGBA32I"},
402 })
403 .data<texture_format::RGBA32U>("RGBA32U"_hs)
405 entt::attribute{"name", "RGBA32U"},
406 entt::attribute{"pretty_name", "RGBA32U"},
407 })
408 .data<texture_format::RGBA32F>("RGBA32F"_hs)
410 entt::attribute{"name", "RGBA32F"},
411 entt::attribute{"pretty_name", "RGBA32F"},
412 })
413 .data<texture_format::B5G6R5>("B5G6R5"_hs)
415 entt::attribute{"name", "B5G6R5"},
416 entt::attribute{"pretty_name", "B5G6R5"},
417 })
418 .data<texture_format::R5G6B5>("R5G6B5"_hs)
420 entt::attribute{"name", "R5G6B5"},
421 entt::attribute{"pretty_name", "R5G6B5"},
422 })
423 .data<texture_format::BGRA4>("BGRA4"_hs)
425 entt::attribute{"name", "BGRA4"},
426 entt::attribute{"pretty_name", "BGRA4"},
427 })
428 .data<texture_format::RGBA4>("RGBA4"_hs)
430 entt::attribute{"name", "RGBA4"},
431 entt::attribute{"pretty_name", "RGBA4"},
432 })
433 .data<texture_format::BGR5A1>("BGR5A1"_hs)
435 entt::attribute{"name", "BGR5A1"},
436 entt::attribute{"pretty_name", "BGR5A1"},
437 })
438 .data<texture_format::RGB5A1>("RGB5A1"_hs)
440 entt::attribute{"name", "RGB5A1"},
441 entt::attribute{"pretty_name", "RGB5A1"},
442 })
443 .data<texture_format::RGB10A2>("RGB10A2"_hs)
445 entt::attribute{"name", "RGB10A2"},
446 entt::attribute{"pretty_name", "RGB10A2"},
447 })
448 .data<texture_format::RG11B10F>("RG11B10F"_hs)
450 entt::attribute{"name", "RG11B10F"},
451 entt::attribute{"pretty_name", "RG11B10F"},
452 })
453 .data<texture_format::UnknownDepth>("UnknownDepth"_hs)
455 entt::attribute{"name", "UnknownDepth"},
456 entt::attribute{"pretty_name", "UnknownDepth"},
457 })
458 .data<texture_format::D16>("D16"_hs)
460 entt::attribute{"name", "D16"},
461 entt::attribute{"pretty_name", "D16"},
462 })
463 .data<texture_format::D24>("D24"_hs)
465 entt::attribute{"name", "D24"},
466 entt::attribute{"pretty_name", "D24"},
467 })
468 .data<texture_format::D24S8>("D24S8"_hs)
470 entt::attribute{"name", "D24S8"},
471 entt::attribute{"pretty_name", "D24S8"},
472 })
473 .data<texture_format::D32>("D32"_hs)
475 entt::attribute{"name", "D32"},
476 entt::attribute{"pretty_name", "D32"},
477 })
478 .data<texture_format::D16F>("D16F"_hs)
480 entt::attribute{"name", "D16F"},
481 entt::attribute{"pretty_name", "D16F"},
482 })
483 .data<texture_format::D24F>("D24F"_hs)
485 entt::attribute{"name", "D24F"},
486 entt::attribute{"pretty_name", "D24F"},
487 })
488 .data<texture_format::D32F>("D32F"_hs)
490 entt::attribute{"name", "D32F"},
491 entt::attribute{"pretty_name", "D32F"},
492 })
493 .data<texture_format::D0S8>("D0S8"_hs)
495 entt::attribute{"name", "D0S8"},
496 entt::attribute{"pretty_name", "D0S8"},
497 })
498 .data<texture_format::Count>("Count"_hs)
500 entt::attribute{"name", "Count"},
501 entt::attribute{"pretty_name", "Count"},
502 });
503
504 entt::meta_factory<texture_info>{}
505 .type("texture_info"_hs)
507 entt::attribute{"name", "texture_info"},
508 entt::attribute{"pretty_name", "Texture Info"},
509 })
510 .data<nullptr, &texture_info::format>("format"_hs)
512 entt::attribute{"name", "format"},
513 entt::attribute{"pretty_name", "Format"}
514 })
515 .data<nullptr, &texture_info::storageSize>("storageSize"_hs)
517 entt::attribute{"name", "storageSize"},
518 entt::attribute{"pretty_name", "Storage Size"},
519 entt::attribute{"format", "size"},
520 entt::attribute{"data_format", "B"},
521 })
522 .data<nullptr, &texture_info::width>("width"_hs)
524 entt::attribute{"name", "width"},
525 entt::attribute{"pretty_name", "Width"}
526 })
527 .data<nullptr, &texture_info::height>("height"_hs)
529 entt::attribute{"name", "height"},
530 entt::attribute{"pretty_name", "Height"}
531 })
532 .data<nullptr, &texture_info::depth>("depth"_hs)
534 entt::attribute{"name", "depth"},
535 entt::attribute{"pretty_name", "Depth"}
536 })
537 .data<nullptr, &texture_info::numMips>("numMips"_hs)
539 entt::attribute{"name", "numMips"},
540 entt::attribute{"pretty_name", "Mips"}
541 })
542 .data<nullptr, &texture_info::bitsPerPixel>("bitsPerPixel"_hs)
544 entt::attribute{"name", "bitsPerPixel"},
545 entt::attribute{"pretty_name", "Bits Per Pixel"}
546 })
547 .data<nullptr, &texture_info::cubeMap>("cubeMap"_hs)
549 entt::attribute{"name", "cubeMap"},
550 entt::attribute{"pretty_name", "Cubemap"}
551 });
552
553
554 entt::meta_factory<texture>{}
555 .type("texture"_hs)
557 entt::attribute{"name", "texture"},
558 entt::attribute{"pretty_name", "Texture"},
559 })
560 .data<nullptr, &texture::info>("info"_hs)
562 entt::attribute{"name", "info"},
563 entt::attribute{"pretty_name", "Info"},
564 entt::attribute{"flattable", true}
565 });
566}
567} // namespace gfx
attributes::value_type attribute
Definition reflection.h:19
std::map< std::string, meta_any > attributes
Definition reflection.h:18
bgfx::TextureInfo texture_info
Definition graphics.h:24
#define REFLECT(cls)
Definition reflection.h:133