summaryrefslogtreecommitdiffstats
path: root/src/kitty/mod.rs
blob: 07cb9014243d0e438fa4e67cd7b1dd7e209cbe41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
mod image_renderer;

pub use image_renderer::*;

use {
    lazy_static::lazy_static,
    std::sync::Mutex,
};

lazy_static! {
    static ref RENDERER: Option<Mutex<KittyImageRenderer>> = KittyImageRenderer::new().map(Mutex::new);
}

// TODO try to find another way (making app_context mut ?) to pass this
// around without the mutex gymnastic, and also to make it really lazy
// (ie only initialized when an image must be rendered)
pub fn image_renderer() -> &'static Option<Mutex<KittyImageRenderer>> {
    &*RENDERER
}