11template<
typename SamplingFilmType,
typename EstimationType>
14 const std::size_t numFilms,
15 const std::size_t numEstimations,
19 m_filter (
std::move(filter)),
20 m_estimations (numEstimations),
21 m_filmActualResFPx(0),
24 m_integrand (
std::move(integrand)),
27 for(SamplingFilmType& film :
m_films)
29 film = SamplingFilmType(
37template<
typename SamplingFilmType,
typename EstimationType>
40 m_filter (
std::move(other.m_filter)),
41 m_estimations (
std::move(other.m_estimations)),
42 m_filmActualResFPx(
std::move(other.m_filmActualResFPx)),
43 m_films (
std::move(other.m_films)),
44 m_estimators (
std::move(other.m_estimators)),
45 m_integrand (
std::move(other.m_integrand)),
46 m_estimationToFilm(
std::move(other.m_estimationToFilm))
49template<
typename SamplingFilmType,
typename EstimationType>
58 for(
const auto* estimator : m_estimators)
60 estimator->estimate(sensedRay, m_integrand, sampleFlow, m_estimations);
63 for(
const auto& estimationToFilm : m_estimationToFilm)
65 const std::size_t estimationIndex = estimationToFilm.first;
66 const std::size_t filmIndex = estimationToFilm.second;
68 m_films[filmIndex].addSample(rasterCoord.x(), rasterCoord.y(), m_estimations[estimationIndex] * quantityWeight);
72template<
typename SamplingFilmType,
typename EstimationType>
79 m_estimators.push_back(estimator);
82template<
typename SamplingFilmType,
typename EstimationType>
85 const std::size_t filmIndex,
86 const std::size_t estimationIndex)
89 PH_ASSERT_LT(filmIndex, m_films.size());
90 PH_ASSERT_LT(estimationIndex, m_estimations.numEstimations());
92 m_estimationToFilm.push_back({estimationIndex, filmIndex});
95template<
typename SamplingFilmType,
typename EstimationType>
100 for(std::size_t i = 0; i < m_films.size(); ++i)
106template<
typename SamplingFilmType,
typename EstimationType>
111 PH_ASSERT_LT(index, m_films.size());
113 m_films[index].clear();
116template<
typename SamplingFilmType,
typename EstimationType>
118mergeFilmTo(
const std::size_t fromIndex, SamplingFilmType& toFilm)
121 PH_ASSERT_LT(fromIndex, m_films.size());
123 toFilm.mergeWith(m_films[fromIndex]);
126template<
typename SamplingFilmType,
typename EstimationType>
131 const bool useSoftEdge)
136 for(SamplingFilmType& film : m_films)
138 film.setActualResPx(actualResPx);
139 film.setEffectiveWindowPx(effectiveWindowPx);
140 film.setSoftEdge(useSoftEdge);
144template<
typename SamplingFilmType,
typename EstimationType>
149 return m_estimations.numEstimations();
152template<
typename SamplingFilmType,
typename EstimationType>
157 PH_ASSERT(!m_films.empty());
159 return m_films.front().getEffectiveWindowPx();
162template<
typename SamplingFilmType,
typename EstimationType>
167 PH_ASSERT(!m_films.empty());
169 return m_films.front().getDimensions();
172template<
typename SamplingFilmType,
typename EstimationType>
177 PH_ASSERT(!m_films.empty());
179 return m_films.front().isSoftEdged();
182template<
typename SamplingFilmType,
typename EstimationType>
187 IReceivedRayProcessor::operator = (std::move(other));
189 m_filter = std::move(other.m_filter);
190 m_estimations = std::move(other.m_estimations);
191 m_filmActualResFPx = std::move(other.m_filmActualResFPx);
192 m_films = std::move(other.m_films);
193 m_estimators = std::move(other.m_estimators);
194 m_integrand = std::move(other.m_integrand);
195 m_estimationToFilm = std::move(other.m_estimationToFilm);
Definition Integrand.h:12
Represents a ray in space.
Definition Ray.h:21
An image reconstruction kernel.
Definition SampleFilter.h:17
A sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
Definition TIRayEstimator.h:17
Definition TReceiverMeasurementEstimator.h:23
bool isSoftEdgedFilm() const
Definition TReceiverMeasurementEstimator.ipp:174
std::vector< SamplingFilmType > m_films
Definition TReceiverMeasurementEstimator.h:66
void process(const math::Vector2D &rasterCoord, const Ray &sensedRay, const math::Spectrum &quantityWeight, SampleFlow &sampleFlow) override
Definition TReceiverMeasurementEstimator.ipp:51
void clearFilm(std::size_t index)
Definition TReceiverMeasurementEstimator.ipp:108
void addEstimator(const Estimator *estimator)
Definition TReceiverMeasurementEstimator.ipp:74
TReceiverMeasurementEstimator & operator=(TReceiverMeasurementEstimator &&other)
Definition TReceiverMeasurementEstimator.ipp:184
void setFilmDimensions(const math::TVector2< int64 > &actualResPx, const math::TAABB2D< int64 > &effectiveWindowPx, bool useSoftEdge=true)
Definition TReceiverMeasurementEstimator.ipp:128
void addFilmEstimation(std::size_t filmIndex, std::size_t estimationIndex)
Definition TReceiverMeasurementEstimator.ipp:84
SamplingFilmDimensions getFilmDimensions() const
Definition TReceiverMeasurementEstimator.ipp:164
void clearFilms()
Definition TReceiverMeasurementEstimator.ipp:97
SampleFilter m_filter
Definition TReceiverMeasurementEstimator.h:63
math::TAABB2D< int64 > getFilmEffectiveWindowPx() const
Definition TReceiverMeasurementEstimator.ipp:154
TReceiverMeasurementEstimator()=default
std::size_t numEstimations() const
Definition TReceiverMeasurementEstimator.ipp:146
void mergeFilmTo(std::size_t fromIndex, SamplingFilmType &toFilm)
Definition TReceiverMeasurementEstimator.ipp:118
A 2-D Axis-Aligned Bounding Box (AABB).
Definition TAABB2D.h:26
Definition TTristimulusSpectrum.h:11
TVector2< float64 > Vector2D
Definition math_fwd.h:47
The root for all renderer implementations.
Definition EEngineProject.h:6
Definition SamplingFilmDimensions.h:12