mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
working on endianness with vulkan images
This commit is contained in:
@@ -11,6 +11,38 @@ namespace mlx
|
||||
std::ranges::reverse(value_representation);
|
||||
return std::bit_cast<T>(value_representation);
|
||||
}
|
||||
|
||||
constexpr std::uint32_t Rmask() noexcept
|
||||
{
|
||||
if constexpr(std::endian::native == std::endian::big)
|
||||
return 0xFF000000;
|
||||
else
|
||||
return 0x000000FF;
|
||||
}
|
||||
|
||||
constexpr std::uint32_t Gmask() noexcept
|
||||
{
|
||||
if constexpr(std::endian::native == std::endian::big)
|
||||
return 0x00FF0000;
|
||||
else
|
||||
return 0x0000FF00;
|
||||
}
|
||||
|
||||
constexpr std::uint32_t Bmask() noexcept
|
||||
{
|
||||
if constexpr(std::endian::native == std::endian::big)
|
||||
return 0x0000FF00;
|
||||
else
|
||||
return 0x00FF0000;
|
||||
}
|
||||
|
||||
constexpr std::uint32_t Amask() noexcept
|
||||
{
|
||||
if constexpr(std::endian::native == std::endian::big)
|
||||
return 0x000000FF;
|
||||
else
|
||||
return 0xFF000000;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user