Mercurial > hg > orthanc-stone
diff Framework/Scene2D/Internals/CompositorHelper.h @ 889:6e79e8c9021c am-dev
integration mainline->am-dev
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 10 Jul 2019 12:05:02 +0200 |
parents | 6176917ef890 6e888cf6a48b |
children | e4ac54cb8771 |
line wrap: on
line diff
--- a/Framework/Scene2D/Internals/CompositorHelper.h Wed Jul 10 11:29:53 2019 +0200 +++ b/Framework/Scene2D/Internals/CompositorHelper.h Wed Jul 10 12:05:02 2019 +0200 @@ -36,15 +36,15 @@ { } - virtual unsigned int GetWidth() const = 0; - virtual unsigned int GetHeight() const = 0; + virtual unsigned int GetCanvasWidth() const = 0; + virtual unsigned int GetCanvasHeight() const = 0; virtual void Refresh() = 0; ScenePoint2D GetPixelCenterCoordinates(int x, int y) const { return ScenePoint2D( - static_cast<double>(x) + 0.5 - static_cast<double>(GetWidth()) / 2.0, - static_cast<double>(y) + 0.5 - static_cast<double>(GetHeight()) / 2.0); + static_cast<double>(x) + 0.5 - static_cast<double>(GetCanvasWidth()) / 2.0, + static_cast<double>(y) + 0.5 - static_cast<double>(GetCanvasHeight()) / 2.0); } }; @@ -61,7 +61,9 @@ { } - virtual void Render(const AffineTransform2D& transform) = 0; + virtual void Render(const AffineTransform2D& transform, + unsigned int canvasWidth, + unsigned int canvasHeight) = 0; // "Update()" is only called if the type of the layer has not changed virtual void Update(const ISceneLayer& layer) = 0; @@ -85,8 +87,12 @@ const Scene2D& scene_; IRendererFactory& factory_; Content content_; + + // Only valid during a call to Refresh() AffineTransform2D sceneTransform_; - + unsigned int canvasWidth_; + unsigned int canvasHeight_; + protected: virtual void Visit(const ISceneLayer& layer, uint64_t layerIdentifier,