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.details().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, 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 libfontconfig-dev libseccomp-dev glycin-loaders bubblewrapon Debian/Ubuntu or
$ dnf install gtk4-devel fontconfig-devel libseccomp-devel glycin-loaders bubblewrapon Fedora.
§Features
gdk4— Enables interoperability withgdk4by enabling to get a [gdk::Texture] directly.tokio— Makes glycin compatible with [zbus] using [tokio].
Modules§
- config
- Processor (Loader/Editor) configuration
Structs§
- Cicp
- Coding-independent code points
- Creator
- Builder pattern for creating images
- Edit
- Result of an editor operation
- Editable
Image - Image handle on which editing operations can be applied
- Editor
- Builder pattern for editing images
- Encoded
Image - Result of a creator operation
- Error
- Feature
NotSupported - Error for when processors do not support a feature
- Frame
- A frame of an image often being the complete image
- Frame
Details - Additional information about a frame
- Frame
Request - Request information to get a specific frame
- Image
- Image handle containing metadata and allowing frame requests
- Image
Details - More information about an image
- Limits
- Loader
- Builder pattern for loading images
- Memory
Format Selection - Selection of memory formats the API user accepts
- NewFrame
- Builder pattern for a new frame
- Operations
- Set of ordered image editing operations
- Pool
- Configuration and set of processor processes
- Pool
Config - Pool configuration
Enums§
- Color
Profile Preference - Some loaders can provide a CICP and ICC profile at the same time. Which color information should be preferred differs between image formats. This value determines which kind should be preferred.
- Color
State - Edit
Outcome - Whether an image could be changed via the chosen method.
- Main
Context Selector - Specify which
MainContextto use - Memory
Format - Describes the formats the image data can have.
- Mime
Type - Mime type
- Operation
- Image editing operation
- Operation
Id - Image editing operation id
- Sandbox
Mechanism - Sandboxing mechanism for image loading and editing
- Sandbox
Selector - Method by which the
SandboxMechanismis selected - Sparse
Edit - Potentially sparse result of an editor operation