-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_internal.h
65 lines (49 loc) · 1.14 KB
/
api_internal.h
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
#pragma once
#include "api.h"
#include "core/instantvnr_types.h"
#include "core/network.h"
#include "core/sampler.h"
#include "core/renderer.h"
#include "core/serializer.h"
#include "core/framebuffer.h"
namespace vnr {
using namespace vnr::math;
struct VolumeContext
{
vec3i dims;
ValueType type;
range1f range;
box3f clipbox;
virtual ~VolumeContext() {};
virtual bool isNetwork() const = 0;
};
struct SimpleVolumeContext : VolumeContext
{
SimpleVolume source;
bool isNetwork() const override { return false; };
};
struct NeuralVolumeContext : VolumeContext
{
NeuralVolume neural;
NeuralVolume::Statistics stats;
NeuralVolumeContext(size_t batchsize) : neural(batchsize) {}
bool isNetwork() const override { return true; };
};
struct RenderContext
{
vnrVolume volume;
Camera camera;
TransferFunctionAPI tfn;
RenderAPI render;
// other states
int rendering_mode{ VNR_INVALID };
// volume states
float sampling_rate{ 1.f };
float density_scale{ 1.f };
// framebuffer states
FrameBuffer framebuffer;
cudaStream_t framebuffer_stream{};
vec2i framebuffer_size;
bool framebuffer_reset{ true };
};
}