Toshihiro Shimizu 890ddd
#ifndef PERLINNOISE_H
Toshihiro Shimizu 890ddd
#define PERLINOISE_H
Shinya Kitaoka 42bfb6
Shinya Kitaoka 42bfb6
#include <memory></memory>
Shinya Kitaoka 42bfb6
Toshihiro Shimizu 890ddd
#include "tfxparam.h"
Toshihiro Shimizu 890ddd
#include "tspectrumparam.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
enum {
Toshihiro Shimizu 890ddd
	PNOISE_CLOUDS,
Toshihiro Shimizu 890ddd
	PNOISE_WOODS
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class PerlinNoise
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	static int Size;
Toshihiro Shimizu 890ddd
	static int TimeSize;
Toshihiro Shimizu 890ddd
	static int Offset;
Toshihiro Shimizu 890ddd
	static double Pixel_size;
Shinya Kitaoka 42bfb6
	std::unique_ptr<float[]> Noise;</float[]>
Toshihiro Shimizu 890ddd
	double LinearNoise(double x, double y, double t);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	PerlinNoise();
Toshihiro Shimizu 890ddd
	double Turbolence(double u, double v, double k, double grain);
Toshihiro Shimizu 890ddd
	double Turbolence(double u, double v, double k, double grain, double min, double max);
Toshihiro Shimizu 890ddd
	double Marble(double u, double v, double k, double grain);
Toshihiro Shimizu 890ddd
	double Marble(double u, double v, double k, double grain, double min, double max);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
/*---------------------------------------------------------------------------*/
Toshihiro Shimizu 890ddd
void doClouds(
Toshihiro Shimizu 890ddd
	const TRasterP &ras,
Toshihiro Shimizu 890ddd
	const TSpectrumParamP colors,
Toshihiro Shimizu 890ddd
	TPointD pos,
Toshihiro Shimizu 890ddd
	double evolution,
Toshihiro Shimizu 890ddd
	double size,
Toshihiro Shimizu 890ddd
	double min,
Toshihiro Shimizu 890ddd
	double max,
Toshihiro Shimizu 890ddd
	int type,
Toshihiro Shimizu 890ddd
	double scale,
Toshihiro Shimizu 890ddd
	double frame);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif