pdf_writer::types

Enum PostScriptOp

source
pub enum PostScriptOp<'a> {
Show 44 variants Real(f32), Integer(i32), Abs, Add, Atan, Ceiling, Cos, Cvi, Cvr, Div, Exp, Floor, Idiv, Ln, Log, Mod, Mul, Neg, Round, Sin, Sqrt, Sub, Truncate, And, Bitshift, Eq, False, Ge, Gt, Le, Lt, Ne, Not, Or, True, Xor, If(&'a [Self]), IfElse(&'a [Self], &'a [Self]), Copy, Dup, Exch, Index, Pop, Roll,
}
Expand description

PostScript operators for use in Type 4 functions.

Variants§

§

Real(f32)

Push a real number.

§

Integer(i32)

Push an integer number.

§

Abs

Absolute value. One number argument.

§

Add

Addition. Two number arguments.

§

Atan

Arc tangent. One number argument.

§

Ceiling

Round up to the nearest integer. One number argument.

§

Cos

Cosine. One number argument.

§

Cvi

Convert to integer. One real number argument.

§

Cvr

Convert to real. One integer argument.

§

Div

Divide. Two number arguments.

§

Exp

Raise the base to the exponent. Two number arguments.

§

Floor

Round down to the nearest integer. One number argument.

§

Idiv

Integer division. Two integer arguments.

§

Ln

Natural logarithm. One number argument.

§

Log

Logarithm base 10. One number argument.

§

Mod

Modulo. Two integer arguments.

§

Mul

Multiply. Two number arguments.

§

Neg

Negate. One number argument.

§

Round

Round to the nearest integer. One number argument.

§

Sin

Sine. One number argument.

§

Sqrt

Square root. One number argument.

§

Sub

Subtract. Two number arguments.

§

Truncate

Remove fractional part. One number argument.

§

And

Logical bitwise And. Two integer or boolean arguments.

§

Bitshift

Bitwise shift left. Negative shifts possible. Two integer arguments.

§

Eq

Equals. Any two arguments of the same type.

§

False

Constant false.

§

Ge

Greater than or equal. Two number arguments.

§

Gt

Greater than. Two number arguments.

§

Le

Less than or equal. Two number arguments.

§

Lt

Less than. Two number arguments.

§

Ne

Not equals. Any two arguments of the same type.

§

Not

Bitwise logical not. One integer or boolean argument.

§

Or

Bitwise logical or. Two integer or boolean arguments.

§

True

Constant true.

§

Xor

Bitwise logical exclusive or. Two integer or boolean arguments.

§

If(&'a [Self])

Conditional. Runs if boolean argument is true.

§

IfElse(&'a [Self], &'a [Self])

Conditional. Decides which branch to run depending on boolean argument.

§

Copy

Copy the top elements. One integer argument.

§

Dup

Duplicate the top element.

§

Exch

Exchange the two top elements.

§

Index

Duplicate any element. One integer argument.

§

Pop

Discard the top element.

§

Roll

Roll n elements up j times. Two integer arguments.

Implementations§

source§

impl<'a> PostScriptOp<'a>

source

pub fn encode(ops: &[Self]) -> Vec<u8>

Encode a slice of operations into a byte stream.

Trait Implementations§

source§

impl<'a> Clone for PostScriptOp<'a>

source§

fn clone(&self) -> PostScriptOp<'a>

Returns a copy of the value. Read more
1.6.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for PostScriptOp<'a>

source§

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

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

impl<'a> PartialEq for PostScriptOp<'a>

source§

fn eq(&self, other: &PostScriptOp<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.6.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Copy for PostScriptOp<'a>

source§

impl<'a> StructuralPartialEq for PostScriptOp<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for PostScriptOp<'a>

§

impl<'a> RefUnwindSafe for PostScriptOp<'a>

§

impl<'a> Send for PostScriptOp<'a>

§

impl<'a> Sync for PostScriptOp<'a>

§

impl<'a> Unpin for PostScriptOp<'a>

§

impl<'a> UnwindSafe for PostScriptOp<'a>

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> Finish for T

source§

fn finish(self)

Does nothing but move self, equivalent to drop.
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> 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 = 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>,

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.