Mercurial > hg > orthanc-stone
comparison Samples/Sdl/Loader.cpp @ 792:4fe4b221a31f
deprecating MessagingToolbox
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 28 May 2019 08:49:49 +0200 |
parents | c83a45f864b2 |
children | f72b49954f62 |
comparison
equal
deleted
inserted
replaced
791:907189734acd | 792:4fe4b221a31f |
---|---|
1218 template <typename T> | 1218 template <typename T> |
1219 void CopyPixelData(const std::string& pixelData) | 1219 void CopyPixelData(const std::string& pixelData) |
1220 { | 1220 { |
1221 ImageBuffer3D& target = volume_->GetPixelData(); | 1221 ImageBuffer3D& target = volume_->GetPixelData(); |
1222 | 1222 |
1223 const Orthanc::PixelFormat format = target.GetFormat(); | |
1224 const unsigned int bpp = target.GetBytesPerPixel(); | 1223 const unsigned int bpp = target.GetBytesPerPixel(); |
1225 const unsigned int width = target.GetWidth(); | 1224 const unsigned int width = target.GetWidth(); |
1226 const unsigned int height = target.GetHeight(); | 1225 const unsigned int height = target.GetHeight(); |
1227 const unsigned int depth = target.GetDepth(); | 1226 const unsigned int depth = target.GetDepth(); |
1228 | 1227 |
1246 assert (writer.GetAccessor().GetWidth() == width && | 1245 assert (writer.GetAccessor().GetWidth() == width && |
1247 writer.GetAccessor().GetHeight() == height); | 1246 writer.GetAccessor().GetHeight() == height); |
1248 | 1247 |
1249 for (unsigned int y = 0; y < height; y++) | 1248 for (unsigned int y = 0; y < height; y++) |
1250 { | 1249 { |
1251 assert(sizeof(T) == Orthanc::GetBytesPerPixel(format)); | 1250 assert(sizeof(T) == Orthanc::GetBytesPerPixel(target.GetFormat())); |
1252 | 1251 |
1253 T* target = reinterpret_cast<T*>(writer.GetAccessor().GetRow(y)); | 1252 T* target = reinterpret_cast<T*>(writer.GetAccessor().GetRow(y)); |
1254 | 1253 |
1255 for (unsigned int x = 0; x < width; x++) | 1254 for (unsigned int x = 0; x < width; x++) |
1256 { | 1255 { |