Browse Source

textium::texture::Bitmap: add raw() -> &[T], into_raw() -> Vec<T>

master
Erin 8 years ago
parent
commit
372ff8d2e7
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      textium/src/texture.rs

+ 8
- 0
textium/src/texture.rs View File

@ -70,6 +70,14 @@ impl<T> Bitmap<T> where T: Clone + Default {
pub fn lines(&self) -> Chunks<T> { pub fn lines(&self) -> Chunks<T> {
self.data.chunks(self.width) self.data.chunks(self.width)
} }
pub fn raw(&self) -> &[T] {
&self.data
}
pub fn into_raw(self) -> Vec<T> {
self.data
}
} }
impl<T> Buffer2d for Bitmap<T> where T: Clone { impl<T> Buffer2d for Bitmap<T> where T: Clone {


Loading…
Cancel
Save