frame/video: add stride() getter
This commit is contained in:
parent
edb6d91f59
commit
90291de572
@ -221,6 +221,17 @@ impl Video {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn stride(&self, index: usize) -> usize {
|
||||
if index >= self.planes() {
|
||||
panic!("out of bounds");
|
||||
}
|
||||
|
||||
unsafe {
|
||||
(*self.as_ptr()).linesize[index] as usize
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn planes(&self) -> usize {
|
||||
for i in 0 .. 8 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user