annotate OrthancFramework/Sources/Images/IImageWriter.h @ 5544:dce22a789a2b

Multitenant DICOM plugin: added support for locales
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Mar 2024 18:56:46 +0100
parents 48b8dae6dc77
children f7adfb22e20e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
11 * the License, or (at your option) any later version.
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
16 * Lesser General Public License for more details.
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
4119
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
19 * License along with this program. If not, see
bf7b9edf6b81 re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
20 * <http://www.gnu.org/licenses/>.
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "ImageAccessor.h"
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include <boost/noncopyable.hpp>
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
2170
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2083
diff changeset
30 #if !defined(ORTHANC_SANDBOXED)
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2083
diff changeset
31 # error The macro ORTHANC_SANDBOXED must be defined
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2083
diff changeset
32 #endif
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2083
diff changeset
33
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 namespace Orthanc
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
36 class ORTHANC_PUBLIC IImageWriter : public boost::noncopyable
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 protected:
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 virtual void WriteToMemoryInternal(std::string& compressed,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 unsigned int width,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 unsigned int height,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 unsigned int pitch,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 PixelFormat format,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 const void* buffer) = 0;
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
2170
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2083
diff changeset
46 #if ORTHANC_SANDBOXED == 0
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 virtual void WriteToFileInternal(const std::string& path,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 unsigned int width,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 unsigned int height,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 unsigned int pitch,
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 PixelFormat format,
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2082
diff changeset
52 const void* buffer);
2170
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2083
diff changeset
53 #endif
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 public:
4310
2ae905070221 renaming pure interface JobOperationValue as IJobOperationValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4297
diff changeset
56 virtual ~IImageWriter()
2ae905070221 renaming pure interface JobOperationValue as IJobOperationValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4297
diff changeset
57 {
2ae905070221 renaming pure interface JobOperationValue as IJobOperationValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4297
diff changeset
58 }
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
4311
cb9aef006229 turning IImageWriter into a pure interface
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4310
diff changeset
60 static void WriteToMemory(IImageWriter& writer,
cb9aef006229 turning IImageWriter into a pure interface
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4310
diff changeset
61 std::string& compressed,
cb9aef006229 turning IImageWriter into a pure interface
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4310
diff changeset
62 const ImageAccessor& accessor);
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
2170
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2083
diff changeset
64 #if ORTHANC_SANDBOXED == 0
4311
cb9aef006229 turning IImageWriter into a pure interface
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4310
diff changeset
65 static void WriteToFile(IImageWriter& writer,
cb9aef006229 turning IImageWriter into a pure interface
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4310
diff changeset
66 const std::string& path,
cb9aef006229 turning IImageWriter into a pure interface
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4310
diff changeset
67 const ImageAccessor& accessor);
2170
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2083
diff changeset
68 #endif
1916
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 };
5bcf721bde4f IImageWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 }