FCT
载入中...
搜索中...
未找到
Image.h
浏览该文件的文档.
1//
2// Created by Administrator on 2025/3/5.
3//
4
5#ifndef FCT_IMAGE_H
6#define FCT_IMAGE_H
7#include "./IRenderTarget.h"
9#include "../RHI/Fence.h"
11#include "../Type/type.h"
12
13namespace FCT {
14 class Context;
15 namespace RHI
16 {
17 class Image;
18 class Fence;
19 class TextureView;
20 class DepthStencilView;
21 class RenderTargetView;
22 }
23
24 class Image;
26 {
27 public:
28 virtual Format format() const = 0;
29 virtual Samples samples() const = 0;
30 protected:
32 };
34 {
35 public:
37 Format format() const;
38 Samples samples() const;
39 private:
40
41 };
43 {
45 std::function<void()> cleanUpCallback;
46 void waitFor();
47 uint8_t currentFrame;
48 };
49 class Image : public RefCount, public IRenderTarget {
50 public:
52 //friend class AfterCreateImageBehavior;
53
54 Image(Context* ctx);
55 virtual ~Image();
56
57 RenderTargetType getType() const override { return m_renderTargetType; }
59
60 virtual void create() = 0;
61 virtual void as(ImageUsages usage) = 0;
62 virtual void bind(Context* ctx) {}
63
64 Format format() const { return m_behavior->format(); }
65 Samples samples() const { return m_behavior->samples(); }
66
67 virtual RHI::Image* currentImage() = 0;
68
69 virtual void resize(uint32_t width, uint32_t height) = 0;
70 virtual Image* getImage() const { return nullptr; }
71 virtual std::vector<Image*> getTargetImages() = 0;
75 int width() const { return m_width; }
76 int height() const { return m_height; }
77 void width(int width) { m_width = width; }
78 void height(int height) { m_height = height; }
81 virtual UpdateResult* updateToCurrent(void* data,size_t size)
82 {
83 return nullptr;
84 };
85 virtual size_t textureViewHash() const = 0;
86 protected:
94 };
95} // namespace FCT
96
97#endif //FCT_IMAGE_H
BeforeCreateImageBehavior(Image *image)
virtual Samples samples() const =0
virtual Format format() const =0
virtual RHI::TextureView * currentTextureView()=0
ImageBehavior * m_behavior
定义 Image.h:87
virtual void create()=0
void samples(Samples samples)
定义 Image.h:80
virtual ~Image()
void height(int height)
定义 Image.h:78
virtual void bind(Context *ctx)
定义 Image.h:62
Context * m_ctx
定义 Image.h:88
virtual size_t textureViewHash() const =0
Image(Context *ctx)
virtual UpdateResult * updateToCurrent(void *data, size_t size)
定义 Image.h:81
virtual RHI::Image * currentImage()=0
RenderTargetType getType() const override
定义 Image.h:57
Samples samples() const
定义 Image.h:65
virtual std::vector< Image * > getTargetImages()=0
virtual void as(ImageUsages usage)=0
Samples m_samples
定义 Image.h:92
virtual RHI::DepthStencilView * currentDepthStencilView()=0
friend class BeforeCreateImageBehavior
定义 Image.h:51
Format m_format
定义 Image.h:91
virtual Image * getImage() const
定义 Image.h:70
Format format() const
定义 Image.h:64
virtual RHI::RenderTargetView * currentTargetView()=0
int height() const
定义 Image.h:76
virtual void resize(uint32_t width, uint32_t height)=0
RenderTargetType m_renderTargetType
定义 Image.h:93
void renderTargetType(RenderTargetType type)
定义 Image.h:58
void width(int width)
定义 Image.h:77
void format(Format format)
定义 Image.h:79
int width() const
定义 Image.h:75
RHI::Fence * fence
定义 Image.h:44
std::function< void()> cleanUpCallback
定义 Image.h:45