Crate imgref_iter
source · [−]Expand description
A small crate for iterating over the rows or columns of imgref buffers.
This crate exports four traits that allow creating iterators over rows or
columns of Imgs:
-
ImgIterPtrforImg<*const [T]>; allows creating iterators over*constpointers -
ImgIterPtrMutforImg<*mut [T]>; allows creating iterators over*mutpointers -
ImgIterforImg<&[T]>; allows creating iterators over shared references -
ImgIterMutforImg<&mut [T]>; allows creating iterators over mutable references
As well as two utility traits for converting to Img<*const [T]> or
Img<*mut [T]>:
-
ImgAsPtrfor conversions toImg<*const [T]>. -
ImgAsMutPtrfor conversions toImg<*mut [T]>.This is actually not implemented by anything other than
Img<*mut [T]>, but it exists for the purpose of documenting why it cannot be implemented forImg<&mut [T]>.
Methods on ImgIterPtr and ImgIterPtrMut are unsafe because they
offset on the provided pointers. ImgIter and ImgIterMut cannot
include safe versions because the pointer iterators may outlive the
references.