Struct libheif_rs::Image [−][src]
pub struct Image { /* fields omitted */ }Implementations
impl Image[src]
impl Image[src]pub fn new(width: u32, height: u32, color_space: ColorSpace) -> Result<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]
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]
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.