-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
318 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
#pragma once | ||
|
||
#include "pbrt/euclidean_space/bounds2.h" | ||
#include "pbrt/euclidean_space/point2.h" | ||
#include <vector> | ||
|
||
class Filter; | ||
|
||
class GreyScaleFilm { | ||
public: | ||
GreyScaleFilm(const Point2i &_resolution) | ||
: resolution(_resolution), | ||
pixel_bound(Bounds2i(Point2i(0, 0), Point2i(_resolution.x, _resolution.y))), | ||
pixels(std::vector<FloatType>(_resolution.x * _resolution.y, 0)) {} | ||
|
||
void add_sample(const Point2i &coord, FloatType val) { | ||
pixels[coord.y * resolution.x + coord.x] += val; | ||
} | ||
|
||
void add_splat(const Point2f &p_film, FloatType val, const Filter *filter); | ||
|
||
void write_to_png(const std::string &filename) const; | ||
|
||
private: | ||
Point2i resolution; | ||
std::vector<FloatType> pixels; | ||
Bounds2i pixel_bound; | ||
}; |
Oops, something went wrong.