Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
frame_utils.h
Go to the documentation of this file.
1#pragma once
2
3#include "Frame/TFrame.h"
4
5#include <cmath>
6
7namespace ph
8{
9
10namespace frame_utils
11{
12
13// Converts HDR frame to LDR frame. Values outside [0, 1] will be clamped.
14void to_LDR(const HdrRgbFrame& srcFrame, LdrRgbFrame* out_dstFrame);
15
16// Converts LDR frame to HDR frame. Values will be in [0, 1].
17void to_HDR(const LdrRgbFrame& srcFrame, HdrRgbFrame* out_dstFrame);
18
19// Computes per-pixel absolute difference between frameA and frameB.
20void abs_diff(const HdrRgbFrame& frameA, const HdrRgbFrame& frameB, HdrRgbFrame* out_result);
21
22// Calculates Mean Squared Error (MSE) of an estimated frame.
23real calc_MSE(const HdrRgbFrame& expected, const HdrRgbFrame& estimated);
24
25// Calculates Root-Mean-Square Error (RMSE) of an estimated frame.
26real calc_RMSE(const HdrRgbFrame& expected, const HdrRgbFrame& estimated);
27
28// In-header Implementations:
29
30inline real calc_RMSE(const HdrRgbFrame& expected, const HdrRgbFrame& estimated)
31{
32 return std::sqrt(calc_MSE(expected, estimated));
33}
34
35}// end namespace frame_utils
36
37}// end namespace ph
void to_HDR(const LdrRgbFrame &srcFrame, HdrRgbFrame *const out_dstFrame)
Definition frame_utils.cpp:28
real calc_RMSE(const HdrRgbFrame &expected, const HdrRgbFrame &estimated)
Definition frame_utils.h:30
void abs_diff(const HdrRgbFrame &frameA, const HdrRgbFrame &frameB, HdrRgbFrame *const out_result)
Definition frame_utils.cpp:44
void to_LDR(const HdrRgbFrame &srcFrame, LdrRgbFrame *const out_dstFrame)
Definition frame_utils.cpp:14
real calc_MSE(const HdrRgbFrame &expected, const HdrRgbFrame &estimated)
Definition frame_utils.cpp:68
The root for all renderer implementations.
Definition EEngineProject.h:6
TFrame< HdrComponent, 3 > HdrRgbFrame
Definition frame_fwd.h:17
TFrame< LdrComponent, 3 > LdrRgbFrame
Definition frame_fwd.h:16