Mercurial > hg > orthanc
comparison Core/Images/ImageAccessor.cpp @ 2865:0f07bdae0805
ImageAccessor::GetWriteableAccessor() and GetReadOnlyAccessor()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 05 Oct 2018 17:56:55 +0200 |
parents | 9b4251721f22 |
children | d924f9bb61cc |
comparison
equal
deleted
inserted
replaced
2864:7cac2bc1986e | 2865:0f07bdae0805 |
---|---|
202 throw OrthancException(ErrorCode_ParameterOutOfRange); | 202 throw OrthancException(ErrorCode_ParameterOutOfRange); |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 | 206 |
207 void ImageAccessor::GetWriteableAccessor(ImageAccessor& target) const | |
208 { | |
209 if (readOnly_) | |
210 { | |
211 throw OrthancException(ErrorCode_ReadOnly); | |
212 } | |
213 else | |
214 { | |
215 target.AssignWritable(format_, width_, height_, pitch_, buffer_); | |
216 } | |
217 } | |
218 | |
219 | |
207 void ImageAccessor::ToMatlabString(std::string& target) const | 220 void ImageAccessor::ToMatlabString(std::string& target) const |
208 { | 221 { |
209 ChunkedBuffer buffer; | 222 ChunkedBuffer buffer; |
210 | 223 |
211 switch (GetFormat()) | 224 switch (GetFormat()) |