Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
NaiveReinhardToneMapping.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <Common/assertion.h>
6#include <Common/primitive_type.h>
7
8#include <cmath>
9
10namespace ph
11{
12
14{
15public:
17
18 void operate(const HdrRgbFrame& srcFrame, HdrRgbFrame* out_dstFrame) override;
19};
20
21// In-header Implementations:
22
25
26inline void NaiveReinhardToneMapping::operate(const HdrRgbFrame& srcFrame, HdrRgbFrame* const out_dstFrame)
27{
28 PH_ASSERT(out_dstFrame);
29
30 out_dstFrame->setSize(srcFrame.getSizePx());
31
32 srcFrame.forEachPixel(
33 [this, out_dstFrame]
34 (const uint32 x, const uint32 y, const HdrRgbFrame::PixelType& pixel)
35 {
36 out_dstFrame->setPixel(x, y, pixel.div(pixel + 1.0_r));
37 });
38}
39
40}// end namespace ph
Definition FrameOperator.h:9
Definition NaiveReinhardToneMapping.h:14
void operate(const HdrRgbFrame &srcFrame, HdrRgbFrame *out_dstFrame) override
Definition NaiveReinhardToneMapping.h:26
NaiveReinhardToneMapping()
Definition NaiveReinhardToneMapping.h:23
void forEachPixel(PerPixelOperation op)
Iterate over all pixels in the frame in row-major order.
Definition TFrame.ipp:252
void setPixel(const math::TVector2< uint32 > &coordPx, const PixelType &pixel)
Definition TFrame.ipp:370
math::TVector2< uint32 > getSizePx() const
Definition TFrame.ipp:428
void setSize(uint32 wPx, uint32 hPx)
Definition TFrame.ipp:237
Derived div(const Derived &rhs) const
Definition TArithmeticArrayBase.ipp:134
Definition TArithmeticArray.h:13
The root for all renderer implementations.
Definition EEngineProject.h:6