ncvgeom

Struct ncvgeom 

Source
#[repr(C)]
pub struct ncvgeom {
Show 17 fields pub pixy: c_uint, pub pixx: c_uint, pub cdimy: c_uint, pub cdimx: c_uint, pub rpixy: c_uint, pub rpixx: c_uint, pub rcelly: c_uint, pub rcellx: c_uint, pub scaley: c_uint, pub scalex: c_uint, pub begy: c_uint, pub begx: c_uint, pub leny: c_uint, pub lenx: c_uint, pub maxpixely: c_uint, pub maxpixelx: c_uint, pub blitter: ncblitter_e,
}
Expand description

describes all geometries of an ncvisual: those which are inherent, and those dependent upon a given rendering regime. pixy and pixx are the true internal pixel geometry, taken directly from the load (and updated by ncvisual_resize()). cdimy/cdimx are the cell-pixel geometry at the time of this call (it can change with a font change, in which case all values other than pixy/pixx are invalidated). rpixy/rpixx are the pixel geometry as handed to the blitter, following any scaling. scaley/scalex are the number of input pixels drawn to a single cell; when using NCBLIT_PIXEL, they are equivalent to cdimy/cdimx. rcelly/rcellx are the cell geometry as written by the blitter, following any padding (there is padding whenever rpix{y, x} is not evenly divided by scale{y, x}, and also sometimes for Sixel). maxpixely/maxpixelx are defined only when NCBLIT_PIXEL is used, and specify the largest bitmap that the terminal is willing to accept. blitter is the blitter which will be used, a function of the requested blitter and the blitters actually supported by this environment. if no ncvisual was supplied, only cdimy/cdimx are filled in.

Fields§

§pixy: c_uint

true pixel geometry of ncvisual data

§pixx: c_uint

true pixel geometry of ncvisual data

§cdimy: c_uint

terminal cell geometry when this was calculated

§cdimx: c_uint

terminal cell geometry when this was calculated

§rpixy: c_uint

rendered pixel geometry (per visual_options)

§rpixx: c_uint

rendered pixel geometry (per visual_options)

§rcelly: c_uint

rendered cell geometry (per visual_options)

§rcellx: c_uint

rendered cell geometry (per visual_options)

§scaley: c_uint

source pixels per filled cell

§scalex: c_uint

source pixels per filled cell

§begy: c_uint

upper-left corner of used region

§begx: c_uint

upper-left corner of used region

§leny: c_uint

geometry of used region

§lenx: c_uint

geometry of used region

§maxpixely: c_uint

only defined for NCBLIT_PIXEL

§maxpixelx: c_uint

only defined for NCBLIT_PIXEL

§blitter: ncblitter_e

blitter that will be used

Implementations§

Source§

impl ncvgeom

§Constructors

Source

pub fn new() -> Self

Returns a new NcVGeom with zeroed fields.

Trait Implementations§

Source§

impl Clone for ncvgeom

Source§

fn clone(&self) -> ncvgeom

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ncvgeom

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ncvgeom

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<ncvgeom> for NcVisualGeometry

Source§

fn from(vg: NcVGeom) -> Self

Since we don’t know the origin of the NcVGeom struct, when some fields are 0, we can’t really know whether that’s a valid value or not. That should be determined manually by other means.

Specifically len_yx, beg_yx & maxpixel_yx wont be None even if the corresponding NcVGeom fields are 0. But they would be None if the NcVisualGeometry had been created by the

See: https://github.com/dankamongmen/notcurses/pull/2320#issuecomment-962170075

Source§

impl Hash for ncvgeom

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for ncvgeom

Source§

fn cmp(&self, other: &ncvgeom) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ncvgeom

Source§

fn eq(&self, other: &ncvgeom) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ncvgeom

Source§

fn partial_cmp(&self, other: &ncvgeom) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for ncvgeom

Source§

impl Eq for ncvgeom

Source§

impl StructuralPartialEq for ncvgeom

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.