Struct libheif_sys::heif_reader
source · #[repr(C)]pub struct heif_reader {
pub reader_api_version: c_int,
pub get_position: Option<unsafe extern "C" fn(userdata: *mut c_void) -> i64>,
pub read: Option<unsafe extern "C" fn(data: *mut c_void, size: usize, userdata: *mut c_void) -> c_int>,
pub seek: Option<unsafe extern "C" fn(position: i64, userdata: *mut c_void) -> c_int>,
pub wait_for_file_size: Option<unsafe extern "C" fn(target_size: i64, userdata: *mut c_void) -> heif_reader_grow_status>,
}
Fields§
§reader_api_version: c_int
API version supported by this reader
get_position: Option<unsafe extern "C" fn(userdata: *mut c_void) -> i64>
— version 1 functions —
read: Option<unsafe extern "C" fn(data: *mut c_void, size: usize, userdata: *mut c_void) -> c_int>
The functions read(), and seek() return heif_error_ok on success. Generally, libheif will make sure that we do not read past the file size.
seek: Option<unsafe extern "C" fn(position: i64, userdata: *mut c_void) -> c_int>
§wait_for_file_size: Option<unsafe extern "C" fn(target_size: i64, userdata: *mut c_void) -> heif_reader_grow_status>
When calling this function, libheif wants to make sure that it can read the file up to ‘target_size’. This is useful when the file is currently downloaded and may grow with time. You may, for example, extract the image sizes even before the actual compressed image data has been completely downloaded.
Even if your input files will not grow, you will have to implement at least detection whether the target_size is above the (fixed) file length (in this case, return ‘size_beyond_eof’).
Trait Implementations§
source§impl Clone for heif_reader
impl Clone for heif_reader
source§fn clone(&self) -> heif_reader
fn clone(&self) -> heif_reader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for heif_reader
impl Debug for heif_reader
impl Copy for heif_reader
Auto Trait Implementations§
impl RefUnwindSafe for heif_reader
impl Send for heif_reader
impl Sync for heif_reader
impl Unpin for heif_reader
impl UnwindSafe for heif_reader
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