NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
rot90.hpp
Go to the documentation of this file.
1
#pragma once
29
30
#include "
NumCpp/Core/Types.hpp
"
31
#include "
NumCpp/Functions/flip.hpp
"
32
#include "
NumCpp/Functions/fliplr.hpp
"
33
#include "
NumCpp/Functions/flipud.hpp
"
34
#include "
NumCpp/NdArray.hpp
"
35
36
namespace
nc
37
{
38
//============================================================================
39
// Method Description:
50
template
<
typename
dtype>
51
NdArray<dtype>
rot90
(
const
NdArray<dtype>
& inArray,
uint8
inK = 1)
52
{
53
inK %= 4;
54
switch
(inK)
55
{
56
case
0:
57
{
58
return
inArray;
59
}
60
case
1:
61
{
62
return
flipud
(inArray.
transpose
());
63
}
64
case
2:
65
{
66
return
flip
(inArray,
Axis::NONE
);
67
}
68
case
3:
69
{
70
return
fliplr
(inArray.
transpose
());
71
}
72
default
:
73
{
74
// this isn't actually possible, just putting this here to get rid
75
// of the compiler warning.
76
return
{};
77
}
78
}
79
}
80
}
// namespace nc
nc::Axis::NONE
@ NONE
flip.hpp
nc::uint8
std::uint8_t uint8
Definition:
Types.hpp:42
fliplr.hpp
nc::NdArray::transpose
NdArray< dtype > transpose() const
Definition:
NdArrayCore.hpp:4652
nc::NdArray< dtype >
NdArray.hpp
nc::flip
NdArray< dtype > flip(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition:
flip.hpp:48
nc
Definition:
Coordinate.hpp:44
nc::flipud
NdArray< dtype > flipud(const NdArray< dtype > &inArray)
Definition:
flipud.hpp:48
flipud.hpp
nc::rot90
NdArray< dtype > rot90(const NdArray< dtype > &inArray, uint8 inK=1)
Definition:
rot90.hpp:51
Types.hpp
nc::fliplr
NdArray< dtype > fliplr(const NdArray< dtype > &inArray)
Definition:
fliplr.hpp:48
include
NumCpp
Functions
rot90.hpp
Generated by
1.8.17