Mercurial > hg > orthanc
comparison Core/Images/ImageBuffer.cpp @ 2107:88831c3edd8f
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 19 Oct 2016 17:22:09 +0200 |
parents | b1291df2f780 |
children | a3a65de1840f |
comparison
equal
deleted
inserted
replaced
2106:09cb73980740 | 2107:88831c3edd8f |
---|---|
85 } | 85 } |
86 | 86 |
87 | 87 |
88 ImageBuffer::ImageBuffer(PixelFormat format, | 88 ImageBuffer::ImageBuffer(PixelFormat format, |
89 unsigned int width, | 89 unsigned int width, |
90 unsigned int height) | 90 unsigned int height, |
91 bool forceMinimalPitch) : | |
92 forceMinimalPitch_(forceMinimalPitch) | |
91 { | 93 { |
92 Initialize(); | 94 Initialize(); |
93 SetWidth(width); | 95 SetWidth(width); |
94 SetHeight(height); | 96 SetHeight(height); |
95 SetFormat(format); | 97 SetFormat(format); |
156 accessor.AssignReadOnly(format_, width_, height_, pitch_, buffer_); | 158 accessor.AssignReadOnly(format_, width_, height_, pitch_, buffer_); |
157 return accessor; | 159 return accessor; |
158 } | 160 } |
159 | 161 |
160 | 162 |
161 void ImageBuffer::SetMinimalPitchForced(bool force) | |
162 { | |
163 if (force != forceMinimalPitch_) | |
164 { | |
165 changed_ = true; | |
166 forceMinimalPitch_ = force; | |
167 } | |
168 } | |
169 | |
170 | |
171 void ImageBuffer::AcquireOwnership(ImageBuffer& other) | 163 void ImageBuffer::AcquireOwnership(ImageBuffer& other) |
172 { | 164 { |
173 // Remove the content of the current image | 165 // Remove the content of the current image |
174 Deallocate(); | 166 Deallocate(); |
175 | 167 |