/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{isPowerOfTwo as e}from"../../core/mathUtils.js";import{WorkerHandle as t}from"../../core/workers/WorkerHandle.js";function r(t,r){let s=r.width,o=r.height;return(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(s=t.width,o=t.height),(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof Uint8Array)&&(6408===r.pixelFormat||6407===r.pixelFormat)&&e(s)&&e(o)&&s>=16&&o>=16}class s extends t{constructor(e){super("TextureCompressionWorker","compress",{compress:e=>[e.data]},e)}async destroyWorkerAndSelf(){await this.broadcast({},"destroy"),this.destroy()}isCompressible(e,t){return r(e,t)}}export{s as TextureCompressionWorkerHandle,r as isCompressible};
