[−][src]Struct packos::SimplePacker
A configurable rectangle packer using a simple packing algorithm.
Methods
impl SimplePacker
[src]
pub fn new() -> Self
[src]
Constructs a new SimplePacker
with the default configuration:
min_size
of 128x128max_size
of 1024x1024padding
of 0
pub fn min_size(self, min_size: (u32, u32)) -> Self
[src]
pub fn max_size(self, max_size: (u32, u32)) -> Self
[src]
pub fn padding(self, padding: u32) -> Self
[src]
pub fn pack<Iter, Item>(&self, items: Iter) -> PackOutput where
Iter: IntoIterator<Item = Item>,
Item: Borrow<InputItem>,
[src]
Iter: IntoIterator<Item = Item>,
Item: Borrow<InputItem>,
Pack a group of input rectangles into zero or more buckets.
Accepts any type that can turn into an iterator of anything that can
borrow as an InputItem
. This helps make sure that types like
Vec<InputItem>
, &[InputItem]
, and iterators that return either
InputItem
or &InputItem
can be valid inputs.
Trait Implementations
impl Clone for SimplePacker
[src]
fn clone(&self) -> SimplePacker
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SimplePacker
[src]
impl Default for SimplePacker
[src]
Auto Trait Implementations
impl RefUnwindSafe for SimplePacker
impl Send for SimplePacker
impl Sync for SimplePacker
impl Unpin for SimplePacker
impl UnwindSafe for SimplePacker
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,