[][src]Struct svgbob::buffer::PropertyBuffer

pub struct PropertyBuffer<'p>(_);

PropertyBuffer is a buffer which contains the property of each cell This will be used in the first phase of converting ascii diagrams into fragment buffer The properties are generated once and will be repeatedly used for the second phase where testing the neighboring charaters to determine the fragment to be drawn for that cell.

Methods

impl<'p> PropertyBuffer<'p>[src]

pub fn new() -> Self[src]

pub fn match_char_from_cell(
    &self,
    settings: &Settings,
    cell: Cell,
    fragments: &Vec<Fragment>,
    try_unicode: bool
) -> Option<char>
[src]

get the appropriate character for this cell that matches the its behavior affected by the 8 surrounding properties of it's neighbor

Note: this is primarily used for the drawing api, converting fragments into the most fitting ascii / unicode character

pub fn match_char_with_surrounding_properties(
    settings: &Settings,
    fragments: &Vec<Fragment>,
    top_left: &Property,
    top: &Property,
    top_right: &Property,
    left: &Property,
    right: &Property,
    bottom_left: &Property,
    bottom: &Property,
    bottom_right: &Property
) -> Option<char>
[src]

if the fragments match to the return fragments of the property behavior, then it is a match

Trait Implementations

impl<'p> AsMut<HashMap<Cell, &'p Property, RandomState>> for PropertyBuffer<'p>[src]

impl<'p> AsRef<HashMap<Cell, &'p Property, RandomState>> for PropertyBuffer<'p>[src]

impl<'p, '_> Into<PropertyBuffer<'p>> for &'_ Span[src]

create a property buffer for all the cells of this span

Auto Trait Implementations

impl<'p> !RefUnwindSafe for PropertyBuffer<'p>

impl<'p> Send for PropertyBuffer<'p>

impl<'p> Sync for PropertyBuffer<'p>

impl<'p> Unpin for PropertyBuffer<'p>

impl<'p> !UnwindSafe for PropertyBuffer<'p>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.