From f3fd5476b2f761056a9811af82d0e6c5c48fe333 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Tue, 18 Jul 2023 12:53:00 -0500 Subject: [PATCH] Add CodecOptions.disableChromaSubsampling Companion to https://github.com/ome/ome-codecs/pull/29 --- .../formats-api/src/loci/formats/codec/CodecOptions.java | 9 +++++++++ .../formats-bsd/src/loci/formats/codec/WrappedCodec.java | 1 + 2 files changed, 10 insertions(+) diff --git a/components/formats-api/src/loci/formats/codec/CodecOptions.java b/components/formats-api/src/loci/formats/codec/CodecOptions.java index ada5ff7fd7b..fef1fdfd4a0 100644 --- a/components/formats-api/src/loci/formats/codec/CodecOptions.java +++ b/components/formats-api/src/loci/formats/codec/CodecOptions.java @@ -117,6 +117,13 @@ public class CodecOptions { */ public boolean ycbcr; + /** + * Whether or not to use chroma subsampling. + * Only used when creating an image (WRITE). + * Default is false (use chroma subsampling). + */ + public boolean disableChromaSubsampling; + // -- Constructors -- /** Construct a new CodecOptions. */ @@ -142,6 +149,7 @@ public CodecOptions(CodecOptions options) { this.tileGridXOffset = options.tileGridXOffset; this.tileGridYOffset = options.tileGridYOffset; this.ycbcr = options.ycbcr; + this.disableChromaSubsampling = options.disableChromaSubsampling; } } @@ -154,6 +162,7 @@ public static CodecOptions getDefaultOptions() { options.interleaved = false; options.lossless = true; options.ycbcr = false; + options.disableChromaSubsampling = false; return options; } diff --git a/components/formats-bsd/src/loci/formats/codec/WrappedCodec.java b/components/formats-bsd/src/loci/formats/codec/WrappedCodec.java index 5c1293043f1..40208aac382 100644 --- a/components/formats-bsd/src/loci/formats/codec/WrappedCodec.java +++ b/components/formats-bsd/src/loci/formats/codec/WrappedCodec.java @@ -156,6 +156,7 @@ private static void copyOptions(CodecOptions src, ome.codecs.CodecOptions dest) dest.tileGridXOffset = src.tileGridXOffset; dest.tileGridYOffset = src.tileGridYOffset; dest.ycbcr = src.ycbcr; + dest.disableChromaSubsampling = src.disableChromaSubsampling; } protected static ome.codecs.CodecOptions getOptions(CodecOptions options)