1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// functions already exported by bindgen : 24
// -----------------------------------------
// (W) wrap: 20
// (#) test: 0
// -----------------------------------------
//W  ncdirectf_free
//W  ncdirectf_from_file
//   ncdirectf_geom
//   ncdirectf_render
//W  ncvisual_at_yx
//W  ncvisual_decode
//W  ncvisual_decode_loop
//W  ncvisual_destroy
//W  ncvisual_from_bgra
//W  ncvisual_from_file
//W  ncvisual_from_palidx
//W  ncvisual_from_plane
//W  ncvisual_from_rgba
//W  ncvisual_from_rgb_packed
//W  ncvisual_from_rgb_loose
//W  ncvisual_media_defblitter
//W  ncvisual_polyfill_yx
//   ncvisual_plane_create
//W  ncvisual_resize
//W  ncvisual_rotate
//W  ncvisual_set_yx
//W  ncvisual_simple_streamer
//~  ncvisual_stream
//W  ncvisual_subtitle_plane

// functions manually reimplemented: 45
// ------------------------------------------
// (+) done: 1
// (W) wrap: 1
// (#) test: 0
// ------------------------------------------
//W+ ncvisualplane_create

#[allow(unused_imports)] // for doc comments
use crate::{NcBlitter, NcChannel, NcDim, NcOffset, NcPlane, NcRgb, NcScale};

mod geometry;
mod methods;
pub(crate) mod options;
mod reimplemented;

pub use geometry::{NcVGeom, NcVisualGeometry};
pub use options::{NcVisualOptions, NcVisualOptionsBuilder};

/// A visual bit of multimedia.
///
/// It can be constructed from a rgba or bgra buffer.
///
/// The [`NcVisualOptions`] structure is used only by the following methods:
/// - [`geom`][NcVisual#method.geom]
/// - [`render`][NcVisual#method.render]
/// - [`simple_streamer`][NcVisual#method.simple_streamer]
pub type NcVisual = crate::bindings::ffi::ncvisual;

// NcRgba
//
/// Three RGB [`NcComponent`]s plus one alpha [`NcComponent`] (alias of `u32`).
///
/// ## Diagram
///
/// ```txt
/// AAAAAAAA RRRRRRRR GGGGGGGG BBBBBBBB
/// ```
/// `type in C: no data type`
///
/// See also: [`NcRgb`] and [`NcChannel`] types.
///
/// [`NcComponent`]: crate::NcComponent
pub type NcRgba = u32;

// // NcBgra
// //
// /// 32 bits broken into 3x 8bpp BGR channels + 8ppp alpha.
// ///
// /// ## Diagram
// ///
// /// ```txt
// /// AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR
// /// ```
// ///
// /// `type in C: no data type`
// ///
// /// See also: [`NcRgba`], [`NcRgb`] and [`NcChannel`] types.
// pub type NcBgra = u32;