1 #ifndef MSP_GL_PIXELFORMAT_H_
2 #define MSP_GL_PIXELFORMAT_H_
4 #include <msp/graphics/pixelformat.h>
5 #include <msp/strings/lexicalcast.h>
7 #include <msp/gl/extensions/arb_texture_float.h>
8 #include <msp/gl/extensions/ext_bgra.h>
9 #include <msp/gl/extensions/ext_texture_srgb.h>
10 #include <msp/gl/extensions/msp_legacy_features.h>
11 #include <msp/gl/extensions/msp_sized_internal_formats.h>
18 STENCIL_INDEX = GL_STENCIL_INDEX,
19 DEPTH_COMPONENT = GL_DEPTH_COMPONENT,
29 SRGB_ALPHA = GL_SRGB_ALPHA,
31 SRGB8_ALPHA8 = GL_SRGB8_ALPHA8,
34 LUMINANCE = GL_LUMINANCE,
35 LUMINANCE8 = GL_LUMINANCE8,
36 // TODO Remove LUMINANCE(_ALPHA) float formats once ARB_texture_rg becomes supported
37 LUMINANCE16F = GL_LUMINANCE16F_ARB,
38 LUMINANCE32F = GL_LUMINANCE32F_ARB,
39 LUMINANCE_ALPHA = GL_LUMINANCE_ALPHA,
40 LUMINANCE_ALPHA8 = GL_LUMINANCE8_ALPHA8,
41 LUMINANCE_ALPHA16F = GL_LUMINANCE_ALPHA16F_ARB,
42 LUMINANCE_ALPHA32F = GL_LUMINANCE_ALPHA32F_ARB,
43 SLUMINANCE = GL_SLUMINANCE,
44 SLUMINANCE8 = GL_SLUMINANCE8,
45 SLUMINANCE_ALPHA = GL_SLUMINANCE_ALPHA,
46 SLUMINANCE8_ALPHA8 = GL_SLUMINANCE8_ALPHA8
49 void operator>>(const LexicalConverter &, PixelFormat &);
51 PixelFormat pixelformat_from_graphics(Graphics::PixelFormat);
52 PixelFormat storage_pixelformat_from_graphics(Graphics::PixelFormat);
54 PixelFormat get_base_pixelformat(PixelFormat);
55 PixelFormat get_srgb_pixelformat(PixelFormat);
56 unsigned get_component_count(PixelFormat);
57 unsigned get_component_size(PixelFormat);
58 unsigned get_pixel_size(PixelFormat);
60 void require_pixelformat(PixelFormat);