Struct libheif_rs::HeifContext[][src]

pub struct HeifContext { /* fields omitted */ }

Implementations

impl HeifContext[src]

pub fn new() -> Result<HeifContext>[src]

Create a new empty context.

pub fn read_from_bytes(bytes: &[u8]) -> Result<HeifContext>[src]

Create a new context from bytes.

pub fn read_from_file(name: &str) -> Result<HeifContext>[src]

Create a new context from file.

pub fn read_from_reader(reader: Box<dyn Reader>) -> Result<HeifContext>[src]

Create a new context from reader.

pub fn write_to_bytes(&self) -> Result<Vec<u8>>[src]

pub fn write_to_file(&self, name: &str) -> Result<()>[src]

pub fn number_of_top_level_images(&self) -> usize[src]

pub fn top_level_image_ids(&self, item_ids: &mut [ItemId]) -> usize[src]

pub fn image_handle(&self, item_id: ItemId) -> Result<ImageHandle<'_>>[src]

pub fn primary_image_handle(&self) -> Result<ImageHandle<'_>>[src]

pub fn encoder_for_format(&self, format: CompressionFormat) -> Result<Encoder>[src]

pub fn encode_image(
    &mut self,
    image: &Image,
    encoder: &mut Encoder,
    encoding_options: Option<EncodingOptions>
) -> Result<ImageHandle<'_>>
[src]

Compress the input image. The first image added to the context is also automatically set the primary image, but you can change the primary image later with [set_primary_image] method. [set_primary_image]: #method.set_primary_image

pub fn set_primary_image(
    &mut self,
    image_handle: &mut ImageHandle<'_>
) -> Result<()>
[src]

Trait Implementations

impl Drop for HeifContext[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl Send for HeifContext[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.