comparison OrthancStone/Sources/OpenGL/ImageProcessingProgram.h @ 2061:6ea5f40ea0e9 deep-learning

added ImageProcessingProgram
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 03 May 2023 16:34:34 +0200
parents
children 4e31d76c7ecd
comparison
equal deleted inserted replaced
2060:86e0e92a2e0d 2061:6ea5f40ea0e9
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
21 **/
22
23
24 #pragma once
25
26 #include "OpenGLProgram.h"
27
28
29 namespace OrthancStone
30 {
31 namespace OpenGL
32 {
33 class OpenGLFramebuffer;
34 class OpenGLTexture;
35 class OpenGLTextureArray;
36
37 class ImageProcessingProgram : public boost::noncopyable
38 {
39 private:
40 OpenGLProgram program_;
41 GLuint quad_vertexbuffer;
42
43 void SetupPosition();
44
45 public:
46 ImageProcessingProgram(IOpenGLContext& context,
47 const std::string& fragmentShader);
48
49 ~ImageProcessingProgram();
50
51 void Use(OpenGLTexture& target,
52 OpenGLFramebuffer& framebuffer,
53 bool checkStatus);
54
55 void Use(OpenGLTextureArray& target,
56 unsigned int targetLayer,
57 OpenGLFramebuffer& framebuffer,
58 bool checkStatus);
59
60 void Render();
61
62 GLint GetUniformLocation(const std::string& name)
63 {
64 return program_.GetUniformLocation(name);
65 }
66
67 GLint GetAttributeLocation(const std::string& name)
68 {
69 return program_.GetAttributeLocation(name);
70 }
71 };
72 }
73 }