]> git.tdb.fi Git - libs/gl.git/blob - source/pixelformat.h
Unbind Clipping in Renderer::end
[libs/gl.git] / source / pixelformat.h
1 #ifndef MSP_GL_PIXELFORMAT_H_
2 #define MSP_GL_PIXELFORMAT_H_
3
4 #include <msp/graphics/pixelformat.h>
5 #include <msp/strings/lexicalcast.h>
6 #include "gl.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>
12
13 namespace Msp {
14 namespace GL {
15
16 enum PixelFormat
17 {
18         STENCIL_INDEX   = GL_STENCIL_INDEX,
19         DEPTH_COMPONENT = GL_DEPTH_COMPONENT,
20         RGB             = GL_RGB,
21         RGBA            = GL_RGBA,
22         RGB8            = GL_RGB8,
23         RGB16F          = GL_RGB16F,
24         RGB32F          = GL_RGB32F,
25         RGBA8           = GL_RGBA8,
26         RGBA16F         = GL_RGBA16F,
27         RGBA32F         = GL_RGBA32F,
28         SRGB            = GL_SRGB,
29         SRGB_ALPHA      = GL_SRGB_ALPHA,
30         SRGB8           = GL_SRGB8,
31         SRGB8_ALPHA8    = GL_SRGB8_ALPHA8,
32         BGR             = GL_BGR,
33         BGRA            = GL_BGRA,
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
47 };
48
49 void operator>>(const LexicalConverter &, PixelFormat &);
50
51 PixelFormat pixelformat_from_graphics(Graphics::PixelFormat);
52 PixelFormat storage_pixelformat_from_graphics(Graphics::PixelFormat);
53
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);
59
60 void require_pixelformat(PixelFormat);
61
62 } // namespace GL
63 } // namespace Msp
64
65 #endif