NumCpp  2.14.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
wrap2d.hpp
Go to the documentation of this file.
1
28#pragma once
29
31#include "NumCpp/Core/Shape.hpp"
32#include "NumCpp/Core/Slice.hpp"
33#include "NumCpp/Core/Types.hpp"
35#include "NumCpp/NdArray.hpp"
36
38{
39 //============================================================================
40 // Method Description:
47 template<typename dtype>
49 {
51
52 const Shape inShape = inImage.shape();
54 outShape.rows += inBoundarySize * 2;
55 outShape.cols += inBoundarySize * 2;
56
60 inImage);
61
62 // bottom
65 inImage(Slice(inShape.rows - inBoundarySize, inShape.rows), Slice(0, inShape.cols)));
66
67 // top
71
72 // left
75 inImage(Slice(0, inShape.rows), Slice(inShape.cols - inBoundarySize, inShape.cols)));
76
77 // right
81
82 // now fill in the corners
86
92
99
100 return outArray;
101 }
102} // namespace nc::filter::boundary
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
A Shape Class for NdArrays.
Definition Core/shape.hpp:41
A Class for slicing into NdArrays.
Definition Slice.hpp:45
Definition addBoundary1d.hpp:44
NdArray< dtype > wrap2d(const NdArray< dtype > &inImage, uint32 inBoundarySize)
Definition wrap2d.hpp:48
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
std::uint32_t uint32
Definition Types.hpp:40