pub struct SkiaDevice { /* private fields */ }Expand description
tiny-skia based raster device.
Implementations§
Source§impl SkiaDevice
impl SkiaDevice
Sourcepub fn new(width: u32, height: u32) -> Self
pub fn new(width: u32, height: u32) -> Self
Create a new device with the given page dimensions and default PNG output.
Defers the full-page pixmap allocation — only a 1×1 placeholder is
created here. The full pixmap is allocated lazily in replay_and_show
only when the non-banded rendering path is needed.
Sourcepub fn with_sink_factory(
width: u32,
height: u32,
sink_factory: Box<dyn PageSinkFactory>,
) -> Self
pub fn with_sink_factory( width: u32, height: u32, sink_factory: Box<dyn PageSinkFactory>, ) -> Self
Create a new device with a custom page sink factory.
Sourcepub fn set_use_viewport_path(&mut self, on: bool)
pub fn set_use_viewport_path(&mut self, on: bool)
Route rendering through the viewport pipeline. Used by the visual
test runner’s --device viewport-png mode.
Sourcepub fn set_system_cmyk_bytes(&mut self, bytes: Arc<Vec<u8>>)
pub fn set_system_cmyk_bytes(&mut self, bytes: Arc<Vec<u8>>)
Set the system CMYK ICC profile bytes for ICC-aware rendering.
Trait Implementations§
Source§impl Drop for SkiaDevice
impl Drop for SkiaDevice
Source§impl OutputDevice for SkiaDevice
impl OutputDevice for SkiaDevice
Source§fn fill_path(&mut self, path: &PsPath, params: &FillParams)
fn fill_path(&mut self, path: &PsPath, params: &FillParams)
Fill a path with the given color.
Source§fn stroke_path(&mut self, path: &PsPath, params: &StrokeParams)
fn stroke_path(&mut self, path: &PsPath, params: &StrokeParams)
Stroke a path with the given parameters.
Source§fn clip_path(&mut self, path: &PsPath, params: &ClipParams)
fn clip_path(&mut self, path: &PsPath, params: &ClipParams)
Intersect the current clip region with the given path.
Source§fn erase_page(&mut self)
fn erase_page(&mut self)
Erase the page (fill with white).
Source§fn show_page(&mut self, output_path: &str) -> Result<(), String>
fn show_page(&mut self, output_path: &str) -> Result<(), String>
Output the current page (e.g., save PNG) and return Ok/Err.
Source§fn draw_image(&mut self, sample_data: &[u8], params: &ImageParams)
fn draw_image(&mut self, sample_data: &[u8], params: &ImageParams)
Draw an image from raw sample data.
Source§fn paint_axial_shading(&mut self, params: &AxialShadingParams)
fn paint_axial_shading(&mut self, params: &AxialShadingParams)
Paint an axial (linear) gradient shading.
Source§fn paint_radial_shading(&mut self, params: &RadialShadingParams)
fn paint_radial_shading(&mut self, params: &RadialShadingParams)
Paint a radial gradient shading.
Source§fn paint_mesh_shading(&mut self, params: &MeshShadingParams)
fn paint_mesh_shading(&mut self, params: &MeshShadingParams)
Paint a Gouraud-shaded triangle mesh.
Source§fn paint_patch_shading(&mut self, params: &PatchShadingParams)
fn paint_patch_shading(&mut self, params: &PatchShadingParams)
Paint a Coons/tensor-product patch mesh.
Source§fn paint_pattern_fill(&mut self, params: &PatternFillParams)
fn paint_pattern_fill(&mut self, params: &PatternFillParams)
Paint a tiled pattern fill.
Source§fn replay_and_show(
&mut self,
list: DisplayList,
output_path: &str,
) -> Result<(), String>
fn replay_and_show( &mut self, list: DisplayList, output_path: &str, ) -> Result<(), String>
Replay a display list and write output in one step.
Source§fn finish(&mut self) -> Result<(), String>
fn finish(&mut self) -> Result<(), String>
Wait for any pending background render to complete.
Source§fn set_trim_box(&mut self, _llx: f64, _lly: f64, _urx: f64, _ury: f64)
fn set_trim_box(&mut self, _llx: f64, _lly: f64, _urx: f64, _ury: f64)
Set the trim box for the next page (PDF points, lower-left origin).
Only meaningful for PDF output; other devices ignore this.
Auto Trait Implementations§
impl Freeze for SkiaDevice
impl !RefUnwindSafe for SkiaDevice
impl Send for SkiaDevice
impl !Sync for SkiaDevice
impl Unpin for SkiaDevice
impl UnsafeUnpin for SkiaDevice
impl !UnwindSafe for SkiaDevice
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