diff --git a/rust/examples/pixel-cell.rs b/rust/examples/pixel-cell.rs index a3c29745e..2bd312183 100644 --- a/rust/examples/pixel-cell.rs +++ b/rust/examples/pixel-cell.rs @@ -24,8 +24,8 @@ fn main() -> NcResult<()> { // print visual delimiters around our pixelized cell println!("0▗│▖\n│─ ─\n2▝│▘"); println!("a cell is {}x{} pixels", pg.cell_y, pg.cell_x); - println!("\ninterpolated not-interpolated interpolated not-interpolated"); - println!(" SCALE SCALE RESIZE RESIZE"); + println!("\ninterpolated not-interpolated not-interpolated interpolated"); + println!(" SCALE SCALE RESIZE RESIZE"); // fill the buffer with random color pixels let mut rng = rand::thread_rng(); @@ -62,7 +62,7 @@ fn main() -> NcResult<()> { 0, ); v1.render(&mut nc, &voptions2)?; - rsleep![&mut nc, 1]; + rsleep![&mut nc, 0, 250]; // show the ncvisual, scaled without using interpolation let mut vplane3 = NcPlane::new_bound(&mut stdplane, 7, 19, 5, 4)?; @@ -80,22 +80,22 @@ fn main() -> NcResult<()> { 0, ); v1.render(&mut nc, &voptions3)?; - rsleep![&mut nc, 1]; + rsleep![&mut nc, 0, 250]; // resize the ncvisual (doesn't use interpolation) let voptions4 = - NcVisualOptions::without_plane(7, 37, 0, 0, pg.cell_y, pg.cell_x, NCBLIT_PIXEL, 0, 0); + NcVisualOptions::without_plane(7, 39, 0, 0, pg.cell_y, pg.cell_x, NCBLIT_PIXEL, 0, 0); v1.resize_noninterpolative(pg.cell_y * 4, pg.cell_x * 4)?; v1.render(&mut nc, &voptions4)?; - rsleep![&mut nc, 1]; + rsleep![&mut nc, 0, 250]; // resize the ncvisual (uses interpolation) let v5 = NcVisual::from_rgba(buffer.as_slice(), pg.cell_y, pg.cell_x * 4, pg.cell_x)?; let voptions5 = - NcVisualOptions::without_plane(7, 51, 0, 0, pg.cell_y, pg.cell_x, NCBLIT_PIXEL, 0, 0); - v5.resize(18 * 4, 9 * 4)?; // FIXME: render function fails when downsizing (y<18 | x<9) + NcVisualOptions::without_plane(7, 56, 0, 0, pg.cell_y, pg.cell_x, NCBLIT_PIXEL, 0, 0); + v5.resize(pg.cell_y * 4, pg.cell_x * 4)?; v5.render(&mut nc, &voptions5)?; - rsleep![&mut nc, 1]; + rsleep![&mut nc, 0, 250]; sleep![2]; diff --git a/rust/src/direct/mod.rs b/rust/src/direct/mod.rs index c83468725..68d9c328e 100644 --- a/rust/src/direct/mod.rs +++ b/rust/src/direct/mod.rs @@ -114,11 +114,11 @@ pub const NCDIRECT_OPTION_INHIBIT_SETLOCALE: NcDirectFlags = pub const NCDIRECT_OPTION_NO_QUIT_SIGHANDLERS: NcDirectFlags = crate::bindings::ffi::NCDIRECT_OPTION_NO_QUIT_SIGHANDLERS as NcDirectFlags; -/// +/// Flag that enables showing detailed information. pub const NCDIRECT_OPTION_VERBOSE: NcDirectFlags = crate::bindings::ffi::NCDIRECT_OPTION_VERBOSE as NcDirectFlags; -/// Enable all diagnostics (equivalent to +/// Flag that enables showing all diagnostics (equivalent to /// [`NCLOGLEVEL_TRACE`][crate::NCLOGLEVEL_TRACE]). /// Implies [`NCDIRECT_OPTION_VERBOSE`]. pub const NCDIRECT_OPTION_VERY_VERBOSE: NcDirectFlags = diff --git a/rust/src/visual/methods.rs b/rust/src/visual/methods.rs index fceb27112..66bbaeeaf 100644 --- a/rust/src/visual/methods.rs +++ b/rust/src/visual/methods.rs @@ -183,7 +183,7 @@ impl NcVisual { /// /// *C style function: [ncvisual_from_rgb_loose()][crate::ncvisual_from_rgb_loose].* pub fn from_rgb_loose<'a>( - rgba: &[u8], + rgb: &[u8], rows: NcDim, rowstride: NcDim, cols: NcDim, @@ -192,7 +192,7 @@ impl NcVisual { error_ref_mut![ unsafe { crate::ncvisual_from_rgb_loose( - rgba.as_ptr() as *const c_void, + rgb.as_ptr() as *const c_void, rows as i32, rowstride as i32, cols as i32, @@ -211,7 +211,7 @@ impl NcVisual { /// /// *C style function: [ncvisual_from_rgb_packed()][crate::ncvisual_from_rgb_packed].* pub fn from_rgb_packed<'a>( - rgba: &[u8], + rgb: &[u8], rows: NcDim, rowstride: NcDim, cols: NcDim, @@ -220,7 +220,7 @@ impl NcVisual { error_ref_mut![ unsafe { crate::ncvisual_from_rgb_packed( - rgba.as_ptr() as *const c_void, + rgb.as_ptr() as *const c_void, rows as i32, rowstride as i32, cols as i32,