libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRNMatrixInt.h
Go to the documentation of this file.
1 /* Copyright 2006-2016 Yann LEYDIER, CoReNum, INSA-Lyon, ENS-Lyon
2  *
3  * This file is part of libcrn.
4  *
5  * libcrn is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * libcrn is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libcrn. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * file: CRNMatrixInt.h
19  * \author Yann LEYDIER, Jean DUONG
20  */
21 
22 #ifndef CRNMATRIXINT_HEADER
23 #define CRNMATRIXINT_HEADER
24 
25 #include <CRNMath/CRNMatrix.h>
27 
28 namespace crn
29 {
30  /****************************************************************************/
40  class MatrixInt: public Matrix<int>
41  {
42  public:
43  using Matrix<int>::Matrix;
44  MatrixInt(const Matrix<int> &m) : Matrix(m) {}
45  MatrixInt(Matrix<int> &&m) : Matrix(std::move(m)) {}
46  MatrixInt(const MatrixInt &) = default;
47  MatrixInt(MatrixInt &&) = default;
48 
50  virtual ~MatrixInt() override = default;
51 
52  MatrixInt& operator=(const MatrixInt &) = default;
53  MatrixInt& operator=(MatrixInt &&) = default;
54 
55  // Special matrix constructors
57  static MatrixInt NewGaussian(double sigma);
59  static MatrixInt NewGaussian3();
61  static MatrixInt NewGaussianSobelX(double sigma);
63  static MatrixInt NewGaussianSobelY(double sigma);
65  static MatrixInt NewSobelX();
67  static MatrixInt NewSobelY();
68 
69  // Distance transform half matrices
71  static MatrixInt NewD4DT1();
73  static MatrixInt NewD4DT2();
75  static MatrixInt NewD8DT1();
77  static MatrixInt NewD8DT2();
79  static MatrixInt NewChamferDT1();
81  static MatrixInt NewChamferDT2();
82 
84  };
85  template<> struct IsClonable<MatrixInt> : public std::true_type {};
86 
87  template<> struct TypeInfo<MatrixInt>
88  {
89  using SumType = MatrixInt;
92  };
93 
94 }
95 #endif
virtual ~MatrixInt() override=default
Destructor.
static MatrixInt NewGaussianSobelY(double sigma)
Creates a Gaussian Sobel Y derivation mask.
static MatrixInt NewChamferDT2()
Creates the second chamfer DT mask.
static MatrixInt NewSobelY()
Creates a Sobel Y derivation mask.
MatrixInt(const Matrix< int > &m)
Definition: CRNMatrixInt.h:44
static MatrixInt NewGaussianSobelX(double sigma)
Creates a Gaussian Sobel X derivation mask.
Integer matrix class.
Definition: CRNMatrixInt.h:40
MatrixInt & operator=(const MatrixInt &)=default
static MatrixInt NewSobelX()
Creates a Sobel X derivation mask.
Base matrix class.
Definition: CRNMatrix.h:43
static MatrixInt NewD8DT2()
Creates the second D8 DT mask.
static MatrixInt NewD4DT1()
Creates the first D4 DT mask.
MatrixInt(Matrix< int > &&m)
Definition: CRNMatrixInt.h:45
static MatrixInt NewGaussian3()
Creates a 3x3 Gaussian mask.
#define CRN_DECLARE_CLASS_CONSTRUCTOR(classname)
Declares a class constructor.
Definition: CRNObject.h:173
static MatrixInt NewD8DT1()
Creates the first D8 DT mask.
static MatrixInt NewGaussian(double sigma)
Creates a Gaussian mask given standard deviation.
A class containing informations on a type.
Definition: CRNType.h:176
static MatrixInt NewChamferDT1()
Creates the first chamfer DT mask.
static MatrixInt NewD4DT2()
Creates the second D4 DT mask.