Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyScene.h @ 409:99c9b3238008
AffineTransform2D
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 12 Nov 2018 15:38:11 +0100 |
parents | 6834c236b36d |
children | 6decc0ba9da5 |
comparison
equal
deleted
inserted
replaced
408:6834c236b36d | 409:99c9b3238008 |
---|---|
19 **/ | 19 **/ |
20 | 20 |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include "../Toolbox/AffineTransform2D.h" | |
24 #include "../Toolbox/Extent2D.h" | 25 #include "../Toolbox/Extent2D.h" |
25 #include "../Toolbox/LinearAlgebra.h" | |
26 #include "../Toolbox/OrthancApiClient.h" | 26 #include "../Toolbox/OrthancApiClient.h" |
27 #include "../Viewport/CairoContext.h" | 27 #include "../Viewport/CairoContext.h" |
28 | 28 |
29 | 29 |
30 namespace OrthancStone | 30 namespace OrthancStone |
43 Corner_TopRight, | 43 Corner_TopRight, |
44 Corner_BottomLeft, | 44 Corner_BottomLeft, |
45 Corner_BottomRight | 45 Corner_BottomRight |
46 }; | 46 }; |
47 | 47 |
48 | |
48 class Layer : public boost::noncopyable | 49 class Layer : public boost::noncopyable |
49 { | 50 { |
50 friend class RadiographyScene; | 51 friend class RadiographyScene; |
51 | 52 |
52 private: | 53 private: |
53 size_t index_; | 54 size_t index_; |
54 bool hasSize_; | 55 bool hasSize_; |
55 unsigned int width_; | 56 unsigned int width_; |
56 unsigned int height_; | 57 unsigned int height_; |
57 bool hasCrop_; | 58 bool hasCrop_; |
58 unsigned int cropX_; | 59 unsigned int cropX_; |
59 unsigned int cropY_; | 60 unsigned int cropY_; |
60 unsigned int cropWidth_; | 61 unsigned int cropWidth_; |
61 unsigned int cropHeight_; | 62 unsigned int cropHeight_; |
62 Matrix transform_; | 63 AffineTransform2D transform_; |
63 Matrix transformInverse_; | 64 AffineTransform2D transformInverse_; |
64 double pixelSpacingX_; | 65 double pixelSpacingX_; |
65 double pixelSpacingY_; | 66 double pixelSpacingY_; |
66 double panX_; | 67 double panX_; |
67 double panY_; | 68 double panY_; |
68 double angle_; | 69 double angle_; |
69 bool resizeable_; | 70 bool resizeable_; |
70 | 71 |
71 | 72 |
72 protected: | 73 protected: |
73 const Matrix& GetTransform() const | 74 const AffineTransform2D& GetTransform() const |
74 { | 75 { |
75 return transform_; | 76 return transform_; |
76 } | 77 } |
77 | 78 |
78 | 79 |
207 | 208 |
208 virtual bool GetDefaultWindowing(float& center, | 209 virtual bool GetDefaultWindowing(float& center, |
209 float& width) const = 0; | 210 float& width) const = 0; |
210 | 211 |
211 virtual void Render(Orthanc::ImageAccessor& buffer, | 212 virtual void Render(Orthanc::ImageAccessor& buffer, |
212 const Matrix& viewTransform, | 213 const AffineTransform2D& viewTransform, |
213 ImageInterpolation interpolation) const = 0; | 214 ImageInterpolation interpolation) const = 0; |
214 | 215 |
215 virtual bool GetRange(float& minValue, | 216 virtual bool GetRange(float& minValue, |
216 float& maxValue) const = 0; | 217 float& maxValue) const = 0; |
217 }; | 218 }; |
297 bool httpCompression); | 298 bool httpCompression); |
298 | 299 |
299 Extent2D GetSceneExtent() const; | 300 Extent2D GetSceneExtent() const; |
300 | 301 |
301 void Render(Orthanc::ImageAccessor& buffer, | 302 void Render(Orthanc::ImageAccessor& buffer, |
302 const Matrix& viewTransform, | 303 const AffineTransform2D& viewTransform, |
303 ImageInterpolation interpolation) const; | 304 ImageInterpolation interpolation) const; |
304 | 305 |
305 bool LookupLayer(size_t& index /* out */, | 306 bool LookupLayer(size_t& index /* out */, |
306 double x, | 307 double x, |
307 double y) const; | 308 double y) const; |