Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TSamplingFilm.h
Go to the documentation of this file.
1#pragma once
2
3#include "Core/Filmic/Film.h"
6#include "Math/TVector2.h"
7#include "Frame/frame_fwd.h"
10
11#include <vector>
12#include <functional>
13#include <memory>
14
15namespace ph
16{
17
20template<typename Sample>
21class TSamplingFilm : public Film
22{
23public:
24 TSamplingFilm() = default;
25
27 int64 actualWidthPx,
28 int64 actualHeightPx,
29 const SampleFilter& filter);
30
32 int64 actualWidthPx,
33 int64 actualHeightPx,
34 const math::TAABB2D<int64>& effectiveWindowPx,
35 const SampleFilter& filter);
36
44 virtual void addSample(float64 xPx, float64 yPx, const Sample& sample) = 0;
45
54 virtual void setPixel(float64 xPx, float64 yPx, const Sample& sample) = 0;
55
56 void clear() override = 0;
57
58 void setEffectiveWindowPx(const math::TAABB2D<int64>& effectiveWindow) override;
59
71 void setSoftEdge(bool useSoftEdge, float32 softness = 1.0f);
72
75 const SampleFilter& getFilter() const;
77 bool isSoftEdged() const;
78
79private:
80 void developRegion(HdrRgbFrame& out_frame, const math::TAABB2D<int64>& regionPx) const override = 0;
81
82 void updateSampleDimensions();
83
84 SampleFilter m_filter;
85 math::TAABB2D<float64> m_sampleWindowPx;
86 float32 m_softness;
87};
88
89}// end namespace ph
90
A camera film that receives any quantity.
Definition Film.h:17
An image reconstruction kernel.
Definition SampleFilter.h:17
Definition Sample.h:9
A camera film that receives any quantity, for sampling-based rendering techniques.
Definition TSamplingFilm.h:22
void clear() override=0
Set all pixel data to its initial state.
TSamplingFilm()=default
virtual void setPixel(float64 xPx, float64 yPx, const Sample &sample)=0
Let the pixel developes to the specified sample value. An interface for using the film as an ordinary...
const SampleFilter & getFilter() const
Definition TSamplingFilm.ipp:72
void setSoftEdge(bool useSoftEdge, float32 softness=1.0f)
Whether to increase the sampling window converage for prettier boundaries in developed frame....
Definition TSamplingFilm.ipp:63
math::TVector2< float64 > getSampleResPx() const
Definition TSamplingFilm.ipp:78
virtual void addSample(float64 xPx, float64 yPx, const Sample &sample)=0
Applies filter to sample value and add to the film. Generally, this method can produce higher quality...
bool isSoftEdged() const
Definition TSamplingFilm.ipp:97
const math::TAABB2D< float64 > & getSampleWindowPx() const
Definition TSamplingFilm.ipp:84
void setEffectiveWindowPx(const math::TAABB2D< int64 > &effectiveWindow) override
Set the region where the film will be used. Implementation is advised to take advantage of this and o...
Definition TSamplingFilm.ipp:55
SamplingFilmDimensions getDimensions() const
Definition TSamplingFilm.ipp:91
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 SamplingFilmDimensions.h:12