https://github.com/lingqi/WaveOpticsBrdf
Revision 73853c6dfa6152945bfc02eb94349ca510ca7d72 authored by Milos Hasan on 08 January 2019, 00:26:32 UTC, committed by Milos Hasan on 08 January 2019, 00:26:32 UTC
1 parent a92800f
Tip revision: 73853c6dfa6152945bfc02eb94349ca510ca7d72 authored by Milos Hasan on 08 January 2019, 00:26:32 UTC
print ranges
print ranges
Tip revision: 73853c6
waveNdf.h
/*
Copyright 2018 Lingqi Yan
This file is part of WaveOpticsBrdf.
WaveOpticsBrdf is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
WaveOpticsBrdf is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with WaveOpticsBrdf. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef WNDF_H
#define WNDF_H
#include "waveBrdf.h"
typedef Eigen::Matrix<std::complex<float>, Eigen::Dynamic, 1> VectorXc;
typedef Eigen::Array<float, 3, 1> Color;
typedef Eigen::Array<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> FloatImage;
typedef Eigen::Array<Color, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> ColorImage;
typedef Eigen::Array<std::complex<float>, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> ComplexImage;
class WaveNDF
{
Heightfield& hf;
int resolution, crop, k;
ComplexImage img, tmp;
FloatImage out;
ColorImage rgb, cropped;
VectorXc a, b;
std::vector<float> lambdas, colors;
std::vector<FloatImage> channels;
bool visRs;
void fft2();
void fftshift();
void mkCrop();
public:
WaveNDF(Heightfield& h, int res, int c=0, int fk=3, bool rs=false):
hf(h), resolution(res), crop(c), k(fk), visRs(rs) {}
void generate(const Query& query, const char* outputFilename);
void generateSpectral(const Query& query, const char* outputFilename);
};
#endif
Computing file changes ...