Struct pdfium_render::bitmap::PdfBitmap
source · [−]pub struct PdfBitmap<'a> { /* private fields */ }Expand description
A bitmap image with a specific width and height.
Implementations
sourceimpl<'a> PdfBitmap<'a>
impl<'a> PdfBitmap<'a>
sourcepub fn empty(
width: Pixels,
height: Pixels,
format: PdfBitmapFormat,
bindings: &'a dyn PdfiumLibraryBindings
) -> Result<PdfBitmap<'_>, PdfiumError>
pub fn empty(
width: Pixels,
height: Pixels,
format: PdfBitmapFormat,
bindings: &'a dyn PdfiumLibraryBindings
) -> Result<PdfBitmap<'_>, PdfiumError>
Creates an empty PdfBitmap with a buffer capable of storing an image of the given pixel width and height in the given pixel format.
sourcepub fn bindings(&self) -> &dyn PdfiumLibraryBindings
pub fn bindings(&self) -> &dyn PdfiumLibraryBindings
Returns the PdfiumLibraryBindings used by this PdfBitmap.
sourcepub fn width(&self) -> Pixels
pub fn width(&self) -> Pixels
Returns the width of the image in the bitmap buffer backing this PdfBitmap.
sourcepub fn height(&self) -> Pixels
pub fn height(&self) -> Pixels
Returns the height of the image in the bitmap buffer backing this PdfBitmap.
sourcepub fn format(&self) -> Result<PdfBitmapFormat, PdfiumError>
pub fn format(&self) -> Result<PdfBitmapFormat, PdfiumError>
Returns the pixel format of the image in the bitmap buffer backing this PdfBitmap.
sourcepub fn as_bytes(&mut self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn as_bytes(&mut self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns an immutable reference to the bitmap buffer backing this PdfBitmap.
sourcepub fn as_image(&mut self) -> DynamicImage
pub fn as_image(&mut self) -> DynamicImage
Returns a new Image::DynamicImage created from the bitmap buffer backing this PdfBitmap.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PdfBitmap<'a>
impl<'a> !Send for PdfBitmap<'a>
impl<'a> !Sync for PdfBitmap<'a>
impl<'a> Unpin for PdfBitmap<'a>
impl<'a> !UnwindSafe for PdfBitmap<'a>
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