Struct leptonica_plumbing::Pix
source · pub struct Pix(/* private fields */);
Expand description
Wrapper around Leptonica’s Pix
structure
Implementations§
source§impl Pix
impl Pix
sourcepub unsafe fn new_from_pointer(ptr: *mut Pix) -> Self
pub unsafe fn new_from_pointer(ptr: *mut Pix) -> Self
Create a new instance from a pointer
§Safety
The pointer must be to a valid Pix
struct.
The structure must not be mutated or freed outside of the Rust code whilst this instance exists.
sourcepub fn read(filename: &CStr) -> Result<RefCountedExclusive<Self>, PixReadError>
pub fn read(filename: &CStr) -> Result<RefCountedExclusive<Self>, PixReadError>
Wrapper for pixRead
Read an image from a filename
sourcepub fn read_mem(
img: &[u8]
) -> Result<RefCountedExclusive<Self>, PixReadMemError>
pub fn read_mem( img: &[u8] ) -> Result<RefCountedExclusive<Self>, PixReadMemError>
Wrapper for pixReadMem
Read an image from memory
sourcepub fn read_with_hint(
filename: &CStr,
hint: u32
) -> Result<RefCountedExclusive<Self>, PixReadError>
pub fn read_with_hint( filename: &CStr, hint: u32 ) -> Result<RefCountedExclusive<Self>, PixReadError>
Wrapper for pixReadWithHint
Read an image from memory with hints for JPEG decoding The valid hints are:
leptonica_sys::L_JPEG_READ_LUMINANCE
- only want luminance data; no chromaleptonica_sys::L_JPEG_CONTINUE_WITH_BAD_DATA
- return possibly damaged pix
sourcepub fn scale_general(
&mut self,
scalex: l_float32,
scaley: l_float32
) -> Result<(), PixManipError>
pub fn scale_general( &mut self, scalex: l_float32, scaley: l_float32 ) -> Result<(), PixManipError>
Wrapper for pixScaleGeneral
sourcepub fn get_height(&self) -> l_int32
pub fn get_height(&self) -> l_int32
Wrapper for pixGetHeight
sourcepub fn get_width(&self) -> l_int32
pub fn get_width(&self) -> l_int32
Wrapper for pixGetWidth
sourcepub fn get_depth(&self) -> l_int32
pub fn get_depth(&self) -> l_int32
Wrapper for pixGetDepth
sourcepub fn get_data(&self) -> *mut l_uint32
pub fn get_data(&self) -> *mut l_uint32
Wrapper for pixGetData
Trait Implementations§
source§impl LeptonicaClone for Pix
impl LeptonicaClone for Pix
Auto Trait Implementations§
impl Freeze for Pix
impl RefUnwindSafe for Pix
impl !Send for Pix
impl !Sync for Pix
impl Unpin for Pix
impl UnwindSafe for Pix
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