pub struct ImageConfig {
pub lv_conf_dir: PathBuf,
pub lvgl_include_dir: PathBuf,
pub converter: PathBuf,
}Expand description
Build-time configuration for LVGL image asset compilation.
Fields§
§lv_conf_dir: PathBufPath to directory containing lv_conf.h.
lvgl_include_dir: PathBufPath to LVGL header root (directory containing lvgl.h).
converter: PathBufPath to LVGLImage.py converter script.
Implementations§
Source§impl ImageConfig
impl ImageConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Create config from environment.
lv_conf_dirfromDEP_LV_CONFIG_PATHenv varlvgl_include_dirandconverterdiscovered from theoxivgl_syscargo git checkout or thirdparty fallback.
§Panics
If DEP_LV_CONFIG_PATH is not set or LVGL source tree not found.
Sourcepub fn image_asset(&self, name: &str, png_path: &str)
pub fn image_asset(&self, name: &str, png_path: &str)
Convert a PNG to an LVGL C image source, compile it, and link it.
name: C symbol name (e.g."cogwheel"). Must be a valid C identifier.png_path: path to PNG file, relative toCARGO_MANIFEST_DIR.
Color format is derived from LV_COLOR_DEPTH in lv_conf.h.
§Build requirements
Python 3 with pypng and lz4 packages.
§Panics
- PNG file not found
LVGLImage.pyexits non-zerocccompilation fails
Auto Trait Implementations§
impl Freeze for ImageConfig
impl RefUnwindSafe for ImageConfig
impl Send for ImageConfig
impl Sync for ImageConfig
impl Unpin for ImageConfig
impl UnsafeUnpin for ImageConfig
impl UnwindSafe for ImageConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more