#include <cmath>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/split_member.hpp>
#include <malloc.h>
#include <alloca.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <assert.h>
#include "randomgen.h"
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
Go to the source code of this file.
Namespaces | |
namespace | lux |
Defines | |
#define | BOOST_NO_INTRINSIC_INT64_T |
#define | _GNU_SOURCE 1 |
#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 HUGE_VAL |
#define | LUX_VERSION 0.5 |
#define | LUX_VERSION_STRING "0.5 (CVS)" |
#define | RAY_EPSILON 1e-3f |
#define | COLOR_SAMPLES 3 |
#define | LUX_PATH_SEP ":" |
#define | _doublemagicroundeps (.5-1.4e-11) |
#define | _doublemagicroundeps (.5-1.4e-11) |
#define | BOOST_NO_INTRINSIC_INT64_T |
#define | _GNU_SOURCE 1 |
#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 HUGE_VAL |
#define | LUX_VERSION 0.5 |
#define | LUX_VERSION_STRING "0.5 (CVS)" |
#define | RAY_EPSILON 1e-3f |
#define | COLOR_SAMPLES 3 |
#define | LUX_PATH_SEP ":" |
#define | _doublemagicroundeps (.5-1.4e-11) |
#define | _doublemagicroundeps (.5-1.4e-11) |
#define | BOOST_NO_INTRINSIC_INT64_T |
#define | _GNU_SOURCE 1 |
#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 HUGE_VAL |
#define | LUX_VERSION 0.5 |
#define | LUX_VERSION_STRING "0.5 (CVS)" |
#define | RAY_EPSILON 1e-3f |
#define | COLOR_SAMPLES 3 |
#define | LUX_PATH_SEP ":" |
#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 | |
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]) |
ImageData * | lux::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 > | |
T | Lerp (float t, T v1, T v2) |
template<class T > | |
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) |
#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 375 of file luxlex.l.
Referenced by Ceil2Int(), Float2Int(), Floor2Int(), Log2Int(), and Round2Int().
#define _GNU_SOURCE 1 |
#define _GNU_SOURCE 1 |
#define BC_GRID_SIZE 40 |
#define BC_GRID_SIZE 40 |
#define BC_GRID_SIZE 40 |
Definition at line 126 of file luxlex.l.
Referenced by BestCandidate2D(), main(), and Redistribute2D().
#define BOOST_NO_INTRINSIC_INT64_T |
#define BOOST_NO_INTRINSIC_INT64_T |
#define COLOR_SAMPLES 3 |
#define COLOR_SAMPLES 3 |
#define COLOR_SAMPLES 3 |
Definition at line 222 of file luxlex.l.
Referenced by lux::Spectrum::AddWeighted(), lux::Spectrum::Black(), lux::Spectrum::Clamp(), lux::UVTexture::Evaluate(), lux::Plastic::GetBSDF(), lux::HarlequinTexture::HarlequinTexture(), InitParamSet(), lux::Spectrum::IsNaN(), lux::Spectrum::operator*(), lux::Spectrum::operator*=(), lux::Spectrum::operator+(), lux::Spectrum::operator+=(), lux::Spectrum::operator-(), lux::Spectrum::operator-=(), lux::Spectrum::operator/(), lux::Spectrum::operator/=(), operator<<(), lux::Spectrum::operator==(), lux::Spectrum::Pow(), lux::Spectrum::Print(), lux::Spectrum::serialize(), lux::Spectrum::Spectrum(), lux::Spectrum::Sqrt(), lux::Spectrum::ToXYZ(), and lux::Spectrum::y().
#define GRID | ( | v | ) | (int((v) * BC_GRID_SIZE)) |
#define GRID | ( | v | ) | (int((v) * BC_GRID_SIZE)) |
#define GRID | ( | v | ) | (int((v) * BC_GRID_SIZE)) |
Definition at line 128 of file luxlex.l.
Referenced by addSampleToGrid(), BestCandidate2D(), main(), and Redistribute2D().
#define INFINITY HUGE_VAL |
#define INFINITY HUGE_VAL |
#define INFINITY HUGE_VAL |
Definition at line 216 of file luxlex.l.
Referenced by lux::BBox::BBox(), BestCandidate2D(), lux::UnsafeKdTreeAccel::buildTree(), lux::TaBRecKdTreeAccel::buildTree(), lux::SPD::Clamp(), lux::MIPMapImpl< T, U >::clamp(), lux::RealisticCamera::GenerateRay(), lux::AggregateVolume::IntersectP(), lux::ExPhotonIntegrator::LiInternal(), main(), lux::FlexImageFilm::MergeSampleArray(), lux::Shape::Pdf(), Redistribute2D(), and lux::ImageFilm::WriteImage().
#define INV_PI 0.31830988618379067154f |
#define INV_PI 0.31830988618379067154f |
#define INV_PI 0.31830988618379067154f |
Definition at line 213 of file luxlex.l.
Referenced by lux::CosineHemispherePdf(), lux::AreaLight::EvalDirectionPdf(), lux::OrenNayar::f(), lux::Lafortune::f(), lux::CookTorrance::f(), lux::EnvironmentCamera::GenerateSample(), lux::IrradianceCache::IndirectLo(), lux::InfiniteAreaLightIS::Le(), lux::InfiniteAreaLight::Le(), lux::PhotonIntegrator::LPhoton(), lux::ExPhotonIntegrator::LPhoton(), lux::Lafortune::Pdf(), lux::InfiniteAreaLightIS::Pdf(), lux::FresnelBlend::Pdf(), lux::CookTorrance::Pdf(), lux::BxDF::Pdf(), lux::ExPhotonIntegrator::Preprocess(), lux::AreaLight::SampleDirection(), lux::GonioPhotometricLight::Scale(), and lux::SphericalMapping2D::sphere().
#define INV_TWOPI 0.15915494309189533577f |
#define INV_TWOPI 0.15915494309189533577f |
#define INV_TWOPI 0.15915494309189533577f |
Definition at line 214 of file luxlex.l.
Referenced by lux::Blinn::D(), lux::Anisotropic::D(), lux::EnvironmentCamera::GenerateSample(), lux::Disk::Intersect(), lux::SkyLight::Le(), lux::InfiniteAreaLightIS::Le(), lux::InfiniteAreaLight::Le(), lux::SkyLight::Pdf(), lux::InfiniteAreaLightIS::Pdf(), lux::InfiniteAreaLight::Pdf(), lux::BxDF::rho(), lux::SkyLight::Sample_L(), lux::InfiniteAreaLight::Sample_L(), lux::AreaLight::Sample_L(), lux::GonioPhotometricLight::Scale(), lux::SphericalMapping2D::sphere(), and lux::UniformHemispherePdf().
#define LUX_PATH_SEP ":" |
#define LUX_PATH_SEP ":" |
#define LUX_VERSION 0.5 |
#define LUX_VERSION 0.5 |
#define LUX_VERSION_STRING "0.5 (CVS)" |
#define LUX_VERSION_STRING "0.5 (CVS)" |
#define LUX_VERSION_STRING "0.5 (CVS)" |
Definition at line 220 of file luxlex.l.
Referenced by main(), and lux::LuxGuiApp::ProcessCommandLine().
#define M_PI 3.14159265358979323846f |
#define M_PI 3.14159265358979323846f |
#define M_PI 3.14159265358979323846f |
Definition at line 212 of file luxlex.l.
Referenced by blender::blend(), lux::ConcentricSampleDisk(), lux::CylindricalMapping2D::cylinder(), lux::WardIsotropic::D(), Degrees(), lux::Ekernel(), lux::ExPhotonIntegrator::estimateE(), lux::FresnelBlend::f(), lux::CookTorrance::f(), lux::LoopSubdiv::GenerateNormals(), lux::EnvironmentCamera::GenerateRay(), lux::EnvironmentCamera::GenerateSample(), lux::CarPaint::GetBSDF(), lux::EnvironmentCamera::GetFlux2RadianceFactors(), lux::SkyLight::GetSkySpectralRadiance(), lux::IrradianceCache::IndirectLo(), lux::InfiniteAreaLightIS::InfiniteAreaLightIS(), lux::Sphere::Intersect(), lux::Paraboloid::Intersect(), lux::LensComponent::Intersect(), lux::Hyperboloid::Intersect(), lux::Disk::Intersect(), lux::Cylinder::Intersect(), lux::Cone::Intersect(), lux::Sphere::IntersectP(), lux::Paraboloid::IntersectP(), lux::Hyperboloid::IntersectP(), lux::Disk::IntersectP(), lux::Cylinder::IntersectP(), lux::Cone::IntersectP(), lux::Lanczos(), lux::SunLight::Le(), lux::SkyLight::Le(), lux::PhotonIntegrator::LPhoton(), lux::SkyLight::Pdf(), lux::InfiniteAreaLightIS::Pdf(), lux::InfiniteAreaLight::Pdf(), lux::Blinn::Pdf(), lux::PerspectiveCamera::PerspectiveCamera(), lux::PhaseHG(), lux::PhaseIsotropic(), lux::PhaseMieHazy(), lux::PhaseMieMurky(), lux::PhaseRayleigh(), lux::PhaseSchlick(), lux::SunLight::Power(), lux::SpotLight::Power(), lux::SkyLight::Power(), lux::ProjectionLight::Power(), lux::PointLight::Power(), lux::AreaLight::Power(), lux::InfiniteAreaLightIS::Power(), lux::InfiniteAreaLight::Power(), lux::GonioPhotometricLight::Power(), lux::DistantLight::Power(), lux::IGIIntegrator::Preprocess(), Radians(), lux::BxDF::rho(), RiAngleBetween(), lux::WardIsotropic::Sample_f(), lux::Lafortune::Sample_f(), lux::Blinn::Sample_f(), lux::Beckmann::Sample_f(), lux::Anisotropic::Sample_f(), lux::SunLight::Sample_L(), lux::SkyLight::Sample_L(), lux::InfiniteAreaLightIS::Sample_L(), lux::InfiniteAreaLight::Sample_L(), lux::DistantLight::Sample_L(), lux::Anisotropic::sampleFirstQuadrant(), lux::SampleHG(), lux::LanczosSincFilter::Sinc1D(), lux::SkyLight::SkyLight(), lux::SphericalPhi(), lux::SunLight::SunLight(), blender::tex_saw(), blender::tex_tri(), lux::UniformConePdf(), lux::UniformSampleCone(), lux::UniformSampleDisk(), lux::UniformSampleHemisphere(), lux::UniformSampleSphere(), and lux::UniformSpherePdf().
#define RAY_EPSILON 1e-3f |
#define RAY_EPSILON 1e-3f |
#define RAY_EPSILON 1e-3f |
Definition at line 221 of file luxlex.l.
Referenced by lux::PerspectiveCamera::IsVisibleFromEyes(), lux::OrthoCamera::IsVisibleFromEyes(), lux::EnvironmentCamera::IsVisibleFromEyes(), lux::IGIIntegrator::Li(), lux::ProjectionLight::ProjectionLight(), lux::VisibilityTester::SetRay(), lux::VisibilityTester::SetSegment(), lux::TaBRecKdTreeAccel::TaBRecKdTreeAccel(), lux::VisibilityTester::TestOcclusion(), and lux::BidirIntegrator::visible().
typedef vector< int > SampleGrid |
typedef double StatsCounterType |
int Ceil2Int | ( | T | val | ) | [inline] |
Definition at line 402 of file lux.h.
References _doublemagicroundeps, and Round2Int().
Referenced by lux::ImageFilm::AddSample(), lux::MIPMapImpl< T, U >::EWA(), lux::FlexImageFilm::FlexImageFilm(), lux::ImageFilm::ImageFilm(), lux::IrregularSPD::IrregularSPD(), lux::SingleScattering::Li(), lux::EmissionIntegrator::Li(), and lux::FlexImageFilm::MergeSampleArray().
T Clamp | ( | T | val, | |
T | low, | |||
T | high | |||
) | [inline] |
Definition at line 329 of file lux.h.
Referenced by lux::Cone::Cone(), lux::ImageFilm::CreateFilm(), lux::FlexImageFilm::CreateFilm(), lux::Cylinder::Cylinder(), lux::VolumeGrid::D(), lux::Disk::Disk(), lux::FresnelDielectric::Evaluate(), lux::MatteTranslucent::GetBSDF(), lux::Matte::GetBSDF(), lux::CarPaint::GetBSDF(), lux::GridAccel::GridAccel(), lux::Hyperboloid::Hyperboloid(), lux::IrradianceCache::IndirectLo(), lux::LensComponent::LensComponent(), lux::MIPMapImpl< T, U >::MIPMapImpl(), lux::Paraboloid::Paraboloid(), lux::InfiniteAreaLightIS::Pdf(), lux::GridAccel::PosToVoxel(), lux::InfiniteAreaLightIS::Sample_L(), SmoothStep(), lux::Sphere::Sphere(), lux::SphericalTheta(), lux::MIPMapImpl< T, U >::texelInternal(), lux::MIPMapImpl< T, U >::triangle(), and lux::ImageFilm::WriteImage().
int Float2Int | ( | T | val | ) | [inline] |
Definition at line 387 of file lux.h.
References _doublemagicroundeps, and Round2Int().
Referenced by lux::ApplyImagingPipeline(), lux::MIPMapImpl< T, U >::EWA(), lux::InfiniteAreaLightIS::Pdf(), lux::GridAccel::PosToVoxel(), lux::InfiniteAreaLightIS::Sample_L(), and lux::WeightedSampleOneLight().
int Floor2Int | ( | T | val | ) | [inline] |
Definition at line 395 of file lux.h.
References _doublemagicroundeps, and Round2Int().
Referenced by lux::ImageFilm::AddSample(), lux::ERPTSampler::AddSample(), lux::SkyLight::ChromaticityToSpectrum(), lux::VolumeGrid::Density(), lux::UVTexture::Evaluate(), lux::MarbleTexture::Evaluate(), lux::DotsTexture< T >::Evaluate(), lux::Checkerboard3D< T >::Evaluate(), lux::Checkerboard2D< T >::Evaluate(), lux::MIPMapImpl< T, U >::EWA(), lux::FBm(), lux::RandomPixelSampler::GetNextPixel(), lux::LowdiscrepancyPixelSampler::GetNextPixel(), lux::ImageFilm::GetSampleExtent(), lux::FlexImageFilm::GetSampleExtent(), lux::IrregularSPD::IrregularSPD(), lux::SingleScattering::Li(), lux::ParticleTracingIntegrator::Li(), lux::MLTPathIntegrator::Li(), lux::BidirIntegrator::Li(), lux::ExPhotonIntegrator::LiInternal(), lux::MIPMapImpl< T, U >::Lookup(), lux::FlexImageFilm::MergeSampleArray(), lux::MIPMapImpl< T, U >::nearest(), lux::Noise(), lux::PhotonIntegrator::Preprocess(), lux::IGIIntegrator::Preprocess(), lux::ExPhotonIntegrator::Preprocess(), lux::MIPMapImpl< T, U >::resampleWeights(), lux::SpectrumWavelengths::Sample(), lux::SPD::sample(), lux::BSDF::Sample_f(), lux::SkyLight::Sample_L(), lux::InfiniteAreaLight::Sample_L(), lux::MIPMapImpl< T, U >::triangle(), lux::Turbulence(), lux::UniformSampleOneLight(), update_Statistics(), lux::LuxGui::UpdateStatistics(), and lux::VegasPixelSampler::VegasPixelSampler().
bool IsPowerOf2 | ( | int | v | ) | [inline] |
Definition at line 360 of file lux.h.
Referenced by lux::Voxel::AddPrimitive(), lux::HaltonSampler::HaltonSampler(), lux::LDSampler::LDSampler(), and lux::MIPMapImpl< T, U >::MIPMapImpl().
T Lerp | ( | float | t, | |
T | v1, | |||
T | v2 | |||
) | [inline] |
Definition at line 326 of file lux.h.
Referenced by lux::ApplyImagingPipeline(), lux::ColorSystem::Constrain(), lux::VolumeGrid::Density(), lux::RealisticCamera::GenerateRay(), lux::PerspectiveCamera::GenerateRay(), lux::OrthoCamera::GenerateRay(), lux::EnvironmentCamera::GenerateRay(), lux::HighContrastOp::Map(), lux::Noise(), lux::NURBS::Refine(), lux::SpectrumWavelengths::Sample(), lux::SPD::sample(), lux::Cylinder::Sample(), lux::UniformSampleCone(), and lux::WeightedSampleOneLight().
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] |
Definition at line 352 of file lux.h.
References _doublemagicroundeps, and Log2().
Referenced by lux::MIPMapImpl< T, U >::MIPMapImpl(), lux::TaBRecKdTreeAccel::TaBRecKdTreeAccel(), and lux::UnsafeKdTreeAccel::UnsafeKdTreeAccel().
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 luxInit | ( | ) |
Definition at line 403 of file api.cpp.
References initialized, LUX_ERROR, LUX_ILLSTATE, and luxError.
Referenced by main(), and lux::LuxGuiApp::OnInit().
int Mod | ( | int | a, | |
int | b | |||
) | [inline] |
Definition at line 332 of file lux.h.
Referenced by lux::MIPMapImpl< T, U >::MIPMapImpl(), and lux::MIPMapImpl< T, U >::texelInternal().
bool ParseFile | ( | const char * | filename | ) |
Definition at line 27 of file parser.cpp.
References current_file, cimg_library::cimg::fclose(), cimg_library::cimg::fopen(), line_num, LUX_NOFILE, LUX_SEVERE, luxError, cimg_library::cimg::strcmp(), yyin, and yyparse().
Referenced by Engine_Thread(), lux::LuxGui::EngineThread(), and engineThread().
bool Quadratic | ( | float | A, | |
float | B, | |||
float | C, | |||
float * | t0, | |||
float * | t1 | |||
) | [inline] |
Definition at line 409 of file lux.h.
References cimg_library::cimg::swap().
Referenced by lux::Sphere::Intersect(), lux::Paraboloid::Intersect(), lux::LensComponent::Intersect(), lux::Hyperboloid::Intersect(), lux::Cylinder::Intersect(), lux::Cone::Intersect(), lux::Sphere::IntersectP(), lux::Paraboloid::IntersectP(), lux::LensComponent::IntersectP(), lux::Hyperboloid::IntersectP(), lux::Cylinder::IntersectP(), and lux::Cone::IntersectP().
float Radians | ( | float | deg | ) | [inline] |
Definition at line 343 of file lux.h.
References M_PI.
Referenced by lux::Cone::Cone(), lux::Cylinder::Cylinder(), lux::Disk::Disk(), lux::ExPhotonIntegrator::ExPhotonIntegrator(), lux::Hyperboloid::Hyperboloid(), lux::LensComponent::LensComponent(), lux::OrenNayar::OrenNayar(), lux::Paraboloid::Paraboloid(), lux::Perspective(), lux::PerspectiveCamera::PerspectiveCamera(), lux::ProjectionLight::ProjectionLight(), lux::Rotate(), lux::RotateX(), lux::RotateY(), lux::RotateZ(), lux::Sphere::Sphere(), and lux::SpotLight::SpotLight().
int Round2Int | ( | double | val | ) | [inline] |
Definition at line 377 of file lux.h.
References _doublemagicroundeps.
Referenced by Ceil2Int(), Float2Int(), Floor2Int(), lux::GridAccel::GridAccel(), lux::TaBRecKdTreeAccel::TaBRecKdTreeAccel(), and lux::UnsafeKdTreeAccel::UnsafeKdTreeAccel().
Definition at line 363 of file lux.h.
Referenced by lux::HaltonSampler::HaltonSampler(), lux::IGIIntegrator::IGIIntegrator(), lux::LDSampler::LDSampler(), lux::MIPMapImpl< T, U >::MIPMapImpl(), lux::LDSampler::RoundSize(), and lux::HaltonSampler::RoundSize().
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().