struct AlignedBuf
pub struct AlignedBuf {
}用途
AlignedBuf 上下文或状态结构体。
公开字段
此类型没有公开字段。
#bytes/aligned标准库包 `#bytes/aligned`。
struct AlignedBufpub struct AlignedBuf {
}AlignedBuf 上下文或状态结构体。
此类型没有公开字段。
struct PlaneLayoutpub struct PlaneLayout {
pub offset int
pub len int
pub stride int
pub width int
pub height int
}承载 offset、len、stride、width、height 等属性的结构体。
offset intlen intstride intwidth intheight intstruct Split2pub struct Split2 {
pub left PlaneLayout
pub right PlaneLayout
}承载 left、right 等属性的结构体。
left PlaneLayoutright PlaneLayoutstruct Yuv420Layoutpub struct Yuv420Layout {
pub y PlaneLayout
pub u PlaneLayout
pub v PlaneLayout
pub total_bytes int
}承载 y、u、v、total_bytes 等属性的结构体。
y PlaneLayoutu PlaneLayoutv PlaneLayouttotal_bytes intstruct Nv12Layoutpub struct Nv12Layout {
pub y PlaneLayout
pub uv PlaneLayout
pub total_bytes int
}承载 y、uv、total_bytes 等属性的结构体。
y PlaneLayoutuv PlaneLayouttotal_bytes intalign_uppub fn align_up(n int, align int) int执行 align up 操作。
n intalign intint — 该类型的值
allocpub fn alloc(size int, align int) AlignedBuf执行 alloc 处理。失败时抛出错误,调用方需处理或继续传播。
size intalign intAlignedBuf — 该类型的值
yuv420_layoutpub fn yuv420_layout(width int, height int, row_align int) Yuv420Layout执行 yuv420 layout 操作。失败时抛出错误,调用方需处理或继续传播。
width intheight introw_align intYuv420Layout — 该类型的值
nv12_layoutpub fn nv12_layout(width int, height int, row_align int) Nv12Layout执行 nv12 layout 操作。失败时抛出错误,调用方需处理或继续传播。
width intheight introw_align intNv12Layout — 该类型的值
(&AlignedBuf) lenpub fn (b &AlignedBuf) len() int&AlignedBuf 上的操作:返回长度。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。int — 该类型的值
(&AlignedBuf) alignmentpub fn (b &AlignedBuf) alignment() int在 &AlignedBuf 上执行 alignment 操作。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。int — 该类型的值
(&AlignedBuf) is_alignedpub fn (b &AlignedBuf) is_aligned(align int) bool&AlignedBuf 上的操作:判断是否 aligned。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。align intbool — 是否成立
(&AlignedBuf) split_atpub fn (b &AlignedBuf) split_at(mid int) Split2&AlignedBuf 上的操作:执行 split at 操作。失败时抛出错误,调用方需处理或继续传播。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。mid intSplit2 — 该类型的值
($&AlignedBuf) zeropub fn (b $&AlignedBuf) zero() int$&AlignedBuf 上的操作:全零。失败时抛出错误,调用方需处理或继续传播。
b $&AlignedBufAlignedBuf 实例;以独占借用传入,方法可修改它,调用方仍持有实例。int — 该类型的值
(&AlignedBuf) byte_atpub fn (b &AlignedBuf) byte_at(off int) u8&AlignedBuf 上的操作:执行 byte at 操作。失败时抛出错误,调用方需处理或继续传播。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。off intu8 — 该类型的值
($&AlignedBuf) set_bytepub fn (b $&AlignedBuf) set_byte(off int, v u8) int$&AlignedBuf 上的操作:设置 byte。失败时抛出错误,调用方需处理或继续传播。
b $&AlignedBufAlignedBuf 实例;以独占借用传入,方法可修改它,调用方仍持有实例。off intv u8int — 该类型的值
($&AlignedBuf) copy_from_bytespub fn (b $&AlignedBuf) copy_from_bytes(off int, src &[]u8, src_off int, n int) int$&AlignedBuf 上的操作:拷贝从字节。失败时抛出错误,调用方需处理或继续传播。
b $&AlignedBufAlignedBuf 实例;以独占借用传入,方法可修改它,调用方仍持有实例。off intsrc &[]u8src_off intn intint — 该类型的值
(&AlignedBuf) copy_to_bytespub fn (b &AlignedBuf) copy_to_bytes(off int, dst $&[]u8, dst_off int, n int) int&AlignedBuf 上的操作:拷贝到字节。失败时抛出错误,调用方需处理或继续传播。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。off intdst $&[]u8dst_off intn intint — 该类型的值
($&AlignedBuf) copy_from_stringpub fn (b $&AlignedBuf) copy_from_string(off int, src &string) int$&AlignedBuf 上的操作:拷贝从字符串。失败时抛出错误,调用方需处理或继续传播。
b $&AlignedBufAlignedBuf 实例;以独占借用传入,方法可修改它,调用方仍持有实例。off intsrc &stringint — 该类型的值
(&AlignedBuf) write_to_filepub fn (b &AlignedBuf) write_to_file(dst &os.File, off int, n int) int&AlignedBuf 上的操作:写入到文件。失败时抛出错误,调用方需处理或继续传播。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。dst &os.Fileoff intn intint — 该类型的值
(&AlignedBuf) as_spanpub fn (b &AlignedBuf) as_span() span.ByteSpan&AlignedBuf 上的操作:执行 as span 操作。失败时抛出错误,调用方需处理或继续传播。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。span.ByteSpan — 该类型的值
($&AlignedBuf) as_span_mutpub fn (b $&AlignedBuf) as_span_mut() span.MutByteSpan$&AlignedBuf 上的操作:执行 as span mut 操作。失败时抛出错误,调用方需处理或继续传播。
b $&AlignedBufAlignedBuf 实例;以独占借用传入,方法可修改它,调用方仍持有实例。span.MutByteSpan — 该类型的值
(&AlignedBuf) plane_viewpub fn (b &AlignedBuf) plane_view(pl &PlaneLayout, bpp int) span.PlaneView&AlignedBuf 上的操作:执行 plane view 操作。失败时抛出错误,调用方需处理或继续传播。
b &AlignedBufAlignedBuf 实例;以只读借用传入,调用方仍持有实例。pl &PlaneLayoutbpp intspan.PlaneView — 该类型的值
($&AlignedBuf) plane_view_mutpub fn (b $&AlignedBuf) plane_view_mut(pl &PlaneLayout, bpp int) span.MutPlaneView$&AlignedBuf 上的操作:执行 plane view mut 操作。失败时抛出错误,调用方需处理或继续传播。
b $&AlignedBufAlignedBuf 实例;以独占借用传入,方法可修改它,调用方仍持有实例。pl &PlaneLayoutbpp intspan.MutPlaneView — 该类型的值
($&AlignedBuf) closepub fn (b $&AlignedBuf) close() int$&AlignedBuf 上的操作:关闭资源。
b $&AlignedBufAlignedBuf 实例;以独占借用传入,方法可修改它,调用方仍持有实例。int — 该类型的值