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
.Coordinate
if you prefer, e.g., toodee[(col, row)] = val
.&toodee[row]
.rows()
, rows_mut()
, col()
, col_mut()
, cells()
, cells_mut()
.#[no_std]
compliant.TooDeeView
from a &[T]
, or a TooDeeViewMut
from a &mut [T]
.insert_col()
, remove_col()
, insert_row()
, and remove_row()
implementations with good performance.TranslateOps
trait provides translate_with_wrap()
(efficient vertical and/or horizontal scrolling), flip_rows()
, and flip_cols()
operations.SortOps
trait provides sort_by_row()
, sort_by_col()
and other related operations.tiles(..)
and tiles_mut()
?Similar libraries do exist, but they lacked either performance, flexibility, or functionality.
Here's a small feature comparison chart:
Storage order | Structs supported | Growable? | Mutable views? | Raw data access? | Iterate over row slices? | Safe/checked access? | Notes | |
---|---|---|---|---|---|---|---|---|
toodee::TooDee | Row-major | Anything | Yes | Yes | Yes | Yes | No | |
image::ImageBuffer | Row-major | image::Pixel | No | No | Yes | No | No | Good for image processing - see the imageproc crate. |
image::SubImage | Row-major | image::Pixel | No | Yes | No | No | No | |
grid::Grid | Row-major | Clone | Yes | No | Yes | No | Yes | Similar to TooDee , but not as functionally rich. |
array2d::Array2D | Row-major | Clone | No | No | No | No | Yes | |
imgref::Img | Row-major | Anything | No | Yes | Yes | No | No | |
nalgebra::Matrix | Column-major | Scalar | Yes | Yes | Yes | No | 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.