Output
Source
{
int R = 120, C = 160;
mat x(R, C);
cx_mat X(R, C);
mat mag(R, C);
FFTW ss(R, C, FFTW_ESTIMATE);
gp0.
window(
"Image", 10, 10, 2 * C + 80, 2 * R + 50);
gp1.
window(
"FFT Blue channel", 640, 10, 2 * C + 80 + 50, 2 * R + 50);
cube x3(R, C, 3, fill::randu);
x3 *= 100;
x3.slice(0).submat(span(20, 51), span(20, 51)) =
250 * ones(32, 32);
x3.slice(1).submat(span(80, 111), span(70, 101)) =
250 * ones(32, 32);
x3.slice(2).submat(span(20, 51), span(110, 141)) =
250 * ones(32, 32);
ppm.
write(
"test.ppm", ppm.
PPM_B, x3,
"Test picture");
x = x3.slice(2);
return 0;
}