Skip to content
Merged
10 changes: 10 additions & 0 deletions src/main/java/dev/zarr/zarrjava/v3/codec/CodecBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ public CodecBuilder withTranspose(int[] order) {
return this;
}

public CodecBuilder withScaleOffset(Object offset, Object scale) {
codecs.add(new ScaleOffsetCodec(new ScaleOffsetCodec.Configuration(offset, scale)));
return this;
}

public CodecBuilder withScaleOffset() {
codecs.add(new ScaleOffsetCodec(null));
return this;
}

public CodecBuilder withCastValue(CastValueCodec.Configuration configuration) {
codecs.add(new CastValueCodec(configuration));
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class CodecRegistry {
addType("zstd", ZstdCodec.class);
addType("crc32c", Crc32cCodec.class);
addType("sharding_indexed", ShardingIndexedCodec.class);
addType("scale_offset", ScaleOffsetCodec.class);
}

public static void addType(String name, Class<? extends Codec> codecClass) {
Expand Down
Loading
Loading