Struct libheif_rs::Image[][src]

pub struct Image { /* fields omitted */ }

Implementations

impl Image[src]

pub fn new(width: u32, height: u32, color_space: ColorSpace) -> Result<Image>[src]

Create a new image of the specified resolution and colorspace. Note: no memory for the actual image data is reserved yet. You have to use Image::create_plane() to add the image planes required by your colorspace.

pub fn width(&self, channel: Channel) -> Result<u32>[src]

pub fn height(&self, channel: Channel) -> Result<u32>[src]

pub fn bits_per_pixel(&self, channel: Channel) -> Result<u8>[src]

pub fn planes(&self) -> Planes<&[u8]>[src]

pub fn planes_mut(&mut self) -> Planes<&mut [u8]>[src]

pub fn has_channel(&self, channel: Channel) -> bool[src]

pub fn color_space(&self) -> Option<ColorSpace>[src]

pub fn scale(
    &self,
    width: u32,
    height: u32,
    _scaling_options: Option<ScalingOptions>
) -> Result<Image>
[src]

Scale image by “nearest neighbor” method.

pub fn create_plane(
    &mut self,
    channel: Channel,
    width: u32,
    height: u32,
    bit_depth: u8
) -> Result<()>
[src]

The indicated bit_depth corresponds to the bit depth per channel. I.e. for interleaved formats like RRGGBB, the bit_depth would be, e.g., 10 bit instead of 30 bits or 3*16=48 bits. For backward compatibility, one can also specify 24bits for RGB and 32bits for RGBA, instead of the preferred 8 bits.

Trait Implementations

impl Drop for Image[src]

impl Send for Image[src]

Auto Trait Implementations

impl RefUnwindSafe for Image

impl !Sync for Image

impl Unpin for Image

impl UnwindSafe for Image

Blanket Implementations

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

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

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

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

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

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.

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.