Photon Engine
2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
RuntimeSampleSource.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
EngineEnv/SampleSource/SampleSource.h
"
4
#include "
SDL/sdl_interface.h
"
5
6
#include <Common/assertion.h>
7
#include <Common/primitive_type.h>
8
9
#include <cstddef>
10
11
namespace
ph
12
{
13
14
// TODO: cached samples
15
16
class
RuntimeSampleSource
:
public
SampleSource
17
{
18
public
:
19
void
cook
(
const
CoreCookingContext
& ctx,
CoreCookedUnit
& cooked)
override
= 0;
20
21
std::size_t
getNumSamples
()
const
;
22
23
private
:
24
std::size_t m_numSamples;
25
26
public
:
27
PH_DEFINE_SDL_CLASS
(
TSdlOwnerClass<RuntimeSampleSource>
)
28
{
29
ClassType clazz(
"runtime"
);
30
clazz.docName(
"Runtime Sample Source"
);
31
clazz.description(
32
"Sample sources that generate samples during render engine execution time."
);
33
clazz.baseOn<
SampleSource
>();
34
35
TSdlSize<OwnerType>
numSamples(
"samples"
, &OwnerType::m_numSamples);
36
numSamples.description(
37
"Number of samples that will be generated. This is the number of samples "
38
"that each data unit (such as a single pixel) will receive, on average."
);
39
numSamples.defaultTo(1);
40
numSamples.required();
41
clazz.addField(numSamples);
42
43
return
clazz;
44
}
45
};
46
47
// In-header Implementations:
48
49
inline
std::size_t
RuntimeSampleSource::getNumSamples
()
const
50
{
51
return
m_numSamples;
52
}
53
54
}
// end namespace ph
SampleSource.h
ph::CoreCookedUnit
Definition
CoreCookedUnit.h:19
ph::CoreCookingContext
Definition
CoreCookingContext.h:15
ph::RuntimeSampleSource
Definition
RuntimeSampleSource.h:17
ph::RuntimeSampleSource::PH_DEFINE_SDL_CLASS
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< RuntimeSampleSource >)
Definition
RuntimeSampleSource.h:27
ph::RuntimeSampleSource::cook
void cook(const CoreCookingContext &ctx, CoreCookedUnit &cooked) override=0
ph::RuntimeSampleSource::getNumSamples
std::size_t getNumSamples() const
Definition
RuntimeSampleSource.h:49
ph::SampleSource
Definition
SampleSource.h:10
ph::TSdlInteger
A field class that binds a integral member variable.
Definition
TSdlInteger.h:21
ph::TSdlOwnerClass
SDL binding type for a canonical SDL resource class.
Definition
TSdlOwnerClass.h:23
ph
The root for all renderer implementations.
Definition
EEngineProject.h:6
sdl_interface.h
Source
EngineEnv
SampleSource
RuntimeSampleSource.h
Generated by
1.11.0