Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
PfmFile.h
Go to the documentation of this file.
1#pragma once
2
3#include "Frame/TFrame.h"
4
5#include <Common/assertion.h>
6
7namespace ph { class Path; }
8
9namespace ph
10{
11
17class PfmFile final
18{
19public:
20 PfmFile() = default;
21 explicit PfmFile(const TFrame<float32, 3>& colorFrame);
22
23 void copy(const TFrame<float32, 3>& colorFrame);
24 void load(const Path& filePath);
25 void save(const Path& filePath) const;
26 const TFrame<float32, 3>& getColorFrame() const;
27 bool isMonochromatic() const;
28
29private:
30 TFrame<float32, 3> m_frame;
31 bool m_isMonochromatic = false;
32};
33
34inline PfmFile::PfmFile(const TFrame<float32, 3>& colorFrame)
35 : m_frame(colorFrame)
36 , m_isMonochromatic(false)
37{}
38
39inline void PfmFile::copy(const TFrame<float32, 3>& colorFrame)
40{
41 m_frame = colorFrame;
42 m_isMonochromatic = false;
43}
44
46{
47 PH_ASSERT(!m_isMonochromatic);
48
49 return m_frame;
50}
51
52inline bool PfmFile::isMonochromatic() const
53{
54 return m_isMonochromatic;
55}
56
57}// end namespace ph
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
Writer for Portable FloatMap image format.
Definition PfmFile.h:18
void load(const Path &filePath)
Definition PfmFile.cpp:23
void save(const Path &filePath) const
Definition PfmFile.cpp:109
bool isMonochromatic() const
Definition PfmFile.h:52
PfmFile()=default
const TFrame< float32, 3 > & getColorFrame() const
Definition PfmFile.h:45
void copy(const TFrame< float32, 3 > &colorFrame)
Definition PfmFile.h:39
Definition TFrame.h:21
The root for all renderer implementations.
Definition EEngineProject.h:6