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#ifdef HAVE_CONFIG_H
8#include "config.h"
9#endif
10
11#include "app/render/simple_renderer.h"
12
13namespace app {
14
15void SimpleRenderer::setRefLayersVisiblity(const bool visible)
16{
17 m_render.setRefLayersVisiblity(visible);
18}
19
20void SimpleRenderer::setNonactiveLayersOpacity(const int opacity)
21{
22 m_render.setNonactiveLayersOpacity(opacity);
23}
24
25void SimpleRenderer::setNewBlendMethod(const bool newBlend)
26{
27 m_render.setNewBlend(newBlend);
28}
29
30void SimpleRenderer::setBgOptions(const render::BgOptions& bg)
31{
32 m_render.setBgOptions(bg);
33}
34
35void SimpleRenderer::setProjection(const render::Projection& projection)
36{
37 m_render.setProjection(projection);
38}
39
40void SimpleRenderer::setSelectedLayer(const doc::Layer* layer)
41{
42 m_render.setSelectedLayer(layer);
43}
44
45void SimpleRenderer::setPreviewImage(const doc::Layer* layer,
46 const doc::frame_t frame,
47 const doc::Image* image,
48 const doc::Tileset* tileset,
49 const gfx::Point& pos,
50 const doc::BlendMode blendMode)
51{
52 m_render.setPreviewImage(layer, frame, image, tileset,
53 pos, blendMode);
54}
55
56void SimpleRenderer::removePreviewImage()
57{
58 m_render.removePreviewImage();
59}
60
61void SimpleRenderer::setExtraImage(render::ExtraType type,
62 const doc::Cel* cel,
63 const doc::Image* image,
64 const doc::BlendMode blendMode,
65 const doc::Layer* currentLayer,
66 const doc::frame_t currentFrame)
67{
68 m_render.setExtraImage(type, cel, image, blendMode,
69 currentLayer, currentFrame);
70}
71
72void SimpleRenderer::removeExtraImage()
73{
74 m_render.removeExtraImage();
75}
76
77void SimpleRenderer::setOnionskin(const render::OnionskinOptions& options)
78{
79 m_render.setOnionskin(options);
80}
81
82void SimpleRenderer::disableOnionskin()
83{
84 m_render.disableOnionskin();
85}
86
87void SimpleRenderer::renderSprite(doc::Image* dstImage,
88 const doc::Sprite* sprite,
89 const doc::frame_t frame)
90{
91 m_render.renderSprite(dstImage, sprite, frame);
92}
93
94void SimpleRenderer::renderSprite(doc::Image* dstImage,
95 const doc::Sprite* sprite,
96 const doc::frame_t frame,
97 const gfx::ClipF& area)
98{
99 m_render.renderSprite(dstImage, sprite, frame, area);
100}
101
102void SimpleRenderer::renderCheckeredBackground(doc::Image* dstImage,
103 const gfx::Clip& area)
104{
105 m_render.renderCheckeredBackground(dstImage, area);
106}
107
108void SimpleRenderer::renderImage(doc::Image* dstImage,
109 const doc::Image* srcImage,
110 const doc::Palette* pal,
111 const int x,
112 const int y,
113 const int opacity,
114 const doc::BlendMode blendMode)
115{
116 m_render.renderImage(dstImage, srcImage, pal,
117 x, y, opacity, blendMode);
118}
119
120} // namespace app
121