libnotcurses_sys/visual/
mod.rs

1// functions already exported by bindgen : 24
2// -----------------------------------------
3// (W) wrap: 20
4// (#) test: 0
5// -----------------------------------------
6//W  ncdirectf_free
7//W  ncdirectf_from_file
8//   ncdirectf_geom
9//   ncdirectf_render
10//W  ncvisual_at_yx
11//W  ncvisual_blit
12//W  ncvisual_decode
13//W  ncvisual_decode_loop
14//W  ncvisual_destroy
15//W  ncvisual_from_bgra
16//W  ncvisual_from_file
17//W  ncvisual_from_palidx
18//W  ncvisual_from_plane
19//W  ncvisual_from_rgba
20//W  ncvisual_from_rgb_packed
21//W  ncvisual_from_rgb_loose
22//W  ncvisual_media_defblitter
23//W  ncvisual_polyfill_yx
24//   ncvisual_plane_create
25//W  ncvisual_resize
26//W  ncvisual_rotate
27//W  ncvisual_set_yx
28//W  ncvisual_simple_streamer
29//~  ncvisual_stream
30//W  ncvisual_subtitle_plane
31
32// functions manually reimplemented: 45
33// ------------------------------------------
34// (+) done: 1
35// (W) wrap: 1
36// (#) test: 0
37// ------------------------------------------
38//W+ ncvisualplane_create
39
40#[allow(unused_imports)] // for doc comments
41use crate::{c_api::NcResult_i32, NcBlitter, NcChannel, NcPlane, NcScale, NcTime};
42
43mod geometry;
44mod methods;
45pub(crate) mod options;
46mod reimplemented;
47
48pub use geometry::NcVisualGeometry;
49pub use options::{NcVisualFlag, NcVisualOptions, NcVisualOptionsBuilder};
50
51/// A visual bit of multimedia.
52///
53/// It can be constructed from a rgba or bgra buffer.
54///
55/// The [`NcVisualOptions`] structure is used only by the following methods:
56/// - [`geom`][NcVisual#method.geom]
57/// - [`blit`][NcVisual#method.blit]
58/// - [`simple_streamer`][NcVisual#method.simple_streamer]
59pub type NcVisual = crate::c_api::ffi::ncvisual;
60
61/// Called for each frame rendered from an `NcVisual`
62///
63/// If anything but 0 is returned, the streaming operation ceases immediately,
64/// and that value is propagated out.
65///
66/// The recommended absolute display time target is passed in 'tspec'.
67pub type NcStreamCb =
68    fn(&mut NcVisual, &mut NcVisualOptions, &NcTime, Option<&mut NcPlane>) -> NcResult_i32;
69
70pub(crate) mod c_api {
71    pub use super::geometry::c_api::*;
72    pub use super::options::c_api::*;
73}