/* tslint:disable */
/* eslint-disable */

/**
 * Compute up to `budget` more seams; returns how many are known so far.
 */
export function sc_carve(budget: number): number;

/**
 * The energy map as a grey image (brighter = more important).
 */
export function sc_energy_image(): Uint8Array;

/**
 * Load an image. `vertical` carves rows instead of columns (changes the height).
 * `mask` has one value per pixel: 1 = protect, -1 = remove first, 0 = normal (empty = none).
 */
export function sc_load(rgba: Uint8Array, w: number, h: number, vertical: boolean, mask: Int8Array): void;

/**
 * The number of seams that will be computed (half the carved dimension).
 */
export function sc_max_seams(): number;

/**
 * The original image with the first `k` seams painted red.
 */
export function sc_overlay(k: number): Uint8Array;

/**
 * The image with `k` seams removed (k > 0) or `-k` seams inserted (k < 0), as RGBA in the
 * original orientation. Its size is (w − k) × h, or w × (h − k) when carving vertically.
 * `k` is limited to the seams computed so far.
 */
export function sc_render(k: number): Uint8Array;

/**
 * Seams needed to remove every pixel marked "remove" (0 if there are none); only
 * meaningful once all seams are computed. Returns u32::MAX if some marked pixel survives
 * all computed seams.
 */
export function sc_seams_to_clear_mask(): number;

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
    readonly memory: WebAssembly.Memory;
    readonly sc_carve: (a: number) => number;
    readonly sc_energy_image: () => [number, number];
    readonly sc_load: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
    readonly sc_max_seams: () => number;
    readonly sc_overlay: (a: number) => [number, number];
    readonly sc_render: (a: number) => [number, number];
    readonly sc_seams_to_clear_mask: () => number;
    readonly __wbindgen_externrefs: WebAssembly.Table;
    readonly __wbindgen_free: (a: number, b: number, c: number) => void;
    readonly __wbindgen_malloc: (a: number, b: number) => number;
    readonly __externref_table_dealloc: (a: number) => void;
    readonly __wbindgen_start: () => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;

/**
 * Instantiates the given `module`, which can either be bytes or
 * a precompiled `WebAssembly.Module`.
 *
 * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
 *
 * @returns {InitOutput}
 */
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;

/**
 * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
 * for everything else, calls `WebAssembly.instantiate` directly.
 *
 * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
 *
 * @returns {Promise<InitOutput>}
 */
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
