载入中...
搜索中...
未找到
IImageResourceFactory.h
浏览该文件的文档.
1#pragma once
2
5#include "common/Result.h"
6
7#include <cstdint>
8#include <span>
9
10namespace eve::graphics {
11
12class Texture;
13
16public:
18 virtual ~IImageResourceFactory() = default;
19
27 [[nodiscard]] virtual Result<Texture*> uploadRgba8(std::uint32_t width,
28 std::uint32_t height,
29 const std::uint8_t* pixels,
30 bool srgb) = 0;
31
41 [[nodiscard]] virtual Result<Texture*> uploadRgba8MipChain(uint32_t width, uint32_t height, uint32_t levels,
42 std::span<const uint8_t> pixels) {
43 (void)width;
44 (void)height;
45 (void)levels;
46 (void)pixels;
49 "image factory does not support explicit mips", {}, {},
50 "graphics.image.mips"));
51 }
52
66 [[nodiscard]] virtual Result<Texture*> uploadRgba8Volume(uint32_t width, uint32_t height, uint32_t depth,
67 std::span<const uint8_t> pixels) {
68 (void)width;
69 (void)height;
70 (void)depth;
71 (void)pixels;
74 "image factory does not support RGBA8 volumes", {}, {},
75 "graphics.image.volume"));
76 }
77
83 [[nodiscard]] virtual Result<void> releaseImage(Texture* texture) = 0;
84};
85
86} // namespace eve::graphics
std::uint32_t height
std::uint32_t width
uint8_t * pixels
Move-only, checked operation results for the common layer.
std::uint32_t depth
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
Move-only operation result carrying either a value or Status.
Definition Result.h:155
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Backend-owned RGBA8 texture upload and release operations.
virtual Result< Texture * > uploadRgba8MipChain(uint32_t width, uint32_t height, uint32_t levels, std::span< const uint8_t > pixels)
Upload complete explicit linear RGBA8 mips without regeneration.
virtual ~IImageResourceFactory()=default
Releases IImageResourceFactory resources.
virtual Result< void > releaseImage(Texture *texture)=0
Release a texture previously returned by this factory.
virtual Result< Texture * > uploadRgba8Volume(uint32_t width, uint32_t height, uint32_t depth, std::span< const uint8_t > pixels)
Upload one tightly packed linear RGBA8 volume.
virtual Result< Texture * > uploadRgba8(std::uint32_t width, std::uint32_t height, const std::uint8_t *pixels, bool srgb)=0
Upload one tightly packed, top-down RGBA8 image.
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25