pub struct PixmapDevice {
pub pixmap: Pixmap,
/* private fields */
}Expand description
A rendering device that draws PDF operations onto a pixel buffer.
Fields§
§pixmap: PixmapImplementations§
Source§impl PixmapDevice
impl PixmapDevice
pub fn new(width: u32, height: u32) -> Result<Self>
Sourcepub fn set_clip_path(
&mut self,
path: &Path,
fill_rule: FillRule,
transform: Transform,
)
pub fn set_clip_path( &mut self, path: &Path, fill_rule: FillRule, transform: Transform, )
Set a clipping path (replaces existing clip).
Sourcepub fn intersect_clip_path(
&mut self,
path: &Path,
fill_rule: FillRule,
transform: Transform,
)
pub fn intersect_clip_path( &mut self, path: &Path, fill_rule: FillRule, transform: Transform, )
Intersect the current clip with another path.
Sourcepub fn clear_clip(&mut self)
pub fn clear_clip(&mut self)
Clear the clip mask.
Sourcepub fn fill_path(
&mut self,
path: &Path,
fill_rule: FillRule,
transform: Transform,
color: [u8; 4],
blend_mode: BlendMode,
)
pub fn fill_path( &mut self, path: &Path, fill_rule: FillRule, transform: Transform, color: [u8; 4], blend_mode: BlendMode, )
Fill a path.
Sourcepub fn stroke_path(
&mut self,
path: &Path,
transform: Transform,
color: [u8; 4],
gs: &GraphicsState,
blend_mode: BlendMode,
)
pub fn stroke_path( &mut self, path: &Path, transform: Transform, color: [u8; 4], gs: &GraphicsState, blend_mode: BlendMode, )
Stroke a path.
Sourcepub fn draw_image(
&mut self,
image_pixmap: &PixmapRef<'_>,
transform: Transform,
alpha: f32,
blend_mode: BlendMode,
)
pub fn draw_image( &mut self, image_pixmap: &PixmapRef<'_>, transform: Transform, alpha: f32, blend_mode: BlendMode, )
Draw an RGBA image at the given transform.
Sourcepub fn draw_pixmap(
&mut self,
src: &PixmapRef<'_>,
transform: Transform,
alpha: f32,
blend_mode: BlendMode,
)
pub fn draw_pixmap( &mut self, src: &PixmapRef<'_>, transform: Transform, alpha: f32, blend_mode: BlendMode, )
Draw a pixmap onto this device (for transparency group compositing).
Sourcepub fn fill_path_with_pattern(
&mut self,
path: &Path,
fill_rule: FillRule,
transform: Transform,
pattern_pixmap: &PixmapRef<'_>,
pattern_transform: Transform,
blend_mode: BlendMode,
)
pub fn fill_path_with_pattern( &mut self, path: &Path, fill_rule: FillRule, transform: Transform, pattern_pixmap: &PixmapRef<'_>, pattern_transform: Transform, blend_mode: BlendMode, )
Fill a path with a pattern (tiled pixmap).
Sourcepub fn stroke_path_with_pattern(
&mut self,
path: &Path,
transform: Transform,
gs: &GraphicsState,
pattern_pixmap: &PixmapRef<'_>,
pattern_transform: Transform,
blend_mode: BlendMode,
)
pub fn stroke_path_with_pattern( &mut self, path: &Path, transform: Transform, gs: &GraphicsState, pattern_pixmap: &PixmapRef<'_>, pattern_transform: Transform, blend_mode: BlendMode, )
Stroke a path with a pattern (tiled pixmap).
Sourcepub fn encode_png(&self) -> Result<Vec<u8>>
pub fn encode_png(&self) -> Result<Vec<u8>>
Encode the pixmap as PNG bytes.
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Get the pixmap dimensions (width, height).
Auto Trait Implementations§
impl Freeze for PixmapDevice
impl RefUnwindSafe for PixmapDevice
impl Send for PixmapDevice
impl Sync for PixmapDevice
impl Unpin for PixmapDevice
impl UnsafeUnpin for PixmapDevice
impl UnwindSafe for PixmapDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more