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.

Corresponds to the NcVGeom fields (pixy, pixx).

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.

Corresponds to the NcVGeom fields (rpixy, rpixx).

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).

Corresponds to the NcVGeom fields (rcelly, rcellx).

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.

Corresponds to the NcVGeom fields (scaley, scalex).

maxpixel_yx: Option<(NcDim, NcDim)>

The largest bitmap geometry that the terminal is willing to accept.

It is only defined when using NcBlitter::Pixel.

Corresponds to the NcVGeom fields (maxpixely, maxpixelx).

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 a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.