Struct libnotcurses_sys::NcVisualGeometry [−][src]
pub struct NcVisualGeometry {
pub pix_yx: Option<(NcDim, NcDim)>,
pub cdim_yx: Option<(NcDim, NcDim)>,
pub rpix_yx: Option<(NcDim, NcDim)>,
pub rcell_yx: Option<(NcDim, NcDim)>,
pub scale_yx: Option<(NcDim, NcDim)>,
pub maxpixel_yx: Option<(NcDim, NcDim)>,
pub beg_yx: Option<(NcDim, NcDim)>,
pub len_yx: Option<(NcDim, NcDim)>,
pub blitter: NcBlitter,
}
Expand description
Describes all the geometries of an NcVisual
, in a more Rust-friendly
struct than NcVGeom
is.
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<(NcDim, NcDim)>
The true internal pixel geometry of NcVisual
data, taken directly
from the load, and updated by ncvisual_resize
.
cdim_yx: Option<(NcDim, NcDim)>
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<(NcDim, NcDim)>
Rendered pixel geometry, per NcVisualOptions
.
as handed to the blitter, following any scaling.
rcell_yx: Option<(NcDim, NcDim)>
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<(NcDim, NcDim)>
The number of input pixels drawn to a single cell.
When using NcBlitter::Pixel
, they are equivalent to cdim_yx
.
maxpixel_yx: Option<(NcDim, NcDim)>
The largest bitmap geometry that the terminal is willing to accept.
It is only defined when using NcBlitter::Pixel
.
beg_yx: Option<(NcDim, NcDim)>
The upper-left corner of the used section.
Corresponds to the NcVGeom
fields (begy
, begx
), and the
NcVisualOptions
fields (begy
, begx
).
len_yx: Option<(NcDim, NcDim)>
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
The name of the blitter which will be used.
A function of the requested blitter and the blitters actually supported by this environment.
Getter methods for the NcVGeom
fields
Each of the following methods return the corresponding NcVGeom
field
with the same name.
Trait Implementations
Returns the “default value” for a type. Read more
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
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
Mutably borrows from an owned value. Read more