Skip to main content

RenderRequest

Struct RenderRequest 

Source
pub struct RenderRequest {
    pub page: u32,
    pub scale: f32,
    pub clip: Option<PixelRect>,
    pub rotation: Rotation,
    pub flags: RenderFlags,
    pub background: Option<Rgba8>,
    pub appearance: PageAppearance,
    pub hidden_annotations: Vec<u32>,
}
Expand description

One render: a page, a scale, an optional tile, a view rotation, flags, a background, the page appearance and the annotations left out.

Added in 0.2.0.

Fields§

§page: u32

The page, 0-based (ADR 0027).

§scale: f32

Output pixels per point, device pixel ratio already applied (1.0 is 72 DPI).

§clip: Option<PixelRect>

The tile to draw; None is the whole page (still bounded by RenderLimits).

§rotation: Rotation

The view rotation.

§flags: RenderFlags

What to draw.

§background: Option<Rgba8>

The background; None is transparent.

§appearance: PageAppearance

How the page’s colours are drawn (default: its own).

§hidden_annotations: Vec<u32>

Annotations left out of this render only, each by its place in the page’s /Annots (default none). An editor hides the annotation it moves, and draws it itself while the gesture lasts. The place, not /NM, names it: /NM is only a hint and two annotations may share one. A place past the end of /Annots hides nothing.

Added in 0.5.0.

Implementations§

Source§

impl RenderRequest

Source

pub fn page(page: u32, scale: f32) -> Self

The whole of page page at scale, upright, default flags, on white.

Added in 0.2.0.

Source

pub const fn with_clip(self, clip: PixelRect) -> Self

Only the tile clip.

Added in 0.2.0.

Source

pub const fn with_rotation(self, rotation: Rotation) -> Self

The view rotation.

Added in 0.2.0.

Source

pub const fn with_flags(self, flags: RenderFlags) -> Self

The flags.

Added in 0.2.0.

Source

pub const fn with_background(self, background: Option<Rgba8>) -> Self

The background (None: transparent).

Added in 0.2.0.

Source

pub const fn with_appearance(self, appearance: PageAppearance) -> Self

The page appearance.

Added in 0.2.0.

Source

pub fn with_hidden_annotations( self, places: impl IntoIterator<Item = u32>, ) -> Self

Leaves out the annotations at these places in the page’s /Annots, for this render only (see RenderRequest::hidden_annotations).

Added in 0.5.0.

Trait Implementations§

Source§

impl Clone for RenderRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderRequest

Source§

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

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

impl PartialEq for RenderRequest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RenderRequest

Auto Trait Implementations§

§

impl Forget for RenderRequest

§

impl Freeze for RenderRequest
where *const u8 is !null: Freeze, PhantomData<u32>: Freeze,

§

impl Move for RenderRequest

§

impl RefUnwindSafe for RenderRequest

§

impl Send for RenderRequest
where RawVecInner: Send,

§

impl Sync for RenderRequest
where RawVecInner: Sync,

§

impl Unpin for RenderRequest
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for RenderRequest

§

impl UnwindSafe for RenderRequest
where RawVecInner: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.