From 4e5f6f01a1b8dfd2dc07f760e79a0ced6d4836a5 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 15 Feb 2020 12:47:29 +1100 Subject: Backport: Extract image conversion from RGBA to BGRA premultiplied into common function. Backport of changeset 7987:beeac488af4d. --- src/XPM.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/XPM.h') diff --git a/src/XPM.h b/src/XPM.h index 9ff612d64..36e541a59 100644 --- a/src/XPM.h +++ b/src/XPM.h @@ -50,6 +50,7 @@ class RGBAImage { float scale; std::vector pixelBytes; public: + static constexpr size_t bytesPerPixel = 4; RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_); explicit RGBAImage(const XPM &xpm); RGBAImage(const RGBAImage &) = default; @@ -65,6 +66,7 @@ public: int CountBytes() const; const unsigned char *Pixels() const; void SetPixel(int x, int y, ColourDesired colour, int alpha); + static void BGRAFromRGBA(unsigned char *pixelsBGRA, const unsigned char *pixelsRGBA, size_t count) noexcept; }; /** -- cgit v1.2.3