Struct libheif_rs::Image
source · [−]pub struct Image { /* private fields */ }Implementations
sourceimpl Image
impl Image
sourcepub fn new(width: u32, height: u32, color_space: ColorSpace) -> Result<Image>
pub fn new(width: u32, height: u32, color_space: ColorSpace) -> Result<Image>
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>
pub fn height(&self, channel: Channel) -> Result<u32>
pub fn bits_per_pixel(&self, channel: Channel) -> Result<u8>
pub fn planes(&self) -> Planes<&[u8]>
pub fn planes_mut(&mut self) -> Planes<&mut [u8]>
pub fn has_channel(&self, channel: Channel) -> bool
pub fn color_space(&self) -> Option<ColorSpace>
sourcepub fn scale(
&self,
width: u32,
height: u32,
_scaling_options: Option<ScalingOptions>
) -> Result<Image>
pub fn scale(
&self,
width: u32,
height: u32,
_scaling_options: Option<ScalingOptions>
) -> Result<Image>
Scale image by “nearest neighbor” method.
sourcepub fn create_plane(
&mut self,
channel: Channel,
width: u32,
height: u32,
bit_depth: u8
) -> Result<()>
pub fn create_plane(
&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.
pub fn set_premultiplied_alpha(&self, is_premultiplied_alpha: bool)
pub fn is_premultiplied_alpha(&self) -> bool
Trait Implementations
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more