diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-05 14:09:24 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-06 09:01:30 +0200 |
commit | b13fbd19b7282a1210a2e14bb5ede9ecdf944c1c (patch) | |
tree | 3db528acc23250ddcc3dbdc9b1e35a817d8de9ee /include/vcl | |
parent | ba121a3269d17f87c6d09b9e46aaaf921af40ef6 (diff) |
convert BMP_SCALE constant to scoped enum
Change-Id: Ibc9f88d2588c028cd71aa86c26d970a73025ef22
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/bitmap.hxx | 29 | ||||
-rw-r--r-- | include/vcl/bitmapex.hxx | 6 | ||||
-rw-r--r-- | include/vcl/gdimtf.hxx | 2 |
3 files changed, 20 insertions, 17 deletions
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 9027a643deba..be7d4eb293d7 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -34,18 +34,21 @@ #define BMP_MIRROR_VERT 0x00000002UL -#define BMP_SCALE_NONE 0x00000000UL +enum class BmpScaleFlag +{ + NONE = 0, // Try to preferably use these. -#define BMP_SCALE_DEFAULT 0x00000001UL -#define BMP_SCALE_FAST 0x00000002UL -#define BMP_SCALE_BESTQUALITY 0x00000003UL + Default = 1, + Fast = 2, + BestQuality = 3, // Specific algorithms, use only if you really need to. -#define BMP_SCALE_INTERPOLATE 0x00000004UL -#define BMP_SCALE_SUPER 0x00000005UL -#define BMP_SCALE_LANCZOS 0x00000006UL -#define BMP_SCALE_BICUBIC 0x00000007UL -#define BMP_SCALE_BILINEAR 0x00000008UL -#define BMP_SCALE_BOX 0x00000009UL + Interpolate = 4, + Super = 5, + Lanczos = 6, + BiCubic = 7, + BiLinear = 8, + Box = 9, +}; #define BMP_DITHER_NONE 0x00000000UL @@ -543,7 +546,7 @@ public: @return true, if the operation was completed successfully. */ - bool Scale( const Size& rNewSize, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT ); + bool Scale( const Size& rNewSize, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default ); /** Scale the bitmap @@ -554,11 +557,11 @@ public: The scale factor in y direction. @param nScaleFlag - Method of scaling - it is recommended that either BMP_SCALE_DEFAULT or BMP_SCALE_BESTQUALITY be used. + Method of scaling - it is recommended that either BmpScaleFlag::Default or BmpScaleFlag::BestQuality be used. @return true, if the operation was completed successfully. */ - bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT ); + bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default ); /** Returns true if bitmap scaling is considered to be fast. diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index eb9e4d60a911..d7b08e087779 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -83,7 +83,7 @@ public: AlphaMask GetAlpha() const; const Size& GetSizePixel() const { return aBitmapSize; } - void SetSizePixel( const Size& rNewSize, sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT ); + void SetSizePixel( const Size& rNewSize, BmpScaleFlag nScaleFlag = BmpScaleFlag::Default ); const Size& GetPrefSize() const { return aBitmap.GetPrefSize(); } void SetPrefSize( const Size& rPrefSize ) { aBitmap.SetPrefSize( rPrefSize ); } @@ -237,7 +237,7 @@ public: */ bool Scale( const Size& rNewSize, - sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT ); + BmpScaleFlag nScaleFlag = BmpScaleFlag::Default ); /** Scale the bitmap @@ -255,7 +255,7 @@ public: bool Scale( const double& rScaleX, const double& rScaleY, - sal_uInt32 nScaleFlag = BMP_SCALE_DEFAULT ); + BmpScaleFlag nScaleFlag = BmpScaleFlag::Default ); /** Rotate bitmap by the specified angle diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx index 43bfad95a0b6..bc8da88cdd9e 100644 --- a/include/vcl/gdimtf.hxx +++ b/include/vcl/gdimtf.hxx @@ -218,7 +218,7 @@ public: bool CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent = 256, BmpConversion nColorConversion = BMP_CONVERSION_24BIT, - long nScaleFlag = BMP_SCALE_BESTQUALITY) const; + BmpScaleFlag nScaleFlag = BmpScaleFlag::BestQuality) const; void UseCanvas( bool _bUseCanvas ); bool GetUseCanvas() const { return bUseCanvas; } |