summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-01-18 22:14:51 -0500
committerLinus Groh <mail@linusgroh.de>2023-01-20 21:44:36 +0000
commit046c79b468b4f70670743965d1c36fec0785e515 (patch)
treed20a5660ee161a877245955ab884bb75e8fc3cf6 /Userland/Libraries/LibGfx
parent0245614a4fb7cf297d0e1c183fffc327de0b2162 (diff)
downloadserenity-046c79b468b4f70670743965d1c36fec0785e515.zip
LibGfx: Make DistinctFourCC compatible with BigEndian
Diffstat (limited to 'Userland/Libraries/LibGfx')
-rw-r--r--Userland/Libraries/LibGfx/ICCProfile.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGfx/ICCProfile.h b/Userland/Libraries/LibGfx/ICCProfile.h
index 4d8f2d143f..8f0f2171f6 100644
--- a/Userland/Libraries/LibGfx/ICCProfile.h
+++ b/Userland/Libraries/LibGfx/ICCProfile.h
@@ -26,13 +26,19 @@ enum class FourCCType {
};
template<FourCCType type>
-struct DistinctFourCC {
- u32 value { 0 };
+struct [[gnu::packed]] DistinctFourCC {
+ explicit DistinctFourCC(u32 value)
+ : value(value)
+ {
+ }
+ explicit operator u32() const { return value; }
char c0() const { return value >> 24; }
char c1() const { return (value >> 16) & 0xff; }
char c2() const { return (value >> 8) & 0xff; }
char c3() const { return value & 0xff; }
+
+ u32 value { 0 };
};
using PreferredCMMType = DistinctFourCC<FourCCType::PreferredCMMType>; // ICC v4, "7.2.3 Preferred CMM type field"