MyScript Interactive Ink SDK  3.0.1
Renderer.h
1 // Copyright @ MyScript. All rights reserved.
2 
3 #pragma once
4 
5 #include <iink/IRenderTarget.h>
6 #include <iink/IRendererListener.h>
7 #include <iink/graphics/ICanvas.h>
8 #include <iink/graphics/Point.h>
9 #include <iink/graphics/IStrokerFactory.h>
10 
11 #include <memory>
12 
13 namespace myscript {
14 namespace iink {
15 
20 class Renderer
21 {
22 public:
23  virtual ~Renderer() = default;
24 
31  virtual void addListener(std::shared_ptr<IRendererListener> listener) = 0;
32 
39  virtual void removeListener(std::shared_ptr<IRendererListener> listener) = 0;
40 
47  virtual float getDpiX() const noexcept = 0;
48 
55  virtual float getDpiY() const noexcept = 0;
56 
62  virtual float getPixelSize() const noexcept = 0;
63 
69  virtual float getViewScale() noexcept = 0;
70 
77  virtual void setViewScale(float scale) = 0;
78 
85  virtual void zoom(float factor) = 0;
86 
94  virtual void zoomAt(graphics::Point p, float factor) = 0;
95 
101  virtual graphics::Point getViewOffset() const noexcept = 0;
102 
111  virtual void setViewOffset(float x, float y) = 0;
112 
118  virtual graphics::Transform getViewTransform() const noexcept = 0;
119 
126  virtual std::shared_ptr<IRenderTarget> getRenderTarget() const noexcept = 0;
127 
136  virtual void registerStroker(String name, std::shared_ptr<graphics::IStrokerFactory> factory) = 0;
137 
143  virtual void unregisterStroker(String name) noexcept = 0;
144 
159  virtual uint64_t drawModelAsync(int x, int y, int width, int height, graphics::ICanvas* canvas) = 0;
160 
167  virtual void commitModelDraw(uint64_t id) = 0;
168 
179  virtual void drawModel(int x, int y, int width, int height, graphics::ICanvas* canvas) = 0;
180 
191  virtual void drawCaptureStrokes(int x, int y, int width, int height, graphics::ICanvas* canvas) = 0;
192 };
193 
194 }
195 }
Definition: IRenderTarget.h:31
Definition: Renderer.h:21
virtual float getDpiX() const noexcept=0
virtual float getPixelSize() const noexcept=0
virtual void drawModel(int x, int y, int width, int height, graphics::ICanvas *canvas)=0
virtual std::shared_ptr< IRenderTarget > getRenderTarget() const noexcept=0
virtual ~Renderer()=default
virtual void unregisterStroker(String name) noexcept=0
virtual float getViewScale() noexcept=0
virtual void commitModelDraw(uint64_t id)=0
virtual void zoomAt(graphics::Point p, float factor)=0
virtual graphics::Point getViewOffset() const noexcept=0
virtual float getDpiY() const noexcept=0
virtual void drawCaptureStrokes(int x, int y, int width, int height, graphics::ICanvas *canvas)=0
virtual void addListener(std::shared_ptr< IRendererListener > listener)=0
virtual uint64_t drawModelAsync(int x, int y, int width, int height, graphics::ICanvas *canvas)=0
virtual void zoom(float factor)=0
virtual void removeListener(std::shared_ptr< IRendererListener > listener)=0
virtual void registerStroker(String name, std::shared_ptr< graphics::IStrokerFactory > factory)=0
virtual void setViewOffset(float x, float y)=0
virtual void setViewScale(float scale)=0
virtual graphics::Transform getViewTransform() const noexcept=0
Definition: String.h:30
Definition: Configuration.h:11