rullino
    Preparing search index...

    Function uploadSrgb8

    • Uploads 8-bit straight-alpha sRGB pixels (ImageData layout, e.g. from a decoder) into a working texture, decoding on the GPU like importImage. Unlike uploadImage(ctx, decodeSrgb8(...)) no colour maths runs on the CPU (half a second at 12 MP), and unlike importImage it needs no browser image type, so it works on Dawn in Node too.

      Parameters

      • ctx: GpuContext
      • data: Uint8ClampedArray<ArrayBufferLike> | Uint8Array<ArrayBufferLike>
      • width: number
      • height: number

      Returns GPUTexture