SynthesisPipeline.h 935 Bytes
Newer Older
Nianchen Deng's avatar
Nianchen Deng committed
1
#pragma once
Nianchen Deng's avatar
sync    
Nianchen Deng committed
2
#include "../utils/common.h"
Nianchen Deng's avatar
Nianchen Deng committed
3
4
5
6
#include "InferPipeline.h"
#include "View.h"
#include "Enhancement.h"

Nianchen Deng's avatar
sync    
Nianchen Deng committed
7
class SynthesisPipeline {
Nianchen Deng's avatar
Nianchen Deng committed
8
public:
Nianchen Deng's avatar
sync    
Nianchen Deng committed
9
10
    SynthesisPipeline(sptr<Msl> net, sptr<Camera> cam, uint nSamples, glm::vec2 depthRange,
                      int encodeDim, int coordChns, float enhanceSigma, float enhanceFe);
Nianchen Deng's avatar
Nianchen Deng committed
11

Nianchen Deng's avatar
sync    
Nianchen Deng committed
12
    void run(View &view);
Nianchen Deng's avatar
Nianchen Deng committed
13
14
15
16

    GLuint getGlResultTexture(int index);

protected:
Nianchen Deng's avatar
sync    
Nianchen Deng committed
17
18
19
20
21
    uint _nRays;
    uint _nSamples;
    float _enhanceSigma;
    float _enhanceFe;
    sptr<Camera> _cam;
Nianchen Deng's avatar
Nianchen Deng committed
22
    sptr<InferPipeline> _inferPipeline;
Nianchen Deng's avatar
sync    
Nianchen Deng committed
23
    sptr<Enhancement> _enhancement;
Nianchen Deng's avatar
Nianchen Deng committed
24
25
    sptr<CudaArray<glm::vec3>> _rays;
    sptr<CudaArray<glm::vec4>> _colors;
Nianchen Deng's avatar
sync    
Nianchen Deng committed
26
27
    std::vector<GLuint> _glResultTextures;
    GLuint _glResultBuffer;
Nianchen Deng's avatar
Nianchen Deng committed
28

Nianchen Deng's avatar
sync    
Nianchen Deng committed
29
30
31
    void _genRays(View &view);
    void _enhance();
    void _uploadResultToTextures();
Nianchen Deng's avatar
Nianchen Deng committed
32
33
34
35

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