X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fpixelformat.h;h=c180451403dc2af7e9f8c640a7c8384b04eb85e7;hp=dde8594e723793a001c6166e575f18f8119aa86d;hb=df9119a9bf2d348a513c515ed92953353da97b54;hpb=33b6ca811172d402fc891eeed9cd2a5edc28d61d diff --git a/source/core/pixelformat.h b/source/core/pixelformat.h index dde8594e..c1804514 100644 --- a/source/core/pixelformat.h +++ b/source/core/pixelformat.h @@ -1,27 +1,17 @@ #ifndef MSP_GL_PIXELFORMAT_H_ #define MSP_GL_PIXELFORMAT_H_ -#include #include #include -#include "gl.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "datatype.h" namespace Msp { namespace GL { /** -Identifies the components of a pixel, without type information. The values -are bitfields laid as follows: +Identifies the components of a pixel, without type information. + +The values are bitfields laid as follows: _grs dccc │││ │ └╴Number of components @@ -31,7 +21,7 @@ _grs dccc └───────╴Grayscale flag This information is presented for internal documentation purposes only; it is -inadvisable for programs to rely on it. +inadvisable for applications to rely on it. */ enum PixelComponents { @@ -48,8 +38,9 @@ enum PixelComponents }; /** -Identifies a pixel format, with components and type. The values are bitfields -laid as follows: +Identifies a pixel format, with components and type. + +The values are bitfields laid as follows: tnfg ssss cccc cccc ││││ │ └╴Components (see PixelComponents) @@ -60,10 +51,11 @@ tnfg ssss cccc cccc └──────────────────╴sRGB flag This information is presented for internal documentation purposes only; it is -inadvisable for programs to rely on it. +inadvisable for applications to rely on it. */ enum PixelFormat { + NO_PIXELFORMAT = 0, R8 = 0x4100|RED, R16F = 0x3200|RED, R32F = 0x3400|RED, @@ -95,7 +87,7 @@ void operator>>(const LexicalConverter &, PixelComponents &); void operator>>(const LexicalConverter &, PixelFormat &); PixelComponents components_from_graphics(Graphics::PixelFormat); -PixelFormat pixelformat_from_image(const Graphics::Image &); +PixelFormat pixelformat_from_image(const Graphics::Image &, bool = false); PixelFormat make_pixelformat(PixelComponents, DataType, bool = false); inline PixelComponents get_components(PixelFormat f) { return static_cast(f&0xFF); } @@ -108,10 +100,9 @@ inline unsigned get_pixel_size(PixelFormat f) { return get_component_count(f)*ge void require_pixelformat(PixelFormat); -GLenum get_gl_components(PixelComponents); -GLenum get_gl_pixelformat(PixelFormat); - } // namespace GL } // namespace Msp +#include "pixelformat_backend.h" + #endif