载入中...
搜索中...
未找到
Canvas.h
浏览该文件的文档.
1#pragma once
2
3#include "graphics/Color.h"
4#include "graphics/Drawable.h"
5
6#include <optional>
7
8namespace eve::image {
9class ImageData;
10}
11
12namespace eve::graphics {
13
14class Texture;
15
17class Canvas : public Drawable {
18public:
19 // Canvas adds a canvas-to-canvas composite overload; keep the base
20 // Drawable::draw(Graphics*, mat4) visible (it is overridden by the
21 // concrete canvas implementations).
22 using Drawable::draw;
23
25 Canvas() {}
27 ~Canvas() override {}
28
30 virtual int getWidth() const = 0;
32 virtual int getHeight() const = 0;
33
35 virtual Texture *getTexture() = 0;
36
38 virtual void clear(std::optional<Color> color, std::optional<int> stencil,
39 std::optional<double> depth) = 0;
40
42 virtual Color getPixel(int x, int y) = 0;
43
47
53 virtual image::ImageData *newHDRImageData() { return nullptr; }
54
56 virtual void draw(Canvas *C, const glm::mat4 &matrix) const = 0;
57};
58
59} // namespace eve::graphics
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
std::uint32_t depth
Canvas public API.
Definition Canvas.h:17
virtual int getWidth() const =0
Returns the width.
virtual Color getPixel(int x, int y)=0
Returns the pixel.
virtual image::ImageData * newImageData()=0
Creates a image data. @ownership Caller deletes unless documented otherwise.
virtual image::ImageData * newHDRImageData()
Copy an HDR Canvas as linear RGBA16F without tone mapping.
Definition Canvas.h:53
virtual void draw(Canvas *C, const glm::mat4 &matrix) const =0
Draws .
virtual void clear(std::optional< Color > color, std::optional< int > stencil, std::optional< double > depth)=0
Clears .
Canvas()
Constructs a Canvas.
Definition Canvas.h:25
virtual Texture * getTexture()=0
Sampleable color buffer; screen Canvas returns nullptr.
virtual int getHeight() const =0
Returns the height.
~Canvas() override
Releases Canvas resources.
Definition Canvas.h:27
Drawable base (textures, meshes, canvases).
Definition Drawable.h:17
virtual void draw(Graphics *gfx, const glm::mat4 &matrix) const =0
Draws the object with the specified transformation matrix.
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
Represents raw pixel data.
Definition ImageData.h:38
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
eve::Color Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
glm::vec4 color