Struct libnotcurses_sys::c_api::ffi::ncvisual_options[][src]

#[repr(C)]
pub struct ncvisual_options {
Show 13 fields pub n: *mut ncplane, pub scaling: ncscale_e, pub y: c_int, pub x: c_int, pub begy: c_uint, pub begx: c_uint, pub leny: c_uint, pub lenx: c_uint, pub blitter: ncblitter_e, pub flags: u64, pub transcolor: u32, pub pxoffy: c_uint, pub pxoffx: c_uint,
}

Fields

n: *mut ncplane

if 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_e

the 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_int

if 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_int

if 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_uint

origin of rendered region in pixels

begx: c_uint

origin of rendered region in pixels

leny: c_uint

size of rendered region in pixels

lenx: c_uint

size of rendered region in pixels

blitter: ncblitter_e

glyph set to use (maps input to output cells)

flags: u64

bitmask over NCVISUAL_OPTION_*

transcolor: u32

treat this color as transparent under NCVISUAL_OPTION_ADDALPHA

pxoffy: c_uint

pixel 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_uint

pixel 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

Treats as transparent the color specified in the transcolor field.

Uses NcAlpha::Blend with the NcVisual.

allows you to indicate that the n field of ncvisual_options refers not to the plane onto which you’d like to blit, but the parent of a new plane.

A plane will be created using the other parameters in the ncvisual_options, as a child of this parent. This means things like, say, vertically centering a sprixel relative to the standard plane can be done in one step.

Fails rather than gracefully degrade. See NcBlitter.

Y is an alignment, not absolute.

X is an alignment, not absolute.

Uses non-interpolative scaling.

Returns a builder object for NcVisualOptions.

New NcVisualOptions.

Arguments
  • plane - an optional mutable pointer to an NcPlane.

  • scale - how the source will be stretched/scaled relative to the NcPlane (NOSCALE, SCALE, STRETCH, NONE_HIRES, SCALE_HIRES).

  • y - if an NcPlane is provided in plane then this specifies where the NcVisual will be on that plane in the y axis.

    Otherwise it specifies where the created NcPlane will be placed in the y axis, relative to the standard plane’s origin.

    If VERALIGNED is set, this will be interpreted as an NcAlign value.

  • x - if an NcPlane is provided in plane then this specifies where the NcVisual will be on that plane, in the x axis.

    Otherwise it specifies where the created NcPlane will be placed, in the y axis, relative to the standard plane’s origin.

    If HORALIGNED is set, this will be interpreted as an NcAlign value.

  • section_yx_lenyx - The size of the rendered section.

    None renders the entire visual, otherwise the provided tuple (y, x, len_y, len_x) sets [yx] as the origin of the section and len_[yx] as the its length on each respective dimension.

  • cell_offset_yx - Pixel offsets within the cell.

    If NcBlitter::Pixel is 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 - NcBlitter glyph set to use for blitting.

  • flags - bitmask of options: (ADDALPHA, BLEND, CHILDPLANE, NODEGRADE, VERALIGNED, HORALIGNED, NOINTERPOLATE).

  • transcolor - treats this color as transparent when the ADDALPHA flag is active

Notes

If the NcVisualOptions::CHILDPLANE flag is used then the plane is interpreted as the parent NcPlane of the new plane created for this NcVisual.

Trait Implementations

Formats the value using the given formatter. Read more

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

Feeds this value into the given Hasher. Read more

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

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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