Struct libnotcurses_sys::c_api::ncvisual_options
source · [−]#[repr(C)]pub struct ncvisual_options {}Fields
n: *mut ncplaneif 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). if NCVISUAL_OPTION_CHILDPLANE is provided, this must be non-NULL, and will be interpreted as the parent.
scaling: ncscale_ethe scaling is ignored if no ncplane is provided (it ought be NCSCALE_NONE in this case). otherwise, the source is stretched/scaled relative to the provided ncplane.
y: c_intif an ncplane is provided, y and x specify where the visual will be rendered on that plane. otherwise, they specify where the created ncplane will be placed relative to the standard plane’s origin. x is an ncalign_e value if NCVISUAL_OPTION_HORALIGNED is provided. y is an ncalign_e if NCVISUAL_OPTION_VERALIGNED is provided.
x: c_intif an ncplane is provided, y and x specify where the visual will be rendered on that plane. otherwise, they specify where the created ncplane will be placed relative to the standard plane’s origin. x is an ncalign_e value if NCVISUAL_OPTION_HORALIGNED is provided. y is an ncalign_e if NCVISUAL_OPTION_VERALIGNED is provided.
begy: c_uintorigin of rendered region in pixels
begx: c_uintorigin of rendered region in pixels
leny: c_uintsize of rendered region in pixels
lenx: c_uintsize of rendered region in pixels
blitter: ncblitter_eglyph set to use (maps input to output cells)
flags: u64bitmask over NCVISUAL_OPTION_*
transcolor: u32treat this color as transparent under NCVISUAL_OPTION_ADDALPHA
pxoffy: c_uintpixel offsets within the cell. if NCBLIT_PIXEL is used, the bitmap will be drawn offset from the upper-left cell’s origin by these amounts. it is an error if either number exceeds the cell-pixel geometry in its dimension. if NCBLIT_PIXEL is not used, these fields are ignored. this functionality can be used for smooth bitmap movement.
pxoffx: c_uintpixel offsets within the cell. if NCBLIT_PIXEL is used, the bitmap will be drawn offset from the upper-left cell’s origin by these amounts. it is an error if either number exceeds the cell-pixel geometry in its dimension. if NCBLIT_PIXEL is not used, these fields are ignored. this functionality can be used for smooth bitmap movement.
Implementations
sourceimpl<'ncplane> ncvisual_options
impl<'ncplane> ncvisual_options
sourcepub fn builder() -> NcVisualOptionsBuilder<'ncplane>
pub fn builder() -> NcVisualOptionsBuilder<'ncplane>
Returns a builder object for NcVisualOptions.
sourcepub fn new(
plane: Option<&mut NcPlane>,
scale: impl Into<NcScale>,
y: i32,
x: i32,
section_yx_lenyx: Option<(u32, u32, u32, u32)>,
cell_offset_yx: Option<(u32, u32)>,
blitter: impl Into<NcBlitter>,
flags: impl Into<NcVisualFlag>,
transcolor: impl Into<NcRgba>
) -> Self
pub fn new(
plane: Option<&mut NcPlane>,
scale: impl Into<NcScale>,
y: i32,
x: i32,
section_yx_lenyx: Option<(u32, u32, u32, u32)>,
cell_offset_yx: Option<(u32, u32)>,
blitter: impl Into<NcBlitter>,
flags: impl Into<NcVisualFlag>,
transcolor: impl Into<NcRgba>
) -> Self
New NcVisualOptions.
Arguments
-
plane- an optional mutable pointer to anNcPlane. -
scale- AnNcScaleindicating how the source will be stretched/scaled relative to theNcPlane. -
y- if anNcPlaneis provided inplanethen this specifies where theNcVisualwill be on that plane in the y axis.Otherwise it specifies where the created
NcPlanewill be placed in the y axis, relative to the standard plane’s origin.If
VerAlignedis set, this will be interpreted as anNcAlignvalue. -
x- if anNcPlaneis provided inplanethen this specifies where theNcVisualwill be on that plane, in the x axis.Otherwise it specifies where the created
NcPlanewill be placed, in the y axis, relative to the standard plane’s origin.If
HorAlignedis set, this will be interpreted as anNcAlignvalue. -
section_yx_lenyx- The size of the rendered section.Nonerenders the entire visual, otherwise the provided tuple (y,x,len_y,len_x) sets[yx]as the origin of the section andlen_[yx]as the its length on each respective dimension. -
cell_offset_yx- Pixel offsets within the cell.If
NcBlitter::Pixelis used the bitmap will be drawn offset from the upper-left cell’s origin by these amounts, otherwise this will be ignored.It is an error if either number exceeds the cell-pixel geometry in any dimension (see
NcVisualGeometry.cdim_yx). -
blitter-NcBlitterglyph set to use for blitting. -
flags-NcVisualFlag. -
transcolor- treats this color as transparent when theAddAlphaflag is active
Notes
If the Childplane flag is used then the plane is interpreted as
the parent NcPlane of the new plane created for this
NcVisual.
Trait Implementations
sourceimpl Debug for ncvisual_options
impl Debug for ncvisual_options
sourceimpl Default for ncvisual_options
impl Default for ncvisual_options
sourceimpl Hash for ncvisual_options
impl Hash for ncvisual_options
sourceimpl Ord for ncvisual_options
impl Ord for ncvisual_options
sourceimpl PartialEq<ncvisual_options> for ncvisual_options
impl PartialEq<ncvisual_options> for ncvisual_options
sourcefn eq(&self, other: &ncvisual_options) -> bool
fn eq(&self, other: &ncvisual_options) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ncvisual_options) -> bool
fn ne(&self, other: &ncvisual_options) -> bool
This method tests for !=.
sourceimpl PartialOrd<ncvisual_options> for ncvisual_options
impl PartialOrd<ncvisual_options> for ncvisual_options
sourcefn partial_cmp(&self, other: &ncvisual_options) -> Option<Ordering>
fn partial_cmp(&self, other: &ncvisual_options) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Eq for ncvisual_options
impl StructuralEq for ncvisual_options
impl StructuralPartialEq for ncvisual_options
Auto Trait Implementations
impl RefUnwindSafe for ncvisual_options
impl !Send for ncvisual_options
impl !Sync for ncvisual_options
impl Unpin for ncvisual_options
impl UnwindSafe for ncvisual_options
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more