Package gov.nih.mipav.model.file
Class libxl
java.lang.Object
gov.nih.mipav.model.file.libxl
JPEG XL image format reference implementation ported from C++ to Java by William Gandler
Copyright (c) the JPEG XL Project Authors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
JPEG XL was standardized in 2022 as [ISO/IEC 18181](https://jpeg.org/jpegxl/workplan.html).
The [core codestream](doc/format_overview.md#codestream-features) is specified in 18181-1,
the [file format](doc/format_overview.md#file-format-features) in 18181-2.
[Decoder conformance](https://github.com/libjxl/conformance) is defined in 18181-3,
and 18181-4 is the [reference software](https://github.com/libjxl/libjxl).
## License
This software is available under a 3-clause BSD license which can be found in
the [LICENSE](LICENSE) file, with an "Additional IP Rights Grant" as outlined in
the [PATENTS](PATENTS) file.
Please note that the PATENTS file only mentions Google since Google is the legal
entity receiving the Contributor License Agreements (CLA) from all contributors
to the JPEG XL Project, including the initial main contributors to the JPEG XL
format: Cloudinary and Google.
## Additional documentation
### Codec description
[JPEG XL Format Overview](doc/format_overview.md)
[Introductory paper](https://www.spiedigitallibrary.org/proceedings/Download?fullDOI=10.1117%2F12.2529237) (open-access)
[XL Overview](doc/xl_overview.md) - a brief introduction to the source code modules
[JPEG XL white paper](https://ds.jpeg.org/whitepapers/jpeg-xl-whitepaper.pdf)
[JPEG XL official website](https://jpeg.org/jpegxl)
[JPEG XL community website](https://jpegxl.info)
### Development process
[More information on testing/build options](doc/building_and_testing.md)
[Git guide for JPEG XL](doc/developing_in_github.md) - for developers
[Fuzzing](doc/fuzzing.md) - for developers
[Building Web Assembly artifacts](doc/building_wasm.md)
[Test coverage on Codecov.io](https://app.codecov.io/gh/libjxl/libjxl) - for
developers
[libjxl documentation on readthedocs.io](https://libjxl.readthedocs.io/)
The development of jpegli, the improved JPEG encoder and decoder, will continue at https://github.com/google/jpegli
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classInformation for a single extra channel.(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) static enum(package private) static enum(package private) classThe codestream animation header, optionally present in the beginning of the codestream, and if it is it applies to all animation frames, unlike @ref JxlFrameHeader which applies to an individual frame.(package private) classBasic image information.(package private) classData type for describing the interpretation of the input and output buffers in terms of the range of allowed input and output pixel values.(package private) static enumSettings for the interpretation of UINT input and output buffers.(package private) classThe information about blending the color channels or a single extra channel.(package private) static enumFrame blend modes.(package private) classThis struct provides callback functions to pass pixel data in a streaming manner instead of requiring the entire frame data in memory at once.(package private) class(package private) classColor encoding of the image as structured information.(package private) classRepresents an input or output colorspace to a color transform, as a serialized ICC profile.(package private) static enumDefines which color profile to get: the profile from the codestream metadata header, which represents the color profile of the original image, or the color profile from the pixel data produced by the decoder.(package private) static enumColor space of the image data.(package private) static enumData type for the sample values per channel per pixel.(package private) static enum(package private) static enumError conditions: API usage errors have the 0x80 bit set to 1 Other errors have the 0x80 bit set to 0(package private) static enumId of encoder options for a frame.(package private) classThe @ref JxlEncoderOutputProcessor structure provides an interface for the encoder's output processing.(package private) static enumData type for querying @ref JxlEncoderStats object(package private) static enum(package private) static enumOrdering of multi-byte data.(package private) static enumGiven type of an extra channel.(package private) classThe header of one displayed frame or non-coalesced layer.(package private) classGain map bundle This structure is used to serialize gain map data to and from an input buffer.(package private) classExtensions in the codestream header.(package private) classThe information about layers.(package private) classMemory Manager struct.(package private) static enumImage orientation metadata.(package private) class(package private) classThe codestream preview header(package private) static enumBuilt-in primaries for color encoding.(package private) static enumTypes of progressive detail.(package private) static enumRendering intent for color encoding, as specified in ISO 15076-1:2010(package private) static enumThe result of @ref JxlSignatureCheck.(package private) static enumBuilt-in transfer functions for color encoding.(package private) static enumBuilt-in white points for color encoding.(package private) class(package private) class(package private) static enum -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int(package private) final int(package private) final int(package private) final int(package private) final int(package private) final int(package private) final int(package private) final intCode returned by the @ref JxlParallelRunInit function to indicate a general error.(package private) final intCode returned by the @ref JxlParallelRunInit function to indicate success.(package private) final intA portable @c bool replacement.(package private) char[]Data type holding the 4-character type name of an ISOBMFF box.(package private) final byte(package private) final byte(package private) final int(package private) String(package private) String(package private) final int(package private) final int(package private) final int(package private) final int(package private) final int(package private) final int[](package private) final int(package private) final int[](package private) final int(package private) final int(package private) final int(package private) final int(package private) final int(package private) String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidAddStandardHuffmanTables(libxl.jpeg_common_struct cinfo, boolean is_dc) (package private) voidBuildJpegHuffmanTable(int[] count, int[] symbols, libxl.HuffmanTableEntry[] lut) (package private) voidCreateHuffmanTree(int[] data, int length, int tree_limit, byte[] depth) (package private) floatDivCeil(float a, float b) (package private) intDivCeil(int a, int b) (package private) booleanFROM_JXL_BOOL(int c) (package private) intjpegli_bytes_per_sample(libxl.JpegliDataType data_type) (package private) intNextTableBitSize(int[] count, int len) (package private) floatRoundUpTo(float a, float b) (package private) intRoundUpTo(int a, int b) (package private) voidSetDepth(libxl.HuffmanTree p, libxl.HuffmanTree[] pool, byte[] depth, byte level) (package private) voidSetDepth(libxl.HuffmanTree p, Vector<libxl.HuffmanTree> pool, byte[] depth, byte level) (package private) intTO_JXL_BOOL(boolean c) (package private) voidValidateHuffmanTable(libxl.JHUFF_TBL table, boolean is_dc)
-
Field Details
-
JXL_TRUE
final int JXL_TRUEA portable @c bool replacement. ::JXL_BOOL is a "documentation" type: actually it is @c int, but in API it denotes a type, whose only values are ::JXL_TRUE and ::JXL_FALSE.- See Also:
-
JXL_FALSE
final int JXL_FALSE- See Also:
-
kDCTBlockSize
final int kDCTBlockSize- See Also:
-
kMaxComponents
final int kMaxComponents- See Also:
-
kMaxQuantTables
final int kMaxQuantTables- See Also:
-
kJpegPrecision
final int kJpegPrecision- See Also:
-
kMaxHuffmanTables
final int kMaxHuffmanTables- See Also:
-
kJpegHuffmanMaxBitLength
final int kJpegHuffmanMaxBitLength- See Also:
-
kJpegHuffmanAlphabetSize
final int kJpegHuffmanAlphabetSize- See Also:
-
kJpegDCAlphabetSize
final int kJpegDCAlphabetSize- See Also:
-
kMaxDHTMarkers
final int kMaxDHTMarkers- See Also:
-
kMaxDimPixels
final int kMaxDimPixels- See Also:
-
kApp1
final byte kApp1- See Also:
-
kApp2
final byte kApp2- See Also:
-
kIccProfileTag
String kIccProfileTag -
kExifTag
String kExifTag -
kXMPTag
String kXMPTag -
kJPEGNaturalOrder
final int[] kJPEGNaturalOrder -
kJPEGZigZagOrder
final int[] kJPEGZigZagOrder -
HWY_ALIGNMENT
final int HWY_ALIGNMENT- See Also:
-
JPOOL_PERMANENT
final int JPOOL_PERMANENT- See Also:
-
JPOOL_IMAGE
final int JPOOL_IMAGE- See Also:
-
JPOOL_NUMPOOLS
final int JPOOL_NUMPOOLS- See Also:
-
JPOOL_PERMANENT_ALIGNED
final int JPOOL_PERMANENT_ALIGNED- See Also:
-
JPOOL_IMAGE_ALIGNED
final int JPOOL_IMAGE_ALIGNED- See Also:
-
JxlBoxType
char[] JxlBoxTypeData type holding the 4-character type name of an ISOBMFF box. -
JXL_PARALLEL_RET_SUCCESS
final int JXL_PARALLEL_RET_SUCCESSCode returned by the @ref JxlParallelRunInit function to indicate success.- See Also:
-
JXL_PARALLEL_RET_RUNNER_ERROR
final int JXL_PARALLEL_RET_RUNNER_ERRORCode returned by the @ref JxlParallelRunInit function to indicate a general error.- See Also:
-
kJpegHuffmanRootTableBits
final int kJpegHuffmanRootTableBits- See Also:
-
kJpegHuffmanLutSize
final int kJpegHuffmanLutSize- See Also:
-
-
Constructor Details
-
libxl
public libxl()
-
-
Method Details
-
TO_JXL_BOOL
int TO_JXL_BOOL(boolean c) -
FROM_JXL_BOOL
boolean FROM_JXL_BOOL(int c) -
DivCeil
int DivCeil(int a, int b) -
DivCeil
float DivCeil(float a, float b) -
RoundUpTo
int RoundUpTo(int a, int b) -
RoundUpTo
float RoundUpTo(float a, float b) -
jpegli_bytes_per_sample
-
NextTableBitSize
int NextTableBitSize(int[] count, int len) -
BuildJpegHuffmanTable
-
SetDepth
-
SetDepth
-
CreateHuffmanTree
void CreateHuffmanTree(int[] data, int length, int tree_limit, byte[] depth) -
ValidateHuffmanTable
-
AddStandardHuffmanTables
-