class XpraImageDecoder{async convertToBitmap(packet){var data,options,bitmap_options,width=packet[4],height=packet[5],coding=packet[6];return height=coding.startsWith("rgb")?(data=decode_rgb(packet),await createImageBitmap(new ImageData(new Uint8ClampedArray(data.buffer),width,height),0,0,width,height)):(data=coding.split("/")[0],bitmap_options={premultiplyAlpha:"none"},"scaled_size"in(options=packet[10])&&(bitmap_options.resizeWidth=width,bitmap_options.resizeHeight=height,bitmap_options.resizeQuality=options["scaling-quality"]||"medium"),width=new Blob([packet[7].buffer],{type:"image/"+data}),await createImageBitmap(width,bitmap_options)),packet[6]="bitmap:"+coding,packet[7]=height,packet}}