annotate Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.cpp @ 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 266e2b0b9abc
children 6e888cf6a48b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
841
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
1 /**
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
2 * Stone of Orthanc
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
6 *
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
10 * the License, or (at your option) any later version.
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
11 *
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
15 * Affero General Public License for more details.
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
16 *
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
19 **/
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
20
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
21
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
22 #include "OpenGLLookupTableTextureRenderer.h"
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
23
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
24 namespace OrthancStone
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
25 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
26 namespace Internals
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
27 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
28 void OpenGLLookupTableTextureRenderer::LoadTexture(
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
29 const LookupTableTextureSceneLayer& layer)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
30 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
31 const Orthanc::ImageAccessor& source = layer.GetTexture();
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
32 const unsigned int width = source.GetWidth();
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
33 const unsigned int height = source.GetHeight();
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
34
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
35 if ((texture_.get() == NULL) ||
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
36 (texture_->GetWidth() != width) ||
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
37 (texture_->GetHeight() != height))
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
38 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
39
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
40 texture_.reset(new Orthanc::Image(
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
41 Orthanc::PixelFormat_RGBA32,
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
42 width,
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
43 height,
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
44 false));
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
45 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
46
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
47 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
48
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
49 const float a = layer.GetMinValue();
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
50 float slope = 0;
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
51
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
52 if (layer.GetMinValue() >= layer.GetMaxValue())
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
53 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
54 slope = 0;
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
55 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
56 else
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
57 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
58 slope = 256.0f / (layer.GetMaxValue() - layer.GetMinValue());
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
59 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
60
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
61 Orthanc::ImageAccessor target;
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
62 texture_->GetWriteableAccessor(target);
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
63
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
64 const std::vector<uint8_t>& lut = layer.GetLookupTable();
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
65 if (lut.size() != 4 * 256)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
66 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
67 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
68 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
69
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
70 assert(source.GetFormat() == Orthanc::PixelFormat_Float32 &&
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
71 target.GetFormat() == Orthanc::PixelFormat_RGBA32 &&
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
72 sizeof(float) == 4);
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
73
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
74 for (unsigned int y = 0; y < height; y++)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
75 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
76 const float* p = reinterpret_cast<const float*>(source.GetConstRow(y));
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
77 uint8_t* q = reinterpret_cast<uint8_t*>(target.GetRow(y));
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
78
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
79 for (unsigned int x = 0; x < width; x++)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
80 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
81 float v = (*p - a) * slope;
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
82 if (v <= 0)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
83 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
84 v = 0;
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
85 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
86 else if (v >= 255)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
87 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
88 v = 255;
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
89 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
90
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
91 uint8_t vv = static_cast<uint8_t>(v);
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
92
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
93 q[0] = lut[4 * vv + 0]; // R
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
94 q[1] = lut[4 * vv + 1]; // G
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
95 q[2] = lut[4 * vv + 2]; // B
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
96 q[3] = lut[4 * vv + 3]; // A
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
97
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
98 p++;
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
99 q += 4;
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
100 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
101 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
102 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
103
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
104 context_.MakeCurrent();
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
105 glTexture_.reset(new OpenGL::OpenGLTexture);
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
106 glTexture_->Load(*texture_, layer.IsLinearInterpolation());
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
107 layerTransform_ = layer.GetTransform();
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
108 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
109
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
110
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
111 OpenGLLookupTableTextureRenderer::OpenGLLookupTableTextureRenderer(
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
112 OpenGL::IOpenGLContext& context,
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
113 OpenGLColorTextureProgram& program,
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
114 const LookupTableTextureSceneLayer& layer)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
115 : context_(context)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
116 , program_(program)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
117 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
118 LoadTexture(layer);
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
119 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
120
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
121
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
122 void OpenGLLookupTableTextureRenderer::Render(const AffineTransform2D& transform)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
123 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
124 if (glTexture_.get() != NULL)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
125 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
126 program_.Apply(
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
127 *glTexture_,
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
128 AffineTransform2D::Combine(transform, layerTransform_),
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
129 true);
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
130 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
131 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
132
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
133
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
134 void OpenGLLookupTableTextureRenderer::Update(const ISceneLayer& layer)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
135 {
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
136 // Should never happen (no revisions in color textures)
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
137 LoadTexture(dynamic_cast<const LookupTableTextureSceneLayer&>(layer));
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
138 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
139 }
266e2b0b9abc better error reporting in DicomStructureSetLoader + fixed POST request logic
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
140 }