luxlex.l File Reference

#include <sstream>
#include "lux.h"
#include "api.h"
#include "error.h"
#include "luxparse.hpp"

Go to the source code of this file.

Classes

class  lux::random::RandomGenerator
struct  IncludeInfo

Namespaces

namespace  lux
namespace  lux::random
namespace  boost

Defines

#define YY_MAIN   0
#define YY_NEVER_INTERACTIVE   1

Functions

void * lux::AllocAligned (size_t size)
void lux::FreeAligned (void *)
void lux::random::init (int tn)
float lux::random::floatValue ()
unsigned long lux::random::uintValue ()
float lux::random::floatValueP ()
unsigned long lux::random::uintValueP ()
void luxInit ()
void luxCleanup ()
bool ParseFile (const char *filename)
unsigned int lux::DJBHash (const std::string &str)
bool lux::SolveLinearSystem2x2 (const float A[2][2], const float B[2], float x[2])
ImageDatalux::ReadImage (const string &name)
void lux::WriteRGBAImage (const string &name, float *pixels, float *alpha, int xRes, int yRes, int totalXRes, int totalYRes, int xOffset, int yOffset)
void lux::WriteRGBAImageFloat (const string &name, float *pixels, float *alpha, int xRes, int yRes, int totalXRes, int totalYRes, int xOffset, int yOffset)
void lux::WriteIgiImage (const string &name, float *pixels, float *alpha, int xRes, int yRes, int totalXRes, int totalYRes, int xOffset, int yOffset)
template<class T >
Lerp (float t, T v1, T v2)
template<class T >
Clamp (T val, T low, T 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)
template<class T >
int Float2Int (T val)
template<class T >
int Floor2Int (T val)
template<class T >
int Ceil2Int (T val)
bool Quadratic (float A, float B, float C, float *t0, float *t1)
float SmoothStep (float min, float max, float value)
void luxIdentity ()
void luxTranslate (float dx, float dy, float dz)
void luxRotate (float angle, float ax, float ay, float az)
void luxScale (float sx, float sy, float sz)
void luxLookAt (float ex, float ey, float ez, float lx, float ly, float lz, float ux, float uy, float uz)
void luxConcatTransform (float transform[16])
void luxTransform (float transform[16])
void luxCoordinateSystem (const char *)
void luxCoordSysTransform (const char *)
void luxPixelFilter (const char *name,...)
void luxPixelFilterV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxFilm (const char *name,...)
void luxFilmV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxSampler (const char *name,...)
void luxSamplerV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxAccelerator (const char *name,...)
void luxAcceleratorV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxSurfaceIntegrator (const char *name,...)
void luxSurfaceIntegratorV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxVolumeIntegrator (const char *name,...)
void luxVolumeIntegratorV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxCamera (const char *name,...)
void luxCameraV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxWorldBegin ()
void luxAttributeBegin ()
void luxAttributeEnd ()
void luxTransformBegin ()
void luxTransformEnd ()
void luxTexture (const char *name, const char *type, const char *texname,...)
void luxTextureV (const char *name, const char *type, const char *texname, int n, LuxToken tokens[], LuxPointer params[])
void luxMaterial (const char *name,...)
void luxMaterialV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxMakeNamedMaterial (const char *name,...)
void luxMakeNamedMaterialV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxNamedMaterial (const char *name,...)
void luxNamedMaterialV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxLightSource (const char *name,...)
void luxLightSourceV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxAreaLightSource (const char *name,...)
void luxAreaLightSourceV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxPortalShape (const char *name,...)
void luxPortalShapeV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxShape (const char *name,...)
void luxShapeV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxReverseOrientation ()
void luxVolume (const char *name,...)
void luxVolumeV (const char *name, int n, LuxToken tokens[], LuxPointer params[])
void luxObjectBegin (const char *name)
void luxObjectEnd ()
void luxObjectInstance (const char *name)
void luxWorldEnd ()
void luxStart ()
void luxPause ()
void luxExit ()
void luxWait ()
int luxAddThread ()
void luxRemoveThread ()
void luxUpdateFramebuffer ()
unsigned char * luxFramebuffer ()
void luxAddServer (const char *name)
void luxUpdateFilmFromNetwork ()
void luxSetNetworkServerUpdateInterval (int updateInterval)
int luxGetNetworkServerUpdateInterval ()
double luxStatistics (const char *statName)
void luxEnableDebugMode ()
void luxErrorHandler (LuxErrorHandler handler)
void luxErrorAbort (int code, int severity, const char *message)
void luxErrorIgnore (int code, int severity, const char *message)
void luxErrorPrint (int code, int severity, const char *message)
void boost::assertion_failed (char const *expr, char const *function, char const *file, long line)
void add_string_char (char c)
void yyerror (const char *str)
void include_push (char *filename)
void include_pop (void)
option nounput WHITESPACE[\t\0xa] NUMBER ([0-9]+|(([0-9]+\.[0-9]*)|(\.[0-9]+)))([eE][-+]?[0-9]+)?IDENT[a-zA-Z_][a-zA-Z_0-9]*%x STR COMMENT INCL INCL_FILE%%Include

Variables

boost::thread_specific_ptr
< RandomGenerator > 
lux::random::myGen
static const float lux::random::invUI = ((float)1.0/(float)4294967296.0)
static RandomGenerator * lux::random::PGen
vector< IncludeInfoincludeStack
int line_num
int str_pos
< INCL > WHITESPACE


Define Documentation

#define YY_MAIN   0

Definition at line 27 of file luxlex.l.

#define YY_NEVER_INTERACTIVE   1

Definition at line 28 of file luxlex.l.


Function Documentation

void add_string_char ( char  c  ) 

Definition at line 59 of file luxlex.l.

template<class T >
int Ceil2Int ( val  )  [inline]

template<class T >
T Clamp ( val,
low,
high 
) [inline]

float Degrees ( float  rad  )  [inline]

Definition at line 346 of file lux.h.

References M_PI.

template<class T >
int Float2Int ( val  )  [inline]

template<class T >
int Floor2Int ( val  )  [inline]

void include_pop ( void   ) 

Definition at line 92 of file luxlex.l.

References YY_CURRENT_BUFFER, yy_delete_buffer(), and yy_switch_to_buffer().

void include_push ( char *  filename  ) 

Definition at line 68 of file luxlex.l.

bool IsPowerOf2 ( int  v  )  [inline]

template<class T >
T Lerp ( float  t,
v1,
v2 
) [inline]

float Log2 ( float  x  )  [inline]

Definition at line 349 of file lux.h.

Referenced by lux::FBm(), Log2Int(), lux::MIPMapImpl< T, U >::Lookup(), and lux::Turbulence().

int Log2Int ( float  v  )  [inline]

void luxAccelerator ( const char *  name,
  ... 
)

Definition at line 177 of file api.cpp.

References EXTRACT_PARAMETERS, luxAcceleratorV(), and PASS_PARAMETERS.

Referenced by luxAcceleratorV(), and yyparse().

void luxAcceleratorV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 183 of file api.cpp.

References luxAccelerator().

Referenced by luxAccelerator().

void luxAddServer ( const char *  name  ) 

Definition at line 79 of file api.cpp.

References luxAddServer().

Referenced by luxAddServer(), main(), and lux::LuxGuiApp::ProcessCommandLine().

int luxAddThread (  ) 

void luxAreaLightSource ( const char *  name,
  ... 
)

Definition at line 330 of file api.cpp.

References EXTRACT_PARAMETERS, luxAreaLightSourceV(), and PASS_PARAMETERS.

Referenced by luxAreaLightSourceV(), and yyparse().

void luxAreaLightSourceV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 336 of file api.cpp.

References luxAreaLightSource().

Referenced by luxAreaLightSource().

void luxAttributeBegin (  ) 

Definition at line 241 of file api.cpp.

References luxAttributeBegin().

Referenced by luxAttributeBegin(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxAttributeEnd (  ) 

Definition at line 245 of file api.cpp.

References luxAttributeEnd().

Referenced by luxAttributeEnd(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxCamera ( const char *  name,
  ... 
)

Definition at line 226 of file api.cpp.

References EXTRACT_PARAMETERS, luxCameraV(), and PASS_PARAMETERS.

Referenced by luxCameraV(), and yyparse().

void luxCameraV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 232 of file api.cpp.

References luxCamera().

Referenced by luxCamera().

void luxCleanup (  ) 

Definition at line 84 of file api.cpp.

References luxCleanup().

Referenced by exit_cb(), luxCleanup(), main(), lux::LuxGui::OnExit(), and lux::NetworkRenderServerThread::run().

void luxConcatTransform ( float  transform[16]  ) 

Definition at line 101 of file api.cpp.

References luxConcatTransform().

Referenced by luxConcatTransform(), and yyparse().

void luxCoordinateSystem ( const char *   ) 

Definition at line 117 of file api.cpp.

References luxCoordinateSystem().

Referenced by luxCoordinateSystem(), and yyparse().

void luxCoordSysTransform ( const char *   ) 

Definition at line 121 of file api.cpp.

References luxCoordSysTransform().

Referenced by luxCoordSysTransform(), and yyparse().

void luxEnableDebugMode (  ) 

Definition at line 504 of file api.cpp.

References luxEnableDebugMode().

Referenced by luxEnableDebugMode(), main(), and lux::LuxGuiApp::ProcessCommandLine().

void luxErrorAbort ( int  code,
int  severity,
const char *  message 
)

Definition at line 531 of file api.cpp.

References LUX_INFO, and luxErrorPrint().

void luxErrorHandler ( LuxErrorHandler  handler  ) 

Definition at line 527 of file api.cpp.

References luxError.

Referenced by lux::LuxGui::LuxGui().

void luxErrorIgnore ( int  code,
int  severity,
const char *  message 
)

Definition at line 537 of file api.cpp.

References luxLastError.

void luxErrorPrint ( int  code,
int  severity,
const char *  message 
)

Definition at line 541 of file api.cpp.

References LUX_ERROR, LUX_INFO, LUX_SEVERE, LUX_WARNING, and luxLastError.

Referenced by luxErrorAbort().

void luxExit (  ) 

Definition at line 445 of file api.cpp.

References luxExit().

Referenced by exit_cb(), luxExit(), main(), lux::LuxGui::OnExit(), and lux::NetworkRenderServerThread::run().

void luxFilm ( const char *  name,
  ... 
)

Definition at line 143 of file api.cpp.

References EXTRACT_PARAMETERS, luxFilmV(), and PASS_PARAMETERS.

Referenced by luxFilmV(), and yyparse().

void luxFilmV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 149 of file api.cpp.

References luxFilm().

Referenced by luxFilm().

unsigned char* luxFramebuffer (  ) 

Definition at line 470 of file api.cpp.

References luxFramebuffer().

Referenced by bindFrameBuffer(), luxFramebuffer(), and lux::LuxOutputWin::OnDraw().

int luxGetNetworkServerUpdateInterval (  ) 

void luxIdentity (  ) 

Definition at line 89 of file api.cpp.

References luxIdentity().

Referenced by luxIdentity(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxInit (  ) 

Definition at line 403 of file api.cpp.

References initialized, LUX_ERROR, LUX_ILLSTATE, and luxError.

Referenced by main(), and lux::LuxGuiApp::OnInit().

void luxLightSource ( const char *  name,
  ... 
)

Definition at line 315 of file api.cpp.

References EXTRACT_PARAMETERS, luxLightSourceV(), and PASS_PARAMETERS.

Referenced by luxLightSourceV(), and yyparse().

void luxLightSourceV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 321 of file api.cpp.

References luxLightSource().

Referenced by luxLightSource().

void luxLookAt ( float  ex,
float  ey,
float  ez,
float  lx,
float  ly,
float  lz,
float  ux,
float  uy,
float  uz 
)

Definition at line 112 of file api.cpp.

References luxLookAt().

Referenced by luxLookAt(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxMakeNamedMaterial ( const char *  name,
  ... 
)

Definition at line 289 of file api.cpp.

References EXTRACT_PARAMETERS, luxMakeNamedMaterialV(), and PASS_PARAMETERS.

Referenced by luxMakeNamedMaterialV(), and yyparse().

void luxMakeNamedMaterialV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 295 of file api.cpp.

References luxMakeNamedMaterial().

Referenced by luxMakeNamedMaterial().

void luxMaterial ( const char *  name,
  ... 
)

Definition at line 278 of file api.cpp.

References EXTRACT_PARAMETERS, luxMaterialV(), and PASS_PARAMETERS.

Referenced by luxMaterialV(), and yyparse().

void luxMaterialV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 284 of file api.cpp.

References luxMaterial().

Referenced by luxMaterial().

void luxNamedMaterial ( const char *  name,
  ... 
)

Definition at line 300 of file api.cpp.

References EXTRACT_PARAMETERS, luxNamedMaterialV(), and PASS_PARAMETERS.

Referenced by luxNamedMaterialV(), and yyparse().

void luxNamedMaterialV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 306 of file api.cpp.

References luxNamedMaterial().

Referenced by luxNamedMaterial().

void luxObjectBegin ( const char *  name  ) 

Definition at line 389 of file api.cpp.

References luxObjectBegin().

Referenced by luxObjectBegin(), and yyparse().

void luxObjectEnd (  ) 

Definition at line 392 of file api.cpp.

References luxObjectEnd().

Referenced by luxObjectEnd(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxObjectInstance ( const char *  name  ) 

Definition at line 395 of file api.cpp.

References luxObjectInstance().

Referenced by luxObjectInstance(), and yyparse().

void luxPause (  ) 

Definition at line 441 of file api.cpp.

References luxPause().

Referenced by luxPause(), lux::LuxGui::OnMenu(), and RenderPause().

void luxPixelFilter ( const char *  name,
  ... 
)

Definition at line 125 of file api.cpp.

References EXTRACT_PARAMETERS, luxPixelFilterV(), and PASS_PARAMETERS.

Referenced by luxPixelFilterV(), and yyparse().

void luxPixelFilterV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 131 of file api.cpp.

References luxPixelFilter().

Referenced by luxPixelFilter().

void luxPortalShape ( const char *  name,
  ... 
)

Definition at line 345 of file api.cpp.

References EXTRACT_PARAMETERS, luxPortalShapeV(), and PASS_PARAMETERS.

Referenced by luxPortalShapeV(), and yyparse().

void luxPortalShapeV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 351 of file api.cpp.

References luxPortalShape().

Referenced by luxPortalShape().

void luxRemoveThread (  ) 

Definition at line 459 of file api.cpp.

References luxRemoveThread().

Referenced by luxRemoveThread(), RemoveThread(), and lux::LuxGui::SetRenderThreads().

void luxReverseOrientation (  ) 

Definition at line 371 of file api.cpp.

References luxReverseOrientation().

Referenced by luxReverseOrientation(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxRotate ( float  angle,
float  ax,
float  ay,
float  az 
)

Definition at line 104 of file api.cpp.

References luxRotate().

Referenced by luxRotate(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxSampler ( const char *  name,
  ... 
)

Definition at line 161 of file api.cpp.

References EXTRACT_PARAMETERS, luxSamplerV(), and PASS_PARAMETERS.

Referenced by luxSamplerV(), and yyparse().

void luxSamplerV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 167 of file api.cpp.

References luxSampler().

Referenced by luxSampler().

void luxScale ( float  sx,
float  sy,
float  sz 
)

Definition at line 108 of file api.cpp.

References luxScale().

Referenced by luxScale(), and yyparse().

void luxSetNetworkServerUpdateInterval ( int  updateInterval  ) 

void luxShape ( const char *  name,
  ... 
)

Definition at line 360 of file api.cpp.

References EXTRACT_PARAMETERS, luxShapeV(), and PASS_PARAMETERS.

Referenced by luxShapeV(), and yyparse().

void luxShapeV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 366 of file api.cpp.

References luxShape().

Referenced by luxShape().

void luxStart (  ) 

Definition at line 437 of file api.cpp.

References luxStart().

Referenced by luxStart(), lux::LuxGui::OnMenu(), and RenderStart().

double luxStatistics ( const char *  statName  ) 

void luxSurfaceIntegrator ( const char *  name,
  ... 
)

Definition at line 192 of file api.cpp.

References EXTRACT_PARAMETERS, luxSurfaceIntegratorV(), and PASS_PARAMETERS.

Referenced by luxSurfaceIntegratorV(), and yyparse().

void luxSurfaceIntegratorV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 198 of file api.cpp.

References luxSurfaceIntegrator().

Referenced by luxSurfaceIntegrator().

void luxTexture ( const char *  name,
const char *  type,
const char *  texname,
  ... 
)

void luxTextureV ( const char *  name,
const char *  type,
const char *  texname,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 269 of file api.cpp.

References luxTexture().

Referenced by luxTexture().

void luxTransform ( float  transform[16]  ) 

Definition at line 97 of file api.cpp.

References luxTransform().

Referenced by luxTransform(), and yyparse().

void luxTransformBegin (  ) 

Definition at line 249 of file api.cpp.

References luxTransformBegin().

Referenced by luxTransformBegin(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxTransformEnd (  ) 

Definition at line 253 of file api.cpp.

References luxTransformEnd().

Referenced by luxTransformEnd(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxTranslate ( float  dx,
float  dy,
float  dz 
)

Definition at line 93 of file api.cpp.

References luxTranslate().

Referenced by luxTranslate(), and yyparse().

void luxUpdateFilmFromNetwork (  ) 

Definition at line 508 of file api.cpp.

References luxUpdateFilmFromNetwork().

Referenced by luxUpdateFilmFromNetwork().

void luxUpdateFramebuffer (  ) 

void luxVolume ( const char *  name,
  ... 
)

Definition at line 378 of file api.cpp.

References EXTRACT_PARAMETERS, luxVolumeV(), and PASS_PARAMETERS.

Referenced by luxVolumeV(), and yyparse().

void luxVolumeIntegrator ( const char *  name,
  ... 
)

Definition at line 209 of file api.cpp.

References EXTRACT_PARAMETERS, luxVolumeIntegratorV(), and PASS_PARAMETERS.

Referenced by luxVolumeIntegratorV(), and yyparse().

void luxVolumeIntegratorV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 215 of file api.cpp.

References luxVolumeIntegrator().

Referenced by luxVolumeIntegrator().

void luxVolumeV ( const char *  name,
int  n,
LuxToken  tokens[],
LuxPointer  params[] 
)

Definition at line 384 of file api.cpp.

References luxVolume().

Referenced by luxVolume().

void luxWait (  ) 

void luxWorldBegin (  ) 

Definition at line 237 of file api.cpp.

References luxWorldBegin().

Referenced by luxWorldBegin(), lux::NetworkRenderServerThread::run(), and yyparse().

void luxWorldEnd (  ) 

Definition at line 398 of file api.cpp.

References luxWorldEnd().

Referenced by luxWorldEnd(), lux::NetworkRenderServerThread::run(), and yyparse().

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

option nounput WHITESPACE [ \t\0xa] NUMBER ( [0-9] +|  ([0-9]+\.[0-9]*)|(\.[0-9]+)  ) 

Definition at line 105 of file luxlex.l.

References BEGIN, and INCL.

bool ParseFile ( const char *  filename  ) 

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

float Radians ( float  deg  )  [inline]

int Round2Int ( double  val  )  [inline]

u_int RoundUpPow2 ( u_int  v  )  [inline]

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

Definition at line 424 of file lux.h.

References Clamp().

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

void yyerror ( const char *  str  ) 

Definition at line 180 of file luxparse.cpp.

References LUX_SEVERE, LUX_SYNTAX, and luxError.


Variable Documentation

Definition at line 54 of file luxlex.l.

int line_num

Definition at line 175 of file luxparse.cpp.

int str_pos

Definition at line 57 of file luxlex.l.

<INCL> WHITESPACE

Definition at line 110 of file luxlex.l.


Generated on Mon May 18 07:15:15 2009 for lux by  doxygen 1.5.7.1