mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-06 03:20:26 +00:00
[rust] rustfmt; fix docs
This commit is contained in:
parent
a163eeb2d7
commit
48c85d5220
@ -4,9 +4,9 @@ use libc::strcmp;
|
||||
|
||||
use crate::{
|
||||
cstring, nccell_release, NcAlphaBits, NcCell, NcChannel, NcChannelPair, NcColor, NcEgc,
|
||||
NcIntResult, NcPaletteIndex, NcPlane, NcRgb, NcStyleMask, NCCELL_OPAQUE,
|
||||
NCCELL_BGDEFAULT_MASK, NCCELL_BG_PALETTE, NCCELL_FGDEFAULT_MASK, NCCELL_FG_PALETTE,
|
||||
NCRESULT_ERR, NCRESULT_OK, NCSTYLE_MASK,
|
||||
NcIntResult, NcPaletteIndex, NcPlane, NcRgb, NcStyleMask, NCCELL_BGDEFAULT_MASK,
|
||||
NCCELL_BG_PALETTE, NCCELL_FGDEFAULT_MASK, NCCELL_FG_PALETTE, NCCELL_OPAQUE, NCRESULT_ERR,
|
||||
NCRESULT_OK, NCSTYLE_MASK,
|
||||
};
|
||||
|
||||
// Alpha -----------------------------------------------------------------------
|
||||
|
@ -1,9 +1,9 @@
|
||||
//! `channel*_*` reimplemented functions.
|
||||
|
||||
use crate::{
|
||||
NcAlphaBits, NcChannel, NcChannelPair, NcColor, NcPaletteIndex, NcRgb,
|
||||
NCCELL_HIGHCONTRAST, NCCELL_OPAQUE, NCCELL_BGDEFAULT_MASK, NCCELL_BG_PALETTE,
|
||||
NCCELL_BG_RGB_MASK, NCCELL_FGDEFAULT_MASK, NCCELL_FG_PALETTE, NCCHANNEL_ALPHA_MASK,
|
||||
NcAlphaBits, NcChannel, NcChannelPair, NcColor, NcPaletteIndex, NcRgb, NCCELL_BGDEFAULT_MASK,
|
||||
NCCELL_BG_PALETTE, NCCELL_BG_RGB_MASK, NCCELL_FGDEFAULT_MASK, NCCELL_FG_PALETTE,
|
||||
NCCELL_HIGHCONTRAST, NCCELL_OPAQUE, NCCHANNEL_ALPHA_MASK,
|
||||
};
|
||||
|
||||
// Alpha -----------------------------------------------------------------------
|
||||
|
@ -3,8 +3,7 @@
|
||||
use serial_test::serial;
|
||||
|
||||
use crate::{
|
||||
NcChannel, NcChannelPair, NCCELL_BLEND, NCCELL_HIGHCONTRAST, NCCELL_OPAQUE,
|
||||
NCCELL_TRANSPARENT,
|
||||
NcChannel, NcChannelPair, NCCELL_BLEND, NCCELL_HIGHCONTRAST, NCCELL_OPAQUE, NCCELL_TRANSPARENT,
|
||||
};
|
||||
|
||||
// NcChannel tests -------------------------------------------------------------
|
||||
|
@ -28,7 +28,7 @@ impl NcPalette {
|
||||
|
||||
/// Returns the [NcColor] RGB components from the [NcChannel] in this NcPalette.
|
||||
///
|
||||
/// *C style function: [ncpalette_get_rgb()][crate::ncpalette_get_rgb].*
|
||||
/// *C style function: [ncpalette_get_rgb()][crate::ncpalette_get_rgb8].*
|
||||
pub fn get_rgb8(&self, index: NcPaletteIndex) -> (NcColor, NcColor, NcColor) {
|
||||
let (mut r, mut g, mut b) = (0, 0, 0);
|
||||
crate::ncchannel_rgb8(self.chans[index as usize], &mut r, &mut g, &mut b);
|
||||
@ -38,7 +38,7 @@ impl NcPalette {
|
||||
/// Extracts the [NcColor] RGB components from an [NcChannel] entry inside
|
||||
/// this NcPalette, and returns the NcChannel.
|
||||
///
|
||||
/// *C style function: [ncpalette_get_rgb()][crate::ncpalette_get_rgb].*
|
||||
/// *C style function: [ncpalette_get_rgb()][crate::ncpalette_get_rgb8].*
|
||||
pub fn get_rgb(&self, index: NcPaletteIndex) -> NcChannel {
|
||||
let (mut r, mut g, mut b) = (0, 0, 0);
|
||||
crate::ncchannel_rgb8(self.chans[index as usize], &mut r, &mut g, &mut b)
|
||||
|
@ -363,13 +363,10 @@ impl NcVisual {
|
||||
///
|
||||
/// *C style function:
|
||||
/// [ncvisual_resize_noninterpolative()][crate::ncvisual_resize_noninterpolative].*
|
||||
pub fn resize_noninterpolative(&mut self, rows: NcDim, cols: NcDim) -> NcResult<NcIntResult> {
|
||||
let res =
|
||||
unsafe { crate::ncvisual_resize_noninterpolative(self, rows as i32, cols as i32) };
|
||||
pub fn resize_noninterpolative(&mut self, rows: NcDim, cols: NcDim) -> NcResult<()> {
|
||||
error![
|
||||
res,
|
||||
&format!["NcVisual.resize_noninterpolative({}, {})", cols, rows],
|
||||
res
|
||||
unsafe { crate::ncvisual_resize_noninterpolative(self, rows as i32, cols as i32) },
|
||||
&format!["NcVisual.resize_noninterpolative({}, {})", cols, rows]
|
||||
]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user