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.20250704 (608fa55 2025-07-04) ~/.moon/bin/moon
moonc v0.6.20 ~/.moon/bin/moonc
moonrun 0.1.20250704 (608fa55 2025-07-04) ~/.moon/bin/moonrunpub(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
}pub(all) struct Point {
x : Int
y : Int
}type SizeErrorfn add2_non_neg(x : Int, y : Int) -> Intfn mul3_non_neg(x : Int, y : Int, z : Int) -> Int