Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ExrFileWriter.h
Go to the documentation of this file.
1#pragma once
2
4#include "Frame/frame_fwd.h"
5
6#include <string_view>
7
8namespace ph
9{
10
11class ByteBuffer;
12
14{
15public:
21
22 explicit ExrFileWriter(const Path& filePath);
23
24 void save(const HdrRgbFrame& frame);
25 void saveHighPrecision(const HdrRgbFrame& frame);
26
31 const HdrRgbFrame& frame,
32 bool saveInHighPrecision = false,
33 std::string_view redChannelName = "R",
34 std::string_view greenChannelName = "G",
35 std::string_view blueChannelName = "B",
36 std::string_view alphaChannelName = "",
37 HdrComponent alphaValue = 1);
38
44 void saveToMemory(
45 const HdrRgbFrame& frame,
46 ByteBuffer& buffer,
47 std::string_view redChannelName = "R",
48 std::string_view greenChannelName = "G",
49 std::string_view blueChannelName = "B",
50 std::string_view alphaChannelName = "",
51 HdrComponent alphaValue = 1);
52
53private:
54 static void saveStandaloneImageData(
55 const Path& filePath,
56 const HdrRgbFrame& frame,
57 bool saveInHighPrecision,
58 std::string_view redChannelName,
59 std::string_view greenChannelName,
60 std::string_view blueChannelName,
61 std::string_view alphaChannelName,
62 HdrComponent alphaValue);
63
64 Path m_filePath;
65};
66
67}// end namespace ph
An auto-resizable byte storage.
Definition ByteBuffer.h:18
Definition ExrFileWriter.h:14
ExrFileWriter()
Create default writer with limited functionalities. Constructed without a path, the file writer may h...
Definition ExrFileWriter.cpp:17
void saveToFilesystem(const HdrRgbFrame &frame, bool saveInHighPrecision=false, std::string_view redChannelName="R", std::string_view greenChannelName="G", std::string_view blueChannelName="B", std::string_view alphaChannelName="", HdrComponent alphaValue=1)
Save an EXR file to the filesystem. A channel will be ignored (not saved) if its name is empty.
Definition ExrFileWriter.cpp:35
void save(const HdrRgbFrame &frame)
Definition ExrFileWriter.cpp:25
void saveHighPrecision(const HdrRgbFrame &frame)
Definition ExrFileWriter.cpp:30
void saveToMemory(const HdrRgbFrame &frame, ByteBuffer &buffer, std::string_view redChannelName="R", std::string_view greenChannelName="G", std::string_view blueChannelName="B", std::string_view alphaChannelName="", HdrComponent alphaValue=1)
Save an EXR file to memory instead of filesystem. A channel will be ignored (not saved) if its name i...
Definition ExrFileWriter.cpp:57
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
The root for all renderer implementations.
Definition EEngineProject.h:6
float32 HdrComponent
Definition frame_fwd.h:14