libcrn
3.9.5
A document image processing library
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
libcrn
CRNMath
CRNMath.cpp
Go to the documentation of this file.
1
/* Copyright 2009-2013 INSA 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: CRNMath.cpp
19
* \author Yann LEYDIER
20
*/
21
22
#include <
CRNMath/CRNMath.h
>
23
24
using namespace
crn;
25
31
Orientation
crn::ToOrientation
(
Direction
d) noexcept
32
{
33
if
(!!(d &
Direction::LEFT
) || !!(d &
Direction::RIGHT
))
34
{
35
return
Orientation::HORIZONTAL
;
36
}
37
else
if
(!!(d &
Direction::TOP
) || !!(d &
Direction::BOTTOM
))
38
{
39
return
Orientation::VERTICAL
;
40
}
41
else
42
return
Orientation::INVALID
;
43
}
44
CRNMath.h
crn::Orientation
Orientation
An enumeration of orientations.
Definition:
CRNMath.h:152
crn::Direction
Direction
An enumeration of directions.
Definition:
CRNMath.h:122
crn::Direction::BOTTOM
crn::ToOrientation
Orientation ToOrientation(Direction d) noexcept
Definition:
CRNMath.cpp:31
crn::Direction::TOP
crn::Direction::RIGHT
crn::Direction::LEFT
crn::Orientation::INVALID
crn::Orientation::VERTICAL
crn::Orientation::HORIZONTAL
Generated on Thu Sep 7 2017 13:54:26 for libcrn by
1.8.6