GLI  0.5.1
format.hpp
Go to the documentation of this file.
1 
29 #ifndef GLI_CORE_FORMAT_INCLUDED
30 #define GLI_CORE_FORMAT_INCLUDED
31 
32 namespace gli
33 {
34  enum format
35  {
37 
38  // unorm formats
43 
48 
49  // snorm formats
54 
59 
60  // Unsigned integer formats
61  R8U,
65 
70 
75 
76  // Signed integer formats
77  R8I,
81 
86 
91 
92  // Floating formats
97 
102 
103  // Packed formats
111 
112  // Depth formats
118 
119  // Compressed formats
152 
153  // sRGB formats
179 
181  };
182 
184  {
285  DXGI_FORMAT_FORCE_UINT = 0xffffffffUL
286  };
287 
289  {
290  INTERNAL_NONE = 0, //GL_NONE
291 
292  // unorm formats
293  INTERNAL_R8_UNORM = 0x8229, //GL_R8
294  INTERNAL_RG8_UNORM = 0x822B, //GL_RG8
295  INTERNAL_RGB8_UNORM = 0x8051, //GL_RGB8
296  INTERNAL_RGBA8_UNORM = 0x8058, //GL_RGBA8
297 
298  INTERNAL_R16_UNORM = 0x822A, //GL_R16
299  INTERNAL_RG16_UNORM = 0x822C, //GL_RG16
300  INTERNAL_RGB16_UNORM = 0x8054, //GL_RGB16
301  INTERNAL_RGBA16_UNORM = 0x805B, //GL_RGBA16
302 
303  // snorm formats
304  INTERNAL_R8_SNORM = 0x8F94, //GL_R8_SNORM
305  INTERNAL_RG8_SNORM = 0x8F95, //GL_RG8_SNORM
306  INTERNAL_RGB8_SNORM = 0x8F96, //GL_RGB8_SNORM
307  INTERNAL_RGBA8_SNORM = 0x8F97, //GL_RGBA8_SNORM
308 
309  INTERNAL_R16_SNORM = 0x8F98, //GL_R16_SNORM
310  INTERNAL_RG16_SNORM= 0x8F99, //GL_RG16_SNORM
311  INTERNAL_RGB16_SNORM= 0x8F9A, //GL_RGB16_SNORM
312  INTERNAL_RGBA16_SNORM = 0x8F9B, //GL_RGBA16_SNORM
313 
314  // Unsigned integer formats
315  INTERNAL_R8U = 0x8232, //GL_R8UI
316  INTERNAL_RG8U = 0x8238, //GL_RG8UI
317  INTERNAL_RGB8U = 0x8D7D, //GL_RGB8UI
318  INTERNAL_RGBA8U = 0x8D7C, //GL_RGBA8UI
319 
320  INTERNAL_R16U = 0x8234, //GL_R16UI
321  INTERNAL_RG16U = 0x823A, //GL_RG16UI
322  INTERNAL_RGB16U = 0x8D77, //GL_RGB16UI
323  INTERNAL_RGBA16U = 0x8D76, //GL_RGBA16UI
324 
325  INTERNAL_R32U = 0x8236, //GL_R32UI
326  INTERNAL_RG32U = 0x823C, //GL_RG32UI
327  INTERNAL_RGB32U = 0x8D71, //GL_RGB32UI
328  INTERNAL_RGBA32U = 0x8D70, //GL_RGBA32UI
329 
330  // Signed integer formats
331  INTERNAL_R8I = 0x8231, //GL_R8I
332  INTERNAL_RG8I = 0x8237, //GL_RG8I
333  INTERNAL_RGB8I = 0x8D8F, //GL_RGB8I
334  INTERNAL_RGBA8I = 0x8D8E, //GL_RGBA8I
335 
336  INTERNAL_R16I = 0x8233, //GL_R16I
337  INTERNAL_RG16I = 0x8239, //GL_RG16I
338  INTERNAL_RGB16I = 0x8D89, //GL_RGB16I
339  INTERNAL_RGBA16I = 0x8D88, //GL_RGBA16I
340 
341  INTERNAL_R32I = 0x8235, //GL_R32I
342  INTERNAL_RG32I = 0x823B, //GL_RG32I
343  INTERNAL_RGB32I = 0x8D83, //GL_RGB32I
344  INTERNAL_RGBA32I = 0x8D82, //GL_RGBA32I
345 
346  // Floating formats
347  INTERNAL_R16F = 0x822D, //GL_R16F
348  INTERNAL_RG16F = 0x822F, //GL_RG16F
349  INTERNAL_RGB16F = 0x881B, //GL_RGB16F
350  INTERNAL_RGBA16F = 0x881A, //GL_RGBA16F
351 
352  INTERNAL_R32F = 0x822E, //GL_R32F
353  INTERNAL_RG32F = 0x8230, //GL_RG32F
354  INTERNAL_RGB32F = 0x8815, //GL_RGB32F
355  INTERNAL_RGBA32F = 0x8814, //GL_RGBA32F
356 
357  // Packed formats
358  INTERNAL_RGB9E5 = 0x8C3D, //GL_RGB9_E5
359  INTERNAL_RG11B10F = 0x8C3A, //GL_R11F_G11F_B10F
360  INTERNAL_RG3B2 = 0x2A10, //GL_R3_G3_B2
361  INTERNAL_R5G6B5 = 0x8D62, //GL_RGB565
362  INTERNAL_RGB5A1 = 0x8057, //GL_RGB5_A1
363  INTERNAL_RGBA4 = 0x8056, //GL_RGBA4
364  INTERNAL_RGB10A2 = 0x8059, //GL_RGB10_A2UI
365 
366  // Depth formats
367  INTERNAL_D16 = 0x81A5, //GL_DEPTH_COMPONENT16
368  INTERNAL_D24 = 0x81A6, //GL_DEPTH_COMPONENT24
369  INTERNAL_D24S8 = 0x88F0, //GL_DEPTH24_STENCIL8
370  INTERNAL_D32 = 0x81A7, //GL_DEPTH_COMPONENT32
371  INTERNAL_D32F = 0x8CAC, //GL_DEPTH_COMPONENT32F
372  INTERNAL_D32FS8X24 = 0x8CAD, //GL_DEPTH32F_STENCIL8
373 
374  // Compressed formats
375  INTERNAL_RGB_DXT1 = 0x83F0, //GL_COMPRESSED_RGB_S3TC_DXT1_EXT
376  INTERNAL_RGBA_DXT1 = 0x83F1, //GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
377  INTERNAL_RGBA_DXT3 = 0x83F2, //GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
378  INTERNAL_RGBA_DXT5 = 0x83F3, //GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
379  INTERNAL_R_ATI1N_UNORM = 0x8DBB, //GL_COMPRESSED_RED_RGTC1
380  INTERNAL_R_ATI1N_SNORM = 0x8DBC, //GL_COMPRESSED_SIGNED_RED_RGTC1
381  INTERNAL_RG_ATI2N_UNORM = 0x8DBD, //GL_COMPRESSED_RG_RGTC2
382  INTERNAL_RG_ATI2N_SNORM = 0x8DBE, //GL_COMPRESSED_SIGNED_RG_RGTC2
383  INTERNAL_RGB_BP_UNSIGNED_FLOAT = 0x8E8F, //GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT
384  INTERNAL_RGB_BP_SIGNED_FLOAT = 0x8E8E, //GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT
385  INTERNAL_RGB_BP_UNORM = 0x8E8C, //GL_COMPRESSED_RGBA_BPTC_UNORM
386  INTERNAL_RGB_PVRTC_4BPPV1 = 0x8C00, //GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG
387  INTERNAL_RGB_PVRTC_2BPPV1 = 0x8C01, //GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG
388  INTERNAL_RGBA_PVRTC_4BPPV1 = 0x8C02, //GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
389  INTERNAL_RGBA_PVRTC_2BPPV1 = 0x8C03, //GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
390  INTERNAL_ATC_RGB = 0x8C92, //GL_ATC_RGB_AMD
391  INTERNAL_ATC_RGBA_EXPLICIT_ALPHA = 0x8C93, //GL_ATC_RGBA_EXPLICIT_ALPHA_AMD
392  INTERNAL_ATC_RGBA_INTERPOLATED_ALPHA = 0x87EE, //GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD
393  INTERNAL_RGBA_ASTC_4x4 = 0x93B0, //GL_COMPRESSED_RGBA_ASTC_4x4_KHR
394  INTERNAL_RGBA_ASTC_5x4 = 0x93B1, //GL_COMPRESSED_RGBA_ASTC_5x4_KHR
395  INTERNAL_RGBA_ASTC_5x5 = 0x93B2, //GL_COMPRESSED_RGBA_ASTC_5x5_KHR
396  INTERNAL_RGBA_ASTC_6x5 = 0x93B3, //GL_COMPRESSED_RGBA_ASTC_6x5_KHR
397  INTERNAL_RGBA_ASTC_6x6 = 0x93B4, //GL_COMPRESSED_RGBA_ASTC_6x6_KHR
398  INTERNAL_RGBA_ASTC_8x5 = 0x93B5, //GL_COMPRESSED_RGBA_ASTC_8x5_KHR
399  INTERNAL_RGBA_ASTC_8x6 = 0x93B6, //GL_COMPRESSED_RGBA_ASTC_8x6_KHR
400  INTERNAL_RGBA_ASTC_8x8 = 0x93B7, //GL_COMPRESSED_RGBA_ASTC_8x8_KHR
401  INTERNAL_RGBA_ASTC_10x5 = 0x93B8, //GL_COMPRESSED_RGBA_ASTC_10x5_KHR
402  INTERNAL_RGBA_ASTC_10x6 = 0x93B9, //GL_COMPRESSED_RGBA_ASTC_10x6_KHR
403  INTERNAL_RGBA_ASTC_10x8 = 0x93BA, //GL_COMPRESSED_RGBA_ASTC_10x8_KHR
404  INTERNAL_RGBA_ASTC_10x10 = 0x93BB, //GL_COMPRESSED_RGBA_ASTC_10x10_KHR
405  INTERNAL_RGBA_ASTC_12x10 = 0x93BC, //GL_COMPRESSED_RGBA_ASTC_12x10_KHR
406  INTERNAL_RGBA_ASTC_12x12 = 0x93BD, //GL_COMPRESSED_RGBA_ASTC_12x12_KHR
407 
408  // sRGB formats
409  INTERNAL_SRGB8 = 0x8C41, //GL_SRGB8
410  INTERNAL_SRGB8_ALPHA8 = 0x8C43, //GL_SRGB8_ALPHA8
411  INTERNAL_SRGB_DXT1 = 0x8C4C, //GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
412  INTERNAL_SRGB_ALPHA_DXT1 = 0x8C4C, //GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
413  INTERNAL_SRGB_ALPHA_DXT3 = 0x8C4E, //GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
414  INTERNAL_SRGB_ALPHA_DXT5 = 0x8C4F, //GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
415  INTERNAL_SRGB_BP_UNORM = 0x8E8D, //GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM
416  INTERNAL_SRGB_PVRTC_2BPPV1 = 0x8A54, //GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT
417  INTERNAL_SRGB_PVRTC_4BPPV1 = 0x8A55, //GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT
418  INTERNAL_SRGB_ALPHA_PVRTC_2BPPV1 = 0x8A56, //GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT
419  INTERNAL_SRGB_ALPHA_PVRTC_4BPPV1 = 0x8A57, //GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT
420  INTERNAL_SRGB8_ALPHA8_ASTC_4x4 = 0x93D0, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
421  INTERNAL_SRGB8_ALPHA8_ASTC_5x4 = 0x93D1, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
422  INTERNAL_SRGB8_ALPHA8_ASTC_5x5 = 0x93D2, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
423  INTERNAL_SRGB8_ALPHA8_ASTC_6x5 = 0x93D3, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
424  INTERNAL_SRGB8_ALPHA8_ASTC_6x6 = 0x93D4, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
425  INTERNAL_SRGB8_ALPHA8_ASTC_8x5 = 0x93D5, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
426  INTERNAL_SRGB8_ALPHA8_ASTC_8x6 = 0x93D6, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
427  INTERNAL_SRGB8_ALPHA8_ASTC_8x8 = 0x93D7, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
428  INTERNAL_SRGB8_ALPHA8_ASTC_10x5 = 0x93D8, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
429  INTERNAL_SRGB8_ALPHA8_ASTC_10x6 = 0x93D9, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
430  INTERNAL_SRGB8_ALPHA8_ASTC_10x8 = 0x93DA, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
431  INTERNAL_SRGB8_ALPHA8_ASTC_10x10 = 0x93DB, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
432  INTERNAL_SRGB8_ALPHA8_ASTC_12x10 = 0x93DC, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
433  INTERNAL_SRGB8_ALPHA8_ASTC_12x12 = 0x93DD, //GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
434 
436  };
437 
439  {
440  EXTERNAL_NONE = 0, //GL_NONE
441  EXTERNAL_RED = 0x1903, //GL_RED
442  EXTERNAL_RG = 0x8227, //GL_RG
443  EXTERNAL_RGB= 0x1907, //GL_RGB
444  EXTERNAL_BGR = 0x80E0, //GL_BGR
445  EXTERNAL_RGBA = 0x1908, //GL_RGBA
446  EXTERNAL_BGRA = 0x80E1, //GL_BGRA
447  EXTERNAL_RED_INTEGER = 0x8D94, //GL_RED_INTEGER
448  EXTERNAL_RG_INTEGER = 0x8228, //GL_RG_INTEGER
449  EXTERNAL_RGB_INTEGER = 0x8D98, //GL_RGB_INTEGER
450  EXTERNAL_BGR_INTEGER = 0x8D9A, //GL_BGR_INTEGER
451  EXTERNAL_RGBA_INTEGER = 0x8D99, //GL_RGBA_INTEGER
452  EXTERNAL_BGRA_INTEGER = 0x8D9B, //GL_BGRA_INTEGER
453  EXTERNAL_DEPTH = 0x1902, //GL_DEPTH_COMPONENT
454  EXTERNAL_DEPTH_STENCIL = 0x84F9, //GL_DEPTH_STENCIL
455  EXTERNAL_RGB_DXT1 = 0x83F0, //GL_COMPRESSED_RGB_S3TC_DXT1_EXT
456  EXTERNAL_RGBA_DXT1 = 0x83F1, //GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
457  EXTERNAL_RGBA_DXT3 = 0x83F2, //GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
458  EXTERNAL_RGBA_DXT5 = 0x83F3, //GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
459  EXTERNAL_R_ATI1N_UNORM = 0x8DBB, //GL_COMPRESSED_RED_RGTC1
460  EXTERNAL_R_ATI1N_SNORM = 0x8DBC, //GL_COMPRESSED_SIGNED_RED_RGTC1
461  EXTERNAL_RG_ATI2N_UNORM = 0x8DBD, //GL_COMPRESSED_RG_RGTC2
462  EXTERNAL_RG_ATI2N_SNORM = 0x8DBE, //GL_COMPRESSED_SIGNED_RG_RGTC2
463  EXTERNAL_RGB_BP_UNSIGNED_FLOAT = 0x8E8F, //GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT
464  EXTERNAL_RGB_BP_SIGNED_FLOAT = 0x8E8E, //GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT
465  EXTERNAL_RGB_BP_UNORM = 0x8E8C, //GL_COMPRESSED_RGBA_BPTC_UNORM
466  EXTERNAL_RGB_PVRTC_4BPPV1 = 0x8C00, //GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG
467  EXTERNAL_RGB_PVRTC_2BPPV1 = 0x8C01, //GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG
468  EXTERNAL_RGBA_PVRTC_4BPPV1 = 0x8C02, //GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
469  EXTERNAL_RGBA_PVRTC_2BPPV1 = 0x8C03, //GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
470  EXTERNAL_ATC_RGB = 0x8C92, //GL_ATC_RGB_AMD
471  EXTERNAL_ATC_RGBA_EXPLICIT_ALPHA = 0x8C93, //GL_ATC_RGBA_EXPLICIT_ALPHA_AMD
472  EXTERNAL_ATC_RGBA_INTERPOLATED_ALPHA = 0x87EE, //GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD
473  EXTERNAL_RGBA_ASTC_4x4 = 0x93B0, //GL_COMPRESSED_RGBA_ASTC_4x4_KHR
474  EXTERNAL_RGBA_ASTC_5x4 = 0x93B1, //GL_COMPRESSED_RGBA_ASTC_5x4_KHR
475  EXTERNAL_RGBA_ASTC_5x5 = 0x93B2, //GL_COMPRESSED_RGBA_ASTC_5x5_KHR
476  EXTERNAL_RGBA_ASTC_6x5 = 0x93B3, //GL_COMPRESSED_RGBA_ASTC_6x5_KHR
477  EXTERNAL_RGBA_ASTC_6x6 = 0x93B4, //GL_COMPRESSED_RGBA_ASTC_6x6_KHR
478  EXTERNAL_RGBA_ASTC_8x5 = 0x93B5, //GL_COMPRESSED_RGBA_ASTC_8x5_KHR
479  EXTERNAL_RGBA_ASTC_8x6 = 0x93B6, //GL_COMPRESSED_RGBA_ASTC_8x6_KHR
480  EXTERNAL_RGBA_ASTC_8x8 = 0x93B7, //GL_COMPRESSED_RGBA_ASTC_8x8_KHR
481  EXTERNAL_RGBA_ASTC_10x5 = 0x93B8, //GL_COMPRESSED_RGBA_ASTC_10x5_KHR
482  EXTERNAL_RGBA_ASTC_10x6 = 0x93B9, //GL_COMPRESSED_RGBA_ASTC_10x6_KHR
483  EXTERNAL_RGBA_ASTC_10x8 = 0x93BA, //GL_COMPRESSED_RGBA_ASTC_10x8_KHR
484  EXTERNAL_RGBA_ASTC_10x10 = 0x93BB, //GL_COMPRESSED_RGBA_ASTC_10x10_KHR
485  EXTERNAL_RGBA_ASTC_12x10 = 0x93BC, //GL_COMPRESSED_RGBA_ASTC_12x10_KHR
486  EXTERNAL_RGBA_ASTC_12x12 = 0x93BD //GL_COMPRESSED_RGBA_ASTC_12x12_KHR
487  };
488 
490  {
491  TYPE_NONE = 0, //GL_NONE
492  TYPE_I8 = 0x1400, //GL_BYTE
493  TYPE_U8 = 0x1401, //GL_UNSIGNED_BYTE
494  TYPE_I16 = 0x1402, //GL_SHORT
495  TYPE_U16 = 0x1403, //GL_UNSIGNED_SHORT
496  TYPE_I32 = 0x1404, //GL_INT
497  TYPE_U32 = 0x1405, //GL_UNSIGNED_INT
498  TYPE_F16 = 0x140B, //GL_HALF_FLOAT
499  TYPE_F32 = 0x1406, //GL_FLOAT
500  TYPE_UINT32_RGB9_E5 = 0x8C3E, //GL_UNSIGNED_INT_5_9_9_9_REV
501  TYPE_UINT32_RG11B10F = 0x8C3B, //GL_UNSIGNED_INT_10F_11F_11F_REV
502  TYPE_UINT8_RG3B2 = 0x8032, //GL_UNSIGNED_BYTE_3_3_2
503  TYPE_UINT8_RG3B2_REV = 0x8362, //GL_UNSIGNED_BYTE_2_3_3_REV
504  TYPE_UINT16_RGB5A1 = 0x8034, //GL_UNSIGNED_SHORT_5_5_5_1
505  TYPE_UINT16_RGB5A1_REV = 0x8366, //GL_UNSIGNED_SHORT_1_5_5_5_REV
506  TYPE_UINT16_R5G6B5 = 0x8363, //GL_UNSIGNED_SHORT_5_6_5
507  TYPE_UINT16_R5G6B5_REV = 0x8364, //GL_UNSIGNED_SHORT_5_6_5_REV
508  TYPE_UINT16_RGBA4 = 0x8033, //GL_UNSIGNED_SHORT_4_4_4_4
509  TYPE_UINT16_RGBA4_REV = 0x8365, //GL_UNSIGNED_SHORT_4_4_4_4_REV
510  TYPE_UINT32_RGB10A2 = 0x8036, //GL_UNSIGNED_INT_10_10_10_2
511  TYPE_UINT32_RGB10A2_REV = 0x8368 //GL_UNSIGNED_INT_2_10_10_10_REV
512  };
513 }//namespace gli
514 
515 #include "format.inl"
516 
517 #endif//GLI_CORE_FORMAT_INCLUDED
dxgiFormat
Definition: format.hpp:183
internalFormat
Definition: format.hpp:288
externalFormat
Definition: format.hpp:438
format
Definition: format.hpp:34
typeFormat
Definition: format.hpp:489