ALTA  alpha
params Class Reference

## Detailed Description

Any function object or data object should have an associated parametrization.

We use the following convention to defined the tangent, normal and bi-normal of the surface:

• The normal is the upper vector (0, 0, 1)
• The tangent direction is along x direction (1, 0, 0)
• The bi-normal is along the y direction (0, 1, 0)

#include <params.h>

## Public Types

enum  input {
RUSIN_TH_PH_TD_PD, RUSIN_TH_PH_TD, RUSIN_TH_TD_PD, RUSIN_TH_TD,
RUSIN_VH_VD, RUSIN_VH, COS_TH_TD, COS_TH,
SCHLICK_TK_PK, SCHLICK_VK, SCHLICK_TL_TK_PROJ_DPHI, COS_TK,
RETRO_TL_TVL_PROJ_DPHI, STEREOGRAPHIC, SPHERICAL_TL_PL_TV_PV, COS_TLV,
COS_TLR, ISOTROPIC_TV_TL, ISOTROPIC_TV_TL_DPHI, ISOTROPIC_TV_PROJ_DPHI,
ISOTROPIC_TL_TV_PROJ_DPHI, ISOTROPIC_TD_PD, STARK_2D, STARK_3D,
NEUMANN_2D, NEUMANN_3D, CARTESIAN, UNKNOWN_INPUT
}
list of all supported parametrization for the input space. An unsupported parametrization will go under the name ! unknown. We use the following notations: More...

enum  output {
XYZ_COLOR, UNKNOWN_OUTPUT
}
list of all supported parametrization for the output space. An unsupported parametrization will go under the name unknown. More...

## Static Public Member Functions

static params::input parse_input (const std::string &txt)
parse a string to provide a parametrization type.

static params::output parse_output (const std::string &txt)
parse a string to provide a parametrization type.

static const std::string & get_name (const params::input param)
look for the string associated with a parametrization type.

static const std::string & get_name (const params::output)
look for the string associated with a parametrization type. More...

static double * convert (const double *invec, params::input intype, params::input outtype)
static function for input type convertion. This function allocate the resulting vector.

static void convert (const double *invec, params::output intype, int indim, params::output outtype, int outdim, double *outvec)
static function for input type convertion. The outvec resulting vector should be allocated with the correct output size. TODO: RP this function is weird the outtype and intype ARE NEVER USED

static void convert (const double *invec, params::input intype, params::input outtype, double *outvec)
static function for input type convertion. The outvec resulting vector should be allocated with the correct output size.

static void to_cartesian (const double *invec, params::input intype, double *outvec)
convert a input vector in a given parametrization to an output vector in a cartesian parametrization, that is two 3d vectors concatenated.

static void from_cartesian (const double *invec, params::input outtype, double *outvec)
convert a input CARTESIAN vector, that is two 3d vectors concatenated to an output vector in a given parametrization.

static int dimension (params::input t)
provide a dimension associated with a parametrization

static int dimension (params::output t)
provide a dimension associated with a parametrization

static bool is_cosine_weighted (params::output t)
Is the value stored weighted by a cosine factor.

template<typename Real >
static void half_to_cartesian (Real theta_h, Real phi_h, Real theta_d, Real phi_d, Real *out)
from the 4D definition of a half vector parametrization, export the cartesian coordinates.

static void classical_to_cartesian (double theta_l, double phi_l, double theta_v, double phi_v, double *out)
from the 4D definition of a classical vector parametrization, export the cartesian coordinates.

template<class Vector , typename Real >
static void rotate_normal (Vector &vec, Real theta)
rotate a cartesian vector with respect to the normal of theta degrees.

template<class Vector , typename Real >
static void rotate_binormal (Vector &vec, Real theta)
rotate a cartesian vector with respect to the bi-normal of theta degrees.

template<class Vector , typename Real >
static void rotate (Vector &vec, Real theta, Real phi)
Rotate VEC by THETA around the normal, and by PHI around the binormal.

static void print_input_params ()

## Member Enumeration Documentation

 enum params::input
• The View vector is $$V$$
• The Light vector is $$L$$
• The Normal vector is $$N$$
• The Reflected vector is $$R = 2\mbox{dot}({V}, {N}){N} - {V}$$
• The Half vector is $$H = \frac{V+L}{||V+L||}$$
• The Back vector is $$K = \frac{V-L}{||V-L||}$$
• The elevation angle of vector $$V$$ is $$\theta_V$$
• The azimuth angle of vector $$V$$ is $$\phi_V$$
Enumerator
RUSIN_TH_PH_TD_PD

Half-angle parametrization as described by Rusinkiewicz [1998] described in spherical coordinates. Coordinates are: $$\left[ \theta_H, \phi_H, \theta_D, \phi_D \right]$$.

RUSIN_TH_TD_PD

Isotropic Half-angle parametrization. This parametrization is defined by the tuple $$\vec{x} = [\theta_H, \theta_D, \phi_D]$$

RUSIN_TH_TD

Half-angle parametrization with no azimutal information

RUSIN_VH_VD

Half-angle parametrization in vector format. Coordinates are: $$[H_x, H_y, H_z, D_x, D_y, D_z]$$.

RUSIN_VH

Half-angle parametrization with no difference direction in vector format. Coordinates are: [ $$\vec{h}_x, \vec{h}_y, \vec{h}_z$$].

COS_TH_TD

Cosine of the RUSIN_TH_TD parametrization: Coordinates are in $$[\cos_{\theta_H},\cos_{\theta_D}]$$.

SCHLICK_TK_PK

Schlick's back vector parametrization

SCHLICK_VK

Schlick's back vector

SCHLICK_TL_TK_PROJ_DPHI

3D Parametrization where the phi component is projected and the parametrization is centered around the back direction. $$[\theta_L, x, y] = [\theta_L, \theta_K \cos(\phi_K), \theta_K \sin(\phi_K)]$$

COS_TK

Schlick's back vector dot product with the normal

RETRO_TL_TVL_PROJ_DPHI

2D Parametrization where the phi component is projected and the parametrization is centered around the retro direction $$[x, y] = [\theta_{VL} \cos(\Delta\phi), \theta_{VL} \sin(\Delta\phi)]$$.

STEREOGRAPHIC

Stereographic projection of the Light and View vectors

SPHERICAL_TL_PL_TV_PV

Light and View vectors represented in spherical coordinates

COS_TLV

Dot product between the Light and View vector

COS_TLR

Dot product between the Light and Reflected vector

ISOTROPIC_TV_TL

Light and View vectors represented in spherical coordinates,

ISOTROPIC_TV_TL_DPHI

Light and View vectors represented in spherical coordinates, with the difference of azimutal coordinates in the last component

ISOTROPIC_TV_PROJ_DPHI

2D Parametrization where the phi component is projected. Coordinates are: $$\left[\theta_v \cos(\Delta\phi), \theta_v \sin(\Delta\phi)\right]$$.

ISOTROPIC_TL_TV_PROJ_DPHI

3D Parametrization where the phi component is projected. Coordinates are: $$\left[\theta_l, \theta_v \cos(\Delta\phi), \theta_v \sin(\Delta\phi)\right]$$.

ISOTROPIC_TD_PD

Difference between two directions such as R and H

STARK_2D

Modified Stark et al. [2005] 2D parametrization by Barla et al. [2015]. This parametrization is defined by the couple $$\vec{x} = ||\tilde{H}_p||, ||\tilde{B}||$$, where $$\tilde{H} = \frac{1}{2}(L+V)$$ and $$\tilde{B} = \frac{1}{2}(L-V)$$. $$\tilde{H}_p$$ is the projected coordinates of $$\tilde{H}$$ on the tangent plane.

STARK_3D

Modified Stark et al. [2005] 2D parametrization by Barla et al. [2015]. This parametrization is defined by the tuple $$\vec{x} = \left[||\tilde{H}_p||, ||\tilde{B}||, \phi_B-\phi_H \right]$$.

NEUMANN_2D

Neumann and Neumann [1996] parametrization. This parametrization is defined by the couple $$\vec{x} = \left[ ||\tilde{H}_p||, ||\tilde{B}_p||\right]$$, where $$\tilde{H} = \frac{1}{2}(L+V)$$ and $$\tilde{B} = \frac{1}{2}(L-V)$$. $$\tilde{H}_p$$ is the projected coordinates of $$\tilde{H}$$ on the tangent plane.

NEUMANN_3D

Neumann and Neumann [1996] 3D parametrization. This parametrization is defined by the tuple $$\vec{x} = [||\tilde{H}_p||, ||\tilde{B}_p||, \phi_B-\phi_H]$$.

CARTESIAN

View and Light vectors represented in cartesian coordinates. We always pack the view vector first: $$[V.x, V.y, V.z, L.x, L.y, L.z]$$

UNKNOWN_INPUT

Default behaviour. Only use this is you do not fit BRDF data.

 enum params::output
Enumerator

Output values in inverse steradian (sr-1). This is the standard definition for a BRDF.