Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/image/shared/scratch"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
mem |
core/mem |
scratch.dodo |
pixels |
std/image/pixels |
scratch.dodo |
ptr |
core/ptr |
scratch.dodo |
slice |
core/slice |
scratch.dodo |
ALIGN_SLACK
Constant · Source
Padding one typed view may skip to align its first element.
pub const ALIGN_SLACK: usize = 8
size
Function · Source
Bytes for
countelements ofelementbytes, padding included.
pub fn size(count: usize, element: usize) -> usize!pixels.Error
add
Function · Source
Sum two sizes, or TooLarge.
pub fn add(a: usize, b: usize) -> usize!pixels.Error
split
Function · Source
The first
lengthbytes and the rest, as independent views.
pub fn split(bytes: &mut[u8], length: usize) -> slice.SplitMut<u8>!pixels.Error from(bytes)
u16s
Function · Source
pub fn u16s(bytes: &mut[u8]) -> &mut[u16] from(bytes)
i16s
Function · Source
pub fn i16s(bytes: &mut[u8]) -> &mut[i16] from(bytes)
u32s
Function · Source
pub fn u32s(bytes: &mut[u8]) -> &mut[u32] from(bytes)
i32s
Function · Source
pub fn i32s(bytes: &mut[u8]) -> &mut[i32] from(bytes)
f32s
Function · Source
pub fn f32s(bytes: &mut[u8]) -> &mut[f32] from(bytes)