aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2019-12-10 18:44:52 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2019-12-10 18:44:52 +0100
commitb914ee01a678df890f66d7e7c63dde8f43ec6a80 (patch)
tree21940931fea78c5ae489bbf8adb1a4d8a4db1e6d
parentb8fb8e36449e29b6811ed5debcba36ed0705161c (diff)
downloadnihav-b914ee01a678df890f66d7e7c63dde8f43ec6a80.tar.gz
core/frame: add get_num_components() call to NAVideoBuffer
-rw-r--r--nihav-core/src/frame.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs
index 697013c..3af0d1d 100644
--- a/nihav-core/src/frame.rs
+++ b/nihav-core/src/frame.rs
@@ -118,6 +118,7 @@ impl<T: Clone> NAVideoBuffer<T> {
pub fn get_info(&self) -> NAVideoInfo { self.info }
pub fn get_data(&self) -> &Vec<T> { self.data.as_ref() }
pub fn get_data_mut(&mut self) -> Option<&mut Vec<T>> { self.data.as_mut() }
+ pub fn get_num_components(&self) -> usize { self.offs.len() }
pub fn copy_buffer(&mut self) -> Self {
let mut data: Vec<T> = Vec::with_capacity(self.data.len());
data.clone_from(self.data.as_ref());