Class: Pool

pool~Pool(size, worker)

Pool for workers to decode chunks of the images.

Constructor

new Pool(size, worker)

Parameters:
Name Type Description
size Number

The size of the pool. Defaults to the number of CPUs available. When this parameter is null or 0, then the decoding will be done in the main thread.

worker Worker

The decoder worker, loaded and initialised. Enables loading the worker using worker-loader(or others) externally when using this library as a webpack dependency.

Source:

Methods

(async) decode(buffer) → {Promise.<ArrayBuffer>}

Decode the given block of bytes with the set compression method.

Parameters:
Name Type Description
buffer ArrayBuffer

the array buffer of bytes to decode.

Source:
Returns:

the decoded result as a Promise

Type
Promise.<ArrayBuffer>