Struct libnotcurses_sys::NcVisualOptionsBuilder
source · pub struct NcVisualOptionsBuilder<'ncplane> { /* private fields */ }
Expand description
Builder object for NcVisualOptions
.
Can be constructed by calling NcVisualOptions::builder()
.
Implementations§
source§impl<'ncplane> NcVisualOptionsBuilder<'ncplane>
impl<'ncplane> NcVisualOptionsBuilder<'ncplane>
§Constructors
sourcepub fn from_options(o: &NcVisualOptions) -> Self
pub fn from_options(o: &NcVisualOptions) -> Self
New builder from pre-existing options.
source§impl<'ncplane> NcVisualOptionsBuilder<'ncplane>
impl<'ncplane> NcVisualOptionsBuilder<'ncplane>
§Methods (chainable)
sourcepub fn plane(self, plane: &'ncplane mut NcPlane) -> Self
pub fn plane(self, plane: &'ncplane mut NcPlane) -> Self
Sets the NcPlane
where the blitting will be done.
This NcPlane
could also be considered the parent of a new plane where
the blitting will occur by utilizing the child
method.
When no NcPlane
is provided, one will be created using the exact size
necessary to render the source with perfect fidelity (this might be
smaller or larger than the rendering area).
Default: None
(no plane).
sourcepub fn child(self, child: bool) -> Self
pub fn child(self, child: bool) -> Self
If true, a plane
must also be provided, which will be the parent
of a new child NcPlane
into which the blitting will be done.
If false, the blitting will occur in the provided plane
, if any,
or in a newly created NcPlane
otherwise.
Default: false (no child plaane).
Effect: Sets the CHILDPLANE
flag.
sourcepub fn scale(self, scale: impl Into<NcScale>) -> Self
pub fn scale(self, scale: impl Into<NcScale>) -> Self
Sets the NcScale
.
Default: NcScale::NOSCALE
.
sourcepub fn y(self, y: i32) -> Self
pub fn y(self, y: i32) -> Self
Sets the vertical placement.
Default: 0
.
Effect: Sets the y coordinate, and unsets the VerAligned
flag.
sourcepub fn x(self, x: i32) -> Self
pub fn x(self, x: i32) -> Self
Sets the horizontal placement.
Default: 0
.
Effect: Sets the x coordinate, and unsets the HorAligned
flag.
sourcepub fn yx(self, y: i32, x: i32) -> Self
pub fn yx(self, y: i32, x: i32) -> Self
Sets the vertical & horizontal placement.
Default: (0, 0)
.
Effect: Sets the y
& x
coordinates and unsets the VerAligned
& HorAligned
flags.
sourcepub fn valign(self, valign: impl Into<NcAlign>) -> Self
pub fn valign(self, valign: impl Into<NcAlign>) -> Self
Sets the vertical alignment.
Default: NcAlign::Top
.
Effect: Sets the y alignment and the VerAligned
flag.
sourcepub fn halign(self, halign: impl Into<NcAlign>) -> Self
pub fn halign(self, halign: impl Into<NcAlign>) -> Self
Sets the horizontal alignment.
Default: NcAlign::Left
.
Effect: Sets the x
alignment and the HorAligned
flag.
sourcepub fn align(
self,
valign: impl Into<NcAlign>,
halign: impl Into<NcAlign>
) -> Self
pub fn align( self, valign: impl Into<NcAlign>, halign: impl Into<NcAlign> ) -> Self
Sets the vertical & horizontal alignments.
Default: (
NcAlign::Top
,
NcAlign::Left
)
.
Effect: Sets the y
& x
alignments and the VerAligned
and
HorAligned
flags.
sourcepub fn blitter(self, blitter: impl Into<NcBlitter>) -> Self
pub fn blitter(self, blitter: impl Into<NcBlitter>) -> Self
Choose the NcBlitter
.
Default: NcBlitter::Default
.
sourcepub fn pixel(self) -> Self
pub fn pixel(self) -> Self
Choose NcBlitter::Pixel
for the blitter.
sourcepub fn transcolor(self, color: Option<impl Into<NcRgba>>) -> Self
pub fn transcolor(self, color: Option<impl Into<NcRgba>>) -> Self
Choose the color to be considered transparent, or None
.
Default: none.
Efect: (Un)Sets the transparent color, and the AddAlpha
flag.
sourcepub fn blend(self, blend: bool) -> Self
pub fn blend(self, blend: bool) -> Self
Choose whether to use NcAlpha::Blend
with the NcVisual
, so that
the foreground or background colors can be a composite between
a color and the corresponding colors underneath it.
Default: false (blends not).
Effect: Sets the Blend
flag.
sourcepub fn degrade(self, degrade: bool) -> Self
pub fn degrade(self, degrade: bool) -> Self
Choose between gracefully degrading the blitter, or fail if the choosen
NcBlitter
is not supported by the terminal.
Default: true (degrades).
Effect: Sets the NoDegrade
flag.
See also: the rules of degradation.
sourcepub fn interpolate(self, interpolate: bool) -> Self
pub fn interpolate(self, interpolate: bool) -> Self
Sets the NoInterpolate
flag.
Default: true (interpolates).
sourcepub fn region(self, beg_y: u32, beg_x: u32, len_y: u32, len_x: u32) -> Self
pub fn region(self, beg_y: u32, beg_x: u32, len_y: u32, len_x: u32) -> Self
Sets the region to be rendered.
(start_y, start_x, len_y, len_x)
sourcepub fn cell_offset(self, y: u32, x: u32) -> Self
pub fn cell_offset(self, y: u32, x: u32) -> Self
Sets the pixel offset within the NcCell
.
sourcepub fn build(self) -> NcVisualOptions
pub fn build(self) -> NcVisualOptions
Finishes the building and returns NcVisualOptions
.