mirror of
https://github.com/hyprwm/hyprgraphics.git
synced 2025-12-25 05:20:03 +01:00
start work on avif
This commit is contained in:
parent
4c1d63a0f2
commit
3b545552ec
3 changed files with 32 additions and 0 deletions
|
|
@ -74,6 +74,19 @@ else()
|
|||
add_compile_definitions(JXL_FOUND)
|
||||
endif()
|
||||
|
||||
pkg_check_modules(
|
||||
HEIF
|
||||
IMPORTED_TARGET
|
||||
libheif
|
||||
)
|
||||
|
||||
if(NOT HEIF_FOUND)
|
||||
file(GLOB_RECURSE HEIFFILES CONFIGURE_DEPENDS "src/*Avif.cpp")
|
||||
list(REMOVE_ITEM SRCFILES ${HEIFFILES})
|
||||
else()
|
||||
add_compile_definitions(HEIF_FOUND)
|
||||
endif()
|
||||
|
||||
add_library(hyprgraphics SHARED ${SRCFILES})
|
||||
target_include_directories(
|
||||
hyprgraphics
|
||||
|
|
@ -86,6 +99,10 @@ if(JXL_FOUND)
|
|||
target_link_libraries(hyprgraphics PkgConfig::JXL)
|
||||
endif()
|
||||
|
||||
if(HEIF_FOUND)
|
||||
target_link_libraries(hyprgraphics PkgConfig::HEIF)
|
||||
endif()
|
||||
|
||||
# tests
|
||||
add_custom_target(tests)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
#ifdef JXL_FOUND
|
||||
#include "formats/JpegXL.hpp"
|
||||
#endif
|
||||
#ifdef HEIF_FOUND
|
||||
#include "formats/Avif.hpp"
|
||||
#endif
|
||||
#include "formats/Webp.hpp"
|
||||
#include "formats/Png.hpp"
|
||||
#include <magic.h>
|
||||
|
|
|
|||
12
src/image/formats/Avif.hpp
Normal file
12
src/image/formats/Avif.hpp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <cairo/cairo.h>
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <expected>
|
||||
|
||||
namespace AVIF {
|
||||
std::expected<cairo_surface_t*, std::string> createSurfaceFromAvif(const std::string&);
|
||||
std::expected<cairo_surface_t*, std::string> createSurfaceFromAvif(const std::span<uint8_t>&);
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue