OTB  6.7.0
Orfeo Toolbox
otbFragmentShaderRegistry.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otb_FragmentShaderRegistry_h
22 #define otb_FragmentShaderRegistry_h
23 
24 #include "itkObject.h"
25 #include "itkObjectFactory.h"
26 
27 namespace otb
28 {
29 
31  : public itk::Object
32 {
33 public:
38 
39  static Pointer Instance();
40 
41  void RegisterShader(const std::string& name, const std::string& source);
42 
43  bool UnregisterShader(const std::string& name);
44 
45  bool IsShaderRegistered(const std::string& name) const;
46 
47  bool LoadShader(const std::string& name);
48 
49  void UnloadShader();
50 
51  void ClearShaders();
52 
53  unsigned int GetShaderProgram(const std::string& name);
54 
55 protected:
57 
58  ~FragmentShaderRegistry() override;
59 
60 private:
61  typedef std::map<std::string, std::pair<unsigned int, unsigned int> > ShaderMapType;
62 
63  itkNewMacro(Self);
64 
65  // prevent implementation
67  void operator=(const Self&);
68 
70 
72 
73 }; // End class FragmentShaderRegistry
74 
75 } // End namespace otb
76 
77 #endif
void RegisterShader(const std::string &name, const std::string &source)
std::map< std::string, std::pair< unsigned int, unsigned int > > ShaderMapType
static Pointer Instance()
bool IsShaderRegistered(const std::string &name) const
void operator=(const Self &)
itk::SmartPointer< const Self > ConstPointer
bool LoadShader(const std::string &name)
unsigned int GetShaderProgram(const std::string &name)
bool UnregisterShader(const std::string &name)
itk::SmartPointer< Self > Pointer