Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TFrame< T, N > Class Template Referencefinal

#include <TFrame.h>

Public Types

using ElementType = T
 
template<typename U >
using TPixelType = math::TArithmeticArray<U, N>
 
using PixelType = TPixelType<T>
 

Public Member Functions

 TFrame ()
 Constructs an empty frame.
 
 TFrame (uint32 wPx, uint32 hPx)
 Constructs a frame with specified dimensions. All pixels are initialized to 0.
 
 TFrame (const TFrame &other)
 
 TFrame (TFrame &&other) noexcept
 
 ~TFrame ()=default
 
void fill (T value)
 
void fill (T value, const math::TAABB2D< uint32 > &region)
 
void flipHorizontally ()
 
void flipVertically ()
 
void setSize (uint32 wPx, uint32 hPx)
 
void setSize (const math::TVector2< uint32 > &sizePx)
 
void sample (TFrame &sampled, const math::TMathFunction2D< float64 > &kernel, uint32 kernelRadiusPx) const
 
void setPixel (const math::TVector2< uint32 > &coordPx, const PixelType &pixel)
 
void setPixel (uint32 x, uint32 y, const PixelType &pixel)
 
PixelType getPixel (const math::TVector2< uint32 > &coordPx) const
 
void getPixel (uint32 x, uint32 y, PixelType *out_pixel) const
 
void copyPixelData (const math::TAABB2D< uint32 > &region, TSpan< T > out_data) const
 Copy a region of pixel data into a buffer.
 
math::TVector2< uint32 > getSizePx () const
 
TFrameoperator= (const TFrame &rhs)
 
TFrameoperator= (TFrame &&rhs) noexcept
 
uint32 widthPx () const
 
uint32 heightPx () const
 
bool isEmpty () const
 
constexpr std::size_t numPixelComponents () const noexcept
 
template<typename U >
TFrame< T, N >::template TPixelType< U > makeMonochromaticPixel (const U value)
 
template<typename PerPixelOperation >
void forEachPixel (PerPixelOperation op)
 Iterate over all pixels in the frame in row-major order.
 
template<typename PerPixelOperation >
void forEachPixel (PerPixelOperation op) const
 
template<typename PerPixelOperation >
void forEachPixel (const math::TAABB2D< uint32 > &region, PerPixelOperation op)
 Iterate over all pixels in the frame in row-major order.
 
template<typename PerPixelOperation >
void forEachPixel (const math::TAABB2D< uint32 > &region, PerPixelOperation op) const
 
TSpan< T > getPixelData ()
 Get pixel data for the full frame.
 
TSpanView< T > getPixelData () const
 

Static Public Member Functions

template<typename U = T>
static TPixelType< U > makeMonochromaticPixel (U value)
 

Member Typedef Documentation

◆ ElementType

template<typename T , std::size_t N>
using ph::TFrame< T, N >::ElementType = T

◆ PixelType

template<typename T , std::size_t N>
using ph::TFrame< T, N >::PixelType = TPixelType<T>

◆ TPixelType

template<typename T , std::size_t N>
template<typename U >
using ph::TFrame< T, N >::TPixelType = math::TArithmeticArray<U, N>

Constructor & Destructor Documentation

◆ TFrame() [1/4]

template<typename T , std::size_t N>
ph::TFrame< T, N >::TFrame ( )
inline

Constructs an empty frame.

◆ TFrame() [2/4]

template<typename T , std::size_t N>
ph::TFrame< T, N >::TFrame ( uint32 wPx,
uint32 hPx )
inline

Constructs a frame with specified dimensions. All pixels are initialized to 0.

◆ TFrame() [3/4]

template<typename T , std::size_t N>
ph::TFrame< T, N >::TFrame ( const TFrame< T, N > & other)
inline

◆ TFrame() [4/4]

template<typename T , std::size_t N>
ph::TFrame< T, N >::TFrame ( TFrame< T, N > && other)
inlinenoexcept

◆ ~TFrame()

template<typename T , std::size_t N>
ph::TFrame< T, N >::~TFrame ( )
inlinedefault

Member Function Documentation

◆ copyPixelData()

template<typename T , std::size_t N>
void ph::TFrame< T, N >::copyPixelData ( const math::TAABB2D< uint32 > & region,
TSpan< T > out_data ) const
inline

Copy a region of pixel data into a buffer.

Parameters
regionThe region to copy from.
[out]out_dataBuffer to copy into. Copied pixels are in row-major and without any padding.

◆ fill() [1/2]

template<typename T , std::size_t N>
void ph::TFrame< T, N >::fill ( T value)
inline

◆ fill() [2/2]

template<typename T , std::size_t N>
void ph::TFrame< T, N >::fill ( T value,
const math::TAABB2D< uint32 > & region )
inline

◆ flipHorizontally()

template<typename T , std::size_t N>
void ph::TFrame< T, N >::flipHorizontally ( )
inline

◆ flipVertically()

template<typename T , std::size_t N>
void ph::TFrame< T, N >::flipVertically ( )
inline

◆ forEachPixel() [1/4]

template<typename T , std::size_t N>
template<typename PerPixelOperation >
void ph::TFrame< T, N >::forEachPixel ( const math::TAABB2D< uint32 > & region,
PerPixelOperation op )
inline

Iterate over all pixels in the frame in row-major order.

Parameters
regionThe region to iterate for.
opThe operation to perform for each pixel.

◆ forEachPixel() [2/4]

template<typename T , std::size_t N>
template<typename PerPixelOperation >
void ph::TFrame< T, N >::forEachPixel ( const math::TAABB2D< uint32 > & region,
PerPixelOperation op ) const
inline

◆ forEachPixel() [3/4]

template<typename T , std::size_t N>
template<typename PerPixelOperation >
void ph::TFrame< T, N >::forEachPixel ( PerPixelOperation op)
inline

Iterate over all pixels in the frame in row-major order.

◆ forEachPixel() [4/4]

template<typename T , std::size_t N>
template<typename PerPixelOperation >
void ph::TFrame< T, N >::forEachPixel ( PerPixelOperation op) const
inline

◆ getPixel() [1/2]

template<typename T , std::size_t N>
auto ph::TFrame< T, N >::getPixel ( const math::TVector2< uint32 > & coordPx) const
inline

◆ getPixel() [2/2]

template<typename T , std::size_t N>
void ph::TFrame< T, N >::getPixel ( uint32 x,
uint32 y,
PixelType * out_pixel ) const
inline

◆ getPixelData() [1/2]

template<typename T , std::size_t N>
TSpan< T > ph::TFrame< T, N >::getPixelData ( )
inline

Get pixel data for the full frame.

Returns
Data for all pixels in row-major order. Components of a pixel are placed continuously.

◆ getPixelData() [2/2]

template<typename T , std::size_t N>
TSpanView< T > ph::TFrame< T, N >::getPixelData ( ) const
inline

◆ getSizePx()

template<typename T , std::size_t N>
math::TVector2< uint32 > ph::TFrame< T, N >::getSizePx ( ) const
inline

◆ heightPx()

template<typename T , std::size_t N>
uint32 ph::TFrame< T, N >::heightPx ( ) const
inline

◆ isEmpty()

template<typename T , std::size_t N>
bool ph::TFrame< T, N >::isEmpty ( ) const
inline

◆ makeMonochromaticPixel() [1/2]

template<typename T , std::size_t N>
template<typename U >
TFrame< T, N >::template TPixelType< U > ph::TFrame< T, N >::makeMonochromaticPixel ( const U value)
inline

◆ makeMonochromaticPixel() [2/2]

template<typename T , std::size_t N>
template<typename U = T>
static TPixelType< U > ph::TFrame< T, N >::makeMonochromaticPixel ( U value)
static

◆ numPixelComponents()

template<typename T , std::size_t N>
std::size_t ph::TFrame< T, N >::numPixelComponents ( ) const
inlineconstexprnoexcept

◆ operator=() [1/2]

template<typename T , std::size_t N>
TFrame< T, N > & ph::TFrame< T, N >::operator= ( const TFrame< T, N > & rhs)
inline

◆ operator=() [2/2]

template<typename T , std::size_t N>
TFrame< T, N > & ph::TFrame< T, N >::operator= ( TFrame< T, N > && rhs)
inlinenoexcept

◆ sample()

template<typename T , std::size_t N>
void ph::TFrame< T, N >::sample ( TFrame< T, N > & sampled,
const math::TMathFunction2D< float64 > & kernel,
uint32 kernelRadiusPx ) const
inline

◆ setPixel() [1/2]

template<typename T , std::size_t N>
void ph::TFrame< T, N >::setPixel ( const math::TVector2< uint32 > & coordPx,
const PixelType & pixel )
inline

◆ setPixel() [2/2]

template<typename T , std::size_t N>
void ph::TFrame< T, N >::setPixel ( uint32 x,
uint32 y,
const PixelType & pixel )
inline

◆ setSize() [1/2]

template<typename T , std::size_t N>
void ph::TFrame< T, N >::setSize ( const math::TVector2< uint32 > & sizePx)
inline

◆ setSize() [2/2]

template<typename T , std::size_t N>
void ph::TFrame< T, N >::setSize ( uint32 wPx,
uint32 hPx )
inline

◆ widthPx()

template<typename T , std::size_t N>
uint32 ph::TFrame< T, N >::widthPx ( ) const
inline

The documentation for this class was generated from the following files: