Struct distance_transform::grid::GenericGrid [] [src]

pub struct GenericGrid<T> { /* fields omitted */ }

A two-dimensional grid of an arbitrary type T

Methods

impl<T: Default + Clone> GenericGrid<T>
[src]

[src]

Constructs a new two-dimensional GenericGrid<T> of size widthxheight with default values of type T.

[src]

Returns the width of the grid

[src]

Returns the height of the grid

[src]

Returns the element at position (x, y), or None if the position is out of bounds.

[src]

Returns a pointer to the element at position (x, y), without doing bounds checking.

[src]

Sets the value of the grid at position (x,y)

[src]

Converts the GenericGrid<T> to a Vec<T> with indexing grid[x, y] == vec[y*grid.width + x]

[src]

Returns an iterator over the nodes of the grid. An item of the iterator contains the position and a reference to the node: (x, y, value)

[src]

Returns an iterator over the nodes of the grid. An item of the iterator contains the position and a mutable reference to the node: (x, y, value)

Trait Implementations

impl<T: Debug> Debug for GenericGrid<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: Clone> Clone for GenericGrid<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more