Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TPwcDistribution2D.h
Go to the documentation of this file.
1#pragma once
2
4#include "Math/TVector2.h"
6
7#include <cstddef>
8#include <vector>
9#include <array>
10
11namespace ph::math
12{
13
14template<typename T>
16{
17public:
19 const TAABB2D<T>& range,
20 const T* weights,
21 const TVector2<std::size_t>& numWeights);
22
24 const T* weights,
25 const TVector2<std::size_t>& numWeights);
26
28
29 // PDFs returned by these methods are never zero.
30 TVector2<T> sampleContinuous(const std::array<T, 2>& sample, T* out_pdf) const;
31
32 T pdfContinuous(const std::array<T, 2>& sample) const;
33
34private:
35 TPwcDistribution1D<T> m_marginalYs;
36 std::vector<TPwcDistribution1D<T>> m_conditionalXs;
37};
38
39}// end namespace ph::math
40
A 2-D Axis-Aligned Bounding Box (AABB).
Definition TAABB2D.h:26
A 1-D piecewise constant distribution of floating-point type T. The sample weights can be seen as a h...
Definition TPwcDistribution1D.h:16
Definition TPwcDistribution2D.h:16
T pdfContinuous(const std::array< T, 2 > &sample) const
Definition TPwcDistribution2D.ipp:77
TVector2< T > sampleContinuous(const std::array< T, 2 > &sample, T *out_pdf) const
Definition TPwcDistribution2D.ipp:60
Represents a 2-D vector.
Definition TVector2.h:19
Math functions and utilities.
Definition TransformInfo.h:10