mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
LibGfx: Add FourCC::from_u32()
This commit is contained in:
parent
53c6dfacd7
commit
36bbf12b73
1 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,16 @@ struct [[gnu::packed]] FourCC {
|
||||||
cc[3] = name[3];
|
cc[3] = name[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static constexpr FourCC from_u32(u32 value)
|
||||||
|
{
|
||||||
|
FourCC result;
|
||||||
|
result.cc[0] = static_cast<char>(value >> 24);
|
||||||
|
result.cc[1] = static_cast<char>(value >> 16);
|
||||||
|
result.cc[2] = static_cast<char>(value >> 8);
|
||||||
|
result.cc[3] = static_cast<char>(value);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==(FourCC const&) const = default;
|
bool operator==(FourCC const&) const = default;
|
||||||
bool operator!=(FourCC const&) const = default;
|
bool operator!=(FourCC const&) const = default;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue