SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
medianblurfilter.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/transformationex.hpp"
6#include "slideio/transformer/transformationtype.hpp"
7
8namespace slideio
9{
10
11 class SLIDEIO_TRANSFORMER_EXPORTS MedianBlurFilter : public TransformationEx
12 {
13 public:
14 MedianBlurFilter()
15 {
16 m_type = TransformationType::MedianBlurFilter;
17 }
18
19 MedianBlurFilter(const MedianBlurFilter& other)
20 : TransformationEx(other),
21 m_kernelSize(other.m_kernelSize) {
22 }
23
24 MedianBlurFilter(MedianBlurFilter&& other) noexcept
25 : TransformationEx(std::move(other)),
26 m_kernelSize(other.m_kernelSize) {
27 }
28
29 MedianBlurFilter& operator=(const MedianBlurFilter& other) {
30 if (this == &other)
31 return *this;
32 TransformationEx::operator =(other);
33 m_kernelSize = other.m_kernelSize;
34 return *this;
35 }
36
37 MedianBlurFilter& operator=(MedianBlurFilter&& other) noexcept {
38 if (this == &other)
39 return *this;
40 TransformationEx::operator =(std::move(other));
41 m_kernelSize = other.m_kernelSize;
42 return *this;
43 }
44
45 virtual ~MedianBlurFilter() = default;
46
47 int getKernelSize() const
48 {
49 return m_kernelSize;
50 }
51
52 void setKernelSize(int kernelSize)
53 {
54 m_kernelSize = kernelSize;
55 }
56
57 void applyTransformation(const cv::Mat& block, cv::OutputArray transformedBlock) const override;
58 int getInflationValue() const override;
59
60 private:
61 int m_kernelSize = 5;
62 };
63
64}
Definition: exceptions.hpp:15