comparison Framework/Orthanc/Core/Images/ImageBuffer.cpp @ 11:4b7e0244881f

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 26 Oct 2016 12:14:03 +0200
parents 2dbe613f6c93
children
comparison
equal deleted inserted replaced
10:55407926aac3 11:4b7e0244881f
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