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.20260330 (c527f57 2026-03-30) ~/.moon/bin/moon
moonc v0.8.4+4d98d95d4 (2026-03-30) ~/.moon/bin/moonc
moonrun 0.1.20260330 (c527f57 2026-03-30) ~/.moon/bin/moonrun
moon-pilot 0.0.1-df92511 (2026-03-30) ~/.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
as_ycbcr(Self) -> YCbCr?
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 YCbCr {
y : Slice[Byte]
cb : Slice[Byte]
cr : Slice[Byte]
y_stride : Int
c_stride : Int
subsampling : YCbCrSubsampling
rect : Rectangle
}fn add2_non_neg(x : Int, y : Int) -> Intfn mul3_non_neg(x : Int, y : Int, z : Int) -> Int