From 372ff8d2e7fcad73fe472ced95184d7a9da7f17b Mon Sep 17 00:00:00 2001 From: Erin Date: Wed, 16 Aug 2017 11:53:17 -0500 Subject: [PATCH] textium::texture::Bitmap: add raw() -> &[T], into_raw() -> Vec --- textium/src/texture.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/textium/src/texture.rs b/textium/src/texture.rs index 8ede56d..b5f0f1f 100644 --- a/textium/src/texture.rs +++ b/textium/src/texture.rs @@ -70,6 +70,14 @@ impl Bitmap where T: Clone + Default { pub fn lines(&self) -> Chunks { self.data.chunks(self.width) } + + pub fn raw(&self) -> &[T] { + &self.data + } + + pub fn into_raw(self) -> Vec { + self.data + } } impl Buffer2d for Bitmap where T: Clone {