Skip to main content

PsRenderBackend

Struct PsRenderBackend 

Source
pub struct PsRenderBackend { /* private fields */ }
Expand description

PostScript Level 2/3 rendering backend.

Emits PS operators instead of pixels. Transparency (opacity, blend modes) is not supported — this matches upstream cfx_psrenderer behavior for PS Level 2, which has no native transparency model.

Implementations§

Source§

impl PsRenderBackend

Source

pub fn new() -> Self

Create a backend that emits a standalone PS file with operator abbreviation preamble and %%Page: markers.

Source

pub fn new_raw() -> Self

Create a backend that emits raw PS operators without a preamble, suitable for embedding in a larger PS document.

Trait Implementations§

Source§

impl Default for PsRenderBackend

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl RenderBackend for PsRenderBackend

Source§

type Surface = PsSurface

The surface type used by this backend.
Source§

fn create_surface(&self, width: u32, height: u32, _bg: &RgbaColor) -> PsSurface

Create a new rendering surface with the given dimensions and background.
Source§

fn fill_path( &mut self, surface: &mut PsSurface, ops: &[PathOp], fill_rule: FillRule, color: &RgbaColor, transform: &Matrix, )

Fill a path with the given color and transform.
Source§

fn stroke_path( &mut self, surface: &mut PsSurface, ops: &[PathOp], style: &StrokeStyle, color: &RgbaColor, transform: &Matrix, )

Stroke a path with the given style, color, and transform.
Source§

fn draw_image( &mut self, surface: &mut PsSurface, image: &DecodedImage, transform: &Matrix, _interpolate: bool, )

Draw a decoded image with the given transform. Read more
Source§

fn push_clip( &mut self, surface: &mut PsSurface, clip: &ClipPath, transform: &Matrix, )

Push a clipping region onto the clip stack.
Source§

fn pop_clip(&mut self, surface: &mut PsSurface)

Pop the most recent clipping region.
Source§

fn push_group( &mut self, surface: &mut PsSurface, _blend_mode: BlendMode, _opacity: f32, _isolated: bool, _knockout: bool, )

Begin a transparency group with the given blend mode, opacity, and transparency group attributes.
Source§

fn pop_group(&mut self, surface: &mut PsSurface)

End the current transparency group, compositing it onto the surface below.
Source§

fn surface_dimensions(&self, surface: &PsSurface) -> (u32, u32)

Return the dimensions (width, height) of the given surface.
Source§

fn composite_over(&mut self, _dst: &mut PsSurface, _src: &PsSurface)

Draw the content of src over dst using normal (SourceOver) blending. Read more
Source§

fn surface_pixels(&self, _surface: &PsSurface) -> Vec<u8>

Return the raw pixel data of the surface as premultiplied RGBA bytes.
Source§

fn finish(self, surface: PsSurface) -> Bitmap

Finish rendering and return the final bitmap.
Source§

fn fill_path_no_aa( &mut self, surface: &mut Self::Surface, ops: &[PathOp], fill_rule: FillRule, color: &RgbaColor, transform: &Matrix, )

Fill a path with anti-aliasing forced off. Read more
Source§

fn set_group_mask(&mut self, _alpha_data: Vec<u8>, _width: u32, _height: u32)

Set a soft mask on the topmost group entry. Read more
Source§

fn draw_alpha_bitmap( &mut self, _surface: &mut Self::Surface, _alpha: &[u8], _width: u32, _height: u32, _bearing_x: i32, _bearing_y: i32, _color: &RgbaColor, _transform: &Matrix, )

Draw a pre-rasterized alpha bitmap at the given position with the given color. Read more
Source§

fn set_antialiasing(&mut self, _enabled: bool)

Set whether anti-aliasing is enabled for subsequent fill/stroke operations. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more