13template<
typename T, std::
size_t N>
23 const float64 u = sampleLocation.
uvw().
x();
24 const float64 v = sampleLocation.
uvw().
y();
28 PH_ASSERT(w != 0 && h != 0);
33 const float64 x = normU * w;
34 const float64 y = normV * h;
35 const float64 x0 = std::floor(x - 0.5) + 0.5;
36 const float64 y0 = std::floor(y - 0.5) + 0.5;
37 const float64 x1 = x0 + 1.0;
38 const float64 y1 = y0 + 1.0;
40 const float64 weights[4]
49 {x0, y0}, {x0, y1}, {x1, y0}, {x1, y1}
54 for(std::size_t i = 0; i < 4; ++i)
56 float64 normUi, normVi;
61 uint32 xi =
static_cast<uint32
>(normUi * w);
62 uint32 yi =
static_cast<uint32
>(normVi * h);
63 xi = xi < w ? xi : w - 1;
64 yi = yi < h ? yi : h - 1;
71 if constexpr(std::is_integral_v<T>)
Definition SampleLocation.h:22
math::Vector3R uvw() const
Gets and sets the uvw coordinates of this sample location.
Definition SampleLocation.h:90
float64 getTexelSizeV() const
Definition TAbstractPixelTex2D.h:42
uint32 getWidthPx() const
Definition TAbstractPixelTex2D.h:39
uint32 getHeightPx() const
Definition TAbstractPixelTex2D.h:40
float64 getTexelSizeU() const
Definition TAbstractPixelTex2D.h:41
void normalizeUV(const float64 u, const float64 v, float64 *const out_u, float64 *const out_v) const
Definition TAbstractPixelTex2D.h:52
Definition TBilinearPixelTex2D.h:15
void sample(const SampleLocation &sampleLocation, TTexPixel< T, N > *const out_value) const override
Definition TBilinearPixelTex2D.h:19
Definition TPixelTex2D.h:16
void getPixel(const uint32 x, const uint32 y, TTexPixel< T, N > *const out_pixel) const
Definition TPixelTex2D.h:40
TPixelTex2D()
Definition TPixelTex2D.h:18
Derived & addLocal(const Derived &rhs)
Definition TArithmeticArrayBase.ipp:40
Definition TArithmeticArray.h:13
T & y()
Definition TVector3.ipp:189
T & x()
Definition TVector3.ipp:183
The root for all renderer implementations.
Definition EEngineProject.h:6
math::TArithmeticArray< T, N > TTexPixel
Definition TTexPixel.h:11