From 14d455147643fcb8dd14fef21d15abfaadb4e8bc Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sun, 16 Jun 2024 00:23:02 +0300 Subject: [PATCH] LibImage: Add rgba getter for Image::Color Actually the format is 0xAARRGGBB which is what my framebuffer uses. --- LibImage/include/LibImage/Image.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LibImage/include/LibImage/Image.h b/LibImage/include/LibImage/Image.h index c972779dfa..418552036d 100644 --- a/LibImage/include/LibImage/Image.h +++ b/LibImage/include/LibImage/Image.h @@ -31,6 +31,11 @@ namespace LibImage .a = static_cast(a.a * a_mult + b.a * b_mult), }; } + + uint32_t as_rgba() const + { + return ((uint32_t)a << 24) | ((uint32_t)r << 16) | ((uint32_t)g << 8) | b; + } }; enum class ResizeAlgorithm