Struct libnotcurses_sys::NcVisualGeometry
source · [−]pub struct NcVisualGeometry {
pub pix_yx: Option<(u32, u32)>,
pub cdim_yx: Option<(u32, u32)>,
pub rpix_yx: Option<(u32, u32)>,
pub rcell_yx: Option<(u32, u32)>,
pub scale_yx: Option<(u32, u32)>,
pub maxpixel_yx: Option<(u32, u32)>,
pub beg_yx: Option<(u32, u32)>,
pub len_yx: Option<(u32, u32)>,
pub blitter: NcBlitter,
}
Expand description
Describes all the geometries of an NcVisual
.
It includes both inherent geometries and those which are dependent upon a given rendering regime.
Inner values are calculated at the time of the call. A font change,
for example, could make all the fields invalid,
except for pix_yx
.
This type is is returned by the NcVisual.geom
method and by the
Nc.visual_geom
method.
See also
Fields
pix_yx: Option<(u32, u32)>
The true internal pixel geometry of NcVisual
data, taken directly
from the load, and updated by ncvisual_resize
.
cdim_yx: Option<(u32, u32)>
Terminal cell geometry at the time of the call. This is the size of a cell in pixels.
This can change with a font change, in which case all field values
are invalidated (except for pix_yx
).
Corresponds to the NcVGeom
fields (cdimy
, cdimx
), and to the
NcPixelGeometry
fields (cell_y
, cell_x
)
rpix_yx: Option<(u32, u32)>
Rendered pixel geometry, per NcVisualOptions
.
as handed to the blitter, following any scaling.
rcell_yx: Option<(u32, u32)>
Rendered cell geometry, per NcVisualOptions
.
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).
scale_yx: Option<(u32, u32)>
The number of input pixels drawn to a single cell.
When using NcBlitter::Pixel
, they are equivalent to cdim_yx
.
maxpixel_yx: Option<(u32, u32)>
The largest bitmap geometry that the terminal is willing to accept.
It is only defined when using NcBlitter::Pixel
.
beg_yx: Option<(u32, u32)>
The upper-left corner of the used section.
Corresponds to the NcVGeom
fields (begy
, begx
), and the
NcVisualOptions
fields (begy
, begx
).
len_yx: Option<(u32, u32)>
The geometry of the used section.
Corresponds to the NcVGeom
fields (leny
, lenx
), and the
NcVisualOptions
fields (leny
, lenx
).
blitter: NcBlitter
The NcBlitter
which will be used.
A function of the requested blitter and the blitters actually supported by this environment.
Implementations
sourceimpl NcVisualGeometry
impl NcVisualGeometry
sourcepub fn blitter_name(&self) -> String
pub fn blitter_name(&self) -> String
The name of the blitter which will be used.
A function of the requested blitter and the blitters actually supported by this environment.
sourceimpl NcVisualGeometry
impl NcVisualGeometry
Getter methods for the NcVGeom
fields
Each of the following methods return the corresponding NcVGeom
field
with the same name.
pub fn pixy(&self) -> u32
pub fn pixx(&self) -> u32
pub fn cdimy(&self) -> u32
pub fn cdimx(&self) -> u32
pub fn rpixy(&self) -> u32
pub fn rpixx(&self) -> u32
pub fn rcelly(&self) -> u32
pub fn rcellx(&self) -> u32
pub fn scaley(&self) -> u32
pub fn scalex(&self) -> u32
pub fn maxpixely(&self) -> u32
pub fn maxpixelx(&self) -> u32
pub fn begy(&self) -> u32
pub fn begx(&self) -> u32
pub fn leny(&self) -> u32
pub fn lenx(&self) -> u32
Trait Implementations
sourceimpl Clone for NcVisualGeometry
impl Clone for NcVisualGeometry
sourcefn clone(&self) -> NcVisualGeometry
fn clone(&self) -> NcVisualGeometry
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for NcVisualGeometry
impl Debug for NcVisualGeometry
sourceimpl Default for NcVisualGeometry
impl Default for NcVisualGeometry
sourcefn default() -> NcVisualGeometry
fn default() -> NcVisualGeometry
Returns the “default value” for a type. Read more
sourceimpl From<ncvgeom> for NcVisualGeometry
impl From<ncvgeom> for NcVisualGeometry
sourcefn from(vg: NcVGeom) -> Self
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
impl Copy for NcVisualGeometry
Auto Trait Implementations
impl RefUnwindSafe for NcVisualGeometry
impl Send for NcVisualGeometry
impl Sync for NcVisualGeometry
impl Unpin for NcVisualGeometry
impl UnwindSafe for NcVisualGeometry
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more