MoonBit image: simple image representation.
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.$ moon version --all
moon 0.1.20251202 (1a59800 2025-12-02) ~/.moon/bin/moon
moonc v0.6.33+b989ba000 (2025-12-02) ~/.moon/bin/moonc
moonrun 0.1.20251202 (1a59800 2025-12-02) ~/.moon/bin/moonrun
moon-pilot 0.0.1-df92511 (2025-12-02) ~/.moon/bin/moon-pilotpub(open) trait Image {
color_model(Self) -> &Model
bounds(Self) -> Rectangle
at(Self, Int, Int) -> &Color
opaque_(Self) -> Bool
set(Self, Int, Int, &Color) -> Unit
sub_image(Self, Rectangle) -> &Image
raw_data(Self) -> Slice[Byte]
get_bytes_per_pixel(Self) -> Int
get_stride(Self) -> Int
pix_offset(Self, Int, Int) -> Int
color_index_at(Self, Int, Int) -> Byte
}type SizeErrorpub(all) struct Point {
x : Int
y : Int
}fn add2_non_neg(x : Int, y : Int) -> Intfn mul3_non_neg(x : Int, y : Int, z : Int) -> Int