changeset 106:6a7c702a7531 wasm

optimization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 14 Jun 2017 14:21:24 +0200
parents e0ddd8cad909
children 71d574a3607f
files Framework/Layers/GrayscaleFrameRenderer.cpp Resources/CMake/OrthancStone.cmake
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Layers/GrayscaleFrameRenderer.cpp	Thu Jun 01 12:33:24 2017 +0200
+++ b/Framework/Layers/GrayscaleFrameRenderer.cpp	Wed Jun 14 14:21:24 2017 +0200
@@ -51,14 +51,17 @@
 
       lut = reinterpret_cast<const uint8_t*>(Orthanc::EmbeddedResources::GetFileResourceBuffer(style.lut_));
     }
-      
+
     Orthanc::ImageAccessor target = result->GetAccessor();
-    for (unsigned int y = 0; y < target.GetHeight(); y++)
+    const unsigned int width = target.GetWidth();
+    const unsigned int height = target.GetHeight();
+    
+    for (unsigned int y = 0; y < height; y++)
     {
       const float* p = reinterpret_cast<const float*>(frame_->GetConstRow(y));
       uint8_t* q = reinterpret_cast<uint8_t*>(target.GetRow(y));
 
-      for (unsigned int x = 0; x < target.GetWidth(); x++, p++, q += 4)
+      for (unsigned int x = 0; x < width; x++, p++, q += 4)
       {
         uint8_t v = 0;
         if (windowWidth >= 0.001f)  // Avoid division by zero
--- a/Resources/CMake/OrthancStone.cmake	Thu Jun 01 12:33:24 2017 +0200
+++ b/Resources/CMake/OrthancStone.cmake	Wed Jun 14 14:21:24 2017 +0200
@@ -28,6 +28,7 @@
 SET(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
 SET(STONE_SANDBOXED OFF CACHE BOOL "Whether Stone runs inside a sandboxed environment (such as Google NaCl)")
+SET(ENABLE_PROFILING OFF CACHE BOOL "Whether to enable the generation of profiling information with gprof")
 
 # Optional components
 SET(ENABLE_CURL ON CACHE BOOL "Include support for libcurl")