1use async_trait::async_trait;
4
5use crate::error::Result;
6use crate::types::GpuTexture;
7
8#[derive(Clone, Debug)]
10pub struct ModelMetadata {
11 pub name: String,
12 pub scale: u32,
13 pub input_name: String,
14 pub output_name: String,
15 pub input_channels: u32,
16 pub min_input_hw: (u32, u32),
17 pub max_input_hw: (u32, u32),
18}
19
20#[async_trait]
22pub trait UpscaleBackend: Send + Sync {
23 async fn initialize(&self) -> Result<()>;
24 async fn process(&self, input: GpuTexture) -> Result<GpuTexture>;
25 async fn shutdown(&self) -> Result<()>;
26 fn metadata(&self) -> Result<&ModelMetadata>;
27}