LibreOffice Module vcl (master)  1
BitmapBasicMorphologyFilter.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_BITMAPBASICMORPHOLOGYFILTER_HXX
12 #define INCLUDED_VCL_BITMAPBASICMORPHOLOGYFILTER_HXX
13 
14 #include <vcl/bitmap.hxx>
15 #include <vcl/bitmapex.hxx>
16 #include <vcl/BitmapFilter.hxx>
17 
19 {
20  erode,
21  dilate
22 };
23 
24 /* Black is foreground, white is background */
26 {
27 public:
28  BitmapBasicMorphologyFilter(BasicMorphologyOp op, sal_Int32 nRadius);
29  BitmapBasicMorphologyFilter(BasicMorphologyOp op, sal_Int32 nRadius, sal_uInt8 nValueOutside);
30  virtual ~BitmapBasicMorphologyFilter();
31 
32  virtual BitmapEx execute(BitmapEx const& rBitmap) const override;
33 
34 private:
35  Bitmap filter(Bitmap const& rBitmap) const;
36 
38  sal_Int32 m_nRadius;
39  sal_uInt8 m_nValueOutside = 0;
40  bool m_bUseValueOutside = false;
41 };
42 
44 {
45 public:
46  BitmapErodeFilter(sal_Int32 nRadius)
48  {
49  }
50  BitmapErodeFilter(sal_Int32 nRadius, sal_uInt8 nValueOutside)
51  : BitmapBasicMorphologyFilter(BasicMorphologyOp::erode, nRadius, nValueOutside)
52  {
53  }
54 };
55 
57 {
58 public:
59  BitmapDilateFilter(sal_Int32 nRadius)
61  {
62  }
63  BitmapDilateFilter(sal_Int32 nRadius, sal_uInt8 nValueOutside)
64  : BitmapBasicMorphologyFilter(BasicMorphologyOp::dilate, nRadius, nValueOutside)
65  {
66  }
67 };
68 
69 #endif // INCLUDED_VCL_BITMAPBASICMORPHOLOGYFILTER_HXX
70 
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
virtual BitmapEx execute(BitmapEx const &rBitmapEx) const =0
BitmapDilateFilter(sal_Int32 nRadius, sal_uInt8 nValueOutside)
BitmapDilateFilter(sal_Int32 nRadius)
unsigned char sal_uInt8
BitmapErodeFilter(sal_Int32 nRadius, sal_uInt8 nValueOutside)
BitmapErodeFilter(sal_Int32 nRadius)