#include <perspective.h>
Public Member Functions | |
| PerspectiveCamera (const Transform &world2camStart, const Transform &world2camEnd, const float Screen[4], float hither, float yon, float sopen, float sclose, int sdist, float lensr, float focald, bool autofocus, float fov, int distribution, int shape, int power, Film *film) | |
| virtual | ~PerspectiveCamera () |
| virtual float | GenerateRay (const Sample &sample, Ray *) const |
| virtual bool | Sample_W (const TsPack *tspack, const Scene *scene, float u1, float u2, float u3, BSDF **bsdf, float *pdf, SWCSpectrum *We) const |
| virtual bool | Sample_W (const TsPack *tspack, const Scene *scene, const Point &p, const Normal &n, float u1, float u2, float u3, BSDF **bsdf, float *pdf, float *pdfDirect, VisibilityTester *visibility, SWCSpectrum *We) const |
| virtual bool | GetSamplePosition (const Point &p, const Vector &wi, float distance, float *x, float *y) const |
| virtual void | ClampRay (Ray &ray) const |
| virtual bool | IsDelta () const |
| virtual BBox | Bounds () const |
| virtual void | AutoFocus (Scene *scene) |
| void | SampleLens (float u1, float u2, float *dx, float *dy) const |
| virtual PerspectiveCamera * | Clone () const |
Static Public Member Functions | |
| static Camera * | CreateCamera (const Transform &world2camStart, const Transform &world2camEnd, const ParamSet ¶ms, Film *film) |
Private Attributes | |
| Point | pos |
| Normal | normal |
| Transform | RasterToCameraBidir |
| Transform | WorldToRasterBidir |
| float | fov |
| float | posPdf |
| float | xStart |
| float | xEnd |
| float | yStart |
| float | yEnd |
| float | R |
| float | xPixelWidth |
| float | yPixelHeight |
| float | Apixel |
| int | distribution |
| int | shape |
| int | power |
| bool | autoFocus |
| boost::shared_ptr< Shape > | lens |
Definition at line 30 of file perspective.h.
| PerspectiveCamera::PerspectiveCamera | ( | const Transform & | world2camStart, | |
| const Transform & | world2camEnd, | |||
| const float | Screen[4], | |||
| float | hither, | |||
| float | yon, | |||
| float | sopen, | |||
| float | sclose, | |||
| int | sdist, | |||
| float | lensr, | |||
| float | focald, | |||
| bool | autofocus, | |||
| float | fov, | |||
| int | distribution, | |||
| int | shape, | |||
| int | power, | |||
| Film * | film | |||
| ) |
Definition at line 112 of file perspective.cpp.
References lux::ParamSet::AddFloat(), Apixel, lux::Camera::CameraToWorld, CreateShape(), DEFAULT_EPSILON_STATIC, fov, lux::Transform::GetInverse(), lux::Film::GetSampleExtent(), lens, lux::ProjectiveCamera::LensRadius, M_PI, normal, lux::Perspective(), pos, posPdf, R, Radians(), RasterToCameraBidir, lux::ProjectiveCamera::RasterToScreen, cimg_library::tan(), lux::Camera::WorldToCamera, WorldToRasterBidir, xEnd, xPixelWidth, lux::Film::xResolution, xStart, yEnd, yPixelHeight, lux::Film::yResolution, and yStart.
Referenced by Clone(), and CreateCamera().
| virtual lux::PerspectiveCamera::~PerspectiveCamera | ( | ) | [inline, virtual] |
Definition at line 40 of file perspective.h.
| void PerspectiveCamera::AutoFocus | ( | Scene * | scene | ) | [virtual] |
Reimplemented from lux::Camera.
Definition at line 154 of file perspective.cpp.
References autoFocus, lux::Camera::CameraToWorld, lux::Camera::ClipHither, lux::Camera::ClipYon, lux::Ray::d, lux::Camera::film, lux::ProjectiveCamera::FocalDistance, lux::Film::GetSampleExtent(), lux::Scene::Intersect(), LUX_INFO, LUX_NOERROR, LUX_WARNING, luxError, lux::Ray::maxt, lux::Ray::mint, lux::Normalize(), lux::Ray::o, lux::ProjectiveCamera::RasterToCamera, lux::Ray::time, lux::Point::x, lux::Point::y, lux::Vector::z, and lux::Point::z.
| BBox PerspectiveCamera::Bounds | ( | ) | const [virtual] |
Reimplemented from lux::Camera.
Definition at line 279 of file perspective.cpp.
References lux::Camera::CameraToWorld, lux::MachineEpsilon::E(), lux::BBox::Expand(), and lux::ProjectiveCamera::LensRadius.
| void PerspectiveCamera::ClampRay | ( | Ray & | ray | ) | const [virtual] |
Reimplemented from lux::Camera.
Definition at line 309 of file perspective.cpp.
References lux::Camera::ClipHither, lux::Camera::ClipYon, lux::Ray::d, lux::Dot(), lux::Ray::maxt, lux::Ray::mint, and normal.
| virtual PerspectiveCamera* lux::PerspectiveCamera::Clone | ( | ) | const [inline, virtual] |
Implements lux::Camera.
Definition at line 51 of file perspective.h.
References PerspectiveCamera().
| Camera * PerspectiveCamera::CreateCamera | ( | const Transform & | world2camStart, | |
| const Transform & | world2camEnd, | |||
| const ParamSet & | params, | |||
| Film * | film | |||
| ) | [static] |
Definition at line 364 of file perspective.cpp.
References distribution, lux::ParamSet::FindFloat(), lux::ParamSet::FindOneBool(), lux::ParamSet::FindOneFloat(), lux::ParamSet::FindOneInt(), lux::ParamSet::FindOneString(), fov, LUX_BADTOKEN, LUX_WARNING, luxError, cimg_library::cimg::max(), memcpy(), cimg_library::cimg::min(), PerspectiveCamera(), power, shape, lux::Film::xResolution, and lux::Film::yResolution.
Implements lux::Camera.
Definition at line 201 of file perspective.cpp.
References lux::Camera::CameraToWorld, lux::Camera::ClipHither, lux::Camera::ClipYon, lux::Ray::d, lux::ProjectiveCamera::FocalDistance, lux::Camera::GetTime(), lux::Sample::imageX, lux::Sample::imageY, lux::ProjectiveCamera::LensRadius, lux::Sample::lensU, lux::Sample::lensV, lux::Ray::maxt, lux::Ray::mint, lux::Normalize(), lux::Ray::o, lux::ProjectiveCamera::RasterToCamera, SampleLens(), lux::Sample::time, lux::Ray::time, lux::Point::x, lux::Point::y, lux::Vector::z, and lux::Point::z.
| bool PerspectiveCamera::GetSamplePosition | ( | const Point & | p, | |
| const Vector & | wi, | |||
| float | distance, | |||
| float * | x, | |||
| float * | y | |||
| ) | const [virtual] |
Reimplemented from lux::Camera.
Definition at line 288 of file perspective.cpp.
References lux::Camera::ClipYon, lux::Dot(), lux::ProjectiveCamera::FocalDistance, lux::ProjectiveCamera::LensRadius, normal, pos, WorldToRasterBidir, lux::Point::x, and lux::Point::y.
| virtual bool lux::PerspectiveCamera::IsDelta | ( | ) | const [inline, virtual] |
Reimplemented from lux::Camera.
Definition at line 46 of file perspective.h.
References lux::ProjectiveCamera::LensRadius.
| bool PerspectiveCamera::Sample_W | ( | const TsPack * | tspack, | |
| const Scene * | scene, | |||
| const Point & | p, | |||
| const Normal & | n, | |||
| float | u1, | |||
| float | u2, | |||
| float | u3, | |||
| BSDF ** | bsdf, | |||
| float * | pdf, | |||
| float * | pdfDirect, | |||
| VisibilityTester * | visibility, | |||
| SWCSpectrum * | We | |||
| ) | const [virtual] |
Reimplemented from lux::Camera.
Definition at line 258 of file perspective.cpp.
References Apixel, BSDF_ALLOC, lux::Camera::CameraToWorld, lux::ProjectiveCamera::FocalDistance, fov, lux::ProjectiveCamera::LensRadius, normal, posPdf, RasterToCameraBidir, SampleLens(), lux::VisibilityTester::SetSegment(), lux::TsPack::time, lux::Point::x, xEnd, xStart, lux::Point::y, yEnd, and yStart.
| bool PerspectiveCamera::Sample_W | ( | const TsPack * | tspack, | |
| const Scene * | scene, | |||
| float | u1, | |||
| float | u2, | |||
| float | u3, | |||
| BSDF ** | bsdf, | |||
| float * | pdf, | |||
| SWCSpectrum * | We | |||
| ) | const [virtual] |
Reimplemented from lux::Camera.
Definition at line 240 of file perspective.cpp.
References Apixel, BSDF_ALLOC, lux::Camera::CameraToWorld, lux::ProjectiveCamera::FocalDistance, fov, lux::ProjectiveCamera::LensRadius, normal, posPdf, RasterToCameraBidir, SampleLens(), lux::Point::x, xEnd, xStart, lux::Point::y, yEnd, and yStart.
| void PerspectiveCamera::SampleLens | ( | float | u1, | |
| float | u2, | |||
| float * | dx, | |||
| float * | dy | |||
| ) | const |
Definition at line 316 of file perspective.cpp.
References lux::ConcentricSampleDisk(), distribution, lux::ExponentialSampleDisk(), lux::GaussianSampleDisk(), lux::InverseExponentialSampleDisk(), lux::InverseGaussianSampleDisk(), M_PI, power, lux::r, radIndex, cimg_library::cimg::rand(), shape, and lux::TriangularSampleDisk().
Referenced by GenerateRay(), and Sample_W().
float lux::PerspectiveCamera::Apixel [private] |
Definition at line 64 of file perspective.h.
Referenced by PerspectiveCamera(), and Sample_W().
bool lux::PerspectiveCamera::autoFocus [private] |
Definition at line 68 of file perspective.h.
Referenced by AutoFocus().
int lux::PerspectiveCamera::distribution [private] |
Definition at line 65 of file perspective.h.
Referenced by CreateCamera(), and SampleLens().
float lux::PerspectiveCamera::fov [private] |
Definition at line 61 of file perspective.h.
Referenced by CreateCamera(), PerspectiveCamera(), and Sample_W().
boost::shared_ptr<Shape> lux::PerspectiveCamera::lens [private] |
Definition at line 70 of file perspective.h.
Referenced by PerspectiveCamera().
Normal lux::PerspectiveCamera::normal [private] |
Definition at line 59 of file perspective.h.
Referenced by ClampRay(), GetSamplePosition(), PerspectiveCamera(), and Sample_W().
Point lux::PerspectiveCamera::pos [private] |
Definition at line 58 of file perspective.h.
Referenced by GetSamplePosition(), and PerspectiveCamera().
float lux::PerspectiveCamera::posPdf [private] |
Definition at line 62 of file perspective.h.
Referenced by PerspectiveCamera(), and Sample_W().
int lux::PerspectiveCamera::power [private] |
Definition at line 65 of file perspective.h.
Referenced by CreateCamera(), and SampleLens().
float lux::PerspectiveCamera::R [private] |
Definition at line 64 of file perspective.h.
Referenced by PerspectiveCamera().
Definition at line 60 of file perspective.h.
Referenced by PerspectiveCamera(), and Sample_W().
int lux::PerspectiveCamera::shape [private] |
Definition at line 65 of file perspective.h.
Referenced by CreateCamera(), and SampleLens().
Definition at line 60 of file perspective.h.
Referenced by GetSamplePosition(), and PerspectiveCamera().
float lux::PerspectiveCamera::xEnd [private] |
Definition at line 63 of file perspective.h.
Referenced by PerspectiveCamera(), and Sample_W().
float lux::PerspectiveCamera::xPixelWidth [private] |
Definition at line 64 of file perspective.h.
Referenced by PerspectiveCamera().
float lux::PerspectiveCamera::xStart [private] |
Definition at line 63 of file perspective.h.
Referenced by PerspectiveCamera(), and Sample_W().
float lux::PerspectiveCamera::yEnd [private] |
Definition at line 63 of file perspective.h.
Referenced by PerspectiveCamera(), and Sample_W().
float lux::PerspectiveCamera::yPixelHeight [private] |
Definition at line 64 of file perspective.h.
Referenced by PerspectiveCamera().
float lux::PerspectiveCamera::yStart [private] |
Definition at line 63 of file perspective.h.
Referenced by PerspectiveCamera(), and Sample_W().
1.6.2-20100208