diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-09-07 17:39:58 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-09-07 20:42:59 +0200 |
commit | 453fde35bb838febf73bfda0bd981ee270c9b12e (patch) | |
tree | fbe3ad4dd86de631bdd3a77ba6d4dd1f00c6b73c /include | |
parent | 7cb3e475f2fb0162c7290414509de4fb8fe57e30 (diff) |
BitmapFilter::execute can be const
...after a little tweak to BitmapMosaicFilter
Change-Id: I76b8ffdbf719a9d7960e7f3dafeb3adeb2300ec5
Reviewed-on: https://gerrit.libreoffice.org/60165
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/BitmapAlphaClampFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapColorQuantizationFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapConvolutionMatrixFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapDuoToneFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapEmbossGreyFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapFilter.hxx | 6 | ||||
-rw-r--r-- | include/vcl/BitmapGaussianSeparableBlurFilter.hxx | 4 | ||||
-rw-r--r-- | include/vcl/BitmapMedianFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapMonochromeFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapMosaicFilter.hxx | 10 | ||||
-rw-r--r-- | include/vcl/BitmapPopArtFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapSeparableUnsharpenFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapSepiaFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapSimpleColorQuantizationFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapSmoothenFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapSobelGreyFilter.hxx | 2 | ||||
-rw-r--r-- | include/vcl/BitmapSolarizeFilter.hxx | 2 |
17 files changed, 26 insertions, 22 deletions
diff --git a/include/vcl/BitmapAlphaClampFilter.hxx b/include/vcl/BitmapAlphaClampFilter.hxx index 0fc6274b6d4e..39c039cbd02c 100644 --- a/include/vcl/BitmapAlphaClampFilter.hxx +++ b/include/vcl/BitmapAlphaClampFilter.hxx @@ -25,7 +25,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt8 mcThreshold; diff --git a/include/vcl/BitmapColorQuantizationFilter.hxx b/include/vcl/BitmapColorQuantizationFilter.hxx index e695567a7bc0..170b0d88a471 100644 --- a/include/vcl/BitmapColorQuantizationFilter.hxx +++ b/include/vcl/BitmapColorQuantizationFilter.hxx @@ -28,7 +28,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt16 mnNewColorCount; diff --git a/include/vcl/BitmapConvolutionMatrixFilter.hxx b/include/vcl/BitmapConvolutionMatrixFilter.hxx index cae8c3d8a91c..928eaa9f0aa2 100644 --- a/include/vcl/BitmapConvolutionMatrixFilter.hxx +++ b/include/vcl/BitmapConvolutionMatrixFilter.hxx @@ -25,7 +25,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; protected: const long (&mrMatrix)[9]; diff --git a/include/vcl/BitmapDuoToneFilter.hxx b/include/vcl/BitmapDuoToneFilter.hxx index 72c02e7afcfa..ce29a2c93c6b 100644 --- a/include/vcl/BitmapDuoToneFilter.hxx +++ b/include/vcl/BitmapDuoToneFilter.hxx @@ -24,7 +24,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uLong mnColorOne; diff --git a/include/vcl/BitmapEmbossGreyFilter.hxx b/include/vcl/BitmapEmbossGreyFilter.hxx index 0a3227295d6e..eebb2d3ecc8e 100644 --- a/include/vcl/BitmapEmbossGreyFilter.hxx +++ b/include/vcl/BitmapEmbossGreyFilter.hxx @@ -24,7 +24,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt16 mnAzimuthAngle100; diff --git a/include/vcl/BitmapFilter.hxx b/include/vcl/BitmapFilter.hxx index ee7ac96b8d1c..9fc8f8017683 100644 --- a/include/vcl/BitmapFilter.hxx +++ b/include/vcl/BitmapFilter.hxx @@ -20,10 +20,10 @@ public: BitmapFilter(); virtual ~BitmapFilter(); - virtual BitmapEx execute(BitmapEx const& rBitmapEx) = 0; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const = 0; - static bool Filter(BitmapEx& rBmpEx, BitmapFilter& rFilter); - static bool Filter(Animation& rBmpEx, BitmapFilter& rFilter); + static bool Filter(BitmapEx& rBmpEx, BitmapFilter const& rFilter); + static bool Filter(Animation& rBmpEx, BitmapFilter const& rFilter); }; #endif diff --git a/include/vcl/BitmapGaussianSeparableBlurFilter.hxx b/include/vcl/BitmapGaussianSeparableBlurFilter.hxx index c1359dab4761..fde41c935dc6 100644 --- a/include/vcl/BitmapGaussianSeparableBlurFilter.hxx +++ b/include/vcl/BitmapGaussianSeparableBlurFilter.hxx @@ -31,14 +31,14 @@ public: Separable Blur implementation uses 2x separable 1D convolution to process the image. */ - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: double mfRadius; bool convolutionPass(Bitmap& rBitmap, Bitmap& aNewBitmap, BitmapReadAccess const* pReadAcc, int aNumberOfContributions, const double* pWeights, int const* pPixels, - const int* pCount); + const int* pCount) const; static std::vector<double> makeBlurKernel(const double radius, int& rows); static void blurContributions(const int aSize, const int aNumberOfContributions, diff --git a/include/vcl/BitmapMedianFilter.hxx b/include/vcl/BitmapMedianFilter.hxx index e51a66eabcb7..b9d2fc555759 100644 --- a/include/vcl/BitmapMedianFilter.hxx +++ b/include/vcl/BitmapMedianFilter.hxx @@ -20,7 +20,7 @@ class VCL_DLLPUBLIC BitmapMedianFilter : public BitmapFilter public: BitmapMedianFilter() {} - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; }; #endif diff --git a/include/vcl/BitmapMonochromeFilter.hxx b/include/vcl/BitmapMonochromeFilter.hxx index acbcc3cc9b2c..09723b7a4009 100644 --- a/include/vcl/BitmapMonochromeFilter.hxx +++ b/include/vcl/BitmapMonochromeFilter.hxx @@ -34,7 +34,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt8 mcThreshold; diff --git a/include/vcl/BitmapMosaicFilter.hxx b/include/vcl/BitmapMosaicFilter.hxx index 0fbf19613b5f..f38e0ac1c6d5 100644 --- a/include/vcl/BitmapMosaicFilter.hxx +++ b/include/vcl/BitmapMosaicFilter.hxx @@ -11,6 +11,10 @@ #ifndef INCLUDED_VCL_BITMAPMOSAICFILTER_HXX #define INCLUDED_VCL_BITMAPMOSAICFILTER_HXX +#include <sal/config.h> + +#include <algorithm> + #include <vcl/BitmapFilter.hxx> class BitmapEx; @@ -19,12 +23,12 @@ class VCL_DLLPUBLIC BitmapMosaicFilter : public BitmapFilter { public: BitmapMosaicFilter(sal_uLong nTileWidth, sal_uLong nTileHeight) - : mnTileWidth(nTileWidth) - , mnTileHeight(nTileHeight) + : mnTileWidth(std::max(nTileWidth, sal_uLong(1))) + , mnTileHeight(std::max(nTileHeight, sal_uLong(1))) { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uLong mnTileWidth; diff --git a/include/vcl/BitmapPopArtFilter.hxx b/include/vcl/BitmapPopArtFilter.hxx index 5c926940d3cf..9312c7b9367a 100644 --- a/include/vcl/BitmapPopArtFilter.hxx +++ b/include/vcl/BitmapPopArtFilter.hxx @@ -18,7 +18,7 @@ class VCL_DLLPUBLIC BitmapPopArtFilter : public BitmapFilter public: BitmapPopArtFilter() {} - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: struct PopArtEntry diff --git a/include/vcl/BitmapSeparableUnsharpenFilter.hxx b/include/vcl/BitmapSeparableUnsharpenFilter.hxx index 1812b9013fe8..91fcbf479498 100644 --- a/include/vcl/BitmapSeparableUnsharpenFilter.hxx +++ b/include/vcl/BitmapSeparableUnsharpenFilter.hxx @@ -26,7 +26,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: double mfRadius; diff --git a/include/vcl/BitmapSepiaFilter.hxx b/include/vcl/BitmapSepiaFilter.hxx index d636ebe6fea6..787a15e3f9f3 100644 --- a/include/vcl/BitmapSepiaFilter.hxx +++ b/include/vcl/BitmapSepiaFilter.hxx @@ -27,7 +27,7 @@ public: mnSepiaPercent = 100; } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt16 mnSepiaPercent; diff --git a/include/vcl/BitmapSimpleColorQuantizationFilter.hxx b/include/vcl/BitmapSimpleColorQuantizationFilter.hxx index b05b13fe6896..200e35356b07 100644 --- a/include/vcl/BitmapSimpleColorQuantizationFilter.hxx +++ b/include/vcl/BitmapSimpleColorQuantizationFilter.hxx @@ -28,7 +28,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt16 mnNewColorCount; diff --git a/include/vcl/BitmapSmoothenFilter.hxx b/include/vcl/BitmapSmoothenFilter.hxx index 131809700680..3403b99ea5ee 100644 --- a/include/vcl/BitmapSmoothenFilter.hxx +++ b/include/vcl/BitmapSmoothenFilter.hxx @@ -23,7 +23,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: double mfRadius; diff --git a/include/vcl/BitmapSobelGreyFilter.hxx b/include/vcl/BitmapSobelGreyFilter.hxx index ac4cd9498d65..4ce6ef60b7d6 100644 --- a/include/vcl/BitmapSobelGreyFilter.hxx +++ b/include/vcl/BitmapSobelGreyFilter.hxx @@ -18,7 +18,7 @@ class VCL_DLLPUBLIC BitmapSobelGreyFilter : public BitmapFilter public: BitmapSobelGreyFilter() {} - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; }; #endif diff --git a/include/vcl/BitmapSolarizeFilter.hxx b/include/vcl/BitmapSolarizeFilter.hxx index 219bc881874f..f91a9fd287aa 100644 --- a/include/vcl/BitmapSolarizeFilter.hxx +++ b/include/vcl/BitmapSolarizeFilter.hxx @@ -23,7 +23,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt8 mcSolarGreyThreshold; |