mirror of
https://github.com/hyprwm/hyprgraphics.git
synced 2025-12-31 00:10:06 +01:00
fix naming
This commit is contained in:
parent
6ba2c4cfb1
commit
e4a92f04c0
3 changed files with 6 additions and 5 deletions
|
|
@ -6,14 +6,14 @@
|
|||
#include <hyprutils/memory/SharedPtr.hpp>
|
||||
|
||||
namespace Hyprgraphics {
|
||||
enum EImageFormat {
|
||||
enum eImageFormat {
|
||||
IMAGE_FORMAT_PNG
|
||||
};
|
||||
|
||||
class CImage {
|
||||
public:
|
||||
CImage(const std::string& path);
|
||||
CImage(const std::span<uint8_t>&, EImageFormat);
|
||||
CImage(const std::span<uint8_t>&, eImageFormat);
|
||||
~CImage();
|
||||
|
||||
CImage(const CImage&) = delete;
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
using namespace Hyprgraphics;
|
||||
using namespace Hyprutils::Memory;
|
||||
|
||||
Hyprgraphics::CImage::CImage(const std::span<uint8_t>& data, EImageFormat format) {
|
||||
Hyprgraphics::CImage::CImage(const std::span<uint8_t>& data, eImageFormat format) {
|
||||
std::expected<cairo_surface_t*, std::string> CAIROSURFACE;
|
||||
if (format == EImageFormat::IMAGE_FORMAT_PNG) {
|
||||
if (format == eImageFormat::IMAGE_FORMAT_PNG) {
|
||||
CAIROSURFACE = PNG::createSurfaceFromPNG(data);
|
||||
mime = "image/png";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@
|
|||
#include <expected>
|
||||
#include <png.h>
|
||||
#include <span>
|
||||
#include <cstdint>
|
||||
|
||||
namespace PNG {
|
||||
std::expected<cairo_surface_t*, std::string> createSurfaceFromPNG(const std::string&);
|
||||
std::expected<cairo_surface_t*, std::string> createSurfaceFromPNG(const std::span<u_int8_t>&);
|
||||
std::expected<cairo_surface_t*, std::string> createSurfaceFromPNG(const std::span<uint8_t>&);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue