Fermat
Public Methods | Public Members | List of all members
CameraSampler Struct Reference

Detailed description

A sampler for the pinhole camera model

#include <camera.h>

Public Methods

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE CameraSampler ()
 
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE CameraSampler (const Camera &camera, const float aspect_ratio)
 
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector3f sample_direction (const cugar::Vector2f ndc) const
 
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float pdf (const cugar::Vector3f out, const bool projected=false) const
 
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float W_e (const cugar::Vector3f out) const
 
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector2f invert (const cugar::Vector3f out) const
 
FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector2f invert (const cugar::Vector3f out, float *pdf_proj) const
 

Public Members

cugar::Vector3f U
 
cugar::Vector3f V
 
cugar::Vector3f W
 
float W_len
 
float square_focal_length
 

Constructor & Destructor Documentation

◆ CameraSampler() [1/2]

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE CameraSampler::CameraSampler ( )
inline

empty constructor

◆ CameraSampler() [2/2]

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE CameraSampler::CameraSampler ( const Camera camera,
const float  aspect_ratio 
)
inline

constructor

Member Function Documentation

◆ invert() [1/2]

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector2f CameraSampler::invert ( const cugar::Vector3f  out) const
inline

invert the camera direction sampler

Parameters
outthe given direction
projectedwhether to return the pdf in projected solid angle or solid angle measure
Returns
the NDC coordinates corresponding to the given direction

◆ invert() [2/2]

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector2f CameraSampler::invert ( const cugar::Vector3f  out,
float *  pdf_proj 
) const
inline

invert the camera direction sampler and compute its projected pdf

Parameters
outthe given direction
projectedwhether to return the pdf in projected solid angle or solid angle measure
Returns
the NDC coordinates corresponding to the given direction

◆ pdf()

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float CameraSampler::pdf ( const cugar::Vector3f  out,
const bool  projected = false 
) const
inline

compute the direction pdf

◆ sample_direction()

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE cugar::Vector3f CameraSampler::sample_direction ( const cugar::Vector2f  ndc) const
inline

sample a direction from normalized device coordinates (NDC) in [0,1]^2

◆ W_e()

FERMAT_HOST_DEVICE FERMAT_FORCEINLINE float CameraSampler::W_e ( const cugar::Vector3f  out) const
inline

compute the importance


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