Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Scene2D/CopyStyleConfigurator.cpp @ 1852:5ead1852095a StoneWebViewer-2.1
StoneWebViewer-2.1
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Jun 2021 16:26:47 +0200 |
parents | 34eb41352dff |
children | 3889ae96d2e9 |
rev | line source |
---|---|
1773
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * License along with this program. If not, see |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 **/ |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 #include "CopyStyleConfigurator.h" |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 #include "FloatTextureSceneLayer.h" |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include "ColorTextureSceneLayer.h" |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 namespace OrthancStone |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 { |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 TextureBaseSceneLayer* CopyStyleConfigurator::CreateTextureFromImage( |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 const Orthanc::ImageAccessor& image) const |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 { |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 if (image.GetFormat() == Orthanc::PixelFormat_RGB24) |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 { |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 return new ColorTextureSceneLayer(image); |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 } |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 else |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 { |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 return new FloatTextureSceneLayer(image); |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 } |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 } |
34eb41352dff
added missing Scene2D/CopyStyleConfigurator.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 } |