Decode with ExtraSamples
These samples are normal bits in the encoded (e.g. compressed) stream of each tile or row of the image. However, when considering the photometric interpretation of an image these samples should be discarded. They are only relevant for multiband. For the most part we previously rejected these images due to a mismatch between sample count and the color as indicated by the interpretation. Only, for alpha we never really verified if the extra channel is indeed alpha or something unrelated. We don't have a perfect solution as GeoTiff motivates us having a MultiBand pseudo-color output configuration that has no related photometric interpretation and borrows the usual gray tone instead. We can only really distinguish this from a gray-alpha image through looking at the values of the ExtraSamples vector. Then again we do not yet support GrayAlpha anyways. As a simplification for the discarding process we only support full-byte extra samples and require all samples to be the same bit-depth, not only those which we return. This is blessed by Tiff's recommendations for baseline decoding as well as libtiff.
This commit is contained in:
1 parent
eb6275547d
commit
8517bb81db
10 files changed
+243
-21
No files matched your search
@@ -235,6 +235,7 @@ const TEST_IMAGE_DIR: &str = "./tests/images/";
|
||||
|
||||
macro_rules! test_roundtrip {
|
||||
($name:ident, $buffer:ident, $buffer_ty:ty) => {
|
||||
#[track_caller]
|
||||
fn $name<C: colortype::ColorType<Inner = $buffer_ty>>(
|
||||
file: &str,
|
||||
expected_type: ColorType,
|
||||
|
||||
Reference in new issue
Block a user