TooDee is a lightweight and high performance two-dimensional wrapper around a Vec
.
data()
and data_mut()
.view()
and view_mut()
.toodee[row][col] = val
.toodee[row]
.rows()
, rows_mut()
, col()
, col_mut()
, cells()
, cells_mut()
.no_std
compliant.TooDeeView
or TooDeeViewMut
directly from a &[T]
or &mut [T]
(respectively).insert_col()
, remove_col()
, insert_row()
, and remove_row()
implementations with good performance.translate_with_wrap()
(scroll), flip_rows()
, and flip_cols()
operations.sort_by_row()
and sort_by_col()
operations.TooDeeView[Mut]
?nth()
and nth_back()
for FlattenExact.tiles(..)
and tiles_mut()
?Similar libraries do exist, but they lacked either performance, flexibility, or functionality.
Here's a small feature comparison chart:
Structs supported | Growable? | Mutable views? | Raw data access? | Iterate over row slices? | Safe/checked access? | Notes | |
---|---|---|---|---|---|---|---|
toodee::TooDee | Anything | Yes | Yes | Yes | Yes | No | |
image::ImageBuffer | image::Pixel | No | No | Yes | No | No | Good for image processing - see the imageproc crate. |
image::SubImage | image::Pixel | No | Yes | No | No | No | |
grid::Grid | Clone | Yes | No | Yes | No | Yes | Similar to TooDee , but not as functionally rich. |
array2d::Array2D | Clone | No | No | No | No | Yes | |
imgref::Img | Anything | No | Yes | Yes | No | No | |
nalgebra::Matrix | Scalar | Yes | Yes | Yes | Yes | No | Use this for vector/matrix math. |
bounds()
of a view
are always relative to the underlying TooDee
array.Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.