Struct pdfium_render::bitmap::PdfBitmap
source · [−]pub struct PdfBitmap<'a> { /* private fields */ }Expand description
A rendered image of a single PdfPage at a specific width and height.
By default, PdfBitmap is lazy; it will not render its page into a bitmap until
it is required to do so in order to return a byte buffer or an Image::DynamicImage.
If preferred, rendering can be initiated manually by calling the PdfBitmap::render() function.
Once rendered, the page will not be re-rendered.
Implementations
sourceimpl<'a> PdfBitmap<'a>
impl<'a> PdfBitmap<'a>
sourcepub fn format(&self) -> PdfBitmapFormat
pub fn format(&self) -> PdfBitmapFormat
Returns the pixel format of the image in this PdfBitmap.
sourcepub fn rotation(&self) -> PdfBitmapRotation
pub fn rotation(&self) -> PdfBitmapRotation
Returns the rotation setting that will be applied to this page during rendering.
sourcepub fn as_image(&mut self) -> DynamicImage
pub fn as_image(&mut self) -> DynamicImage
Returns a new DynamicImage created from the bitmap buffer backing this PdfBitmap, rendering the referenced page if necessary.
sourcepub fn as_bytes(&mut self) -> &'a [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn as_bytes(&mut self) -> &'a [u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns an immutable reference to the bitmap buffer backing this PdfBitmap, rendering the referenced page if necessary.
sourcepub fn render(&mut self)
pub fn render(&mut self)
Renders this page into a bitmap buffer. Once rendered, the page will not be re-rendered.
It is generally unnecessary to call this function directly, since PdfBitmap will automatically initiate rendering itself on the first call to either the PdfBitmap::as_bytes() function or the PdfBitmap::as_image() function.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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