6 #include "GLUTImageViewers.h"
11 #include "Rippling0Provider.h"
12 #include "RipplingProvider.h"
13 #include "FractalProvider.h"
14 #include "NewtonProvider.h"
15 #include "HeatTransfertProvider.h"
16 #include "RayTracingProvider.h"
17 #include "ConvolutionProvider.h"
21 int mainGL(const vector
<string
>& args
)
23 const string defaultCommand
= "raytracing";
24 const string command
= args
.size() > 0 ? args
[0] : defaultCommand
;
26 // AutoViewer<Rippling0Image, Rippling0Provider> rippling0(true, true, 10, 10); // Warmup.
28 if (command
== "rippling")
30 AutoViewer
<Image
, RipplingProvider
> rippling(true, true, 10, 10);
32 else if (command
== "mandelbrot")
34 const bool multiGPU
= args
.size() >= 2 && args
[1] == "--mp";
35 Viewer
<ImageFonctionel
> fractalMandelbrot(MandelbrotProvider::createGL(multiGPU
), true, true, 10, 10);
37 else if (command
== "julia")
38 AutoViewer
<ImageFonctionel
, JuliaProvider
> fractalJulia(true, true, 10, 10);
39 else if (command
== "newton")
40 AutoViewer
<ImageFonctionel
, NewtonProvider
> newtown(true, true, 10, 10);
41 else if (command
== "heat-transfert")
42 AutoViewer
<Image
, HeatTransfertProvider
> heatTransfert(true, false, 10, 10);
43 else if (command
== "raytracing")
44 AutoViewer
<Image
, RayTracingProvider
> rayTracing(true, true, 20, 20);
45 else if (command
== "convolution")
47 const string videoPath
= args
.size() >= 2 ? args
[1] : "/media/Data/Video/nasaFHD_short.avi"; // Vidéo par défaut si pas donnée en paramètre.
48 Viewer
<Image
> convolution(ConvolutionProvider::createGL(videoPath
), true, true, 10, 10);
50 else if (command
== "demo")
52 Viewer
<Image
> convolution(ConvolutionProvider::createGL("/media/Data/Video/nasaFHD_short.avi"), true, true, 10, 10, false);
53 AutoViewer
<Image
, RipplingProvider
> rippling(true, true, 60, 30, false);
54 Viewer
<ImageFonctionel
> fractalMandelbrot(MandelbrotProvider::createGL(false), true, true, 120, 60, false);
55 AutoViewer
<ImageFonctionel
, JuliaProvider
> fractalJulia(true, true, 180, 80, false);
56 AutoViewer
<ImageFonctionel
, NewtonProvider
> newtown(true, true, 260, 120, false);
57 AutoViewer
<Image
, HeatTransfertProvider
> heatTransfert(true, false, 1200, 300, false);
58 GLUTImageViewers::runALL();
62 cout
<< "Command unknown: " << command
<< endl
;