MCPcopy Create free account
hub / github.com/RenderKit/ospray / readParams

Method readParams

modules/cpu/lights/IntensityDistribution.cpp:9–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace ospray {
8
9void IntensityDistribution::readParams(ISPCDeviceObject &obj)
10{
11 c0 = obj.getParam<vec3f>("c0", c0);
12 lid = obj.getParamDataT<float, 2>("intensityDistribution");
13 if (lid) {
14 if (lid->numItems.z > 1)
15 throw std::runtime_error(obj.toString()
16 + " must have (at most 2D) 'intensityDistribution' array using the first two dimensions.");
17 size = vec2i(lid->numItems.x, lid->numItems.y);
18 if (size.x < 2)
19 throw std::runtime_error(obj.toString()
20 + " 'intensityDistribution' must have data for at least two gamma angles.");
21 if (!lid->compact()) {
22 postStatusMsg(OSP_LOG_WARNING)
23 << obj.toString()
24 << " does currently not support strides for 'intensityDistribution', copying data.";
25
26 const auto data = new Data(obj.getISPCDevice(), OSP_FLOAT, lid->numItems);
27 data->copy(*lid, vec3ui(0));
28 lid = &(data->as<float, 2>());
29 data->refDec();
30 }
31 }
32}
33
34void IntensityDistribution::setSh(ispc::IntensityDistribution &sh) const
35{

Callers 3

commitMethod · 0.45
commitMethod · 0.45
commitMethod · 0.45

Calls 4

postStatusMsgFunction · 0.85
copyMethod · 0.80
toStringMethod · 0.45
compactMethod · 0.45

Tested by

no test coverage detected