Mercurial > hg > orthanc
comparison Core/DicomFormat/DicomIntegerPixelAccessor.h @ 945:427a1f996b7b templating
integration mainline -> templating
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Jun 2014 11:56:48 +0200 |
parents | ff530685e46a |
children | 851a55d183c9 |
comparison
equal
deleted
inserted
replaced
838:aabc3b430890 | 945:427a1f996b7b |
---|---|
32 | 32 |
33 #pragma once | 33 #pragma once |
34 | 34 |
35 #include "DicomMap.h" | 35 #include "DicomMap.h" |
36 | 36 |
37 #include "DicomImageInformation.h" | |
38 | |
37 #include <stdint.h> | 39 #include <stdint.h> |
38 | 40 |
39 namespace Orthanc | 41 namespace Orthanc |
40 { | 42 { |
41 class DicomIntegerPixelAccessor | 43 class DicomIntegerPixelAccessor |
42 { | 44 { |
43 private: | 45 private: |
44 unsigned int width_; | 46 DicomImageInformation information_; |
45 unsigned int height_; | 47 |
46 unsigned int samplesPerPixel_; | 48 uint32_t signMask_; |
47 unsigned int numberOfFrames_; | 49 uint32_t mask_; |
48 unsigned int planarConfiguration_; | 50 |
49 const void* pixelData_; | 51 const void* pixelData_; |
50 size_t size_; | 52 size_t size_; |
51 | |
52 uint8_t shift_; | |
53 uint32_t signMask_; | |
54 uint32_t mask_; | |
55 size_t bytesPerPixel_; | |
56 unsigned int frame_; | 53 unsigned int frame_; |
57 | |
58 size_t frameOffset_; | 54 size_t frameOffset_; |
59 size_t rowOffset_; | 55 size_t rowOffset_; |
60 | 56 |
61 public: | 57 public: |
62 DicomIntegerPixelAccessor(const DicomMap& values, | 58 DicomIntegerPixelAccessor(const DicomMap& values, |
63 const void* pixelData, | 59 const void* pixelData, |
64 size_t size); | 60 size_t size); |
65 | 61 |
66 unsigned int GetWidth() const | 62 const DicomImageInformation GetInformation() const |
67 { | 63 { |
68 return width_; | 64 return information_; |
69 } | |
70 | |
71 unsigned int GetHeight() const | |
72 { | |
73 return height_; | |
74 } | |
75 | |
76 unsigned int GetNumberOfFrames() const | |
77 { | |
78 return numberOfFrames_; | |
79 } | 65 } |
80 | 66 |
81 unsigned int GetCurrentFrame() const | 67 unsigned int GetCurrentFrame() const |
82 { | 68 { |
83 return frame_; | 69 return frame_; |
86 void SetCurrentFrame(unsigned int frame); | 72 void SetCurrentFrame(unsigned int frame); |
87 | 73 |
88 void GetExtremeValues(int32_t& min, | 74 void GetExtremeValues(int32_t& min, |
89 int32_t& max) const; | 75 int32_t& max) const; |
90 | 76 |
91 unsigned int GetChannelCount() const | 77 int32_t GetValue(unsigned int x, unsigned int y, unsigned int channel = 0) const; |
78 | |
79 const void* GetPixelData() const | |
92 { | 80 { |
93 return samplesPerPixel_; | 81 return pixelData_; |
94 } | 82 } |
95 | |
96 int32_t GetValue(unsigned int x, unsigned int y, unsigned int channel = 0) const; | |
97 }; | 83 }; |
98 } | 84 } |