39 lines
815 B
C
39 lines
815 B
C
|
#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_;
|
||
|
|
||
|
|
||
|
};
|