]> git.tdb.fi Git - libs/gl.git/blob - source/pixelformat.h
Use a renderer in the viewer
[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
11 namespace Msp {
12 namespace GL {
13
14 enum PixelFormat
15 {
16         COLOR_INDEX     = GL_COLOR_INDEX,
17         STENCIL_INDEX   = GL_STENCIL_INDEX,
18         DEPTH_COMPONENT = GL_DEPTH_COMPONENT,
19         RED             = GL_RED,
20         GREEN           = GL_GREEN,
21         BLUE            = GL_BLUE,
22         ALPHA           = GL_ALPHA,
23         RGB             = GL_RGB,
24         RGBA            = GL_RGBA,
25         RGB8            = GL_RGB8,
26         RGB16F          = GL_RGB16F_ARB,
27         RGB32F          = GL_RGB32F_ARB,
28         RGBA8           = GL_RGBA8,
29         RGBA16F         = GL_RGBA16F_ARB,
30         RGBA32F         = GL_RGBA32F_ARB,
31         SRGB            = GL_SRGB_EXT,
32         SRGB_ALPHA      = GL_SRGB_ALPHA_EXT,
33         SRGB8           = GL_SRGB8_EXT,
34         SRGB8_ALPHA8    = GL_SRGB8_ALPHA8_EXT,
35         BGR             = GL_BGR,
36         BGRA            = GL_BGRA,
37         LUMINANCE       = GL_LUMINANCE,
38         LUMINANCE8      = GL_LUMINANCE8,
39         LUMINANCE16F    = GL_LUMINANCE16F_ARB,
40         LUMINANCE32F    = GL_LUMINANCE32F_ARB,
41         LUMINANCE_ALPHA    = GL_LUMINANCE_ALPHA,
42         LUMINANCE_ALPHA8   = GL_LUMINANCE8_ALPHA8,
43         LUMINANCE_ALPHA16F = GL_LUMINANCE_ALPHA16F_ARB,
44         LUMINANCE_ALPHA32F = GL_LUMINANCE_ALPHA32F_ARB,
45         SLUMINANCE         = GL_SLUMINANCE_EXT,
46         SLUMINANCE8        = GL_SLUMINANCE8_EXT,
47         SLUMINANCE_ALPHA   = GL_SLUMINANCE_ALPHA_EXT,
48         SLUMINANCE8_ALPHA8 = GL_SLUMINANCE8_ALPHA8_EXT
49 };
50
51 void operator>>(const LexicalConverter &, PixelFormat &);
52
53 PixelFormat pixelformat_from_graphics(Graphics::PixelFormat);
54 PixelFormat storage_pixelformat_from_graphics(Graphics::PixelFormat);
55
56 PixelFormat get_base_pixelformat(PixelFormat);
57 PixelFormat get_srgb_pixelformat(PixelFormat);
58 unsigned get_component_count(PixelFormat);
59
60 void require_pixelformat(PixelFormat);
61
62 } // namespace GL
63 } // namespace Msp
64
65 #endif