3#include "../../catch2/catch.hpp"
8#define MX_NO_ERROR_REPORTS
10#include "../../../include/sigproc/signalWindows.hpp"
11#include "../../../include/improc/eigenImage.hpp"
12#include "../../../include/improc/milkImage.hpp"
20SCENARIO(
"creating 2D Rectangular Tukey Windows",
"[sigproc::signalWindows::tukey2dSquare]" )
22 GIVEN(
"a centered square array" )
24 WHEN(
"256x256, alpha=0" )
28 win.resize( 256, 256 );
30 mx::sigproc::window::tukey2dSquare<float>( win.data(),
36 0.5 * ( win.rows() - 1.0 ),
37 0.5 * ( win.cols() - 1.0 ) );
39 REQUIRE( win.sum() == 256 * 256 );
42 WHEN(
"256x256, alpha=1" )
46 win.resize( 256, 256 );
48 mx::sigproc::window::tukey2dSquare<float>( win.data(),
54 0.5 * ( win.rows() - 1.0 ),
55 0.5 * ( win.cols() - 1.0 ) );
57 std::vector<float> win1( 256 );
58 mx::sigproc::window::tukey<float>( win1, 1.0 );
60 REQUIRE( win( 0, 0 ) == win1[0] * win1[0] );
61 REQUIRE( win( 10, 15 ) == win1[10] * win1[15] );
63 WHEN(
"256x256, alpha=0.5" )
67 win.resize( 256, 256 );
69 mx::sigproc::window::tukey2dSquare<float>( win.data(),
75 0.5 * ( win.rows() - 1.0 ),
76 0.5 * ( win.cols() - 1.0 ) );
78 std::vector<float> win1( 256 );
79 mx::sigproc::window::tukey<float>( win1, 0.5 );
84 REQUIRE( win( 0, 0 ) == win1[0] * win1[0] );
85 REQUIRE( win( 10, 15 ) == win1[10] * win1[15] );
Class to interface with an ImageStreamIO image in shared memory.
void create(const std::string &imname, uint32_t sz0, uint32_t sz1)
Create (or re-create) and connect to an image, allocating the eigenMap.
Eigen::Array< scalarT, -1, -1 > eigenImage
Definition of the eigenImage type, which is an alias for Eigen::Array.