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 /vcl | |
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 'vcl')
31 files changed, 33 insertions, 39 deletions
diff --git a/vcl/inc/BitmapColorizeFilter.hxx b/vcl/inc/BitmapColorizeFilter.hxx index 0fac997d5f10..0d2ab8176f93 100644 --- a/vcl/inc/BitmapColorizeFilter.hxx +++ b/vcl/inc/BitmapColorizeFilter.hxx @@ -23,7 +23,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: Color maColor; diff --git a/vcl/inc/BitmapDisabledImageFilter.hxx b/vcl/inc/BitmapDisabledImageFilter.hxx index 2f69e8fa0c51..34336464aff6 100644 --- a/vcl/inc/BitmapDisabledImageFilter.hxx +++ b/vcl/inc/BitmapDisabledImageFilter.hxx @@ -18,7 +18,7 @@ class VCL_DLLPUBLIC BitmapDisabledImageFilter : public BitmapFilter public: BitmapDisabledImageFilter() {} - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; }; #endif diff --git a/vcl/inc/BitmapFastScaleFilter.hxx b/vcl/inc/BitmapFastScaleFilter.hxx index bc0ddfc7718f..1b156d670b91 100644 --- a/vcl/inc/BitmapFastScaleFilter.hxx +++ b/vcl/inc/BitmapFastScaleFilter.hxx @@ -23,7 +23,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: double mfScaleX; diff --git a/vcl/inc/BitmapInterpolateScaleFilter.hxx b/vcl/inc/BitmapInterpolateScaleFilter.hxx index 3c6dd310909b..7ab36c94ed1b 100644 --- a/vcl/inc/BitmapInterpolateScaleFilter.hxx +++ b/vcl/inc/BitmapInterpolateScaleFilter.hxx @@ -23,7 +23,7 @@ public: { } - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: double mfScaleX; diff --git a/vcl/inc/BitmapLightenFilter.hxx b/vcl/inc/BitmapLightenFilter.hxx index ffd8ede55574..540f07fb39b8 100644 --- a/vcl/inc/BitmapLightenFilter.hxx +++ b/vcl/inc/BitmapLightenFilter.hxx @@ -16,7 +16,7 @@ class VCL_DLLPUBLIC BitmapLightenFilter : public BitmapFilter { public: - virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; }; #endif diff --git a/vcl/inc/BitmapScaleConvolutionFilter.hxx b/vcl/inc/BitmapScaleConvolutionFilter.hxx index bb5fb38409e1..b3db59065c7c 100644 --- a/vcl/inc/BitmapScaleConvolutionFilter.hxx +++ b/vcl/inc/BitmapScaleConvolutionFilter.hxx @@ -37,7 +37,7 @@ protected: { } - virtual BitmapEx execute(BitmapEx const& rBitmap) override; + virtual BitmapEx execute(BitmapEx const& rBitmap) const override; private: std::unique_ptr<Kernel> mxKernel; diff --git a/vcl/inc/BitmapScaleSuperFilter.hxx b/vcl/inc/BitmapScaleSuperFilter.hxx index 3b403015a5c9..7fa26f0c769a 100644 --- a/vcl/inc/BitmapScaleSuperFilter.hxx +++ b/vcl/inc/BitmapScaleSuperFilter.hxx @@ -28,7 +28,7 @@ public: BitmapScaleSuperFilter(const double& rScaleX, const double& rScaleY); virtual ~BitmapScaleSuperFilter() override; - virtual BitmapEx execute(BitmapEx const& rBitmap) override; + virtual BitmapEx execute(BitmapEx const& rBitmap) const override; private: double mrScaleX; diff --git a/vcl/source/bitmap/BitmapAlphaClampFilter.cxx b/vcl/source/bitmap/BitmapAlphaClampFilter.cxx index 5fd19235b6d1..258f30991d7e 100644 --- a/vcl/source/bitmap/BitmapAlphaClampFilter.cxx +++ b/vcl/source/bitmap/BitmapAlphaClampFilter.cxx @@ -15,7 +15,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapAlphaClampFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapAlphaClampFilter::execute(BitmapEx const& rBitmapEx) const { if (!rBitmapEx.IsTransparent()) return rBitmapEx; diff --git a/vcl/source/bitmap/BitmapColorQuantizationFilter.cxx b/vcl/source/bitmap/BitmapColorQuantizationFilter.cxx index 643354515f06..c877dd4adb66 100644 --- a/vcl/source/bitmap/BitmapColorQuantizationFilter.cxx +++ b/vcl/source/bitmap/BitmapColorQuantizationFilter.cxx @@ -21,7 +21,7 @@ #include <cstdlib> -BitmapEx BitmapColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) +BitmapEx BitmapColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) const { Bitmap aBitmap = aBitmapEx.GetBitmap(); diff --git a/vcl/source/bitmap/BitmapColorizeFilter.cxx b/vcl/source/bitmap/BitmapColorizeFilter.cxx index f9a89ac60dde..4ec5bfe75d32 100644 --- a/vcl/source/bitmap/BitmapColorizeFilter.cxx +++ b/vcl/source/bitmap/BitmapColorizeFilter.cxx @@ -16,7 +16,7 @@ #include <bitmapwriteaccess.hxx> #include <BitmapColorizeFilter.hxx> -BitmapEx BitmapColorizeFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapColorizeFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap = rBitmapEx.GetBitmap(); BitmapScopedWriteAccess pWriteAccess(aBitmap); diff --git a/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx b/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx index bb1a1932c763..c2f2750f69a0 100644 --- a/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx +++ b/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx @@ -18,7 +18,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapDisabledImageFilter.cxx b/vcl/source/bitmap/BitmapDisabledImageFilter.cxx index c341ddea7534..3529f7e67dc2 100644 --- a/vcl/source/bitmap/BitmapDisabledImageFilter.cxx +++ b/vcl/source/bitmap/BitmapDisabledImageFilter.cxx @@ -15,7 +15,7 @@ #include <bitmapwriteaccess.hxx> #include <BitmapDisabledImageFilter.hxx> -BitmapEx BitmapDisabledImageFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapDisabledImageFilter::execute(BitmapEx const& rBitmapEx) const { const Size aSize(rBitmapEx.GetSizePixel()); diff --git a/vcl/source/bitmap/BitmapDuoToneFilter.cxx b/vcl/source/bitmap/BitmapDuoToneFilter.cxx index 1769081b9ccd..521d1cc6d98e 100644 --- a/vcl/source/bitmap/BitmapDuoToneFilter.cxx +++ b/vcl/source/bitmap/BitmapDuoToneFilter.cxx @@ -24,7 +24,7 @@ static inline sal_uInt8 lcl_getDuotoneColorComponent(sal_uInt8 base, sal_uInt16 return static_cast<sal_uInt8>(color1 + color2); } -BitmapEx BitmapDuoToneFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapDuoToneFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx index 3c12c5364168..7b6e503ffe22 100644 --- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx @@ -15,7 +15,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapFastScaleFilter.cxx b/vcl/source/bitmap/BitmapFastScaleFilter.cxx index 5d02e5ea32c6..cff8f3148980 100644 --- a/vcl/source/bitmap/BitmapFastScaleFilter.cxx +++ b/vcl/source/bitmap/BitmapFastScaleFilter.cxx @@ -26,7 +26,7 @@ #include <BitmapFastScaleFilter.hxx> #include <sal/log.hxx> -BitmapEx BitmapFastScaleFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapFastScaleFilter::execute(BitmapEx const& rBitmapEx) const { SAL_INFO("vcl.gdi", "BitmapFastScaleFilter::execute()"); diff --git a/vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx b/vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx index d65d82e238b3..38b417929bb3 100644 --- a/vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx +++ b/vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx @@ -17,7 +17,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapGaussianSeparableBlurFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapGaussianSeparableBlurFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); @@ -86,7 +86,7 @@ bool BitmapGaussianSeparableBlurFilter::convolutionPass(Bitmap& rBitmap, Bitmap& BitmapReadAccess const* pReadAcc, int aNumberOfContributions, const double* pWeights, int const* pPixels, - const int* pCount) + const int* pCount) const { if (!pReadAcc) return false; diff --git a/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx b/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx index 32266595b93e..cbc5dc34d837 100644 --- a/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx +++ b/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx @@ -26,7 +26,7 @@ #include <BitmapFastScaleFilter.hxx> #include <BitmapInterpolateScaleFilter.hxx> -BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapLightenFilter.cxx b/vcl/source/bitmap/BitmapLightenFilter.cxx index 1432ce02ae59..52e41ae33e97 100644 --- a/vcl/source/bitmap/BitmapLightenFilter.cxx +++ b/vcl/source/bitmap/BitmapLightenFilter.cxx @@ -15,7 +15,7 @@ #include <bitmapwriteaccess.hxx> #include <BitmapLightenFilter.hxx> -BitmapEx BitmapLightenFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapLightenFilter::execute(BitmapEx const& rBitmapEx) const { const Size aSize(rBitmapEx.GetSizePixel()); diff --git a/vcl/source/bitmap/BitmapMedianFilter.cxx b/vcl/source/bitmap/BitmapMedianFilter.cxx index 45f1149a1c0c..81b935ac5212 100644 --- a/vcl/source/bitmap/BitmapMedianFilter.cxx +++ b/vcl/source/bitmap/BitmapMedianFilter.cxx @@ -52,7 +52,7 @@ MN3(a, b, c); \ MX3(d, e, f); -BitmapEx BitmapMedianFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapMedianFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapMonochromeFilter.cxx b/vcl/source/bitmap/BitmapMonochromeFilter.cxx index 0bdb2cd09226..72bacf84955a 100644 --- a/vcl/source/bitmap/BitmapMonochromeFilter.cxx +++ b/vcl/source/bitmap/BitmapMonochromeFilter.cxx @@ -15,7 +15,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapMonochromeFilter::execute(BitmapEx const& aBitmapEx) +BitmapEx BitmapMonochromeFilter::execute(BitmapEx const& aBitmapEx) const { Bitmap aBitmap = aBitmapEx.GetBitmap(); Bitmap::ScopedReadAccess pReadAcc(aBitmap); diff --git a/vcl/source/bitmap/BitmapMosaicFilter.cxx b/vcl/source/bitmap/BitmapMosaicFilter.cxx index 496d687ef4e3..0b94cf845f7c 100644 --- a/vcl/source/bitmap/BitmapMosaicFilter.cxx +++ b/vcl/source/bitmap/BitmapMosaicFilter.cxx @@ -15,18 +15,12 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapMosaicFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapMosaicFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); bool bRet = false; - if (!mnTileWidth) - mnTileWidth = 1; - - if (!mnTileHeight) - mnTileHeight = 1; - if (mnTileWidth > 1 || mnTileHeight > 1) { Bitmap* pNewBmp; diff --git a/vcl/source/bitmap/BitmapPopArtFilter.cxx b/vcl/source/bitmap/BitmapPopArtFilter.cxx index 15b1b9ea09dd..271cb658258b 100644 --- a/vcl/source/bitmap/BitmapPopArtFilter.cxx +++ b/vcl/source/bitmap/BitmapPopArtFilter.cxx @@ -17,7 +17,7 @@ #include <cstdlib> -BitmapEx BitmapPopArtFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapPopArtFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx b/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx index 566abf22c78a..95345ae88fbe 100644 --- a/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx +++ b/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx @@ -372,7 +372,7 @@ bool ImplScaleConvolution(Bitmap& rBitmap, const double& rScaleX, const double& } // end anonymous namespace -BitmapEx BitmapScaleConvolutionFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapScaleConvolutionFilter::execute(BitmapEx const& rBitmapEx) const { bool bRetval = false; Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx index 10ab46f5214c..9668a4a28a45 100644 --- a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx +++ b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx @@ -930,7 +930,7 @@ BitmapScaleSuperFilter::BitmapScaleSuperFilter(const double& rScaleX, const doub BitmapScaleSuperFilter::~BitmapScaleSuperFilter() {} -BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap) +BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap) const { Bitmap aBitmap(rBitmap.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx b/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx index 4361cb864c87..0ee1fd3159b2 100644 --- a/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx +++ b/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx @@ -18,7 +18,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapSeparableUnsharpenFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapSeparableUnsharpenFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapSepiaFilter.cxx b/vcl/source/bitmap/BitmapSepiaFilter.cxx index 0d1a41083974..9e2aaeaac31d 100644 --- a/vcl/source/bitmap/BitmapSepiaFilter.cxx +++ b/vcl/source/bitmap/BitmapSepiaFilter.cxx @@ -15,7 +15,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapSepiaFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapSepiaFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); Bitmap::ScopedReadAccess pReadAcc(aBitmap); diff --git a/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx b/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx index 5436a227770e..1885308275e5 100644 --- a/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx +++ b/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx @@ -18,7 +18,7 @@ #include <cstdlib> -BitmapEx BitmapSimpleColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) +BitmapEx BitmapSimpleColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) const { Bitmap aBitmap = aBitmapEx.GetBitmap(); diff --git a/vcl/source/bitmap/BitmapSmoothenFilter.cxx b/vcl/source/bitmap/BitmapSmoothenFilter.cxx index 49ecfc97122e..3e6f3148cd3d 100644 --- a/vcl/source/bitmap/BitmapSmoothenFilter.cxx +++ b/vcl/source/bitmap/BitmapSmoothenFilter.cxx @@ -17,7 +17,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapSmoothenFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapSmoothenFilter::execute(BitmapEx const& rBitmapEx) const { BitmapEx aBitmapEx(rBitmapEx); bool bRet = false; diff --git a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx index 450772dd2abe..47c6f438f995 100644 --- a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx @@ -15,7 +15,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapSobelGreyFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapSobelGreyFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); diff --git a/vcl/source/bitmap/BitmapSolarizeFilter.cxx b/vcl/source/bitmap/BitmapSolarizeFilter.cxx index 3c8b3b598c68..d12986c81c9f 100644 --- a/vcl/source/bitmap/BitmapSolarizeFilter.cxx +++ b/vcl/source/bitmap/BitmapSolarizeFilter.cxx @@ -15,7 +15,7 @@ #include <bitmapwriteaccess.hxx> -BitmapEx BitmapSolarizeFilter::execute(BitmapEx const& rBitmapEx) +BitmapEx BitmapSolarizeFilter::execute(BitmapEx const& rBitmapEx) const { Bitmap aBitmap(rBitmapEx.GetBitmap()); bool bRet = false; diff --git a/vcl/source/bitmap/bitmapfilter.cxx b/vcl/source/bitmap/bitmapfilter.cxx index 1cfb6d4d4d36..b28573cf3906 100644 --- a/vcl/source/bitmap/bitmapfilter.cxx +++ b/vcl/source/bitmap/bitmapfilter.cxx @@ -18,7 +18,7 @@ BitmapFilter::BitmapFilter() {} BitmapFilter::~BitmapFilter() {} -bool BitmapFilter::Filter(BitmapEx& rBmpEx, BitmapFilter& rFilter) +bool BitmapFilter::Filter(BitmapEx& rBmpEx, BitmapFilter const & rFilter) { BitmapEx aTmpBmpEx(rFilter.execute(rBmpEx)); @@ -32,7 +32,7 @@ bool BitmapFilter::Filter(BitmapEx& rBmpEx, BitmapFilter& rFilter) return true; } -bool BitmapFilter::Filter(Animation& rAnimation, BitmapFilter& rFilter) +bool BitmapFilter::Filter(Animation& rAnimation, BitmapFilter const & rFilter) { SAL_WARN_IF(rAnimation.IsInAnimation(), "vcl", "Animation modified while it is animated"); |