Lumiverse  2.5
A framework for creating lighting control applications
DistributedCachingArnoldInterface.h
Go to the documentation of this file.
1 
7 #ifndef _Arnold_DISTRIBUTED_CACHE_INTERFACE_H_
8 #define _Arnold_DISTRIBUTED_CACHE_INTERFACE_H_
9 
10 #pragma once
11 
12 #include "LumiverseCoreConfig.h"
13 
14 #ifdef USE_ARNOLD
15 
16 #ifdef USE_DUMIVERSE
17 
18 #ifdef USE_ARNOLD_CACHING
19 
20 #include "ArnoldInterface.h"
21 #include <ai.h>
22 #include "ArnoldParameterVector.h"
23 #include "Compositor.h"
24 #include "ToneMapper.h"
25 #include "EXRLayer.h"
26 #include <thread>
27 #include <algorithm>
28 #include <unordered_map>
29 #include <set>
30 #include "CachingArnoldInterface.h"
31 #include "DistributedArnoldInterface.h"
32 
33 namespace Lumiverse {
34 
35  class DistributedCachingArnoldInterface : public DistributedArnoldInterface, public CachingArnoldInterface
36  {
37  public:
38  DistributedCachingArnoldInterface(string host, int port, string outputPath) : DistributedArnoldInterface(host, port, outputPath) {}
39 
45  void init(const JSONNode jsonPatch) override;
46 
50  void close() override;
51 
56  int render(const std::set<Device *> &devices);
57 
61  bool setDims(int w, int h) override;
62 
63  virtual float getPercentage() override {
65  }
66 
74  void setSamples(int samples) override;
75 
79  void setOptionParameter(const std::string &paramName, int val) override;
80  void setOptionParameter(const std::string &paramName, float val) override;
81 
82  float *getBufferPointer() override;
83 
84  protected:
85  Compositor compositor;
86 
87  void dumpHDRToBuffer(const std::set<Device *> &devices);
88  void updateDevicesLayers(const std::set<Device *> &devices) override;
89  void setHDROutputBuffer() override;
90  };
91 }
92 
93 #endif // USE_ARNOLD_CACHING
94 
95 #endif // USE_DUMIVERSE
96 
97 #endif // USE_ARNOLD
98 
99 #endif // _Arnold_CACHE_INTERFACE_H_
void render()
Render a frame and pass it back to node.
Definition: Dumiverse.cpp:43
void close()
Close the connection to node.
Definition: Dumiverse.cpp:37
void init(const char *jsonPatchStr, const char *filename)
Initializes data structures.
Definition: Dumiverse.cpp:29
float getPercentage()
Gets the progress of current frame as a percentage.
Definition: Dumiverse.cpp:25
An interface for serving cached Arnold render responses.
Stores a vector used by ArnoldPatch.
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
Implementation of a interface between ArnoldPatch and arnold.