workaround segfault in compiler on macos-clang-intel
[LibreOffice.git] / include / vcl / BitmapGaussianSeparableBlurFilter.hxx
blob72b3fdb81f1d21f1dae3d31966f4ecb9ca93304a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
11 #ifndef INCLUDED_VCL_BITMAPGAUSSIANSEPARABLEBLURFILTER_HXX
12 #define INCLUDED_VCL_BITMAPGAUSSIANSEPARABLEBLURFILTER_HXX
14 #include <vcl/BitmapFilter.hxx>
15 #include <vector>
17 class BitmapEx;
19 class BitmapGaussianSeparableBlurFilter final : public BitmapFilter
21 public:
22 BitmapGaussianSeparableBlurFilter(double fRadius)
23 : mfRadius(fRadius)
27 /** Separable Gaussian Blur filter and accepts a blur radius
28 as a parameter so the user can change the strength of the blur.
29 Radius of 1.0 is 3 * standard deviation of gauss function.
31 Separable Blur implementation uses 2x separable 1D convolution
32 to process the image.
34 virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override;
36 private:
37 double mfRadius;
39 static bool convolutionPass(const Bitmap& rBitmap, Bitmap& aNewBitmap,
40 BitmapReadAccess const* pReadAcc, int aNumberOfContributions,
41 const double* pWeights, int const* pPixels, const int* pCount);
43 static std::vector<double> makeBlurKernel(const double radius, int& rows);
44 static void blurContributions(const int aSize, const int aNumberOfContributions,
45 const std::vector<double>& rBlurVector,
46 std::vector<double>& rWeights, std::vector<int>& rPixels,
47 std::vector<int>& rCounts);
50 #endif
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */