Cogs.Core
CaptureComponent.cpp
1#include "CaptureComponent.h"
2
3#include "Types.h"
4
5using namespace Cogs::Reflection;
6
7void Cogs::Core::CaptureComponent::registerType()
8{
9 static constexpr EnumeratorDef captureSceneModeEnum[] = {
10 { "Forward", CaptureSceneMode::Forward },
11 { "ForwardHdr", CaptureSceneMode::ForwardHdr },
12 { "DeferredCausticsHdr", CaptureSceneMode::DeferredCausticsHdr },
13 };
14 TypeDatabase::createType<CaptureSceneMode>().setEnumerators(captureSceneModeEnum);
15
16 static constexpr EnumeratorDef captureModeEnums[] = {
17 { "Off", CaptureMode::Off },
18 { "Scene", CaptureMode::Scene },
19 { "ObjectId", CaptureMode::ObjectId },
20 { "ObjectIdColorize", CaptureMode::ObjectIdColorize },
21 { "Normals", CaptureMode::Normals },
22 { "Depth", CaptureMode::Depth },
23 };
24 TypeDatabase::createType<CaptureMode>().setEnumerators(captureModeEnums);
25
26 static constexpr EnumeratorDef captureFormatEnums[] = {
27 { "PNG", CaptureFormat::PNG },
28 { "RawARGB", CaptureFormat::RawARGB },
29 { "RawFloat", CaptureFormat::RawFloat },
30 };
31 TypeDatabase::createType<CaptureFormat>().setEnumerators(captureFormatEnums);
32
33 Field fields[] = {
36#if 0
37 Field(Name("size"), &CaptureComponent::size),
38#endif
40 Field(Name("framesToCapture"), &CaptureComponent::framesToCapture),
42 Field(Name("recordToDisc"), &CaptureComponent::recordToDisc),
44 };
45
46 TypeDatabase::createType<CaptureComponent>()
47 .setBase<Component>()
48 .setFields(fields);
49}
Field definition describing a single data member of a data structure.
Definition: Field.h:68
@ PNG
Encode capture image as a PNG image.
@ RawARGB
Store image as a blob of raw bytes in ARGB order.
@ RawFloat
Store image as a blob of raw float values (in host byte order).
@ ObjectId
Render object ids.
@ Normals
Render world-space surface normals.
@ ObjectIdColorize
Render object ids, colorized for visualization.
@ Depth
Render world-space distance from eye, scaled by 1/100 (so a value of 1 equals a distance of 100 units...
@ Scene
Render in normal scene mode,.
@ Off
Disable capture and camera, consume no rendering resources.
@ Forward
Normal forward rendering.
@ DeferredCausticsHdr
Deferred rendering with support for caustics and HDR post-processing.
@ ForwardHdr
Normal forward rendering with HDR post-proessing (exposure, bloom, tonemapping)
Contains reflection support.
Definition: Component.h:11
bool recordToDisc
Write capture frames to disc.
std::string recordPath
Path to directory where captured frames are stored.
int framesToCapture
Enable capture for the given number of frames.
bool dropFrames
Allow capture to drop frames.
CaptureMode mode
Specify type of capture.
CaptureSceneMode sceneMode
Specify rendering mode when mode is scene.
CaptureFormat format
Specifices the format of the captured data.
Represents an unique name.
Definition: Name.h:70