2023-01-24 13:32:19 +01:00
|
|
|
|
2023-01-26 22:56:23 +01:00
|
|
|
#ifndef CG1_TRACER_BLOOM_H
|
|
|
|
#define CG1_TRACER_BLOOM_H
|
2023-01-24 13:32:19 +01:00
|
|
|
|
|
|
|
#include "common/texture.h"
|
|
|
|
#include "common/vector3d.h"
|
|
|
|
|
2023-01-26 22:56:23 +01:00
|
|
|
class Bloom {
|
2023-01-24 13:32:19 +01:00
|
|
|
|
|
|
|
public:
|
2023-01-26 22:56:23 +01:00
|
|
|
Bloom(CImg<float> image);
|
2023-01-25 10:20:27 +01:00
|
|
|
CImg<float> bloom(float threshold, int kernelSize, float sigma, float intensity);
|
2023-01-24 13:32:19 +01:00
|
|
|
|
|
|
|
private:
|
2023-01-25 10:20:27 +01:00
|
|
|
void scaleBrightness(float scale);
|
|
|
|
void gaussianBlur(int kernelSize, float sigma);
|
|
|
|
|
|
|
|
CImg<float> convolution(CImg<float> &img, CImg<float> &kernel);
|
|
|
|
CImg<float> computeGaussianKernel(int kernelSize, float sigma);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CImg<float> image;
|
2023-01-24 13:32:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-01-26 22:56:23 +01:00
|
|
|
#endif //CG1_TRACER_BLOOM_H
|