Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::Photon Struct Reference

Memory-efficient photon representation for use with PointKDTree. More...

#include <mitsuba/render/photon.h>

+ Inheritance diagram for mitsuba::Photon:

Public Member Functions

 Photon ()
 Dummy constructor. More...
 
 Photon (const Point &pos, const Normal &normal, const Vector &dir, const Spectrum &power, uint16_t depth)
 Construct from a photon interaction. More...
 
 Photon (Stream *stream)
 Unserialize from a binary data stream. More...
 
int getDepth () const
 Return the depth (in # of interactions) More...
 
Vector getDirection () const
 
Normal getNormal () const
 
Spectrum getPower () const
 Convert the photon power from RGBE to floating point. More...
 
void serialize (Stream *stream) const
 Serialize to a binary data stream. More...
 
std::string toString () const
 Return a string representation (for debugging) More...
 
- Public Member Functions inherited from mitsuba::SimpleKDNode< Point, PhotonData >
 SimpleKDNode ()
 Initialize a KD-tree node. More...
 
 SimpleKDNode (const DataRecord &data)
 Initialize a KD-tree node with the given data record. More...
 
IndexType getRightIndex (IndexType self) const
 Given the current node's index, return the index of the right child. More...
 
void setRightIndex (IndexType self, IndexType value)
 Given the current node's index, set the right child index. More...
 
IndexType getLeftIndex (IndexType self) const
 Given the current node's index, return the index of the left child. More...
 
void setLeftIndex (IndexType self, IndexType value)
 Given the current node's index, set the left child index. More...
 
bool isLeaf () const
 Check whether this is a leaf node. More...
 
void setLeaf (bool value)
 Specify whether this is a leaf node. More...
 
uint16_t getAxis () const
 Return the split axis associated with this node. More...
 
void setAxis (uint8_t axis)
 Set the split flags associated with this node. More...
 
const PointTypegetPosition () const
 Return the position associated with this node. More...
 
void setPosition (const PointType &value)
 Set the position associated with this node. More...
 
DataRecordgetData ()
 Return the data record associated with this node. More...
 
const DataRecordgetData () const
 Return the data record associated with this node (const version) More...
 
void setData (const DataRecord &val)
 Set the data record associated with this node. More...
 

Static Protected Member Functions

static bool createPrecompTables ()
 Initialize the precomputed lookup tables. More...
 

Static Protected Attributes

Precomputed lookup tables
static Float m_cosTheta [256]
 
static Float m_sinTheta [256]
 
static Float m_cosPhi [256]
 
static Float m_sinPhi [256]
 
static Float m_expTable [256]
 
static bool m_precompTableReady
 

Friends

class PhotonMap
 

Additional Inherited Members

- Public Types inherited from mitsuba::SimpleKDNode< Point, PhotonData >
enum  
 
typedef Point PointType
 
typedef PhotonData DataRecord
 
typedef uint32_t IndexType
 
typedef PointType::Scalar Scalar
 
- Public Attributes inherited from mitsuba::SimpleKDNode< Point, PhotonData >
PointType position
 
IndexType right
 
DataRecord data
 
uint8_t flags
 
- Static Public Attributes inherited from mitsuba::SimpleKDNode< Point, PhotonData >
static const bool leftBalancedLayout
 

Detailed Description

Memory-efficient photon representation for use with PointKDTree.

See Also
PhotonMap

Constructor & Destructor Documentation

mitsuba::Photon::Photon ( )
inline

Dummy constructor.

mitsuba::Photon::Photon ( const Point pos,
const Normal normal,
const Vector dir,
const Spectrum power,
uint16_t  depth 
)

Construct from a photon interaction.

mitsuba::Photon::Photon ( Stream stream)

Unserialize from a binary data stream.

Member Function Documentation

static bool mitsuba::Photon::createPrecompTables ( )
staticprotected

Initialize the precomputed lookup tables.

int mitsuba::Photon::getDepth ( ) const
inline

Return the depth (in # of interactions)

Vector mitsuba::Photon::getDirection ( ) const
inline

Convert the photon direction from quantized spherical coordinates to a floating point vector value. Precomputation idea based on Jensen's implementation.

Normal mitsuba::Photon::getNormal ( ) const
inline

Convert the normal direction from quantized spherical coordinates to a floating point vector value.

Spectrum mitsuba::Photon::getPower ( ) const
inline

Convert the photon power from RGBE to floating point.

void mitsuba::Photon::serialize ( Stream stream) const

Serialize to a binary data stream.

std::string mitsuba::Photon::toString ( ) const

Return a string representation (for debugging)

Friends And Related Function Documentation

friend class PhotonMap
friend

Member Data Documentation

Float mitsuba::Photon::m_cosPhi[256]
staticprotected
Float mitsuba::Photon::m_cosTheta[256]
staticprotected
Float mitsuba::Photon::m_expTable[256]
staticprotected
bool mitsuba::Photon::m_precompTableReady
staticprotected
Float mitsuba::Photon::m_sinPhi[256]
staticprotected
Float mitsuba::Photon::m_sinTheta[256]
staticprotected

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