Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TSwizzledTexture< InputT, OutputT, OUTPUT_N > Class Template Reference

Swizzle an array-like input type to the other array-like output type. Output type OutputT can have any number of elements (no need to be the same as input type InputT). For any elements in OutputT that is not part of the swizzle, the value will be as if the element is zero-initialized (or default-initialized depending on the actual type). More...

#include <TSwizzledTexture.h>

Inheritance diagram for ph::TSwizzledTexture< InputT, OutputT, OUTPUT_N >:
ph::TTexture< OutputT >

Public Types

using InputTexRes = std::shared_ptr<TTexture<InputT>>
 
using InputElement = std::remove_cvref_t<decltype(std::declval<InputT>()[std::declval<std::size_t>()])>
 
using OutputElement = std::remove_cvref_t<decltype(std::declval<OutputT>()[std::declval<std::size_t>()])>
 
- Public Types inherited from ph::TTexture< OutputT >
using Output
 

Public Member Functions

 TSwizzledTexture (InputTexRes inputTexture, std::array< uint8, OUTPUT_N > swizzleMap)
 
void sample (const SampleLocation &sampleLocation, OutputT *const out_value) const override
 
- Public Member Functions inherited from ph::TTexture< OutputT >
 TTexture ()=default
 
virtual ~TTexture ()=default
 

Detailed Description

template<typename InputT, typename OutputT, std::size_t OUTPUT_N>
class ph::TSwizzledTexture< InputT, OutputT, OUTPUT_N >

Swizzle an array-like input type to the other array-like output type. Output type OutputT can have any number of elements (no need to be the same as input type InputT). For any elements in OutputT that is not part of the swizzle, the value will be as if the element is zero-initialized (or default-initialized depending on the actual type).

Template Parameters
OUTPUT_NSize of the array-like object. Must not exceed number of elements in OutputT.

Member Typedef Documentation

◆ InputElement

template<typename InputT , typename OutputT , std::size_t OUTPUT_N>
using ph::TSwizzledTexture< InputT, OutputT, OUTPUT_N >::InputElement = std::remove_cvref_t<decltype(std::declval<InputT>()[std::declval<std::size_t>()])>

◆ InputTexRes

template<typename InputT , typename OutputT , std::size_t OUTPUT_N>
using ph::TSwizzledTexture< InputT, OutputT, OUTPUT_N >::InputTexRes = std::shared_ptr<TTexture<InputT>>

◆ OutputElement

template<typename InputT , typename OutputT , std::size_t OUTPUT_N>
using ph::TSwizzledTexture< InputT, OutputT, OUTPUT_N >::OutputElement = std::remove_cvref_t<decltype(std::declval<OutputT>()[std::declval<std::size_t>()])>

Constructor & Destructor Documentation

◆ TSwizzledTexture()

template<typename InputT , typename OutputT , std::size_t OUTPUT_N>
ph::TSwizzledTexture< InputT, OutputT, OUTPUT_N >::TSwizzledTexture ( InputTexRes inputTexture,
std::array< uint8, OUTPUT_N > swizzleMap )
inline
Parameters
swizzleMapHow each output slot maps to the input slot. Stores indices to the input slots. Indices must not exceed the size of InputT.

Member Function Documentation

◆ sample()

template<typename InputT , typename OutputT , std::size_t OUTPUT_N>
void ph::TSwizzledTexture< InputT, OutputT, OUTPUT_N >::sample ( const SampleLocation & sampleLocation,
OutputT *const out_value ) const
inlineoverridevirtual

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