annotate Framework/Scene2D/Internals/OpenGLFloatTextureProgram.h @ 1305:a5326ce4f24b broker

Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 04 Mar 2020 09:45:38 +0100
parents 2d8ab34c8c91
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
591
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 947
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
591
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "OpenGLTextureProgram.h"
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 namespace OrthancStone
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 {
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace Internals
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 class OpenGLFloatTextureProgram : public boost::noncopyable
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 public:
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class Data : public boost::noncopyable
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 private:
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 OpenGL::OpenGLTexture texture_;
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 float offset_;
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 float slope_;
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 public:
947
1091b2adeb5a Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents: 914
diff changeset
41 Data(OpenGL::IOpenGLContext& context, const Orthanc::ImageAccessor& texture,
591
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 bool isLinearInterpolation);
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 float GetOffset() const
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 return offset_;
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 float GetSlope() const
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 return slope_;
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 }
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 OpenGL::OpenGLTexture& GetTexture()
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 {
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 return texture_;
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 }
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 };
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
592
bbe29efd3d1c OpenGLLinesProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
60 public:
bbe29efd3d1c OpenGLLinesProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
61 OpenGLFloatTextureProgram(OpenGL::IOpenGLContext& context);
bbe29efd3d1c OpenGLLinesProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
62
591
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 void Apply(Data& data,
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 const AffineTransform2D& transform,
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 float windowCenter,
914
4d1f57773b5b Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
Benjamin Golinvaux <bgo@osimis.io>
parents: 592
diff changeset
66 float windowWidth,
4d1f57773b5b Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
Benjamin Golinvaux <bgo@osimis.io>
parents: 592
diff changeset
67 bool invert);
947
1091b2adeb5a Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents: 914
diff changeset
68 private:
1091b2adeb5a Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents: 914
diff changeset
69 OpenGLTextureProgram program_;
1091b2adeb5a Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents: 914
diff changeset
70 OpenGL::IOpenGLContext& context_;
591
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 };
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 }
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }