diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-05-21 10:57:22 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-05-21 10:57:22 +0200 |
commit | 8b746bf7d611f6910d656b312b4f6269fd63883c (patch) | |
tree | 90528b41ddb492aee1bd029ff9097834fb8ac155 /nihav-core/src/formats.rs | |
parent | a92964d593be4ebf96706842c02b428d68325b8d (diff) | |
download | nihav-8b746bf7d611f6910d656b312b4f6269fd63883c.tar.gz |
core/formats: add NAPixelFormaton::get_total_depth()
Diffstat (limited to 'nihav-core/src/formats.rs')
-rw-r--r-- | nihav-core/src/formats.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nihav-core/src/formats.rs b/nihav-core/src/formats.rs index 176f8d6..2c2e717 100644 --- a/nihav-core/src/formats.rs +++ b/nihav-core/src/formats.rs @@ -659,6 +659,16 @@ impl NAPixelFormaton { } mdepth } + /// Returns the total amount of bits needed for components. + pub fn get_total_depth(&self) -> u8 { + let mut depth = 0; + for chr in self.comp_info.iter() { + if let Some(ref chromaton) = chr { + depth += chromaton.depth; + } + } + depth + } /// Returns the maximum component subsampling. pub fn get_max_subsampling(&self) -> u8 { let mut ssamp = 0; |