projects
/
nihav.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core/frame: introduce NAVideoBuffer::from_raw_parts()
[nihav.git]
/
nihav-core
/
src
/
frame.rs
diff --git
a/nihav-core/src/frame.rs
b/nihav-core/src/frame.rs
index 0fcdbcaa7526845f74ced9303431f7872d50e1c5..5499de1001b40b36446bec2cd8d99902bcf24d1e 100644
(file)
--- a/
nihav-core/src/frame.rs
+++ b/
nihav-core/src/frame.rs
@@
-150,6
+150,10
@@
pub struct NAVideoBuffer<T> {
}
impl<T: Clone> NAVideoBuffer<T> {
}
impl<T: Clone> NAVideoBuffer<T> {
+ /// Constructs video buffer from the provided components.
+ pub fn from_raw_parts(info: NAVideoInfo, data: NABufferRef<Vec<T>>, offs: Vec<usize>, strides: Vec<usize>) -> Self {
+ Self { info, data, offs, strides }
+ }
/// Returns the component offset (0 for all unavailable offsets).
pub fn get_offset(&self, idx: usize) -> usize {
if idx >= self.offs.len() { 0 }
/// Returns the component offset (0 for all unavailable offsets).
pub fn get_offset(&self, idx: usize) -> usize {
if idx >= self.offs.len() { 0 }