Sign in

    wzzc-dev/moui_sun/graphics does not have a README file

    Surface

    pub(open) trait Surface {
    fn get_width(Self) -> Int
    fn get_height(Self) -> Int
    fn present_pixels(Self, width : Int, height : Int, row_bytes : Int, pixels : FixedArray[Byte]) -> Result[Unit, PresentError]
    fn present_pixels_rect(Self, x : Int, y : Int, width : Int, height : Int, row_bytes : Int, pixels : FixedArray[Byte]) -> Result[Unit, PresentError]
    }

    Destination for CPU-rendered RGBA pixels.

    BlendMode

    pub(all) enum BlendMode {
    Clear
    Source
    Destination
    SourceOver
    DestinationOver
    SourceIn
    DestinationIn
    SourceOut
    DestinationOut
    SourceAtop
    DestinationAtop
    Xor
    Multiply
    Screen
    Add
    Darken
    Lighten
    Difference
    Exclusion
    Overlay
    HardLight
    SoftLight
    ColorDodge
    ColorBurn
    Hue
    Saturation
    Color
    Luminosity
    LinearBurn
    Subtract
    } derive(Eq,
    Debug
    )

    Pixel blend mode used when compositing paint over destination pixels.

    BlendMode::equal

    fn BlendMode::equal(BlendMode, BlendMode) -> Bool

    BlendMode::not_equal

    fn BlendMode::not_equal(x : BlendMode, y : BlendMode) -> Bool

    BmpInfo

    BmpInfo::to_repr

    Canvas

    pub struct Canvas {
    pixmap : Pixmap
    transform : Transform
    clip_rect : Rect?
    state_stack : Array[CanvasState]
    dirty_region : DirtyRegion
    } derive(
    Debug
    )

    2D drawing canvas backed by a pixmap

    Canvas::clear

    fn Canvas::clear(self : Canvas, color : Color) -> Unit

    Clear the canvas with a color

    Canvas::clear_clip

    fn Canvas::clear_clip(self : Canvas) -> Unit

    Clear the current clip rectangle.

    Canvas::clear_dirty_region

    fn Canvas::clear_dirty_region(self : Canvas) -> Unit

    Clear accumulated dirty rectangles.

    Canvas::concat_transform

    fn Canvas::concat_transform(self : Canvas, transform : Transform) -> Unit

    Concatenate a transform onto the current transform.

    Canvas::dirty_present_batch

    fn[S : Surface] Canvas::dirty_present_batch(self : Canvas, surface : S, max_rects : Int) -> Result[PresentBatch, PresentError]

    Canvas::dirty_present_plan

    fn[S : Surface] Canvas::dirty_present_plan(self : Canvas, surface : S, max_rects : Int) -> DirtyPresentPlan

    Canvas::draw_mask

    fn Canvas::draw_mask(self : Canvas, x : Int, y : Int, width : Int, height : Int, mask : FixedArray[Byte], paint : Paint) -> Unit

    Draw a grayscale coverage mask with the given paint

    Canvas::draw_mask_rect

    fn Canvas::draw_mask_rect(self : Canvas, x : Int, y : Int, mask_width : Int, mask_height : Int, mask : FixedArray[Byte], src_rect : PixelRect, paint : Paint) -> Unit

    Draw a source rectangle from a grayscale coverage mask with the given paint.

    Canvas::draw_nine_patch_pixmap

    fn Canvas::draw_nine_patch_pixmap(self : Canvas, src : Pixmap, x : Int, y : Int, width : Int, height : Int, insets : NinePatchInsets, paint : Paint, sampling : ImageSampling) -> Unit

    Draw a source pixmap using nine-patch scaling.

    Canvas::draw_pixel

    fn Canvas::draw_pixel(self : Canvas, x : Int, y : Int, color : Color) -> Unit

    Draw a single pixel (for testing)

    Canvas::draw_pixmap

    fn Canvas::draw_pixmap(self : Canvas, src : Pixmap, x : Int, y : Int, paint : Paint) -> Unit

    Draw a source pixmap at the given destination position.

    Canvas::draw_pixmap_rect

    fn Canvas::draw_pixmap_rect(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Int, y : Int, paint : Paint) -> Unit

    Draw a source pixmap rectangle at the given destination position.

    Canvas::draw_placeholder_text

    fn Canvas::draw_placeholder_text(self : Canvas, text : String, x : Double, y : Double, font_size : Double, color : Color) -> Unit

    Draw placeholder text boxes at the given position.

    Canvas::draw_quality_nine_patch_pixmap

    fn Canvas::draw_quality_nine_patch_pixmap(self : Canvas, src : Pixmap, x : Int, y : Int, width : Int, height : Int, insets : NinePatchInsets, paint : Paint, quality : ImageQuality) -> Unit

    Draw a source pixmap using nine-patch scaling and a quality strategy.

    Canvas::draw_quality_pixmap

    fn Canvas::draw_quality_pixmap(self : Canvas, src : Pixmap, x : Int, y : Int, width : Int, height : Int, paint : Paint, quality : ImageQuality) -> Unit

    Draw a source pixmap scaled with a quality strategy.

    Canvas::draw_quality_pixmap_rect

    fn Canvas::draw_quality_pixmap_rect(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Int, y : Int, width : Int, height : Int, paint : Paint, quality : ImageQuality) -> Unit

    Draw a source pixmap rectangle scaled with a quality strategy.

    Canvas::draw_sampled_pixmap

    fn Canvas::draw_sampled_pixmap(self : Canvas, src : Pixmap, x : Int, y : Int, width : Int, height : Int, paint : Paint, sampling : ImageSampling) -> Unit

    Draw a source pixmap scaled with an explicit sampling mode.

    Canvas::draw_sampled_pixmap_rect

    fn Canvas::draw_sampled_pixmap_rect(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Int, y : Int, width : Int, height : Int, paint : Paint, sampling : ImageSampling) -> Unit

    Draw a source pixmap rectangle scaled with an explicit sampling mode.

    Canvas::draw_scaled_pixmap

    fn Canvas::draw_scaled_pixmap(self : Canvas, src : Pixmap, x : Int, y : Int, width : Int, height : Int, paint : Paint) -> Unit

    Draw a source pixmap scaled to the given destination rectangle.

    Canvas::draw_scaled_pixmap_bicubic

    fn Canvas::draw_scaled_pixmap_bicubic(self : Canvas, src : Pixmap, x : Int, y : Int, width : Int, height : Int, paint : Paint) -> Unit

    Draw a source pixmap scaled with bicubic sampling.

    Canvas::draw_scaled_pixmap_bilinear

    fn Canvas::draw_scaled_pixmap_bilinear(self : Canvas, src : Pixmap, x : Int, y : Int, width : Int, height : Int, paint : Paint) -> Unit

    Draw a source pixmap scaled with bilinear sampling.

    Canvas::draw_scaled_pixmap_rect

    fn Canvas::draw_scaled_pixmap_rect(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Int, y : Int, width : Int, height : Int, paint : Paint) -> Unit

    Draw a source pixmap rectangle scaled to the given destination rectangle.

    Canvas::draw_scaled_pixmap_rect_bicubic

    fn Canvas::draw_scaled_pixmap_rect_bicubic(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Int, y : Int, width : Int, height : Int, paint : Paint) -> Unit

    Draw a source pixmap rectangle scaled with bicubic sampling.

    Canvas::draw_scaled_pixmap_rect_bilinear

    fn Canvas::draw_scaled_pixmap_rect_bilinear(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Int, y : Int, width : Int, height : Int, paint : Paint) -> Unit

    Draw a source pixmap rectangle scaled with bilinear sampling.

    Canvas::draw_tiled_pixmap_rect

    fn Canvas::draw_tiled_pixmap_rect(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Int, y : Int, width : Int, height : Int, paint : Paint) -> Unit

    Draw a source pixmap rectangle repeatedly into the destination rectangle.

    Canvas::draw_transformed_quality_pixmap

    fn Canvas::draw_transformed_quality_pixmap(self : Canvas, src : Pixmap, x : Double, y : Double, width : Double, height : Double, paint : Paint, quality : ImageQuality) -> Unit

    Draw a source pixmap transformed by the current transform using a quality strategy.

    Canvas::draw_transformed_quality_pixmap_rect

    fn Canvas::draw_transformed_quality_pixmap_rect(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Double, y : Double, width : Double, height : Double, paint : Paint, quality : ImageQuality) -> Unit

    Draw a source pixmap rectangle transformed by the current transform using a quality strategy.

    Canvas::draw_transformed_sampled_pixmap

    fn Canvas::draw_transformed_sampled_pixmap(self : Canvas, src : Pixmap, x : Double, y : Double, width : Double, height : Double, paint : Paint, sampling : ImageSampling) -> Unit

    Draw a source pixmap transformed by the current canvas transform.

    Canvas::draw_transformed_sampled_pixmap_rect

    fn Canvas::draw_transformed_sampled_pixmap_rect(self : Canvas, src : Pixmap, src_rect : PixelRect, x : Double, y : Double, width : Double, height : Double, paint : Paint, sampling : ImageSampling) -> Unit

    Draw a source pixmap rectangle transformed by the current canvas transform.

    Canvas::fill_circle

    fn Canvas::fill_circle(self : Canvas, cx : Double, cy : Double, radius : Double, paint : Paint) -> Unit

    Draw a filled circle.

    Canvas::fill_ellipse

    fn Canvas::fill_ellipse(self : Canvas, cx : Double, cy : Double, rx : Double, ry : Double, paint : Paint) -> Unit

    Draw a filled ellipse.

    Canvas::fill_path

    fn Canvas::fill_path(self : Canvas, path : Path, paint : Paint) -> Unit

    Fill a path with the given paint

    Canvas::fill_pie

    fn Canvas::fill_pie(self : Canvas, cx : Double, cy : Double, radius : Double, start_angle : Double, sweep_angle : Double, paint : Paint) -> Unit

    Draw a filled pie slice.

    Canvas::fill_polygon

    fn Canvas::fill_polygon(self : Canvas, points : Array[Point], paint : Paint) -> Unit

    Draw a filled polygon.

    Canvas::fill_rect

    fn Canvas::fill_rect(self : Canvas, x : Double, y : Double, w : Double, h : Double, paint : Paint) -> Unit

    Draw a filled rectangle

    Canvas::fill_rounded_rect

    fn Canvas::fill_rounded_rect(self : Canvas, x : Double, y : Double, w : Double, h : Double, radius : Double, paint : Paint) -> Unit

    Draw a filled rounded rectangle.

    Canvas::fill_rounded_rect_corners

    fn Canvas::fill_rounded_rect_corners(self : Canvas, x : Double, y : Double, w : Double, h : Double, top_left : Double, top_right : Double, bottom_right : Double, bottom_left : Double, paint : Paint) -> Unit

    Draw a filled rounded rectangle with independent corner radii.

    Canvas::get_clip_rect

    fn Canvas::get_clip_rect(self : Canvas) -> Rect?

    Get the current clip rectangle, if any.

    Canvas::get_dirty_region

    fn Canvas::get_dirty_region(self : Canvas) -> DirtyRegion

    Get the accumulated dirty region for incremental rendering.

    Canvas::get_pixmap

    fn Canvas::get_pixmap(self : Canvas) -> Pixmap

    Get the underlying pixmap

    Canvas::get_save_count

    fn Canvas::get_save_count(self : Canvas) -> Int

    Get the number of saved canvas states.

    Canvas::get_transform

    fn Canvas::get_transform(self : Canvas) -> Transform

    Get the current transform

    Canvas::intersect_clip_rect

    fn Canvas::intersect_clip_rect(self : Canvas, rect : Rect) -> Unit

    Intersect the current clip rectangle with a new device-space rectangle.

    Canvas::new

    fn Canvas::new(width : Int, height : Int) -> Canvas

    Create a new canvas with the given dimensions

    Canvas::present_dirty_to

    fn[S : Surface] Canvas::present_dirty_to(self : Canvas, surface : S) -> Result[Int, PresentError]

    Canvas::present_dirty_to_with_limit

    fn[S : Surface] Canvas::present_dirty_to_with_limit(self : Canvas, surface : S, max_rects : Int) -> Result[Int, PresentError]

    Canvas::present_to

    fn[S : Surface] Canvas::present_to(self : Canvas, surface : S) -> Result[Unit, PresentError]

    Canvas::reset_transform

    fn Canvas::reset_transform(self : Canvas) -> Unit

    Reset the current transform to identity.

    Canvas::restore

    fn Canvas::restore(self : Canvas) -> Bool

    Restore the most recently saved transform and clip state.

    Canvas::rotate

    fn Canvas::rotate(self : Canvas, angle : Double) -> Unit

    Rotate subsequent transformed drawing operations by an angle in radians.

    Canvas::save

    fn Canvas::save(self : Canvas) -> Unit

    Save the current transform and clip state.

    Canvas::scale

    fn Canvas::scale(self : Canvas, sx~ : Double, sy~ : Double) -> Unit

    Scale subsequent transformed drawing operations.

    Canvas::set_clip_rect

    fn Canvas::set_clip_rect(self : Canvas, rect : Rect) -> Unit

    Set the current clip rectangle in device coordinates.

    Canvas::set_transform

    fn Canvas::set_transform(self : Canvas, transform : Transform) -> Unit

    Set the current transform

    Canvas::stroke_arc

    fn Canvas::stroke_arc(self : Canvas, cx : Double, cy : Double, radius : Double, start_angle : Double, sweep_angle : Double, paint : Paint) -> Unit

    Draw a stroked circular arc.

    Canvas::stroke_circle

    fn Canvas::stroke_circle(self : Canvas, cx : Double, cy : Double, radius : Double, paint : Paint) -> Unit

    Draw a stroked circle.

    Canvas::stroke_ellipse

    fn Canvas::stroke_ellipse(self : Canvas, cx : Double, cy : Double, rx : Double, ry : Double, paint : Paint) -> Unit

    Draw a stroked ellipse.

    Canvas::stroke_line

    fn Canvas::stroke_line(self : Canvas, x0 : Double, y0 : Double, x1 : Double, y1 : Double, paint : Paint) -> Unit

    Draw a stroked line segment.

    Canvas::stroke_path

    fn Canvas::stroke_path(self : Canvas, path : Path, paint : Paint) -> Unit

    Stroke a path with the given paint

    Canvas::stroke_polygon

    fn Canvas::stroke_polygon(self : Canvas, points : Array[Point], paint : Paint) -> Unit

    Draw a stroked closed polygon.

    Canvas::stroke_polyline

    fn Canvas::stroke_polyline(self : Canvas, points : Array[Point], paint : Paint) -> Unit

    Draw a stroked open polyline.

    Canvas::stroke_rect

    fn Canvas::stroke_rect(self : Canvas, x : Double, y : Double, w : Double, h : Double, paint : Paint) -> Unit

    Draw a stroked rectangle.

    Canvas::stroke_rounded_rect

    fn Canvas::stroke_rounded_rect(self : Canvas, x : Double, y : Double, w : Double, h : Double, radius : Double, paint : Paint) -> Unit

    Draw a stroked rounded rectangle.

    Canvas::stroke_rounded_rect_corners

    fn Canvas::stroke_rounded_rect_corners(self : Canvas, x : Double, y : Double, w : Double, h : Double, top_left : Double, top_right : Double, bottom_right : Double, bottom_left : Double, paint : Paint) -> Unit

    Draw a stroked rounded rectangle with independent corner radii.

    Canvas::to_repr

    Canvas::translate

    fn Canvas::translate(self : Canvas, tx~ : Double, ty~ : Double) -> Unit

    Translate subsequent transformed drawing operations.

    CanvasEdge

    type CanvasEdge derive(
    Debug
    )

    CanvasState

    type CanvasState derive(
    Debug
    )

    Color

    pub(all) struct Color {
    r : Byte
    g : Byte
    b : Byte
    a : Byte
    } derive(Eq,
    Debug
    )

    RGBA color representation
    impl Show for Color

    Color::black

    fn Color::black() -> Color

    Color::blend_over

    fn Color::blend_over(self : Color, dst : Color) -> Color

    Composite this straight-alpha source color over a destination color

    Color::blend_with

    fn Color::blend_with(self : Color, dst : Color, blend_mode : BlendMode) -> Color

    Composite this straight-alpha source color over a destination color using a configured blend mode.

    Color::blue

    fn Color::blue() -> Color

    Color::equal

    fn Color::equal(Color, Color) -> Bool

    Color::green

    fn Color::green() -> Color

    Color::new

    fn Color::new(r~ : Byte, g~ : Byte, b~ : Byte, a? : Byte) -> Color

    Create a color from RGBA values

    Color::not_equal

    fn Color::not_equal(x : Color, y : Color) -> Bool

    Color::output

    fn Color::output(self : Color, logger : &Logger) -> Unit

    Color::red

    fn Color::red() -> Color

    Color::scale_alpha

    fn Color::scale_alpha(self : Color, opacity : Double) -> Color

    Return this color with its alpha multiplied by opacity

    Color::to_repr

    Color::to_string

    fn Color::to_string(self : Color) -> String

    Color::transparent

    fn Color::transparent() -> Color

    Color::white

    fn Color::white() -> Color

    Predefined colors

    Color::with_alpha

    fn Color::with_alpha(self : Color, alpha : Byte) -> Color

    Return this color with a replaced alpha channel

    DashCursor

    type DashCursor derive(
    Debug
    )

    DirtyPresentPlan

    pub struct DirtyPresentPlan {
    mode : DirtyPresentPlanMode
    rects : Array[PixelRect]
    } derive(
    Debug
    )

    A concrete dirty-present plan after clipping to the target bounds and applying a rectangle-count limit.

    DirtyPresentPlan::get_mode

    DirtyPresentPlan::get_present_bounds

    fn DirtyPresentPlan::get_present_bounds(self : DirtyPresentPlan) -> PixelRect?

    DirtyPresentPlan::get_present_byte_count

    fn DirtyPresentPlan::get_present_byte_count(self : DirtyPresentPlan) -> Int

    DirtyPresentPlan::get_present_pixel_count

    fn DirtyPresentPlan::get_present_pixel_count(self : DirtyPresentPlan) -> Int

    DirtyPresentPlan::get_present_strategy

    fn DirtyPresentPlan::get_present_strategy(self : DirtyPresentPlan, width : Int, height : Int) -> DirtyPresentStrategy

    DirtyPresentPlan::get_rect_count

    fn DirtyPresentPlan::get_rect_count(self : DirtyPresentPlan) -> Int

    DirtyPresentPlan::get_rects

    DirtyPresentPlan::is_empty

    fn DirtyPresentPlan::is_empty(self : DirtyPresentPlan) -> Bool

    DirtyPresentPlan::saves_full_present_pixels

    fn DirtyPresentPlan::saves_full_present_pixels(self : DirtyPresentPlan, width : Int, height : Int) -> Bool

    DirtyPresentPlan::uses_bounds_fallback

    fn DirtyPresentPlan::uses_bounds_fallback(self : DirtyPresentPlan) -> Bool

    DirtyPresentPlanMode

    pub(all) enum DirtyPresentPlanMode {
    Empty
    Rects
    Bounds
    } derive(Eq,
    Debug
    )

    Strategy selected for submitting a dirty region to a Surface.

    DirtyPresentPlanMode::equal

    DirtyPresentPlanMode::not_equal

    DirtyPresentStrategy

    pub(all) enum DirtyPresentStrategy {
    Skip
    Partial
    Full
    } derive(Eq,
    Debug
    )

    Scheduler-facing present strategy chosen from a dirty present plan and the full-frame pixel budget.

    DirtyPresentStrategy::equal

    DirtyPresentStrategy::not_equal

    DirtyRegion

    pub struct DirtyRegion {
    rects : Array[PixelRect]
    } derive(
    Debug
    )

    Accumulates pixel-aligned dirty rectangles for incremental rendering.

    DirtyRegion::add_all

    fn DirtyRegion::add_all(self : DirtyRegion, width : Int, height : Int) -> Unit

    DirtyRegion::add_clipped_rect

    fn DirtyRegion::add_clipped_rect(self : DirtyRegion, rect : PixelRect, bounds : PixelRect) -> Unit

    DirtyRegion::add_rect

    fn DirtyRegion::add_rect(self : DirtyRegion, rect : PixelRect) -> Unit

    DirtyRegion::bounds

    fn DirtyRegion::bounds(self : DirtyRegion) -> PixelRect?

    DirtyRegion::clear

    fn DirtyRegion::clear(self : DirtyRegion) -> Unit

    DirtyRegion::get_rect_count

    fn DirtyRegion::get_rect_count(self : DirtyRegion) -> Int

    DirtyRegion::get_rects

    fn DirtyRegion::get_rects(self : DirtyRegion) -> Array[PixelRect]

    DirtyRegion::is_empty

    fn DirtyRegion::is_empty(self : DirtyRegion) -> Bool

    DirtyRegion::new

    DirtyRegion::present_plan

    fn DirtyRegion::present_plan(self : DirtyRegion, bounds : PixelRect, max_rects : Int) -> DirtyPresentPlan

    DirtyRegion::present_rects

    fn DirtyRegion::present_rects(self : DirtyRegion, bounds : PixelRect, max_rects : Int) -> Array[PixelRect]

    DirtySubmitPlan

    pub struct DirtySubmitPlan {
    dirty_bounds : PixelRect?
    present_plan : DirtyPresentPlan
    } derive(
    Debug
    )

    Dirty state snapshot for schedulers: logical dirty bounds plus the clipped present plan that would be submitted to the current surface.

    DirtySubmitPlan::get_dirty_bounds

    fn DirtySubmitPlan::get_dirty_bounds(self : DirtySubmitPlan) -> PixelRect?

    DirtySubmitPlan::get_present_bounds

    fn DirtySubmitPlan::get_present_bounds(self : DirtySubmitPlan) -> PixelRect?

    DirtySubmitPlan::get_present_byte_count

    fn DirtySubmitPlan::get_present_byte_count(self : DirtySubmitPlan) -> Int

    DirtySubmitPlan::get_present_pixel_count

    fn DirtySubmitPlan::get_present_pixel_count(self : DirtySubmitPlan) -> Int

    DirtySubmitPlan::get_present_plan

    fn DirtySubmitPlan::get_present_plan(self : DirtySubmitPlan) -> DirtyPresentPlan

    DirtySubmitPlan::get_present_rect_count

    fn DirtySubmitPlan::get_present_rect_count(self : DirtySubmitPlan) -> Int

    DirtySubmitPlan::get_present_strategy

    fn DirtySubmitPlan::get_present_strategy(self : DirtySubmitPlan, width : Int, height : Int) -> DirtyPresentStrategy

    DirtySubmitPlan::get_state

    DirtySubmitPlan::has_dirty

    fn DirtySubmitPlan::has_dirty(self : DirtySubmitPlan) -> Bool

    DirtySubmitPlan::needs_present

    fn DirtySubmitPlan::needs_present(self : DirtySubmitPlan) -> Bool

    DirtySubmitPlan::saves_full_present_pixels

    fn DirtySubmitPlan::saves_full_present_pixels(self : DirtySubmitPlan, width : Int, height : Int) -> Bool

    DirtySubmitPlan::uses_bounds_fallback

    fn DirtySubmitPlan::uses_bounds_fallback(self : DirtySubmitPlan) -> Bool

    DirtySubmitResult

    pub struct DirtySubmitResult {
    submit_plan : DirtySubmitPlan
    presented_rect_count : Int
    } derive(
    Debug
    )

    Result of submitting a dirty frame: the scheduler-visible plan snapshot plus the number of rectangles actually presented to the surface.

    DirtySubmitResult::did_present

    fn DirtySubmitResult::did_present(self : DirtySubmitResult) -> Bool

    DirtySubmitResult::get_dirty_bounds

    fn DirtySubmitResult::get_dirty_bounds(self : DirtySubmitResult) -> PixelRect?

    DirtySubmitResult::get_present_bounds

    fn DirtySubmitResult::get_present_bounds(self : DirtySubmitResult) -> PixelRect?

    DirtySubmitResult::get_present_byte_count

    fn DirtySubmitResult::get_present_byte_count(self : DirtySubmitResult) -> Int

    DirtySubmitResult::get_present_pixel_count

    fn DirtySubmitResult::get_present_pixel_count(self : DirtySubmitResult) -> Int

    DirtySubmitResult::get_present_strategy

    fn DirtySubmitResult::get_present_strategy(self : DirtySubmitResult, width : Int, height : Int) -> DirtyPresentStrategy

    DirtySubmitResult::get_presented_rect_count

    fn DirtySubmitResult::get_presented_rect_count(self : DirtySubmitResult) -> Int

    DirtySubmitResult::get_state

    DirtySubmitResult::get_submit_plan

    fn DirtySubmitResult::get_submit_plan(self : DirtySubmitResult) -> DirtySubmitPlan

    DirtySubmitResult::has_dirty

    fn DirtySubmitResult::has_dirty(self : DirtySubmitResult) -> Bool

    DirtySubmitResult::needs_present

    fn DirtySubmitResult::needs_present(self : DirtySubmitResult) -> Bool

    DirtySubmitResult::saves_full_present_pixels

    fn DirtySubmitResult::saves_full_present_pixels(self : DirtySubmitResult, width : Int, height : Int) -> Bool

    DirtySubmitResult::uses_bounds_fallback

    fn DirtySubmitResult::uses_bounds_fallback(self : DirtySubmitResult) -> Bool

    DirtySubmitResult::was_clipped_away

    fn DirtySubmitResult::was_clipped_away(self : DirtySubmitResult) -> Bool

    DirtySubmitState

    pub(all) enum DirtySubmitState {
    Clean
    Present
    DirtyClippedAway
    } derive(Eq,
    Debug
    )

    Scheduler-facing state for a dirty submit snapshot.

    DirtySubmitState::equal

    DirtySubmitState::not_equal

    fn DirtySubmitState::not_equal(x : DirtySubmitState, y : DirtySubmitState) -> Bool

    FillRule

    pub(all) enum FillRule {
    NonZero
    EvenOdd
    } derive(Eq,
    Debug
    )

    Fill rule for path filling

    FillRule::equal

    fn FillRule::equal(FillRule, FillRule) -> Bool

    FillRule::not_equal

    fn FillRule::not_equal(x : FillRule, y : FillRule) -> Bool

    FillRule::to_repr

    ImageQuality

    pub(all) enum ImageQuality {
    Fast
    Balanced
    High
    } derive(Eq,
    Debug
    )

    Image quality strategy for callers that prefer intent over a concrete sampling algorithm.

    ImageQuality::equal

    ImageQuality::not_equal

    fn ImageQuality::not_equal(x : ImageQuality, y : ImageQuality) -> Bool

    ImageQuality::to_sampling

    fn ImageQuality::to_sampling(self : ImageQuality) -> ImageSampling

    Return the concrete sampling mode selected by this quality strategy.

    ImageSampling

    pub(all) enum ImageSampling {
    Nearest
    Bilinear
    Bicubic
    } derive(Eq,
    Debug
    )

    Sampling mode used when scaling source pixmaps.

    ImageSampling::equal

    ImageSampling::not_equal

    fn ImageSampling::not_equal(x : ImageSampling, y : ImageSampling) -> Bool

    Layer

    pub struct Layer {
    canvas : Canvas
    x : Int
    y : Int
    visible : Bool
    opacity : Double
    blend_mode : BlendMode
    shader : PaintShader?
    filter : PaintFilter?
    } derive(
    Debug
    )

    Off-screen drawing cache backed by a Canvas. Layers are intended for GUI subtrees that can redraw locally and then composite their dirty pixels into a parent canvas.

    Layer::bounds

    fn Layer::bounds(self : Layer) -> PixelRect

    Layer::clear

    fn Layer::clear(self : Layer, color : Color) -> Unit

    Layer::clear_dirty_region

    fn Layer::clear_dirty_region(self : Layer) -> Unit

    Layer::clear_filter

    fn Layer::clear_filter(self : Layer) -> Layer

    Layer::clear_shader

    fn Layer::clear_shader(self : Layer) -> Layer

    Layer::composite_dirty_to

    fn Layer::composite_dirty_to(self : Layer, target : Canvas, max_rects : Int) -> Int

    Layer::composite_dirty_to_result

    fn Layer::composite_dirty_to_result(self : Layer, target : Canvas, max_rects : Int) -> LayerCompositeResult

    Composite dirty cache pixels and return lifecycle telemetry.

    Layer::composite_to

    fn Layer::composite_to(self : Layer, target : Canvas) -> Int

    Layer::dirty_bounds

    fn Layer::dirty_bounds(self : Layer) -> PixelRect?

    Layer::get_blend_mode

    fn Layer::get_blend_mode(self : Layer) -> BlendMode

    Layer::get_canvas

    fn Layer::get_canvas(self : Layer) -> Canvas

    Layer::get_dirty_region

    fn Layer::get_dirty_region(self : Layer) -> DirtyRegion

    Layer::get_filter

    fn Layer::get_filter(self : Layer) -> PaintFilter?

    Layer::get_height

    fn Layer::get_height(self : Layer) -> Int

    Layer::get_opacity

    fn Layer::get_opacity(self : Layer) -> Double

    Layer::get_pixmap

    fn Layer::get_pixmap(self : Layer) -> Pixmap

    Layer::get_shader

    fn Layer::get_shader(self : Layer) -> PaintShader?

    Layer::get_width

    fn Layer::get_width(self : Layer) -> Int

    Layer::get_x

    fn Layer::get_x(self : Layer) -> Int

    Layer::get_y

    fn Layer::get_y(self : Layer) -> Int

    Layer::has_dirty

    fn Layer::has_dirty(self : Layer) -> Bool

    Layer::is_compositable

    fn Layer::is_compositable(self : Layer) -> Bool

    Layer::is_visible

    fn Layer::is_visible(self : Layer) -> Bool

    Layer::mark_all_dirty

    fn Layer::mark_all_dirty(self : Layer) -> Unit

    Layer::mark_dirty_rect

    fn Layer::mark_dirty_rect(self : Layer, rect : PixelRect) -> Unit

    Layer::new

    fn Layer::new(width : Int, height : Int) -> Layer

    Layer::resize

    fn Layer::resize(self : Layer, width : Int, height : Int) -> Layer

    Layer::set_blend_mode

    fn Layer::set_blend_mode(self : Layer, blend_mode : BlendMode) -> Layer

    Layer::set_filter

    fn Layer::set_filter(self : Layer, filter : PaintFilter) -> Layer

    Layer::set_opacity

    fn Layer::set_opacity(self : Layer, opacity : Double) -> Layer

    Layer::set_position

    fn Layer::set_position(self : Layer, x : Int, y : Int) -> Layer

    Layer::set_shader

    fn Layer::set_shader(self : Layer, shader : PaintShader) -> Layer

    Set the shader used when compositing this layer. The shader is sampled in layer-local coordinates so moving a layer preserves its cached pattern.

    Layer::set_visible

    fn Layer::set_visible(self : Layer, visible : Bool) -> Layer

    Layer::to_repr

    Layer::translated_bounds

    fn Layer::translated_bounds(self : Layer) -> PixelRect

    Layer::translated_dirty_bounds

    fn Layer::translated_dirty_bounds(self : Layer) -> PixelRect?

    Layer::translated_dirty_rects

    fn Layer::translated_dirty_rects(self : Layer, max_rects : Int) -> Array[PixelRect]

    LayerCompositeResult

    pub struct LayerCompositeResult {
    composited_rect_count : Int
    local_dirty_bounds : PixelRect?
    target_dirty_bounds : PixelRect?
    uses_bounds_fallback : Bool
    did_composite : Bool
    did_clear_dirty : Bool
    } derive(
    Debug
    )

    Telemetry for a dirty layer composite attempt.

    LayerCompositeResult::did_clear_dirty

    fn LayerCompositeResult::did_clear_dirty(self : LayerCompositeResult) -> Bool

    Return whether the layer dirty region was cleared after compositing.

    LayerCompositeResult::did_composite

    fn LayerCompositeResult::did_composite(self : LayerCompositeResult) -> Bool

    Return whether any dirty pixels were composited into the target.

    LayerCompositeResult::get_composited_rect_count

    fn LayerCompositeResult::get_composited_rect_count(self : LayerCompositeResult) -> Int

    Return the number of dirty rectangles composited into the target.

    LayerCompositeResult::get_local_dirty_bounds

    fn LayerCompositeResult::get_local_dirty_bounds(self : LayerCompositeResult) -> PixelRect?

    Return the layer-local bounds covered by this composite attempt.

    LayerCompositeResult::get_target_dirty_bounds

    fn LayerCompositeResult::get_target_dirty_bounds(self : LayerCompositeResult) -> PixelRect?

    Return the target-space bounds covered by this composite attempt.

    LayerCompositeResult::uses_bounds_fallback

    fn LayerCompositeResult::uses_bounds_fallback(self : LayerCompositeResult) -> Bool

    Return whether dirty composition fell back to the dirty bounds rectangle because the candidate dirty rect count exceeded the requested limit.

    LayerTree

    pub struct LayerTree {
    layers : Array[Layer]
    invalidation : DirtyRegion
    } derive(
    Debug
    )

    Ordered collection of cached layers. Layers added later are composited above earlier layers.

    LayerTree::add_layer

    fn LayerTree::add_layer(self : LayerTree, layer : Layer) -> Int

    LayerTree::clear_dirty_regions

    fn LayerTree::clear_dirty_regions(self : LayerTree) -> Unit

    LayerTree::clear_layer_filter

    fn LayerTree::clear_layer_filter(self : LayerTree, index : Int) -> Bool

    LayerTree::clear_layer_shader

    fn LayerTree::clear_layer_shader(self : LayerTree, index : Int) -> Bool

    LayerTree::composite_dirty_to

    fn LayerTree::composite_dirty_to(self : LayerTree, target : Canvas, max_rects : Int) -> Int

    LayerTree::composite_to

    fn LayerTree::composite_to(self : LayerTree, target : Canvas) -> Int

    LayerTree::dirty_bounds

    fn LayerTree::dirty_bounds(self : LayerTree) -> PixelRect?

    LayerTree::dirty_present_batch

    fn[S : Surface] LayerTree::dirty_present_batch(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> Result[PresentBatch, PresentError]

    LayerTree::dirty_present_plan

    fn[S : Surface] LayerTree::dirty_present_plan(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> DirtyPresentPlan

    LayerTree::dirty_rects

    fn LayerTree::dirty_rects(self : LayerTree, max_rects : Int) -> Array[PixelRect]

    LayerTree::dirty_submit_plan

    fn[S : Surface] LayerTree::dirty_submit_plan(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> DirtySubmitPlan

    LayerTree::get_compositable_layer_count

    fn LayerTree::get_compositable_layer_count(self : LayerTree) -> Int

    LayerTree::get_layer

    fn LayerTree::get_layer(self : LayerTree, index : Int) -> Layer?

    LayerTree::get_layer_count

    fn LayerTree::get_layer_count(self : LayerTree) -> Int

    LayerTree::invalidate_layer

    fn LayerTree::invalidate_layer(self : LayerTree, index : Int) -> Bool

    LayerTree::invalidate_rect

    fn LayerTree::invalidate_rect(self : LayerTree, rect : PixelRect) -> Unit

    LayerTree::new

    fn LayerTree::new() -> LayerTree

    LayerTree::present_all_to

    fn[S : Surface] LayerTree::present_all_to(self : LayerTree, target : Canvas, surface : S) -> Result[Int, PresentError]

    LayerTree::present_all_to_with_limit

    fn[S : Surface] LayerTree::present_all_to_with_limit(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> Result[Int, PresentError]

    LayerTree::present_dirty_to

    fn[S : Surface] LayerTree::present_dirty_to(self : LayerTree, target : Canvas, surface : S) -> Result[Int, PresentError]

    LayerTree::present_dirty_to_with_limit

    fn[S : Surface] LayerTree::present_dirty_to_with_limit(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> Result[Int, PresentError]

    LayerTree::redraw_schedule

    fn[S : Surface] LayerTree::redraw_schedule(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> RenderFrameSchedule

    LayerTree::remove_layer

    fn LayerTree::remove_layer(self : LayerTree, index : Int) -> Layer?

    LayerTree::reorder_layer

    fn LayerTree::reorder_layer(self : LayerTree, from_index : Int, to_index : Int) -> Bool

    LayerTree::replace_layer

    fn LayerTree::replace_layer(self : LayerTree, index : Int, layer : Layer) -> Layer?

    LayerTree::resize_layer

    fn LayerTree::resize_layer(self : LayerTree, index : Int, width : Int, height : Int) -> Bool

    LayerTree::set_layer_blend_mode

    fn LayerTree::set_layer_blend_mode(self : LayerTree, index : Int, blend_mode : BlendMode) -> Bool

    LayerTree::set_layer_filter

    fn LayerTree::set_layer_filter(self : LayerTree, index : Int, filter : PaintFilter) -> Bool

    LayerTree::set_layer_opacity

    fn LayerTree::set_layer_opacity(self : LayerTree, index : Int, opacity : Double) -> Bool

    LayerTree::set_layer_position

    fn LayerTree::set_layer_position(self : LayerTree, index : Int, x : Int, y : Int) -> Bool

    LayerTree::set_layer_shader

    fn LayerTree::set_layer_shader(self : LayerTree, index : Int, shader : PaintShader) -> Bool

    Set the shader used when compositing a layer. The shader is sampled in the layer's local coordinates so layer movement does not shift the pattern.

    LayerTree::set_layer_visible

    fn LayerTree::set_layer_visible(self : LayerTree, index : Int, visible : Bool) -> Bool

    LayerTree::submit_by_strategy_plan

    fn[S : Surface] LayerTree::submit_by_strategy_plan(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> RenderFrameSubmitPlan

    LayerTree::submit_dirty_to

    fn[S : Surface] LayerTree::submit_dirty_to(self : LayerTree, target : Canvas, surface : S) -> Result[DirtySubmitResult, PresentError]

    LayerTree::submit_dirty_to_with_limit

    fn[S : Surface] LayerTree::submit_dirty_to_with_limit(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> Result[DirtySubmitResult, PresentError]

    LayerTree::submit_request_by_policy

    fn[S : Surface] LayerTree::submit_request_by_policy(self : LayerTree, target : Canvas, surface : S, max_rects : Int, policy : RenderFrameSubmitPolicy) -> RenderFrameSubmitRequest

    LayerTree::submit_request_to

    fn[S : Surface] LayerTree::submit_request_to(self : LayerTree, target : Canvas, surface : S, request : RenderFrameSubmitRequest) -> Result[RenderFrameSubmitResult, PresentError]

    LayerTree::submit_request_to_with_limit

    fn[S : Surface] LayerTree::submit_request_to_with_limit(self : LayerTree, target : Canvas, surface : S, max_rects : Int, request : RenderFrameSubmitRequest) -> Result[RenderFrameSubmitResult, PresentError]

    LayerTree::submit_schedule

    fn[S : Surface] LayerTree::submit_schedule(self : LayerTree, target : Canvas, surface : S, max_rects : Int) -> RenderFrameSchedule

    LayerTree::submit_schedule_by_policy

    fn[S : Surface] LayerTree::submit_schedule_by_policy(self : LayerTree, target : Canvas, surface : S, max_rects : Int, policy : RenderFrameSubmitPolicy) -> RenderFrameSchedule

    LayerTree::submit_scheduled_to

    fn[S : Surface] LayerTree::submit_scheduled_to(self : LayerTree, target : Canvas, surface : S, schedule : RenderFrameSchedule) -> Result[RenderFrameSubmitResult, PresentError]

    LayerTree::submit_scheduled_to_with_limit

    fn[S : Surface] LayerTree::submit_scheduled_to_with_limit(self : LayerTree, target : Canvas, surface : S, max_rects : Int, schedule : RenderFrameSchedule) -> Result[RenderFrameSubmitResult, PresentError]

    LayerTree::submit_to_by_policy

    fn[S : Surface] LayerTree::submit_to_by_policy(self : LayerTree, target : Canvas, surface : S, policy : RenderFrameSubmitPolicy) -> Result[RenderFrameSubmitResult, PresentError]

    LayerTree::submit_to_by_policy_with_limit

    fn[S : Surface] LayerTree::submit_to_by_policy_with_limit(self : LayerTree, target : Canvas, surface : S, max_rects : Int, policy : RenderFrameSubmitPolicy) -> Result[RenderFrameSubmitResult, PresentError]

    MemoryPresentRecord

    pub struct MemoryPresentRecord {
    rect : PixelRect
    row_bytes : Int
    } derive(Eq,
    Debug
    )

    One validated present operation recorded by MemorySurface.

    MemoryPresentRecord::equal

    MemoryPresentRecord::get_present_byte_count

    fn MemoryPresentRecord::get_present_byte_count(self : MemoryPresentRecord) -> Int

    MemoryPresentRecord::get_present_pixel_count

    fn MemoryPresentRecord::get_present_pixel_count(self : MemoryPresentRecord) -> Int

    MemoryPresentRecord::get_rect

    MemoryPresentRecord::get_row_bytes

    fn MemoryPresentRecord::get_row_bytes(self : MemoryPresentRecord) -> Int

    MemoryPresentRecord::get_source_byte_count

    fn MemoryPresentRecord::get_source_byte_count(self : MemoryPresentRecord) -> Int

    MemoryPresentRecord::get_source_padding_byte_count

    fn MemoryPresentRecord::get_source_padding_byte_count(self : MemoryPresentRecord) -> Int

    MemoryPresentRecord::not_equal

    MemorySurface

    pub struct MemorySurface {
    width : Int
    height : Int
    pixels : FixedArray[Byte]
    present_count : Int
    present_records : Array[MemoryPresentRecord]
    } derive(
    Debug
    )

    In-memory surface used as the reference backend for tests and headless tools.

    MemorySurface::checksum

    fn MemorySurface::checksum(self : MemorySurface) -> Int

    Return a deterministic lightweight checksum of the current surface pixels.

    MemorySurface::checksum_rect

    fn MemorySurface::checksum_rect(self : MemorySurface, rect : PixelRect) -> Result[Int, PresentError]

    Return a deterministic lightweight checksum of a surface rectangle.

    MemorySurface::get_height

    fn MemorySurface::get_height(self : MemorySurface) -> Int

    MemorySurface::get_last_present_record

    fn MemorySurface::get_last_present_record(self : MemorySurface) -> MemoryPresentRecord?

    MemorySurface::get_pixel

    fn MemorySurface::get_pixel(self : MemorySurface, x : Int, y : Int) -> Color

    MemorySurface::get_pixels

    fn MemorySurface::get_pixels(self : MemorySurface) -> FixedArray[Byte]

    Return a copied snapshot of the surface's RGBA pixels.

    MemorySurface::get_present_bounds

    fn MemorySurface::get_present_bounds(self : MemorySurface) -> PixelRect?

    MemorySurface::get_present_byte_count

    fn MemorySurface::get_present_byte_count(self : MemorySurface) -> Int

    MemorySurface::get_present_count

    fn MemorySurface::get_present_count(self : MemorySurface) -> Int

    MemorySurface::get_present_pixel_count

    fn MemorySurface::get_present_pixel_count(self : MemorySurface) -> Int

    MemorySurface::get_present_records

    fn MemorySurface::get_present_records(self : MemorySurface) -> Array[MemoryPresentRecord]

    MemorySurface::get_present_source_byte_count

    fn MemorySurface::get_present_source_byte_count(self : MemorySurface) -> Int

    MemorySurface::get_present_source_padding_byte_count

    fn MemorySurface::get_present_source_padding_byte_count(self : MemorySurface) -> Int

    MemorySurface::get_width

    fn MemorySurface::get_width(self : MemorySurface) -> Int

    MemorySurface::new

    fn MemorySurface::new(width : Int, height : Int) -> MemorySurface

    MemorySurface::present_pixels

    fn MemorySurface::present_pixels(self : MemorySurface, width : Int, height : Int, row_bytes : Int, pixels : FixedArray[Byte]) -> Result[Unit, PresentError]

    MemorySurface::present_pixels_rect

    fn MemorySurface::present_pixels_rect(self : MemorySurface, x : Int, y : Int, width : Int, height : Int, row_bytes : Int, pixels : FixedArray[Byte]) -> Result[Unit, PresentError]

    MemorySurface::reset_present_telemetry

    fn MemorySurface::reset_present_telemetry(self : MemorySurface) -> Unit

    Clear accumulated present telemetry while preserving surface pixels.

    MemorySurface::to_bmp_bytes

    fn MemorySurface::to_bmp_bytes(self : MemorySurface) -> Bytes

    Encode the current surface pixels as deterministic 32-bit BMP(BGRA) bytes.

    MemorySurface::to_bmp_rect_bytes

    fn MemorySurface::to_bmp_rect_bytes(self : MemorySurface, rect : PixelRect) -> Result[Bytes, PresentError]

    Encode a rectangle of this surface as deterministic 32-bit BMP(BGRA) bytes.

    MemorySurface::to_pixmap

    fn MemorySurface::to_pixmap(self : MemorySurface) -> Pixmap

    Snapshot this in-memory surface into an isolated pixmap.

    MemorySurface::to_pixmap_rect

    fn MemorySurface::to_pixmap_rect(self : MemorySurface, rect : PixelRect) -> Result[Pixmap, PresentError]

    Snapshot a rectangle of this in-memory surface into an isolated pixmap.

    MemorySurface::to_png_bytes

    fn MemorySurface::to_png_bytes(self : MemorySurface) -> Result[Bytes, PixmapEncodeError]

    Encode the current surface pixels as deterministic 8-bit RGBA PNG bytes.

    MemorySurface::to_png_rect_bytes

    fn MemorySurface::to_png_rect_bytes(self : MemorySurface, rect : PixelRect) -> Result[Bytes, PresentError]

    Encode a rectangle of this surface as deterministic 8-bit RGBA PNG bytes.

    MemorySurface::to_ppm_bytes

    fn MemorySurface::to_ppm_bytes(self : MemorySurface) -> Bytes

    Encode the current surface pixels as deterministic binary PPM(P6) bytes.

    MemorySurface::to_ppm_rect_bytes

    fn MemorySurface::to_ppm_rect_bytes(self : MemorySurface, rect : PixelRect) -> Result[Bytes, PresentError]

    Encode a rectangle of this surface as deterministic binary PPM(P6) bytes.

    MemorySurface::to_rgba_bytes

    fn MemorySurface::to_rgba_bytes(self : MemorySurface) -> Bytes

    Return an isolated copy of the current surface RGBA pixel bytes.

    MemorySurface::to_rgba_rect_bytes

    fn MemorySurface::to_rgba_rect_bytes(self : MemorySurface, rect : PixelRect) -> Result[Bytes, PresentError]

    Return packed RGBA bytes for a surface rectangle in row-major order.

    NinePatchInsets

    pub struct NinePatchInsets {
    left : Int
    top : Int
    right : Int
    bottom : Int
    } derive(Eq,
    Debug
    )

    Insets used for nine-patch image scaling.

    NinePatchInsets::equal

    NinePatchInsets::new

    fn NinePatchInsets::new(left~ : Int, top~ : Int, right~ : Int, bottom~ : Int) -> NinePatchInsets

    NinePatchInsets::not_equal

    fn NinePatchInsets::not_equal(x : NinePatchInsets, y : NinePatchInsets) -> Bool

    NinePatchSlices

    type NinePatchSlices derive(
    Debug
    )

    Paint

    pub struct Paint {
    color : Color
    shader : PaintShader?
    filter : PaintFilter?
    style : PaintStyle
    blend_mode : BlendMode
    stroke_width : Double
    stroke_cap : StrokeCap
    stroke_join : StrokeJoin
    miter_limit : Double
    stroke_dash_pattern : Array[Double]
    stroke_dash_offset : Double
    fill_rule : FillRule
    opacity : Double
    } derive(
    Debug
    )

    Paint configuration for drawing operations

    Paint::clear_filter

    fn Paint::clear_filter(self : Paint) -> Paint

    Clear the active color filter.

    Paint::clear_shader

    fn Paint::clear_shader(self : Paint) -> Paint

    Clear shader color source and return to solid-color drawing.

    Paint::clear_stroke_dash

    fn Paint::clear_stroke_dash(self : Paint) -> Paint

    Clear stroke dash pattern and return to solid strokes.

    Paint::get_blend_mode

    fn Paint::get_blend_mode(self : Paint) -> BlendMode

    Return the pixel blend mode used when compositing this paint.

    Paint::get_color

    fn Paint::get_color(self : Paint) -> Color

    Return the solid paint color used when no shader color source is active.

    Paint::get_fill_rule

    fn Paint::get_fill_rule(self : Paint) -> FillRule

    Return the fill rule used by path filling.

    Paint::get_filter

    fn Paint::get_filter(self : Paint) -> PaintFilter?

    Return the configured color filter, if any.

    Paint::get_miter_limit

    fn Paint::get_miter_limit(self : Paint) -> Double

    Return the stroke miter limit.

    Paint::get_opacity

    fn Paint::get_opacity(self : Paint) -> Double

    Return the normalized configured opacity.

    Paint::get_shader

    fn Paint::get_shader(self : Paint) -> PaintShader?

    Return the configured shader color source, if any.

    Paint::get_stroke_cap

    fn Paint::get_stroke_cap(self : Paint) -> StrokeCap

    Return the stroke cap style.

    Paint::get_stroke_dash_offset

    fn Paint::get_stroke_dash_offset(self : Paint) -> Double

    Return the stroke dash phase offset.

    Paint::get_stroke_dash_pattern

    fn Paint::get_stroke_dash_pattern(self : Paint) -> Array[Double]

    Return a copied normalized stroke dash pattern.

    Paint::get_stroke_join

    fn Paint::get_stroke_join(self : Paint) -> StrokeJoin

    Return the stroke join style.

    Paint::get_stroke_width

    fn Paint::get_stroke_width(self : Paint) -> Double

    Return the stroke width.

    Paint::get_style

    fn Paint::get_style(self : Paint) -> PaintStyle

    Return the paint style.

    Paint::has_filter

    fn Paint::has_filter(self : Paint) -> Bool

    Return whether this paint has an active color filter.

    Paint::has_shader

    fn Paint::has_shader(self : Paint) -> Bool

    Return whether this paint has an active shader color source.

    Paint::has_stroke_dash

    fn Paint::has_stroke_dash(self : Paint) -> Bool

    Return whether this paint has a normalized stroke dash pattern.

    Paint::new

    fn Paint::new() -> Paint

    Create a default paint

    Paint::sample_color

    fn Paint::sample_color(self : Paint, x : Double, y : Double) -> Color

    Sample this paint's active color source at a device-space point and apply paint opacity.

    Paint::sample_source_color

    fn Paint::sample_source_color(self : Paint, color : Color) -> Color

    Apply this paint's filter and opacity to a sampled source pixel.

    Paint::set_blend_mode

    fn Paint::set_blend_mode(self : Paint, blend_mode : BlendMode) -> Paint

    Set pixel blend mode used when compositing this paint.

    Paint::set_color

    fn Paint::set_color(self : Paint, color : Color) -> Paint

    Set the paint color and clear any shader color source.

    Paint::set_dotted_stroke

    fn Paint::set_dotted_stroke(self : Paint) -> Paint

    Configure a round dotted stroke using the current stroke width.

    Paint::set_fill_rule

    fn Paint::set_fill_rule(self : Paint, fill_rule : FillRule) -> Paint

    Set fill rule

    Paint::set_filter

    fn Paint::set_filter(self : Paint, filter : PaintFilter) -> Paint

    Set a color filter applied after color sampling and before opacity.

    Paint::set_miter_limit

    fn Paint::set_miter_limit(self : Paint, limit : Double) -> Paint

    Set stroke miter limit. Values below 1.0 are clamped to the minimum meaningful ratio.

    Paint::set_opacity

    fn Paint::set_opacity(self : Paint, opacity : Double) -> Paint

    Set opacity (0.0 to 1.0)

    Paint::set_shader

    fn Paint::set_shader(self : Paint, shader : PaintShader) -> Paint

    Set a shader color source for vector and mask drawing.

    Paint::set_stroke_cap

    fn Paint::set_stroke_cap(self : Paint, cap : StrokeCap) -> Paint

    Set stroke cap style

    Paint::set_stroke_dash

    fn Paint::set_stroke_dash(self : Paint, pattern : Array[Double], offset : Double) -> Paint

    Set stroke dash pattern and phase offset. Empty or non-positive-only patterns draw a solid stroke.

    Paint::set_stroke_join

    fn Paint::set_stroke_join(self : Paint, join : StrokeJoin) -> Paint

    Set stroke join style

    Paint::set_stroke_width

    fn Paint::set_stroke_width(self : Paint, width : Double) -> Paint

    Set stroke width

    Paint::set_style

    fn Paint::set_style(self : Paint, style : PaintStyle) -> Paint

    Set the paint style

    Paint::to_repr

    PaintFilter

    type PaintFilter derive(Eq,
    Debug
    )

    Paint color filter applied after color sampling and before opacity.

    PaintFilter::apply

    fn PaintFilter::apply(self : PaintFilter, color : Color) -> Color

    Apply this filter to a straight-alpha color.

    PaintFilter::brightness

    fn PaintFilter::brightness(factor : Double) -> PaintFilter

    Create a filter that scales RGB brightness and preserves alpha.

    PaintFilter::color_matrix

    fn PaintFilter::color_matrix(values : Array[Double]) -> PaintFilter

    Create a filter from a 4x5 RGBA color matrix.

    PaintFilter::compose

    fn PaintFilter::compose(first : PaintFilter, second : PaintFilter) -> PaintFilter

    Compose two filters in application order: first, then second.

    PaintFilter::contrast

    fn PaintFilter::contrast(factor : Double) -> PaintFilter

    Create a filter that scales RGB contrast around mid-gray and preserves alpha.

    PaintFilter::equal

    fn PaintFilter::equal(PaintFilter, PaintFilter) -> Bool

    PaintFilter::get_filter_count

    fn PaintFilter::get_filter_count(self : PaintFilter) -> Int

    Return the number of filter stages in this chain.

    PaintFilter::get_stage_color

    fn PaintFilter::get_stage_color(self : PaintFilter, index : Int) -> Color?

    Return the stage color for color-bearing filter stages.

    PaintFilter::get_stage_color_matrix

    fn PaintFilter::get_stage_color_matrix(self : PaintFilter, index : Int) -> Array[Double]?

    Return a copied 4x5 RGBA color matrix for matrix filter stages.

    PaintFilter::get_stage_factor

    fn PaintFilter::get_stage_factor(self : PaintFilter, index : Int) -> Double?

    Return the numeric factor for factor-bearing filter stages.

    PaintFilter::get_stage_type

    fn PaintFilter::get_stage_type(self : PaintFilter, index : Int) -> PaintFilterType?

    Return the filter stage family at an index.

    PaintFilter::grayscale

    fn PaintFilter::grayscale() -> PaintFilter

    Create a filter that converts RGB channels to luminance and preserves alpha.

    PaintFilter::identity

    fn PaintFilter::identity() -> PaintFilter

    Create a filter chain with no stages. Applying it returns the source color.

    PaintFilter::invert

    fn PaintFilter::invert() -> PaintFilter

    Create a filter that inverts RGB channels and preserves alpha.

    PaintFilter::is_identity

    fn PaintFilter::is_identity(self : PaintFilter) -> Bool

    Return whether this filter chain has no stages.

    PaintFilter::modulate

    fn PaintFilter::modulate(color : Color) -> PaintFilter

    Create a filter that multiplies each source channel by a color.

    PaintFilter::not_equal

    fn PaintFilter::not_equal(x : PaintFilter, y : PaintFilter) -> Bool

    PaintFilter::saturate

    fn PaintFilter::saturate(factor : Double) -> PaintFilter

    Create a filter that scales RGB saturation around luminance and preserves alpha.

    PaintFilter::sepia

    fn PaintFilter::sepia() -> PaintFilter

    Create a filter that maps RGB channels through a warm sepia tone matrix.

    PaintFilter::then

    fn PaintFilter::then(self : PaintFilter, next : PaintFilter) -> PaintFilter

    Return a filter that applies this filter and then the next filter.

    PaintFilterType

    pub(all) enum PaintFilterType {
    Modulate
    Grayscale
    Invert
    Brightness
    Contrast
    Saturate
    Sepia
    ColorMatrix
    } derive(Eq,
    Debug
    )

    Public filter stage family used for inspection and paint pipeline planning.

    PaintFilterType::equal

    PaintFilterType::not_equal

    fn PaintFilterType::not_equal(x : PaintFilterType, y : PaintFilterType) -> Bool

    PaintGradientStop

    type PaintGradientStop derive(Eq,
    Debug
    )

    One color stop in a gradient shader.

    PaintGradientStop::equal

    PaintGradientStop::get_color

    fn PaintGradientStop::get_color(self : PaintGradientStop) -> Color

    Return this stop's color.

    PaintGradientStop::get_offset

    fn PaintGradientStop::get_offset(self : PaintGradientStop) -> Double

    Return this stop's normalized offset.

    PaintGradientStop::new

    fn PaintGradientStop::new(offset~ : Double, color~ : Color) -> PaintGradientStop

    Create a gradient color stop. Offsets are clamped into 0.0..1.0.

    PaintGradientStop::not_equal

    fn PaintGradientStop::not_equal(x : PaintGradientStop, y : PaintGradientStop) -> Bool

    PaintShader

    type PaintShader derive(Eq,
    Debug
    )

    Device-space shader used as a Paint color source.

    PaintShader::equal

    fn PaintShader::equal(PaintShader, PaintShader) -> Bool

    PaintShader::get_gradient_stop

    fn PaintShader::get_gradient_stop(self : PaintShader, index : Int) -> PaintGradientStop?

    Return a copied gradient stop at an index.

    PaintShader::get_gradient_stop_count

    fn PaintShader::get_gradient_stop_count(self : PaintShader) -> Int

    Return the number of color stops used by this gradient. Two-color gradient constructors report their implicit start/end stop pair.

    PaintShader::get_gradient_stops

    fn PaintShader::get_gradient_stops(self : PaintShader) -> Array[PaintGradientStop]

    Return a copied gradient stop list. Two-color gradient constructors expose their implicit start/end pair as stops at 0.0 and 1.0.

    PaintShader::get_linear_gradient_points

    fn PaintShader::get_linear_gradient_points(self : PaintShader) -> (Point, Point)?

    Return local linear-gradient endpoints, if this is a linear gradient.

    PaintShader::get_local_from_device_transform

    fn PaintShader::get_local_from_device_transform(self : PaintShader) -> Transform?

    Return the local-from-device transform used before sampling, if any.

    PaintShader::get_radial_gradient_circle

    fn PaintShader::get_radial_gradient_circle(self : PaintShader) -> (Point, Double)?

    Return local radial-gradient center and radius, if this is a radial gradient.

    PaintShader::get_spread

    fn PaintShader::get_spread(self : PaintShader) -> PaintShaderSpread

    Return the gradient spread mode.

    PaintShader::get_sweep_gradient_geometry

    fn PaintShader::get_sweep_gradient_geometry(self : PaintShader) -> (Point, Double, Double)?

    Return local sweep-gradient center and angles, if this is a sweep gradient.

    PaintShader::get_type

    fn PaintShader::get_type(self : PaintShader) -> PaintShaderType

    Return the shader family.

    PaintShader::has_local_transform

    fn PaintShader::has_local_transform(self : PaintShader) -> Bool

    Return whether this shader has a local-to-device transform attached.

    PaintShader::is_sampleable

    fn PaintShader::is_sampleable(self : PaintShader) -> Bool

    Return whether this shader can produce non-transparent samples. Singular transforms mark a shader as unsampleable.

    PaintShader::linear_gradient

    fn PaintShader::linear_gradient(x0~ : Double, y0~ : Double, x1~ : Double, y1~ : Double, start_color~ : Color, end_color~ : Color, spread? : PaintShaderSpread) -> PaintShader

    Create a device-space linear gradient shader.

    PaintShader::linear_gradient_stops

    fn PaintShader::linear_gradient_stops(x0~ : Double, y0~ : Double, x1~ : Double, y1~ : Double, stops~ : Array[PaintGradientStop], spread? : PaintShaderSpread) -> PaintShader

    Create a device-space linear gradient shader with multiple color stops.

    PaintShader::not_equal

    fn PaintShader::not_equal(x : PaintShader, y : PaintShader) -> Bool

    PaintShader::radial_gradient

    fn PaintShader::radial_gradient(cx~ : Double, cy~ : Double, radius~ : Double, start_color~ : Color, end_color~ : Color, spread? : PaintShaderSpread) -> PaintShader

    Create a device-space radial gradient shader.

    PaintShader::radial_gradient_stops

    fn PaintShader::radial_gradient_stops(cx~ : Double, cy~ : Double, radius~ : Double, stops~ : Array[PaintGradientStop], spread? : PaintShaderSpread) -> PaintShader

    Create a device-space radial gradient shader with multiple color stops.

    PaintShader::sample

    fn PaintShader::sample(self : PaintShader, x : Double, y : Double) -> Color

    Sample this shader at a device-space point.

    PaintShader::sweep_gradient

    fn PaintShader::sweep_gradient(cx~ : Double, cy~ : Double, start_angle~ : Double, sweep_angle~ : Double, start_color~ : Color, end_color~ : Color, spread? : PaintShaderSpread) -> PaintShader

    Create a device-space sweep gradient shader around a center point.

    PaintShader::sweep_gradient_stops

    fn PaintShader::sweep_gradient_stops(cx~ : Double, cy~ : Double, start_angle~ : Double, sweep_angle~ : Double, stops~ : Array[PaintGradientStop], spread? : PaintShaderSpread) -> PaintShader

    Create a device-space sweep gradient shader with multiple color stops.

    PaintShader::transformed

    fn PaintShader::transformed(self : PaintShader, transform : Transform) -> PaintShader

    Return a shader sampled in local coordinates mapped to device space by the given transform. Singular transforms make the shader sample transparent.

    PaintShaderSpread

    pub(all) enum PaintShaderSpread {
    Clamp
    Repeat
    Mirror
    Decal
    } derive(Eq,
    Debug
    )

    Spread mode applied to gradient coordinates outside the unit interval.

    PaintShaderSpread::equal

    PaintShaderSpread::not_equal

    fn PaintShaderSpread::not_equal(x : PaintShaderSpread, y : PaintShaderSpread) -> Bool

    PaintShaderType

    pub(all) enum PaintShaderType {
    LinearGradient
    RadialGradient
    SweepGradient
    } derive(Eq,
    Debug
    )

    Public shader family used for inspection and paint pipeline planning.

    PaintShaderType::equal

    PaintShaderType::not_equal

    fn PaintShaderType::not_equal(x : PaintShaderType, y : PaintShaderType) -> Bool

    PaintStyle

    pub(all) enum PaintStyle {
    Fill
    Stroke
    } derive(Eq,
    Debug
    )

    Paint style

    PaintStyle::equal

    fn PaintStyle::equal(PaintStyle, PaintStyle) -> Bool

    PaintStyle::not_equal

    fn PaintStyle::not_equal(x : PaintStyle, y : PaintStyle) -> Bool

    Path

    pub struct Path {
    segments : Array[PathSegment]
    current_x : Double
    current_y : Double
    start_x : Double
    start_y : Double
    } derive(
    Debug
    )

    2D path builder for constructing vector shapes

    Path::add_arc

    fn Path::add_arc(self : Path, cx : Double, cy : Double, radius : Double, start_angle : Double, sweep_angle : Double) -> Path

    Add an open circular arc approximated with cubic bezier curves.

    Path::add_circle

    fn Path::add_circle(self : Path, cx : Double, cy : Double, radius : Double) -> Path

    Add a circle approximation using cubic bezier curves

    Path::add_ellipse

    fn Path::add_ellipse(self : Path, cx : Double, cy : Double, rx : Double, ry : Double) -> Path

    Add an ellipse approximation using cubic bezier curves

    Path::add_pie

    fn Path::add_pie(self : Path, cx : Double, cy : Double, radius : Double, start_angle : Double, sweep_angle : Double) -> Path

    Add a closed pie slice from the center through a circular arc.

    Path::add_polygon

    fn Path::add_polygon(self : Path, points : Array[Point]) -> Path

    Add a closed polygon through the given points

    Path::add_polyline

    fn Path::add_polyline(self : Path, points : Array[Point]) -> Path

    Add an open polyline through the given points

    Path::add_rect

    fn Path::add_rect(self : Path, x : Double, y : Double, w : Double, h : Double) -> Path

    Add a rectangle to the path

    Path::add_rounded_rect

    fn Path::add_rounded_rect(self : Path, x : Double, y : Double, w : Double, h : Double, radius : Double) -> Path

    Add a rounded rectangle with a uniform corner radius to the path

    Path::add_rounded_rect_corners

    fn Path::add_rounded_rect_corners(self : Path, x : Double, y : Double, w : Double, h : Double, top_left : Double, top_right : Double, bottom_right : Double, bottom_left : Double) -> Path

    Add a rounded rectangle with independent corner radii in clockwise order.

    Path::boolean

    fn Path::boolean(self : Path, other : Path, op : PathBooleanOp) -> Path?

    Boolean two supported path shapes. Empty paths follow geometric identity rules. Rect-like paths and single convex line-polygon paths support all operations. Single axis-aligned line polygons are decomposed into rectangle cells so common GUI clip shapes such as L regions can also be combined. Other non-convex or curved operands are currently rejected with None.

    Path::close

    fn Path::close(self : Path) -> Path

    Close the current subpath

    Path::contains_point

    fn Path::contains_point(self : Path, x : Double, y : Double, fill_rule : FillRule) -> Bool

    Return whether a point is inside this path under the given fill rule.

    Path::control_bounds

    fn Path::control_bounds(self : Path) -> Rect?

    Return conservative bounds over all explicit path control points.

    Path::cubic_to

    fn Path::cubic_to(self : Path, cx1 : Double, cy1 : Double, cx2 : Double, cy2 : Double, x : Double, y : Double) -> Path

    Draw a cubic bezier curve

    Path::difference

    fn Path::difference(self : Path, other : Path) -> Path?

    Return the geometric difference of this path minus another supported shape.

    Path::get_segments

    fn Path::get_segments(self : Path) -> Array[PathSegment]

    Get the segments of the path

    Path::intersection

    fn Path::intersection(self : Path, other : Path) -> Path?

    Return the geometric intersection of two supported path shapes.

    Path::is_empty

    fn Path::is_empty(self : Path) -> Bool

    Check if the path is empty

    Path::is_line_polygon

    fn Path::is_line_polygon(self : Path) -> Bool

    Return whether this path can be treated as one simplified closed line polygon.

    Path::line_polygon_area

    fn Path::line_polygon_area(self : Path) -> Double?

    Return the absolute shoelace area for one simplified closed line polygon.

    Path::line_polygon_points

    fn Path::line_polygon_points(self : Path) -> Array[Point]?

    Return isolated points when this path is one simplified closed line polygon.

    Path::line_polygon_signed_area

    fn Path::line_polygon_signed_area(self : Path) -> Double?

    Return the signed shoelace area for one simplified closed line polygon.

    Path::line_to

    fn Path::line_to(self : Path, x : Double, y : Double) -> Path

    Draw a line to a point

    Path::move_to

    fn Path::move_to(self : Path, x : Double, y : Double) -> Path

    Move to a point without drawing

    Path::new

    fn Path::new() -> Path

    Create a new empty path

    Path::quad_to

    fn Path::quad_to(self : Path, cx : Double, cy : Double, x : Double, y : Double) -> Path

    Draw a quadratic bezier curve

    Path::rect_boolean

    fn Path::rect_boolean(self : Path, other : Path, op : PathBooleanOp) -> Path?

    Boolean two axis-aligned rectangle paths by decomposing them into non-overlapping rectangle cells. Returns None when either operand is not a single rect-like path.

    Path::rect_bounds

    fn Path::rect_bounds(self : Path) -> Rect?

    Return normalized bounds when this path is one closed axis-aligned rectangle.

    Path::segment_count

    fn Path::segment_count(self : Path) -> Int

    Return the number of path segments without exposing the segment array.

    Path::simplified

    fn Path::simplified(self : Path) -> Path

    Return a copy with exact no-op segments removed.

    This keeps path geometry intact while coalescing consecutive moves, removing zero-length line segments, removing fully degenerate curves, and dropping repeated close commands and empty subpaths, including trailing open moves. Explicit line-to-start segments immediately before close commands are folded into the close. Curves that trace the same straight span with monotonic control points are folded into line segments. Contiguous line segments that keep moving along the same straight span are coalesced.

    Path::to_repr

    Path::transformed

    fn Path::transformed(self : Path, transform : Transform) -> Path

    Return a copy of this path with all explicit coordinates transformed.

    Path::union

    fn Path::union(self : Path, other : Path) -> Path?

    Return the geometric union of two supported path shapes.

    Path::xor

    fn Path::xor(self : Path, other : Path) -> Path?

    Return the geometric symmetric difference of two supported path shapes.

    PathBooleanOp

    pub(all) enum PathBooleanOp {
    Union
    Intersection
    Difference
    Xor
    } derive(Eq,
    Debug
    )

    Boolean operation for supported path operands.

    PathBooleanOp::equal

    PathBooleanOp::not_equal

    fn PathBooleanOp::not_equal(x : PathBooleanOp, y : PathBooleanOp) -> Bool

    PathSegment

    pub enum PathSegment {
    MoveTo(Double, Double)
    LineTo(Double, Double)
    QuadTo(Double, Double, Double, Double)
    CubicTo(Double, Double, Double, Double, Double, Double)
    Close
    } derive(Eq,
    Debug
    )

    Path segment types

    PathSegment::equal

    fn PathSegment::equal(PathSegment, PathSegment) -> Bool

    PathSegment::not_equal

    fn PathSegment::not_equal(x : PathSegment, y : PathSegment) -> Bool

    PixelRect

    pub struct PixelRect {
    x : Int
    y : Int
    width : Int
    height : Int
    } derive(Eq,
    Debug
    )

    Pixel-aligned rectangle used for dirty-region tracking.

    PixelRect::area

    fn PixelRect::area(self : PixelRect) -> Int

    PixelRect::bottom

    fn PixelRect::bottom(self : PixelRect) -> Int

    PixelRect::clip_to

    fn PixelRect::clip_to(self : PixelRect, bounds : PixelRect) -> PixelRect?

    PixelRect::contains

    fn PixelRect::contains(self : PixelRect, x : Int, y : Int) -> Bool

    PixelRect::equal

    fn PixelRect::equal(PixelRect, PixelRect) -> Bool

    PixelRect::intersection

    fn PixelRect::intersection(self : PixelRect, other : PixelRect) -> PixelRect?

    PixelRect::intersects

    fn PixelRect::intersects(self : PixelRect, other : PixelRect) -> Bool

    PixelRect::is_empty

    fn PixelRect::is_empty(self : PixelRect) -> Bool

    PixelRect::new

    fn PixelRect::new(x~ : Int, y~ : Int, width~ : Int, height~ : Int) -> PixelRect

    PixelRect::not_equal

    fn PixelRect::not_equal(x : PixelRect, y : PixelRect) -> Bool

    PixelRect::right

    fn PixelRect::right(self : PixelRect) -> Int

    PixelRect::union

    fn PixelRect::union(self : PixelRect, other : PixelRect) -> PixelRect

    Pixmap

    pub struct Pixmap {
    width : Int
    height : Int
    pixels : FixedArray[Byte]
    } derive(
    Debug
    )

    Pixel buffer for 2D rendering (RGBA format)

    Pixmap::blend_mask

    fn Pixmap::blend_mask(self : Pixmap, x : Int, y : Int, width : Int, height : Int, mask : FixedArray[Byte], color : Color) -> Unit

    Composite a grayscale coverage mask over the existing pixels

    Pixmap::blend_mask_rect

    fn Pixmap::blend_mask_rect(self : Pixmap, x : Int, y : Int, mask_width : Int, mask_height : Int, mask : FixedArray[Byte], src_rect : PixelRect, color : Color) -> Unit

    Composite a source rectangle from a grayscale coverage mask over this pixmap.

    Pixmap::blend_nine_patch_pixmap

    fn Pixmap::blend_nine_patch_pixmap(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, insets : NinePatchInsets, opacity : Double, sampling : ImageSampling) -> Unit

    Composite a source pixmap using nine-patch scaling.

    Pixmap::blend_pixel

    fn Pixmap::blend_pixel(self : Pixmap, x : Int, y : Int, color : Color) -> Unit

    Composite a pixel over the existing pixel at the given coordinates

    Pixmap::blend_pixmap

    fn Pixmap::blend_pixmap(self : Pixmap, x : Int, y : Int, src : Pixmap, opacity : Double) -> Unit

    Composite another pixmap over this pixmap at the given destination position.

    Pixmap::blend_pixmap_rect

    fn Pixmap::blend_pixmap_rect(self : Pixmap, x : Int, y : Int, src : Pixmap, src_rect : PixelRect, opacity : Double) -> Unit

    Composite a source pixmap rectangle over this pixmap at the destination position corresponding to the requested source rectangle's top-left corner.

    Pixmap::blend_quality_nine_patch_pixmap

    fn Pixmap::blend_quality_nine_patch_pixmap(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, insets : NinePatchInsets, opacity : Double, quality : ImageQuality) -> Unit

    Composite a source pixmap using nine-patch scaling and a quality strategy.

    Pixmap::blend_quality_pixmap

    fn Pixmap::blend_quality_pixmap(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, opacity : Double, quality : ImageQuality) -> Unit

    Composite another pixmap scaled with a quality strategy.

    Pixmap::blend_quality_pixmap_rect

    fn Pixmap::blend_quality_pixmap_rect(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, src_rect : PixelRect, opacity : Double, quality : ImageQuality) -> Unit

    Composite a source pixmap rectangle scaled with a quality strategy.

    Pixmap::blend_rect

    fn Pixmap::blend_rect(self : Pixmap, x : Int, y : Int, w : Int, h : Int, color : Color) -> Unit

    Composite a rectangle over the existing pixels

    Pixmap::blend_sampled_pixmap

    fn Pixmap::blend_sampled_pixmap(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, opacity : Double, sampling : ImageSampling) -> Unit

    Composite another pixmap scaled with an explicit sampling mode.

    Pixmap::blend_sampled_pixmap_rect

    fn Pixmap::blend_sampled_pixmap_rect(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, src_rect : PixelRect, opacity : Double, sampling : ImageSampling) -> Unit

    Composite a source pixmap rectangle scaled with an explicit sampling mode.

    Pixmap::blend_scaled_pixmap

    fn Pixmap::blend_scaled_pixmap(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, opacity : Double) -> Unit

    Composite another pixmap scaled to the given destination size.

    Pixmap::blend_scaled_pixmap_bicubic

    fn Pixmap::blend_scaled_pixmap_bicubic(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, opacity : Double) -> Unit

    Composite another pixmap scaled with bicubic sampling.

    Pixmap::blend_scaled_pixmap_bilinear

    fn Pixmap::blend_scaled_pixmap_bilinear(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, opacity : Double) -> Unit

    Composite another pixmap scaled with bilinear sampling.

    Pixmap::blend_scaled_pixmap_rect

    fn Pixmap::blend_scaled_pixmap_rect(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, src_rect : PixelRect, opacity : Double) -> Unit

    Composite a source pixmap rectangle scaled to the given destination size.

    Pixmap::blend_scaled_pixmap_rect_bicubic

    fn Pixmap::blend_scaled_pixmap_rect_bicubic(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, src_rect : PixelRect, opacity : Double) -> Unit

    Composite a source pixmap rectangle scaled with bicubic sampling.

    Pixmap::blend_scaled_pixmap_rect_bilinear

    fn Pixmap::blend_scaled_pixmap_rect_bilinear(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, src_rect : PixelRect, opacity : Double) -> Unit

    Composite a source pixmap rectangle scaled with bilinear sampling.

    Pixmap::blend_tiled_pixmap_rect

    fn Pixmap::blend_tiled_pixmap_rect(self : Pixmap, x : Int, y : Int, width : Int, height : Int, src : Pixmap, src_rect : PixelRect, opacity : Double) -> Unit

    Composite a source pixmap rectangle repeatedly into the destination area.

    Pixmap::checksum

    fn Pixmap::checksum(self : Pixmap) -> Int

    Return a deterministic lightweight checksum of the raw RGBA pixel bytes. This is intended for compact regression assertions and smoke telemetry, not for cryptographic or collision-resistant validation.

    Pixmap::checksum_rect

    fn Pixmap::checksum_rect(self : Pixmap, rect : PixelRect) -> Result[Int, PresentError]

    Return a deterministic lightweight checksum of a pixmap rectangle.

    Pixmap::clear

    fn Pixmap::clear(self : Pixmap, color : Color) -> Unit

    Clear the pixmap with a color

    Pixmap::copy

    fn Pixmap::copy(self : Pixmap) -> Pixmap

    Copy this pixmap and its raw pixel storage.

    Pixmap::copy_rect

    fn Pixmap::copy_rect(self : Pixmap, rect : PixelRect) -> Result[Pixmap, PresentError]

    Snapshot a rectangle of this pixmap into an isolated pixmap.

    Pixmap::fill_rect

    fn Pixmap::fill_rect(self : Pixmap, x : Int, y : Int, w : Int, h : Int, color : Color) -> Unit

    Fill a rectangle with a color

    Pixmap::from_bmp_bytes

    fn Pixmap::from_bmp_bytes(data : Bytes) -> Result[Pixmap, PixmapDecodeError]

    Decode a 24-bit or 32-bit BMP image into an RGBA pixmap.

    This intentionally supports uncompressed BMP images with BGR/BGRA pixels. Both bottom-up and top-down BMP row order are accepted.

    Pixmap::from_png_bytes

    fn Pixmap::from_png_bytes(data : Bytes) -> Result[Pixmap, PixmapDecodeError]

    Decode an 8-bit RGBA PNG image into a pixmap.

    This decoder supports non-interlaced PNGs with RGBA color, standard scanline filters, and zlib-wrapped DEFLATE image data. It is intentionally paired with to_png_bytes for portable fixture roundtrips.

    Pixmap::from_rgba_bytes

    fn Pixmap::from_rgba_bytes(width : Int, height : Int, data : Bytes) -> Result[Pixmap, PixmapDecodeError]

    Decode tightly packed RGBA bytes into a pixmap.

    The input must contain exactly width * height * 4 bytes in row-major RGBA order. Decoded pixels are copied so later mutations to the returned pixmap cannot alias caller-owned byte storage.

    Pixmap::get_height

    fn Pixmap::get_height(self : Pixmap) -> Int

    Get the height of the pixmap

    Pixmap::get_pixel

    fn Pixmap::get_pixel(self : Pixmap, x : Int, y : Int) -> Color

    Get the color at the given coordinates

    Pixmap::get_pixels

    fn Pixmap::get_pixels(self : Pixmap) -> FixedArray[Byte]

    Get the raw pixel data

    Pixmap::get_width

    fn Pixmap::get_width(self : Pixmap) -> Int

    Get the width of the pixmap

    Pixmap::new

    fn Pixmap::new(width : Int, height : Int) -> Pixmap

    Create a new pixmap filled with transparent pixels

    Pixmap::present_batch

    fn Pixmap::present_batch(self : Pixmap, plan : DirtyPresentPlan) -> Result[PresentBatch, PresentError]

    Pixmap::present_rect_payload

    fn Pixmap::present_rect_payload(self : Pixmap, rect : PixelRect) -> Result[PresentRectPayload, PresentError]

    Pixmap::present_rect_to

    fn[S : Surface] Pixmap::present_rect_to(self : Pixmap, surface : S, rect : PixelRect) -> Result[Unit, PresentError]

    Pixmap::present_to

    fn[S : Surface] Pixmap::present_to(self : Pixmap, surface : S) -> Result[Unit, PresentError]

    Pixmap::set_pixel

    fn Pixmap::set_pixel(self : Pixmap, x : Int, y : Int, color : Color) -> Unit

    Set a pixel at the given coordinates

    Pixmap::to_bmp_bytes

    fn Pixmap::to_bmp_bytes(self : Pixmap) -> Bytes

    Encode this pixmap as a deterministic 32-bit BMP image.

    Pixels are written in standard bottom-up BMP row order with BGRA channels, preserving the pixmap alpha channel for tools that understand 32-bit BMP.

    Pixmap::to_bmp_rect_bytes

    fn Pixmap::to_bmp_rect_bytes(self : Pixmap, rect : PixelRect) -> Result[Bytes, PresentError]

    Encode a rectangle of this pixmap as deterministic 32-bit BMP(BGRA) bytes.

    Pixmap::to_png_bytes

    fn Pixmap::to_png_bytes(self : Pixmap) -> Result[Bytes, PixmapEncodeError]

    Encode this pixmap as a deterministic 8-bit RGBA PNG image.

    The encoder writes filter-0 scanlines into uncompressed DEFLATE blocks, so the output is dependency-free and stable for headless render fixtures.

    Pixmap::to_png_rect_bytes

    fn Pixmap::to_png_rect_bytes(self : Pixmap, rect : PixelRect) -> Result[Bytes, PresentError]

    Encode a rectangle of this pixmap as deterministic 8-bit RGBA PNG bytes.

    Pixmap::to_ppm_bytes

    fn Pixmap::to_ppm_bytes(self : Pixmap) -> Bytes

    Encode this pixmap as a binary PPM (P6) image, dropping the alpha channel. The result is a deterministic, dependency-free fixture format for headless render tests and simple CPU-rendered pixel dumps.

    Pixmap::to_ppm_rect_bytes

    fn Pixmap::to_ppm_rect_bytes(self : Pixmap, rect : PixelRect) -> Result[Bytes, PresentError]

    Encode a rectangle of this pixmap as deterministic binary PPM(P6) bytes.

    Pixmap::to_repr

    Pixmap::to_rgba_bytes

    fn Pixmap::to_rgba_bytes(self : Pixmap) -> Bytes

    Return an isolated copy of the raw RGBA pixel bytes in row-major order.

    Pixmap::to_rgba_rect_bytes

    fn Pixmap::to_rgba_rect_bytes(self : Pixmap, rect : PixelRect) -> Result[Bytes, PresentError]

    Return packed RGBA bytes for a pixmap rectangle in row-major order.

    PixmapCache

    pub struct PixmapCache {
    pixmaps : Map[String, Pixmap]
    access_order : Array[String]
    capacity : Int
    is_bounded : Bool
    } derive(
    Debug
    )

    Small keyed cache for reusable pixmap resources.

    PixmapCache::capacity

    fn PixmapCache::capacity(self : PixmapCache) -> Int

    Return the maximum number of cached pixmaps, or 0 for an unbounded cache.

    PixmapCache::clear

    fn PixmapCache::clear(self : PixmapCache) -> Unit

    Drop all cached pixmaps.

    PixmapCache::contains

    fn PixmapCache::contains(self : PixmapCache, key : String) -> Bool

    Return whether the cache has a pixmap for this key without refreshing LRU.

    PixmapCache::get

    fn PixmapCache::get(self : PixmapCache, key : String) -> Pixmap?

    Look up a pixmap by caller-provided key.

    PixmapCache::get_or_decode_bmp

    fn PixmapCache::get_or_decode_bmp(self : PixmapCache, key : String, data : Bytes) -> Result[Pixmap, PixmapDecodeError]

    Return a cached pixmap or decode BMP bytes and cache the decoded pixmap.

    PixmapCache::get_or_decode_bmp_result

    fn PixmapCache::get_or_decode_bmp_result(self : PixmapCache, key : String, data : Bytes) -> Result[PixmapCacheDecodeResult, PixmapDecodeError]

    Return a cached pixmap or decode BMP bytes, reporting cache hits.

    PixmapCache::get_or_decode_png

    fn PixmapCache::get_or_decode_png(self : PixmapCache, key : String, data : Bytes) -> Result[Pixmap, PixmapDecodeError]

    Return a cached pixmap or decode PNG bytes and cache the decoded pixmap.

    PixmapCache::get_or_decode_png_result

    fn PixmapCache::get_or_decode_png_result(self : PixmapCache, key : String, data : Bytes) -> Result[PixmapCacheDecodeResult, PixmapDecodeError]

    Return a cached pixmap or decode PNG bytes, reporting cache hits.

    PixmapCache::get_or_decode_rgba

    fn PixmapCache::get_or_decode_rgba(self : PixmapCache, key : String, width : Int, height : Int, data : Bytes) -> Result[Pixmap, PixmapDecodeError]

    Return a cached pixmap or decode raw RGBA bytes and cache the pixmap.

    PixmapCache::get_or_decode_rgba_result

    fn PixmapCache::get_or_decode_rgba_result(self : PixmapCache, key : String, width : Int, height : Int, data : Bytes) -> Result[PixmapCacheDecodeResult, PixmapDecodeError]

    Return a cached pixmap or decode raw RGBA bytes, reporting cache hits.

    PixmapCache::get_or_insert

    fn PixmapCache::get_or_insert(self : PixmapCache, key : String, pixmap : Pixmap) -> Pixmap

    Return a cached pixmap or insert this fallback pixmap on a miss.

    PixmapCache::get_or_insert_result

    fn PixmapCache::get_or_insert_result(self : PixmapCache, key : String, pixmap : Pixmap) -> PixmapCacheInsertResult

    Return a cached pixmap or insert this fallback pixmap, reporting cache hits.

    PixmapCache::insert

    fn PixmapCache::insert(self : PixmapCache, key : String, pixmap : Pixmap) -> Pixmap

    Insert or replace a pixmap under a caller-provided key.

    PixmapCache::is_capacity_bounded

    fn PixmapCache::is_capacity_bounded(self : PixmapCache) -> Bool

    Return whether the cache has a configured entry limit.

    PixmapCache::is_empty

    fn PixmapCache::is_empty(self : PixmapCache) -> Bool

    Return whether the cache currently has no pixmaps.

    PixmapCache::len

    fn PixmapCache::len(self : PixmapCache) -> Int

    Return the number of cached pixmaps.

    PixmapCache::new

    Create an empty pixmap cache.

    PixmapCache::remove

    fn PixmapCache::remove(self : PixmapCache, key : String) -> Unit

    Remove a cached pixmap by key.

    PixmapCache::with_capacity

    fn PixmapCache::with_capacity(capacity : Int) -> PixmapCache

    Create an empty pixmap cache with least-recently-used eviction.

    PixmapCacheDecodeResult

    pub struct PixmapCacheDecodeResult {
    pixmap : Pixmap
    did_decode : Bool
    } derive(
    Debug
    )

    Result of reading a pixmap from cache or decoding bytes on miss.

    PixmapCacheDecodeResult::did_decode

    fn PixmapCacheDecodeResult::did_decode(self : PixmapCacheDecodeResult) -> Bool

    Return whether this lookup decoded bytes instead of hitting cache.

    PixmapCacheDecodeResult::did_hit_cache

    fn PixmapCacheDecodeResult::did_hit_cache(self : PixmapCacheDecodeResult) -> Bool

    Return whether this lookup reused a cached pixmap.

    PixmapCacheDecodeResult::get_pixmap

    Get the resulting pixmap.

    PixmapCacheInsertResult

    pub struct PixmapCacheInsertResult {
    pixmap : Pixmap
    did_insert : Bool
    } derive(
    Debug
    )

    Result of reading a pixmap from cache or inserting it on miss.

    PixmapCacheInsertResult::did_hit_cache

    fn PixmapCacheInsertResult::did_hit_cache(self : PixmapCacheInsertResult) -> Bool

    Return whether this lookup reused a cached pixmap.

    PixmapCacheInsertResult::did_insert

    fn PixmapCacheInsertResult::did_insert(self : PixmapCacheInsertResult) -> Bool

    Return whether this lookup inserted a new pixmap instead of hitting cache.

    PixmapCacheInsertResult::get_pixmap

    Get the resulting pixmap.

    PixmapDecodeError

    pub(all) enum PixmapDecodeError {
    UnexpectedEndOfData(Int, Int, Int)
    InvalidRgbaDimensions(Int, Int)
    RgbaByteLengthMismatch(Int, Int)
    InvalidBmpSignature(Byte, Byte)
    UnsupportedBmpHeaderSize(Int)
    UnsupportedBmpColorPlanes(Int)
    UnsupportedBmpBitsPerPixel(Int)
    UnsupportedBmpCompression(Int)
    InvalidBmpDimensions(Int, Int)
    BmpPixelDataOutOfBounds(Int, Int, Int)
    InvalidPngSignature
    MissingPngImageHeader
    MissingPngImageData
    MissingPngImageEnd
    UnsupportedPngHeaderSize(Int)
    UnsupportedPngBitDepth(Int)
    UnsupportedPngColorType(Int)
    UnsupportedPngCompression(Int)
    UnsupportedPngFilter(Int)
    UnsupportedPngInterlace(Int)
    UnsupportedPngChunk(Int, Int, Int, Int)
    UnsupportedPngDeflateCompression(Int)
    UnsupportedPngDeflatePresetDictionary
    UnsupportedPngDeflateBlockType(Int)
    InvalidPngDeflateCode
    UnsupportedPngFilterType(Int)
    InvalidPngDimensions(Int, Int)
    InvalidPngZlibHeader(Int, Int)
    PngCrcMismatch(UInt, UInt)
    PngAdlerMismatch(UInt, UInt)
    PngStoredBlockLengthMismatch(Int, Int)
    PngInflateLengthMismatch(Int, Int)
    PngScanlineLengthMismatch(Int, Int)
    } derive(Eq,
    Debug
    )

    Error returned when decoding pixmap bytes.

    PixmapDecodeError::equal

    PixmapDecodeError::not_equal

    fn PixmapDecodeError::not_equal(x : PixmapDecodeError, y : PixmapDecodeError) -> Bool

    PixmapEncodeError

    pub(all) enum PixmapEncodeError {
    InvalidPngDimensions(Int, Int)
    } derive(Eq,
    Debug
    )

    Error returned when encoding pixmap bytes.

    PixmapEncodeError::equal

    PixmapEncodeError::not_equal

    fn PixmapEncodeError::not_equal(x : PixmapEncodeError, y : PixmapEncodeError) -> Bool

    PngDeflateBitReader

    type PngDeflateBitReader derive(
    Debug
    )

    PngDeflateHuffman

    type PngDeflateHuffman derive(
    Debug
    )

    PngDeflateHuffmanEntry

    type PngDeflateHuffmanEntry derive(
    Debug
    )

    PngDeflateTables

    type PngDeflateTables derive(
    Debug
    )

    PngHeader

    type PngHeader derive(
    Debug
    )

    PngInfo

    PngInfo::to_repr

    Point

    pub struct Point {
    x : Double
    y : Double
    } derive(Eq,
    Debug
    )

    2D point with floating point coordinates

    Point::equal

    fn Point::equal(Point, Point) -> Bool

    Point::new

    fn Point::new(x~ : Double, y~ : Double) -> Point

    Create a new point

    Point::not_equal

    fn Point::not_equal(x : Point, y : Point) -> Bool

    Point::to_repr

    PresentBatch

    pub struct PresentBatch {
    payloads : Array[PresentRectPayload]
    present_pixel_count : Int
    present_byte_count : Int
    } derive(
    Debug
    )

    A materialized batch of packed rectangle present payloads.

    PresentBatch::get_full_present_byte_savings

    fn PresentBatch::get_full_present_byte_savings(self : PresentBatch, width : Int, height : Int) -> Int

    Return how many packed RGBA bytes this batch avoids compared with presenting the full target surface.

    PresentBatch::get_full_present_pixel_savings

    fn PresentBatch::get_full_present_pixel_savings(self : PresentBatch, width : Int, height : Int) -> Int

    Return how many pixels this batch avoids compared with presenting the full target surface. Empty batches report no savings because they represent skip, not a partial present.

    PresentBatch::get_payloads

    fn PresentBatch::get_payloads(self : PresentBatch) -> Array[PresentRectPayload]

    PresentBatch::get_present_bounds

    fn PresentBatch::get_present_bounds(self : PresentBatch) -> PixelRect?

    PresentBatch::get_present_byte_count

    fn PresentBatch::get_present_byte_count(self : PresentBatch) -> Int

    PresentBatch::get_present_pixel_count

    fn PresentBatch::get_present_pixel_count(self : PresentBatch) -> Int

    PresentBatch::get_present_strategy

    fn PresentBatch::get_present_strategy(self : PresentBatch, width : Int, height : Int) -> DirtyPresentStrategy

    PresentBatch::get_rect_count

    fn PresentBatch::get_rect_count(self : PresentBatch) -> Int

    PresentBatch::get_source_byte_count

    fn PresentBatch::get_source_byte_count(self : PresentBatch) -> Int

    PresentBatch::get_source_padding_byte_count

    fn PresentBatch::get_source_padding_byte_count(self : PresentBatch) -> Int

    PresentBatch::is_empty

    fn PresentBatch::is_empty(self : PresentBatch) -> Bool

    PresentBatch::saves_full_present_pixels

    fn PresentBatch::saves_full_present_pixels(self : PresentBatch, width : Int, height : Int) -> Bool

    PresentBatch::submit_plan_for

    fn[S : Surface] PresentBatch::submit_plan_for(self : PresentBatch, surface : S) -> Result[PresentBatchSubmitPlan, PresentError]

    Build a validated dry-run submit plan for this packed batch without presenting any payloads to the surface.

    PresentBatch::submit_to

    fn[S : Surface] PresentBatch::submit_to(self : PresentBatch, surface : S) -> Result[Int, PresentError]

    PresentBatch::submit_to_result

    fn[S : Surface] PresentBatch::submit_to_result(self : PresentBatch, surface : S) -> Result[PresentBatchSubmitResult, PresentError]

    PresentBatch::validate_for

    fn[S : Surface] PresentBatch::validate_for(self : PresentBatch, surface : S) -> Result[Unit, PresentError]

    Validate every payload in this batch against a target surface before any present call mutates backend state.

    PresentBatchSubmitPlan

    pub struct PresentBatchSubmitPlan {
    batch : PresentBatch
    surface_width : Int
    surface_height : Int
    } derive(
    Debug
    )

    Validated dry-run plan for submitting a materialized present batch to a concrete surface.

    PresentBatchSubmitPlan::get_batch

    PresentBatchSubmitPlan::get_full_present_byte_savings

    fn PresentBatchSubmitPlan::get_full_present_byte_savings(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::get_full_present_pixel_savings

    fn PresentBatchSubmitPlan::get_full_present_pixel_savings(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::get_present_bounds

    fn PresentBatchSubmitPlan::get_present_bounds(self : PresentBatchSubmitPlan) -> PixelRect?

    PresentBatchSubmitPlan::get_present_byte_count

    fn PresentBatchSubmitPlan::get_present_byte_count(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::get_present_pixel_count

    fn PresentBatchSubmitPlan::get_present_pixel_count(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::get_present_strategy

    PresentBatchSubmitPlan::get_rect_count

    fn PresentBatchSubmitPlan::get_rect_count(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::get_source_byte_count

    fn PresentBatchSubmitPlan::get_source_byte_count(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::get_source_padding_byte_count

    fn PresentBatchSubmitPlan::get_source_padding_byte_count(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::get_surface_height

    fn PresentBatchSubmitPlan::get_surface_height(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::get_surface_width

    fn PresentBatchSubmitPlan::get_surface_width(self : PresentBatchSubmitPlan) -> Int

    PresentBatchSubmitPlan::needs_present

    fn PresentBatchSubmitPlan::needs_present(self : PresentBatchSubmitPlan) -> Bool

    PresentBatchSubmitPlan::saves_full_present_pixels

    fn PresentBatchSubmitPlan::saves_full_present_pixels(self : PresentBatchSubmitPlan) -> Bool

    PresentBatchSubmitPlan::submit_to

    fn[S : Surface] PresentBatchSubmitPlan::submit_to(self : PresentBatchSubmitPlan, surface : S) -> Result[Int, PresentError]

    Submit this prevalidated plan to a surface with the same dimensions.

    PresentBatchSubmitPlan::submit_to_result

    fn[S : Surface] PresentBatchSubmitPlan::submit_to_result(self : PresentBatchSubmitPlan, surface : S) -> Result[PresentBatchSubmitResult, PresentError]

    Submit this prevalidated plan and return lifecycle telemetry.

    The target surface must still match the dimensions captured by the dry-run plan, so stale resize-era plans fail before any backend present call.

    PresentBatchSubmitResult

    pub struct PresentBatchSubmitResult {
    submit_plan : PresentBatchSubmitPlan
    presented_rect_count : Int
    } derive(
    Debug
    )

    Result of submitting a materialized present batch to a concrete surface.

    PresentBatchSubmitResult::did_present

    fn PresentBatchSubmitResult::did_present(self : PresentBatchSubmitResult) -> Bool

    PresentBatchSubmitResult::get_batch

    PresentBatchSubmitResult::get_full_present_byte_savings

    fn PresentBatchSubmitResult::get_full_present_byte_savings(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_full_present_pixel_savings

    fn PresentBatchSubmitResult::get_full_present_pixel_savings(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_present_bounds

    PresentBatchSubmitResult::get_present_byte_count

    fn PresentBatchSubmitResult::get_present_byte_count(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_present_pixel_count

    fn PresentBatchSubmitResult::get_present_pixel_count(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_present_strategy

    PresentBatchSubmitResult::get_presented_rect_count

    fn PresentBatchSubmitResult::get_presented_rect_count(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_rect_count

    fn PresentBatchSubmitResult::get_rect_count(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_source_byte_count

    fn PresentBatchSubmitResult::get_source_byte_count(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_source_padding_byte_count

    fn PresentBatchSubmitResult::get_source_padding_byte_count(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_submit_plan

    PresentBatchSubmitResult::get_surface_height

    fn PresentBatchSubmitResult::get_surface_height(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::get_surface_width

    fn PresentBatchSubmitResult::get_surface_width(self : PresentBatchSubmitResult) -> Int

    PresentBatchSubmitResult::needs_present

    fn PresentBatchSubmitResult::needs_present(self : PresentBatchSubmitResult) -> Bool

    PresentBatchSubmitResult::saves_full_present_pixels

    fn PresentBatchSubmitResult::saves_full_present_pixels(self : PresentBatchSubmitResult) -> Bool

    PresentError

    pub(all) enum PresentError {
    InvalidDimensions(Int, Int)
    SizeMismatch(Int, Int, Int, Int)
    RectOutOfBounds(Int, Int, Int, Int, Int, Int)
    InvalidRowBytes(Int, Int)
    PixelBufferTooSmall(Int, Int)
    } derive(Eq,
    Debug
    )

    Error returned when presenting RGBA pixels to a surface fails.

    PresentError::equal

    PresentError::not_equal

    fn PresentError::not_equal(x : PresentError, y : PresentError) -> Bool

    PresentRectInfo

    pub(all) struct PresentRectInfo {
    required_row_bytes : Int
    required_len : Int
    } derive(Eq,
    Debug
    )

    Validated geometry for a rectangle present call. Backends can use this to share row-stride and buffer-size checks with the reference MemorySurface.

    PresentRectInfo::equal

    PresentRectInfo::not_equal

    fn PresentRectInfo::not_equal(x : PresentRectInfo, y : PresentRectInfo) -> Bool

    PresentRectInfo::required_len

    fn PresentRectInfo::required_len(self : PresentRectInfo) -> Int

    PresentRectInfo::required_row_bytes

    fn PresentRectInfo::required_row_bytes(self : PresentRectInfo) -> Int

    PresentRectPayload

    pub struct PresentRectPayload {
    rect : PixelRect
    row_bytes : Int
    pixels : FixedArray[Byte]
    } derive(
    Debug
    )

    Packed source pixels for one rectangle present operation.

    PresentRectPayload::get_pixels

    fn PresentRectPayload::get_pixels(self : PresentRectPayload) -> FixedArray[Byte]

    PresentRectPayload::get_present_byte_count

    fn PresentRectPayload::get_present_byte_count(self : PresentRectPayload) -> Int

    PresentRectPayload::get_present_pixel_count

    fn PresentRectPayload::get_present_pixel_count(self : PresentRectPayload) -> Int

    PresentRectPayload::get_rect

    PresentRectPayload::get_row_bytes

    fn PresentRectPayload::get_row_bytes(self : PresentRectPayload) -> Int

    PresentRectPayload::get_source_byte_count

    fn PresentRectPayload::get_source_byte_count(self : PresentRectPayload) -> Int

    PresentRectPayload::get_source_padding_byte_count

    fn PresentRectPayload::get_source_padding_byte_count(self : PresentRectPayload) -> Int

    PresentRectPayload::new

    fn PresentRectPayload::new(rect : PixelRect, row_bytes : Int, pixels : FixedArray[Byte]) -> Result[PresentRectPayload, PresentError]

    Build a validated rectangle present payload from caller-provided RGBA rows.

    PresentRectPayload::submit_to

    fn[S : Surface] PresentRectPayload::submit_to(self : PresentRectPayload, surface : S) -> Result[Unit, PresentError]

    Rect

    pub struct Rect {
    x : Double
    y : Double
    width : Double
    height : Double
    } derive(Eq,
    Debug
    )

    2D rectangle defined by origin and size

    Rect::bottom

    fn Rect::bottom(self : Rect) -> Double

    Get the bottom edge (y + height)

    Rect::contains

    fn Rect::contains(self : Rect, px : Double, py : Double) -> Bool

    Check if a point is inside the rectangle

    Rect::equal

    fn Rect::equal(Rect, Rect) -> Bool

    Rect::intersection

    fn Rect::intersection(self : Rect, other : Rect) -> Rect?

    Return the overlapping rectangle, if both rectangles overlap with area.

    Rect::is_empty

    fn Rect::is_empty(self : Rect) -> Bool

    Check whether this rectangle has no positive area.

    Rect::new

    fn Rect::new(x~ : Double, y~ : Double, width~ : Double, height~ : Double) -> Rect

    Create a rectangle

    Rect::not_equal

    fn Rect::not_equal(x : Rect, y : Rect) -> Bool

    Rect::right

    fn Rect::right(self : Rect) -> Double

    Get the right edge (x + width)

    Rect::to_repr

    RenderFrame

    pub struct RenderFrame {
    canvas : Canvas
    layer_tree : LayerTree
    dirty_rect_limit : Int
    } derive(
    Debug
    )

    A frame-sized drawing target with a z-ordered layer tree and a dirty-present policy. This is the small unit an event loop can submit to a Surface.

    RenderFrame::clear_dirty_regions

    fn RenderFrame::clear_dirty_regions(self : RenderFrame) -> Unit

    RenderFrame::dirty_bounds

    fn RenderFrame::dirty_bounds(self : RenderFrame) -> PixelRect?

    RenderFrame::dirty_present_batch

    fn[S : Surface] RenderFrame::dirty_present_batch(self : RenderFrame, surface : S) -> Result[PresentBatch, PresentError]

    RenderFrame::dirty_present_plan

    fn[S : Surface] RenderFrame::dirty_present_plan(self : RenderFrame, surface : S) -> DirtyPresentPlan

    RenderFrame::dirty_submit_plan

    fn[S : Surface] RenderFrame::dirty_submit_plan(self : RenderFrame, surface : S) -> DirtySubmitPlan

    RenderFrame::get_canvas

    fn RenderFrame::get_canvas(self : RenderFrame) -> Canvas

    RenderFrame::get_dirty_rect_limit

    fn RenderFrame::get_dirty_rect_limit(self : RenderFrame) -> Int

    RenderFrame::get_height

    fn RenderFrame::get_height(self : RenderFrame) -> Int

    RenderFrame::get_layer_tree

    fn RenderFrame::get_layer_tree(self : RenderFrame) -> LayerTree

    RenderFrame::get_width

    fn RenderFrame::get_width(self : RenderFrame) -> Int

    RenderFrame::has_dirty

    fn RenderFrame::has_dirty(self : RenderFrame) -> Bool

    RenderFrame::mark_all_dirty

    fn RenderFrame::mark_all_dirty(self : RenderFrame) -> Unit

    RenderFrame::mark_dirty_rect

    fn RenderFrame::mark_dirty_rect(self : RenderFrame, rect : PixelRect) -> Unit

    RenderFrame::new

    fn RenderFrame::new(width : Int, height : Int) -> RenderFrame

    RenderFrame::present_all_to

    fn[S : Surface] RenderFrame::present_all_to(self : RenderFrame, surface : S) -> Result[Int, PresentError]

    RenderFrame::present_dirty_to

    fn[S : Surface] RenderFrame::present_dirty_to(self : RenderFrame, surface : S) -> Result[Int, PresentError]

    RenderFrame::present_strategy

    fn[S : Surface] RenderFrame::present_strategy(self : RenderFrame, surface : S) -> DirtyPresentStrategy

    RenderFrame::redraw_schedule

    fn[S : Surface] RenderFrame::redraw_schedule(self : RenderFrame, surface : S) -> RenderFrameSchedule

    Dry-run a window redraw submission. Dirty frames reuse the regular schedule; clean frames are promoted to a full cached present so OS redraw requests can repaint without each event loop reimplementing that policy.

    RenderFrame::replace_layer

    fn RenderFrame::replace_layer(self : RenderFrame, layer_index : Int, layer : Layer) -> Layer?

    Replace one frame-owned layer and invalidate the old and new layer bounds.

    RenderFrame::replace_layers

    fn RenderFrame::replace_layers(self : RenderFrame, requests : Array[RenderFrameLayerReplacementRequest]) -> Bool

    Replace multiple frame-owned layers after validating every target index.

    RenderFrame::resize

    fn RenderFrame::resize(self : RenderFrame, width : Int, height : Int) -> RenderFrame

    RenderFrame::resize_and_clear_layer

    fn RenderFrame::resize_and_clear_layer(self : RenderFrame, layer_index : Int, width : Int, height : Int, color : Color) -> Bool

    Resize the frame and a layer-sized background cache, then clear that layer. Intended for GUI resize handlers that keep a full-frame background layer at a stable index while other layers are replaced or redrawn separately.

    RenderFrame::resize_and_clear_layers

    fn RenderFrame::resize_and_clear_layers(self : RenderFrame, width : Int, height : Int, requests : Array[RenderFrameLayerClearRequest]) -> Bool

    Resize the frame and multiple layer-sized caches, then clear each layer. This validates all requested layers before mutating frame or layer state.

    RenderFrame::resize_clear_and_replace_layers

    fn RenderFrame::resize_clear_and_replace_layers(self : RenderFrame, width : Int, height : Int, clear_requests : Array[RenderFrameLayerClearRequest], replacement_requests : Array[RenderFrameLayerReplacementRequest]) -> Bool

    Resize the frame, clear frame-sized layer caches, and replace redrawn layers. This validates every requested layer before mutating frame or layer state.

    RenderFrame::set_dirty_rect_limit

    fn RenderFrame::set_dirty_rect_limit(self : RenderFrame, limit : Int) -> RenderFrame

    RenderFrame::submit_by_strategy_plan

    fn[S : Surface] RenderFrame::submit_by_strategy_plan(self : RenderFrame, surface : S) -> RenderFrameSubmitPlan

    RenderFrame::submit_by_strategy_to

    fn[S : Surface] RenderFrame::submit_by_strategy_to(self : RenderFrame, surface : S) -> Result[RenderFrameSubmitResult, PresentError]

    RenderFrame::submit_dirty_to

    fn[S : Surface] RenderFrame::submit_dirty_to(self : RenderFrame, surface : S) -> Result[DirtySubmitResult, PresentError]

    RenderFrame::submit_redraw_to

    fn[S : Surface] RenderFrame::submit_redraw_to(self : RenderFrame, surface : S) -> Result[RenderFrameSubmitResult, PresentError]

    RenderFrame::submit_request_by_policy

    fn[S : Surface] RenderFrame::submit_request_by_policy(self : RenderFrame, surface : S, policy : RenderFrameSubmitPolicy) -> RenderFrameSubmitRequest

    RenderFrame::submit_request_to

    fn[S : Surface] RenderFrame::submit_request_to(self : RenderFrame, surface : S, request : RenderFrameSubmitRequest) -> Result[RenderFrameSubmitResult, PresentError]

    RenderFrame::submit_schedule

    fn[S : Surface] RenderFrame::submit_schedule(self : RenderFrame, surface : S) -> RenderFrameSchedule

    RenderFrame::submit_schedule_by_policy

    fn[S : Surface] RenderFrame::submit_schedule_by_policy(self : RenderFrame, surface : S, policy : RenderFrameSubmitPolicy) -> RenderFrameSchedule

    RenderFrame::submit_scheduled_to

    fn[S : Surface] RenderFrame::submit_scheduled_to(self : RenderFrame, surface : S, schedule : RenderFrameSchedule) -> Result[RenderFrameSubmitResult, PresentError]

    RenderFrame::submit_to_by_policy

    fn[S : Surface] RenderFrame::submit_to_by_policy(self : RenderFrame, surface : S, policy : RenderFrameSubmitPolicy) -> Result[RenderFrameSubmitResult, PresentError]

    RenderFrameLayerClearRequest

    pub struct RenderFrameLayerClearRequest {
    layer_index : Int
    color : Color
    } derive(Eq,
    Debug
    )

    Request to resize one frame-owned layer cache and clear it to a color.

    RenderFrameLayerClearRequest::get_color

    Return the clear color for the target layer.

    RenderFrameLayerClearRequest::get_layer_index

    Return the target layer index.

    RenderFrameLayerClearRequest::new

    fn RenderFrameLayerClearRequest::new(layer_index : Int, color : Color) -> RenderFrameLayerClearRequest

    Create a layer clear request for a RenderFrame resize lifecycle operation.

    RenderFrameLayerClearRequest::not_equal

    RenderFrameLayerReplacementRequest

    pub struct RenderFrameLayerReplacementRequest {
    layer_index : Int
    layer : Layer
    } derive(
    Debug
    )

    Request to replace one frame-owned layer cache.

    RenderFrameLayerReplacementRequest::get_layer

    Return the replacement layer.

    RenderFrameLayerReplacementRequest::get_layer_index

    Return the target layer index.

    RenderFrameLayerReplacementRequest::new

    Create a layer replacement request for a RenderFrame lifecycle operation.

    RenderFrameSchedule

    pub struct RenderFrameSchedule {
    submit_plan : RenderFrameSubmitPlan
    action : RenderFrameScheduleAction
    } derive(
    Debug
    )

    Dry-run scheduling decision for submitting a RenderFrame to a Surface.

    RenderFrameSchedule::get_action

    RenderFrameSchedule::get_dirty_bounds

    fn RenderFrameSchedule::get_dirty_bounds(self : RenderFrameSchedule) -> PixelRect?

    RenderFrameSchedule::get_present_bounds

    fn RenderFrameSchedule::get_present_bounds(self : RenderFrameSchedule) -> PixelRect?

    RenderFrameSchedule::get_present_byte_count

    fn RenderFrameSchedule::get_present_byte_count(self : RenderFrameSchedule) -> Int

    RenderFrameSchedule::get_present_pixel_count

    fn RenderFrameSchedule::get_present_pixel_count(self : RenderFrameSchedule) -> Int

    RenderFrameSchedule::get_present_rect_count

    fn RenderFrameSchedule::get_present_rect_count(self : RenderFrameSchedule) -> Int

    RenderFrameSchedule::get_present_strategy

    RenderFrameSchedule::get_state

    RenderFrameSchedule::get_submit_plan

    RenderFrameSchedule::has_dirty

    fn RenderFrameSchedule::has_dirty(self : RenderFrameSchedule) -> Bool

    RenderFrameSchedule::needs_present

    fn RenderFrameSchedule::needs_present(self : RenderFrameSchedule) -> Bool

    RenderFrameSchedule::saves_full_present_pixels

    fn RenderFrameSchedule::saves_full_present_pixels(self : RenderFrameSchedule) -> Bool

    RenderFrameSchedule::should_submit

    fn RenderFrameSchedule::should_submit(self : RenderFrameSchedule) -> Bool

    RenderFrameSchedule::uses_bounds_fallback

    fn RenderFrameSchedule::uses_bounds_fallback(self : RenderFrameSchedule) -> Bool

    RenderFrameSchedule::was_clipped_away

    fn RenderFrameSchedule::was_clipped_away(self : RenderFrameSchedule) -> Bool

    RenderFrameScheduleAction

    pub(all) enum RenderFrameScheduleAction {
    Skip
    SubmitWithoutPresent
    Present
    } derive(Eq,
    Debug
    )

    Event-loop-facing action selected from a dry-run RenderFrame submit plan.

    RenderFrameScheduleAction::equal

    RenderFrameScheduleAction::not_equal

    RenderFrameSubmitPlan

    pub struct RenderFrameSubmitPlan {
    dirty_submit_plan : DirtySubmitPlan
    strategy : DirtyPresentStrategy
    present_bounds : PixelRect?
    present_rect_count : Int
    present_pixel_count : Int
    present_byte_count : Int
    } derive(
    Debug
    )

    Strategy-aware dry-run plan for submitting a RenderFrame to a Surface.

    RenderFrameSubmitPlan::get_dirty_bounds

    fn RenderFrameSubmitPlan::get_dirty_bounds(self : RenderFrameSubmitPlan) -> PixelRect?

    RenderFrameSubmitPlan::get_dirty_submit_plan

    fn RenderFrameSubmitPlan::get_dirty_submit_plan(self : RenderFrameSubmitPlan) -> DirtySubmitPlan

    RenderFrameSubmitPlan::get_present_bounds

    fn RenderFrameSubmitPlan::get_present_bounds(self : RenderFrameSubmitPlan) -> PixelRect?

    RenderFrameSubmitPlan::get_present_byte_count

    fn RenderFrameSubmitPlan::get_present_byte_count(self : RenderFrameSubmitPlan) -> Int

    RenderFrameSubmitPlan::get_present_pixel_count

    fn RenderFrameSubmitPlan::get_present_pixel_count(self : RenderFrameSubmitPlan) -> Int

    RenderFrameSubmitPlan::get_present_rect_count

    fn RenderFrameSubmitPlan::get_present_rect_count(self : RenderFrameSubmitPlan) -> Int

    RenderFrameSubmitPlan::get_present_strategy

    RenderFrameSubmitPlan::get_state

    RenderFrameSubmitPlan::has_dirty

    fn RenderFrameSubmitPlan::has_dirty(self : RenderFrameSubmitPlan) -> Bool

    RenderFrameSubmitPlan::needs_present

    fn RenderFrameSubmitPlan::needs_present(self : RenderFrameSubmitPlan) -> Bool

    RenderFrameSubmitPlan::saves_full_present_pixels

    fn RenderFrameSubmitPlan::saves_full_present_pixels(self : RenderFrameSubmitPlan) -> Bool

    RenderFrameSubmitPlan::uses_bounds_fallback

    fn RenderFrameSubmitPlan::uses_bounds_fallback(self : RenderFrameSubmitPlan) -> Bool

    RenderFrameSubmitPlan::was_clipped_away

    fn RenderFrameSubmitPlan::was_clipped_away(self : RenderFrameSubmitPlan) -> Bool

    RenderFrameSubmitPolicy

    pub(all) enum RenderFrameSubmitPolicy {
    DirtyOnly
    CachedRedraw
    FullRedraw
    } derive(Eq,
    Debug
    )

    Event-loop-facing submit policy for choosing between dirty-only work, cached repaint requests, and unconditional full redraws.

    RenderFrameSubmitPolicy::equal

    RenderFrameSubmitPolicy::not_equal

    RenderFrameSubmitRequest

    pub struct RenderFrameSubmitRequest {
    policy : RenderFrameSubmitPolicy
    schedule : RenderFrameSchedule
    } derive(
    Debug
    )

    Policy intent paired with the dry-run schedule selected for one frame submit. Event loops can inspect this request, then execute the same precomputed decision without recomputing scheduling state.

    RenderFrameSubmitRequest::get_action

    RenderFrameSubmitRequest::get_dirty_bounds

    RenderFrameSubmitRequest::get_policy

    RenderFrameSubmitRequest::get_present_bounds

    RenderFrameSubmitRequest::get_present_byte_count

    fn RenderFrameSubmitRequest::get_present_byte_count(self : RenderFrameSubmitRequest) -> Int

    RenderFrameSubmitRequest::get_present_pixel_count

    fn RenderFrameSubmitRequest::get_present_pixel_count(self : RenderFrameSubmitRequest) -> Int

    RenderFrameSubmitRequest::get_present_rect_count

    fn RenderFrameSubmitRequest::get_present_rect_count(self : RenderFrameSubmitRequest) -> Int

    RenderFrameSubmitRequest::get_present_strategy

    RenderFrameSubmitRequest::get_schedule

    RenderFrameSubmitRequest::get_state

    RenderFrameSubmitRequest::get_submit_plan

    RenderFrameSubmitRequest::has_dirty

    RenderFrameSubmitRequest::needs_present

    fn RenderFrameSubmitRequest::needs_present(self : RenderFrameSubmitRequest) -> Bool

    RenderFrameSubmitRequest::new

    RenderFrameSubmitRequest::saves_full_present_pixels

    fn RenderFrameSubmitRequest::saves_full_present_pixels(self : RenderFrameSubmitRequest) -> Bool

    RenderFrameSubmitRequest::should_submit

    fn RenderFrameSubmitRequest::should_submit(self : RenderFrameSubmitRequest) -> Bool

    RenderFrameSubmitRequest::uses_bounds_fallback

    fn RenderFrameSubmitRequest::uses_bounds_fallback(self : RenderFrameSubmitRequest) -> Bool

    RenderFrameSubmitRequest::was_clipped_away

    fn RenderFrameSubmitRequest::was_clipped_away(self : RenderFrameSubmitRequest) -> Bool

    RenderFrameSubmitResult

    pub struct RenderFrameSubmitResult {
    submit_plan : RenderFrameSubmitPlan
    presented_rect_count : Int
    } derive(
    Debug
    )

    Result of submitting a RenderFrame through the strategy-aware scheduler.

    RenderFrameSubmitResult::did_present

    fn RenderFrameSubmitResult::did_present(self : RenderFrameSubmitResult) -> Bool

    RenderFrameSubmitResult::get_dirty_bounds

    RenderFrameSubmitResult::get_present_bounds

    fn RenderFrameSubmitResult::get_present_bounds(self : RenderFrameSubmitResult) -> PixelRect?

    RenderFrameSubmitResult::get_present_byte_count

    fn RenderFrameSubmitResult::get_present_byte_count(self : RenderFrameSubmitResult) -> Int

    RenderFrameSubmitResult::get_present_pixel_count

    fn RenderFrameSubmitResult::get_present_pixel_count(self : RenderFrameSubmitResult) -> Int

    RenderFrameSubmitResult::get_present_rect_count

    fn RenderFrameSubmitResult::get_present_rect_count(self : RenderFrameSubmitResult) -> Int

    RenderFrameSubmitResult::get_present_strategy

    RenderFrameSubmitResult::get_presented_rect_count

    fn RenderFrameSubmitResult::get_presented_rect_count(self : RenderFrameSubmitResult) -> Int

    RenderFrameSubmitResult::get_state

    RenderFrameSubmitResult::get_submit_plan

    RenderFrameSubmitResult::has_dirty

    fn RenderFrameSubmitResult::has_dirty(self : RenderFrameSubmitResult) -> Bool

    RenderFrameSubmitResult::needs_present

    fn RenderFrameSubmitResult::needs_present(self : RenderFrameSubmitResult) -> Bool

    RenderFrameSubmitResult::saves_full_present_pixels

    fn RenderFrameSubmitResult::saves_full_present_pixels(self : RenderFrameSubmitResult) -> Bool

    RenderFrameSubmitResult::uses_bounds_fallback

    fn RenderFrameSubmitResult::uses_bounds_fallback(self : RenderFrameSubmitResult) -> Bool

    RenderFrameSubmitResult::was_clipped_away

    fn RenderFrameSubmitResult::was_clipped_away(self : RenderFrameSubmitResult) -> Bool

    ScanlineRasterizer

    pub struct ScanlineRasterizer {
    width : Int
    height : Int
    pixels : FixedArray[Byte]
    }

    Scanline rasterizer for vector path filling

    ScanlineRasterizer::clear

    fn ScanlineRasterizer::clear(self : ScanlineRasterizer, color : Color) -> Unit

    Clear the buffer

    ScanlineRasterizer::draw_line

    fn ScanlineRasterizer::draw_line(self : ScanlineRasterizer, x0 : Int, y0 : Int, x1 : Int, y1 : Int, color : Color) -> Unit

    Draw a line using Bresenham's algorithm

    ScanlineRasterizer::fill_polygon

    fn ScanlineRasterizer::fill_polygon(self : ScanlineRasterizer, points : Array[(Double, Double)], color : Color) -> Unit

    Fill a convex polygon (works for any convex shape)

    ScanlineRasterizer::fill_triangle

    fn ScanlineRasterizer::fill_triangle(self : ScanlineRasterizer, x0 : Double, y0 : Double, x1 : Double, y1 : Double, x2 : Double, y2 : Double, color : Color) -> Unit

    Fill a triangle using scanline algorithm

    ScanlineRasterizer::get_pixels

    fn ScanlineRasterizer::get_pixels(self : ScanlineRasterizer) -> FixedArray[Byte]

    Get the pixel buffer (RGBA)

    ScanlineRasterizer::new

    fn ScanlineRasterizer::new(width : Int, height : Int) -> ScanlineRasterizer

    Create a new scanline rasterizer

    Size

    pub struct Size {
    width : Double
    height : Double
    } derive(Eq,
    Debug
    )

    2D size (width and height)

    Size::equal

    fn Size::equal(Size, Size) -> Bool

    Size::new

    fn Size::new(width~ : Double, height~ : Double) -> Size

    Size::not_equal

    fn Size::not_equal(x : Size, y : Size) -> Bool

    Size::to_repr

    StrokeCap

    pub(all) enum StrokeCap {
    Butt
    Round
    Square
    } derive(Eq,
    Debug
    )

    Stroke cap style

    StrokeCap::equal

    fn StrokeCap::equal(StrokeCap, StrokeCap) -> Bool

    StrokeCap::not_equal

    fn StrokeCap::not_equal(x : StrokeCap, y : StrokeCap) -> Bool

    StrokeEndpoint

    type StrokeEndpoint derive(
    Debug
    )

    StrokeJoin

    pub(all) enum StrokeJoin {
    Miter
    Round
    Bevel
    } derive(Eq,
    Debug
    )

    Stroke join style

    StrokeJoin::equal

    fn StrokeJoin::equal(StrokeJoin, StrokeJoin) -> Bool

    StrokeJoin::not_equal

    fn StrokeJoin::not_equal(x : StrokeJoin, y : StrokeJoin) -> Bool

    StrokeJoinPoint

    type StrokeJoinPoint derive(
    Debug
    )

    StrokePathData

    type StrokePathData derive(
    Debug
    )

    Transform

    pub struct Transform {
    a : Double
    b : Double
    c : Double
    d : Double
    tx : Double
    ty : Double
    } derive(Eq,
    Debug
    )

    2D affine transformation matrix | a b tx | | c d ty | | 0 0 1 |

    Transform::affine

    fn Transform::affine(a~ : Double, b~ : Double, c~ : Double, d~ : Double, tx~ : Double, ty~ : Double) -> Transform

    Create an arbitrary affine transform.

    Transform::apply

    fn Transform::apply(self : Transform, x : Double, y : Double) -> (Double, Double)

    Apply transform to a point

    Transform::equal

    fn Transform::equal(Transform, Transform) -> Bool

    Transform::identity

    fn Transform::identity() -> Transform

    Create an identity transform

    Transform::inverse

    fn Transform::inverse(self : Transform) -> Transform?

    Return the inverse transform if this matrix is invertible.

    Transform::multiply

    fn Transform::multiply(self : Transform, other : Transform) -> Transform

    Multiply two transforms

    Transform::not_equal

    fn Transform::not_equal(x : Transform, y : Transform) -> Bool

    Transform::rotate

    fn Transform::rotate(angle : Double) -> Transform

    Create a rotation transform (angle in radians)

    Transform::scale

    fn Transform::scale(sx~ : Double, sy~ : Double) -> Transform

    Create a scale transform

    Transform::translate

    fn Transform::translate(tx~ : Double, ty~ : Double) -> Transform

    Create a translation transform

    Vec2

    pub struct Vec2 {
    x : Double
    y : Double
    } derive(Eq,
    Debug
    )

    2D vector (same as Point but semantically different)

    Vec2::equal

    fn Vec2::equal(Vec2, Vec2) -> Bool

    Vec2::new

    fn Vec2::new(x~ : Double, y~ : Double) -> Vec2

    Vec2::not_equal

    fn Vec2::not_equal(x : Vec2, y : Vec2) -> Bool

    Vec2::to_repr

    present_pixels

    fn[S : Surface] present_pixels(surface : S, width : Int, height : Int, row_bytes : Int, pixels : FixedArray[Byte]) -> Result[Unit, PresentError]

    present_pixels_rect

    fn[S : Surface] present_pixels_rect(surface : S, x : Int, y : Int, width : Int, height : Int, row_bytes : Int, pixels : FixedArray[Byte]) -> Result[Unit, PresentError]

    validate_present_rect

    fn validate_present_rect(surface_width : Int, surface_height : Int, x : Int, y : Int, width : Int, height : Int, row_bytes : Int, pixels : FixedArray[Byte]) -> Result[PresentRectInfo, PresentError]