Zarr.NET  0.8.0
Zarr reader and writer in .NET
Loading...
Searching...
No Matches
ZarrNET.TransposeCodec Class Referencesealed

Zarr v3 transpose array-to-array codec. It permutes a decoded full-chunk buffer before it reaches the bytes codec, or reverses that permutation while decoding. More...

Inheritance diagram for ZarrNET.TransposeCodec:
ZarrNET.IZarrCodec

Public Member Functions

 TransposeCodec (int[] order, int[] inputShape, int elementSize)
 
Task< byte[]> EncodeAsync (byte[] input, CancellationToken ct=default)
 Encodes bytes for the next codec step.
 
Task< byte[]> DecodeAsync (byte[] input, CancellationToken ct=default)
 Decodes bytes produced by the previous codec step.
 
- Public Member Functions inherited from ZarrNET.IZarrCodec

Properties

string Name [get]
 Codec name as it appears in zarr.json (e.g. "gzip", "zstd", "bytes").
 
- Properties inherited from ZarrNET.IZarrCodec

Detailed Description

Zarr v3 transpose array-to-array codec. It permutes a decoded full-chunk buffer before it reaches the bytes codec, or reverses that permutation while decoding.

Constructor & Destructor Documentation

◆ TransposeCodec()

ZarrNET.TransposeCodec.TransposeCodec ( int[] order,
int[] inputShape,
int elementSize )
18 {
19 ArgumentNullException.ThrowIfNull(order);
20 ArgumentNullException.ThrowIfNull(inputShape);
21 if (order.Length != inputShape.Length || order.Order().Distinct().Count() != order.Length ||
22 order.Any(axis => axis < 0 || axis >= inputShape.Length))
23 throw new ArgumentException("Transpose order must be a permutation of every chunk axis.", nameof(order));
24 if (inputShape.Any(size => size <= 0))
25 throw new ArgumentOutOfRangeException(nameof(inputShape), "Chunk dimensions must be positive.");
26 if (elementSize <= 0) throw new ArgumentOutOfRangeException(nameof(elementSize));
27
28 _order = order.ToArray();
29 _inputShape = inputShape.ToArray();
30 _outputShape = order.Select(axis => inputShape[axis]).ToArray();
31 _elementSize = elementSize;
32 }

Member Function Documentation

◆ DecodeAsync()

Task< byte[]> ZarrNET.TransposeCodec.DecodeAsync ( byte[] input,
CancellationToken ct = default )

Decodes bytes produced by the previous codec step.

Implements ZarrNET.IZarrCodec.

◆ EncodeAsync()

Task< byte[]> ZarrNET.TransposeCodec.EncodeAsync ( byte[] input,
CancellationToken ct = default )

Encodes bytes for the next codec step.

Implements ZarrNET.IZarrCodec.

Property Documentation

◆ Name

string ZarrNET.TransposeCodec.Name
get

Codec name as it appears in zarr.json (e.g. "gzip", "zstd", "bytes").

Implements ZarrNET.IZarrCodec.


The documentation for this class was generated from the following file: