pbrt.h File Reference

#include <malloc.h>
#include <alloca.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <assert.h>

Go to the source code of this file.

Classes

struct  ProgressReporter
class  StatsCounter
class  StatsRatio
class  StatsPercentage
class  ReferenceCounted
class  Reference< T >
class  ObjectArena< T >
class  MemoryArena
class  BlockedArray< T, logBlockSize >
struct  Matrix4x4

Defines

#define _GNU_SOURCE   1
#define COREDLL
#define DLLEXPORT
#define PBRT_PATH_SEP   ":"
#define BC_GRID_SIZE   40
#define GRID(v)   (int((v) * BC_GRID_SIZE))
#define M_PI   3.14159265358979323846f
#define INV_PI   0.31830988618379067154f
#define INV_TWOPI   0.15915494309189533577f
#define INFINITY   FLT_MAX
#define PBRT_VERSION   1.03
#define RAY_EPSILON   1e-3f
#define COLOR_SAMPLES   3
#define PRINTF_FUNC
#define Assert(expr)
#define _doublemagicroundeps   (.5-1.4e-11)
#define _doublemagicroundeps   (.5-1.4e-11)
#define _GNU_SOURCE   1
#define COREDLL
#define DLLEXPORT
#define PBRT_PATH_SEP   ":"
#define BC_GRID_SIZE   40
#define GRID(v)   (int((v) * BC_GRID_SIZE))
#define M_PI   3.14159265358979323846f
#define INV_PI   0.31830988618379067154f
#define INV_TWOPI   0.15915494309189533577f
#define INFINITY   FLT_MAX
#define PBRT_VERSION   1.03
#define RAY_EPSILON   1e-3f
#define COLOR_SAMPLES   3
#define PRINTF_FUNC
#define Assert(expr)
#define _doublemagicroundeps   (.5-1.4e-11)
#define _doublemagicroundeps   (.5-1.4e-11)
#define _GNU_SOURCE   1
#define COREDLL
#define DLLEXPORT
#define PBRT_PATH_SEP   ":"
#define BC_GRID_SIZE   40
#define GRID(v)   (int((v) * BC_GRID_SIZE))
#define M_PI   3.14159265358979323846f
#define INV_PI   0.31830988618379067154f
#define INV_TWOPI   0.15915494309189533577f
#define INFINITY   FLT_MAX
#define PBRT_VERSION   1.03
#define RAY_EPSILON   1e-3f
#define COLOR_SAMPLES   3
#define PRINTF_FUNC
#define Assert(expr)
#define _doublemagicroundeps   (.5-1.4e-11)
#define _doublemagicroundeps   (.5-1.4e-11)

Typedefs

typedef double StatsCounterType
typedef unsigned char u_char
typedef unsigned short u_short
typedef unsigned int u_int
typedef unsigned long u_long
typedef vector< int > SampleGrid [BC_GRID_SIZE][BC_GRID_SIZE]

Functions

COREDLL float Noise (float x, float y=.5f, float z=.5f)
COREDLL float Noise (const Point &P)
COREDLL float FBm (const Point &P, const Vector &dpdx, const Vector &dpdy, float omega, int octaves)
COREDLL float Turbulence (const Point &P, const Vector &dpdx, const Vector &dpdy, float omega, int octaves)
COREDLL void Info (const char *,...) PRINTF_FUNC
COREDLL void Warning (const char *,...) PRINTF_FUNC
COREDLL void Error (const char *,...) PRINTF_FUNC
COREDLL void Severe (const char *,...) PRINTF_FUNC
void StatsPrint (FILE *dest)
void StatsCleanup ()
COREDLL void * AllocAligned (size_t size)
COREDLL void FreeAligned (void *)
COREDLL bool SolveLinearSystem2x2 (const float A[2][2], const float B[2], float x[2])
COREDLL unsigned long genrand_int32 (void)
COREDLL float genrand_real1 (void)
COREDLL float genrand_real2 (void)
COREDLL SpectrumReadImage (const string &name, int *xSize, int *ySize)
COREDLL void WriteRGBAImage (const string &name, float *pixels, float *alpha, int XRes, int YRes, int totalXRes, int totalYRes, int xOffset, int yOffset)
COREDLL void pbrtInit ()
COREDLL void pbrtCleanup ()
COREDLL Transform Translate (const Vector &delta)
COREDLL Transform Scale (float x, float y, float z)
COREDLL Transform RotateX (float angle)
COREDLL Transform RotateY (float angle)
COREDLL Transform RotateZ (float angle)
COREDLL Transform Rotate (float angle, const Vector &axis)
COREDLL Transform LookAt (const Point &pos, const Point &look, const Vector &up)
COREDLL Transform Orthographic (float znear, float zfar)
COREDLL Transform Perspective (float fov, float znear, float zfar)
COREDLL Spectrum FrDiel (float cosi, float cost, const Spectrum &etai, const Spectrum &etat)
COREDLL Spectrum FrCond (float cosi, const Spectrum &n, const Spectrum &k)
COREDLL Spectrum FresnelApproxEta (const Spectrum &intensity)
COREDLL Spectrum FresnelApproxK (const Spectrum &intensity)
COREDLL float Lanczos (float, float tau=2)
COREDLL Spectrum EstimateDirect (const Scene *scene, const Light *light, const Point &p, const Normal &n, const Vector &wo, BSDF *bsdf, const Sample *sample, int lightSamp, int bsdfSamp, int bsdfComponent, u_int sampleNum)
COREDLL void ComputeStep1dCDF (float *f, int nValues, float *c, float *cdf)
COREDLL float SampleStep1d (float *f, float *cdf, float c, int nSteps, float u, float *weight)
COREDLL void ConcentricSampleDisk (float u1, float u2, float *dx, float *dy)
COREDLL void UniformSampleTriangle (float ud1, float ud2, float *u, float *v)
COREDLL bool ParseFile (const char *filename)
float Lerp (float t, float v1, float v2)
float Clamp (float val, float low, float high)
int Clamp (int val, int low, int high)
int Mod (int a, int b)
float Radians (float deg)
float Degrees (float rad)
float Log2 (float x)
int Log2Int (float v)
bool IsPowerOf2 (int v)
u_int RoundUpPow2 (u_int v)
int Round2Int (double val)
int Float2Int (double val)
int Floor2Int (double val)
int Ceil2Int (double val)
float RandomFloat ()
unsigned long RandomUInt ()
bool Quadratic (float A, float B, float C, float *t0, float *t1)
float SmoothStep (float min, float max, float value)
float ExponentialAverage (float avg, float val, float alpha)


Define Documentation

#define _doublemagicroundeps   (.5-1.4e-11)

#define _doublemagicroundeps   (.5-1.4e-11)

#define _doublemagicroundeps   (.5-1.4e-11)

#define _doublemagicroundeps   (.5-1.4e-11)

#define _doublemagicroundeps   (.5-1.4e-11)

Definition at line 600 of file pbrtlex.l.

#define _doublemagicroundeps   (.5-1.4e-11)

Definition at line 600 of file pbrtlex.l.

Referenced by Ceil2Int(), Float2Int(), Floor2Int(), Log2Int(), and Round2Int().

#define _GNU_SOURCE   1

#define _GNU_SOURCE   1

#define _GNU_SOURCE   1

Definition at line 43 of file pbrtlex.l.

#define Assert ( expr   ) 

Value:

((expr) ? (void)0 : \
                Severe("Assertion \"%s\" failed in %s, line %d", \
               #expr, __FILE__, __LINE__))

#define Assert ( expr   ) 

Value:

((expr) ? (void)0 : \
                Severe("Assertion \"%s\" failed in %s, line %d", \
               #expr, __FILE__, __LINE__))

#define Assert ( expr   ) 

#define BC_GRID_SIZE   40

#define BC_GRID_SIZE   40

#define BC_GRID_SIZE   40

Definition at line 152 of file pbrtlex.l.

Referenced by BestCandidate2D(), main(), and Redistribute2D().

#define COLOR_SAMPLES   3

#define COLOR_SAMPLES   3

#define COLOR_SAMPLES   3

#define COREDLL

#define COREDLL

#define COREDLL

Definition at line 109 of file pbrtlex.l.

#define DLLEXPORT

#define DLLEXPORT

#define DLLEXPORT

Definition at line 110 of file pbrtlex.l.

#define GRID (  )     (int((v) * BC_GRID_SIZE))

#define GRID (  )     (int((v) * BC_GRID_SIZE))

#define GRID (  )     (int((v) * BC_GRID_SIZE))

Definition at line 154 of file pbrtlex.l.

Referenced by addSampleToGrid(), BestCandidate2D(), main(), and Redistribute2D().

#define INFINITY   FLT_MAX

#define INFINITY   FLT_MAX

#define INFINITY   FLT_MAX

#define INV_PI   0.31830988618379067154f

#define INV_PI   0.31830988618379067154f

#define INV_PI   0.31830988618379067154f

#define INV_TWOPI   0.15915494309189533577f

#define INV_TWOPI   0.15915494309189533577f

#define INV_TWOPI   0.15915494309189533577f

#define M_PI   3.14159265358979323846f

#define M_PI   3.14159265358979323846f

#define M_PI   3.14159265358979323846f

#define PBRT_PATH_SEP   ":"

#define PBRT_PATH_SEP   ":"

#define PBRT_PATH_SEP   ":"

Definition at line 115 of file pbrtlex.l.

Referenced by RenderOptions::RenderOptions(), and SearchPath().

#define PBRT_VERSION   1.03

#define PBRT_VERSION   1.03

#define PBRT_VERSION   1.03

Definition at line 208 of file pbrtlex.l.

Referenced by main().

#define PRINTF_FUNC

#define PRINTF_FUNC

#define PRINTF_FUNC

Definition at line 217 of file pbrtlex.l.

#define RAY_EPSILON   1e-3f

#define RAY_EPSILON   1e-3f

#define RAY_EPSILON   1e-3f


Typedef Documentation

typedef vector< int > SampleGrid

Definition at line 152 of file pbrt.h.

typedef double StatsCounterType

Definition at line 121 of file pbrt.h.

typedef unsigned char u_char

Definition at line 122 of file pbrt.h.

typedef unsigned int u_int

Definition at line 124 of file pbrt.h.

typedef unsigned long u_long

Definition at line 125 of file pbrt.h.

typedef unsigned short u_short

Definition at line 123 of file pbrt.h.


Function Documentation

COREDLL void * AllocAligned ( size_t  size  ) 

int Ceil2Int ( double  val  )  [inline]

int Clamp ( int  val,
int  low,
int  high 
) [inline]

Definition at line 554 of file pbrt.h.

float Clamp ( float  val,
float  low,
float  high 
) [inline]

COREDLL void ComputeStep1dCDF ( float *  f,
int  nValues,
float *  c,
float *  cdf 
)

COREDLL void ConcentricSampleDisk ( float  u1,
float  u2,
float *  dx,
float *  dy 
)

float Degrees ( float  rad  )  [inline]

Definition at line 569 of file pbrt.h.

References M_PI.

COREDLL void Error ( const char *  ,
  ... 
)

COREDLL Spectrum EstimateDirect ( const Scene scene,
const Light light,
const Point p,
const Normal n,
const Vector wo,
BSDF bsdf,
const Sample sample,
int  lightSamp,
int  bsdfSamp,
int  bsdfComponent,
u_int  sampleNum 
)

float ExponentialAverage ( float  avg,
float  val,
float  alpha 
) [inline]

Definition at line 661 of file pbrt.h.

Referenced by WeightedSampleOneLight().

COREDLL float FBm ( const Point P,
const Vector dpdx,
const Vector dpdy,
float  omega,
int  octaves 
)

int Float2Int ( double  val  )  [inline]

int Floor2Int ( double  val  )  [inline]

COREDLL Spectrum FrCond ( float  cosi,
const Spectrum n,
const Spectrum k 
)

Definition at line 40 of file reflection.cpp.

Referenced by FresnelConductor::Evaluate().

COREDLL Spectrum FrDiel ( float  cosi,
float  cost,
const Spectrum etai,
const Spectrum etat 
)

Definition at line 31 of file reflection.cpp.

Referenced by FresnelDielectric::Evaluate().

COREDLL void FreeAligned ( void *   ) 

COREDLL Spectrum FresnelApproxEta ( const Spectrum intensity  ) 

Definition at line 52 of file reflection.cpp.

References Spectrum::Clamp(), and Spectrum::Sqrt().

Referenced by ShinyMetal::GetBSDF().

COREDLL Spectrum FresnelApproxK ( const Spectrum intensity  ) 

Definition at line 57 of file reflection.cpp.

References Spectrum::Clamp(), and Spectrum::Sqrt().

COREDLL unsigned long genrand_int32 ( void   ) 

Definition at line 340 of file util.cpp.

References init_genrand(), LOWER_MASK, M, MATRIX_A, mt, mti, N, and UPPER_MASK.

Referenced by genrand_real1(), genrand_real2(), and RandomUInt().

COREDLL float genrand_real1 ( void   ) 

Definition at line 377 of file util.cpp.

References genrand_int32().

COREDLL float genrand_real2 ( void   ) 

Definition at line 383 of file util.cpp.

References genrand_int32().

Referenced by RandomFloat().

COREDLL void Info ( const char *  ,
  ... 
)

Definition at line 74 of file util.cpp.

References PBRT_ERROR_CONTINUE, and processError().

bool IsPowerOf2 ( int  v  )  [inline]

Definition at line 584 of file pbrt.h.

Referenced by Voxel::AddPrimitive(), LDSampler::LDSampler(), and MIPMap< T >::MIPMap().

COREDLL float Lanczos ( float  ,
float  tau = 2 
)

Definition at line 241 of file texture.cpp.

References M_PI.

Referenced by MIPMap< Spectrum >::resampleWeights().

float Lerp ( float  t,
float  v1,
float  v2 
) [inline]

float Log2 ( float  x  )  [inline]

Definition at line 572 of file pbrt.h.

Referenced by FBm(), Log2Int(), MIPMap< T >::Lookup(), and Turbulence().

int Log2Int ( float  v  )  [inline]

Definition at line 576 of file pbrt.h.

References _doublemagicroundeps, and Log2().

Referenced by KdTreeAccel::KdTreeAccel(), and MIPMap< T >::MIPMap().

COREDLL Transform LookAt ( const Point pos,
const Point look,
const Vector up 
)

Definition at line 113 of file transform.cpp.

References Cross(), Matrix4x4::Inverse(), Normalize(), Vector::x, Point::x, Vector::y, Point::y, Vector::z, and Point::z.

Referenced by pbrtLookAt().

int Mod ( int  a,
int  b 
) [inline]

Definition at line 559 of file pbrt.h.

Referenced by MIPMap< T >::MIPMap(), and MIPMap< T >::texel().

COREDLL float Noise ( const Point P  ) 

Definition at line 186 of file texture.cpp.

References Noise(), Point::x, Point::y, and Point::z.

COREDLL float Noise ( float  x,
float  y = .5f,
float  z = .5f 
)

Definition at line 156 of file texture.cpp.

References Floor2Int(), Grad(), Lerp(), NOISE_PERM_SIZE, and NoiseWeight().

Referenced by DotsTexture< T >::Evaluate(), FBm(), Noise(), and Turbulence().

COREDLL Transform Orthographic ( float  znear,
float  zfar 
)

Definition at line 177 of file transform.cpp.

References Scale(), and Translate().

COREDLL bool ParseFile ( const char *  filename  ) 

Definition at line 27 of file parser.cpp.

References current_file, and line_num.

Referenced by main().

COREDLL void pbrtCleanup (  ) 

Definition at line 163 of file api.cpp.

References currentApiState, Error(), STATE_UNINITIALIZED, STATE_WORLD_BLOCK, and StatsCleanup().

Referenced by main().

COREDLL void pbrtInit (  ) 

Definition at line 141 of file api.cpp.

References currentApiState, Error(), GraphicsState::GraphicsState(), STATE_OPTIONS_BLOCK, and STATE_UNINITIALIZED.

Referenced by main().

COREDLL Transform Perspective ( float  fov,
float  znear,
float  zfar 
)

Definition at line 182 of file transform.cpp.

References Radians(), Scale(), and Transform::Transform().

Referenced by ProjectionLight::ProjectionLight().

bool Quadratic ( float  A,
float  B,
float  C,
float *  t0,
float *  t1 
) [inline]

float Radians ( float  deg  )  [inline]

float RandomFloat (  )  [inline]

unsigned long RandomUInt (  )  [inline]

COREDLL Spectrum* ReadImage ( const string &  name,
int *  xSize,
int *  ySize 
)

COREDLL Transform Rotate ( float  angle,
const Vector axis 
)

Definition at line 84 of file transform.cpp.

References Normalize(), Radians(), Matrix4x4::Transpose(), Vector::x, Vector::y, and Vector::z.

Referenced by pbrtRotate().

COREDLL Transform RotateX ( float  angle  ) 

Definition at line 56 of file transform.cpp.

References Radians(), and Matrix4x4::Transpose().

COREDLL Transform RotateY ( float  angle  ) 

Definition at line 65 of file transform.cpp.

References Radians(), and Matrix4x4::Transpose().

COREDLL Transform RotateZ ( float  angle  ) 

Definition at line 75 of file transform.cpp.

References Radians(), and Matrix4x4::Transpose().

int Round2Int ( double  val  )  [inline]

u_int RoundUpPow2 ( u_int  v  )  [inline]

COREDLL float SampleStep1d ( float *  f,
float *  cdf,
float  c,
int  nSteps,
float  u,
float *  weight 
)

COREDLL Transform Scale ( float  x,
float  y,
float  z 
)

COREDLL void Severe ( const char *  ,
  ... 
)

float SmoothStep ( float  min,
float  max,
float  value 
) [inline]

Definition at line 657 of file pbrt.h.

References Clamp().

Referenced by FBm(), IGIIntegrator::Li(), and Turbulence().

COREDLL bool SolveLinearSystem2x2 ( const float  A[2][2],
const float  B[2],
float  x[2] 
)

void StatsCleanup (  ) 

Definition at line 277 of file util.cpp.

References trackers.

Referenced by pbrtCleanup().

void StatsPrint ( FILE *  dest  ) 

COREDLL Transform Translate ( const Vector delta  ) 

COREDLL float Turbulence ( const Point P,
const Vector dpdx,
const Vector dpdy,
float  omega,
int  octaves 
)

Definition at line 221 of file texture.cpp.

References Floor2Int(), Vector::LengthSquared(), Log2(), Noise(), and SmoothStep().

Referenced by WrinkledTexture< T >::Evaluate().

COREDLL void UniformSampleTriangle ( float  ud1,
float  ud2,
float *  u,
float *  v 
)

Definition at line 135 of file mc.cpp.

Referenced by Triangle::Sample().

COREDLL void Warning ( const char *  ,
  ... 
)

COREDLL void WriteRGBAImage ( const string &  name,
float *  pixels,
float *  alpha,
int  XRes,
int  YRes,
int  totalXRes,
int  totalYRes,
int  xOffset,
int  yOffset 
)

Definition at line 74 of file exrio.cpp.

References Error().

Referenced by ImageFilm::WriteImage().


Generated on Mon Jul 20 17:31:54 2009 for pbrt by  doxygen 1.5.6