aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-core/src/frame.rs
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-06-07 14:48:03 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-06-07 14:48:03 +0200
commit30940e7459d0fa54e1831bb9825b1b91787ac3d7 (patch)
treeea48fcc3c5f699f57d69a90e53616e5e6ece9a6b /nihav-core/src/frame.rs
parent0be53e583e2433d7a1702caa24f3864a08f31dd1 (diff)
downloadnihav-30940e7459d0fa54e1831bb9825b1b91787ac3d7.tar.gz
add declared bitdepth to NAVideoInfo
Diffstat (limited to 'nihav-core/src/frame.rs')
-rw-r--r--nihav-core/src/frame.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs
index 26e8640..6386d6f 100644
--- a/nihav-core/src/frame.rs
+++ b/nihav-core/src/frame.rs
@@ -53,12 +53,15 @@ pub struct NAVideoInfo {
pub flipped: bool,
/// Picture pixel format.
pub format: NAPixelFormaton,
+ /// Declared bits per sample.
+ pub bits: u8,
}
impl NAVideoInfo {
/// Constructs a new `NAVideoInfo` instance.
pub fn new(w: usize, h: usize, flip: bool, fmt: NAPixelFormaton) -> Self {
- NAVideoInfo { width: w, height: h, flipped: flip, format: fmt }
+ let bits = fmt.get_total_depth();
+ NAVideoInfo { width: w, height: h, flipped: flip, format: fmt, bits }
}
/// Returns picture width.
pub fn get_width(&self) -> usize { self.width as usize }