Enum libnotcurses_sys::NcBlitter [−][src]
#[repr(u32)]
#[non_exhaustive]
pub enum NcBlitter {
Default,
Ascii,
Half,
Quadrant,
Sextant,
Braille,
Pixel,
_4x1,
_8x1,
}Expand description
The blitter mode to use for rasterizing an NcVisual.
We never blit full blocks, but instead spaces (more efficient) with the background set to the desired foreground.
Default
Degradation
There is a mechanism of graceful degradation, that works as follows:
- without braille support,
Brailledecays toSextant. - without bitmap support,
Pixeldecays toSextant. - without sextant support,
Sextantdecays toQuadrant. - without quadrant support,
Quadrantdecays toHalf. - the only viable blitters in ASCII are
AsciiandPixel.
If you don’t want this behaviour you have to set the
NcVisualOptions::NODEGRADE flag on NcVisualOptions or call
degrade(false) on NcVisualOptionsBuilder.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Default
Ascii
Blitter mode using only spaces, compatible with ASCII (1x1).
Half
Blitter mode using halves + Ascii (2x1).
▄▀
Quadrant
Blitter mode using quadrants + Half (2x2).
▗▐ ▖▀▟▌▙
Sextant
Blitter mode using sextants + Quadrant (3x2).
🬀🬁🬂🬃🬄🬅🬆🬇🬈🬉🬊🬋🬌🬍🬎🬏🬐🬑🬒🬓🬔🬕🬖🬗🬘🬙🬚🬛🬜🬝🬞🬟🬠🬡🬢🬣🬤🬥🬦🬧🬨🬩🬪🬫🬬🬭🬮🬯🬰🬱🬲🬳🬴🬵🬶🬷🬸🬹🬺🬻
Braille
Blitter mode using braille (4x2). ⡀⡄⡆⡇⢀⣀⣄⣆⣇⢠⣠⣤⣦⣧⢰⣰⣴⣶⣷⢸⣸⣼⣾⣿
Pixel
Blitter mode using Pixels/Sixels.
_4x1
NcBlitter mode using: four vertical levels (4x1).
█▆▄▂
_8x1
NcBlitter mode using: eight vertical levels (8x1).
█▇▆▅▄▃▂▁
Implementations
Blits a flat array data of NcRgba values to the NcPlane that
must be configured in vopts.
The blit begins at vopts.y and vopts.x relative to the plane.
Each source row ought occupy line_size bytes (this might be greater
than vopts.lenx * 4 due to padding or partial blits).
A subregion of the input can be specified with the begy×begx and
leny×lenx fields from vopts.
Returns the number of pixels blitted on success.
C style function: ncblit_rgba().
Like blit_rgba, but for BGRx.
C style function: ncblit_bgrx().
pub fn blit_rgb_packed(
data: &[u8],
line_size: usize,
vopts: &NcVisualOptions,
alpha: u8
) -> NcResult<usize>
pub fn blit_rgb_packed(
data: &[u8],
line_size: usize,
vopts: &NcVisualOptions,
alpha: u8
) -> NcResult<usize>
Like blit_rgba, but for RGB.
line_size must be a multiple of 3 for this RGB data.
Supply an alpha value to be applied throughout.
C style function: ncblit_rgb_packed().
pub fn blit_rgb_loose(
data: &[u8],
line_size: usize,
vopts: &NcVisualOptions,
alpha: u8
) -> NcResult<usize>
pub fn blit_rgb_loose(
data: &[u8],
line_size: usize,
vopts: &NcVisualOptions,
alpha: u8
) -> NcResult<usize>
Like blit_rgb_packed, but line_size
must be a multiple of 4 for this RGBx data.
Supply an alpha value to be applied throughout.
C style function: ncblit_rgb_loose().
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for NcBlitter
impl UnwindSafe for NcBlitter
Blanket Implementations
Mutably borrows from an owned value. Read more
