SynthesisPipeline.h 1000 Bytes
Newer Older
Nianchen Deng's avatar
Nianchen Deng committed
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
#pragma once
#include "../utils/common.h"
#include "InferPipeline.h"
#include "View.h"
#include "Enhancement.h"

class SynthesisPipeline {
public:
    SynthesisPipeline(sptr<Msl> net, sptr<Camera> cam, uint nSamples, glm::vec2 depthRange,
                      int encodeDim, int coordChns, float enhanceSigma, float enhanceFe);

    void getRays(sptr<CudaArray<glm::vec3>> o_rays, View& view);
    void run(View &view);

    GLuint getGlResultTexture(int index);

protected:
    uint _nRays;
    uint _nSamples;
    float _enhanceSigma;
    float _enhanceFe;
    sptr<Camera> _cam;
    sptr<InferPipeline> _inferPipeline;
    sptr<Enhancement> _enhancement;
    sptr<CudaArray<glm::vec3>> _rays;
    sptr<CudaArray<glm::vec4>> _colors;
    std::vector<GLuint> _glResultTextures;
    GLuint _glResultBuffer;

    void _genRays(View &view);
    void _enhance();
    void _uploadResultToTextures();

    GLuint _createGlResultTexture(glm::uvec2 res);
    GLuint _createGlResultBuffer(uint elements);
};