pub struct Image { /* private fields */ }Implementations§
Source§impl Image
impl Image
Sourcepub fn get_image_width(&self, channel: i32) -> u32
pub fn get_image_width(&self, channel: i32) -> u32
Examples found in repository?
examples/demo.rs (line 68)
48fn main() {
49 let de = De265::new().unwrap();
50 println!("libde265 {}", de.get_version());
51
52 let mut decoder = Decoder::new(de.clone());
53 decoder.start_worker_threads(16).unwrap();
54
55 let h264_in = std::fs::read("/home/andrey/demo/h265/big_buck_bunney.h265").unwrap();
56
57 for packet in nal_units(&h264_in) {
58 decoder.push_data(packet, 0, None).unwrap();
59 decoder.decode().unwrap();
60
61 if let Some(img) = decoder.get_next_picture() {
62 let y = img.get_image_plane(0);
63 let u = img.get_image_plane(1);
64 let v = img.get_image_plane(2);
65
66 println!(
67 "pic {}x{} {:?} {:?} {:?} {:?} {:?} {:?} {:?}",
68 img.get_image_width(0),
69 img.get_image_height(0),
70 img.get_chroma_format(),
71 &y.0[0..20],
72 y.1,
73 &u.0[0..20],
74 u.1,
75 &v.0[0..20],
76 v.1
77 );
78 }
79 }
80}Sourcepub fn get_image_height(&self, channel: i32) -> u32
pub fn get_image_height(&self, channel: i32) -> u32
Examples found in repository?
examples/demo.rs (line 69)
48fn main() {
49 let de = De265::new().unwrap();
50 println!("libde265 {}", de.get_version());
51
52 let mut decoder = Decoder::new(de.clone());
53 decoder.start_worker_threads(16).unwrap();
54
55 let h264_in = std::fs::read("/home/andrey/demo/h265/big_buck_bunney.h265").unwrap();
56
57 for packet in nal_units(&h264_in) {
58 decoder.push_data(packet, 0, None).unwrap();
59 decoder.decode().unwrap();
60
61 if let Some(img) = decoder.get_next_picture() {
62 let y = img.get_image_plane(0);
63 let u = img.get_image_plane(1);
64 let v = img.get_image_plane(2);
65
66 println!(
67 "pic {}x{} {:?} {:?} {:?} {:?} {:?} {:?} {:?}",
68 img.get_image_width(0),
69 img.get_image_height(0),
70 img.get_chroma_format(),
71 &y.0[0..20],
72 y.1,
73 &u.0[0..20],
74 u.1,
75 &v.0[0..20],
76 v.1
77 );
78 }
79 }
80}Sourcepub fn get_chroma_format(&self) -> ChromaFormat
pub fn get_chroma_format(&self) -> ChromaFormat
Examples found in repository?
examples/demo.rs (line 70)
48fn main() {
49 let de = De265::new().unwrap();
50 println!("libde265 {}", de.get_version());
51
52 let mut decoder = Decoder::new(de.clone());
53 decoder.start_worker_threads(16).unwrap();
54
55 let h264_in = std::fs::read("/home/andrey/demo/h265/big_buck_bunney.h265").unwrap();
56
57 for packet in nal_units(&h264_in) {
58 decoder.push_data(packet, 0, None).unwrap();
59 decoder.decode().unwrap();
60
61 if let Some(img) = decoder.get_next_picture() {
62 let y = img.get_image_plane(0);
63 let u = img.get_image_plane(1);
64 let v = img.get_image_plane(2);
65
66 println!(
67 "pic {}x{} {:?} {:?} {:?} {:?} {:?} {:?} {:?}",
68 img.get_image_width(0),
69 img.get_image_height(0),
70 img.get_chroma_format(),
71 &y.0[0..20],
72 y.1,
73 &u.0[0..20],
74 u.1,
75 &v.0[0..20],
76 v.1
77 );
78 }
79 }
80}pub fn get_bits_per_pixel(&self, channel: i32) -> i32
Sourcepub fn get_image_plane(&self, channel: i32) -> (&[u8], usize)
pub fn get_image_plane(&self, channel: i32) -> (&[u8], usize)
Examples found in repository?
examples/demo.rs (line 62)
48fn main() {
49 let de = De265::new().unwrap();
50 println!("libde265 {}", de.get_version());
51
52 let mut decoder = Decoder::new(de.clone());
53 decoder.start_worker_threads(16).unwrap();
54
55 let h264_in = std::fs::read("/home/andrey/demo/h265/big_buck_bunney.h265").unwrap();
56
57 for packet in nal_units(&h264_in) {
58 decoder.push_data(packet, 0, None).unwrap();
59 decoder.decode().unwrap();
60
61 if let Some(img) = decoder.get_next_picture() {
62 let y = img.get_image_plane(0);
63 let u = img.get_image_plane(1);
64 let v = img.get_image_plane(2);
65
66 println!(
67 "pic {}x{} {:?} {:?} {:?} {:?} {:?} {:?} {:?}",
68 img.get_image_width(0),
69 img.get_image_height(0),
70 img.get_chroma_format(),
71 &y.0[0..20],
72 y.1,
73 &u.0[0..20],
74 u.1,
75 &v.0[0..20],
76 v.1
77 );
78 }
79 }
80}pub fn get_image_plane_user_data(&self, channel: i32) -> Option<&dyn Any>
pub fn get_image_plane_user_data_mut( &mut self, channel: i32, ) -> Option<&mut dyn Any>
pub fn get_image_user_data(&self) -> Option<&dyn Any>
pub fn get_image_user_data_mut(&mut self) -> Option<&mut dyn Any>
pub fn get_image_pts(&self) -> i64
pub fn get_image_nal_header(&self)
pub fn get_image_full_range_flag(&self) -> i32
pub fn get_image_colour_primaries(&self) -> i32
pub fn get_image_transfer_characteristics(&self) -> i32
pub fn get_image_matrix_coefficients(&self) -> i32
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl !Send for Image
impl !Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more