[−][src]Struct pathfinder::Map
High abstraction Map which helps position objects.
Methods
impl Map
[src]
pub fn new() -> Self
[src]
Creates a new map, no min_max are intially required and are generated automatically when calling Map::map.
pub fn save(self, path: &Path) -> Result<(), Error>
[src]
Saves the image to disk at the given Path.
Examples
let nodes = Node::from_list(&[(0, 0), (10, 10)]); Map::new() .map(&nodes) .save(Path::new("/tmp/example.png"))?;
pub fn consume(self) -> IW
[src]
Consumes the Map and returns the ImageWrapper.
pub fn map<T: Draw + Location + Hash + MinMax>(self, element: &[T]) -> Self
[src]
Maps any struct that has implemented Draw, on to an ImageBuffer.
Examples
let nodes: Vec<Node> = Node::from_list(&[(0, 0), (100, 100)]); // Add content to vectors. let mut map = Map::new(); map = map.map(&nodes);
pub fn map_filter<T: Draw + Location + Hash + MinMax>(
self,
element: &[T],
filter: &dyn Fn(&T) -> bool
) -> Self
[src]
self,
element: &[T],
filter: &dyn Fn(&T) -> bool
) -> Self
Maps the elements but with an added filter parameter to exclude elements.
pub fn map_shape<T: Draw + Location + Hash + MinMax>(
self,
element: &[T],
shape: &Shape
) -> Self
[src]
self,
element: &[T],
shape: &Shape
) -> Self
Maps the elements with a specified shape struct.
pub fn map_absolute<T: Draw + Location + Hash + MinMax>(
self,
element: &[T]
) -> Self
[src]
self,
element: &[T]
) -> Self
Maps the elements without stabalizing the positions on the canvas.
pub fn map_params<T: Draw + Location + Hash + MinMax>(
self,
element: &[T],
filter: &dyn Fn(&T) -> bool,
shape: &Shape
) -> Self
[src]
self,
element: &[T],
filter: &dyn Fn(&T) -> bool,
shape: &Shape
) -> Self
Maps the elements but with all added parameters.
Trait Implementations
impl Default for Map
[src]
impl Clone for Map
[src]
fn clone(&self) -> Map
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Map
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,