Mercurial > hg > orthanc
comparison Core/DicomParsing/MemoryBufferTranscoder.h @ 3930:b99acc213937 transcoding
transcoder plugins and GDCM transcoding are working
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 14 May 2020 19:20:40 +0200 |
parents | 7dc5e7e0045d |
children | aae045f802f4 |
comparison
equal
deleted
inserted
replaced
3929:7dc5e7e0045d | 3930:b99acc213937 |
---|---|
31 **/ | 31 **/ |
32 | 32 |
33 | 33 |
34 #pragma once | 34 #pragma once |
35 | 35 |
36 #if !defined(ORTHANC_ENABLE_DCMTK_TRANSCODING) | 36 #include "IDicomTranscoder.h" |
37 # error Macro ORTHANC_ENABLE_DCMTK_TRANSCODING must be defined to use this file | |
38 #endif | |
39 | |
40 #if ORTHANC_ENABLE_DCMTK_TRANSCODING == 1 | |
41 # include "DcmtkTranscoder.h" | |
42 #endif | |
43 | 37 |
44 namespace Orthanc | 38 namespace Orthanc |
45 { | 39 { |
46 // This is the basis class for transcoding plugins | 40 // This is the basis class for transcoding plugins |
47 class MemoryBufferTranscoder : public IDicomTranscoder | 41 class MemoryBufferTranscoder : public IDicomTranscoder |
48 { | 42 { |
49 private: | |
50 bool useDcmtk_; | |
51 | |
52 #if ORTHANC_ENABLE_DCMTK_TRANSCODING == 1 | |
53 DcmtkTranscoder dcmtk_; | |
54 #endif | |
55 | |
56 protected: | 43 protected: |
57 virtual bool Transcode(std::string& target, | 44 virtual bool Transcode(std::string& target, |
58 bool& hasSopInstanceUidChanged /* out */, | 45 bool& hasSopInstanceUidChanged /* out */, |
59 const void* buffer, | 46 const void* buffer, |
60 size_t size, | 47 size_t size, |
61 const std::set<DicomTransferSyntax>& allowedSyntaxes, | 48 const std::set<DicomTransferSyntax>& allowedSyntaxes, |
62 bool allowNewSopInstanceUid) = 0; | 49 bool allowNewSopInstanceUid) = 0; |
63 | 50 |
64 public: | 51 public: |
65 /** | |
66 * If "useDcmtk" is "true", the transcoder will first try and call | |
67 * DCMTK, before calling its own "Transcode()" implementation. | |
68 **/ | |
69 MemoryBufferTranscoder(); | |
70 | |
71 void SetDcmtkUsed(bool used); | |
72 | |
73 bool IsDcmtkUsed() const | |
74 { | |
75 return useDcmtk_; | |
76 } | |
77 | |
78 virtual bool TranscodeParsedToBuffer(std::string& target /* out */, | 52 virtual bool TranscodeParsedToBuffer(std::string& target /* out */, |
79 bool& hasSopInstanceUidChanged /* out */, | 53 bool& hasSopInstanceUidChanged /* out */, |
80 DcmFileFormat& dicom /* in, possibly modified */, | 54 DcmFileFormat& dicom /* in, possibly modified */, |
81 DicomTransferSyntax targetSyntax, | 55 DicomTransferSyntax targetSyntax, |
82 bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; | 56 bool allowNewSopInstanceUid) ORTHANC_OVERRIDE; |