hyprlock/src/renderer/widgets/Background.hpp

38 lines
1.1 KiB
C++
Raw Normal View History

2024-02-18 23:08:03 +00:00
#pragma once
#include "IWidget.hpp"
#include "../../helpers/Vector2D.hpp"
#include "../../helpers/Color.hpp"
2024-02-21 22:19:01 +00:00
#include "../Framebuffer.hpp"
2024-02-18 23:08:03 +00:00
#include <string>
2024-02-21 22:19:01 +00:00
#include <unordered_map>
#include <any>
2024-02-18 23:08:03 +00:00
struct SPreloadedAsset;
class COutput;
2024-02-18 23:08:03 +00:00
class CBackground : public IWidget {
public:
CBackground(const Vector2D& viewport, COutput* output_, const std::string& resourceID, const std::unordered_map<std::string, std::any>& props, bool ss_);
2024-02-18 23:08:03 +00:00
2024-02-19 16:26:08 +00:00
virtual bool draw(const SRenderData& data);
void renderRect(CColor color);
2024-02-18 23:08:03 +00:00
private:
2024-02-21 22:19:01 +00:00
// if needed
CFramebuffer blurredFB;
int blurSize = 10;
int blurPasses = 3;
float noise = 0.0117;
float contrast = 0.8916;
float brightness = 0.8172;
float vibrancy = 0.1696;
float vibrancy_darkness = 0.0;
2024-02-18 23:08:03 +00:00
Vector2D viewport;
std::string resourceID;
CColor color;
SPreloadedAsset* asset = nullptr;
COutput* output = nullptr;
bool isScreenshot = false;
2024-02-18 23:08:03 +00:00
};