3#include "sdl_painter/color.h"
16 explicit Pen(
const Color& color,
float width = 1.0F)
17 : mColor(color), mWidth(width) {}
33 mOutlineColor(outline_color),
34 mOutlineWidth(outline_width) {}
40 [[nodiscard]]
float GetWidth() const noexcept {
return mWidth; }
54 void SetWidth(
float width)
noexcept { mWidth = width; }
64 return mColor.a > 0 && mWidth > 0.0F;
69 return mOutlineColor.a > 0 && mOutlineWidth > 0.0F;
72 [[nodiscard]]
bool operator==(
const Pen& other)
const noexcept {
73 return mColor == other.mColor && mWidth == other.mWidth &&
74 mOutlineColor == other.mOutlineColor &&
75 mOutlineWidth == other.mOutlineWidth;
77 [[nodiscard]]
bool operator!=(
const Pen& other)
const noexcept {
78 return !(*
this == other);
83 return Pen(Color::Transparent(), 0.0F);
87 Color mColor{Color::Black()};
89 Color mOutlineColor{Color::Transparent()};
90 float mOutlineWidth{0.0F};
Çizgi stili — renk, kalınlık ve isteğe bağlı dış kontur.
Definition pen.h:8
const Color & GetOutlineColor() const noexcept
Dış kontur rengini döndür.
Definition pen.h:43
void SetOutlineWidth(float width) noexcept
Dış kontur kalınlığını ayarla.
Definition pen.h:60
bool IsVisible() const noexcept
Kalem görünür mü? (alpha > 0 ve width > 0).
Definition pen.h:63
void SetWidth(float width) noexcept
Çizgi kalınlığını ayarla.
Definition pen.h:54
static Pen NoPen() noexcept
Şeffaf (çizim yapmayan) kalem.
Definition pen.h:82
bool HasOutline() const noexcept
Kalemin görünür bir dış konturu var mı?
Definition pen.h:68
Pen(const Color &color, float width=1.0F)
Renk ve kalınlıkla kalem oluştur.
Definition pen.h:16
float GetWidth() const noexcept
Çizgi kalınlığını döndür.
Definition pen.h:40
void SetOutlineColor(const Color &color) noexcept
Dış kontur rengini ayarla.
Definition pen.h:57
const Color & GetColor() const noexcept
Çizgi rengini döndür.
Definition pen.h:37
float GetOutlineWidth() const noexcept
Dış kontur kalınlığını döndür.
Definition pen.h:48
void SetColor(const Color &color) noexcept
Çizgi rengini ayarla.
Definition pen.h:51
Pen(const Color &color, float width, const Color &outline_color, float outline_width)
Dış konturlu (outline) kalem oluştur.
Definition pen.h:29
Pen()=default
Varsayılan kalem: siyah, 1 piksel kalınlık.
RGBA renk temsili. Her kanal [0, 255] aralığında.
Definition color.h:8