summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/Bitmap.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-04 22:05:20 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-04 23:40:21 +0100
commit5ace66a9037fa6968b417cfb604ae8419be62271 (patch)
treeacc383f50bfab4f576af6f80b5dffee02a036883 /Userland/Libraries/LibGfx/Bitmap.h
parent5c4bb039266242ee606aceabba5926831de46e83 (diff)
downloadserenity-5ace66a9037fa6968b417cfb604ae8419be62271.zip
LibGfx: Rename RGBA32 => ARGB32
The ARGB32 typedef is used for 32-bit #AARRGGBB quadruplets. As such, the name RGBA32 was misleading, so let's call it ARGB32 instead. Since endianness is a thing, let's not encode any assumptions about byte order in the name of this type. ARGB32 is basically a "machine word" of color.
Diffstat (limited to 'Userland/Libraries/LibGfx/Bitmap.h')
-rw-r--r--Userland/Libraries/LibGfx/Bitmap.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/Userland/Libraries/LibGfx/Bitmap.h b/Userland/Libraries/LibGfx/Bitmap.h
index 7a1343c003..82d421b477 100644
--- a/Userland/Libraries/LibGfx/Bitmap.h
+++ b/Userland/Libraries/LibGfx/Bitmap.h
@@ -95,7 +95,7 @@ public:
[[nodiscard]] static ErrorOr<NonnullRefPtr<Bitmap>> try_create_wrapper(BitmapFormat, IntSize const&, int intrinsic_scale, size_t pitch, void*);
[[nodiscard]] static ErrorOr<NonnullRefPtr<Bitmap>> try_load_from_file(String const& path, int scale_factor = 1);
[[nodiscard]] static ErrorOr<NonnullRefPtr<Bitmap>> try_load_from_fd_and_close(int fd, String const& path);
- [[nodiscard]] static ErrorOr<NonnullRefPtr<Bitmap>> try_create_with_anonymous_buffer(BitmapFormat, Core::AnonymousBuffer, IntSize const&, int intrinsic_scale, Vector<RGBA32> const& palette);
+ [[nodiscard]] static ErrorOr<NonnullRefPtr<Bitmap>> try_create_with_anonymous_buffer(BitmapFormat, Core::AnonymousBuffer, IntSize const&, int intrinsic_scale, Vector<ARGB32> const& palette);
static ErrorOr<NonnullRefPtr<Bitmap>> try_create_from_serialized_byte_buffer(ByteBuffer&&);
static bool is_path_a_supported_image_format(StringView path)
@@ -125,8 +125,8 @@ public:
[[nodiscard]] u8* scanline_u8(int physical_y);
[[nodiscard]] u8 const* scanline_u8(int physical_y) const;
- [[nodiscard]] RGBA32* scanline(int physical_y);
- [[nodiscard]] RGBA32 const* scanline(int physical_y) const;
+ [[nodiscard]] ARGB32* scanline(int physical_y);
+ [[nodiscard]] ARGB32 const* scanline(int physical_y) const;
[[nodiscard]] IntRect rect() const { return { {}, m_size }; }
[[nodiscard]] IntSize size() const { return m_size; }
@@ -167,7 +167,7 @@ public:
}
}
- [[nodiscard]] Vector<RGBA32> palette_to_vector() const;
+ [[nodiscard]] Vector<ARGB32> palette_to_vector() const;
[[nodiscard]] static unsigned bpp_for_format(BitmapFormat format)
{
@@ -239,16 +239,16 @@ public:
private:
Bitmap(BitmapFormat, IntSize const&, int, BackingStore const&);
Bitmap(BitmapFormat, IntSize const&, int, size_t pitch, void*);
- Bitmap(BitmapFormat, Core::AnonymousBuffer, IntSize const&, int, Vector<RGBA32> const& palette);
+ Bitmap(BitmapFormat, Core::AnonymousBuffer, IntSize const&, int, Vector<ARGB32> const& palette);
static ErrorOr<BackingStore> allocate_backing_store(BitmapFormat format, IntSize const& size, int scale_factor);
- void allocate_palette_from_format(BitmapFormat, Vector<RGBA32> const& source_palette);
+ void allocate_palette_from_format(BitmapFormat, Vector<ARGB32> const& source_palette);
IntSize m_size;
int m_scale;
void* m_data { nullptr };
- RGBA32* m_palette { nullptr };
+ ARGB32* m_palette { nullptr };
size_t m_pitch { 0 };
BitmapFormat m_format { BitmapFormat::Invalid };
bool m_needs_munmap { false };
@@ -268,14 +268,14 @@ inline u8 const* Bitmap::scanline_u8(int y) const
return reinterpret_cast<u8 const*>(m_data) + (y * m_pitch);
}
-inline RGBA32* Bitmap::scanline(int y)
+inline ARGB32* Bitmap::scanline(int y)
{
- return reinterpret_cast<RGBA32*>(scanline_u8(y));
+ return reinterpret_cast<ARGB32*>(scanline_u8(y));
}
-inline RGBA32 const* Bitmap::scanline(int y) const
+inline ARGB32 const* Bitmap::scanline(int y) const
{
- return reinterpret_cast<RGBA32 const*>(scanline_u8(y));
+ return reinterpret_cast<ARGB32 const*>(scanline_u8(y));
}
template<>