9 #include "LumiverseCoreConfig.h"
20 #include "../lib/libjson/libjson.h"
24 struct PhotoLightRecord : SimulationLightRecord {
26 : intensity(0), color(1.f, 1.f, 1.f), photo(NULL), SimulationLightRecord() {}
27 virtual ~PhotoLightRecord() {
30 virtual void init()
override {
31 SimulationLightRecord::init();
36 virtual void clear()
override {
42 Eigen::Vector3f color;
54 class PhotoPatch :
public SimulationPatch
60 PhotoPatch() : m_blend(NULL), m_blend_buffer(NULL),
68 PhotoPatch(
const JSONNode data);
73 virtual ~PhotoPatch();
78 virtual void init()
override;
85 virtual JSONNode toJSON()
override;
92 virtual string getType()
override {
return "PhotoPatch"; }
99 virtual int getWidth() {
return m_width; }
106 virtual int getHeight() {
return m_height; }
113 virtual float *getBufferPointer()
override {
return m_blend; }
128 virtual void updateLight(set<Device *> devices);
135 virtual void loadLight(Device *d_ptr);
141 virtual void loadJSON(
const JSONNode data)
override;
147 virtual bool renderLoop();
149 virtual void bindRenderLoop()
override;
158 bool blendUint8(
float* blended,
unsigned char* light,
float intensity, Eigen::Vector3f color);
160 bool blendFloat(
float* blended,
float* light,
float intensity, Eigen::Vector3f color);
162 float *m_blend_buffer;
void init(const char *jsonPatchStr, const char *filename)
Initializes data structures.
Definition: Dumiverse.cpp:29
int getWidth()
Get the width of the loaded image.
Definition: Dumiverse.cpp:17
int getHeight()
Get the height of the loaded image.
Definition: Dumiverse.cpp:21
Implementation of a patch for Arnold.
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2