LibreOffice Module vcl (master)  1
BitmapGaussianSeparableBlurFilter.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  */
10 
11 #ifndef INCLUDED_VCL_BITMAPGAUSSIANSEPARABLEBLURFILTER_HXX
12 #define INCLUDED_VCL_BITMAPGAUSSIANSEPARABLEBLURFILTER_HXX
13 
14 #include <vcl/BitmapFilter.hxx>
15 #include <vector>
16 
17 class BitmapEx;
18 
20 {
21 public:
23  : mfRadius(fRadius)
24  {
25  }
26 
34  virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override;
35 
36 private:
37  double const mfRadius;
38 
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);
42 
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);
48 };
49 
50 #endif
51 
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static std::vector< double > makeBlurKernel(const double radius, int &rows)
static bool convolutionPass(const Bitmap &rBitmap, Bitmap &aNewBitmap, BitmapReadAccess const *pReadAcc, int aNumberOfContributions, const double *pWeights, int const *pPixels, const int *pCount)
static void blurContributions(const int aSize, const int aNumberOfContributions, const std::vector< double > &rBlurVector, std::vector< double > &rWeights, std::vector< int > &rPixels, std::vector< int > &rCounts)
virtual BitmapEx execute(BitmapEx const &rBitmapEx) const override
Separable Gaussian Blur filter and accepts a blur radius as a parameter so the user can change the st...