ailoy-web
    Preparing search index...

    Type Alias PartImage

    PartImage:
        | {
            colorspace: PartImageColorspace;
            data: Bytes;
            height: number;
            type: "binary";
            width: number;
        }
        | { type: "url"; url: string }

    Represents the image data contained in a [Part].

    PartImage provides structured access to image data. Currently, it only implments "binary" types.

    Example

    let part = Part::image_binary(640, 480, \"rgb\", (0..640*480*3).map(|i| (i % 255) as u8)).unwrap();

    if let Some(img) = part.as_image() {
    assert_eq!(img.height(), 640);
    assert_eq!(img.width(), 480);
    }