MoonBit bindings for Skia
Dependencies
let surface = try! @skia.Surface(width=640, height=360)
defer surface.dispose()
let paint = @skia.Paint()
defer paint.dispose()
let typeface = try! @skia.Typeface::default()
defer typeface.dispose()
let font = try! @skia.Font(typeface, size=32.0)
defer font.dispose()
surface.canvas().draw_text(b"MoonBit + Skia", x=48.0, y=96.0, font, paint)
try! surface.write_png(b"out.png")pub(all) suberror SkiaError {
InvalidPixelBufferSize(width~ : Int, height~ : Int)
InvalidSurfaceSize(width~ : Int, height~ : Int)
TypefaceCreateFailed
FontCreateFailed
PathParseSvgFailed
SurfaceReadPixelsFailed
SurfaceCreateFailed(width~ : Int, height~ : Int)
WritePngFailed(status~ : Int)
} derive(Eq, Debug)pub struct Canvas {
// private fields
}pub struct Color {
a : Byte
r : Byte
g : Byte
b : Byte
}pub struct Font {
// private fields
}pub struct Paint {
// private fields
}pub struct Path {
// private fields
}pub struct PixelBuffer {
data : Bytes
width : Int
height : Int
row_bytes : Int
}pub struct Rect {
left : Float
top : Float
right : Float
bottom : Float
}pub struct Surface {
// private fields
}MoonBit bindings for Skia
Dependencies