Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mut_lens.h
Go to the documentation of this file.
1 /*
2  This file is part of Mitsuba, a physically based rendering system.
3 
4  Copyright (c) 2007-2014 by Wenzel Jakob and others.
5 
6  Mitsuba is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License Version 3
8  as published by the Free Software Foundation.
9 
10  Mitsuba is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #pragma once
20 #if !defined(__MITSUBA_BIDIR_MUT_LENS_H_)
21 #define __MITSUBA_BIDIR_MUT_LENS_H_
22 
23 #include <mitsuba/bidir/mutator.h>
24 
26 
27 /**
28  * \brief Veach-style Lens subpath perturbation strategy
29  *
30  * This class implements a simple lens perturbation strategy
31  * as described in Eric Veach's PhD thesis.
32  *
33  * \author Wenzel Jakob
34  * \ingroup libbidir
35  */
37 public:
38  /**
39  * \brief Construct a new lens perturbation strategy
40  *
41  * \param scene
42  * A pointer to the underlying scene
43  *
44  * \param sampler
45  * A sample generator
46  *
47  * \param pool
48  * A memory pool used to allocate new path vertices and edges
49  *
50  * \param minJump
51  * Minimum jump distance in fractional pixel coordinates
52  *
53  * \param coveredArea
54  * Approximate fractional image plane area that is
55  * reachable using the lens perturbation
56  */
57  LensPerturbation(const Scene *scene, Sampler *sampler,
58  MemoryPool &pool, Float minJump, Float coveredArea);
59 
60  // =============================================================
61  //! @{ \name Implementation of the Mutator interface
62 
63  EMutationType getType() const;
64  Float suitability(const Path &path) const;
65  bool sampleMutation(Path &source, Path &proposal,
66  MutationRecord &muRec, const MutationRecord& sourceMuRec);
67  Float Q(const Path &source, const Path &proposal,
68  const MutationRecord &muRec) const;
69  void accept(const MutationRecord &muRec);
70 
71  //! @}
72  // =============================================================
73 
75 protected:
76  /// Virtual destructor
77  virtual ~LensPerturbation();
78 protected:
79  ref<const Scene> m_scene;
80  ref<Sampler> m_sampler;
81  MemoryPool &m_pool;
82  Vector2 m_filmRes;
83  Float m_r1, m_r2;
84  Float m_logRatio;
85  Float m_imagePlaneArea;
86 };
87 
89 
90 #endif /*__MITSUBA_BIDIR_MUT_LENS_H_ */
#define MTS_EXPORT_BIDIR
Definition: platform.h:119
Medium-aware mutator base class.
Definition: mutator.h:143
Stores supplemental information about an executed mutation strategy.
Definition: mutator.h:115
virtual void accept(const MutationRecord &muRec)=0
Record an accepted mutation.
Principal scene data structure.
Definition: scene.h:49
Base class of all sample generators.
Definition: sampler.h:66
Bidirectional path data structure.
Definition: path.h:46
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
Veach-style Lens subpath perturbation strategy.
Definition: mut_lens.h:36
virtual Float Q(const Path &source, const Path &proposal, const MutationRecord &muRec) const =0
For a pair of paths, this function computes the inverse transition probability (matching the Q term i...
virtual bool sampleMutation(Path &source, Path &proposal, MutationRecord &muRec, const MutationRecord &sourceMuRec)=0
Given a path, this function produces a new proposal according to the internally implemented mutation ...
virtual EMutationType getType() const =0
What kind of mutations does this mutator perform?
EMutationType
Specifies the type of mutation implemented by the mutator.
Definition: mutator.h:36
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Reference counting helper.
Definition: ref.h:40
virtual Float suitability(const Path &path) const =0
Determine the general &quot;suitability&quot; of this mutator for a given kind of path.
Definition: mempool.h:29
Definition: fwd.h:95
#define MTS_NAMESPACE_END
Definition: platform.h:138