#![deny(clippy::all)]
#![allow(dead_code)]

use liquid_rescale_task::LiquidRescaleTask;
use napi::{
    bindgen_prelude::{AbortSignal, AsyncTask, Buffer},
    Result,
};
use napi_derive::napi;

mod liquid_rescale_task;

#[napi]
pub fn liquid_rescale(
    input_image: Buffer,
    output_width: Option<u32>,
    output_height: Option<u32>,
    signal: Option<AbortSignal>,
) -> Result<AsyncTask<LiquidRescaleTask>> {
    let task = LiquidRescaleTask::new(
        input_image,
        output_width.unwrap_or(200) as usize,
        output_height.unwrap_or(400) as usize,
    );
    Ok(AsyncTask::with_optional_signal(task, signal))
}
