Mercurial > hg > orthanc
comparison Core/ImageFormats/ImageAccessor.cpp @ 1486:f967bdf8534e
refactoring to Logging.h
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 04 Aug 2015 10:01:31 +0200 |
parents | 704de8c30ff5 |
children | e460341872dc |
comparison
equal
deleted
inserted
replaced
1485:27661b33f624 | 1486:f967bdf8534e |
---|---|
31 | 31 |
32 | 32 |
33 #include "../PrecompiledHeaders.h" | 33 #include "../PrecompiledHeaders.h" |
34 #include "ImageAccessor.h" | 34 #include "ImageAccessor.h" |
35 | 35 |
36 #include "../Logging.h" | |
36 #include "../OrthancException.h" | 37 #include "../OrthancException.h" |
37 #include "../ChunkedBuffer.h" | 38 #include "../ChunkedBuffer.h" |
38 | 39 |
39 #include <stdint.h> | 40 #include <stdint.h> |
40 #include <cassert> | 41 #include <cassert> |
41 #include <boost/lexical_cast.hpp> | 42 #include <boost/lexical_cast.hpp> |
42 | 43 |
43 #if HAVE_GOOGLE_LOG == 1 | |
44 #include <glog/logging.h> | |
45 #endif | |
46 | 44 |
47 | 45 |
48 namespace Orthanc | 46 namespace Orthanc |
49 { | 47 { |
50 template <typename PixelType> | 48 template <typename PixelType> |
106 | 104 |
107 void* ImageAccessor::GetBuffer() const | 105 void* ImageAccessor::GetBuffer() const |
108 { | 106 { |
109 if (readOnly_) | 107 if (readOnly_) |
110 { | 108 { |
111 #if HAVE_GOOGLE_LOG == 1 | |
112 LOG(ERROR) << "Trying to write on a read-only image"; | 109 LOG(ERROR) << "Trying to write on a read-only image"; |
113 #endif | |
114 | |
115 throw OrthancException(ErrorCode_ReadOnly); | 110 throw OrthancException(ErrorCode_ReadOnly); |
116 } | 111 } |
117 | 112 |
118 return buffer_; | 113 return buffer_; |
119 } | 114 } |
134 | 129 |
135 void* ImageAccessor::GetRow(unsigned int y) const | 130 void* ImageAccessor::GetRow(unsigned int y) const |
136 { | 131 { |
137 if (readOnly_) | 132 if (readOnly_) |
138 { | 133 { |
139 #if HAVE_GOOGLE_LOG == 1 | |
140 LOG(ERROR) << "Trying to write on a read-only image"; | 134 LOG(ERROR) << "Trying to write on a read-only image"; |
141 #endif | |
142 | |
143 throw OrthancException(ErrorCode_ReadOnly); | 135 throw OrthancException(ErrorCode_ReadOnly); |
144 } | 136 } |
145 | 137 |
146 if (buffer_ != NULL) | 138 if (buffer_ != NULL) |
147 { | 139 { |