ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ShaderMan.h
Go to the documentation of this file.
1 // 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 //
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"
33 //class ShaderMan
34 //description: pure static class
35 // wrapper of shaders from different GPU languages
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();
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);
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
int width
int size
int height
#define NULL
static void UseShaderDisplayGrad()
Definition: ShaderMan.cpp:224
static void UseShaderGenListHisto()
Definition: ShaderMan.cpp:266
static void UseShaderGenListEnd(int ktex)
Definition: ShaderMan.cpp:287
static void UseShaderZeroPass()
Definition: ShaderMan.cpp:298
static int HaveShaderMan()
Definition: ShaderMan.h:76
static void UseShaderDisplayDOG()
Definition: ShaderMan.cpp:211
static void FilterSampledImage(GLTexImage *tex, GLTexImage *buf)
Definition: ShaderMan.cpp:134
static void FilterInitialImage(GLTexImage *tex, GLTexImage *buf)
Definition: ShaderMan.cpp:129
static void UseShaderRGB2Gray()
Definition: ShaderMan.cpp:218
static void UseShaderDisplayGaussian()
Definition: ShaderMan.cpp:206
static void UseShaderMarginCopy(int xmax, int ymax)
Definition: ShaderMan.cpp:308
static void UseShaderGenListStart(float fw, int tex0)
Definition: ShaderMan.cpp:275
static void UseShaderCopyKeypoint()
Definition: ShaderMan.cpp:314
static void InitShaderMan(SiftParam &param)
Definition: ShaderMan.cpp:48
static void FilterImage(FilterProgram *filter, GLTexImage *dst, GLTexImage *src, GLTexImage *tmp)
Definition: ShaderMan.cpp:76
static void DestroyShaders()
Definition: ShaderMan.cpp:65
static void UnloadProgram()
Definition: ShaderMan.cpp:71
static void TextureCopy(GLTexImage *dst, GLTexImage *src)
Definition: ShaderMan.cpp:139
static void UseShaderGenListInit(int w, int h, int tight=1)
Definition: ShaderMan.cpp:254
static void UseShaderKeypoint(int texU, int texD)
Definition: ShaderMan.cpp:246
static void UseShaderGenVBO(float width, float fwidth, float size)
Definition: ShaderMan.cpp:303
static void TextureUpSample(GLTexImage *dst, GLTexImage *src, int scale)
Definition: ShaderMan.cpp:177
static void SelectInitialSmoothingFilter(int octave_min, SiftParam &param)
Definition: ShaderMan.cpp:346
static void UseShaderDescriptor(int gtex, int otex, int dwidth, int fwidth, int width, int height, float sigma)
Definition: ShaderMan.cpp:340
static void UseShaderGradientPass(int texP=0)
Definition: ShaderMan.cpp:239
static void TextureDownSample(GLTexImage *dst, GLTexImage *src, int scale=2)
Definition: ShaderMan.cpp:155
static void UseShaderOrientation(int gtex, int width, int height, float sigma, int auxtex, float step, int keypoint_list)
Definition: ShaderMan.cpp:327
static void UseShaderDisplayKeypoints()
Definition: ShaderMan.cpp:230
static void UseShaderDebug()
Definition: ShaderMan.cpp:293
static void UseShaderSimpleOrientation(int oTex, float sigma, float sigma_step)
Definition: ShaderMan.cpp:319
static ShaderBag * s_bag
Definition: ShaderMan.h:43
static void UseShaderGenListStep(int tex, int tex0)
Definition: ShaderMan.cpp:281