1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #ifndef INCLUDED_VCL_BITMAPGAUSSIANSEPARABLEBLURFILTER_HXX
12 #define INCLUDED_VCL_BITMAPGAUSSIANSEPARABLEBLURFILTER_HXX
14 #include <vcl/BitmapFilter.hxx>
19 class BitmapGaussianSeparableBlurFilter final
: public BitmapFilter
22 BitmapGaussianSeparableBlurFilter(double 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
34 virtual BitmapEx
execute(BitmapEx
const& rBitmapEx
) const override
;
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
);
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */