OpenRaster layered document editing and compositing in MoonBit
moon update
moon check --target all --deny-warn
moon test --target js --deny-warn
python scripts/serve_web.pylet image = @ora.Image::new(1, 1, [255, 0, 0, 255])
let layer = @ora.Node::Layer(@ora.Properties::new("Red"), image)
let document = @ora.Document::new(1, 1, [layer])
let archive = document.write()
let reopened = @ora.read(archive)
let png = reopened.render().encode_png()moon run cmd/main --target js -- inspect drawing.ora
moon run cmd/main --target js -- render drawing.ora composite.png
moon run cmd/main --target js -- edit drawing.ora changed.ora edits.json[{"path":[0,0],"name":"Moved layer","x":20,"y":10,"visible":true,"opacity":0.5,"composite_op":"svg:src-over"}]python scripts/check_interop.py
python scripts/check_acceptance.py
python scripts/check_consistency.py
python scripts/check_plus.py
python scripts/build_web.py
node scripts/check_bridge.mjs
node scripts/check_editor.mjs
node scripts/check_samples.mjs
python scripts/check_sample_pixels.py
python scripts/check_artwork.py
python scripts/check_krita.py
python scripts/check_package.pypub(all) suberror OraError {
InvalidDocument(String)
Unsupported(String)
}pub struct Document {
width : Int
height : Int
name : String
// private fields
}fn Document::set_properties(self : Document, path : Array[Int], properties : Properties) -> Document raisepub struct Image {
width : Int
height : Int
// private fields
}pub struct Properties {
name : String
x : Int
y : Int
visible : Bool
opacity : Double
composite_op : String
// private fields
}fn Properties::new(name : String, x? : Int, y? : Int, visible? : Bool, opacity? : Double, composite_op? : String) -> Properties raise OraError