1// Aseprite
2// Copyright (C) 2022 Igara Studio S.A.
3//
4// This program is distributed under the terms of
5// the End-User License Agreement for Aseprite.
6
7#ifndef APP_RENDER_SIMPLE_RENDERER_H_INCLUDED
8#define APP_RENDER_SIMPLE_RENDERER_H_INCLUDED
9#pragma once
10
11#include "app/render/renderer.h"
12
13namespace app {
14
15 // Represents the way to render sprites on Aseprite (Old and "New")
16 // which use the render::Render class to render sprites with the
17 // CPU-only.
18 class SimpleRenderer : public Renderer {
19 public:
20 void setRefLayersVisiblity(const bool visible) override;
21 void setNonactiveLayersOpacity(const int opacity) override;
22 void setNewBlendMethod(const bool newBlend) override;
23 void setBgOptions(const render::BgOptions& bg) override;
24 void setProjection(const render::Projection& projection) override;
25
26 void setSelectedLayer(const doc::Layer* layer) override;
27 void setPreviewImage(const doc::Layer* layer,
28 const doc::frame_t frame,
29 const doc::Image* image,
30 const doc::Tileset* tileset,
31 const gfx::Point& pos,
32 const doc::BlendMode blendMode) override;
33 void removePreviewImage() override;
34 void setExtraImage(render::ExtraType type,
35 const doc::Cel* cel,
36 const doc::Image* image,
37 const doc::BlendMode blendMode,
38 const doc::Layer* currentLayer,
39 const doc::frame_t currentFrame) override;
40 void removeExtraImage() override;
41 void setOnionskin(const render::OnionskinOptions& options) override;
42 void disableOnionskin() override;
43
44 void renderSprite(doc::Image* dstImage,
45 const doc::Sprite* sprite,
46 const doc::frame_t frame) override;
47 void renderSprite(doc::Image* dstImage,
48 const doc::Sprite* sprite,
49 const doc::frame_t frame,
50 const gfx::ClipF& area) override;
51 void renderCheckeredBackground(doc::Image* dstImage,
52 const gfx::Clip& area) override;
53 void renderImage(doc::Image* dstImage,
54 const doc::Image* srcImage,
55 const doc::Palette* pal,
56 const int x,
57 const int y,
58 const int opacity,
59 const doc::BlendMode blendMode) override;
60 private:
61 render::Render m_render;
62 };
63
64} // namespace app
65
66#endif
67