comparison Framework/Layers/FrameRenderer.h @ 77:f5f54ed8d307 wasm

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 May 2017 21:13:29 +0200
parents 28956ed68280
children bd48431ac285
comparison
equal deleted inserted replaced
76:0aef120d7e1c 77:f5f54ed8d307
21 21
22 #pragma once 22 #pragma once
23 23
24 #include "ILayerRenderer.h" 24 #include "ILayerRenderer.h"
25 25
26 #include "../Toolbox/SliceGeometry.h" 26 #include "../Toolbox/Slice.h"
27 27
28 namespace OrthancStone 28 namespace OrthancStone
29 { 29 {
30 class FrameRenderer : public ILayerRenderer 30 class FrameRenderer : public ILayerRenderer
31 { 31 {
32 private: 32 private:
33 SliceGeometry viewportSlice_;
34 SliceGeometry frameSlice_; 33 SliceGeometry frameSlice_;
35 double pixelSpacingX_; 34 double pixelSpacingX_;
36 double pixelSpacingY_; 35 double pixelSpacingY_;
37 RenderStyle style_; 36 RenderStyle style_;
38 bool isFullQuality_; 37 bool isFullQuality_;
42 41
43 protected: 42 protected:
44 virtual CairoSurface* GenerateDisplay(const RenderStyle& style) = 0; 43 virtual CairoSurface* GenerateDisplay(const RenderStyle& style) = 0;
45 44
46 public: 45 public:
47 FrameRenderer(const SliceGeometry& viewportSlice, 46 FrameRenderer(const SliceGeometry& frameSlice,
48 const SliceGeometry& frameSlice,
49 double pixelSpacingX, 47 double pixelSpacingX,
50 double pixelSpacingY, 48 double pixelSpacingY,
51 bool isFullQuality); 49 bool isFullQuality);
52 50
51 // TODO Remove this overload
53 static bool ComputeFrameExtent(double& x1, 52 static bool ComputeFrameExtent(double& x1,
54 double& y1, 53 double& y1,
55 double& x2, 54 double& x2,
56 double& y2, 55 double& y2,
57 const SliceGeometry& viewportSlice, 56 const SliceGeometry& viewportSlice,
59 unsigned int frameWidth, 58 unsigned int frameWidth,
60 unsigned int frameHeight, 59 unsigned int frameHeight,
61 double pixelSpacingX, 60 double pixelSpacingX,
62 double pixelSpacingY); 61 double pixelSpacingY);
63 62
63 static bool ComputeFrameExtent(double& x1,
64 double& y1,
65 double& x2,
66 double& y2,
67 const SliceGeometry& viewportSlice,
68 const Slice& slice)
69 {
70 return ComputeFrameExtent(x1, y1, x2, y2, viewportSlice,
71 slice.GetGeometry(), slice.GetWidth(), slice.GetHeight(),
72 slice.GetPixelSpacingX(), slice.GetPixelSpacingY());
73 }
74
64 virtual bool RenderLayer(CairoContext& context, 75 virtual bool RenderLayer(CairoContext& context,
65 const ViewportGeometry& view); 76 const ViewportGeometry& view,
77 const SliceGeometry& viewportSlice);
66 78
67 virtual void SetLayerStyle(const RenderStyle& style); 79 virtual void SetLayerStyle(const RenderStyle& style);
68 80
69 virtual bool IsFullQuality() 81 virtual bool IsFullQuality()
70 { 82 {
71 return isFullQuality_; 83 return isFullQuality_;
72 } 84 }
73 85
86 // TODO Remove this overload
74 static ILayerRenderer* CreateRenderer(Orthanc::ImageAccessor* frame, 87 static ILayerRenderer* CreateRenderer(Orthanc::ImageAccessor* frame,
75 const SliceGeometry& viewportSlice,
76 const SliceGeometry& frameSlice, 88 const SliceGeometry& frameSlice,
77 const OrthancPlugins::IDicomDataset& dicom, 89 const OrthancPlugins::IDicomDataset& dicom,
78 double pixelSpacingX, 90 double pixelSpacingX,
79 double pixelSpacingY, 91 double pixelSpacingY,
80 bool isFullQuality); 92 bool isFullQuality);
93
94 static ILayerRenderer* CreateRenderer(Orthanc::ImageAccessor* frame,
95 const Slice& slice,
96 bool isFullQuality);
81 }; 97 };
82 } 98 }