Add signed & two-component pixel traits
This commit is contained in:
parent
7b9e042842
commit
3a3d93c7db
1 changed files with 40 additions and 0 deletions
|
|
@ -18,6 +18,14 @@ namespace psemek::gfx
|
||||||
static constexpr GLenum type = gl::UNSIGNED_BYTE;
|
static constexpr GLenum type = gl::UNSIGNED_BYTE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct pixel_traits<geom::vector<std::uint8_t, 2>>
|
||||||
|
{
|
||||||
|
static constexpr GLenum internal_format = gl::RG8;
|
||||||
|
static constexpr GLenum format = gl::RG;
|
||||||
|
static constexpr GLenum type = gl::UNSIGNED_BYTE;
|
||||||
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct pixel_traits<geom::vector<std::uint8_t, 3>>
|
struct pixel_traits<geom::vector<std::uint8_t, 3>>
|
||||||
{
|
{
|
||||||
|
|
@ -34,6 +42,38 @@ namespace psemek::gfx
|
||||||
static constexpr GLenum type = gl::UNSIGNED_BYTE;
|
static constexpr GLenum type = gl::UNSIGNED_BYTE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct pixel_traits<std::int8_t>
|
||||||
|
{
|
||||||
|
static constexpr GLenum internal_format = gl::R8;
|
||||||
|
static constexpr GLenum format = gl::RED;
|
||||||
|
static constexpr GLenum type = gl::BYTE;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct pixel_traits<geom::vector<std::int8_t, 2>>
|
||||||
|
{
|
||||||
|
static constexpr GLenum internal_format = gl::RG8;
|
||||||
|
static constexpr GLenum format = gl::RG;
|
||||||
|
static constexpr GLenum type = gl::BYTE;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct pixel_traits<geom::vector<std::int8_t, 3>>
|
||||||
|
{
|
||||||
|
static constexpr GLenum internal_format = gl::RGB8;
|
||||||
|
static constexpr GLenum format = gl::RGB;
|
||||||
|
static constexpr GLenum type = gl::BYTE;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct pixel_traits<geom::vector<std::int8_t, 4>>
|
||||||
|
{
|
||||||
|
static constexpr GLenum internal_format = gl::RGBA8;
|
||||||
|
static constexpr GLenum format = gl::RGBA;
|
||||||
|
static constexpr GLenum type = gl::BYTE;
|
||||||
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct pixel_traits<float>
|
struct pixel_traits<float>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue