annotate OrthancFramework/Sources/Images/ImageAccessor.h @ 4294:0923247e69f6

log categories: rest -> http + added lua & jobs
author Alain Mazy <alain@mazy.be>
date Thu, 05 Nov 2020 11:43:32 +0100
parents 0034f855c023
children 785a2713323e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1612
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 983
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
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
e1d27ee2114a ImageAccessor abstraction
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.
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
e1d27ee2114a ImageAccessor abstraction
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.
798
e1d27ee2114a ImageAccessor abstraction
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/>.
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #pragma once
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
4273
0034f855c023 tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4201
diff changeset
25 #include "../Compatibility.h"
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "../Enumerations.h"
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
1396
ac4efabeb80c Migration of the orthanc-client as a separate project
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
28 #include <string>
1922
369897749653 ImageAccessor::GetRegion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
29 #include <stdint.h>
2861
9b4251721f22 ImageAccessor now non-copyable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2487
diff changeset
30 #include <boost/noncopyable.hpp>
1396
ac4efabeb80c Migration of the orthanc-client as a separate project
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
31
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 namespace Orthanc
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
3992
f9863630ec7f working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
34 class ORTHANC_PUBLIC ImageAccessor : public boost::noncopyable
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 private:
2487
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
37 template <Orthanc::PixelFormat Format>
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
38 friend struct ImageTraits;
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
39
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 bool readOnly_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 PixelFormat format_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 unsigned int width_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 unsigned int height_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 unsigned int pitch_;
1922
369897749653 ImageAccessor::GetRegion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
45 uint8_t *buffer_;
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
2487
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
47 template <typename T>
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
48 const T& GetPixelUnchecked(unsigned int x,
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
49 unsigned int y) const
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
50 {
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
51 const uint8_t* row = reinterpret_cast<const uint8_t*>(buffer_) + y * pitch_;
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
52 return reinterpret_cast<const T*>(row) [x];
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
53 }
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
54
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
55
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
56 template <typename T>
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
57 T& GetPixelUnchecked(unsigned int x,
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
58 unsigned int y)
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
59 {
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
60 uint8_t* row = reinterpret_cast<uint8_t*>(buffer_) + y * pitch_;
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
61 return reinterpret_cast<T*>(row) [x];
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
62 }
be1dbb1dcdd6 PixelTraits and ImageTraits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2447
diff changeset
63
4273
0034f855c023 tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4201
diff changeset
64 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
0034f855c023 tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4201
diff changeset
65 // Alias for binary compatibility with Orthanc Framework 1.7.2 => don't use it anymore
0034f855c023 tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4201
diff changeset
66 void* GetBuffer() const;
0034f855c023 tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4201
diff changeset
67 void* GetRow(unsigned int y) const;
0034f855c023 tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4201
diff changeset
68 #endif
0034f855c023 tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4201
diff changeset
69
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 public:
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 ImageAccessor()
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 AssignEmpty(PixelFormat_Grayscale8);
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
1605
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1396
diff changeset
76 virtual ~ImageAccessor()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1396
diff changeset
77 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1396
diff changeset
78 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1396
diff changeset
79
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 bool IsReadOnly() const
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 {
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 return readOnly_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 }
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 PixelFormat GetFormat() const
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 return format_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 }
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89
983
80d4f1618b33 Sample plugin to replace DCMTK by GDCM when decoding images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 874
diff changeset
90 unsigned int GetBytesPerPixel() const
80d4f1618b33 Sample plugin to replace DCMTK by GDCM when decoding images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 874
diff changeset
91 {
80d4f1618b33 Sample plugin to replace DCMTK by GDCM when decoding images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 874
diff changeset
92 return ::Orthanc::GetBytesPerPixel(format_);
80d4f1618b33 Sample plugin to replace DCMTK by GDCM when decoding images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 874
diff changeset
93 }
80d4f1618b33 Sample plugin to replace DCMTK by GDCM when decoding images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 874
diff changeset
94
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 unsigned int GetWidth() const
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 {
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 return width_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 }
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 unsigned int GetHeight() const
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 {
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 return height_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 }
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 unsigned int GetPitch() const
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 {
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 return pitch_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 }
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
844
502c49adb5ad jpeg lossless
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 800
diff changeset
110 unsigned int GetSize() const
502c49adb5ad jpeg lossless
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 800
diff changeset
111 {
502c49adb5ad jpeg lossless
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 800
diff changeset
112 return GetHeight() * GetPitch();
502c49adb5ad jpeg lossless
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 800
diff changeset
113 }
502c49adb5ad jpeg lossless
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 800
diff changeset
114
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 const void* GetConstBuffer() const
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 {
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 return buffer_;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 }
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119
4201
2d5209153b32 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
120 void* GetBuffer();
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 const void* GetConstRow(unsigned int y) const;
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
4201
2d5209153b32 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4119
diff changeset
124 void* GetRow(unsigned int y);
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 void AssignEmpty(PixelFormat format);
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 void AssignReadOnly(PixelFormat format,
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 unsigned int width,
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 unsigned int height,
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 unsigned int pitch,
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 const void *buffer);
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
2865
0f07bdae0805 ImageAccessor::GetWriteableAccessor() and GetReadOnlyAccessor()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2861
diff changeset
134 void GetReadOnlyAccessor(ImageAccessor& target) const
0f07bdae0805 ImageAccessor::GetWriteableAccessor() and GetReadOnlyAccessor()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2861
diff changeset
135 {
0f07bdae0805 ImageAccessor::GetWriteableAccessor() and GetReadOnlyAccessor()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2861
diff changeset
136 target.AssignReadOnly(format_, width_, height_, pitch_, buffer_);
0f07bdae0805 ImageAccessor::GetWriteableAccessor() and GetReadOnlyAccessor()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2861
diff changeset
137 }
0f07bdae0805 ImageAccessor::GetWriteableAccessor() and GetReadOnlyAccessor()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2861
diff changeset
138
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 void AssignWritable(PixelFormat format,
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 unsigned int width,
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 unsigned int height,
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 unsigned int pitch,
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 void *buffer);
874
87791ebc1f50 download matlab images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 844
diff changeset
144
2865
0f07bdae0805 ImageAccessor::GetWriteableAccessor() and GetReadOnlyAccessor()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2861
diff changeset
145 void GetWriteableAccessor(ImageAccessor& target) const;
0f07bdae0805 ImageAccessor::GetWriteableAccessor() and GetReadOnlyAccessor()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2861
diff changeset
146
874
87791ebc1f50 download matlab images
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 844
diff changeset
147 void ToMatlabString(std::string& target) const;
1922
369897749653 ImageAccessor::GetRegion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
148
2861
9b4251721f22 ImageAccessor now non-copyable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2487
diff changeset
149 void GetRegion(ImageAccessor& accessor,
9b4251721f22 ImageAccessor now non-copyable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2487
diff changeset
150 unsigned int x,
9b4251721f22 ImageAccessor now non-copyable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2487
diff changeset
151 unsigned int y,
9b4251721f22 ImageAccessor now non-copyable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2487
diff changeset
152 unsigned int width,
9b4251721f22 ImageAccessor now non-copyable
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2487
diff changeset
153 unsigned int height) const;
2103
a89ca69ec1d1 ImageAccessor::SetFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1922
diff changeset
154
a89ca69ec1d1 ImageAccessor::SetFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1922
diff changeset
155 void SetFormat(PixelFormat format);
798
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 };
e1d27ee2114a ImageAccessor abstraction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 }