diff OrthancServer/Sources/ServerContext.h @ 5743:8bb3f2fca242

refactored ServerContext::DecodeDicomFrame to have a single implementation
author Alain Mazy <am@orthanc.team>
date Thu, 29 Aug 2024 13:46:49 +0200
parents 0c218d90096e
children 9d6167ddcb35 796cb17db15c 8279eaab0d1d
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerContext.h	Thu Aug 29 12:33:41 2024 +0200
+++ b/OrthancServer/Sources/ServerContext.h	Thu Aug 29 13:46:49 2024 +0200
@@ -305,6 +305,7 @@
       std::unique_ptr<ParsedDicomFile>             dicom_;
       size_t                                       dicomSize_;
       std::unique_ptr<Semaphore::Locker>           largeDicomLocker_;
+      std::string                                  buffer_;
 
     public:
       DicomCacheLocker(ServerContext& context,
@@ -313,6 +314,8 @@
       ~DicomCacheLocker();
 
       ParsedDicomFile& GetDicom() const;
+
+      const std::string& GetBuffer();
     };
 
     ServerContext(IDatabaseWrapper& database,
@@ -555,7 +558,12 @@
     ImageAccessor* DecodeDicomFrame(const void* dicom,
                                     size_t size,
                                     unsigned int frameIndex);
-    
+
+    ImageAccessor* DecodeDicomFrame(const ParsedDicomFile& parsedDicom,
+                                    const void* buffer,  // actually the buffer that is the source of the ParsedDicomFile
+                                    size_t size,
+                                    unsigned int frameIndex);
+
     void StoreWithTranscoding(std::string& sopClassUid,
                               std::string& sopInstanceUid,
                               DicomStoreUserConnection& connection,