Blyx Nest Blyx language
Registry / Framework
framework · v0.1.0

Hoopoe

Plan a thumbnail and check the decoded pixel buffer against a byte budget.

Source repository · Package JSON

Use Hoopoe

use vendor::hoopoe::hoopoe;

Run the example

nest demo hoopoe@0.1.0
blyxc native-run hoopoe-demo/main.blyx
Example source and expected output
use vendor::hoopoe::hoopoe;

fn main() {
    let width = 400.0;
    let height = 200.0;
    let box_w = 100.0;
    let box_h = 100.0;
    let channels = 3.0;
    let align = 4.0;
    let memory = 14000.0;
    let result = hoopoe_thumbnail(width, height, box_w, box_h, channels, align, memory);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

100
50
300
15000
0

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP977d385cad8454d6797f2a50d73bfa29a72287e3a0911f79b90155fed6adc265f3e3fee3bd