Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/OrthancSlicesLoader.cpp @ 128:c993693e9e63 wasm
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 14 Nov 2017 17:26:10 +0100 |
parents | b963f3a9a86c |
children | e2fe9352f240 |
comparison
equal
deleted
inserted
replaced
127:b963f3a9a86c | 128:c993693e9e63 |
---|---|
50 | 50 |
51 std::vector<int> T(256,-1); | 51 std::vector<int> T(256,-1); |
52 for (int i=0; i<64; i++) T["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]] = i; | 52 for (int i=0; i<64; i++) T["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]] = i; |
53 | 53 |
54 int val=0, valb=-8; | 54 int val=0, valb=-8; |
55 for (unsigned char c : in) { | 55 for (size_t i = 0; i < in.size(); i++) { |
56 unsigned char c = in[i]; | |
56 if (T[c] == -1) break; | 57 if (T[c] == -1) break; |
57 val = (val<<6) + T[c]; | 58 val = (val<<6) + T[c]; |
58 valb += 6; | 59 valb += 6; |
59 if (valb>=0) { | 60 if (valb>=0) { |
60 out.push_back(char((val>>valb)&0xFF)); | 61 out.push_back(char((val>>valb)&0xFF)); |
868 // This requires the official Web viewer plugin to be installed! | 869 // This requires the official Web viewer plugin to be installed! |
869 std::string uri = ("/web-viewer/instances/jpeg" + | 870 std::string uri = ("/web-viewer/instances/jpeg" + |
870 boost::lexical_cast<std::string>(value) + | 871 boost::lexical_cast<std::string>(value) + |
871 "-" + slice.GetOrthancInstanceId() + "_" + | 872 "-" + slice.GetOrthancInstanceId() + "_" + |
872 boost::lexical_cast<std::string>(slice.GetFrame())); | 873 boost::lexical_cast<std::string>(slice.GetFrame())); |
873 | 874 |
874 orthanc_.ScheduleGetRequest(*webCallback_, uri, | 875 orthanc_.ScheduleGetRequest(*webCallback_, uri, |
875 Operation::DownloadSliceImage(index, slice, quality)); | 876 Operation::DownloadSliceImage(index, slice, quality)); |
876 } | 877 } |
877 | 878 |
878 | 879 |