annotate OrthancFramework/Sources/Images/IImageWriter.cpp @ 4224:38d446c9ee1d

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Sep 2020 17:59:09 +0200
parents bf7b9edf6b81
children 785a2713323e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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: 4044
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: 4044
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: 4044
diff changeset
10 * the License, or (at your option) any later version.
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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: 4044
diff changeset
15 * Lesser General Public License for more details.
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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: 4044
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: 4044
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: 4044
diff changeset
19 * <http://www.gnu.org/licenses/>.
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "IImageWriter.h"
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
2143
fd5875662670 creation of namespace SystemToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2140
diff changeset
25 #if ORTHANC_SANDBOXED == 0
fd5875662670 creation of namespace SystemToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2140
diff changeset
26 # include "../SystemToolbox.h"
fd5875662670 creation of namespace SystemToolbox
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2140
diff changeset
27 #endif
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 namespace Orthanc
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
2170
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2143
diff changeset
31 #if ORTHANC_SANDBOXED == 0
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 void IImageWriter::WriteToFileInternal(const std::string& path,
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 unsigned int width,
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 unsigned int height,
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 unsigned int pitch,
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 PixelFormat format,
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 const void* buffer)
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 {
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 std::string compressed;
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 WriteToMemoryInternal(compressed, width, height, pitch, format, buffer);
2140
aa4b8895cd23 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2139
diff changeset
41 SystemToolbox::WriteFile(compressed, path);
2170
baf8dd89b4e0 improved support for sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2143
diff changeset
42 }
2083
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 #endif
bfeacb51af20 cleaning up code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 }