Files
MuditaOS/module-gui/gui/core/renderers/ArcRenderer.hpp
Maciej Janicki e6fdf0e22c [EGD-5333] Change renderer to follow command design pattern
Changes draw command implementation to properly follow
command design pattern. All drawing commands have been
moved to separate inheriting draw commands from renderer.

Other changes:
- New draw methods overloads have been added to pixel renderer.
 Now pixel rendering methods are in one class.
- Simplified draw commands naming.
- Changed variable naming in draw commands to be more verbose.
- Changed {x,y} pairs to Points where possible.
2021-02-03 16:24:48 +01:00

55 lines
1.4 KiB
C++

// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include "Color.hpp"
#include "Common.hpp"
#include "DrawCommand.hpp"
#include <module-utils/math/Math.hpp>
namespace gui
{
class Context;
} // namespace gui
namespace gui::renderer
{
class ArcRenderer
{
public:
struct DrawableStyle
{
Length penWidth{1};
Color color{ColorFullBlack};
static auto from(const DrawArc &command) -> DrawableStyle;
};
static void draw(Context *ctx,
Point center,
Length radius,
trigonometry::Degrees begin,
trigonometry::Degrees sweep,
const DrawableStyle &style);
private:
static void draw(Context *ctx,
Point center,
Length radius,
trigonometry::Degrees begin,
trigonometry::Degrees sweep,
Color color);
static void draw(Context *ctx,
Point center,
Length radius,
trigonometry::Degrees begin,
trigonometry::Degrees sweep,
Color color,
Length width);
};
} // namespace gui::renderer