MoonBit image: simple image representation.
Dependencies
// 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.20260309 (f21b520 2026-03-09) ~/.moon/bin/moon
moonc v0.8.3+cd28f524e (2026-03-09) ~/.moon/bin/moonc
moonrun 0.1.20260309 (f21b520 2026-03-09) ~/.moon/bin/moonrun
moon-pilot 0.0.1-df92511 (2026-03-09) ~/.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
}type SizeErrorpub(all) struct Point {
x : Int
y : Int
}pub(all) struct YCbCr {
y : Slice[Byte]
cb : Slice[Byte]
cr : Slice[Byte]
y_stride : Int
c_stride : Int
subsampling : YCbCrSubsampling
rect : Rectangle
}pub(all) enum YCbCrSubsampling {
YCbCrSubsampling444
YCbCrSubsampling422
YCbCrSubsampling420
YCbCrSubsampling440
YCbCrSubsampling411
YCbCrSubsampling410
}impl Eq for YCbCrSubsamplingimpl Show for YCbCrSubsamplingfn add2_non_neg(x : Int, y : Int) -> Intfn mul3_non_neg(x : Int, y : Int, z : Int) -> IntMoonBit image: simple image representation.
Dependencies