SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
gaussianblurfilter.hpp
1// This file is part of slideio project.
2// It is subject to the license terms in the LICENSE file found in the top-level directory
3// of this distribution and at http://slideio.com/license.html.
4#pragma once
5#include "slideio/transformer/transformer_def.hpp"
6#include "slideio/transformer/transformationex.hpp"
7#include "slideio/transformer/transformationtype.hpp"
8
9namespace slideio
10{
11 class SLIDEIO_TRANSFORMER_EXPORTS GaussianBlurFilter : public TransformationEx
12 {
13 public:
14 GaussianBlurFilter()
15 {
16 m_type = TransformationType::GaussianBlurFilter;
17 }
18
19 GaussianBlurFilter(const GaussianBlurFilter& other)
20 : TransformationEx(other),
21 m_kernelSizeX(other.m_kernelSizeX),
22 m_kernelSizeY(other.m_kernelSizeY),
23 m_sigmaX(other.m_sigmaX),
24 m_sigmaY(other.m_sigmaY) {
25 }
26
27 GaussianBlurFilter(GaussianBlurFilter&& other) noexcept
28 : TransformationEx(std::move(other)),
29 m_kernelSizeX(other.m_kernelSizeX),
30 m_kernelSizeY(other.m_kernelSizeY),
31 m_sigmaX(other.m_sigmaX),
32 m_sigmaY(other.m_sigmaY) {
33 }
34
35 GaussianBlurFilter& operator=(const GaussianBlurFilter& other) {
36 if (this == &other)
37 return *this;
38 TransformationEx::operator =(other);
39 m_kernelSizeX = other.m_kernelSizeX;
40 m_kernelSizeY = other.m_kernelSizeY;
41 m_sigmaX = other.m_sigmaX;
42 m_sigmaY = other.m_sigmaY;
43 return *this;
44 }
45
46 GaussianBlurFilter& operator=(GaussianBlurFilter&& other) noexcept {
47 if (this == &other)
48 return *this;
49 TransformationEx::operator =(std::move(other));
50 m_kernelSizeX = other.m_kernelSizeX;
51 m_kernelSizeY = other.m_kernelSizeY;
52 m_sigmaX = other.m_sigmaX;
53 m_sigmaY = other.m_sigmaY;
54 return *this;
55 }
56
57 int getKernelSizeX() const
58 {
59 return m_kernelSizeX;
60 }
61
62 void setKernelSizeX(int kernelSizeX)
63 {
64 m_kernelSizeX = kernelSizeX;
65 }
66
67 int getKernelSizeY() const
68 {
69 return m_kernelSizeY;
70 }
71
72 void setKernelSizeY(int kernelSizeY)
73 {
74 m_kernelSizeY = kernelSizeY;
75 }
76
77 double getSigmaX() const
78 {
79 return m_sigmaX;
80 }
81
82 void setSigmaX(double sigmaX)
83 {
84 m_sigmaX = sigmaX;
85 }
86
87 double getSigmaY() const
88 {
89 return m_sigmaY;
90 }
91
92 void setSigmaY(double sigmaY)
93 {
94 m_sigmaY = sigmaY;
95 }
96
97 void applyTransformation(const cv::Mat& block, cv::OutputArray transformedBlock) const override;
98 int getInflationValue() const override;
99 private:
100 int m_kernelSizeX = 5;
101 int m_kernelSizeY = 5;
102 double m_sigmaX = 0;
103 double m_sigmaY = 0;
104
105 };
106}
Definition: exceptions.hpp:15