Struct leptonica_plumbing::Pix

source ·
pub struct Pix(/* private fields */);
Expand description

Wrapper around Leptonica’s Pix structure

Implementations§

source§

impl Pix

source

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.

source

pub fn read(filename: &CStr) -> Result<RefCountedExclusive<Self>, PixReadError>

Wrapper for pixRead

Read an image from a filename

source

pub fn read_mem( img: &[u8] ) -> Result<RefCountedExclusive<Self>, PixReadMemError>

Wrapper for pixReadMem

Read an image from memory

source

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:

source

pub fn scale_general( &mut self, scalex: l_float32, scaley: l_float32 ) -> Result<(), PixManipError>

Wrapper for pixScaleGeneral

source

pub fn get_height(&self) -> l_int32

Wrapper for pixGetHeight

source

pub fn get_width(&self) -> l_int32

Wrapper for pixGetWidth

source

pub fn get_depth(&self) -> l_int32

Wrapper for pixGetDepth

source

pub fn get_data(&self) -> *mut l_uint32

Wrapper for pixGetData

Trait Implementations§

source§

impl AsMut<Pix> for Pix

source§

fn as_mut(&mut self) -> &mut Pix

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<*mut Pix> for Pix

source§

fn as_ref(&self) -> &*mut Pix

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<Pix> for Pix

source§

fn as_ref(&self) -> &Pix

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<Pix> for Pix

source§

fn as_ref(&self) -> &Pix

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Pix

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl LeptonicaClone for Pix

source§

unsafe fn clone(&mut self) -> Self

Call to leptonica’s internal structure-clone method. Read more
source§

impl LeptonicaDestroy for Pix

source§

unsafe fn destroy(&mut self)

Call to leptonica’s internal structure-destroy method. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.