Skip to main content

IMAGE_FRAME

Constant IMAGE_FRAME 

Source
pub const IMAGE_FRAME: &str = "type ImageFrame { pixels: Tensor[u8]; }";
Expand description

Decoded byte pixels with an explicit channel axis.

Pixels have shape [height, width, channels], with 1, 3 or 4 channels for Gray, RGB or RGBA. Construction uses the SDK Image validator. Channel order follows the last axis; this value contains no encoded file or device handle.

§Declaration

type ImageFrame { pixels: Tensor[u8]; }

§Fields and methods

  • pixels: Packed u8 pixels; height and width are positive and channels is 1, 3 or 4.

§Construct ImageFrame

Inspect the typed payload and metadata.

let image = ImageFrame { pixels: tensor[u8]([255, 0, 0, 255], [1, 1, 4])? };
print(image.pixels.shape());