Expand description
Blinc Image
Image loading and rendering for Blinc UI.
§Features
- Load images from file paths, URLs, and base64 data
- Support for PNG, JPEG, GIF, WebP, BMP formats
- CSS-style object-fit options (cover, contain, fill, etc.)
- Image filters: grayscale, sepia, brightness, contrast, blur, etc.
§Example
ⓘ
use blinc_image::{ImageSource, ImageData, ObjectFit};
// Load from file
let data = ImageData::load(ImageSource::File("image.png".into()))?;
// Load from base64
let data = ImageData::load(ImageSource::Base64("iVBORw0KGgo...".into()))?;
// Load from URL (requires "network" feature)
let data = ImageData::load_async(ImageSource::Url("https://example.com/image.png".into())).await?;Structs§
- Image
Data - Decoded image data ready for GPU upload
- Image
Filter - Image filter effects (CSS filter equivalent)
- Image
Style - Complete image styling options
- Object
Position - Image alignment within its container (CSS object-position equivalent)
Enums§
- Image
Error - Errors that can occur during image operations
- Image
Source - Source of an image
- Object
Fit - How an image should fit within its container (CSS object-fit equivalent)
Functions§
- calculate_
fit_ rects - Calculate the source and destination rectangles for rendering an image with a given object-fit mode.
- src_
rect_ to_ uv - Convert source rectangle to UV coordinates (0-1 range)
Type Aliases§
- BoxFit
- Alias for ObjectFit for backward compatibility
- Image
Alignment - Alias for ObjectPosition for backward compatibility
- Result
- Result type for blinc_image operations