projects
/
nihav.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core/formats: add NAPixelFormaton::get_total_depth()
[nihav.git]
/
nihav-core
/
src
/
formats.rs
diff --git
a/nihav-core/src/formats.rs
b/nihav-core/src/formats.rs
index 176f8d613f32a0fd782ea4569a1076c8343ebee7..2c2e717d93e3cd6bf35bf2fe2f5dafb3d0ede950 100644
(file)
--- a/
nihav-core/src/formats.rs
+++ b/
nihav-core/src/formats.rs
@@
-659,6
+659,16
@@
impl NAPixelFormaton {
}
mdepth
}
}
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;
/// Returns the maximum component subsampling.
pub fn get_max_subsampling(&self) -> u8 {
let mut ssamp = 0;