[Colour.hpp] Support for 6 to 8-bit colour
This commit is contained in:
@@ -3,11 +3,15 @@
|
|||||||
|
|
||||||
// Helpers functions for converting colour channels between bit depths
|
// Helpers functions for converting colour channels between bit depths
|
||||||
namespace Colour {
|
namespace Colour {
|
||||||
inline static u8 convert4To8Bit(u8 c) {
|
inline static constexpr u8 convert4To8Bit(u8 c) {
|
||||||
return (c << 4) | c;
|
return (c << 4) | c;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static u8 convert5To8Bit(u8 c) {
|
inline static constexpr u8 convert5To8Bit(u8 c) {
|
||||||
return (c << 3) | (c >> 2);
|
return (c << 3) | (c >> 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static constexpr u8 convert6To8Bit(u8 c) {
|
||||||
|
return (c << 2) | (c >> 4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user