FrontendCommon: Add a post processing implementation
This commit is contained in:
36
src/frontend-common/postprocessing_chain.h
Normal file
36
src/frontend-common/postprocessing_chain.h
Normal file
@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include "postprocessing_shader.h"
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace FrontendCommon {
|
||||
|
||||
class PostProcessingChain
|
||||
{
|
||||
public:
|
||||
PostProcessingChain();
|
||||
~PostProcessingChain();
|
||||
|
||||
ALWAYS_INLINE bool IsEmpty() const { return m_shaders.empty(); }
|
||||
ALWAYS_INLINE const u32 GetStageCount() const { return static_cast<u32>(m_shaders.size()); }
|
||||
ALWAYS_INLINE const PostProcessingShader& GetShaderStage(u32 i) const { return m_shaders[i]; }
|
||||
ALWAYS_INLINE PostProcessingShader& GetShaderStage(u32 i) { return m_shaders[i]; }
|
||||
|
||||
void AddShader(PostProcessingShader shader);
|
||||
bool AddStage(const std::string_view& name);
|
||||
void RemoveStage(u32 index);
|
||||
void MoveStageUp(u32 index);
|
||||
void MoveStageDown(u32 index);
|
||||
void ClearStages();
|
||||
|
||||
std::string GetConfigString() const;
|
||||
|
||||
bool CreateFromString(const std::string_view& chain_config);
|
||||
|
||||
static std::vector<std::string> GetAvailableShaderNames();
|
||||
|
||||
private:
|
||||
std::vector<PostProcessingShader> m_shaders;
|
||||
};
|
||||
|
||||
} // namespace FrontendCommon
|
||||
Reference in New Issue
Block a user