Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TPixelTexture2D.h
Go to the documentation of this file.
1#pragma once
2
5#include "Math/math.h"
7#include "Math/TVector2.h"
8
9#include <memory>
10
11namespace ph
12{
13
14template<typename OutputType>
15class TPixelTexture2D : public TTexture<OutputType>
16{
17public:
18 explicit TPixelTexture2D(const std::shared_ptr<PixelBuffer2D>& pixelBuffer);
19
21 const std::shared_ptr<PixelBuffer2D>& pixelBuffer,
24 pixel_texture::EWrapMode wrapModeT);
25
26 void sample(
27 const SampleLocation& sampleLocation,
28 OutputType* out_value) const override = 0;
29
31
37 const PixelBuffer2D* getPixelBuffer() const;
38
41
42protected:
43 math::Vector2D sampleUVToST(const math::Vector2D& sampleUV) const;
44
45private:
46 std::shared_ptr<PixelBuffer2D> m_pixelBuffer;
47 pixel_texture::ESampleMode m_sampleMode;
48 pixel_texture::EWrapMode m_wrapModeS;
49 pixel_texture::EWrapMode m_wrapModeT;
50 math::Vector2D m_texelSize;
51};
52
53}// end namespace ph
54
Definition PixelBuffer2D.h:153
Definition SampleLocation.h:22
Definition TPixelTexture2D.h:16
pixel_buffer::TPixel< float64 > samplePixelBufferNearest(const math::Vector2D &sampleUV) const
Definition TPixelTexture2D.ipp:107
pixel_texture::EWrapMode getWrapModeT() const
Definition TPixelTexture2D.ipp:72
pixel_buffer::TPixel< float64 > samplePixelBuffer(const math::Vector2D &sampleUV) const
Definition TPixelTexture2D.ipp:91
const PixelBuffer2D * getPixelBuffer() const
Definition TPixelTexture2D.ipp:78
pixel_texture::ESampleMode getSampleMode() const
Definition TPixelTexture2D.ipp:60
TPixelTexture2D(const std::shared_ptr< PixelBuffer2D > &pixelBuffer)
Definition TPixelTexture2D.ipp:15
math::Vector2D sampleUVToST(const math::Vector2D &sampleUV) const
Definition TPixelTexture2D.ipp:85
pixel_texture::EWrapMode getWrapModeS() const
Definition TPixelTexture2D.ipp:66
void sample(const SampleLocation &sampleLocation, OutputType *out_value) const override=0
pixel_buffer::TPixel< float64 > samplePixelBufferBilinear(const math::Vector2D &sampleUV) const
Definition TPixelTexture2D.ipp:124
math::TVector2< uint32 > getSizePx() const
Definition TPixelTexture2D.ipp:47
math::Vector2D getTexelSize() const
Definition TPixelTexture2D.ipp:54
Definition TTexture.h:12
Represent a pixel from pixel buffer.
Definition PixelBuffer2D.h:27
Miscellaneous math utilities.
EWrapMode
Definition pixel_texture_basics.h:21
ESampleMode
Definition pixel_texture_basics.h:28
The root for all renderer implementations.
Definition EEngineProject.h:6