Add signed & two-component pixel traits

This commit is contained in:
Nikita Lisitsa 2020-09-30 16:21:16 +03:00
parent 7b9e042842
commit 3a3d93c7db

View file

@ -18,6 +18,14 @@ namespace psemek::gfx
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 <>
struct pixel_traits<geom::vector<std::uint8_t, 3>>
{
@ -34,6 +42,38 @@ namespace psemek::gfx
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 <>
struct pixel_traits<float>
{