comparison Framework/Inputs/HierarchicalTiff.h @ 297:c1687b8fc800

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Jul 2023 07:13:36 +0200
parents 559499b80da8
children 7020852a8fa9
comparison
equal deleted inserted replaced
296:559499b80da8 297:c1687b8fc800
21 21
22 22
23 #pragma once 23 #pragma once
24 24
25 #include "PyramidWithRawTiles.h" 25 #include "PyramidWithRawTiles.h"
26 #include "../TiffReader.h"
26 27
27 #include <tiff.h>
28 #include <tiffio.h>
29 #include <vector> 28 #include <vector>
30 #include <boost/thread.hpp> 29 #include <boost/thread.hpp>
31 30
32 namespace OrthancWSI 31 namespace OrthancWSI
33 { 32 {
48 }; 47 };
49 48
50 struct Comparator; 49 struct Comparator;
51 50
52 boost::mutex mutex_; 51 boost::mutex mutex_;
53 TIFF* tiff_; 52 TiffReader reader_;
54 Orthanc::PixelFormat pixelFormat_; 53 Orthanc::PixelFormat pixelFormat_;
55 ImageCompression compression_; 54 ImageCompression compression_;
56 unsigned int tileWidth_; 55 unsigned int tileWidth_;
57 unsigned int tileHeight_; 56 unsigned int tileHeight_;
58 std::vector<Level> levels_; 57 std::vector<Level> levels_;
59 Orthanc::PhotometricInterpretation photometric_; 58 Orthanc::PhotometricInterpretation photometric_;
60 59
61 void Finalize();
62
63 void CheckLevel(unsigned int level) const; 60 void CheckLevel(unsigned int level) const;
64
65 bool Initialize();
66 61
67 public: 62 public:
68 explicit HierarchicalTiff(const std::string& path); 63 explicit HierarchicalTiff(const std::string& path);
69
70 virtual ~HierarchicalTiff()
71 {
72 Finalize();
73 }
74 64
75 virtual unsigned int GetLevelCount() const ORTHANC_OVERRIDE 65 virtual unsigned int GetLevelCount() const ORTHANC_OVERRIDE
76 { 66 {
77 return levels_.size(); 67 return levels_.size();
78 } 68 }
109 99
110 ImageCompression GetImageCompression() 100 ImageCompression GetImageCompression()
111 { 101 {
112 return compression_; 102 return compression_;
113 } 103 }
114
115 static bool GetCurrentDirectoryInformation(TIFF* tiff,
116 ImageCompression& compression,
117 Orthanc::PixelFormat& pixelFormat,
118 Orthanc::PhotometricInterpretation& photometric);
119 }; 104 };
120 } 105 }