Struct libheif_rs::Image [−][src]
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]
&self,
width: u32,
height: u32,
_scaling_options: Option<ScalingOptions>
) -> Result<Image>
Scale image by “nearest neighbor” method.
pub fn create_plane(
&mut self,
channel: Channel,
width: u32,
height: u32,
bit_depth: u8
) -> Result<()>
[src]
&mut self,
channel: Channel,
width: u32,
height: u32,
bit_depth: u8
) -> Result<()>
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
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,