mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
LibGfx: Add Bitmap::strip_alpha_channel()
Sets all alpha values to 0xff and sets the bitmap's format to BGRx8888. Currently only implemented for BGRA8888 and BGRx8888.
This commit is contained in:
parent
6e0fc5e221
commit
d70ddc8961
2 changed files with 11 additions and 0 deletions
|
@ -212,6 +212,9 @@ public:
|
|||
[[nodiscard]] bool has_alpha_channel() const { return m_format == BitmapFormat::BGRA8888 || m_format == BitmapFormat::RGBA8888; }
|
||||
[[nodiscard]] BitmapFormat format() const { return m_format; }
|
||||
|
||||
// Call only for BGRx8888 and BGRA8888 bitmaps.
|
||||
void strip_alpha_channel();
|
||||
|
||||
void set_mmap_name(DeprecatedString const&);
|
||||
|
||||
[[nodiscard]] static constexpr size_t size_in_bytes(size_t pitch, int physical_height) { return pitch * physical_height; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue