Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ReceiverSamplingWork.h
Go to the documentation of this file.
1#pragma once
2
4#include "Utility/IMoveOnly.h"
8#include "Math/TVector2.h"
11
12#include <atomic>
13#include <functional>
14
15namespace ph
16{
17
18class Receiver;
19
21{
22public:
24 explicit ReceiverSamplingWork(const Receiver* receiver);
26
28
29 void setSampleGenerator(std::unique_ptr<SampleGenerator> sampleGenerator);
30
32 const math::TVector2<int64>& rasterActualResPx,
33 const math::TAABB2D<float64>& rasterSampleWindowPx,
34 const math::TVector2<int64>& sampleRes);
35
36 void addProcessor(IReceivedRayProcessor* processor);
37
38 void onWorkStart(std::function<void()> func);
39 void onWorkReport(std::function<void()> func);
40 void onWorkFinish(std::function<void()> func);
41
43
44private:
45 void doWork() override;
46
47 const Receiver* m_receiver;
48 std::vector<IReceivedRayProcessor*> m_processors;
49 std::unique_ptr<SampleGenerator> m_sampleGenerator;
50 math::Vector2D m_rasterActualResPx;
51 math::TAABB2D<float64> m_rasterSampleWindowPx;
52 math::Vector2S m_sampleRes;
53
54 std::atomic_uint32_t m_numSamplesTaken;
55 std::function<void()> m_onWorkStart;
56 std::function<void()> m_onWorkReport;
57 std::function<void()> m_onWorkFinish;
58};
59
60}// end namespace ph
Marks the derived class as move only.
Definition IMoveOnly.h:23
Definition IReceivedRayProcessor.h:15
A target that can receive any physical quantity, typically electromagnetic energy....
Definition Receiver.h:22
Definition ReceiverSamplingWork.h:21
void onWorkReport(std::function< void()> func)
Definition ReceiverSamplingWork.cpp:170
void onWorkStart(std::function< void()> func)
Definition ReceiverSamplingWork.cpp:165
ReceiverSamplingWork & operator=(ReceiverSamplingWork &&other) noexcept
Definition ReceiverSamplingWork.cpp:180
void onWorkFinish(std::function< void()> func)
Definition ReceiverSamplingWork.cpp:175
void addProcessor(IReceivedRayProcessor *processor)
Definition ReceiverSamplingWork.cpp:158
ReceiverSamplingWork()
Definition ReceiverSamplingWork.cpp:16
void setSampleGenerator(std::unique_ptr< SampleGenerator > sampleGenerator)
Definition ReceiverSamplingWork.cpp:140
void setSampleDimensions(const math::TVector2< int64 > &rasterActualResPx, const math::TAABB2D< float64 > &rasterSampleWindowPx, const math::TVector2< int64 > &sampleRes)
Definition ReceiverSamplingWork.cpp:145
SamplingStatistics asyncGetStatistics() const
Definition ReceiverSamplingWork.cpp:54
Definition RenderWork.h:16
A 2-D Axis-Aligned Bounding Box (AABB).
Definition TAABB2D.h:26
Represents a 2-D vector.
Definition TVector2.h:19
The root for all renderer implementations.
Definition EEngineProject.h:6
Definition SamplingStatistics.h:9