pub struct Image { /* private fields */ }Expand description
Tesseract-specific image.
Implementations§
Source§impl Image
impl Image
Sourcepub fn from_rgb(
width: u32,
height: u32,
rgb: &[u8],
) -> Result<Self, InvalidImage>
pub fn from_rgb( width: u32, height: u32, rgb: &[u8], ) -> Result<Self, InvalidImage>
Create an image from raw RGB bytes.
Sourcepub fn from_rgba(
width: u32,
height: u32,
rgba: &[u8],
) -> Result<Self, InvalidImage>
pub fn from_rgba( width: u32, height: u32, rgba: &[u8], ) -> Result<Self, InvalidImage>
Create an image from raw RGBA bytes.
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Returns width and height of the image.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl !Send for Image
impl !Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more