Statistics
| Branch: | Revision:

root / rgbdslam / external / siftgpu / src / SiftGPU / ShaderMan.h @ 9240aaa3

History | View | Annotate | Download (3.23 KB)

1
////////////////////////////////////////////////////////////////////////////
2
//        File:                ShaderMan.h
3
//        Author:                Changchang Wu
4
//        Description : interface for the ShaderMan class.
5
//                        This is a class that manages all the shaders for SIFT
6
//
7
//
8
//        Copyright (c) 2007 University of North Carolina at Chapel Hill
9
//        All Rights Reserved
10
//
11
//        Permission to use, copy, modify and distribute this software and its
12
//        documentation for educational, research and non-profit purposes, without
13
//        fee, and without a written agreement is hereby granted, provided that the
14
//        above copyright notice and the following paragraph appear in all copies.
15
//        
16
//        The University of North Carolina at Chapel Hill make no representations
17
//        about the suitability of this software for any purpose. It is provided
18
//        'as is' without express or implied warranty. 
19
//
20
//        Please send BUG REPORTS to ccwu@cs.unc.edu
21
//
22
////////////////////////////////////////////////////////////////////////////
23

    
24

    
25

    
26
#ifndef _SIFT_SHADER_MAN_H
27
#define _SIFT_SHADER_MAN_H
28

    
29

    
30
#include "ProgramGPU.h"
31
#include "ProgramGLSL.h"
32
///////////////////////////////////////////////////////////////////
33
//class ShaderMan
34
//description:        pure static class
35
//                                wrapper of shaders from different GPU languages
36
///////////////////////////////////////////////////////////////////
37
class SiftParam;
38
class FilterGLSL;
39

    
40
class ShaderMan
41
{
42
public:
43
        static ShaderBag*   s_bag;
44
public:
45
        static void SelectInitialSmoothingFilter(int octave_min, SiftParam&param); 
46
        static void UseShaderMarginCopy(int xmax, int ymax);
47
        static void UseShaderOrientation(int gtex, int width, int height, float sigma, int auxtex, float step, int keypoint_list);
48
        static void UseShaderDescriptor(int gtex, int otex, int dwidth, int fwidth, int width, int height, float sigma);
49
        static void UseShaderSimpleOrientation(int oTex, float sigma, float sigma_step);
50
        static void UseShaderCopyKeypoint();
51
        static void UseShaderGenVBO( float width, float fwidth,  float size);
52
        static void UseShaderDebug();
53
        static void UseShaderZeroPass();
54
        static void UseShaderGenListStart(float fw, int tex0);
55
        static void UseShaderGenListStep(int tex, int tex0);
56
        static void UseShaderGenListEnd(int ktex);
57
        static void UseShaderGenListHisto();
58
        static void UseShaderGenListInit(int w, int h, int tight = 1);
59
        static void UseShaderKeypoint(int texU, int texD);
60
        static void UseShaderGradientPass(int texP = 0);
61
        static void UseShaderDisplayKeypoints();
62
        static void UseShaderDisplayGrad();
63
        static void UseShaderRGB2Gray();
64
        static void UseShaderDisplayDOG();
65
        static void UseShaderDisplayGaussian();
66
    ///////////////////////////////////////////
67
    static void FilterInitialImage(GLTexImage* tex, GLTexImage* buf);
68
    static void FilterSampledImage(GLTexImage* tex, GLTexImage* buf);
69
    static void FilterImage(FilterProgram* filter, GLTexImage *dst, GLTexImage *src, GLTexImage*tmp);
70
        static void TextureCopy(GLTexImage*dst, GLTexImage*src);
71
        static void TextureDownSample(GLTexImage* dst, GLTexImage*src, int scale = 2);
72
        static void TextureUpSample(GLTexImage* dst, GLTexImage*src, int scale);
73
        ///////////////////////////////////////////////
74
        static void InitShaderMan(SiftParam&param);
75
        static void DestroyShaders();
76
        static int  HaveShaderMan(){return s_bag != NULL;}
77
        static void UnloadProgram();
78
};
79

    
80
#endif