Mercurial > hg > orthanc-webviewer
comparison Orthanc/Core/Images/ImageBuffer.cpp @ 145:d850500b8ca6
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 08 Nov 2016 10:15:05 +0100 |
parents | 3809121c3290 |
children | 5dc54316d68b |
comparison
equal
deleted
inserted
replaced
144:daf99382bc18 | 145:d850500b8ca6 |
---|---|
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 |