numcodecs_wasm_ebcc

Classes:

  • Ebcc

    Codec providing compression using EBCC.

Ebcc

Ebcc(residual, _version='0.1.0', base_cr=100.0, error=None)

Codec providing compression using EBCC.

EBCC combines JPEG2000 compression with error-bounded residual compression.

Arrays that are higher-dimensional than 3D are encoded by compressing each 3D slice with EBCC independently. Specifically, the array's shape is interpreted as [.., depth, height, width]. If you want to compress 3D slices along three different axes, you can swizzle the array axes beforehand.

Parameters:
  • residual (...) –
    • "jpeg2000-only": No residual compression - base JPEG2000 only

    • "absolute": Residual compression with absolute maximum error bound

    • "relative": Residual compression with relative error bound

  • _version (..., default: = "0.1.0" ) –

    The codec's encoding format version. Do not provide this parameter explicitly.

  • base_cr (..., default: = 100.0 ) –

    JPEG2000 positive base compression ratio

  • error (..., default: None ) –

Methods:

  • decode

    Decode the data in buf.

  • encode

    Encode the data in buf.

  • from_config

    Instantiate the codec from a configuration dict.

  • get_config

    Returns the configuration of the codec.

codec_id class-attribute instance-attribute

codec_id = 'ebcc.rs'

decode

decode(buf, out=None)

Decode the data in buf.

Parameters:
  • buf (Buffer) –

    Encoded data. May be any object supporting the new-style buffer protocol.

  • out (Buffer, default: None ) –

    Writeable buffer to store decoded data. N.B. if provided, this buffer must be exactly the right size to store the decoded data.

Returns:
  • dec( Buffer ) –

    Decoded data. May be any object supporting the new-style buffer protocol.

encode

encode(buf)

Encode the data in buf.

Parameters:
  • buf (Buffer) –

    Data to be encoded. May be any object supporting the new-style buffer protocol.

Returns:
  • enc( Buffer ) –

    Encoded data. May be any object supporting the new-style buffer protocol.

from_config classmethod

from_config(config)

Instantiate the codec from a configuration dict.

Parameters:
  • config (dict) –

    Configuration of the codec.

Returns:
  • codec( Self ) –

    Instantiated codec.

get_config

get_config()

Returns the configuration of the codec.

numcodecs.registry.get_codec(config) can be used to reconstruct this codec from the returned config.

Returns:
  • config( dict ) –

    Configuration of the codec.