FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CubbyFlow/Examples/SmokeSim/main.cpp at main · utilForever/CubbyFlow · GitHub
utilForever
/
CubbyFlow
Public
Notifications
You must be signed in to change notification settings
Fork
38
Star
299
Code
Issues
30
Pull requests
2
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CubbyFlow
/
Examples
/
SmokeSim
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
552 lines (464 loc) · 18.2 KB
Breadcrumbs
CubbyFlow
/
Examples
/
SmokeSim
/
main.cpp
Copy path
File metadata and controls
552 lines (464 loc) · 18.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
//
This code is based on Jet framework.
//
Copyright (c) 2018 Doyub Kim
//
CubbyFlow is voxel-based fluid simulation engine for computer games.
//
Copyright (c) 2020 CubbyFlow Team
//
Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
//
AI Part: Dongheon Cho, Minseo Kim
//
We are making my contributions/submissions to this project solely in our
//
personal capacity and are not conveying any rights to any intellectual
//
property of any third parties.
#
include
<
../ClaraUtils.hpp
>
#
include
<
Core/Array/Array.hpp
>
#
include
<
Core/Emitter/VolumeGridEmitter3.hpp
>
#
include
<
Core/Geometry/Box.hpp
>
#
include
<
Core/Geometry/ImplicitTriangleMesh3.hpp
>
#
include
<
Core/Geometry/RigidBodyCollider.hpp
>
#
include
<
Core/Geometry/Sphere.hpp
>
#
include
<
Core/Geometry/TriangleMesh3.hpp
>
#
include
<
Core/Grid/ScalarGrid.hpp
>
#
include
<
Core/Math/MathUtils.hpp
>
#
include
<
Core/Solver/Advection/CubicSemiLagrangian3.hpp
>
#
include
<
Core/Solver/Advection/SemiLagrangian3.hpp
>
#
include
<
Core/Solver/Grid/GridSmokeSolver3.hpp
>
#
include
<
Core/Utils/Logging.hpp
>
#
include
<
pystring/pystring.h
>
#
include
<
clara.hpp
>
#
ifdef
CUBBYFLOW_WINDOWS
#
include
<
direct.h
>
#
else
#
include
<
sys/stat.h
>
#
endif
#
include
<
array
>
#
include
<
cstring
>
#
include
<
fstream
>
#
include
<
iostream
>
#
include
<
string
>
#
include
<
vector
>
#
define
APP_NAME
"
SmokeSim
"
using
namespace
CubbyFlow
;
const
size_t
EDGE_BLUR
=
3
;
const
float
EDGE_BLUR_F
=
3
.f;
const
double
TGA_SCALE
=
10.0
;
inline
float
SmoothStep
(
float
edge0,
float
edge1,
float
x)
{
const
float
t =
Clamp
((x - edge0) / (edge1 - edge0),
0
.
f
,
1
.
f
);
return
t * t * (
3
.
f
-
2
.
f
* t);
}
//
Export density field to Mitsuba volume file.
void
SaveVolumeAsVol
(
const
ScalarGrid3Ptr& density,
const
std::string& rootDir,
int
frameCnt)
{
char
baseName[
256
];
snprintf
(baseName,
sizeof
(baseName),
"
frame_%06d.vol
"
, frameCnt);
std::string fileName =
pystring::os::path::join
(rootDir, baseName);
std::ofstream
file
(fileName.
c_str
(), std::ofstream::binary);
if
(file)
{
printf
(
"
Writing %s...
\n
"
, fileName.
c_str
());
//
Mitsuba 0.5.0 grid-volume format
char
header[
48
];
memset
(header,
0
,
sizeof
(header));
header[
0
] =
'
V
'
;
header[
1
] =
'
O
'
;
header[
2
] =
'
L
'
;
header[
3
] =
3
;
const
std::array<
int32_t
,
5
> encoding = {
1
,
//
32-bit float
static_cast
<
int32_t
>(density->
DataSize
().
x
),
static_cast
<
int32_t
>(density->
DataSize
().
y
),
static_cast
<
int32_t
>(density->
DataSize
().
z
),
1
//
number of channels
};
std::memcpy
(header +
4
, encoding.
data
(),
sizeof
(encoding));
const
BoundingBox3D domain = density->
GetBoundingBox
();
const
std::array<
float
,
6
> bbox = {
static_cast
<
float
>(domain.
lowerCorner
.
x
),
static_cast
<
float
>(domain.
lowerCorner
.
y
),
static_cast
<
float
>(domain.
lowerCorner
.
z
),
static_cast
<
float
>(domain.
upperCorner
.
x
),
static_cast
<
float
>(domain.
upperCorner
.
y
),
static_cast
<
float
>(domain.
upperCorner
.
z
)
};
std::memcpy
(header +
4
+
sizeof
(encoding), bbox.
data
(),
sizeof
(bbox));
file.
write
(header,
sizeof
(header));
Array3<
float
>
data
(density->
DataSize
());
ParallelForEachIndex
(data.
Size
(), [&](
size_t
i,
size_t
j,
size_t
k) {
float
d =
static_cast
<
float
>((*density)(i, j, k));
//
Blur the edge for less-noisy rendering
if
(i <
EDGE_BLUR
)
{
d *=
SmoothStep
(
0
.
f
,
EDGE_BLUR_F
,
static_cast
<
float
>(i));
}
if
(i > data.
Size
().
x
-
1
-
EDGE_BLUR
)
{
d *=
SmoothStep
(
0
.
f
,
EDGE_BLUR_F
,
static_cast
<
float
>((data.
Size
().
x
-
1
) - i));
}
if
(j <
EDGE_BLUR
)
{
d *=
SmoothStep
(
0
.
f
,
EDGE_BLUR_F
,
static_cast
<
float
>(j));
}
if
(j > data.
Size
().
y
-
1
-
EDGE_BLUR
)
{
d *=
SmoothStep
(
0
.
f
,
EDGE_BLUR_F
,
static_cast
<
float
>((data.
Size
().
y
-
1
) - j));
}
if
(k <
EDGE_BLUR
)
{
d *=
SmoothStep
(
0
.
f
,
EDGE_BLUR_F
,
static_cast
<
float
>(k));
}
if
(k > data.
Size
().
z
-
1
-
EDGE_BLUR
)
{
d *=
SmoothStep
(
0
.
f
,
EDGE_BLUR_F
,
static_cast
<
float
>((data.
Size
().
z
-
1
) - k));
}
data
(i, j, k) = d;
});
file.
write
(
reinterpret_cast
<
const
char
*>(data.
data
()),
sizeof
(
float
) * data.
Size
().
x
* data.
Size
().
y
* data.
Size
().
z
);
file.
close
();
}
}
void
SaveVolumeAsTga
(
const
ScalarGrid3Ptr& density,
const
std::string& rootDir,
int
frameCnt)
{
char
baseName[
256
];
snprintf
(baseName,
sizeof
(baseName),
"
frame_%06d.tga
"
, frameCnt);
std::string fileName =
pystring::os::path::join
(rootDir, baseName);
std::ofstream
file
(fileName.
c_str
(), std::ofstream::binary);
if
(file)
{
printf
(
"
Writing %s...
\n
"
, fileName.
c_str
());
Vector3UZ dataSize = density->
DataSize
();
std::array<
char
,
18
> header;
header.
fill
(
0
);
const
int
imgWidth =
static_cast
<
int
>(dataSize.
x
);
const
int
imgHeight =
static_cast
<
int
>(dataSize.
y
);
header[
2
] =
2
;
header[
12
] =
static_cast
<
char
>(imgWidth &
0xff
);
header[
13
] =
static_cast
<
char
>((imgWidth &
0xff00
) >>
8
);
header[
14
] =
static_cast
<
char
>(imgHeight &
0xff
);
header[
15
] =
static_cast
<
char
>((imgHeight &
0xff00
) >>
8
);
header[
16
] =
24
;
file.
write
(header.
data
(), header.
size
());
Array2<
double
>
hdrImg
(dataSize.
x
, dataSize.
y
);
ParallelForEachIndex
(hdrImg.
Size
(), [&](
size_t
i,
size_t
j) {
double
sum =
0.0
;
for
(
size_t
k =
0
; k < dataSize.
z
; ++k)
{
sum += (*density)(i, j, k);
}
hdrImg
(i, j) =
TGA_SCALE
* sum /
static_cast
<
double
>(dataSize.
z
);
});
std::vector<
char
>
img
(
3
* dataSize.
x
* dataSize.
y
);
for
(
size_t
i =
0
; i < dataSize.
x
* dataSize.
y
; ++i)
{
const
char
val =
static_cast
<
char
>(
Clamp
(hdrImg[i],
0.0
,
1.0
) *
255.0
);
img[
3
* i +
0
] = val;
img[
3
* i +
1
] = val;
img[
3
* i +
2
] = val;
}
file.
write
(img.
data
(), img.
size
());
file.
close
();
}
}
void
PrintInfo
(
const
GridSmokeSolver3Ptr& solver)
{
const
auto
grids = solver->
GetGridSystemData
();
const
Vector3UZ resolution = grids->
Resolution
();
const
BoundingBox3D domain = grids->
GetBoundingBox
();
const
Vector3D gridSpacing = grids->
GridSpacing
();
printf
(
"
Resolution: %zu x %zu x %zu
\n
"
, resolution.
x
, resolution.
y
,
resolution.
z
);
printf
(
"
Domain: [%f, %f, %f] x [%f, %f, %f]
\n
"
, domain.
lowerCorner
.
x
,
domain.
lowerCorner
.
y
, domain.
lowerCorner
.
z
, domain.
upperCorner
.
x
,
domain.
upperCorner
.
y
, domain.
upperCorner
.
z
);
printf
(
"
Grid spacing: [%f, %f, %f]
\n
"
, gridSpacing.
x
, gridSpacing.
y
,
gridSpacing.
z
);
}
void
RunSimulation
(
const
std::string& rootDir,
const
GridSmokeSolver3Ptr& solver,
int
numberOfFrames,
const
std::string& format,
double
fps)
{
const
auto
density = solver->
GetSmokeDensity
();
for
(Frame
frame
(
0
,
1.0
/ fps); frame.
index
< numberOfFrames; ++frame)
{
solver->
Update
(frame);
if
(format ==
"
vol
"
)
{
SaveVolumeAsVol
(density, rootDir, frame.
index
);
}
else
if
(format ==
"
tga
"
)
{
SaveVolumeAsTga
(density, rootDir, frame.
index
);
}
}
}
void
RunExample1
(
const
std::string& rootDir,
size_t
resolutionX,
int
numberOfFrames,
const
std::string& format,
double
fps)
{
//
Build solver
auto
solver =
GridSmokeSolver3::Builder
()
.
WithResolution
({ resolutionX,
2
* resolutionX, resolutionX })
.
WithDomainSizeX
(
1.0
)
.
MakeShared
();
solver->
SetAdvectionSolver
(std::make_shared<CubicSemiLagrangian3>());
const
auto
grids = solver->
GetGridSystemData
();
BoundingBox3D domain = grids->
GetBoundingBox
();
//
Build emitter
const
auto
box =
Box3::Builder
()
.
WithLowerCorner
({
0.45
, -
1
,
0.45
})
.
WithUpperCorner
({
0.55
,
0.05
,
0.55
})
.
MakeShared
();
auto
emitter =
VolumeGridEmitter3::Builder
()
.
WithSourceRegion
(box)
.
WithIsOneShot
(
false
)
.
MakeShared
();
solver->
SetEmitter
(emitter);
emitter->
AddStepFunctionTarget
(solver->
GetSmokeDensity
(),
0
,
1
);
emitter->
AddStepFunctionTarget
(solver->
GetTemperature
(),
0
,
1
);
//
Build collider
const
auto
sphere =
Sphere3::Builder
()
.
WithCenter
({
0.5
,
0.3
,
0.5
})
.
WithRadius
(
0.075
* domain.
Width
())
.
MakeShared
();
const
auto
collider =
RigidBodyCollider3::Builder
().
WithSurface
(sphere).
MakeShared
();
solver->
SetCollider
(collider);
//
Print simulation info
printf
(
"
Running example 1 (rising smoke with cubic-spline advection)
\n
"
);
PrintInfo
(solver);
//
Run simulation
RunSimulation
(rootDir, solver, numberOfFrames, format, fps);
}
void
RunExample2
(
const
std::string& rootDir,
size_t
resolutionX,
int
numberOfFrames,
const
std::string& format,
double
fps)
{
//
Build solver
auto
solver =
GridSmokeSolver3::Builder
()
.
WithResolution
({ resolutionX,
2
* resolutionX, resolutionX })
.
WithDomainSizeX
(
1.0
)
.
MakeShared
();
solver->
SetAdvectionSolver
(std::make_shared<SemiLagrangian3>());
const
auto
grids = solver->
GetGridSystemData
();
BoundingBox3D domain = grids->
GetBoundingBox
();
//
Build emitter
const
auto
box =
Box3::Builder
()
.
WithLowerCorner
({
0.45
, -
1
,
0.45
})
.
WithUpperCorner
({
0.55
,
0.05
,
0.55
})
.
MakeShared
();
auto
emitter =
VolumeGridEmitter3::Builder
()
.
WithSourceRegion
(box)
.
WithIsOneShot
(
false
)
.
MakeShared
();
solver->
SetEmitter
(emitter);
emitter->
AddStepFunctionTarget
(solver->
GetSmokeDensity
(),
0
,
1
);
emitter->
AddStepFunctionTarget
(solver->
GetTemperature
(),
0
,
1
);
//
Build collider
const
auto
sphere =
Sphere3::Builder
()
.
WithCenter
({
0.5
,
0.3
,
0.5
})
.
WithRadius
(
0.075
* domain.
Width
())
.
MakeShared
();
const
auto
collider =
RigidBodyCollider3::Builder
().
WithSurface
(sphere).
MakeShared
();
solver->
SetCollider
(collider);
//
Print simulation info
printf
(
"
Running example 2 (rising smoke with linear advection)
\n
"
);
PrintInfo
(solver);
//
Run simulation
RunSimulation
(rootDir, solver, numberOfFrames, format, fps);
}
void
RunExample3
(
const
std::string& rootDir,
size_t
resolutionX,
int
numberOfFrames,
const
std::string& format,
double
fps)
{
//
Build solver
auto
solver =
GridSmokeSolver3::Builder
()
.
WithResolution
(
{ resolutionX, resolutionX /
4
*
5
, resolutionX /
2
})
.
WithDomainSizeX
(
2.0
)
.
WithOrigin
({ -
1
, -
0.15
, -
0.5
})
.
MakeShared
();
//
Build emitter
auto
dragonMesh =
TriangleMesh3::Builder
().
MakeShared
();
std::ifstream
objFile
(
RESOURCES_DIR
"
/dragon.obj
"
);
if
(objFile)
{
[[maybe_unused]]
bool
isLoaded = dragonMesh->
ReadObj
(&objFile);
}
else
{
fprintf
(stderr,
"
Cannot open Resources/dragon.obj
\n
"
);
exit
(
EXIT_FAILURE
);
}
const
auto
dragon =
ImplicitTriangleMesh3::Builder
()
.
WithTriangleMesh
(dragonMesh)
.
WithResolutionX
(resolutionX)
.
MakeShared
();
auto
emitter =
VolumeGridEmitter3::Builder
()
.
WithSourceRegion
(dragon)
.
WithIsOneShot
(
false
)
.
MakeShared
();
solver->
SetEmitter
(emitter);
emitter->
AddStepFunctionTarget
(solver->
GetSmokeDensity
(),
0
,
1
);
emitter->
AddStepFunctionTarget
(solver->
GetTemperature
(),
0
,
1
);
//
Print simulation info
printf
(
"
Running example 3 (rising dragon)
\n
"
);
PrintInfo
(solver);
//
Run simulation
RunSimulation
(rootDir, solver, numberOfFrames, format, fps);
}
void
RunExample4
(
const
std::string& rootDir,
size_t
resolutionX,
int
numberOfFrames,
const
std::string& format,
double
fps)
{
//
Build solver
auto
solver =
GridSmokeSolver3::Builder
()
.
WithResolution
(
{ resolutionX,
6
* resolutionX /
5
, resolutionX /
2
})
.
WithDomainSizeX
(
1.0
)
.
MakeShared
();
solver->
SetBuoyancyTemperatureFactor
(
2.0
);
//
Build emitter
const
auto
box =
Box3::Builder
()
.
WithLowerCorner
({
0.05
,
0.1
,
0.225
})
.
WithUpperCorner
({
0.1
,
0.15
,
0.275
})
.
MakeShared
();
auto
emitter =
VolumeGridEmitter3::Builder
()
.
WithSourceRegion
(box)
.
WithIsOneShot
(
false
)
.
MakeShared
();
solver->
SetEmitter
(emitter);
emitter->
AddStepFunctionTarget
(solver->
GetSmokeDensity
(),
0
,
1
);
emitter->
AddStepFunctionTarget
(solver->
GetTemperature
(),
0
,
1
);
emitter->
AddTarget
(solver->
GetVelocity
(),
[](
double
sdf,
const
Vector3D&,
const
Vector3D& oldVal) {
if
(sdf <
0.05
)
{
return
Vector3D
(
0.5
, oldVal.
y
, oldVal.
z
);
}
else
{
return
Vector3D
(oldVal);
}
});
//
Print simulation info
printf
(
"
Running example 4 (rising smoke with cubic-spline advection)
\n
"
);
PrintInfo
(solver);
//
Run simulation
RunSimulation
(rootDir, solver, numberOfFrames, format, fps);
}
void
RunExample5
(
const
std::string& rootDir,
size_t
resolutionX,
int
numberOfFrames,
const
std::string& format,
double
fps)
{
//
Build solver
auto
solver =
GridSmokeSolver3::Builder
()
.
WithResolution
(
{ resolutionX,
6
* resolutionX /
5
, resolutionX /
2
})
.
WithDomainSizeX
(
1.0
)
.
MakeShared
();
solver->
SetBuoyancyTemperatureFactor
(
2.0
);
solver->
SetAdvectionSolver
(std::make_shared<SemiLagrangian3>());
//
Build emitter
const
auto
box =
Box3::Builder
()
.
WithLowerCorner
({
0.05
,
0.1
,
0.225
})
.
WithUpperCorner
({
0.1
,
0.15
,
0.275
})
.
MakeShared
();
auto
emitter =
VolumeGridEmitter3::Builder
()
.
WithSourceRegion
(box)
.
WithIsOneShot
(
false
)
.
MakeShared
();
solver->
SetEmitter
(emitter);
emitter->
AddStepFunctionTarget
(solver->
GetSmokeDensity
(),
0
,
1
);
emitter->
AddStepFunctionTarget
(solver->
GetTemperature
(),
0
,
1
);
emitter->
AddTarget
(solver->
GetVelocity
(), [](
double
sdf,
const
Vector3D& pt,
const
Vector3D& oldVal) {
UNUSED_VARIABLE
(pt);
if
(sdf <
0.05
)
{
return
Vector3D
(
0.5
, oldVal.
y
, oldVal.
z
);
}
else
{
return
Vector3D
(oldVal);
}
});
//
Print simulation info
printf
(
"
Running example 5 (rising smoke with linear advection)
\n
"
);
PrintInfo
(solver);
//
Run simulation
RunSimulation
(rootDir, solver, numberOfFrames, format, fps);
}
int
main
(
int
argc,
char
* argv[])
{
bool
showHelp =
false
;
size_t
resX =
50
;
int
numberOfFrames =
100
;
double
fps =
60.0
;
int
exampleNum =
1
;
std::string logFileName =
APP_NAME
"
.log
"
;
std::string outputDir =
APP_NAME
"
_output
"
;
std::string format =
"
tga
"
;
//
Parsing
auto
parser =
clara::Help
(showHelp) |
clara::Opt
(resX,
"
resX
"
)[
"
-r
"
][
"
--resx
"
](
"
grid resolution in x-axis (default is 50)
"
) |
clara::Opt
(numberOfFrames,
"
numberOfFrames
"
)[
"
-f
"
][
"
--frames
"
](
"
total number of frames (default is 100)
"
) |
clara::Opt
(
fps,
"
fps
"
)[
"
-p
"
][
"
--fps
"
](
"
frames per second (default is 60.0)
"
) |
clara::Opt
(exampleNum,
"
exampleNum
"
)[
"
-e
"
][
"
--example
"
](
"
example number (between 1 and 5, default is 1)
"
) |
clara::Opt
(logFileName,
"
logFileName
"
)[
"
-l
"
][
"
--log
"
](
"
log file name (default is
"
APP_NAME
"
.log)
"
) |
clara::Opt
(outputDir,
"
outputDir
"
)[
"
-o
"
][
"
--output
"
](
"
output directory name (default is
"
APP_NAME
"
_output)
"
) |
clara::Opt
(format,
"
format
"
)[
"
-m
"
][
"
--format
"
](
"
particle output format (tag or vol. default is tag)
"
);
auto
result = parser.
parse
(
clara::Args
(argc, argv));
if
(!result)
{
std::cerr <<
"
Error in command line:
"
<< result.
errorMessage
() <<
'
\n
'
;
exit
(
EXIT_FAILURE
);
}
if
(showHelp)
{
std::cout <<
ToString
(parser) <<
'
\n
'
;
exit
(
EXIT_SUCCESS
);
}
#
ifdef
CUBBYFLOW_WINDOWS
_mkdir
(outputDir.
c_str
());
#
else
mkdir
(outputDir.
c_str
(),
S_IRWXU
|
S_IRWXG
|
S_IRWXO
);
#
endif
std::ofstream
logFile
(logFileName.
c_str
());
if
(logFile)
{
Logging::SetAllStream
(&logFile);
}
switch
(exampleNum)
{
case
1
:
RunExample1
(outputDir, resX, numberOfFrames, format, fps);
break
;
case
2
:
RunExample2
(outputDir, resX, numberOfFrames, format, fps);
break
;
case
3
:
RunExample3
(outputDir, resX, numberOfFrames, format, fps);
break
;
case
4
:
RunExample4
(outputDir, resX, numberOfFrames, format, fps);
break
;
case
5
:
RunExample5
(outputDir, resX, numberOfFrames, format, fps);
break
;
default
:
std::cout <<
ToString
(parser) <<
'
\n
'
;
exit
(
EXIT_FAILURE
);
}
return
EXIT_SUCCESS
;
}
Back
|
FazBrowse Home
|
New Git URL