comparison Core/ImageFormats/ImageAccessor.cpp @ 1397:704de8c30ff5

modularization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 01 Jun 2015 11:50:58 +0200
parents 6e7e5ed91c2d
children f967bdf8534e
comparison
equal deleted inserted replaced
1396:ac4efabeb80c 1397:704de8c30ff5
36 #include "../OrthancException.h" 36 #include "../OrthancException.h"
37 #include "../ChunkedBuffer.h" 37 #include "../ChunkedBuffer.h"
38 38
39 #include <stdint.h> 39 #include <stdint.h>
40 #include <cassert> 40 #include <cassert>
41 #include <boost/lexical_cast.hpp>
42
43 #if HAVE_GOOGLE_LOG == 1
41 #include <glog/logging.h> 44 #include <glog/logging.h>
42 #include <boost/lexical_cast.hpp> 45 #endif
46
43 47
44 namespace Orthanc 48 namespace Orthanc
45 { 49 {
46 template <typename PixelType> 50 template <typename PixelType>
47 static void ToMatlabStringInternal(ChunkedBuffer& target, 51 static void ToMatlabStringInternal(ChunkedBuffer& target,
102 106
103 void* ImageAccessor::GetBuffer() const 107 void* ImageAccessor::GetBuffer() const
104 { 108 {
105 if (readOnly_) 109 if (readOnly_)
106 { 110 {
111 #if HAVE_GOOGLE_LOG == 1
107 LOG(ERROR) << "Trying to write on a read-only image"; 112 LOG(ERROR) << "Trying to write on a read-only image";
113 #endif
114
108 throw OrthancException(ErrorCode_ReadOnly); 115 throw OrthancException(ErrorCode_ReadOnly);
109 } 116 }
110 117
111 return buffer_; 118 return buffer_;
112 } 119 }
127 134
128 void* ImageAccessor::GetRow(unsigned int y) const 135 void* ImageAccessor::GetRow(unsigned int y) const
129 { 136 {
130 if (readOnly_) 137 if (readOnly_)
131 { 138 {
139 #if HAVE_GOOGLE_LOG == 1
132 LOG(ERROR) << "Trying to write on a read-only image"; 140 LOG(ERROR) << "Trying to write on a read-only image";
141 #endif
142
133 throw OrthancException(ErrorCode_ReadOnly); 143 throw OrthancException(ErrorCode_ReadOnly);
134 } 144 }
135 145
136 if (buffer_ != NULL) 146 if (buffer_ != NULL)
137 { 147 {