Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
util.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_UTIL_H_)
21 #define __MITSUBA_BIDIR_UTIL_H_
22 
23 #include <mitsuba/bidir/path.h>
24 #include <mitsuba/bidir/rsampler.h>
25 
27 
28 /**
29  * \brief A collection of powerful support functions that can be used to construct
30  * bidirectional rendering algorithms
31  */
33 public:
34  /**
35  * \brief Render the direct illumination component of a scene
36  *
37  * The function is made available here, since it is used
38  * by both Keleman-style and Veach-style MLT.
39  */
40  static ref<Bitmap> renderDirectComponent(Scene *scene, int sceneResID,
41  int sensorResID, RenderQueue *queue, const RenderJob *job,
42  size_t directSamples);
43 
44  /**
45  * \brief Execute the first pass of a 2-pass MLT scheme.
46  *
47  * The function is made available here, since it is used
48  * by both Keleman-style and Veach-style MLT.
49  *
50  * \param scene
51  * Pointer to the underlying scene
52  *
53  * \param sceneResID
54  * Resource ID of the scene (used for executing the first
55  * stage in parallel over multiple machines)
56  *
57  * \param queue
58  * Pointer to the render queue associated with the original job
59  *
60  * \param sizeFactor
61  * Size reduction factor to use when rendering the
62  * luminance image
63  *
64  * \param nestedJob
65  * Reference to a nested render job. Can be used to terminate
66  * the process from another thread
67  */
68  static ref<Bitmap> mltLuminancePass(Scene *scene, int sceneResID,
69  RenderQueue *queue, int sizeFactor, ref<RenderJob> &nestedJob);
70 };
71 
72 /// Restores the measure of a path vertex after going out of scope
75  : vertex(vertex), measure(vertex->measure) { }
76  ~RestoreMeasureHelper() { vertex->measure = measure; }
79 };
80 
82 
83 #endif /* __MITSUBA_BIDIR_UTIL_H_ */
EMeasure measure
Definition: util.h:78
#define MTS_EXPORT_BIDIR
Definition: platform.h:119
Bidirectional path vertex data structure.
Definition: vertex.h:48
Principal scene data structure.
Definition: scene.h:49
Render queue - used to keep track of a number of scenes that are simultaneously being rendered...
Definition: renderqueue.h:65
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
EMeasure
A list of measures that are associated with various sampling methods in Mitsuba.
Definition: common.h:56
A collection of powerful support functions that can be used to construct bidirectional rendering algo...
Definition: util.h:32
~RestoreMeasureHelper()
Definition: util.h:76
Reference counting helper.
Definition: ref.h:40
RestoreMeasureHelper(PathVertex *vertex)
Definition: util.h:74
Coordinates the process of rendering a single image.
Definition: renderjob.h:37
PathVertex * vertex
Definition: util.h:77
#define MTS_NAMESPACE_END
Definition: platform.h:138
Restores the measure of a path vertex after going out of scope.
Definition: util.h:73