Package gov.nih.mipav.model.file
Class jxlatte
java.lang.Object
gov.nih.mipav.model.file.jxlatte
Copyright 2022-2024 Leo Izen (Traneptora)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# jxlatte
Work-in-progress pure java JPEG XL decoder
## Compiling
JXLatte is built with the [Meson build system](https://mesonbuild.com/).
To build, create a build directory, for example, with `mkdir build invalid input: '&'invalid input: '&' cd build`.
Then run `meson setup ../` to set up the build directory, and `ninja` to compile JXLatte.
## Running
JXLatte can be executed just like any normal jar file:
```sh
java -jar jxlatte.jar samples/art.jxl output.png
```
The JAR can also be used as a library. To use it, add it to your application's classpath.
```java
InputStream input = someInputStream;
OutputStream output = someOutputStream;
JXLDecoder decoder = new JXLDecoder(input);
JXLImage image = decoder.decode();
PNGWriter writer = new PNGWriter(image);
writer.write(output);
```
## Features
Supported features:
- All static Modular images
- All lossless images
- All JXL Art
- All Lossy Modular images
- All static VarDCT Images
- All JPEG reconstructions
- Other static VarDCT images
- Varblock Visualization
- Output:
- PNG
- SDR
- HDR
- PFM
Features not yet supported at this time:
- Progressive Decoding
- Region-of-interest Decoding
- Animation
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassclassclassclassclassclassclassclassfinal classclassclassclassclassclassstatic interfacestatic interfacestatic interfaceclassclassstatic interfacestatic interfaceclassstatic interfaceclassfinal classclassclassclassclassclassclassclassclassclassclassfinal classclassclassclassclassclassclassclassclassclassstatic interfaceThis must be separate because TransformType's static initializers won't fire in timeclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassstatic interfaceclassstatic enumclassclassclassclass -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintceilDiv(int numerator, int denominator) intceilLog1p(long x) static intceilLog1pSt(long x) intceilLog2(long x) static intceilLog2St(long x) floatclamp(float v, float a, float b) intclamp(int v, int a, int b) intclamp(int v, int a, int b, int c) floatclampAsc(float v, float lower, float upper) float[][][]deepCopyOf(float[][][] array) floaterf(float z) floatfloatFromF16(int bits16) intfloorLog1p(long x) voidforwardDCT2D(float[][] src, float[][] dest, jxlatte.Point startIn, jxlatte.Point startOut, jxlatte.Dimension length, float[][] scratchSpace0, float[][] scratchSpace1) voidforwardDCTHorizontal(float[] src, float[] dest, int xStartIn, int xStartOut, int xLogLength, int xLength) (package private) voidvoidinverseDCT2D(float[][] src, float[][] dest, jxlatte.Point startIn, jxlatte.Point startOut, jxlatte.Dimension size, float[][] scratchSpace0, float[][] scratchSpace1, boolean transposed) voidinverseDCTHorizontal(float[] src, float[] dest, int xStartIn, int xStartOut, int xLogLength, int xLength) float[][]invertMatrix3x3(float[][] matrix) float[][]matrixIdentity(int n) float[][]matrixMultiply(float[][]... matrices) float[][]matrixMultiply(float[][] left, float[][] right) float[]matrixMutliply(float[][] matrix, float[] columnVector) float[]matrixMutliply(float[] rowVector, float[][] matrix) voidmatrixMutliply3InPlace(float[][] matrix, float[] columnVector) floatmax(float... a) intmax(int... a) intmin(int... a) intmirrorCoordinate(int coordinate, int size) intround(float d) floatsignedPow(float base, float exponent) float[][]transposeMatrix(float[][] matrix, int height, int width) voidtransposeMatrixInto(float[][] src, float[][] dest, jxlatte.Point srcStart, jxlatte.Point destStart, int srcHeight, int srcWidth) intunpackSigned(int value)
-
Field Details
-
SQRT_2
public final float SQRT_2 -
SQRT_H
public final float SQRT_H -
SQRT_F
public final float SQRT_F -
PHI_BAR
public final float PHI_BAR -
PHI
public final float PHI -
ZERO
-
cosineLut
private float[][][] cosineLut -
root2
final double root2
-
-
Constructor Details
-
jxlatte
public jxlatte()
-
-
Method Details
-
initcosineLut
void initcosineLut() -
unpackSigned
public int unpackSigned(int value) -
round
public int round(float d) -
erf
public float erf(float z) -
inverseDCTHorizontal
public void inverseDCTHorizontal(float[] src, float[] dest, int xStartIn, int xStartOut, int xLogLength, int xLength) -
forwardDCTHorizontal
public void forwardDCTHorizontal(float[] src, float[] dest, int xStartIn, int xStartOut, int xLogLength, int xLength) -
inverseDCT2D
public void inverseDCT2D(float[][] src, float[][] dest, jxlatte.Point startIn, jxlatte.Point startOut, jxlatte.Dimension size, float[][] scratchSpace0, float[][] scratchSpace1, boolean transposed) -
forwardDCT2D
public void forwardDCT2D(float[][] src, float[][] dest, jxlatte.Point startIn, jxlatte.Point startOut, jxlatte.Dimension length, float[][] scratchSpace0, float[][] scratchSpace1) -
transposeMatrixInto
public void transposeMatrixInto(float[][] src, float[][] dest, jxlatte.Point srcStart, jxlatte.Point destStart, int srcHeight, int srcWidth) -
transposeMatrix
public float[][] transposeMatrix(float[][] matrix, int height, int width) -
ceilLog1p
public int ceilLog1p(long x) - Returns:
- ceil(log2(x + 1))
-
ceilLog1pSt
public static int ceilLog1pSt(long x) -
ceilLog2
public int ceilLog2(long x) -
ceilLog2St
public static int ceilLog2St(long x) -
ceilDiv
public int ceilDiv(int numerator, int denominator) -
floorLog1p
public int floorLog1p(long x) -
min
public int min(int... a) -
max
public int max(int... a) -
max
public float max(float... a) -
signedPow
public float signedPow(float base, float exponent) -
clamp
public int clamp(int v, int a, int b, int c) -
clamp
public int clamp(int v, int a, int b) -
clampAsc
public float clampAsc(float v, float lower, float upper) -
clamp
public float clamp(float v, float a, float b) -
matrixMutliply
public float[] matrixMutliply(float[][] matrix, float[] columnVector) -
matrixMutliply3InPlace
public void matrixMutliply3InPlace(float[][] matrix, float[] columnVector) -
matrixMutliply
public float[] matrixMutliply(float[] rowVector, float[][] matrix) -
matrixMultiply
public float[][] matrixMultiply(float[][] left, float[][] right) -
matrixIdentity
public float[][] matrixIdentity(int n) -
matrixMultiply
public float[][] matrixMultiply(float[][]... matrices) -
invertMatrix3x3
public float[][] invertMatrix3x3(float[][] matrix) -
mirrorCoordinate
public int mirrorCoordinate(int coordinate, int size) -
floatFromF16
public float floatFromF16(int bits16) -
deepCopyOf
public float[][][] deepCopyOf(float[][][] array)
-