import { image } from "@kit.ImageKit";

/**
 * 抠图页ViewModel
 */
export class CuteViewModel {
  private pixelMap: image.PixelMap | null = null;

  setProcessedPixelMap(pm: image.PixelMap) {
    this.pixelMap = pm;
  }

  getProcessedPixelMap(): image.PixelMap | null {
    return this.pixelMap;
  }

  release() {
    if (this.pixelMap) {
      this.pixelMap.release();
      this.pixelMap = null;
    }
  }
}

const cuteViewModel = new CuteViewModel();

export default cuteViewModel;