40#ifndef INCLUDE_GUARD_EUNOMIA_IMAGEBUFFER_H
41#define INCLUDE_GUARD_EUNOMIA_IMAGEBUFFER_H
131 {
return reinterpret_cast<const C_*
>(
buf_ +
pitch_ * y); }
164 const C_&
at(
int x,
int y)
const
193 int left,
int top,
int right,
int bottom,
const C_&
color,
204 int x,
int y,
int a,
int b,
const C_&
color,
bool fill =
false);
253 template<
class CSrc,
class Copier>
276 int dx,
int dy,
const std::optional<Rect>&
cliprect = std::nullopt)
298 for (
int j = 0;
j <
h_; ++
j)
314 = pixel.red * 0.2990 + pixel.green * 0.5870 + pixel.blue * 0.1140;
例外
Definition exception.h:50
畫像バッファ基底クラステンプレート
Definition imagebuffer.h:84
void paintFill(int x, int y, const C_ &color)
塗り潰し
Definition ibuf_draw.h:375
void forEachPixel(Func func)
畫素毎の處理
Definition imagebuffer.h:296
void clear(const C_ &color)
バッファ全體の塗り潰し
Definition ibuf_draw.h:45
int width() const noexcept
幅
Definition imagebuffer.h:114
ImageBuffer(int w, int h, int p) noexcept
構築子
Definition imagebuffer.h:101
int pitch() const noexcept
ピッチ
Definition imagebuffer.h:118
void blt(const ImageBuffer< CSrc > &src, int sx, int sy, int w, int h, int dx, int dy, const std::optional< Rect > &cliprect, Copier copier)
轉送
std::uint8_t * buf_
畫像バッファ
Definition imagebuffer.h:89
void circle(int x, int y, int r, const C_ &color, bool fill=false)
圓の描畫
Definition imagebuffer.h:212
const C_ & at(int x, int y) const
畫素(x, y)の參照
Definition imagebuffer.h:164
C_ ColourType
Definition imagebuffer.h:86
void line(int x1, int y1, int x2, int y2, const C_ &color)
線分の描畫
Definition ibuf_draw.h:60
C_ & pixel(int x, int y) noexcept
畫素(x, y)の參照
Definition imagebuffer.h:140
const C_ * lineBuffer(int y) const noexcept
ラインバッファの先頭アドレスの取得
Definition imagebuffer.h:130
C_ * lineBuffer(int y) noexcept
ラインバッファの先頭アドレスの取得
Definition imagebuffer.h:126
uint8_t * buffer() noexcept
バッファの先頭アドレスの取得
Definition imagebuffer.h:121
void ellipse(int x, int y, int a, int b, const C_ &color, bool fill=false)
楕圓の描畫
Definition ibuf_draw.h:258
int w_
幅
Definition imagebuffer.h:90
C_ & at(int x, int y)
畫素(x, y)の參照
Definition imagebuffer.h:152
int h_
高さ
Definition imagebuffer.h:91
void blt(const ImageBuffer< CSrc > &src, int sx, int sy, int w, int h, int dx, int dy, const std::optional< Rect > &cliprect=std::nullopt)
轉送
Definition imagebuffer.h:274
virtual ~ImageBuffer()=default
解體子
int pitch_
ピッチ = 水平方向1ラインのビット數
Definition imagebuffer.h:92
const C_ & pixel(int x, int y) const noexcept
畫素(x, y)の參照
Definition imagebuffer.h:145
int height() const noexcept
高さ
Definition imagebuffer.h:116
const uint8_t * buffer() const noexcept
バッファの先頭アドレスの取得
Definition imagebuffer.h:123
void box(int left, int top, int right, int bottom, const C_ &color, bool fill=false)
長方形の描畫
Definition ibuf_draw.h:200
コピー禁止クラステンプレート
Definition noncopyable.h:60
範圍逸脱例外
Definition imagebuffer.h:71
RangeOverException()
Definition imagebuffer.h:73
void grayscale(C_ &pixel)
グレイスケール化
Definition imagebuffer.h:311
點
Definition imagebuffer.h:58
int y
Y座標
Definition imagebuffer.h:60
constexpr Point(int xx, int yy) noexcept
Definition imagebuffer.h:63
int x
X座標
Definition imagebuffer.h:59