public enum PatchJPEGLS extends Enum<PatchJPEGLS>
This enum contains different options to use with a PatchJPEGLSImageInputStream
or PatchJPEGLSImageOutputStream
to both patch faulty JPEG-LS streams created by JAI-ImageIO to make them readable
by standard-compliant decoders and to make correct JPEG-LS streams (created by other encoders) readable by
JAI-ImageIO.
Enum Constant and Description |
---|
ISO2JAI
Amend default JPEG-LS Coding parameters (for streams that do not contain them yet).
|
ISO2JAI_IF_APP_OR_COM
Amend default JPEG-LS Coding parameters (for streams that do not contain them yet), but only if the stream
contains APPn or COM segments - so it was certainly not created by JAI-ImageIO.
|
JAI2ISO
Amend JPEG-LS Coding parameters actually used by JAI-ImageIO.
|
JAI2ISO_IF_NO_APP_OR_COM
Amend JPEG-LS Coding parameters actually used by JAI-ImageIO, but only if the stream does NOT contain APPn or
COM segments and is therefore more likely to have been actually created by JAI-ImageIO.
|
Modifier and Type | Method and Description |
---|---|
JPEGLSCodingParam |
createJPEGLSCodingParam(byte[] jpeg) |
static PatchJPEGLS |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PatchJPEGLS[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PatchJPEGLS JAI2ISO
Used to patch faulty JPEG-LS streams created by JAI-ImageIO CLibImageWriter, so the resulting JPEG-LS stream can be decoded by JPEG-LS compliant decoders.
Warning: Patching a correct JPEG-LS (not created by JAI-ImageIO) with this option is likely to corrupt it (if it has more than 12 bits per pixel and uses default coding parameters, i.e. doesn't contain an LSE segment). Use JAI2ISO_IF_NO_APP_OR_COM to prevent this problem in some cases.
public static final PatchJPEGLS JAI2ISO_IF_NO_APP_OR_COM
This option can be used, if you are not 100% sure whether the stream has actually been created by JAI-ImageIO and you want to decrease the likeliness of corrupting a correct stream by incorrectly patching it. It will prevent patching streams of some correct encoders (e.g. Agfa/Pegasus) that add APPn or COM segments. But as some correct encoders (e.g. dcmtk in the current version 3.6.0) also do not create APPn or COM segments, this option might still patch a correct stream and thereby make it corrupt.
public static final PatchJPEGLS ISO2JAI
Used to patch correct JPEG-LS streams, so they can be decompressed by the faulty JAI-ImageIO CLibImageReader. The resulting stream will still be correct JPEG-LS and can also be decoded by other decoders.
Warning: Patching faulty JPEG-LS streams created by JAI-ImageIO with this option will make them corrupt (i.e. unreadable by both JAI-ImageIO and standard-compliant decoders).
public static final PatchJPEGLS ISO2JAI_IF_APP_OR_COM
This option can be used to prevent adding those default parameters to faulty streams created by JAI-ImageIO which would make them unreadable for both JAI-ImageIO and standard-compliant decoders. On the other hand some correct encoders (e.g. dcmtk 3.6.0) also do not add APPn or COM segments and will therefore not be patched, which prevents them from getting decompressed correctly with JAI-ImageIO, if this option is used. (Use the ISO2JAI option for reading such streams with JAI-ImageIO.)
public static PatchJPEGLS[] values()
for (PatchJPEGLS c : PatchJPEGLS.values()) System.out.println(c);
public static PatchJPEGLS valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic JPEGLSCodingParam createJPEGLSCodingParam(byte[] jpeg)
Copyright © 2017 dcm4che.org. All rights reserved.