Skip to content

ko1N/hyprgraphics

 
 

Repository files navigation

hyprgraphics

Hyprgraphics is a small C++ library with graphics / resource related utilities used across the hypr* ecosystem.

Stability

Hyprgraphics depends on the ABI stability of the stdlib implementation of your compiler. Sover bumps will be done only for hyprgraphics ABI breaks, not stdlib.

Dependencies

Requires a compiler with C++26 support.

Dep list:

  • pixman-1
  • cairo
  • hyprutils
  • libjpeg
  • libwebp
  • libwebpdemux [optional]
  • giflib [optional]
  • libjxl [optional]
  • libjxl_cms [optional]
  • libjxl_threads [optional]
  • libmagic
  • libpng
  • librsvg2

Animated image API

CImage keeps the existing static-image behavior.

For timeline decoding (animated GIF / animated WebP), use CAnimatedImage:

#include <hyprgraphics/image/AnimatedImage.hpp>

Hyprgraphics::CAnimatedImage image("/path/to/animated.webp");
if (!image.success()) {
    // handle image.getError()
    return;
}

for (size_t i = 0; i < image.frameCount(); ++i) {
    const auto frame = image.frame(i);
    // render frame.cairoSurface for frame.durationMs milliseconds
}

Notes:

  • static images are exposed as one frame (frameCount() == 1, isAnimated() == false)
  • loopCount() == 0 means infinite looping

Building

git clone https://github.com/hyprwm/hyprgraphics
cd hyprgraphics/
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
sudo cmake --install build

About

Hyprland graphics / resource utilities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 93.9%
  • CMake 3.6%
  • Nix 2.5%