diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2018-03-13 15:38:44 +1100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-04-16 03:19:23 +0200 |
commit | 6631cc554557c56000e0b87d595493b36e6fb7da (patch) | |
tree | 5c5c169fbe648e9daccb62f69f9bfde04d20541e /vcl/inc | |
parent | 9fb7aaf570c03c8a26d763f1205fb8c890e8211a (diff) |
vcl: migrated BitmapProcessor and scale classes to BitmapFilterEx classes
Change-Id: I0530824cdefb3c714d2664988f887d123e471840
Reviewed-on: https://gerrit.libreoffice.org/52898
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/BitmapColorizeFilter.hxx | 34 | ||||
-rw-r--r-- | vcl/inc/BitmapDisabledImageFilter.hxx (renamed from vcl/inc/BitmapProcessor.hxx) | 17 | ||||
-rw-r--r-- | vcl/inc/BitmapLightenFilter.hxx (renamed from vcl/inc/bitmapfilter.hxx) | 13 | ||||
-rwxr-xr-x[-rw-r--r--] | vcl/inc/BitmapScaleConvolutionFilter.hxx (renamed from vcl/inc/BitmapScaleConvolution.hxx) | 60 | ||||
-rw-r--r-- | vcl/inc/BitmapScaleSuperFilter.hxx (renamed from vcl/inc/bitmapscalesuper.hxx) | 12 |
5 files changed, 96 insertions, 40 deletions
diff --git a/vcl/inc/BitmapColorizeFilter.hxx b/vcl/inc/BitmapColorizeFilter.hxx new file mode 100644 index 000000000000..0fac997d5f10 --- /dev/null +++ b/vcl/inc/BitmapColorizeFilter.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#ifndef INCLUDED_VCL_INC_BITMAPCOLORIZEFILTER_HXX +#define INCLUDED_VCL_INC_BITMAPCOLORIZEFILTER_HXX + +#include <tools/color.hxx> + +#include <vcl/BitmapFilter.hxx> + +class VCL_DLLPUBLIC BitmapColorizeFilter : public BitmapFilter +{ +public: + BitmapColorizeFilter(Color aColor) + : maColor(aColor) + { + } + + virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + +private: + Color maColor; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/BitmapProcessor.hxx b/vcl/inc/BitmapDisabledImageFilter.hxx index 5f5bd8b69b6c..2f69e8fa0c51 100644 --- a/vcl/inc/BitmapProcessor.hxx +++ b/vcl/inc/BitmapDisabledImageFilter.hxx @@ -5,21 +5,22 @@ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * */ -#ifndef VCL_INC_BITMAP_PROCESSOR_HXX -#define VCL_INC_BITMAP_PROCESSOR_HXX +#ifndef INCLUDED_VCL_INC_BITMAPDISABLEDIMAGEFILTER_HXX +#define INCLUDED_VCL_INC_BITMAPDISABLEDIMAGEFILTER_HXX -#include <vcl/bitmapex.hxx> +#include <vcl/BitmapFilter.hxx> -class VCL_DLLPUBLIC BitmapProcessor +class VCL_DLLPUBLIC BitmapDisabledImageFilter : public BitmapFilter { public: - static BitmapEx createLightImage(const BitmapEx& rBitmapEx); - static BitmapEx createDisabledImage(const BitmapEx& rBitmapEx); - static void colorizeImage(BitmapEx const & rBitmapEx, Color aColor); + BitmapDisabledImageFilter() {} + + virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; }; -#endif // VCL_INC_BITMAP_PROCESSOR_HXX +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/bitmapfilter.hxx b/vcl/inc/BitmapLightenFilter.hxx index 82f5f2edf091..ffd8ede55574 100644 --- a/vcl/inc/bitmapfilter.hxx +++ b/vcl/inc/BitmapLightenFilter.hxx @@ -8,18 +8,15 @@ * */ -#ifndef INCLUDED_VCL_INC_BITMAPFILTER_HXX -#define INCLUDED_VCL_INC_BITMAPFILTER_HXX +#ifndef INCLUDED_VCL_INC_BITMAPLIGHTENFILTER_HXX +#define INCLUDED_VCL_INC_BITMAPLIGHTENFILTER_HXX -#include <vcl/bitmap.hxx> +#include <vcl/BitmapFilter.hxx> -class BitmapFilter +class VCL_DLLPUBLIC BitmapLightenFilter : public BitmapFilter { public: - BitmapFilter(); - virtual ~BitmapFilter(); - - virtual bool execute(Bitmap& rBitmap) = 0; + virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; }; #endif diff --git a/vcl/inc/BitmapScaleConvolution.hxx b/vcl/inc/BitmapScaleConvolutionFilter.hxx index 60e450f670ba..9a0c5dafbb04 100644..100755 --- a/vcl/inc/BitmapScaleConvolution.hxx +++ b/vcl/inc/BitmapScaleConvolutionFilter.hxx @@ -17,42 +17,66 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_BITMAPSCALECONVOLUTION_HXX -#define INCLUDED_VCL_BITMAPSCALECONVOLUTION_HXX +#ifndef VCL_INC_BITMAPSCALECONVOLUTIONFILTER_HXX +#define VCL_INC_BITMAPSCALECONVOLUTIONFILTER_HXX -#include "bitmapfilter.hxx" +#include <vcl/BitmapFilter.hxx> -namespace vcl -{ +#include "ResampleKernel.hxx" -enum class ConvolutionKernelType +namespace vcl { - BiLinear = 1, - BiCubic = 2, - Lanczos3 = 3, -}; - class VCL_DLLPUBLIC BitmapScaleConvolutionFilter : public BitmapFilter { public: - - BitmapScaleConvolutionFilter(const double& rScaleX, const double& rScaleY, ConvolutionKernelType eKernelType) + BitmapScaleConvolutionFilter(const double& rScaleX, const double& rScaleY) : mrScaleX(rScaleX) , mrScaleY(rScaleY) - , meKernelType(eKernelType) - {} + { + } + + virtual BitmapEx execute(BitmapEx const& rBitmap) override; - virtual bool execute(Bitmap& rBitmap) override; +protected: + Kernel* mpKernel; private: double mrScaleX; double mrScaleY; +}; + +class VCL_DLLPUBLIC BitmapScaleBilinearFilter : public BitmapScaleConvolutionFilter +{ +public: + BitmapScaleBilinearFilter(const double& rScaleX, const double& rScaleY) + : BitmapScaleConvolutionFilter(rScaleX, rScaleY) + { + mpKernel = new BilinearKernel(); + } +}; - ConvolutionKernelType meKernelType; +class VCL_DLLPUBLIC BitmapScaleBicubicFilter : public BitmapScaleConvolutionFilter +{ +public: + BitmapScaleBicubicFilter(const double& rScaleX, const double& rScaleY) + : BitmapScaleConvolutionFilter(rScaleX, rScaleY) + { + mpKernel = new BicubicKernel(); + } +}; + +class VCL_DLLPUBLIC BitmapScaleLanczos3Filter : public BitmapScaleConvolutionFilter +{ +public: + BitmapScaleLanczos3Filter(const double& rScaleX, const double& rScaleY) + : BitmapScaleConvolutionFilter(rScaleX, rScaleY) + { + mpKernel = new Lanczos3Kernel(); + } }; } -#endif // INCLUDED_VCL_BITMAPSCALECONVOLUTION_HXX +#endif // VCL_INC_BITMAPSCALECONVOLUTIONFILTER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/bitmapscalesuper.hxx b/vcl/inc/BitmapScaleSuperFilter.hxx index c8309c874b77..3b403015a5c9 100644 --- a/vcl/inc/bitmapscalesuper.hxx +++ b/vcl/inc/BitmapScaleSuperFilter.hxx @@ -20,19 +20,19 @@ #ifndef INCLUDED_VCL_INC_BITMAPSCALESUPER_HXX #define INCLUDED_VCL_INC_BITMAPSCALESUPER_HXX -#include "bitmapfilter.hxx" +#include <vcl/BitmapFilter.hxx> class BitmapScaleSuperFilter : public BitmapFilter { public: - BitmapScaleSuperFilter(const double& rScaleX, const double& rScaleY); - virtual ~BitmapScaleSuperFilter() override; + BitmapScaleSuperFilter(const double& rScaleX, const double& rScaleY); + virtual ~BitmapScaleSuperFilter() override; - virtual bool execute(Bitmap& rBitmap) override; + virtual BitmapEx execute(BitmapEx const& rBitmap) override; private: - double mrScaleX; - double mrScaleY; + double mrScaleX; + double mrScaleY; }; |