Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::ProjectiveCamera Class Referenceabstract

Projective camera interface. More...

#include <mitsuba/render/sensor.h>

+ Inheritance diagram for mitsuba::ProjectiveCamera:

Public Member Functions

const Transform getViewTransform (Float t) const
 Return the world-to-view (aka "view") transformation at time t. More...
 
const Transform getWorldTransform (Float t) const
 Return the view-to-world transformation at time t. More...
 
void setWorldTransform (const Transform &trafo)
 Overwrite the view-to-world transformation with a static (i.e. non-animated) transformation. More...
 
void setWorldTransform (AnimatedTransform *trafo)
 Overwrite the view-to-world transformation with an animated transformation. More...
 
virtual Transform getProjectionTransform (const Point2 &apertureSample, const Point2 &aaSample) const =0
 Return a projection matrix suitable for rendering the scene using OpenGL. More...
 
virtual void serialize (Stream *stream, InstanceManager *manager) const
 Serialize this camera to a binary data stream. More...
 
Float getNearClip () const
 Return the near clip plane distance. More...
 
void setNearClip (Float nearClip)
 Set the near clip plane distance. More...
 
Float getFarClip () const
 Return the far clip plane distance. More...
 
void setFarClip (Float farClip)
 Set the far clip plane distance. More...
 
Float getFocusDistance () const
 Return the distance to the focal plane. More...
 
void setFocusDistance (Float focusDistance)
 Set the distance to the focal plane. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from mitsuba::Sensor
virtual Spectrum sampleRay (Ray &ray, const Point2 &samplePosition, const Point2 &apertureSample, Float timeSample) const =0
 Importance sample a ray according to the sensor response. More...
 
virtual Spectrum sampleRayDifferential (RayDifferential &ray, const Point2 &samplePosition, const Point2 &apertureSample, Float timeSample) const
 Importance sample a ray differential according to the sensor response. More...
 
Float sampleTime (Float sample) const
 Importance sample the temporal part of the sensor response function. More...
 
virtual Spectrum eval (const Intersection &its, const Vector &d, Point2 &samplePos) const
 Return the emitted importance for the given surface intersection. More...
 
virtual bool getSamplePosition (const PositionSamplingRecord &pRec, const DirectionSamplingRecord &dRec, Point2 &position) const
 Return the sample position associated with a given position and direction sampling record. More...
 
Float pdfTime (const Ray &ray, EMeasure measure) const
 Evaluate the temporal component of the sampling density implemented by the sampleRay() method. More...
 
Float getShutterOpen () const
 Return the time value of the shutter opening event. More...
 
void setShutterOpen (Float time)
 Set the time value of the shutter opening event. More...
 
Float getShutterOpenTime () const
 Return the length, for which the shutter remains open. More...
 
void setShutterOpenTime (Float time)
 Set the length, for which the shutter remains open. More...
 
bool needsTimeSample () const
 Does the method sampleRay() require a uniformly distributed sample for the time-dependent component? More...
 
bool needsApertureSample () const
 Does the method sampleRay() require a uniformly distributed sample for the aperture component? More...
 
FilmgetFilm ()
 Return the Film instance associated with this sensor. More...
 
const FilmgetFilm () const
 Return the Film instance associated with this sensor (const) More...
 
Float getAspect () const
 Return the aspect ratio of the sensor and its underlying film. More...
 
SamplergetSampler ()
 Return the sensor's sample generator. More...
 
const SamplergetSampler () const
 Return the sensor's sampler (const version). More...
 
virtual void addChild (const std::string &name, ConfigurableObject *child)
 Add a child ConfigurableObject. More...
 
void addChild (ConfigurableObject *child)
 Add an unnamed child. More...
 
virtual void configure ()
 Configure the object (called once after construction and addition of all child ConfigurableObject instances). More...
 
- Public Member Functions inherited from mitsuba::AbstractEmitter
virtual Spectrum samplePosition (PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra=NULL) const
 Importance sample the spatial component of the emission profile. More...
 
virtual Spectrum sampleDirection (DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra=NULL) const
 Conditioned on the spatial component, importance sample the directional part of the emission profile. More...
 
virtual Spectrum sampleDirect (DirectSamplingRecord &dRec, const Point2 &sample) const
 Direct sampling: given a reference point in the scene, sample an emitter position that contributes towards it. More...
 
virtual Spectrum evalPosition (const PositionSamplingRecord &pRec) const
 Evaluate the spatial component of the emission profile. More...
 
virtual Spectrum evalDirection (const DirectionSamplingRecord &dRec, const PositionSamplingRecord &pRec) const
 Evaluate the directional component of the emission profile. More...
 
virtual Float pdfPosition (const PositionSamplingRecord &pRec) const
 Evaluate the spatial component of the sampling density implemented by the samplePosition() method. More...
 
virtual Float pdfDirection (const DirectionSamplingRecord &dRec, const PositionSamplingRecord &pRec) const
 Evaluate the directional component of the sampling density implemented by the sampleDirection() method. More...
 
virtual Float pdfDirect (const DirectSamplingRecord &dRec) const
 Evaluate the probability density of the direct sampling method implemented by the sampleDirect() method. More...
 
uint32_t getType () const
 Return a listing of classification flags combined using binary OR. More...
 
const AnimatedTransformgetWorldTransform () const
 Return the local space to world space transformation. More...
 
void setWorldTransform (AnimatedTransform *trafo)
 Set the local space to world space transformation. More...
 
bool needsPositionSample () const
 Does the method samplePosition() require a uniformly distributed sample for the spatial component? More...
 
bool needsDirectionSample () const
 Does the method sampleDirection() require a uniformly distributed sample for the direction component? More...
 
bool isOnSurface () const
 Does the emitter lie on some kind of surface? More...
 
bool isDegenerate () const
 Does the sensor have a degenerate directional or spatial distribution? More...
 
bool needsDirectSample () const
 Does the method sampleDirect() require a uniformly distributed sample? More...
 
EMeasure getDirectMeasure () const
 Return the measure associated with the sampleDirect() operation. More...
 
MediumgetMedium ()
 Return a pointer to the medium that surrounds the emitter. More...
 
const MediumgetMedium () const
 Return a pointer to the medium that surrounds the emitter (const version) More...
 
ShapegetShape ()
 Return the shape, to which the emitter is currently attached. More...
 
const ShapegetShape () const
 Return the shape, to which the emitter is currently attached (const version) More...
 
virtual ref< ShapecreateShape (const Scene *scene)
 Create a special shape that represents the emitter. More...
 
virtual AABB getAABB () const =0
 Return an axis-aligned box bounding the spatial extents of the emitter. More...
 
void setMedium (Medium *medium)
 Set the medium that surrounds the emitter. More...
 
void addChild (ConfigurableObject *child)
 Add an unnamed child. More...
 
- Public Member Functions inherited from mitsuba::ConfigurableObject
virtual void setParent (ConfigurableObject *parent)
 Notify the ConfigurableObject instance about its parent object. More...
 
void addChild (ConfigurableObject *child)
 Add an unnamed child. More...
 
const std::string & getID () const
 Return the identifier associated with this instance (or "unnamed") More...
 
void setID (const std::string &name)
 Set the identifier associated with this instance. More...
 
const PropertiesgetProperties () const
 Return the properties object that was originally used to create this instance. More...
 
- Public Member Functions inherited from mitsuba::SerializableObject
 SerializableObject (Stream *stream, InstanceManager *manager)
 Unserialize a serializable object. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 
virtual std::string toString () const
 Return a human-readable string representation of the object's contents. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::Sensor
static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::AbstractEmitter
static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::ConfigurableObject
static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::SerializableObject
static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

 ProjectiveCamera (const Properties &props)
 Construct a new camera instance. More...
 
 ProjectiveCamera (Stream *stream, InstanceManager *manager)
 Unserialize a camera instance from a binary data stream. More...
 
virtual ~ProjectiveCamera ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::Sensor
 Sensor (const Properties &props)
 Construct a new sensor instance. More...
 
 Sensor (Stream *stream, InstanceManager *manager)
 Unserialize a sensor instance from a binary data stream. More...
 
virtual ~Sensor ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::AbstractEmitter
 AbstractEmitter (const Properties &props)
 Construct a new emitter instance. More...
 
 AbstractEmitter (Stream *stream, InstanceManager *manager)
 Unserialize a emitter instance from a binary data stream. More...
 
virtual ~AbstractEmitter ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::ConfigurableObject
virtual ~ConfigurableObject ()
 Virtual destructor. More...
 
 ConfigurableObject (const Properties &props)
 Construct a configurable object. More...
 
 ConfigurableObject (Stream *stream, InstanceManager *manager)
 Unserialize a configurable object. More...
 
- Protected Member Functions inherited from mitsuba::SerializableObject
 SerializableObject ()
 Construct a serializable object. More...
 
virtual ~SerializableObject ()
 Virtual deconstructor. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Protected Attributes

Float m_nearClip
 
Float m_farClip
 
Float m_focusDistance
 
- Protected Attributes inherited from mitsuba::Sensor
ref< Filmm_film
 
ref< Samplerm_sampler
 
Vector2 m_resolution
 
Vector2 m_invResolution
 
Float m_shutterOpen
 
Float m_shutterOpenTime
 
Float m_aspect
 
- Protected Attributes inherited from mitsuba::AbstractEmitter
ref< const AnimatedTransformm_worldTransform
 
ref< Mediumm_medium
 
Shapem_shape
 
uint32_t m_type
 
- Protected Attributes inherited from mitsuba::ConfigurableObject
Properties m_properties
 

Additional Inherited Members

- Public Types inherited from mitsuba::Sensor
enum  ESensorFlags {
  EDeltaTime = 0x010, ENeedsApertureSample = 0x020, EProjectiveCamera = 0x100, EPerspectiveCamera = 0x200,
  EOrthographicCamera = 0x400, EPositionSampleMapsToPixels = 0x1000, EDirectionSampleMapsToPixels = 0x2000
}
 This list of flags is used to additionally characterize and classify the response functions of different types of sensors. More...
 
- Public Types inherited from mitsuba::AbstractEmitter
enum  EEmitterType { EDeltaDirection = 0x01, EDeltaPosition = 0x02, EOnSurface = 0x04 }
 Flags used to classify the emission profile of different types of emitters. More...
 
- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 

Detailed Description

Projective camera interface.

This class provides an abstract interface to several types of sensors that are commonly used in computer graphics, such as perspective and orthographic camera models.

The interface is meant to be implemented by any kind of sensor, whose world to clip space transformation can be explained using only linear operations on homogeneous coordinates.

A useful feature of ProjectiveCamera sensors is that their view can be rendered using the traditional OpenGL pipeline.

Constructor & Destructor Documentation

mitsuba::ProjectiveCamera::ProjectiveCamera ( const Properties props)
protected

Construct a new camera instance.

mitsuba::ProjectiveCamera::ProjectiveCamera ( Stream stream,
InstanceManager manager 
)
protected

Unserialize a camera instance from a binary data stream.

virtual mitsuba::ProjectiveCamera::~ProjectiveCamera ( )
protectedvirtual

Virtual destructor.

Member Function Documentation

virtual const Class* mitsuba::ProjectiveCamera::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::Sensor.

Reimplemented in mitsuba::PerspectiveCamera.

Float mitsuba::ProjectiveCamera::getFarClip ( ) const
inline

Return the far clip plane distance.

Float mitsuba::ProjectiveCamera::getFocusDistance ( ) const
inline

Return the distance to the focal plane.

Float mitsuba::ProjectiveCamera::getNearClip ( ) const
inline

Return the near clip plane distance.

virtual Transform mitsuba::ProjectiveCamera::getProjectionTransform ( const Point2 apertureSample,
const Point2 aaSample 
) const
pure virtual

Return a projection matrix suitable for rendering the scene using OpenGL.

For scenes involving a narrow depth of field and antialiasing, it is necessary to average many separately rendered images using different pixel offsets and aperture positions.

Parameters
apertureSampleSample for rendering with defocus blur. This should be a uniformly distributed random point in [0,1]^2 (or any value when needsApertureSample() == false)
aaSampleSample for antialiasing. This should be a uniformly distributed random point in [0,1]^2.
const Transform mitsuba::ProjectiveCamera::getViewTransform ( Float  t) const
inline

Return the world-to-view (aka "view") transformation at time t.

const Transform mitsuba::ProjectiveCamera::getWorldTransform ( Float  t) const
inline

Return the view-to-world transformation at time t.

virtual void mitsuba::ProjectiveCamera::serialize ( Stream stream,
InstanceManager manager 
) const
virtual

Serialize this camera to a binary data stream.

Reimplemented from mitsuba::Sensor.

Reimplemented in mitsuba::PerspectiveCamera.

void mitsuba::ProjectiveCamera::setFarClip ( Float  farClip)

Set the far clip plane distance.

void mitsuba::ProjectiveCamera::setFocusDistance ( Float  focusDistance)

Set the distance to the focal plane.

void mitsuba::ProjectiveCamera::setNearClip ( Float  nearClip)

Set the near clip plane distance.

void mitsuba::ProjectiveCamera::setWorldTransform ( const Transform trafo)

Overwrite the view-to-world transformation with a static (i.e. non-animated) transformation.

void mitsuba::ProjectiveCamera::setWorldTransform ( AnimatedTransform trafo)

Overwrite the view-to-world transformation with an animated transformation.

Member Data Documentation

Float mitsuba::ProjectiveCamera::m_farClip
protected
Float mitsuba::ProjectiveCamera::m_focusDistance
protected
Float mitsuba::ProjectiveCamera::m_nearClip
protected
Class* mitsuba::ProjectiveCamera::m_theClass
static

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