Mercurial > hg > orthanc-webviewer
comparison Plugin/DecodedImageAdapter.h @ 96:a6ba21a083e5 refactoring
major refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 27 Nov 2015 18:26:55 +0100 |
parents | 02f7a0400a91 |
children | 46ec13a1177c |
comparison
equal
deleted
inserted
replaced
95:dbe7c97b6b4a | 96:a6ba21a083e5 |
---|---|
22 | 22 |
23 #include "Cache/ICacheFactory.h" | 23 #include "Cache/ICacheFactory.h" |
24 | 24 |
25 #include <orthanc/OrthancCPlugin.h> | 25 #include <orthanc/OrthancCPlugin.h> |
26 #include <stdint.h> | 26 #include <stdint.h> |
27 #include <json/value.h> | |
28 | |
29 #include "../Orthanc/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h" | |
30 #include "../Orthanc/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.h" | |
31 | |
27 | 32 |
28 namespace OrthancPlugins | 33 namespace OrthancPlugins |
29 { | 34 { |
30 class DecodedImageAdapter : public ICacheFactory | 35 class DecodedImageAdapter : public ICacheFactory |
31 { | 36 { |
39 static bool ParseUri(CompressionType& type, | 44 static bool ParseUri(CompressionType& type, |
40 uint8_t& compressionLevel, | 45 uint8_t& compressionLevel, |
41 std::string& instanceId, | 46 std::string& instanceId, |
42 const std::string& uri); | 47 const std::string& uri); |
43 | 48 |
49 static bool GetCornerstoneMetadata(Json::Value& result, | |
50 const Json::Value& tags, | |
51 OrthancImageWrapper& image); | |
52 | |
53 static bool EncodeUsingDeflate(Json::Value& result, | |
54 OrthancImageWrapper& image, | |
55 uint8_t compressionLevel /* between 0 and 9 */); | |
56 | |
57 static bool EncodeUsingJpeg(Json::Value& result, | |
58 OrthancImageWrapper& image, | |
59 uint8_t quality /* between 0 and 100 */); | |
60 | |
44 OrthancPluginContext* context_; | 61 OrthancPluginContext* context_; |
62 GdcmDecoderCache decoderCache_; | |
45 | 63 |
46 public: | 64 public: |
47 DecodedImageAdapter(OrthancPluginContext* context) : context_(context) | 65 DecodedImageAdapter(OrthancPluginContext* context) : context_(context) |
48 { | 66 { |
49 } | 67 } |
50 | 68 |
51 virtual bool Create(std::string& content, | 69 virtual bool Create(std::string& content, |
52 const std::string& uri); | 70 const std::string& uri); |
71 | |
72 GdcmDecoderCache& GetDecoderCache() | |
73 { | |
74 return decoderCache_; | |
75 } | |
53 }; | 76 }; |
54 } | 77 } |