Mercurial > hg > orthanc
comparison Core/Images/PamReader.h @ 3837:963ea9fab402
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 15 Apr 2020 17:28:27 +0200 |
parents | 219de90c1f43 |
children | 95083d2f6819 |
comparison
equal
deleted
inserted
replaced
3836:0c16051dfd56 | 3837:963ea9fab402 |
---|---|
44 class PamReader : public ImageAccessor | 44 class PamReader : public ImageAccessor |
45 { | 45 { |
46 private: | 46 private: |
47 void ParseContent(); | 47 void ParseContent(); |
48 | 48 |
49 /** | |
50 Whether we want to use the default malloc alignment in the image buffer, | |
51 at the expense of an extra copy | |
52 */ | |
53 bool enforceAligned_; | |
54 | |
55 /** | |
56 This is actually a copy of wrappedContent_, but properly aligned. | |
57 | |
58 It is only used if the enforceAligned parameter is set to true in the | |
59 constructor. | |
60 */ | |
61 void* alignedImageBuffer_; | |
62 | |
63 /** | |
64 Points somewhere in the content_ buffer. | |
65 */ | |
66 ImageAccessor wrappedContent_; | |
67 | |
68 /** | |
69 Raw content (file bytes or answer from the server, for instance). | |
70 */ | |
49 std::string content_; | 71 std::string content_; |
50 | 72 |
51 public: | 73 public: |
74 /** | |
75 See doc for field enforceAligned_ | |
76 */ | |
77 PamReader(bool enforceAligned = false) : | |
78 enforceAligned_(enforceAligned), | |
79 alignedImageBuffer_(NULL) | |
80 { | |
81 } | |
82 | |
83 virtual ~PamReader() | |
84 { | |
85 // freeing NULL is OK | |
86 free(alignedImageBuffer_); | |
87 } | |
52 | 88 |
53 #if ORTHANC_SANDBOXED == 0 | 89 #if ORTHANC_SANDBOXED == 0 |
54 void ReadFromFile(const std::string& filename); | 90 void ReadFromFile(const std::string& filename); |
55 #endif | 91 #endif |
56 | 92 |