Package gov.nih.mipav.model.file
Enum libxl.JxlDecoderStatus
- All Implemented Interfaces:
Serializable,Comparable<libxl.JxlDecoderStatus>,java.lang.constant.Constable
- Enclosing class:
libxl
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionInformative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": Basic information such as image dimensions and extra channels.Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": The header of a box of the container format (BMFF) is decoded.The box being decoded is now complete.The box contents output buffer is too small.Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": Color encoding or ICC profile from the codestream header.An error occurred, for example invalid input file or out of memory.Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": Beginning of a frame.Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": a progressive step in decoding the frame is reached.Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": full frame (or layer, in case coalescing is disabled) is decoded.The JPEG reconstruction buffer is too small for reconstructed JPEG codestream to fit.Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": JPEG reconstruction data decoded.The decoder requests an output buffer to store the full resolution image, which can be set with @ref JxlDecoderSetImageOutBuffer or with @ref JxlDecoderSetImageOutCallback.The decoder needs more input bytes to continue.The decoder is able to decode a preview image and requests setting a preview output buffer using @ref JxlDecoderSetPreviewOutBuffer.Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": Preview image, a small frame, decoded.Function call finished successfully, or decoding is finished and there is nothing more to be done. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic libxl.JxlDecoderStatusReturns the enum constant of this type with the specified name.static libxl.JxlDecoderStatus[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
JXL_DEC_SUCCESS
Function call finished successfully, or decoding is finished and there is nothing more to be done. Note that @ref JxlDecoderProcessInput will return ::JXL_DEC_SUCCESS if all events that were registered with @ref JxlDecoderSubscribeEvents were processed, even before the end of the JPEG XL codestream. In this case, the return value @ref JxlDecoderReleaseInput will be the same as it was at the last signaled event. E.g. if ::JXL_DEC_FULL_IMAGE was subscribed to, then all bytes from the end of the JPEG XL codestream (including possible boxes needed for jpeg reconstruction) will be returned as unprocessed. -
JXL_DEC_ERROR
An error occurred, for example invalid input file or out of memory. TODO(lode): add function to get error information from decoder. -
JXL_DEC_NEED_MORE_INPUT
The decoder needs more input bytes to continue. Before the next @ref JxlDecoderProcessInput call, more input data must be set, by calling @ref JxlDecoderReleaseInput (if input was set previously) and then calling @ref JxlDecoderSetInput. @ref JxlDecoderReleaseInput returns how many bytes are not yet processed, before a next call to @ref JxlDecoderProcessInput all unprocessed bytes must be provided again (the address need not match, but the contents must), and more bytes must be concatenated after the unprocessed bytes. In most cases, @ref JxlDecoderReleaseInput will return no unprocessed bytes at this event, the only exceptions are if the previously set input ended within (a) the raw codestream signature, (b) the signature box, (c) a box header, or (d) the first 4 bytes of a `brob`, `ftyp`, or `jxlp` box. In any of these cases the number of unprocessed bytes is less than 20. -
JXL_DEC_NEED_PREVIEW_OUT_BUFFER
The decoder is able to decode a preview image and requests setting a preview output buffer using @ref JxlDecoderSetPreviewOutBuffer. This occurs if ::JXL_DEC_PREVIEW_IMAGE is requested and it is possible to decode a preview image from the codestream and the preview out buffer was not yet set. There is maximum one preview image in a codestream. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the frame header (including ToC) of the preview frame as unprocessed. -
JXL_DEC_NEED_IMAGE_OUT_BUFFER
The decoder requests an output buffer to store the full resolution image, which can be set with @ref JxlDecoderSetImageOutBuffer or with @ref JxlDecoderSetImageOutCallback. This event re-occurs for new frames if there are multiple animation frames and requires setting an output again. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the frame header (including ToC) as unprocessed. -
JXL_DEC_JPEG_NEED_MORE_OUTPUT
The JPEG reconstruction buffer is too small for reconstructed JPEG codestream to fit. @ref JxlDecoderSetJPEGBuffer must be called again to make room for remaining bytes. This event may occur multiple times after ::JXL_DEC_JPEG_RECONSTRUCTION. -
JXL_DEC_BOX_NEED_MORE_OUTPUT
The box contents output buffer is too small. @ref JxlDecoderSetBoxBuffer must be called again to make room for remaining bytes. This event may occur multiple times after ::JXL_DEC_BOX. -
JXL_DEC_BASIC_INFO
Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": Basic information such as image dimensions and extra channels. This event occurs max once per image. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the basic info as unprocessed (including the last byte of basic info if it did not end on a byte boundary). -
JXL_DEC_COLOR_ENCODING
Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": Color encoding or ICC profile from the codestream header. This event occurs max once per image and always later than ::JXL_DEC_BASIC_INFO and earlier than any pixel data. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the image header (which is the start of the first frame) as unprocessed. -
JXL_DEC_PREVIEW_IMAGE
Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": Preview image, a small frame, decoded. This event can only happen if the image has a preview frame encoded. This event occurs max once for the codestream and always later than @ref JXL_DEC_COLOR_ENCODING and before ::JXL_DEC_FRAME. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the preview frame as unprocessed. -
JXL_DEC_FRAME
Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": Beginning of a frame. @ref JxlDecoderGetFrameHeader can be used at this point. A note on frames: a JPEG XL image can have internal frames that are not intended to be displayed (e.g. used for compositing a final frame), but this only returns displayed frames, unless @ref JxlDecoderSetCoalescing was set to @ref JXL_FALSE "JXL_FALSE": in that case, the individual layers are returned, without blending. Note that even when coalescing is disabled, only frames of type kRegularFrame are returned; frames of type kReferenceOnly and kLfFrame are always for internal purposes only and cannot be accessed. A displayed frame either has an animation duration or is the only or last frame in the image. This event occurs max once per displayed frame, always later than ::JXL_DEC_COLOR_ENCODING, and always earlier than any pixel data. While JPEG XL supports encoding a single frame as the composition of multiple internal sub-frames also called frames, this event is not indicated for the internal frames. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the frame header (including ToC) as unprocessed. -
JXL_DEC_FULL_IMAGE
Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": full frame (or layer, in case coalescing is disabled) is decoded. @ref JxlDecoderSetImageOutBuffer must be used after getting the basic image information to be able to get the image pixels, if not this return status only indicates we're past this point in the codestream. This event occurs max once per frame. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the frame (or if ::JXL_DEC_JPEG_RECONSTRUCTION is subscribed to, from the end of the last box that is needed for jpeg reconstruction) as unprocessed. -
JXL_DEC_JPEG_RECONSTRUCTION
Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": JPEG reconstruction data decoded. @ref JxlDecoderSetJPEGBuffer may be used to set a JPEG reconstruction buffer after getting the JPEG reconstruction data. If a JPEG reconstruction buffer is set a byte stream identical to the JPEG codestream used to encode the image will be written to the JPEG reconstruction buffer instead of pixels to the image out buffer. This event occurs max once per image and always before ::JXL_DEC_FULL_IMAGE. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the `jbrd` box as unprocessed. -
JXL_DEC_BOX
Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": The header of a box of the container format (BMFF) is decoded. The following API functions related to boxes can be used after this event: - @ref JxlDecoderSetBoxBuffer and @ref JxlDecoderReleaseBoxBuffer "JxlDecoderReleaseBoxBuffer": set and release a buffer to get the box data. - @ref JxlDecoderGetBoxType get the 4-character box typename. - @ref JxlDecoderGetBoxSizeRaw get the size of the box as it appears in the container file, not decompressed. - @ref JxlDecoderSetDecompressBoxes to configure whether to get the box data decompressed, or possibly compressed. Boxes can be compressed. This is so when their box type is "brob". In that case, they have an underlying decompressed box type and decompressed data. @ref JxlDecoderSetDecompressBoxes allows configuring which data to get. Decompressing requires Brotli. @ref JxlDecoderGetBoxType has a flag to get the compressed box type, which can be "brob", or the decompressed box type. If a box is not compressed (its compressed type is not "brob"), then the output decompressed box type and data is independent of what setting is configured. The buffer set with @ref JxlDecoderSetBoxBuffer must be set again for each next box to be obtained, or can be left unset to skip outputting this box. The output buffer contains the full box data when the ::JXL_DEC_BOX_COMPLETE (if subscribed to) or subsequent ::JXL_DEC_SUCCESS or ::JXL_DEC_BOX event occurs. ::JXL_DEC_BOX occurs for all boxes, including non-metadata boxes such as the signature box or codestream boxes. To check whether the box is a metadata type for respectively EXIF, XMP or JUMBF, use @ref JxlDecoderGetBoxType and check for types "Exif", "xml " and "jumb" respectively. In this case, @ref JxlDecoderReleaseInput will return all bytes from the start of the box header as unprocessed. -
JXL_DEC_FRAME_PROGRESSION
Informative event by @ref JxlDecoderProcessInput "JxlDecoderProcessInput": a progressive step in decoding the frame is reached. When calling @ref JxlDecoderFlushImage at this point, the flushed image will correspond exactly to this point in decoding, and not yet contain partial results (such as partially more fine detail) of a next step. By default, this event will trigger maximum once per frame, when a 8x8th resolution (DC) image is ready (the image data is still returned at full resolution, giving upscaled DC). Use @ref JxlDecoderSetProgressiveDetail to configure more fine-grainedness. The event is not guaranteed to trigger, not all images have progressive steps or DC encoded. In this case, @ref JxlDecoderReleaseInput will return all bytes from the end of the section that was needed to produce this progressive event as unprocessed. -
JXL_DEC_BOX_COMPLETE
The box being decoded is now complete. This is only emitted if a buffer was set for the box.
-
-
Field Details
-
numVal
private final int numVal
-
-
Constructor Details
-
JxlDecoderStatus
private JxlDecoderStatus(int numVal)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getNumVal
public int getNumVal()
-