human_render/src/ImageBuffer.h

39 lines
815 B
C
Raw Normal View History

2024-11-30 17:10:43 +00:00
#pragma once
#include <vector>
#include <queue>
#include "Core/Core.h"
#include "Core/Singleton.h"
class ImageBuffer : public Singleton<ImageBuffer> {
public:
enum class IBType {
Background,
};
public:
explicit ImageBuffer() noexcept = default;
~ImageBuffer() = default;
ImageBuffer(const ImageBuffer&) = delete;
ImageBuffer& operator=(const ImageBuffer&) = delete;
void PushImage(IBType type, std::vector<uint8> data, uint32 width, uint32 height, uint32 comp);
private:
void PushBackgroundImage(std::vector<uint8> data, uint32 width, uint32 height, uint32 comp);
private:
struct Image {
std::vector<uint8> data;
uint32 width;
uint32 height;
uint32 comp;
};
CriticalSection cs_;
std::queue<Image> background_;
};