Skip to content

Commit

Permalink
Merge pull request #86 from r1ckhu/limit-debug-output
Browse files Browse the repository at this point in the history
feat: limit debug output to Debug mode only
  • Loading branch information
mchenwang authored Jul 22, 2024
2 parents db50425 + f3278b7 commit 686daa6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/FunctionLayer/Film/Film.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ void Film::deposit(const Point2i &p, const Spectrum &s) {

void Film::save(const std::string &path) {
// ! A temp implementation
#ifdef _DEBUG
std::ofstream ofs("render_result.txt");
#endif
for (int i = 0; i < resolution.y; i++) {
for (int j = 0; j < resolution.x; j++) {
int id = i * resolution.x + j;
Spectrum value = sumValues[id] / sumWeights[id];
image->setColorAt(Point2i(j, i), value);
// for debug
ofs << j << " " << i << " " << value[0] << " " << value[1] << " " << value[2] << " " << std::endl;
#ifdef _DEBUG
ofs << j << " " << i << " " << value[0] << " " << value[1] << " " << value[2] << " " << std::endl;
#endif
}
}
image->saveTo(path);
Expand Down

0 comments on commit 686daa6

Please sign in to comment.