Expand description
Glycin allows to decode images into gdk::Texture
s and to extract image
metadata. The decoding happens in sandboxed modular image loaders that have
to be provided as binaries. The glycin-utils
for more
details.
§Example
You need to enable the gdk4
feature for this example to work.
let file = gio::File::for_path("image.jpg");
let image = Loader::new(file).load().await?;
let height = image.info().height();
let texture = image.next_frame().await?.texture();
You can pass the texture
of a Frame
to
gtk4::Image::from_paintable()
to display the image.
§External Dependencies
Glycin requires the libraries libglib2.0, liblcms2, libfontconfig, and
libseccomp packages to be installed. For the gdk4
feature, libgtk-4 is
required as well. To actually work with images, loaders for the respective
formats have to be installed. Glycin provides loaders for many formats
that are packaged with many distributions. When working in the default
sandbox mode, the bwrap
binary of bubblewrap is required as well. The
required dependencies can usually be installed through commands like
$ apt install libgtk-4-dev liblcms2-dev libfontconfig-dev libseccomp-dev glycin-loaders bubblewrap
on Debian/Ubuntu or
$ dnf install gtk4-devel lcms2-devel fontconfig-devel libseccomp-devel glycin-loaders bubblewrap
on Fedora.
§Features
gdk4
— Enables interoperability withgdk4
by enabling to get agdk::Texture
directly.tokio
— Makes glycin compatible withzbus
usingtokio
.
Re-exports§
pub use config::COMPAT_VERSION;
pub use crate::config::MimeType;
Modules§
Structs§
- Binary
Data - Cicp
- Coding-independent code points
- Edit
- Editor
- Image edit builder
- Error
Ctx - Frame
- A frame of an image often being the complete image
- Frame
Details - More information about a frame
- Frame
Request - Request information to get a specific frame
- Image
- Image handle containing metadata and allowing frame requests
- Image
Info - Various image metadata
- Image
Info Details - Loader
- Image request builder
- Operations
Enums§
- Color
State - Edit
Outcome - Whether an image could be changed via the chosen method.
- Error
- Memory
Format - Describes the formats the image data can have.
- Operation
- Operation
Id - Remote
Error - Error within the remote process.
- Sandbox
Mechanism - Sandboxing mechanism for image loading and editing
- Sandbox
Selector - Method by which the
SandboxMechanism
is selected - Sparse
Edit - An image change that is potentially sparse.
- Video
Range Flag