SDLPainter 0.1.0
QPainter benzeri SDL3 + OpenGL/Vulkan 2D çizim kütüphanesi
Yüklüyor...
Arıyor...
Eşleşme Yok
brush.h
1#pragma once
2
3#include "sdl_painter/color.h"
4
5namespace sdl_painter {
6
8class Brush {
9 public:
11 Brush() = default;
12
14 explicit Brush(const Color& color) : mColor(color) {}
15
17 [[nodiscard]] const Color& GetColor() const noexcept { return mColor; }
18
20 void SetColor(const Color& color) noexcept { mColor = color; }
21
23 [[nodiscard]] bool IsVisible() const noexcept { return mColor.a > 0; }
24
25 [[nodiscard]] bool operator==(const Brush& other) const noexcept {
26 return mColor == other.mColor;
27 }
28 [[nodiscard]] bool operator!=(const Brush& other) const noexcept {
29 return !(*this == other);
30 }
31
33 [[nodiscard]] static Brush NoBrush() noexcept {
34 return Brush(Color::Transparent());
35 }
36
37 private:
38 Color mColor{Color::Black()};
39};
40
41} // namespace sdl_painter
Dolgu stili — renk tabanlı düz dolgu.
Definition brush.h:8
bool IsVisible() const noexcept
Fırça görünür mü? (alpha > 0).
Definition brush.h:23
const Color & GetColor() const noexcept
Dolgu rengini döndür.
Definition brush.h:17
Brush()=default
Varsayılan fırça: siyah, tam opak.
void SetColor(const Color &color) noexcept
Dolgu rengini ayarla.
Definition brush.h:20
Brush(const Color &color)
Renk ile fırça oluştur.
Definition brush.h:14
static Brush NoBrush() noexcept
Şeffaf (dolgu yapmayan) fırça.
Definition brush.h:33
RGBA renk temsili. Her kanal [0, 255] aralığında.
Definition color.h:8