Type Definition libnotcurses_sys::NcVisualOptions [−][src]
pub type NcVisualOptions = ncvisual_options;Expand description
Options struct for NcVisual.
It is recommended to construct it via NcVisualOptionsBuilder
by calling NcVisualOptions::builder().
Usage
If a plane is not provided, one will be created, having the exact size
necessary to display the visual (this might be smaller or larger than
the rendering area). if NcVisualOptions::CHILDPLANE is provided,
this will be interpreted as the parent.
A subregion of the visual can be rendered using beg_y, beg_x, len_y,
and len_x.
Fields
-
scaling: how the source will be stretched/scaled relative to theNcPlane(NOSCALE,SCALE,STRETCH,NONE_HIRES,SCALE_HIRES). -
y: if anNcPlaneis provided innthen this specifies where theNcVisualwill be on that plane.Otherwise it specifies where the created
NcPlanewill be placed relative to the standard plane’s origin.If
VERALIGNEDis set, this will be interpreted as anNcAlignvalue. -
x: if anNcPlaneis provided innthen this specifies where theNcVisualwill be on that plane.Otherwise it specifies where the created
NcPlanewill be placed relative to the standard plane’s origin.If
HORALIGNEDis set, this will be interpreted as anNcAlignvalue. -
begy: origin of rendered section in the y axis. -
begx: origin of rendered section in the x axis. -
leny: length of rendered section in the y axis. -
lenx: length of rendered section in the x axis. -
flags: bitmask of options:ADDALPHA,BLEND,CHILDPLANE,NODEGRADE,VERALIGNED,HORALIGNED,NOINTERPOLATE. -
transcolor: treats this color as transparent when theADDALPHAflag is active. -
pxoffy: pixel offset within the cell in the y axis.If
NcBlitter::Pixelis 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
NcPixelGeometry.cell_y,NcVisualGeometry.cdim_yx). -
pxoffx: pixel offset within the cell in the x axis.If
NcBlitter::Pixelis 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
NcPixelGeometry.cell_x,NcVisualGeometry.cdim_yx).
Implementations
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.
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 anNcPlane. -
scale- how the source will be stretched/scaled relative to theNcPlane(NOSCALE,SCALE,STRETCH,NONE_HIRES,SCALE_HIRES). -
y- if anNcPlaneis provided inplanethen this specifies where theNcVisualwill be on that plane in the y axis.Otherwise it specifies where the created
NcPlanewill be placed in the y axis, relative to the standard plane’s origin.If
VERALIGNEDis set, this will be interpreted as anNcAlignvalue. -
x- if anNcPlaneis provided inplanethen this specifies where theNcVisualwill be on that plane, in the x axis.Otherwise it specifies where the created
NcPlanewill be placed, in the y axis, relative to the standard plane’s origin.If
HORALIGNEDis set, this will be interpreted as anNcAlignvalue. -
section_yx_lenyx- The size of the rendered section.Nonerenders the entire visual, otherwise the provided tuple (y,x,len_y,len_x) sets[yx]as the origin of the section andlen_[yx]as the its length on each respective dimension. -
cell_offset_yx- Pixel offsets within the cell.If
NcBlitter::Pixelis 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-NcBlitterglyph set to use for blitting. -
flags- bitmask of options: (ADDALPHA,BLEND,CHILDPLANE,NODEGRADE,VERALIGNED,HORALIGNED,NOINTERPOLATE). -
transcolor- treats this color as transparent when theADDALPHAflag 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.
