From 68bc6a5dd68006ab86e7ef26f9e5d241cb118879 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 13 Mar 2021 12:00:28 +0900 Subject: add PixelFormat enum that replaces bit count in Bitmap/BitmapEx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bit count for the image is a numeric value (sal_uInt16) but only a handful of values make sense - namely 1,4,8,24 and 32. This replaces the numeric value with an enum, which only accepts those values and checks the correct values are used at compile time. Change-Id: I0fc137c62bce3b0d021f05019a1648da628521bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112408 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/backendtest/outputdevice/bitmap.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl/backendtest') diff --git a/vcl/backendtest/outputdevice/bitmap.cxx b/vcl/backendtest/outputdevice/bitmap.cxx index 50060b88b7ed..2c7d7569cde6 100644 --- a/vcl/backendtest/outputdevice/bitmap.cxx +++ b/vcl/backendtest/outputdevice/bitmap.cxx @@ -18,7 +18,7 @@ namespace vcl::test { Bitmap OutputDeviceTestBitmap::setupDrawTransformedBitmap() { Size aBitmapSize(9, 9); - Bitmap aBitmap(aBitmapSize, 24); + Bitmap aBitmap(aBitmapSize, vcl::PixelFormat::N24_BPP); { BitmapScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(constFillColor); @@ -43,7 +43,7 @@ Bitmap OutputDeviceTestBitmap::setupDrawTransformedBitmap() Bitmap OutputDeviceTestBitmap::setupDrawBitmap() { Size aBitmapSize(9, 9); - Bitmap aBitmap(aBitmapSize, 24); + Bitmap aBitmap(aBitmapSize, vcl::PixelFormat::N24_BPP); { BitmapScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(constFillColor); @@ -65,7 +65,7 @@ Bitmap OutputDeviceTestBitmap::setupDrawBitmap() Bitmap OutputDeviceTestBitmap::setupDrawBitmapExWithAlpha() { Size aBitmapSize(9, 9); - Bitmap aBitmap(aBitmapSize, 24); + Bitmap aBitmap(aBitmapSize, vcl::PixelFormat::N24_BPP); { BitmapScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(COL_WHITE); @@ -95,7 +95,7 @@ Bitmap OutputDeviceTestBitmap::setupDrawBitmapExWithAlpha() Bitmap OutputDeviceTestBitmap::setupDrawMask() { Size aBitmapSize(9, 9); - Bitmap aBitmap(aBitmapSize, 24); + Bitmap aBitmap(aBitmapSize, vcl::PixelFormat::N24_BPP); { BitmapScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(COL_WHITE); @@ -114,7 +114,7 @@ Bitmap OutputDeviceTestBitmap::setupDrawMask() BitmapEx OutputDeviceTestBitmap::setupDrawBlend() { Size aBitmapSize(9, 9); - Bitmap aBitmap(aBitmapSize, 24); + Bitmap aBitmap(aBitmapSize, vcl::PixelFormat::N24_BPP); { BitmapScopedWriteAccess aWriteAccess(aBitmap); aWriteAccess->Erase(COL_WHITE); -- cgit