Mercurial > hg > orthanc
comparison Core/ImageFormats/ImageAccessor.cpp @ 861:a546b05a43da jpeg
fix PngWriter
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 07 Jun 2014 10:49:00 +0200 |
parents | 80c7e53a69b5 |
children | 87791ebc1f50 |
comparison
equal
deleted
inserted
replaced
860:80c7e53a69b5 | 861:a546b05a43da |
---|---|
35 | 35 |
36 #include "../OrthancException.h" | 36 #include "../OrthancException.h" |
37 | 37 |
38 #include <stdint.h> | 38 #include <stdint.h> |
39 #include <cassert> | 39 #include <cassert> |
40 #include <glog/logging.h> | |
40 | 41 |
41 namespace Orthanc | 42 namespace Orthanc |
42 { | 43 { |
43 void* ImageAccessor::GetBuffer() const | 44 void* ImageAccessor::GetBuffer() const |
44 { | 45 { |
45 if (readOnly_) | 46 if (readOnly_) |
46 { | 47 { |
48 LOG(ERROR) << "Trying to write on a read-only image"; | |
47 throw OrthancException(ErrorCode_ReadOnly); | 49 throw OrthancException(ErrorCode_ReadOnly); |
48 } | 50 } |
49 | 51 |
50 return buffer_; | 52 return buffer_; |
51 } | 53 } |
66 | 68 |
67 void* ImageAccessor::GetRow(unsigned int y) const | 69 void* ImageAccessor::GetRow(unsigned int y) const |
68 { | 70 { |
69 if (readOnly_) | 71 if (readOnly_) |
70 { | 72 { |
73 LOG(ERROR) << "Trying to write on a read-only image"; | |
71 throw OrthancException(ErrorCode_ReadOnly); | 74 throw OrthancException(ErrorCode_ReadOnly); |
72 } | 75 } |
73 | 76 |
74 if (buffer_ != NULL) | 77 if (buffer_ != NULL) |
75 { | 78 { |