Mercurial > hg > orthanc
annotate OrthancFramework/Sources/Images/IImageWriter.h @ 4285:544120b34c09
fix for VS2008, debug logs for C-FIND SCP and for storage commitment SCP
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 04 Nov 2020 16:27:59 +0100 |
parents | bf7b9edf6b81 |
children | 785a2713323e |
rev | line source |
---|---|
1916 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
3640
94f4a18a79cc
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
1916 | 6 * |
7 * 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
|
8 * 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
|
9 * 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
|
10 * the License, or (at your option) any later version. |
1916 | 11 * |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * 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
|
15 * Lesser General Public License for more details. |
1916 | 16 * |
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
|
17 * 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
|
18 * 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
|
19 * <http://www.gnu.org/licenses/>. |
1916 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include "ImageAccessor.h" | |
26 | |
27 #include <boost/noncopyable.hpp> | |
28 | |
2170
baf8dd89b4e0
improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
29 #if !defined(ORTHANC_SANDBOXED) |
baf8dd89b4e0
improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
30 # error The macro ORTHANC_SANDBOXED must be defined |
baf8dd89b4e0
improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
31 #endif |
baf8dd89b4e0
improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
32 |
1916 | 33 namespace Orthanc |
34 { | |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
35 class ORTHANC_PUBLIC IImageWriter : public boost::noncopyable |
1916 | 36 { |
37 protected: | |
38 virtual void WriteToMemoryInternal(std::string& compressed, | |
39 unsigned int width, | |
40 unsigned int height, | |
41 unsigned int pitch, | |
42 PixelFormat format, | |
43 const void* buffer) = 0; | |
44 | |
2170
baf8dd89b4e0
improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
45 #if ORTHANC_SANDBOXED == 0 |
1916 | 46 virtual void WriteToFileInternal(const std::string& path, |
47 unsigned int width, | |
48 unsigned int height, | |
49 unsigned int pitch, | |
50 PixelFormat format, | |
2083 | 51 const void* buffer); |
2170
baf8dd89b4e0
improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
52 #endif |
1916 | 53 |
54 public: | |
55 virtual ~IImageWriter() | |
56 { | |
57 } | |
58 | |
59 virtual void WriteToMemory(std::string& compressed, | |
60 const ImageAccessor& accessor) | |
61 { | |
62 WriteToMemoryInternal(compressed, accessor.GetWidth(), accessor.GetHeight(), | |
63 accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer()); | |
64 } | |
65 | |
2170
baf8dd89b4e0
improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
66 #if ORTHANC_SANDBOXED == 0 |
1916 | 67 virtual void WriteToFile(const std::string& path, |
68 const ImageAccessor& accessor) | |
69 { | |
70 WriteToFileInternal(path, accessor.GetWidth(), accessor.GetHeight(), | |
71 accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer()); | |
72 } | |
2170
baf8dd89b4e0
improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2083
diff
changeset
|
73 #endif |
1916 | 74 }; |
75 } |