struct AlignedBuf
pub struct AlignedBuf {
}Purpose
AlignedBuf context or state structure.
Public fields
This type has no public fields.
#bytes/alignedAligned zero-copy owned byte buffer and disjoint multi-plane descriptors (for SIMD 64-byte alignment, page-aligned DMA/IOSurface/DirectIO buffers, and YUV420/NV12 multi-plane frame layouts).
struct AlignedBufpub struct AlignedBuf {
}AlignedBuf context or state structure.
This type has no public fields.
struct PlaneLayoutpub struct PlaneLayout {
pub offset int
pub len int
pub stride int
pub width int
pub height int
}Disjoint sub-region descriptor inside an AlignedBuf (byte offset/length + stride).
offset intlen intstride intwidth intheight intstruct Split2pub struct Split2 {
pub left PlaneLayout
pub right PlaneLayout
}Structure encapsulating left, right.
left PlaneLayoutright PlaneLayoutstruct Yuv420Layoutpub struct Yuv420Layout {
pub y PlaneLayout
pub u PlaneLayout
pub v PlaneLayout
pub total_bytes int
}Structure encapsulating y, u, v, total_bytes.
y PlaneLayoutu PlaneLayoutv PlaneLayouttotal_bytes intstruct Nv12Layoutpub struct Nv12Layout {
pub y PlaneLayout
pub uv PlaneLayout
pub total_bytes int
}Structure encapsulating y, uv, total_bytes.
y PlaneLayoutuv PlaneLayouttotal_bytes intalign_uppub fn align_up(n int, align int) intAlign up.
n intalign intint — a value of this type
allocpub fn alloc(size int, align int) AlignedBufAllocate size zeroed bytes aligned to align (power of two >= 8). Throws on failure; handle the error or propagate it to the caller.
size intalign intAlignedBuf — a value of this type
yuv420_layoutpub fn yuv420_layout(width int, height int, row_align int) Yuv420LayoutCompute disjoint 3-plane YUV420 layout with aligned row strides and plane bases. Throws on failure; handle the error or propagate it to the caller.
width intheight introw_align intYuv420Layout — a value of this type
nv12_layoutpub fn nv12_layout(width int, height int, row_align int) Nv12LayoutCompute disjoint 2-plane NV12 layout (Y plane + interleaved UV plane). Throws on failure; handle the error or propagate it to the caller.
width intheight introw_align intNv12Layout — a value of this type
(&AlignedBuf) lenpub fn (b &AlignedBuf) len() intOperation on &AlignedBuf: return the length.
b &AlignedBufAlignedBuf instance used by this call (borrow).int — a value of this type
(&AlignedBuf) alignmentpub fn (b &AlignedBuf) alignment() intExecute alignment on &AlignedBuf.
b &AlignedBufAlignedBuf instance used by this call (borrow).int — a value of this type
(&AlignedBuf) is_alignedpub fn (b &AlignedBuf) is_aligned(align int) boolOperation on &AlignedBuf: whether it is aligned.
b &AlignedBufAlignedBuf instance used by this call (borrow).align intbool — true or false
(&AlignedBuf) split_atpub fn (b &AlignedBuf) split_at(mid int) Split2Operation on &AlignedBuf: split at. Throws on failure; handle the error or propagate it to the caller.
b &AlignedBufAlignedBuf instance used by this call (borrow).mid intSplit2 — a value of this type
($&AlignedBuf) zeropub fn (b $&AlignedBuf) zero() intOperation on $&AlignedBuf: zero. Throws on failure; handle the error or propagate it to the caller.
b $&AlignedBufAlignedBuf instance used by this call (exclusive borrow).int — a value of this type
(&AlignedBuf) byte_atpub fn (b &AlignedBuf) byte_at(off int) u8Operation on &AlignedBuf: byte at. Throws on failure; handle the error or propagate it to the caller.
b &AlignedBufAlignedBuf instance used by this call (borrow).off intu8 — a value of this type
($&AlignedBuf) set_bytepub fn (b $&AlignedBuf) set_byte(off int, v u8) intOperation on $&AlignedBuf: set byte. Throws on failure; handle the error or propagate it to the caller.
b $&AlignedBufAlignedBuf instance used by this call (exclusive borrow).off intv u8int — a value of this type
($&AlignedBuf) copy_from_bytespub fn (b $&AlignedBuf) copy_from_bytes(off int, src &[]u8, src_off int, n int) intOperation on $&AlignedBuf: copy from bytes. Throws on failure; handle the error or propagate it to the caller.
b $&AlignedBufAlignedBuf instance used by this call (exclusive borrow).off intsrc &[]u8src_off intn intint — a value of this type
(&AlignedBuf) copy_to_bytespub fn (b &AlignedBuf) copy_to_bytes(off int, dst $&[]u8, dst_off int, n int) intOperation on &AlignedBuf: copy to bytes. Throws on failure; handle the error or propagate it to the caller.
b &AlignedBufAlignedBuf instance used by this call (borrow).off intdst $&[]u8dst_off intn intint — a value of this type
($&AlignedBuf) copy_from_stringpub fn (b $&AlignedBuf) copy_from_string(off int, src &string) intOperation on $&AlignedBuf: copy from string. Throws on failure; handle the error or propagate it to the caller.
b $&AlignedBufAlignedBuf instance used by this call (exclusive borrow).off intsrc &stringint — a value of this type
(&AlignedBuf) write_to_filepub fn (b &AlignedBuf) write_to_file(dst &os.File, off int, n int) intOperation on &AlignedBuf: write to file. Throws on failure; handle the error or propagate it to the caller.
b &AlignedBufAlignedBuf instance used by this call (borrow).dst &os.Fileoff intn intint — a value of this type
(&AlignedBuf) as_spanpub fn (b &AlignedBuf) as_span() span.ByteSpanOperation on &AlignedBuf: as span. Throws on failure; handle the error or propagate it to the caller.
b &AlignedBufAlignedBuf instance used by this call (borrow).span.ByteSpan — a value of this type
($&AlignedBuf) as_span_mutpub fn (b $&AlignedBuf) as_span_mut() span.MutByteSpanOperation on $&AlignedBuf: as span mut. Throws on failure; handle the error or propagate it to the caller.
b $&AlignedBufAlignedBuf instance used by this call (exclusive borrow).span.MutByteSpan — a value of this type
(&AlignedBuf) plane_viewpub fn (b &AlignedBuf) plane_view(pl &PlaneLayout, bpp int) span.PlaneViewOperation on &AlignedBuf: plane view. Throws on failure; handle the error or propagate it to the caller.
b &AlignedBufAlignedBuf instance used by this call (borrow).pl &PlaneLayoutbpp intspan.PlaneView — a value of this type
($&AlignedBuf) plane_view_mutpub fn (b $&AlignedBuf) plane_view_mut(pl &PlaneLayout, bpp int) span.MutPlaneViewOperation on $&AlignedBuf: plane view mut. Throws on failure; handle the error or propagate it to the caller.
b $&AlignedBufAlignedBuf instance used by this call (exclusive borrow).pl &PlaneLayoutbpp intspan.MutPlaneView — a value of this type
($&AlignedBuf) closepub fn (b $&AlignedBuf) close() intOperation on $&AlignedBuf: close the resource.
b $&AlignedBufAlignedBuf instance used by this call (exclusive borrow).int — a value of this type