annotate Framework/Scene2D/Internals/OpenGLFloatTextureProgram.h @ 871:4bc8d9609447

Added support for measuring tool edition in TrackerSampleApp
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 25 Jun 2019 18:17:33 +0200
parents bbe29efd3d1c
children 4d1f57773b5b
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
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
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:
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 Data(const Orthanc::ImageAccessor& texture,
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 private:
bbe29efd3d1c OpenGLLinesProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
61 OpenGLTextureProgram program_;
bbe29efd3d1c OpenGLLinesProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
62
bbe29efd3d1c OpenGLLinesProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
63 public:
bbe29efd3d1c OpenGLLinesProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
64 OpenGLFloatTextureProgram(OpenGL::IOpenGLContext& context);
bbe29efd3d1c OpenGLLinesProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
65
591
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 void Apply(Data& data,
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 const AffineTransform2D& transform,
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 float windowCenter,
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 float windowWidth);
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 };
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 }
b66ced2c43d4 OpenGLTextureProgram
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 }