diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f77f26e..8339390 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,6 +44,14 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -55,7 +63,7 @@ jobs: - name: Build with Maven run: | brew install libavif - mvn -B install --file pom.xml + mvn -B package --file pom.xml -DskipTests - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 7634cfc..a74aae4 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,10 +15,10 @@ jobs: if: ${{ contains(github.event.head_commit.message, 'bump version') }} run: grep "" pom.xml | head -1 | grep -v SNAPSHOT - - name: Set up JDK 1.8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '17' distribution: 'temurin' cache: maven diff --git a/README.md b/README.md index 9a8c163..5ad0ac9 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ [![Release](https://jitpack.io/v/umjammer/vavi-image-avif.svg)](https://jitpack.io/#umjammer/vavi-image-avif) [![Java CI](https://github.com/umjammer/vavi-image-avif/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/vavi-image-avif/actions/workflows/maven.yml) [![CodeQL](https://github.com/umjammer/vavi-image-avif/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/umjammer/vavi-image-avif/actions/workflows/codeql-analysis.yml) -![Java](https://img.shields.io/badge/Java-8-b07219) +![Java](https://img.shields.io/badge/Java-17-b07219) [![Parent](https://img.shields.io/badge/Parent-vavi--image--sandbox-pink)](https://github.com/umjammer/vavi-image-sandbox) # vavi-image-avif -Java AVIF decoder
+Java AVIF decoder and encoder
wrapped [libavif](https://github.com/AOMediaCodec/libavif) by jna
based on https://github.com/AOMediaCodec/libavif/tree/main/android_jni @@ -15,14 +15,17 @@ based on https://github.com/AOMediaCodec/libavif/tree/main/android_jni ## Install - * install `libavif` e.g. `brew intall libavif` + * install `libavif` 1.0.3 ... e.g. `brew intall libavif` * https://jitpack.io/#umjammer/vavi-image-avif - * add `-Djna.library.path=/usr/local/lib` for jvm args + * add `-Djna.library.path=/opt/homebrew/lib` for jvm args ## Usage ```java + // read BufferedImage image = ImageIO.read(Paths.get("/foo/bar.avif").toFile()); + // write + ImageIO.write(image, "AVIF", Paths.get("/foo/baz.avif").toFile()); ``` ## TODO diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..efde7bf --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +jdk: + - openjdk17 diff --git a/pom.xml b/pom.xml index d1af218..199de8d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ vavi vavi-image-avif - 0.0.4 + 0.0.5 Java AVIF Decoder @@ -51,22 +51,21 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 - 8 - 8 - UTF-8 + 17 org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.1.2 + --add-opens java.logging/java.util.logging=ALL-UNNAMED -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties - -Djna.library.path=/usr/local/lib + -Djna.library.path=/usr/local/lib:/opt/homebrew/lib false @@ -79,7 +78,7 @@ org.junit junit-bom - 5.9.3 + 5.10.0 pom import @@ -107,7 +106,7 @@ net.java.dev.jna jna - 5.12.1 + 5.14.0 diff --git a/src/main/java/vavi/awt/image/avif/jna/Avif.java b/src/main/java/vavi/awt/image/avif/jna/Avif.java index 2a6f408..99c72ad 100644 --- a/src/main/java/vavi/awt/image/avif/jna/Avif.java +++ b/src/main/java/vavi/awt/image/avif/jna/Avif.java @@ -9,6 +9,7 @@ import java.util.logging.Level; import com.sun.jna.Native; +import com.sun.jna.NativeLong; import com.sun.jna.Pointer; import vavi.awt.image.jna.avif.AvifLibrary; import vavi.awt.image.jna.avif.avifDecoder; @@ -33,7 +34,7 @@ public class Avif { // This is a utility class and cannot be instantiated. private Avif() { String version = AvifLibrary.INSTANCE.avifVersion(); - if (!version.startsWith("0.11")) { + if (!version.startsWith("1.0.3")) { Debug.println(Level.SEVERE, "wrong version: " + version); } } @@ -51,7 +52,7 @@ public static Avif getInstance() { public static boolean isAvifImage(ByteBuffer encoded, int length) { avifROData data = new avifROData(); data.data = Native.getDirectBufferPointer(encoded); - data.size = length; + data.size.setValue(length); return AvifLibrary.INSTANCE.avifPeekCompatibleFileType(data) == AvifLibrary.AVIF_TRUE; } @@ -87,7 +88,7 @@ private avifDecoder createDecoderAndParse(Pointer buffer, int length, int thread // crbug.com/1198455). decoder.strictFlags &= ~AvifLibrary.avifStrictFlag.AVIF_STRICT_PIXI_REQUIRED; - int res = AvifLibrary.INSTANCE.avifDecoderSetIOMemory(decoder, buffer, length); + int res = AvifLibrary.INSTANCE.avifDecoderSetIOMemory(decoder, buffer, new NativeLong(length)); if (res != AvifLibrary.avifResult.AVIF_RESULT_OK) { throw new IllegalStateException("Failed to set AVIF IO to a memory reader."); } @@ -187,7 +188,7 @@ public ByteBuffer encode(BufferedImage bitmap, int quality) { // ByteBuffer nativeBuffer = ByteBuffer.allocateDirect(bitmap.getWidth() * bitmap.getHeight() * bytes); // rgb.pixels = Native.getDirectBufferPointer(nativeBuffer); // rgb.rowBytes = bitmap.getWidth() * bytes; -Debug.printf(Level.FINE, StringUtil.paramString(rgb)); +//Debug.printf(Level.FINE, StringUtil.paramString(rgb)); // TODO paramString doesn't work jdk16+ nativeBuffer.put(((DataBufferByte) bitmap.getRaster().getDataBuffer()).getData()); @@ -227,11 +228,11 @@ public ByteBuffer encode(BufferedImage bitmap, int quality) { throw new IllegalStateException(String.format("Failed to finish encode: %s", AvifLibrary.INSTANCE.avifResultToString(finishResult))); } -Debug.printf(Level.FINE, "Encode success: %d total bytes", avifOutput.size); +Debug.printf(Level.FINE, "Encode success: %d total bytes", avifOutput.size.longValue()); AvifLibrary.INSTANCE.avifRGBImageFreePixels(rgb); AvifLibrary.INSTANCE.avifEncoderDestroy(encoder); - return avifOutput.data.getByteBuffer(0, avifOutput.size); + return avifOutput.data.getByteBuffer(0, avifOutput.size.longValue()); } } diff --git a/src/main/java/vavi/awt/image/jna/avif/AvifLibrary.java b/src/main/java/vavi/awt/image/jna/avif/AvifLibrary.java index 572cfa0..1bc551c 100644 --- a/src/main/java/vavi/awt/image/jna/avif/AvifLibrary.java +++ b/src/main/java/vavi/awt/image/jna/avif/AvifLibrary.java @@ -4,9 +4,11 @@ import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.NativeLibrary; +import com.sun.jna.NativeLong; import com.sun.jna.Pointer; import com.sun.jna.PointerType; import com.sun.jna.ptr.FloatByReference; +import com.sun.jna.ptr.NativeLongByReference; import com.sun.jna.ptr.PointerByReference; import java.nio.ByteBuffer; import java.nio.FloatBuffer; @@ -21,10 +23,10 @@ public interface AvifLibrary extends Library { String JNA_LIBRARY_NAME = "avif"; NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(AvifLibrary.JNA_LIBRARY_NAME); AvifLibrary INSTANCE = Native.load(AvifLibrary.JNA_LIBRARY_NAME, AvifLibrary.class); - /** + /** * native declaration : avif/avif.h
- * enum values - */ + * enum values + */ interface avifPlanesFlag { /** native declaration : avif/avif.h:82 */ int AVIF_PLANES_YUV = (1 << 0); @@ -34,969 +36,1096 @@ interface avifPlanesFlag { int AVIF_PLANES_ALL = 0xff; } - /** + /** * native declaration : avif/avif.h:89
- * enum values - */ - interface avifChannelIndex { - /** native declaration : avif/avif.h:97 */ - int AVIF_CHAN_Y = 0; - /** native declaration : avif/avif.h:98 */ - int AVIF_CHAN_U = 1; - /** native declaration : avif/avif.h:99 */ - int AVIF_CHAN_V = 2; - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifResult { - /** native declaration : avif/avif.h:120 */ - int AVIF_RESULT_OK = 0; - /** native declaration : avif/avif.h:121 */ - int AVIF_RESULT_UNKNOWN_ERROR = 1; - /** native declaration : avif/avif.h:122 */ - int AVIF_RESULT_INVALID_FTYP = 2; - /** native declaration : avif/avif.h:123 */ - int AVIF_RESULT_NO_CONTENT = 3; - /** native declaration : avif/avif.h:124 */ - int AVIF_RESULT_NO_YUV_FORMAT_SELECTED = 4; - /** native declaration : avif/avif.h:125 */ - int AVIF_RESULT_REFORMAT_FAILED = 5; - /** native declaration : avif/avif.h:126 */ - int AVIF_RESULT_UNSUPPORTED_DEPTH = 6; - /** native declaration : avif/avif.h:127 */ - int AVIF_RESULT_ENCODE_COLOR_FAILED = 7; - /** native declaration : avif/avif.h:128 */ - int AVIF_RESULT_ENCODE_ALPHA_FAILED = 8; - /** native declaration : avif/avif.h:129 */ - int AVIF_RESULT_BMFF_PARSE_FAILED = 9; - /** native declaration : avif/avif.h:130 */ - int AVIF_RESULT_NO_AV1_ITEMS_FOUND = 10; - /** native declaration : avif/avif.h:131 */ - int AVIF_RESULT_DECODE_COLOR_FAILED = 11; - /** native declaration : avif/avif.h:132 */ - int AVIF_RESULT_DECODE_ALPHA_FAILED = 12; - /** native declaration : avif/avif.h:133 */ - int AVIF_RESULT_COLOR_ALPHA_SIZE_MISMATCH = 13; - /** native declaration : avif/avif.h:134 */ - int AVIF_RESULT_ISPE_SIZE_MISMATCH = 14; - /** native declaration : avif/avif.h:135 */ - int AVIF_RESULT_NO_CODEC_AVAILABLE = 15; - /** native declaration : avif/avif.h:136 */ - int AVIF_RESULT_NO_IMAGES_REMAINING = 16; - /** native declaration : avif/avif.h:137 */ - int AVIF_RESULT_INVALID_EXIF_PAYLOAD = 17; - /** native declaration : avif/avif.h:138 */ - int AVIF_RESULT_INVALID_IMAGE_GRID = 18; - /** native declaration : avif/avif.h:139 */ - int AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION = 19; - /** native declaration : avif/avif.h:140 */ - int AVIF_RESULT_TRUNCATED_DATA = 20; - /** - * the avifIO field of avifDecoder is not set
- * native declaration : avif/avif.h:141 - */ - int AVIF_RESULT_IO_NOT_SET = 21; - /** native declaration : avif/avif.h:142 */ - int AVIF_RESULT_IO_ERROR = 22; - /** - * similar to EAGAIN/EWOULDBLOCK, this means the avifIO doesn't have necessary data available yet
- * native declaration : avif/avif.h:143 - */ - int AVIF_RESULT_WAITING_ON_IO = 23; - /** - * an argument passed into this function is invalid
- * native declaration : avif/avif.h:144 - */ - int AVIF_RESULT_INVALID_ARGUMENT = 24; - /** - * a requested code path is not (yet) implemented
- * native declaration : avif/avif.h:145 - */ - int AVIF_RESULT_NOT_IMPLEMENTED = 25; - /** native declaration : avif/avif.h:146 */ - int AVIF_RESULT_OUT_OF_MEMORY = 26; - /** a setting that can't change is changed during encoding */ - int AVIF_RESULT_CANNOT_CHANGE_SETTING = 27; - /** the image is incompatible with already encoded images */ - int AVIF_RESULT_INCOMPATIBLE_IMAGE = 28; - } - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifPixelFormat { - /** native declaration : avif/avif.h:183 */ - int AVIF_PIXEL_FORMAT_NONE = 0; - /** native declaration : avif/avif.h:185 */ - int AVIF_PIXEL_FORMAT_YUV444 = 1; - /** native declaration : avif/avif.h:186 */ - int AVIF_PIXEL_FORMAT_YUV422 = 2; - /** native declaration : avif/avif.h:187 */ - int AVIF_PIXEL_FORMAT_YUV420 = 3; - /** native declaration : avif/avif.h:188 */ - int AVIF_PIXEL_FORMAT_YUV400 = 4; - /** */ - int AVIF_PIXEL_FORMAT_COUNT = 5; - } - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifChromaSamplePosition { - /** native declaration : avif/avif.h:206 */ - int AVIF_CHROMA_SAMPLE_POSITION_UNKNOWN = 0; - /** native declaration : avif/avif.h:207 */ - int AVIF_CHROMA_SAMPLE_POSITION_VERTICAL = 1; - /** native declaration : avif/avif.h:208 */ - int AVIF_CHROMA_SAMPLE_POSITION_COLOCATED = 2; - } - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifRange { - /** native declaration : avif/avif.h:216 */ - int AVIF_RANGE_LIMITED = 0; - /** native declaration : avif/avif.h:217 */ - int AVIF_RANGE_FULL = 1; - } - int AVIF_COLOR_PRIMARIES_UNKNOWN = 0; - int AVIF_COLOR_PRIMARIES_BT709 = 1; - int AVIF_COLOR_PRIMARIES_IEC61966_2_4 = 1; - int AVIF_COLOR_PRIMARIES_UNSPECIFIED = 2; - int AVIF_COLOR_PRIMARIES_BT470M = 4; - int AVIF_COLOR_PRIMARIES_BT470BG = 5; - int AVIF_COLOR_PRIMARIES_BT601 = 6; - int AVIF_COLOR_PRIMARIES_SMPTE240 = 7; - int AVIF_COLOR_PRIMARIES_GENERIC_FILM = 8; - int AVIF_COLOR_PRIMARIES_BT2020 = 9; - int AVIF_COLOR_PRIMARIES_XYZ = 10; - int AVIF_COLOR_PRIMARIES_SMPTE431 = 11; - /** DCI P3 */ - int AVIF_COLOR_PRIMARIES_SMPTE432 = 12; - int AVIF_COLOR_PRIMARIES_EBU3213 = 22; - int AVIF_TRANSFER_CHARACTERISTICS_UNKNOWN = 0; - int AVIF_TRANSFER_CHARACTERISTICS_BT709 = 1; - int AVIF_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2; - /** 2.2 gamma */ - int AVIF_TRANSFER_CHARACTERISTICS_BT470M = 4; - /** 2.8 gamma */ - int AVIF_TRANSFER_CHARACTERISTICS_BT470BG = 5; - int AVIF_TRANSFER_CHARACTERISTICS_BT601 = 6; - int AVIF_TRANSFER_CHARACTERISTICS_SMPTE240 = 7; - int AVIF_TRANSFER_CHARACTERISTICS_LINEAR = 8; - int AVIF_TRANSFER_CHARACTERISTICS_LOG100 = 9; - int AVIF_TRANSFER_CHARACTERISTICS_LOG100_SQRT10 = 10; - int AVIF_TRANSFER_CHARACTERISTICS_IEC61966 = 11; - int AVIF_TRANSFER_CHARACTERISTICS_BT1361 = 12; - int AVIF_TRANSFER_CHARACTERISTICS_SRGB = 13; - int AVIF_TRANSFER_CHARACTERISTICS_BT2020_10BIT = 14; - int AVIF_TRANSFER_CHARACTERISTICS_BT2020_12BIT = 15; - /** PQ */ - int AVIF_TRANSFER_CHARACTERISTICS_SMPTE2084 = 16; - int AVIF_TRANSFER_CHARACTERISTICS_SMPTE428 = 17; - int AVIF_TRANSFER_CHARACTERISTICS_HLG = 18; - int AVIF_MATRIX_COEFFICIENTS_IDENTITY = 0; - int AVIF_MATRIX_COEFFICIENTS_BT709 = 1; - int AVIF_MATRIX_COEFFICIENTS_UNSPECIFIED = 2; - int AVIF_MATRIX_COEFFICIENTS_FCC = 4; - int AVIF_MATRIX_COEFFICIENTS_BT470BG = 5; - int AVIF_MATRIX_COEFFICIENTS_BT601 = 6; - int AVIF_MATRIX_COEFFICIENTS_SMPTE240 = 7; - int AVIF_MATRIX_COEFFICIENTS_YCGCO = 8; - int AVIF_MATRIX_COEFFICIENTS_BT2020_NCL = 9; - int AVIF_MATRIX_COEFFICIENTS_BT2020_CL = 10; - int AVIF_MATRIX_COEFFICIENTS_SMPTE2085 = 11; - int AVIF_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL = 12; - int AVIF_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL = 13; - int AVIF_MATRIX_COEFFICIENTS_ICTCP = 14; - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifTransformFlag { - /** native declaration : avif/avif.h:315 */ - int AVIF_TRANSFORM_NONE = 0; - /** native declaration : avif/avif.h:317 */ - int AVIF_TRANSFORM_PASP = (1 << 0); - /** native declaration : avif/avif.h:318 */ - int AVIF_TRANSFORM_CLAP = (1 << 1); - /** native declaration : avif/avif.h:319 */ - int AVIF_TRANSFORM_IROT = (1 << 2); - /** native declaration : avif/avif.h:320 */ - int AVIF_TRANSFORM_IMIR = (1 << 3); - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifRGBFormat { - /** native declaration : avif/avif.h:533 */ - int AVIF_RGB_FORMAT_RGB = 0; - /** - * This is the default format set in avifRGBImageSetDefaults().
- * native declaration : avif/avif.h:534 - */ - int AVIF_RGB_FORMAT_RGBA = 1; - /** native declaration : avif/avif.h:535 */ - int AVIF_RGB_FORMAT_ARGB = 2; - /** native declaration : avif/avif.h:536 */ - int AVIF_RGB_FORMAT_BGR = 3; - /** native declaration : avif/avif.h:537 */ - int AVIF_RGB_FORMAT_BGRA = 4; - /** native declaration : avif/avif.h:538 */ - int AVIF_RGB_FORMAT_ABGR = 5; - /** - * RGB_565 format uses five bits for the red and blue components and six - * bits for the green component. Each RGB pixel is 16 bits (2 bytes), which - * is packed as follows: - *
-         *   uint16_t: [r4 r3 r2 r1 r0 g5 g4 g3 g2 g1 g0 b4 b3 b2 b1 b0]
-         *   r4 and r0 are the MSB and LSB of the red component respectively.
-         *   g5 and g0 are the MSB and LSB of the green component respectively.
-         *   b4 and b0 are the MSB and LSB of the blue component respectively.
-         * 
- * This format is only supported for YUV -> RGB conversion and when - * avifRGBImage.depth is set to 8. - */ - int AVIF_RGB_FORMAT_RGB_565 = 6; - int AVIF_RGB_FORMAT_COUNT = 7; - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifChromaUpsampling { - /** - * Chooses best trade off of speed/quality (prefers libyuv, else uses BEST_QUALITY)
- * native declaration : avif/avif.h:545 - */ - int AVIF_CHROMA_UPSAMPLING_AUTOMATIC = 0; - /** - * Chooses speed over quality (prefers libyuv, else uses NEAREST)
- * native declaration : avif/avif.h:546 - */ - int AVIF_CHROMA_UPSAMPLING_FASTEST = 1; - /** - * Chooses the best quality upsampling, given settings (avoids libyuv)
- * native declaration : avif/avif.h:547 - */ - int AVIF_CHROMA_UPSAMPLING_BEST_QUALITY = 2; - /** - * Uses nearest-neighbor filter (built-in)
- * native declaration : avif/avif.h:548 - */ - int AVIF_CHROMA_UPSAMPLING_NEAREST = 3; - /** - * Uses bilinear filter (built-in)
- * native declaration : avif/avif.h:549 - */ - int AVIF_CHROMA_UPSAMPLING_BILINEAR = 4; - } - - interface avifChromaDownsampling { - /** Chooses best trade off of speed/quality (same as AVERAGE) */ - int AVIF_CHROMA_DOWNSAMPLING_AUTOMATIC = 0; - /** Chooses speed over quality (same as AVERAGE) */ - int AVIF_CHROMA_DOWNSAMPLING_FASTEST = 1; - /** Chooses the best quality upsampling (same as AVERAGE) */ - int AVIF_CHROMA_DOWNSAMPLING_BEST_QUALITY = 2; - /** Uses averaging filter */ - int AVIF_CHROMA_DOWNSAMPLING_AVERAGE = 3; - /** Uses sharp yuv filter (libsharpyuv), available for 4:2:0 only, ignored for 4:2:2 */ - int AVIF_CHROMA_DOWNSAMPLING_SHARP_YUV = 4; - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifCodecChoice { - /** native declaration : avif/avif.h:602 */ - int AVIF_CODEC_CHOICE_AUTO = 0; - /** native declaration : avif/avif.h:603 */ - int AVIF_CODEC_CHOICE_AOM = 1; - /** - * Decode only
- * native declaration : avif/avif.h:604 - */ - int AVIF_CODEC_CHOICE_DAV1D = 2; - /** - * Decode only
- * native declaration : avif/avif.h:605 - */ - int AVIF_CODEC_CHOICE_LIBGAV1 = 3; - /** - * Encode only
- * native declaration : avif/avif.h:606 - */ - int AVIF_CODEC_CHOICE_RAV1E = 4; - /** - * Encode only
- * native declaration : avif/avif.h:607 - */ - int AVIF_CODEC_CHOICE_SVT = 5; - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifCodecFlag { - /** native declaration : avif/avif.h:612 */ - int AVIF_CODEC_FLAG_CAN_DECODE = (1 << 0); - /** native declaration : avif/avif.h:613 */ - int AVIF_CODEC_FLAG_CAN_ENCODE = (1 << 1); - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifStrictFlag { - /** native declaration : avif/avif.h:712 */ - int AVIF_STRICT_DISABLED = 0; - /** native declaration : avif/avif.h:718 */ - int AVIF_STRICT_PIXI_REQUIRED = (1 << 0); - /** native declaration : avif/avif.h:723 */ - int AVIF_STRICT_CLAP_VALID = (1 << 1); - /** native declaration : avif/avif.h:731 */ - int AVIF_STRICT_ALPHA_ISPE_REQUIRED = (1 << 2); - /** native declaration : avif/avif.h:734 */ - int AVIF_STRICT_ENABLED = avifStrictFlag.AVIF_STRICT_PIXI_REQUIRED | avifStrictFlag.AVIF_STRICT_CLAP_VALID | avifStrictFlag.AVIF_STRICT_ALPHA_ISPE_REQUIRED; - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifDecoderSource { - /** native declaration : avif/avif.h:752 */ - int AVIF_DECODER_SOURCE_AUTO = 0; - /** native declaration : avif/avif.h:756 */ - int AVIF_DECODER_SOURCE_PRIMARY_ITEM = 1; - /** native declaration : avif/avif.h:760 */ - int AVIF_DECODER_SOURCE_TRACKS = 2; - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifProgressiveState { - /** native declaration : avif/avif.h:780 */ - int AVIF_PROGRESSIVE_STATE_UNAVAILABLE = 0; - /** native declaration : avif/avif.h:785 */ - int AVIF_PROGRESSIVE_STATE_AVAILABLE = 1; - /** native declaration : avif/avif.h:792 */ - int AVIF_PROGRESSIVE_STATE_ACTIVE = 2; - } - - /** - * native declaration : avif/avif.h
- * enum values - */ - interface avifAddImageFlag { - /** native declaration : avif/avif.h:1037 */ - int AVIF_ADD_IMAGE_FLAG_NONE = 0; - /** native declaration : avif/avif.h:1040 */ - int AVIF_ADD_IMAGE_FLAG_FORCE_KEYFRAME = (1 << 0); - /** native declaration : avif/avif.h:1045 */ - int AVIF_ADD_IMAGE_FLAG_SINGLE = (1 << 1); - } - - /** native declaration : avif/avif.h */ - int AVIF_VERSION_MAJOR = 0; - /** native declaration : avif/avif.h */ - int AVIF_VERSION_MINOR = 10; - /** native declaration : avif/avif.h */ - int AVIF_VERSION_PATCH = 1; - /** native declaration : avif/avif.h */ - int AVIF_VERSION_DEVEL = 0; - /** native declaration : avif/avif.h */ - int AVIF_VERSION = (0 * 1000000) + (10 * 10000) + (1 * 100) + 0; - /** native declaration : avif/avif.h */ - int AVIF_TRUE = 1; - /** native declaration : avif/avif.h */ - int AVIF_FALSE = 0; - /** native declaration : avif/avif.h */ - int AVIF_DIAGNOSTICS_ERROR_BUFFER_SIZE = 256; - /** native declaration : avif/avif.h */ - int AVIF_DEFAULT_IMAGE_SIZE_LIMIT = 16384 * 16384; - /** native declaration : avif/avif.h */ - int AVIF_DEFAULT_IMAGE_COUNT_LIMIT = 12 * 3600 * 60; - /** native declaration : avif/avif.h */ - int AVIF_QUANTIZER_LOSSLESS = 0; - /** native declaration : avif/avif.h */ - int AVIF_QUANTIZER_BEST_QUALITY = 0; - /** native declaration : avif/avif.h */ - int AVIF_QUANTIZER_WORST_QUALITY = 63; - /** native declaration : avif/avif.h */ - int AVIF_PLANE_COUNT_YUV = 3; - /** native declaration : avif/avif.h */ - int AVIF_SPEED_DEFAULT = -1; - /** native declaration : avif/avif.h */ - int AVIF_SPEED_SLOWEST = 0; - /** native declaration : avif/avif.h */ - int AVIF_SPEED_FASTEST = 10; - /** native declaration : avif/avif.h */ - interface avifIODestroyFunc extends Callback { - void apply(avifIO io); - } - /** native declaration : avif/avif.h */ - interface avifIOReadFunc extends Callback { - int apply(avifIO io, int readFlags, long offset, int size, avifROData out); - } - /** native declaration : avif/avif.h */ - interface avifIOWriteFunc extends Callback { - int apply(avifIO io, int writeFlags, long offset, Pointer data, int size); - } - /** - * Version
- * Original signature : char* avifVersion()
- * native declaration : avif/avif.h:105 - */ - String avifVersion(); - /** - * Original signature : void avifCodecVersions(char[256])
- * native declaration : avif/avif.h:106
- * @deprecated use the safer methods {@link #avifCodecVersions(java.nio.ByteBuffer)} and {@link #avifCodecVersions(com.sun.jna.Pointer)} instead - */ - @Deprecated - void avifCodecVersions(Pointer outBuffer); - /** - * Original signature : void avifCodecVersions(char[256])
- * native declaration : avif/avif.h:106 - */ - void avifCodecVersions(ByteBuffer outBuffer); - /** - * returns 0 if libavif wasn't compiled with libyuv support
- * Original signature : int avifLibYUVVersion()
- * native declaration : avif/avif.h:107 - */ - int avifLibYUVVersion(); - /** - * Memory management
- * Original signature : void* avifAlloc(size_t)
- * native declaration : avif/avif.h:112 - */ - Pointer avifAlloc(int size); - /** - * Original signature : void avifFree(void*)
- * native declaration : avif/avif.h:113 - */ - void avifFree(Pointer p); - /** - * Original signature : char* avifResultToString(avifResult)
- * native declaration : avif/avif.h:149 - */ - String avifResultToString(int result); - /** - * clang-format on
- * Original signature : void avifRWDataRealloc(avifRWData*, size_t)
- * native declaration : avif/avif.h:173 - */ - void avifRWDataRealloc(avifRWData raw, int newSize); - /** - * Original signature : void avifRWDataSet(avifRWData*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:174
- * @deprecated use the safer methods {@link #avifRWDataSet(vavi.awt.image.jna.avif.avifRWData, byte[], int)} and {@link #avifRWDataSet(vavi.awt.image.jna.avif.avifRWData, com.sun.jna.Pointer, int)} instead - */ - @Deprecated - void avifRWDataSet(avifRWData raw, Pointer data, int len); - /** - * Original signature : void avifRWDataSet(avifRWData*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:174 - */ - void avifRWDataSet(avifRWData raw, byte[] data, int len); - /** - * Original signature : void avifRWDataFree(avifRWData*)
- * native declaration : avif/avif.h:175 - */ - void avifRWDataFree(avifRWData raw); - /** - * Original signature : char* avifPixelFormatToString(avifPixelFormat)
- * native declaration : avif/avif.h:190 - */ - String avifPixelFormatToString(int format); - /** - * Original signature : void avifGetPixelFormatInfo(avifPixelFormat, avifPixelFormatInfo*)
- * native declaration : avif/avif.h:199 - */ - void avifGetPixelFormatInfo(int format, avifPixelFormatInfo info); - /** - * outPrimaries: rX, rY, gX, gY, bX, bY, wX, wY
- * Original signature : void avifColorPrimariesGetValues(avifColorPrimaries, float[8])
- * native declaration : avif/avif.h:245
- * @deprecated use the safer methods {@link #avifColorPrimariesGetValues(short, java.nio.FloatBuffer)} and {@link #avifColorPrimariesGetValues(short, com.sun.jna.ptr.FloatByReference)} instead - */ - @Deprecated - void avifColorPrimariesGetValues(short acp, FloatByReference outPrimaries); - /** - * outPrimaries: rX, rY, gX, gY, bX, bY, wX, wY
- * Original signature : void avifColorPrimariesGetValues(avifColorPrimaries, float[8])
- * native declaration : avif/avif.h:245 - */ - void avifColorPrimariesGetValues(short acp, FloatBuffer outPrimaries); - /** - * Original signature : avifColorPrimaries avifColorPrimariesFind(const float[8], const char**)
- * native declaration : avif/avif.h:246
- * @deprecated use the safer methods {@link #avifColorPrimariesFind(float[], java.lang.String[])} and {@link #avifColorPrimariesFind(com.sun.jna.ptr.FloatByReference, com.sun.jna.ptr.PointerByReference)} instead - */ - @Deprecated - short avifColorPrimariesFind(FloatByReference inPrimaries, PointerByReference outName); - /** - * Original signature : avifColorPrimaries avifColorPrimariesFind(const float[8], const char**)
- * native declaration : avif/avif.h:246 - */ - short avifColorPrimariesFind(float[] inPrimaries, String[] outName); - /** - * Original signature : void avifDiagnosticsClearError(avifDiagnostics*)
- * native declaration : avif/avif.h:308 - */ - void avifDiagnosticsClearError(avifDiagnostics diag); - /** - * values are not guaranteed to be complete or correct and should not be used.
- * Original signature : avifBool avifCropRectConvertCleanApertureBox(avifCropRect*, const avifCleanApertureBox*, uint32_t, uint32_t, avifPixelFormat, avifDiagnostics*)
- * native declaration : avif/avif.h:397 - */ - int avifCropRectConvertCleanApertureBox(avifCropRect cropRect, avifCleanApertureBox clap, int imageW, int imageH, int yuvFormat, avifDiagnostics diag); - /** - * Original signature : avifBool avifCleanApertureBoxConvertCropRect(avifCleanApertureBox*, const avifCropRect*, uint32_t, uint32_t, avifPixelFormat, avifDiagnostics*)
- * native declaration : avif/avif.h:403 - */ - int avifCleanApertureBoxConvertCropRect(avifCleanApertureBox clap, avifCropRect cropRect, int imageW, int imageH, int yuvFormat, avifDiagnostics diag); - /** - * Original signature : avifImage* avifImageCreate(int, int, int, avifPixelFormat)
- * native declaration : avif/avif.h:464 - */ - avifImage avifImageCreate(int width, int height, int depth, int yuvFormat); - /** - * helper for making an image to decode into
- * Original signature : avifImage* avifImageCreateEmpty()
- * native declaration : avif/avif.h:465 - */ - avifImage avifImageCreateEmpty(); - /** - * deep copy
- * Original signature : void avifImageCopy(avifImage*, const avifImage*, avifPlanesFlags)
- * native declaration : avif/avif.h:466 - */ - int avifImageCopy(avifImage dstImage, avifImage srcImage, int planes); - /** - * shallow copy, no metadata
- * Original signature : avifResult avifImageSetViewRect(avifImage*, const avifImage*, const avifCropRect*)
- * native declaration : avif/avif.h:467 - */ - int avifImageSetViewRect(avifImage dstImage, avifImage srcImage, avifCropRect rect); - /** - * Original signature : void avifImageDestroy(avifImage*)
- * native declaration : avif/avif.h:468 - */ - void avifImageDestroy(avifImage image); - /** - * Original signature : void avifImageSetProfileICC(avifImage*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:470
- * @deprecated use the safer methods {@link #avifImageSetProfileICC(vavi.awt.image.jna.avif.avifImage, byte[], int)} and {@link #avifImageSetProfileICC(vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer, int)} instead - */ - @Deprecated - void avifImageSetProfileICC(avifImage image, Pointer icc, int iccSize); - /** - * Original signature : void avifImageSetProfileICC(avifImage*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:470 - */ - void avifImageSetProfileICC(avifImage image, byte[] icc, int iccSize); - /** - * Warning: If the Exif payload is set and invalid, avifEncoderWrite() may return AVIF_RESULT_INVALID_EXIF_PAYLOAD
- * Original signature : void avifImageSetMetadataExif(avifImage*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:473
- * @deprecated use the safer methods {@link #avifImageSetMetadataExif(vavi.awt.image.jna.avif.avifImage, byte[], int)} and {@link #avifImageSetMetadataExif(vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer, int)} instead - */ - @Deprecated - void avifImageSetMetadataExif(avifImage image, Pointer exif, int exifSize); - /** - * Warning: If the Exif payload is set and invalid, avifEncoderWrite() may return AVIF_RESULT_INVALID_EXIF_PAYLOAD
- * Original signature : void avifImageSetMetadataExif(avifImage*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:473 - */ - void avifImageSetMetadataExif(avifImage image, byte[] exif, int exifSize); - /** - * Original signature : void avifImageSetMetadataXMP(avifImage*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:474
- * @deprecated use the safer methods {@link #avifImageSetMetadataXMP(vavi.awt.image.jna.avif.avifImage, byte[], int)} and {@link #avifImageSetMetadataXMP(vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer, int)} instead - */ - @Deprecated - void avifImageSetMetadataXMP(avifImage image, Pointer xmp, int xmpSize); - /** - * Original signature : void avifImageSetMetadataXMP(avifImage*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:474 - */ - void avifImageSetMetadataXMP(avifImage image, byte[] xmp, int xmpSize); - /** - * Ignores any pre-existing planes
- * Original signature : void avifImageAllocatePlanes(avifImage*, avifPlanesFlags)
- * native declaration : avif/avif.h:476 - */ - int avifImageAllocatePlanes(avifImage image, int planes); - /** - * Ignores already-freed planes
- * Original signature : void avifImageFreePlanes(avifImage*, avifPlanesFlags)
- * native declaration : avif/avif.h:477 - */ - void avifImageFreePlanes(avifImage image, int planes); - /** - * Original signature : void avifImageStealPlanes(avifImage*, avifImage*, avifPlanesFlags)
- * native declaration : avif/avif.h:478 - */ - void avifImageStealPlanes(avifImage dstImage, avifImage srcImage, int planes); - /** - * Original signature : uint32_t avifRGBFormatChannelCount(avifRGBFormat)
- * native declaration : avif/avif.h:540 - */ - int avifRGBFormatChannelCount(int format); - /** - * Original signature : avifBool avifRGBFormatHasAlpha(avifRGBFormat)
- * native declaration : avif/avif.h:541 - */ - int avifRGBFormatHasAlpha(int format); - /** - * values.
- * Original signature : void avifRGBImageSetDefaults(avifRGBImage*, const avifImage*)
- * native declaration : avif/avif.h:572 - */ - void avifRGBImageSetDefaults(avifRGBImage rgb, avifImage image); - /** - * Original signature : uint32_t avifRGBImagePixelSize(const avifRGBImage*)
- * native declaration : avif/avif.h:573 - */ - int avifRGBImagePixelSize(avifRGBImage rgb); - /** - * Convenience functions. If you supply your own pixels/rowBytes, you do not need to use these.
- * Original signature : void avifRGBImageAllocatePixels(avifRGBImage*)
- * native declaration : avif/avif.h:576 - */ - void avifRGBImageAllocatePixels(avifRGBImage rgb); - /** - * Original signature : void avifRGBImageFreePixels(avifRGBImage*)
- * native declaration : avif/avif.h:577 - */ - void avifRGBImageFreePixels(avifRGBImage rgb); - /** - * The main conversion functions
- * Original signature : avifResult avifImageRGBToYUV(avifImage*, const avifRGBImage*)
- * native declaration : avif/avif.h:580 - */ - int avifImageRGBToYUV(avifImage image, avifRGBImage rgb); - /** - * Original signature : avifResult avifImageYUVToRGB(const avifImage*, avifRGBImage*)
- * native declaration : avif/avif.h:581 - */ - int avifImageYUVToRGB(avifImage image, avifRGBImage rgb); - /** - * so usually you don't need to call these. They are there for convenience.
- * Original signature : avifResult avifRGBImagePremultiplyAlpha(avifRGBImage*)
- * native declaration : avif/avif.h:586 - */ - int avifRGBImagePremultiplyAlpha(avifRGBImage rgb); - /** - * Original signature : avifResult avifRGBImageUnpremultiplyAlpha(avifRGBImage*)
- * native declaration : avif/avif.h:587 - */ - int avifRGBImageUnpremultiplyAlpha(avifRGBImage rgb); - /** - * YUV Utils
- * Original signature : int avifFullToLimitedY(int, int)
- * native declaration : avif/avif.h:592 - */ - int avifFullToLimitedY(int depth, int v); - /** - * Original signature : int avifFullToLimitedUV(int, int)
- * native declaration : avif/avif.h:593 - */ - int avifFullToLimitedUV(int depth, int v); - /** - * Original signature : int avifLimitedToFullY(int, int)
- * native declaration : avif/avif.h:594 - */ - int avifLimitedToFullY(int depth, int v); - /** - * Original signature : int avifLimitedToFullUV(int, int)
- * native declaration : avif/avif.h:595 - */ - int avifLimitedToFullUV(int depth, int v); - /** - * If this returns NULL, the codec choice/flag combination is unavailable
- * Original signature : char* avifCodecName(avifCodecChoice, avifCodecFlags)
- * native declaration : avif/avif.h:618 - */ - String avifCodecName(int choice, int requiredFlags); - /** - * Original signature : avifCodecChoice avifCodecChoiceFromName(const char*)
- * native declaration : avif/avif.h:619
- * @deprecated use the safer methods {@link #avifCodecChoiceFromName(java.lang.String)} and {@link #avifCodecChoiceFromName(com.sun.jna.Pointer)} instead - */ - @Deprecated - int avifCodecChoiceFromName(Pointer name); - /** - * Original signature : avifCodecChoice avifCodecChoiceFromName(const char*)
- * native declaration : avif/avif.h:619 - */ - int avifCodecChoiceFromName(String name); - /** - * Original signature : avifIO* avifIOCreateMemoryReader(const uint8_t*, size_t)
- * native declaration : avif/avif.h:698
- * @deprecated use the safer methods {@link #avifIOCreateMemoryReader(byte[], int)} and {@link #avifIOCreateMemoryReader(com.sun.jna.Pointer, int)} instead - */ - @Deprecated - avifIO avifIOCreateMemoryReader(Pointer data, int size); - /** - * Original signature : avifIO* avifIOCreateMemoryReader(const uint8_t*, size_t)
- * native declaration : avif/avif.h:698 - */ - avifIO avifIOCreateMemoryReader(byte[] data, int size); - /** - * Original signature : avifIO* avifIOCreateFileReader(const char*)
- * native declaration : avif/avif.h:699
- * @deprecated use the safer methods {@link #avifIOCreateFileReader(java.lang.String)} and {@link #avifIOCreateFileReader(com.sun.jna.Pointer)} instead - */ - @Deprecated - avifIO avifIOCreateFileReader(Pointer filename); - /** - * Original signature : avifIO* avifIOCreateFileReader(const char*)
- * native declaration : avif/avif.h:699 - */ - avifIO avifIOCreateFileReader(String filename); - /** - * Original signature : void avifIODestroy(avifIO*)
- * native declaration : avif/avif.h:700 - */ - void avifIODestroy(avifIO io); - /** - * Original signature : char* avifProgressiveStateToString(avifProgressiveState)
- * native declaration : avif/avif.h:794 - */ - String avifProgressiveStateToString(int progressiveState); - /** - * Original signature : avifDecoder* avifDecoderCreate()
- * native declaration : avif/avif.h:896 - */ - avifDecoder avifDecoderCreate(); - /** - * Original signature : void avifDecoderDestroy(avifDecoder*)
- * native declaration : avif/avif.h:897 - */ - void avifDecoderDestroy(avifDecoder decoder); - /** - * Simple interfaces to decode a single image, independent of the decoder afterwards (decoder may be destroyed).
- * call avifDecoderSetIO*() first
- * Original signature : avifResult avifDecoderRead(avifDecoder*, avifImage*)
- * native declaration : avif/avif.h:900 - */ - int avifDecoderRead(avifDecoder decoder, avifImage image); - /** - * Original signature : avifResult avifDecoderReadMemory(avifDecoder*, avifImage*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:901
- * @deprecated use the safer methods {@link #avifDecoderReadMemory(vavi.awt.image.jna.avif.avifDecoder, vavi.awt.image.jna.avif.avifImage, byte[], int)} and {@link #avifDecoderReadMemory(vavi.awt.image.jna.avif.avifDecoder, vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer, int)} instead - */ - @Deprecated - int avifDecoderReadMemory(avifDecoder decoder, avifImage image, Pointer data, int size); - /** - * Original signature : avifResult avifDecoderReadMemory(avifDecoder*, avifImage*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:901 - */ - int avifDecoderReadMemory(avifDecoder decoder, avifImage image, byte[] data, int size); - /** - * Original signature : avifResult avifDecoderReadFile(avifDecoder*, avifImage*, const char*)
- * native declaration : avif/avif.h:902
- * @deprecated use the safer methods {@link #avifDecoderReadFile(vavi.awt.image.jna.avif.avifDecoder, vavi.awt.image.jna.avif.avifImage, java.lang.String)} and {@link #avifDecoderReadFile(vavi.awt.image.jna.avif.avifDecoder, vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer)} instead - */ - @Deprecated - int avifDecoderReadFile(avifDecoder decoder, avifImage image, Pointer filename); - /** - * Original signature : avifResult avifDecoderReadFile(avifDecoder*, avifImage*, const char*)
- * native declaration : avif/avif.h:902 - */ - int avifDecoderReadFile(avifDecoder decoder, avifImage image, String filename); - /** - * Parse again. Normally AVIF_DECODER_SOURCE_AUTO is enough for the common path.
- * Original signature : avifResult avifDecoderSetSource(avifDecoder*, avifDecoderSource)
- * native declaration : avif/avif.h:926 - */ - int avifDecoderSetSource(avifDecoder decoder, int source); - /** - * avifDecoderDestroy(decoder) has no effects on 'io'.
- * Original signature : void avifDecoderSetIO(avifDecoder*, avifIO*)
- * native declaration : avif/avif.h:931 - */ - void avifDecoderSetIO(avifDecoder decoder, avifIO io); - /** - * Original signature : avifResult avifDecoderSetIOMemory(avifDecoder*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:932
- * @deprecated use the safer methods {@link #avifDecoderSetIOMemory(vavi.awt.image.jna.avif.avifDecoder, byte[], int)} and {@link #avifDecoderSetIOMemory(vavi.awt.image.jna.avif.avifDecoder, com.sun.jna.Pointer, int)} instead - */ - @Deprecated - int avifDecoderSetIOMemory(avifDecoder decoder, Pointer data, int size); - /** - * Original signature : avifResult avifDecoderSetIOMemory(avifDecoder*, const uint8_t*, size_t)
- * native declaration : avif/avif.h:932 - */ - int avifDecoderSetIOMemory(avifDecoder decoder, byte[] data, int size); - /** - * Original signature : avifResult avifDecoderSetIOFile(avifDecoder*, const char*)
- * native declaration : avif/avif.h:933
- * @deprecated use the safer methods {@link #avifDecoderSetIOFile(vavi.awt.image.jna.avif.avifDecoder, java.lang.String)} and {@link #avifDecoderSetIOFile(vavi.awt.image.jna.avif.avifDecoder, com.sun.jna.Pointer)} instead - */ - @Deprecated - int avifDecoderSetIOFile(avifDecoder decoder, Pointer filename); - /** - * Original signature : avifResult avifDecoderSetIOFile(avifDecoder*, const char*)
- * native declaration : avif/avif.h:933 - */ - int avifDecoderSetIOFile(avifDecoder decoder, String filename); - /** - * Original signature : avifResult avifDecoderParse(avifDecoder*)
- * native declaration : avif/avif.h:934 - */ - int avifDecoderParse(avifDecoder decoder); - /** - * Original signature : avifResult avifDecoderNextImage(avifDecoder*)
- * native declaration : avif/avif.h:935 - */ - int avifDecoderNextImage(avifDecoder decoder); - /** - * Original signature : avifResult avifDecoderNthImage(avifDecoder*, uint32_t)
- * native declaration : avif/avif.h:936 - */ - int avifDecoderNthImage(avifDecoder decoder, int frameIndex); - /** - * Original signature : avifResult avifDecoderReset(avifDecoder*)
- * native declaration : avif/avif.h:937 - */ - int avifDecoderReset(avifDecoder decoder); - /** - * These functions may be used after a successful call (AVIF_RESULT_OK) to avifDecoderParse().
- * Original signature : avifBool avifDecoderIsKeyframe(const avifDecoder*, uint32_t)
- * native declaration : avif/avif.h:943 - */ - int avifDecoderIsKeyframe(avifDecoder decoder, int frameIndex); - /** - * Original signature : uint32_t avifDecoderNearestKeyframe(const avifDecoder*, uint32_t)
- * native declaration : avif/avif.h:944 - */ - int avifDecoderNearestKeyframe(avifDecoder decoder, int frameIndex); - /** - * This function may be used after a successful call (AVIF_RESULT_OK) to avifDecoderParse().
- * Original signature : avifResult avifDecoderNthImageTiming(const avifDecoder*, uint32_t, avifImageTiming*)
- * native declaration : avif/avif.h:948 - */ - int avifDecoderNthImageTiming(avifDecoder decoder, int frameIndex, avifImageTiming outTiming); - /** - * WARNING: Experimental feature.
- * Original signature : uint32_t avifDecoderDecodedRowCount(const avifDecoder*)
- * native declaration : avif/avif.h:958 - */ - int avifDecoderDecodedRowCount(avifDecoder decoder); - /** - * This function may be used after a successful call (AVIF_RESULT_OK) to avifDecoderParse().
- * Original signature : avifResult avifDecoderNthImageMaxExtent(const avifDecoder*, uint32_t, avifExtent*)
- * native declaration : avif/avif.h:984 - */ - int avifDecoderNthImageMaxExtent(avifDecoder decoder, int frameIndex, avifExtent outExtent); - /** - * Original signature : avifEncoder* avifEncoderCreate()
- * native declaration : avif/avif.h:1031 - */ - avifEncoder avifEncoderCreate(); - /** - * Original signature : avifResult avifEncoderWrite(avifEncoder*, const avifImage*, avifRWData*)
- * native declaration : avif/avif.h:1032 - */ - int avifEncoderWrite(avifEncoder encoder, avifImage image, avifRWData output); - /** - * Original signature : void avifEncoderDestroy(avifEncoder*)
- * native declaration : avif/avif.h:1033 - */ - void avifEncoderDestroy(avifEncoder encoder); - /** - * Original signature : avifResult avifEncoderAddImage(avifEncoder*, const avifImage*, uint64_t, avifAddImageFlags)
- * native declaration : avif/avif.h:1061 - */ - int avifEncoderAddImage(avifEncoder encoder, avifImage image, long durationInTimescales, int addImageFlags); - /** - * Original signature : avifResult avifEncoderAddImageGrid(avifEncoder*, uint32_t, uint32_t, const const avifImage**, avifAddImageFlags)
- * native declaration : avif/avif.h:1062
- * @deprecated use the safer method {@link #avifEncoderAddImageGrid(vavi.awt.image.jna.avif.avifEncoder, int, int, vavi.awt.image.jna.avif.avifImage.ByReference[], int)} instead - */ - @Deprecated - int avifEncoderAddImageGrid(avifEncoder encoder, int gridCols, int gridRows, PointerByReference cellImages, int addImageFlags); - /** - * Original signature : avifResult avifEncoderAddImageGrid(avifEncoder*, uint32_t, uint32_t, const const avifImage**, avifAddImageFlags)
- * native declaration : avif/avif.h:1062 - */ - int avifEncoderAddImageGrid(avifEncoder encoder, int gridCols, int gridRows, avifImage.ByReference[] cellImages, int addImageFlags); - /** - * Original signature : avifResult avifEncoderFinish(avifEncoder*, avifRWData*)
- * native declaration : avif/avif.h:1067 - */ - int avifEncoderFinish(avifEncoder encoder, avifRWData output); - /** - * AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION from avifEncoderWrite() or avifEncoderAddImage().
- * Original signature : void avifEncoderSetCodecSpecificOption(avifEncoder*, const char*, const char*)
- * native declaration : avif/avif.h:1075
- * @deprecated use the safer methods {@link #avifEncoderSetCodecSpecificOption(vavi.awt.image.jna.avif.avifEncoder, java.lang.String, java.lang.String)} and {@link #avifEncoderSetCodecSpecificOption(vavi.awt.image.jna.avif.avifEncoder, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead - */ - @Deprecated - void avifEncoderSetCodecSpecificOption(avifEncoder encoder, Pointer key, Pointer value); - /** - * AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION from avifEncoderWrite() or avifEncoderAddImage().
- * Original signature : void avifEncoderSetCodecSpecificOption(avifEncoder*, const char*, const char*)
- * native declaration : avif/avif.h:1075 - */ - void avifEncoderSetCodecSpecificOption(avifEncoder encoder, String key, String value); - /** - * Helpers
- * Original signature : avifBool avifImageUsesU16(const avifImage*)
- * native declaration : avif/avif.h:1078 - */ - int avifImageUsesU16(avifImage image); - /** - * either the brand 'avif' or 'avis' (or both), without performing any allocations.
- * Original signature : avifBool avifPeekCompatibleFileType(const avifROData*)
- * native declaration : avif/avif.h:1082 - */ - int avifPeekCompatibleFileType(avifROData input); - class avifCodecSpecificOptions extends PointerType { - public avifCodecSpecificOptions(Pointer address) { - super(address); - } - public avifCodecSpecificOptions() { - super(); - } - } - class avifDecoderData extends PointerType { - public avifDecoderData(Pointer address) { - super(address); - } - public avifDecoderData() { - super(); - } - } - class avifEncoderData extends PointerType { - public avifEncoderData(Pointer address) { - super(address); - } - public avifEncoderData() { - super(); - } - } - int AVIF_PLANES_ALL = 0xff; - int AVIF_QUALITY_DEFAULT = -1; - int AVIF_QUALITY_LOSSLESS = 100; - int AVIF_QUALITY_WORST = 0; - int AVIF_QUALITY_BEST = 100; + * enum values + */ + interface avifChannelIndex { + /** native declaration : avif/avif.h:129 */ + int AVIF_CHAN_Y = 0; + /** native declaration : avif/avif.h:130 */ + int AVIF_CHAN_U = 1; + /** native declaration : avif/avif.h:131 */ + int AVIF_CHAN_V = 2; + /** native declaration : avif/avif.h:134 */ + int AVIF_CHAN_A = 3; + } + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifResult { + /** native declaration : avif/avif.h:156 */ + int AVIF_RESULT_OK = 0; + /** native declaration : avif/avif.h:157 */ + int AVIF_RESULT_UNKNOWN_ERROR = 1; + /** native declaration : avif/avif.h:158 */ + int AVIF_RESULT_INVALID_FTYP = 2; + /** native declaration : avif/avif.h:159 */ + int AVIF_RESULT_NO_CONTENT = 3; + /** native declaration : avif/avif.h:160 */ + int AVIF_RESULT_NO_YUV_FORMAT_SELECTED = 4; + /** native declaration : avif/avif.h:161 */ + int AVIF_RESULT_REFORMAT_FAILED = 5; + /** native declaration : avif/avif.h:162 */ + int AVIF_RESULT_UNSUPPORTED_DEPTH = 6; + /** native declaration : avif/avif.h:163 */ + int AVIF_RESULT_ENCODE_COLOR_FAILED = 7; + /** native declaration : avif/avif.h:164 */ + int AVIF_RESULT_ENCODE_ALPHA_FAILED = 8; + /** native declaration : avif/avif.h:165 */ + int AVIF_RESULT_BMFF_PARSE_FAILED = 9; + /** native declaration : avif/avif.h:166 */ + int AVIF_RESULT_MISSING_IMAGE_ITEM = 10; + /** native declaration : avif/avif.h:167 */ + int AVIF_RESULT_DECODE_COLOR_FAILED = 11; + /** native declaration : avif/avif.h:168 */ + int AVIF_RESULT_DECODE_ALPHA_FAILED = 12; + /** native declaration : avif/avif.h:169 */ + int AVIF_RESULT_COLOR_ALPHA_SIZE_MISMATCH = 13; + /** native declaration : avif/avif.h:170 */ + int AVIF_RESULT_ISPE_SIZE_MISMATCH = 14; + /** native declaration : avif/avif.h:171 */ + int AVIF_RESULT_NO_CODEC_AVAILABLE = 15; + /** native declaration : avif/avif.h:172 */ + int AVIF_RESULT_NO_IMAGES_REMAINING = 16; + /** native declaration : avif/avif.h:173 */ + int AVIF_RESULT_INVALID_EXIF_PAYLOAD = 17; + /** native declaration : avif/avif.h:174 */ + int AVIF_RESULT_INVALID_IMAGE_GRID = 18; + /** native declaration : avif/avif.h:175 */ + int AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION = 19; + /** native declaration : avif/avif.h:176 */ + int AVIF_RESULT_TRUNCATED_DATA = 20; + /** + * the avifIO field of avifDecoder is not set
+ * native declaration : avif/avif.h:177 + */ + int AVIF_RESULT_IO_NOT_SET = 21; + /** native declaration : avif/avif.h:178 */ + int AVIF_RESULT_IO_ERROR = 22; + /** + * similar to EAGAIN/EWOULDBLOCK, this means the avifIO doesn't have necessary data available yet
+ * native declaration : avif/avif.h:179 + */ + int AVIF_RESULT_WAITING_ON_IO = 23; + /** + * an argument passed into this function is invalid
+ * native declaration : avif/avif.h:180 + */ + int AVIF_RESULT_INVALID_ARGUMENT = 24; + /** + * a requested code path is not (yet) implemented
+ * native declaration : avif/avif.h:181 + */ + int AVIF_RESULT_NOT_IMPLEMENTED = 25; + /** native declaration : avif/avif.h:182 */ + int AVIF_RESULT_OUT_OF_MEMORY = 26; + /** + * a setting that can't change is changed during encoding
+ * native declaration : avif/avif.h:183 + */ + int AVIF_RESULT_CANNOT_CHANGE_SETTING = 27; + /** + * the image is incompatible with already encoded images
+ * native declaration : avif/avif.h:184 + */ + int AVIF_RESULT_INCOMPATIBLE_IMAGE = 28; + /** native declaration : avif/avif.h:192 */ + int AVIF_RESULT_NO_AV1_ITEMS_FOUND = (int)AvifLibrary.avifResult.AVIF_RESULT_MISSING_IMAGE_ITEM; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifHeaderFormat { + /** native declaration : avif/avif.h:203 */ + int AVIF_HEADER_FULL = 0; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifPixelFormat { + /** native declaration : avif/avif.h:259 */ + int AVIF_PIXEL_FORMAT_NONE = 0; + /** native declaration : avif/avif.h:261 */ + int AVIF_PIXEL_FORMAT_YUV444 = 1; + /** native declaration : avif/avif.h:262 */ + int AVIF_PIXEL_FORMAT_YUV422 = 2; + /** native declaration : avif/avif.h:263 */ + int AVIF_PIXEL_FORMAT_YUV420 = 3; + /** native declaration : avif/avif.h:264 */ + int AVIF_PIXEL_FORMAT_YUV400 = 4; + /** native declaration : avif/avif.h:265 */ + int AVIF_PIXEL_FORMAT_COUNT = 5; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifChromaSamplePosition { + /** native declaration : avif/avif.h:289 */ + int AVIF_CHROMA_SAMPLE_POSITION_UNKNOWN = 0; + /** native declaration : avif/avif.h:290 */ + int AVIF_CHROMA_SAMPLE_POSITION_VERTICAL = 1; + /** native declaration : avif/avif.h:291 */ + int AVIF_CHROMA_SAMPLE_POSITION_COLOCATED = 2; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifRange { + /** native declaration : avif/avif.h:299 */ + int AVIF_RANGE_LIMITED = 0; + /** native declaration : avif/avif.h:300 */ + int AVIF_RANGE_FULL = 1; + }; + int AVIF_COLOR_PRIMARIES_UNKNOWN = 0; + int AVIF_COLOR_PRIMARIES_BT709 = 1; + int AVIF_COLOR_PRIMARIES_SRGB = 1; + int AVIF_COLOR_PRIMARIES_IEC61966_2_4 = 1; + int AVIF_COLOR_PRIMARIES_UNSPECIFIED = 2; + int AVIF_COLOR_PRIMARIES_BT470M = 4; + int AVIF_COLOR_PRIMARIES_BT470BG = 5; + int AVIF_COLOR_PRIMARIES_BT601 = 6; + int AVIF_COLOR_PRIMARIES_SMPTE240 = 7; + int AVIF_COLOR_PRIMARIES_GENERIC_FILM = 8; + int AVIF_COLOR_PRIMARIES_BT2020 = 9; + int AVIF_COLOR_PRIMARIES_BT2100 = 9; + int AVIF_COLOR_PRIMARIES_XYZ = 10; + int AVIF_COLOR_PRIMARIES_SMPTE431 = 11; + int AVIF_COLOR_PRIMARIES_SMPTE432 = 12; + int AVIF_COLOR_PRIMARIES_DCI_P3 = 12; + int AVIF_COLOR_PRIMARIES_EBU3213 = 22; + int AVIF_TRANSFER_CHARACTERISTICS_UNKNOWN = 0; + int AVIF_TRANSFER_CHARACTERISTICS_BT709 = 1; + int AVIF_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2; + /** 2.2 gamma */ + int AVIF_TRANSFER_CHARACTERISTICS_BT470M = 4; + /** 2.8 gamma */ + int AVIF_TRANSFER_CHARACTERISTICS_BT470BG = 5; + int AVIF_TRANSFER_CHARACTERISTICS_BT601 = 6; + int AVIF_TRANSFER_CHARACTERISTICS_SMPTE240 = 7; + int AVIF_TRANSFER_CHARACTERISTICS_LINEAR = 8; + int AVIF_TRANSFER_CHARACTERISTICS_LOG100 = 9; + int AVIF_TRANSFER_CHARACTERISTICS_LOG100_SQRT10 = 10; + int AVIF_TRANSFER_CHARACTERISTICS_IEC61966 = 11; + int AVIF_TRANSFER_CHARACTERISTICS_BT1361 = 12; + int AVIF_TRANSFER_CHARACTERISTICS_SRGB = 13; + int AVIF_TRANSFER_CHARACTERISTICS_BT2020_10BIT = 14; + int AVIF_TRANSFER_CHARACTERISTICS_BT2020_12BIT = 15; + /** Perceptual Quantizer (HDR); BT.2100 PQ */ + int AVIF_TRANSFER_CHARACTERISTICS_PQ = 16; + int AVIF_TRANSFER_CHARACTERISTICS_SMPTE2084 = 16; + int AVIF_TRANSFER_CHARACTERISTICS_SMPTE428 = 17; + /** Hybrid Log-Gamma (HDR); ARIB STD-B67; BT.2100 HLG */ + int AVIF_TRANSFER_CHARACTERISTICS_HLG = 18; + int AVIF_MATRIX_COEFFICIENTS_IDENTITY = 0; + int AVIF_MATRIX_COEFFICIENTS_BT709 = 1; + int AVIF_MATRIX_COEFFICIENTS_UNSPECIFIED = 2; + int AVIF_MATRIX_COEFFICIENTS_FCC = 4; + int AVIF_MATRIX_COEFFICIENTS_BT470BG = 5; + int AVIF_MATRIX_COEFFICIENTS_BT601 = 6; + int AVIF_MATRIX_COEFFICIENTS_SMPTE240 = 7; + int AVIF_MATRIX_COEFFICIENTS_YCGCO = 8; + int AVIF_MATRIX_COEFFICIENTS_BT2020_NCL = 9; + int AVIF_MATRIX_COEFFICIENTS_BT2020_CL = 10; + int AVIF_MATRIX_COEFFICIENTS_SMPTE2085 = 11; + int AVIF_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL = 12; + int AVIF_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL = 13; + int AVIF_MATRIX_COEFFICIENTS_ICTCP = 14; + int AVIF_MATRIX_COEFFICIENTS_LAST = 15; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifTransformFlag { + /** native declaration : avif/avif.h:421 */ + int AVIF_TRANSFORM_NONE = 0; + /** native declaration : avif/avif.h:423 */ + int AVIF_TRANSFORM_PASP = (1 << 0); + /** native declaration : avif/avif.h:424 */ + int AVIF_TRANSFORM_CLAP = (1 << 1); + /** native declaration : avif/avif.h:425 */ + int AVIF_TRANSFORM_IROT = (1 << 2); + /** native declaration : avif/avif.h:426 */ + int AVIF_TRANSFORM_IMIR = (1 << 3); + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifRGBFormat { + /** native declaration : avif/avif.h:859 */ + int AVIF_RGB_FORMAT_RGB = 0; + /** + * This is the default format set in avifRGBImageSetDefaults().
+ * native declaration : avif/avif.h:860 + */ + int AVIF_RGB_FORMAT_RGBA = 1; + /** native declaration : avif/avif.h:861 */ + int AVIF_RGB_FORMAT_ARGB = 2; + /** native declaration : avif/avif.h:862 */ + int AVIF_RGB_FORMAT_BGR = 3; + /** native declaration : avif/avif.h:863 */ + int AVIF_RGB_FORMAT_BGRA = 4; + /** native declaration : avif/avif.h:864 */ + int AVIF_RGB_FORMAT_ABGR = 5; + /** native declaration : avif/avif.h:874 */ + int AVIF_RGB_FORMAT_RGB_565 = 6; + /** native declaration : avif/avif.h:875 */ + int AVIF_RGB_FORMAT_COUNT = 7; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifChromaUpsampling { + /** + * Chooses best trade off of speed/quality (uses BILINEAR libyuv if available,
+ * native declaration : avif/avif.h:882 + */ + int AVIF_CHROMA_UPSAMPLING_AUTOMATIC = 0; + /** + * Chooses speed over quality (same as NEAREST)
+ * native declaration : avif/avif.h:884 + */ + int AVIF_CHROMA_UPSAMPLING_FASTEST = 1; + /** + * Chooses the best quality upsampling, given settings (same as BILINEAR)
+ * native declaration : avif/avif.h:885 + */ + int AVIF_CHROMA_UPSAMPLING_BEST_QUALITY = 2; + /** + * Uses nearest-neighbor filter
+ * native declaration : avif/avif.h:886 + */ + int AVIF_CHROMA_UPSAMPLING_NEAREST = 3; + /** + * Uses bilinear filter
+ * native declaration : avif/avif.h:887 + */ + int AVIF_CHROMA_UPSAMPLING_BILINEAR = 4; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifChromaDownsampling { + /** + * Chooses best trade off of speed/quality (same as AVERAGE)
+ * native declaration : avif/avif.h:892 + */ + int AVIF_CHROMA_DOWNSAMPLING_AUTOMATIC = 0; + /** + * Chooses speed over quality (same as AVERAGE)
+ * native declaration : avif/avif.h:893 + */ + int AVIF_CHROMA_DOWNSAMPLING_FASTEST = 1; + /** + * Chooses the best quality upsampling (same as AVERAGE)
+ * native declaration : avif/avif.h:894 + */ + int AVIF_CHROMA_DOWNSAMPLING_BEST_QUALITY = 2; + /** + * Uses averaging filter
+ * native declaration : avif/avif.h:895 + */ + int AVIF_CHROMA_DOWNSAMPLING_AVERAGE = 3; + /** + * Uses sharp yuv filter (libsharpyuv), available for 4:2:0 only, ignored for 4:2:2
+ * native declaration : avif/avif.h:896 + */ + int AVIF_CHROMA_DOWNSAMPLING_SHARP_YUV = 4; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifCodecChoice { + /** native declaration : avif/avif.h:958 */ + int AVIF_CODEC_CHOICE_AUTO = 0; + /** native declaration : avif/avif.h:959 */ + int AVIF_CODEC_CHOICE_AOM = 1; + /** + * Decode only
+ * native declaration : avif/avif.h:960 + */ + int AVIF_CODEC_CHOICE_DAV1D = 2; + /** + * Decode only
+ * native declaration : avif/avif.h:961 + */ + int AVIF_CODEC_CHOICE_LIBGAV1 = 3; + /** + * Encode only
+ * native declaration : avif/avif.h:962 + */ + int AVIF_CODEC_CHOICE_RAV1E = 4; + /** + * Encode only
+ * native declaration : avif/avif.h:963 + */ + int AVIF_CODEC_CHOICE_SVT = 5; + /** + * Experimental (AV2)
+ * native declaration : avif/avif.h:964 + */ + int AVIF_CODEC_CHOICE_AVM = 6; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifCodecFlag { + /** native declaration : avif/avif.h:969 */ + int AVIF_CODEC_FLAG_CAN_DECODE = (1 << 0); + /** native declaration : avif/avif.h:970 */ + int AVIF_CODEC_FLAG_CAN_ENCODE = (1 << 1); + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifStrictFlag { + /** native declaration : avif/avif.h:1047 */ + int AVIF_STRICT_DISABLED = 0; + /** native declaration : avif/avif.h:1053 */ + int AVIF_STRICT_PIXI_REQUIRED = (1 << 0); + /** native declaration : avif/avif.h:1058 */ + int AVIF_STRICT_CLAP_VALID = (1 << 1); + /** native declaration : avif/avif.h:1066 */ + int AVIF_STRICT_ALPHA_ISPE_REQUIRED = (1 << 2); + /** native declaration : avif/avif.h:1069 */ + int AVIF_STRICT_ENABLED = (int)AvifLibrary.avifStrictFlag.AVIF_STRICT_PIXI_REQUIRED | (int)AvifLibrary.avifStrictFlag.AVIF_STRICT_CLAP_VALID | (int)AvifLibrary.avifStrictFlag.AVIF_STRICT_ALPHA_ISPE_REQUIRED; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifDecoderSource { + /** native declaration : avif/avif.h:1089 */ + int AVIF_DECODER_SOURCE_AUTO = 0; + /** native declaration : avif/avif.h:1093 */ + int AVIF_DECODER_SOURCE_PRIMARY_ITEM = 1; + /** native declaration : avif/avif.h:1097 */ + int AVIF_DECODER_SOURCE_TRACKS = 2; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifProgressiveState { + /** native declaration : avif/avif.h:1117 */ + int AVIF_PROGRESSIVE_STATE_UNAVAILABLE = 0; + /** native declaration : avif/avif.h:1122 */ + int AVIF_PROGRESSIVE_STATE_AVAILABLE = 1; + /** native declaration : avif/avif.h:1129 */ + int AVIF_PROGRESSIVE_STATE_ACTIVE = 2; + }; + /** + * native declaration : avif/avif.h
+ * enum values + */ + interface avifAddImageFlag { + /** native declaration : avif/avif.h:1465 */ + int AVIF_ADD_IMAGE_FLAG_NONE = 0; + /** native declaration : avif/avif.h:1468 */ + int AVIF_ADD_IMAGE_FLAG_FORCE_KEYFRAME = (1 << 0); + /** native declaration : avif/avif.h:1473 */ + int AVIF_ADD_IMAGE_FLAG_SINGLE = (1 << 1); + }; + /** native declaration : avif/avif.h */ + int AVIF_VERSION_MAJOR = (int)1; + /** native declaration : avif/avif.h */ + int AVIF_VERSION_MINOR = (int)0; + /** native declaration : avif/avif.h */ + int AVIF_VERSION_PATCH = (int)3; + /** native declaration : avif/avif.h */ + int AVIF_VERSION_DEVEL = (int)1; + /** native declaration : avif/avif.h */ + int AVIF_VERSION = (int)((1 * 1000000) + (0 * 10000) + (3 * 100) + 1); + /** native declaration : avif/avif.h */ + int AVIF_TRUE = (int)1; + /** native declaration : avif/avif.h */ + int AVIF_FALSE = (int)0; + /** native declaration : avif/avif.h */ + int AVIF_DIAGNOSTICS_ERROR_BUFFER_SIZE = (int)256; + /** native declaration : avif/avif.h */ + int AVIF_DEFAULT_IMAGE_SIZE_LIMIT = (int)(16384 * 16384); + /** native declaration : avif/avif.h */ + int AVIF_DEFAULT_IMAGE_DIMENSION_LIMIT = (int)32768; + /** native declaration : avif/avif.h */ + int AVIF_DEFAULT_IMAGE_COUNT_LIMIT = (int)(12 * 3600 * 60); + /** native declaration : avif/avif.h */ + int AVIF_QUALITY_DEFAULT = (int)-1; + /** native declaration : avif/avif.h */ + int AVIF_QUALITY_LOSSLESS = (int)100; + /** native declaration : avif/avif.h */ + int AVIF_QUALITY_WORST = (int)0; + /** native declaration : avif/avif.h */ + int AVIF_QUALITY_BEST = (int)100; + /** native declaration : avif/avif.h */ + int AVIF_QUANTIZER_LOSSLESS = (int)0; + /** native declaration : avif/avif.h */ + int AVIF_QUANTIZER_BEST_QUALITY = (int)0; + /** native declaration : avif/avif.h */ + int AVIF_QUANTIZER_WORST_QUALITY = (int)63; + /** native declaration : avif/avif.h */ + int AVIF_PLANE_COUNT_YUV = (int)3; + /** native declaration : avif/avif.h */ + int AVIF_SPEED_DEFAULT = (int)-1; + /** native declaration : avif/avif.h */ + int AVIF_SPEED_SLOWEST = (int)0; + /** native declaration : avif/avif.h */ + int AVIF_SPEED_FASTEST = (int)10; + /** native declaration : avif/avif.h */ + int AVIF_REPETITION_COUNT_INFINITE = (int)-1; + /** native declaration : avif/avif.h */ + int AVIF_REPETITION_COUNT_UNKNOWN = (int)-2; + /** native declaration : avif/avif.h */ + int AVIF_MAX_AV1_LAYER_COUNT = (int)4; + /** native declaration : avif/avif.h */ + public interface avifIODestroyFunc extends Callback { + void apply(avifIO io); + }; + /** native declaration : avif/avif.h */ + public interface avifIOReadFunc extends Callback { + int apply(avifIO io, int readFlags, long offset, NativeLong size, avifROData out); + }; + /** native declaration : avif/avif.h */ + public interface avifIOWriteFunc extends Callback { + int apply(avifIO io, int writeFlags, long offset, Pointer data, NativeLong size); + }; + /** + * Version
+ * Original signature : char* avifVersion()
+ * native declaration : avif/avif.h:140 + */ + String avifVersion(); + /** + * Original signature : void avifCodecVersions(char[256])
+ * native declaration : avif/avif.h:141
+ * @deprecated use the safer methods {@link #avifCodecVersions(java.nio.ByteBuffer)} and {@link #avifCodecVersions(com.sun.jna.Pointer)} instead + */ + @Deprecated + void avifCodecVersions(Pointer outBuffer); + /** + * Original signature : void avifCodecVersions(char[256])
+ * native declaration : avif/avif.h:141 + */ + void avifCodecVersions(ByteBuffer outBuffer); + /** + * returns 0 if libavif wasn't compiled with libyuv support
+ * Original signature : int avifLibYUVVersion()
+ * native declaration : avif/avif.h:142 + */ + int avifLibYUVVersion(); + /** + * Returns NULL on memory allocation failure.
+ * Original signature : void* avifAlloc(size_t)
+ * native declaration : avif/avif.h:148 + */ + Pointer avifAlloc(NativeLong size); + /** + * Original signature : void avifFree(void*)
+ * native declaration : avif/avif.h:149 + */ + void avifFree(Pointer p); + /** + * Original signature : char* avifResultToString(avifResult)
+ * native declaration : avif/avif.h:195 + */ + String avifResultToString(int result); + /** + * If AVIF_RESULT_OUT_OF_MEMORY is returned, raw is left unchanged.
+ * Original signature : avifResult avifRWDataRealloc(avifRWData*, size_t)
+ * native declaration : avif/avif.h:236 + */ + int avifRWDataRealloc(avifRWData raw, NativeLong newSize); + /** + * Original signature : avifResult avifRWDataSet(avifRWData*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:237
+ * @deprecated use the safer methods {@link #avifRWDataSet(vavi.awt.image.jna.avif.avifRWData, byte[], NativeLong)} and {@link #avifRWDataSet(vavi.awt.image.jna.avif.avifRWData, com.sun.jna.Pointer, NativeLong)} instead + */ + @Deprecated + int avifRWDataSet(avifRWData raw, Pointer data, NativeLong len); + /** + * Original signature : avifResult avifRWDataSet(avifRWData*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:237 + */ + int avifRWDataSet(avifRWData raw, byte data[], NativeLong len); + /** + * Original signature : void avifRWDataFree(avifRWData*)
+ * native declaration : avif/avif.h:238 + */ + void avifRWDataFree(avifRWData raw); + /** + * Validates the first bytes of the Exif payload and finds the TIFF header offset (up to UINT32_MAX).
+ * Original signature : avifResult avifGetExifTiffHeaderOffset(const uint8_t*, size_t, size_t*)
+ * native declaration : avif/avif.h:244
+ * @deprecated use the safer methods {@link #avifGetExifTiffHeaderOffset(byte[], NativeLong, NativeLongByReference)} and {@link #avifGetExifTiffHeaderOffset(com.sun.jna.Pointer, NativeLong, NativeLongByReference)} instead + */ + @Deprecated + int avifGetExifTiffHeaderOffset(Pointer exif, NativeLong exifSize, NativeLongByReference offset); + /** + * Validates the first bytes of the Exif payload and finds the TIFF header offset (up to UINT32_MAX).
+ * Original signature : avifResult avifGetExifTiffHeaderOffset(const uint8_t*, size_t, size_t*)
+ * native declaration : avif/avif.h:244 + */ + int avifGetExifTiffHeaderOffset(byte exif[], NativeLong exifSize, NativeLongByReference offset); + /** + * If the offset is set to exifSize, there was no parsing error but no orientation tag was found.
+ * Original signature : avifResult avifGetExifOrientationOffset(const uint8_t*, size_t, size_t*)
+ * native declaration : avif/avif.h:247
+ * @deprecated use the safer methods {@link #avifGetExifOrientationOffset(byte[], NativeLong, NativeLongByReference)} and {@link #avifGetExifOrientationOffset(com.sun.jna.Pointer, NativeLong, NativeLongByReference)} instead + */ + @Deprecated + int avifGetExifOrientationOffset(Pointer exif, NativeLong exifSize, NativeLongByReference offset); + /** + * If the offset is set to exifSize, there was no parsing error but no orientation tag was found.
+ * Original signature : avifResult avifGetExifOrientationOffset(const uint8_t*, size_t, size_t*)
+ * native declaration : avif/avif.h:247 + */ + int avifGetExifOrientationOffset(byte exif[], NativeLong exifSize, NativeLongByReference offset); + /** + * Original signature : char* avifPixelFormatToString(avifPixelFormat)
+ * native declaration : avif/avif.h:267 + */ + String avifPixelFormatToString(int format); + /** + * an AV1 implementation that only supports profile 0 to hardcode subsampling_x and subsampling_y to 1.
+ * Original signature : void avifGetPixelFormatInfo(avifPixelFormat, avifPixelFormatInfo*)
+ * native declaration : avif/avif.h:282 + */ + void avifGetPixelFormatInfo(int format, avifPixelFormatInfo info); + /** + * outPrimaries: rX, rY, gX, gY, bX, bY, wX, wY
+ * Original signature : void avifColorPrimariesGetValues(avifColorPrimaries, float[8])
+ * native declaration : avif/avif.h:331
+ * @deprecated use the safer methods {@link #avifColorPrimariesGetValues(short, java.nio.FloatBuffer)} and {@link #avifColorPrimariesGetValues(short, com.sun.jna.ptr.FloatByReference)} instead + */ + @Deprecated + void avifColorPrimariesGetValues(short acp, FloatByReference outPrimaries); + /** + * outPrimaries: rX, rY, gX, gY, bX, bY, wX, wY
+ * Original signature : void avifColorPrimariesGetValues(avifColorPrimaries, float[8])
+ * native declaration : avif/avif.h:331 + */ + void avifColorPrimariesGetValues(short acp, FloatBuffer outPrimaries); + /** + * Original signature : avifColorPrimaries avifColorPrimariesFind(const float[8], const char**)
+ * native declaration : avif/avif.h:332
+ * @deprecated use the safer methods {@link #avifColorPrimariesFind(float[], java.lang.String[])} and {@link #avifColorPrimariesFind(com.sun.jna.ptr.FloatByReference, com.sun.jna.ptr.PointerByReference)} instead + */ + @Deprecated + short avifColorPrimariesFind(FloatByReference inPrimaries, PointerByReference outName); + /** + * Original signature : avifColorPrimaries avifColorPrimariesFind(const float[8], const char**)
+ * native declaration : avif/avif.h:332 + */ + short avifColorPrimariesFind(float inPrimaries[], String outName[]); + /** + * to that value and returns AVIF_RESULT_OK. Returns an error otherwise.
+ * Original signature : avifResult avifTransferCharacteristicsGetGamma(avifTransferCharacteristics, float*)
+ * native declaration : avif/avif.h:362
+ * @deprecated use the safer methods {@link #avifTransferCharacteristicsGetGamma(short, java.nio.FloatBuffer)} and {@link #avifTransferCharacteristicsGetGamma(short, com.sun.jna.ptr.FloatByReference)} instead + */ + @Deprecated + int avifTransferCharacteristicsGetGamma(short atc, FloatByReference gamma); + /** + * to that value and returns AVIF_RESULT_OK. Returns an error otherwise.
+ * Original signature : avifResult avifTransferCharacteristicsGetGamma(avifTransferCharacteristics, float*)
+ * native declaration : avif/avif.h:362 + */ + int avifTransferCharacteristicsGetGamma(short atc, FloatBuffer gamma); + /** + * Original signature : avifTransferCharacteristics avifTransferCharacteristicsFindByGamma(float)
+ * native declaration : avif/avif.h:363 + */ + short avifTransferCharacteristicsFindByGamma(float gamma); + /** + * Original signature : void avifDiagnosticsClearError(avifDiagnostics*)
+ * native declaration : avif/avif.h:405 + */ + void avifDiagnosticsClearError(avifDiagnostics diag); + /** + * values are not guaranteed to be complete or correct and should not be used.
+ * Original signature : avifBool avifCropRectConvertCleanApertureBox(avifCropRect*, const avifCleanApertureBox*, uint32_t, uint32_t, avifPixelFormat, avifDiagnostics*)
+ * native declaration : avif/avif.h:498 + */ + int avifCropRectConvertCleanApertureBox(avifCropRect cropRect, avifCleanApertureBox clap, int imageW, int imageH, int yuvFormat, avifDiagnostics diag); + /** + * Original signature : avifBool avifCleanApertureBoxConvertCropRect(avifCleanApertureBox*, const avifCropRect*, uint32_t, uint32_t, avifPixelFormat, avifDiagnostics*)
+ * native declaration : avif/avif.h:504 + */ + int avifCleanApertureBoxConvertCropRect(avifCleanApertureBox clap, avifCropRect cropRect, int imageW, int imageH, int yuvFormat, avifDiagnostics diag); + /** + * avifImageCreate() and avifImageCreateEmpty() return NULL if arguments are invalid or if a memory allocation failed.
+ * Original signature : avifImage* avifImageCreate(uint32_t, uint32_t, uint32_t, avifPixelFormat)
+ * native declaration : avif/avif.h:777 + */ + avifImage avifImageCreate(int width, int height, int depth, int yuvFormat); + /** + * helper for making an image to decode into
+ * Original signature : avifImage* avifImageCreateEmpty()
+ * native declaration : avif/avif.h:778 + */ + avifImage avifImageCreateEmpty(); + /** + * and if AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP is defined.
+ * Original signature : avifResult avifImageCopy(avifImage*, const avifImage*, avifPlanesFlags)
+ * native declaration : avif/avif.h:781 + */ + int avifImageCopy(avifImage dstImage, avifImage srcImage, int planes); + /** + * Ignores the gainMap field (which exists only if AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP is defined).
+ * Original signature : avifResult avifImageSetViewRect(avifImage*, const avifImage*, const avifCropRect*)
+ * native declaration : avif/avif.h:784 + */ + int avifImageSetViewRect(avifImage dstImage, avifImage srcImage, avifCropRect rect); + /** + * Original signature : void avifImageDestroy(avifImage*)
+ * native declaration : avif/avif.h:785 + */ + void avifImageDestroy(avifImage image); + /** + * Original signature : avifResult avifImageSetProfileICC(avifImage*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:787
+ * @deprecated use the safer methods {@link #avifImageSetProfileICC(vavi.awt.image.jna.avif.avifImage, byte[], NativeLong)} and {@link #avifImageSetProfileICC(vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer, NativeLong)} instead + */ + @Deprecated + int avifImageSetProfileICC(avifImage image, Pointer icc, NativeLong iccSize); + /** + * Original signature : avifResult avifImageSetProfileICC(avifImage*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:787 + */ + int avifImageSetProfileICC(avifImage image, byte icc[], NativeLong iccSize); + /** + * Warning: If the Exif payload is set and invalid, avifEncoderWrite() may return AVIF_RESULT_INVALID_EXIF_PAYLOAD.
+ * Original signature : avifResult avifImageSetMetadataExif(avifImage*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:792
+ * @deprecated use the safer methods {@link #avifImageSetMetadataExif(vavi.awt.image.jna.avif.avifImage, byte[], NativeLong)} and {@link #avifImageSetMetadataExif(vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer, NativeLong)} instead + */ + @Deprecated + int avifImageSetMetadataExif(avifImage image, Pointer exif, NativeLong exifSize); + /** + * Warning: If the Exif payload is set and invalid, avifEncoderWrite() may return AVIF_RESULT_INVALID_EXIF_PAYLOAD.
+ * Original signature : avifResult avifImageSetMetadataExif(avifImage*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:792 + */ + int avifImageSetMetadataExif(avifImage image, byte exif[], NativeLong exifSize); + /** + * Sets XMP metadata.
+ * Original signature : avifResult avifImageSetMetadataXMP(avifImage*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:794
+ * @deprecated use the safer methods {@link #avifImageSetMetadataXMP(vavi.awt.image.jna.avif.avifImage, byte[], NativeLong)} and {@link #avifImageSetMetadataXMP(vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer, NativeLong)} instead + */ + @Deprecated + int avifImageSetMetadataXMP(avifImage image, Pointer xmp, NativeLong xmpSize); + /** + * Sets XMP metadata.
+ * Original signature : avifResult avifImageSetMetadataXMP(avifImage*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:794 + */ + int avifImageSetMetadataXMP(avifImage image, byte xmp[], NativeLong xmpSize); + /** + * AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP is defined).
+ * Ignores any pre-existing planes
+ * Original signature : avifResult avifImageAllocatePlanes(avifImage*, avifPlanesFlags)
+ * native declaration : avif/avif.h:798 + */ + int avifImageAllocatePlanes(avifImage image, int planes); + /** + * Ignores already-freed planes
+ * Original signature : void avifImageFreePlanes(avifImage*, avifPlanesFlags)
+ * native declaration : avif/avif.h:799 + */ + void avifImageFreePlanes(avifImage image, int planes); + /** + * Original signature : void avifImageStealPlanes(avifImage*, avifImage*, avifPlanesFlags)
+ * native declaration : avif/avif.h:800 + */ + void avifImageStealPlanes(avifImage dstImage, avifImage srcImage, int planes); + /** + * dstWidth*dstHeight should be <= AVIF_DEFAULT_IMAGE_SIZE_LIMIT.
+ * Original signature : avifResult avifImageScale(avifImage*, uint32_t, uint32_t, avifDiagnostics*)
+ * native declaration : avif/avif.h:831 + */ + int avifImageScale(avifImage image, int dstWidth, int dstHeight, avifDiagnostics diag); + /** + * Original signature : uint32_t avifRGBFormatChannelCount(avifRGBFormat)
+ * native declaration : avif/avif.h:877 + */ + int avifRGBFormatChannelCount(int format); + /** + * Original signature : avifBool avifRGBFormatHasAlpha(avifRGBFormat)
+ * native declaration : avif/avif.h:878 + */ + int avifRGBFormatHasAlpha(int format); + /** + * values.
+ * Original signature : void avifRGBImageSetDefaults(avifRGBImage*, const avifImage*)
+ * native declaration : avif/avif.h:928 + */ + void avifRGBImageSetDefaults(avifRGBImage rgb, avifImage image); + /** + * Original signature : uint32_t avifRGBImagePixelSize(const avifRGBImage*)
+ * native declaration : avif/avif.h:929 + */ + int avifRGBImagePixelSize(avifRGBImage rgb); + /** + * Convenience functions. If you supply your own pixels/rowBytes, you do not need to use these.
+ * Original signature : avifResult avifRGBImageAllocatePixels(avifRGBImage*)
+ * native declaration : avif/avif.h:932 + */ + int avifRGBImageAllocatePixels(avifRGBImage rgb); + /** + * Original signature : void avifRGBImageFreePixels(avifRGBImage*)
+ * native declaration : avif/avif.h:933 + */ + void avifRGBImageFreePixels(avifRGBImage rgb); + /** + * The main conversion functions
+ * Original signature : avifResult avifImageRGBToYUV(avifImage*, const avifRGBImage*)
+ * native declaration : avif/avif.h:936 + */ + int avifImageRGBToYUV(avifImage image, avifRGBImage rgb); + /** + * Original signature : avifResult avifImageYUVToRGB(const avifImage*, avifRGBImage*)
+ * native declaration : avif/avif.h:937 + */ + int avifImageYUVToRGB(avifImage image, avifRGBImage rgb); + /** + * so usually you don't need to call these. They are there for convenience.
+ * Original signature : avifResult avifRGBImagePremultiplyAlpha(avifRGBImage*)
+ * native declaration : avif/avif.h:942 + */ + int avifRGBImagePremultiplyAlpha(avifRGBImage rgb); + /** + * Original signature : avifResult avifRGBImageUnpremultiplyAlpha(avifRGBImage*)
+ * native declaration : avif/avif.h:943 + */ + int avifRGBImageUnpremultiplyAlpha(avifRGBImage rgb); + /** + * YUV Utils
+ * Original signature : int avifFullToLimitedY(uint32_t, int)
+ * native declaration : avif/avif.h:948 + */ + int avifFullToLimitedY(int depth, int v); + /** + * Original signature : int avifFullToLimitedUV(uint32_t, int)
+ * native declaration : avif/avif.h:949 + */ + int avifFullToLimitedUV(int depth, int v); + /** + * Original signature : int avifLimitedToFullY(uint32_t, int)
+ * native declaration : avif/avif.h:950 + */ + int avifLimitedToFullY(int depth, int v); + /** + * Original signature : int avifLimitedToFullUV(uint32_t, int)
+ * native declaration : avif/avif.h:951 + */ + int avifLimitedToFullUV(int depth, int v); + /** + * If this returns NULL, the codec choice/flag combination is unavailable
+ * Original signature : char* avifCodecName(avifCodecChoice, avifCodecFlags)
+ * native declaration : avif/avif.h:975 + */ + String avifCodecName(int choice, int requiredFlags); + /** + * Original signature : avifCodecChoice avifCodecChoiceFromName(const char*)
+ * native declaration : avif/avif.h:976
+ * @deprecated use the safer methods {@link #avifCodecChoiceFromName(java.lang.String)} and {@link #avifCodecChoiceFromName(com.sun.jna.Pointer)} instead + */ + @Deprecated + int avifCodecChoiceFromName(Pointer name); + /** + * Original signature : avifCodecChoice avifCodecChoiceFromName(const char*)
+ * native declaration : avif/avif.h:976 + */ + int avifCodecChoiceFromName(String name); + /** + * Returns NULL if the reader cannot be allocated.
+ * Original signature : avifIO* avifIOCreateMemoryReader(const uint8_t*, size_t)
+ * native declaration : avif/avif.h:1032
+ * @deprecated use the safer methods {@link #avifIOCreateMemoryReader(byte[], NativeLong)} and {@link #avifIOCreateMemoryReader(com.sun.jna.Pointer, NativeLong)} instead + */ + @Deprecated + avifIO avifIOCreateMemoryReader(Pointer data, NativeLong size); + /** + * Returns NULL if the reader cannot be allocated.
+ * Original signature : avifIO* avifIOCreateMemoryReader(const uint8_t*, size_t)
+ * native declaration : avif/avif.h:1032 + */ + avifIO avifIOCreateMemoryReader(byte data[], NativeLong size); + /** + * Returns NULL if the file cannot be opened or if the reader cannot be allocated.
+ * Original signature : avifIO* avifIOCreateFileReader(const char*)
+ * native declaration : avif/avif.h:1034
+ * @deprecated use the safer methods {@link #avifIOCreateFileReader(java.lang.String)} and {@link #avifIOCreateFileReader(com.sun.jna.Pointer)} instead + */ + @Deprecated + avifIO avifIOCreateFileReader(Pointer filename); + /** + * Returns NULL if the file cannot be opened or if the reader cannot be allocated.
+ * Original signature : avifIO* avifIOCreateFileReader(const char*)
+ * native declaration : avif/avif.h:1034 + */ + avifIO avifIOCreateFileReader(String filename); + /** + * Original signature : void avifIODestroy(avifIO*)
+ * native declaration : avif/avif.h:1035 + */ + void avifIODestroy(avifIO io); + /** + * Original signature : char* avifProgressiveStateToString(avifProgressiveState)
+ * native declaration : avif/avif.h:1131 + */ + String avifProgressiveStateToString(int progressiveState); + /** + * Returns NULL in case of memory allocation failure.
+ * Original signature : avifDecoder* avifDecoderCreate()
+ * native declaration : avif/avif.h:1275 + */ + avifDecoder avifDecoderCreate(); + /** + * Original signature : void avifDecoderDestroy(avifDecoder*)
+ * native declaration : avif/avif.h:1276 + */ + void avifDecoderDestroy(avifDecoder decoder); + /** + * Simple interfaces to decode a single image, independent of the decoder afterwards (decoder may be destroyed).
+ * call avifDecoderSetIO*() first
+ * Original signature : avifResult avifDecoderRead(avifDecoder*, avifImage*)
+ * native declaration : avif/avif.h:1279 + */ + int avifDecoderRead(avifDecoder decoder, avifImage image); + /** + * Original signature : avifResult avifDecoderReadMemory(avifDecoder*, avifImage*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:1280
+ * @deprecated use the safer methods {@link #avifDecoderReadMemory(vavi.awt.image.jna.avif.avifDecoder, vavi.awt.image.jna.avif.avifImage, byte[], NativeLong)} and {@link #avifDecoderReadMemory(vavi.awt.image.jna.avif.avifDecoder, vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer, NativeLong)} instead + */ + @Deprecated + int avifDecoderReadMemory(avifDecoder decoder, avifImage image, Pointer data, NativeLong size); + /** + * Original signature : avifResult avifDecoderReadMemory(avifDecoder*, avifImage*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:1280 + */ + int avifDecoderReadMemory(avifDecoder decoder, avifImage image, byte data[], NativeLong size); + /** + * Original signature : avifResult avifDecoderReadFile(avifDecoder*, avifImage*, const char*)
+ * native declaration : avif/avif.h:1281
+ * @deprecated use the safer methods {@link #avifDecoderReadFile(vavi.awt.image.jna.avif.avifDecoder, vavi.awt.image.jna.avif.avifImage, java.lang.String)} and {@link #avifDecoderReadFile(vavi.awt.image.jna.avif.avifDecoder, vavi.awt.image.jna.avif.avifImage, com.sun.jna.Pointer)} instead + */ + @Deprecated + int avifDecoderReadFile(avifDecoder decoder, avifImage image, Pointer filename); + /** + * Original signature : avifResult avifDecoderReadFile(avifDecoder*, avifImage*, const char*)
+ * native declaration : avif/avif.h:1281 + */ + int avifDecoderReadFile(avifDecoder decoder, avifImage image, String filename); + /** + * Parse again. Normally AVIF_DECODER_SOURCE_AUTO is enough for the common path.
+ * Original signature : avifResult avifDecoderSetSource(avifDecoder*, avifDecoderSource)
+ * native declaration : avif/avif.h:1305 + */ + int avifDecoderSetSource(avifDecoder decoder, int source); + /** + * avifDecoderDestroy(decoder) has no effects on 'io'.
+ * Original signature : void avifDecoderSetIO(avifDecoder*, avifIO*)
+ * native declaration : avif/avif.h:1310 + */ + void avifDecoderSetIO(avifDecoder decoder, avifIO io); + /** + * Original signature : avifResult avifDecoderSetIOMemory(avifDecoder*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:1311
+ * @deprecated use the safer methods {@link #avifDecoderSetIOMemory(vavi.awt.image.jna.avif.avifDecoder, byte[], NativeLong)} and {@link #avifDecoderSetIOMemory(vavi.awt.image.jna.avif.avifDecoder, com.sun.jna.Pointer, NativeLong)} instead + */ + @Deprecated + int avifDecoderSetIOMemory(avifDecoder decoder, Pointer data, NativeLong size); + /** + * Original signature : avifResult avifDecoderSetIOMemory(avifDecoder*, const uint8_t*, size_t)
+ * native declaration : avif/avif.h:1311 + */ + int avifDecoderSetIOMemory(avifDecoder decoder, byte data[], NativeLong size); + /** + * Original signature : avifResult avifDecoderSetIOFile(avifDecoder*, const char*)
+ * native declaration : avif/avif.h:1312
+ * @deprecated use the safer methods {@link #avifDecoderSetIOFile(vavi.awt.image.jna.avif.avifDecoder, java.lang.String)} and {@link #avifDecoderSetIOFile(vavi.awt.image.jna.avif.avifDecoder, com.sun.jna.Pointer)} instead + */ + @Deprecated + int avifDecoderSetIOFile(avifDecoder decoder, Pointer filename); + /** + * Original signature : avifResult avifDecoderSetIOFile(avifDecoder*, const char*)
+ * native declaration : avif/avif.h:1312 + */ + int avifDecoderSetIOFile(avifDecoder decoder, String filename); + /** + * Original signature : avifResult avifDecoderParse(avifDecoder*)
+ * native declaration : avif/avif.h:1313 + */ + int avifDecoderParse(avifDecoder decoder); + /** + * Original signature : avifResult avifDecoderNextImage(avifDecoder*)
+ * native declaration : avif/avif.h:1314 + */ + int avifDecoderNextImage(avifDecoder decoder); + /** + * Original signature : avifResult avifDecoderNthImage(avifDecoder*, uint32_t)
+ * native declaration : avif/avif.h:1315 + */ + int avifDecoderNthImage(avifDecoder decoder, int frameIndex); + /** + * Original signature : avifResult avifDecoderReset(avifDecoder*)
+ * native declaration : avif/avif.h:1316 + */ + int avifDecoderReset(avifDecoder decoder); + /** + * These functions may be used after a successful call (AVIF_RESULT_OK) to avifDecoderParse().
+ * Original signature : avifBool avifDecoderIsKeyframe(const avifDecoder*, uint32_t)
+ * native declaration : avif/avif.h:1322 + */ + int avifDecoderIsKeyframe(avifDecoder decoder, int frameIndex); + /** + * Original signature : uint32_t avifDecoderNearestKeyframe(const avifDecoder*, uint32_t)
+ * native declaration : avif/avif.h:1323 + */ + int avifDecoderNearestKeyframe(avifDecoder decoder, int frameIndex); + /** + * This function may be used after a successful call (AVIF_RESULT_OK) to avifDecoderParse().
+ * Original signature : avifResult avifDecoderNthImageTiming(const avifDecoder*, uint32_t, avifImageTiming*)
+ * native declaration : avif/avif.h:1327 + */ + int avifDecoderNthImageTiming(avifDecoder decoder, int frameIndex, avifImageTiming outTiming); + /** + * WARNING: Experimental feature.
+ * Original signature : uint32_t avifDecoderDecodedRowCount(const avifDecoder*)
+ * native declaration : avif/avif.h:1343 + */ + int avifDecoderDecodedRowCount(avifDecoder decoder); + /** + * This function may be used after a successful call (AVIF_RESULT_OK) to avifDecoderParse().
+ * Original signature : avifResult avifDecoderNthImageMaxExtent(const avifDecoder*, uint32_t, avifExtent*)
+ * native declaration : avif/avif.h:1369 + */ + int avifDecoderNthImageMaxExtent(avifDecoder decoder, int frameIndex, avifExtent outExtent); + /** + * avifEncoderCreate() returns NULL if a memory allocation failed.
+ * Original signature : avifEncoder* avifEncoderCreate()
+ * native declaration : avif/avif.h:1459 + */ + avifEncoder avifEncoderCreate(); + /** + * Original signature : avifResult avifEncoderWrite(avifEncoder*, const avifImage*, avifRWData*)
+ * native declaration : avif/avif.h:1460 + */ + int avifEncoderWrite(avifEncoder encoder, avifImage image, avifRWData output); + /** + * Original signature : void avifEncoderDestroy(avifEncoder*)
+ * native declaration : avif/avif.h:1461 + */ + void avifEncoderDestroy(avifEncoder encoder); + /** + * or if we are encoding a layered image.
+ * Original signature : avifResult avifEncoderAddImage(avifEncoder*, const avifImage*, uint64_t, avifAddImageFlags)
+ * native declaration : avif/avif.h:1502 + */ + int avifEncoderAddImage(avifEncoder encoder, avifImage image, long durationInTimescales, int addImageFlags); + /** + * Original signature : avifResult avifEncoderAddImageGrid(avifEncoder*, uint32_t, uint32_t, const const avifImage**, avifAddImageFlags)
+ * native declaration : avif/avif.h:1503
+ * @deprecated use the safer method {@link #avifEncoderAddImageGrid(vavi.awt.image.jna.avif.avifEncoder, int, int, vavi.awt.image.jna.avif.avifImage.ByReference[], int)} instead + */ + @Deprecated + int avifEncoderAddImageGrid(avifEncoder encoder, int gridCols, int gridRows, PointerByReference cellImages, int addImageFlags); + /** + * Original signature : avifResult avifEncoderAddImageGrid(avifEncoder*, uint32_t, uint32_t, const const avifImage**, avifAddImageFlags)
+ * native declaration : avif/avif.h:1503 + */ + int avifEncoderAddImageGrid(avifEncoder encoder, int gridCols, int gridRows, avifImage.ByReference cellImages[], int addImageFlags); + /** + * Original signature : avifResult avifEncoderFinish(avifEncoder*, avifRWData*)
+ * native declaration : avif/avif.h:1508 + */ + int avifEncoderFinish(avifEncoder encoder, avifRWData output); + /** + * AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION from avifEncoderWrite() or avifEncoderAddImage().
+ * Original signature : avifResult avifEncoderSetCodecSpecificOption(avifEncoder*, const char*, const char*)
+ * native declaration : avif/avif.h:1516
+ * @deprecated use the safer methods {@link #avifEncoderSetCodecSpecificOption(vavi.awt.image.jna.avif.avifEncoder, java.lang.String, java.lang.String)} and {@link #avifEncoderSetCodecSpecificOption(vavi.awt.image.jna.avif.avifEncoder, com.sun.jna.Pointer, com.sun.jna.Pointer)} instead + */ + @Deprecated + int avifEncoderSetCodecSpecificOption(avifEncoder encoder, Pointer key, Pointer value); + /** + * AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION from avifEncoderWrite() or avifEncoderAddImage().
+ * Original signature : avifResult avifEncoderSetCodecSpecificOption(avifEncoder*, const char*, const char*)
+ * native declaration : avif/avif.h:1516 + */ + int avifEncoderSetCodecSpecificOption(avifEncoder encoder, String key, String value); + /** + * Helpers
+ * Original signature : avifBool avifImageUsesU16(const avifImage*)
+ * native declaration : avif/avif.h:1524 + */ + int avifImageUsesU16(avifImage image); + /** + * Original signature : avifBool avifImageIsOpaque(const avifImage*)
+ * native declaration : avif/avif.h:1525 + */ + int avifImageIsOpaque(avifImage image); + /** + * channel can be an avifChannelIndex.
+ * Original signature : uint8_t* avifImagePlane(const avifImage*, int)
+ * native declaration : avif/avif.h:1527 + */ + Pointer avifImagePlane(avifImage image, int channel); + /** + * Original signature : uint32_t avifImagePlaneRowBytes(const avifImage*, int)
+ * native declaration : avif/avif.h:1528 + */ + int avifImagePlaneRowBytes(avifImage image, int channel); + /** + * Original signature : uint32_t avifImagePlaneWidth(const avifImage*, int)
+ * native declaration : avif/avif.h:1529 + */ + int avifImagePlaneWidth(avifImage image, int channel); + /** + * Original signature : uint32_t avifImagePlaneHeight(const avifImage*, int)
+ * native declaration : avif/avif.h:1530 + */ + int avifImagePlaneHeight(avifImage image, int channel); + /** + * either the brand 'avif' or 'avis' (or both), without performing any allocations.
+ * Original signature : avifBool avifPeekCompatibleFileType(const avifROData*)
+ * native declaration : avif/avif.h:1534 + */ + int avifPeekCompatibleFileType(avifROData input); + class avifCodecSpecificOptions extends PointerType { + public avifCodecSpecificOptions(Pointer address) { + super(address); + } + public avifCodecSpecificOptions() { + super(); + } + } + class avifDecoderData extends PointerType { + public avifDecoderData(Pointer address) { + super(address); + } + public avifDecoderData() { + super(); + } + } + class avifEncoderData extends PointerType { + public avifEncoderData(Pointer address) { + super(address); + } + public avifEncoderData() { + super(); + } + } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifCleanApertureBox.java b/src/main/java/vavi/awt/image/jna/avif/avifCleanApertureBox.java index dd319c9..73b1186 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifCleanApertureBox.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifCleanApertureBox.java @@ -39,10 +39,8 @@ public avifCleanApertureBox(Pointer peer) { super(peer); } public static class ByReference extends avifCleanApertureBox implements Structure.ByReference { - } public static class ByValue extends avifCleanApertureBox implements Structure.ByValue { - } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifContentLightLevelInformationBox.java b/src/main/java/vavi/awt/image/jna/avif/avifContentLightLevelInformationBox.java new file mode 100644 index 0000000..d6de2fa --- /dev/null +++ b/src/main/java/vavi/awt/image/jna/avif/avifContentLightLevelInformationBox.java @@ -0,0 +1,33 @@ +package vavi.awt.image.jna.avif; +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import java.util.Arrays; +import java.util.List; +/** + * native declaration : avif/avif.h
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class avifContentLightLevelInformationBox extends Structure { + public short maxCLL; + public short maxPALL; + public avifContentLightLevelInformationBox() { + super(); + } + protected List getFieldOrder() { + return Arrays.asList("maxCLL", "maxPALL"); + } + public avifContentLightLevelInformationBox(short maxCLL, short maxPALL) { + super(); + this.maxCLL = maxCLL; + this.maxPALL = maxPALL; + } + public avifContentLightLevelInformationBox(Pointer peer) { + super(peer); + } + public static class ByReference extends avifContentLightLevelInformationBox implements Structure.ByReference { + } + public static class ByValue extends avifContentLightLevelInformationBox implements Structure.ByValue { + } +} diff --git a/src/main/java/vavi/awt/image/jna/avif/avifCropRect.java b/src/main/java/vavi/awt/image/jna/avif/avifCropRect.java index d8fe749..2257c5f 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifCropRect.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifCropRect.java @@ -31,10 +31,8 @@ public avifCropRect(Pointer peer) { super(peer); } public static class ByReference extends avifCropRect implements Structure.ByReference { - } public static class ByValue extends avifCropRect implements Structure.ByValue { - } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifDecoder.java b/src/main/java/vavi/awt/image/jna/avif/avifDecoder.java index 5311fdb..fb318e2 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifDecoder.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifDecoder.java @@ -56,10 +56,12 @@ public class avifDecoder extends Structure { public avifImageTiming imageTiming; /** timescale of the media (Hz) */ public long timescale; - /** in seconds (durationInTimescales / timescale) */ + /** duration of a single playback of the image sequence in seconds */ public double duration; - /** duration in "timescales" */ + /** duration of a single playback of the image sequence in "timescales" */ public long durationInTimescales; + /** number of times the sequence has to be repeated. This can also be one of */ + public int repetitionCount; /** C type : avifBool */ public int alphaPresent; /** C type : avifIOStats */ @@ -70,11 +72,13 @@ public class avifDecoder extends Structure { public vavi.awt.image.jna.avif.avifIO.ByReference io; /** C type : avifDecoderData* */ public avifDecoderData data; + /** C type : avifBool */ + public int imageSequenceTrackPresent; public avifDecoder() { super(); } - protected List getFieldOrder() { - return Arrays.asList("codecChoice", "maxThreads", "requestedSource", "allowProgressive", "allowIncremental", "ignoreExif", "ignoreXMP", "imageSizeLimit", "imageDimensionLimit", "imageCountLimit", "strictFlags", "image", "imageIndex", "imageCount", "progressiveState", "imageTiming", "timescale", "duration", "durationInTimescales", "alphaPresent", "ioStats", "diag", "io", "data"); + protected List getFieldOrder() { + return Arrays.asList("codecChoice", "maxThreads", "requestedSource", "allowProgressive", "allowIncremental", "ignoreExif", "ignoreXMP", "imageSizeLimit", "imageDimensionLimit", "imageCountLimit", "strictFlags", "image", "imageIndex", "imageCount", "progressiveState", "imageTiming", "timescale", "duration", "durationInTimescales", "repetitionCount", "alphaPresent", "ioStats", "diag", "io", "data", "imageSequenceTrackPresent"); } public avifDecoder(Pointer peer) { super(peer); diff --git a/src/main/java/vavi/awt/image/jna/avif/avifEncoder.java b/src/main/java/vavi/awt/image/jna/avif/avifEncoder.java index d6b2153..693f45d 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifEncoder.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifEncoder.java @@ -21,7 +21,7 @@ public class avifEncoder extends Structure { public int codecChoice; public int maxThreads; public int speed; - /** How many frames between automatic forced keyframes; 0 to disable (default). */ + /** Any set of |keyframeInterval| consecutive frames will have at least one keyframe. When it is 0, */ public int keyframeInterval; /** timescale of the media (Hz) */ public long timescale; @@ -31,20 +31,21 @@ public class avifEncoder extends Structure { * Essentially, if repetitionCount is a non-negative integer `n`, then the image sequence should be * played back `n + 1` times. Defaults to AVIF_REPETITION_COUNT_INFINITE. */ -// public int repetitionCount; + public int repetitionCount; /** EXPERIMENTAL: Non-zero value encodes layered image. */ -// public int extraLayerCount; - // changeable encoder settings -// public int quality; -// public int qualityAlpha; + public int extraLayerCount; + public int quality; + public int qualityAlpha; public int minQuantizer; public int maxQuantizer; public int minQuantizerAlpha; public int maxQuantizerAlpha; public int tileRowsLog2; public int tileColsLog2; + /** C type : avifBool */ public int autoTiling; -// public int scalingMode; + /** C type : avifScalingMode */ + public avifScalingMode scalingMode; /** C type : avifIOStats */ public avifIOStats ioStats; /** C type : avifDiagnostics */ @@ -53,12 +54,15 @@ public class avifEncoder extends Structure { public avifEncoderData data; /** C type : avifCodecSpecificOptions* */ public avifCodecSpecificOptions csOptions; + /** + * @see AvifLibrary.avifHeaderFormat + */ + public int headerFormat; public avifEncoder() { super(); } - protected List getFieldOrder() { - return Arrays.asList("codecChoice", "maxThreads", "speed", "keyframeInterval", "timescale", /*"repetitionCount", "extraLayerCount", "quality", "qualityAlpha",*/ - "minQuantizer", "maxQuantizer", "minQuantizerAlpha", "maxQuantizerAlpha", "tileRowsLog2", "tileColsLog2", "autoTiling", /*"scalingMode",*/ "ioStats", "diag", "data", "csOptions"); + protected List getFieldOrder() { + return Arrays.asList("codecChoice", "maxThreads", "speed", "keyframeInterval", "timescale", "repetitionCount", "extraLayerCount", "quality", "qualityAlpha", "minQuantizer", "maxQuantizer", "minQuantizerAlpha", "maxQuantizerAlpha", "tileRowsLog2", "tileColsLog2", "autoTiling", "scalingMode", "ioStats", "diag", "data", "csOptions", "headerFormat"); } public avifEncoder(Pointer peer) { super(peer); diff --git a/src/main/java/vavi/awt/image/jna/avif/avifExtent.java b/src/main/java/vavi/awt/image/jna/avif/avifExtent.java index 8f4d3e7..a7f7436 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifExtent.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifExtent.java @@ -1,5 +1,6 @@ package vavi.awt.image.jna.avif; +import com.sun.jna.NativeLong; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; @@ -13,14 +14,14 @@ */ public class avifExtent extends Structure { public long offset; - public int size; + public NativeLong size; public avifExtent() { super(); } - protected List getFieldOrder() { + protected List getFieldOrder() { return Arrays.asList("offset", "size"); } - public avifExtent(long offset, int size) { + public avifExtent(long offset, NativeLong size) { super(); this.offset = offset; this.size = size; diff --git a/src/main/java/vavi/awt/image/jna/avif/avifFraction.java b/src/main/java/vavi/awt/image/jna/avif/avifFraction.java new file mode 100644 index 0000000..de85b67 --- /dev/null +++ b/src/main/java/vavi/awt/image/jna/avif/avifFraction.java @@ -0,0 +1,33 @@ +package vavi.awt.image.jna.avif; +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import java.util.Arrays; +import java.util.List; +/** + * native declaration : avif/avif.h
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class avifFraction extends Structure { + public int n; + public int d; + public avifFraction() { + super(); + } + protected List getFieldOrder() { + return Arrays.asList("n", "d"); + } + public avifFraction(int n, int d) { + super(); + this.n = n; + this.d = d; + } + public avifFraction(Pointer peer) { + super(peer); + } + public static class ByReference extends avifFraction implements Structure.ByReference { + } + public static class ByValue extends avifFraction implements Structure.ByValue { + } +} diff --git a/src/main/java/vavi/awt/image/jna/avif/avifIO.java b/src/main/java/vavi/awt/image/jna/avif/avifIO.java index a305679..09732c4 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifIO.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifIO.java @@ -50,10 +50,8 @@ public avifIO(Pointer peer) { super(peer); } public static class ByReference extends avifIO implements Structure.ByReference { - } public static class ByValue extends avifIO implements Structure.ByValue { - } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifIOStats.java b/src/main/java/vavi/awt/image/jna/avif/avifIOStats.java index ac19e73..dbcef4d 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifIOStats.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifIOStats.java @@ -1,4 +1,5 @@ package vavi.awt.image.jna.avif; +import com.sun.jna.NativeLong; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; @@ -10,15 +11,15 @@ * For help, please visit NativeLibs4Java , Rococoa, or JNA. */ public class avifIOStats extends Structure { - public int colorOBUSize; - public int alphaOBUSize; + public NativeLong colorOBUSize; + public NativeLong alphaOBUSize; public avifIOStats() { super(); } - protected List getFieldOrder() { + protected List getFieldOrder() { return Arrays.asList("colorOBUSize", "alphaOBUSize"); } - public avifIOStats(int colorOBUSize, int alphaOBUSize) { + public avifIOStats(NativeLong colorOBUSize, NativeLong alphaOBUSize) { super(); this.colorOBUSize = colorOBUSize; this.alphaOBUSize = alphaOBUSize; @@ -27,10 +28,8 @@ public avifIOStats(Pointer peer) { super(peer); } public static class ByReference extends avifIOStats implements Structure.ByReference { - } - public static class ByValue extends avifIOStats implements Structure.ByValue { - + public static class ByValue extends avifIOStats implements Structure.ByValue { } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifImage.java b/src/main/java/vavi/awt/image/jna/avif/avifImage.java index 7e8d96a..5e7c0b0 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifImage.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifImage.java @@ -52,6 +52,8 @@ public class avifImage extends Structure { public short transferCharacteristics; /** C type : avifMatrixCoefficients */ public short matrixCoefficients; + /** C type : avifContentLightLevelInformationBox */ + public avifContentLightLevelInformationBox clli; /** C type : avifTransformFlags */ public int transformFlags; /** C type : avifPixelAspectRatioBox */ @@ -69,8 +71,8 @@ public class avifImage extends Structure { public avifImage() { super(); } - protected List getFieldOrder() { - return Arrays.asList("width", "height", "depth", "yuvFormat", "yuvRange", "yuvChromaSamplePosition", "yuvPlanes", "yuvRowBytes", "imageOwnsYUVPlanes", "alphaPlane", "alphaRowBytes", "imageOwnsAlphaPlane", "alphaPremultiplied", "icc", "colorPrimaries", "transferCharacteristics", "matrixCoefficients", "transformFlags", "pasp", "clap", "irot", "imir", "exif", "xmp"); + protected List getFieldOrder() { + return Arrays.asList("width", "height", "depth", "yuvFormat", "yuvRange", "yuvChromaSamplePosition", "yuvPlanes", "yuvRowBytes", "imageOwnsYUVPlanes", "alphaPlane", "alphaRowBytes", "imageOwnsAlphaPlane", "alphaPremultiplied", "icc", "colorPrimaries", "transferCharacteristics", "matrixCoefficients", "clli", "transformFlags", "pasp", "clap", "irot", "imir", "exif", "xmp"); } public avifImage(Pointer peer) { super(peer); diff --git a/src/main/java/vavi/awt/image/jna/avif/avifImageMirror.java b/src/main/java/vavi/awt/image/jna/avif/avifImageMirror.java index d5ccae0..59b5f4a 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifImageMirror.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifImageMirror.java @@ -11,25 +11,23 @@ * For help, please visit NativeLibs4Java , Rococoa, or JNA. */ public class avifImageMirror extends Structure { - public byte mode; + public byte axis; public avifImageMirror() { super(); } - protected List getFieldOrder() { - return Collections.singletonList("mode"); + protected List getFieldOrder() { + return Collections.singletonList("axis"); } - public avifImageMirror(byte mode) { + public avifImageMirror(byte axis) { super(); - this.mode = mode; + this.axis = axis; } public avifImageMirror(Pointer peer) { super(peer); } public static class ByReference extends avifImageMirror implements Structure.ByReference { - } - public static class ByValue extends avifImageMirror implements Structure.ByValue { - + public static class ByValue extends avifImageMirror implements Structure.ByValue { } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifImageRotation.java b/src/main/java/vavi/awt/image/jna/avif/avifImageRotation.java index ae1f304..89652b3 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifImageRotation.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifImageRotation.java @@ -28,10 +28,8 @@ public avifImageRotation(Pointer peer) { super(peer); } public static class ByReference extends avifImageRotation implements Structure.ByReference { - } public static class ByValue extends avifImageRotation implements Structure.ByValue { - } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifImageTiming.java b/src/main/java/vavi/awt/image/jna/avif/avifImageTiming.java index 6daa511..f8e03d2 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifImageTiming.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifImageTiming.java @@ -45,10 +45,8 @@ public avifImageTiming(Pointer peer) { super(peer); } public static class ByReference extends avifImageTiming implements Structure.ByReference { - } public static class ByValue extends avifImageTiming implements Structure.ByValue { - } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifPixelAspectRatioBox.java b/src/main/java/vavi/awt/image/jna/avif/avifPixelAspectRatioBox.java index a0bb73d..a01d654 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifPixelAspectRatioBox.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifPixelAspectRatioBox.java @@ -27,10 +27,8 @@ public avifPixelAspectRatioBox(Pointer peer) { super(peer); } public static class ByReference extends avifPixelAspectRatioBox implements Structure.ByReference { - } public static class ByValue extends avifPixelAspectRatioBox implements Structure.ByValue { - } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifPixelFormatInfo.java b/src/main/java/vavi/awt/image/jna/avif/avifPixelFormatInfo.java index 8a9933f..c83b144 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifPixelFormatInfo.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifPixelFormatInfo.java @@ -31,10 +31,8 @@ public avifPixelFormatInfo(Pointer peer) { super(peer); } public static class ByReference extends avifPixelFormatInfo implements Structure.ByReference { - } public static class ByValue extends avifPixelFormatInfo implements Structure.ByValue { - } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifRGBImage.java b/src/main/java/vavi/awt/image/jna/avif/avifRGBImage.java index a825256..d91e6b1 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifRGBImage.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifRGBImage.java @@ -26,23 +26,23 @@ public class avifRGBImage extends Structure { public int format; /** * @see AvifLibrary.avifChromaUpsampling - * Defaults to AVIF_CHROMA_UPSAMPLING_AUTOMATIC: How to upsample non-4:4:4 UV (ignored for 444) when converting to RGB.
+ * How to upsample from 4:2:0 or 4:2:2 UV when converting to RGB (ignored for 4:4:4 and 4:0:0).
* C type : avifChromaUpsampling */ public int chromaUpsampling; /** * @see AvifLibrary.avifChromaDownsampling - * How to downsample to 4:2:0 or 4:2:2 UV when converting from RGB (ignored for 4:4:4 and 4:0:0). - * Ignored when converting to RGB. Defaults to AVIF_CHROMA_DOWNSAMPLING_AUTOMATIC. + * How to downsample to 4:2:0 or 4:2:2 UV when converting from RGB (ignored for 4:4:4 and 4:0:0).
+ * C type : avifChromaDownsampling */ public int chromaDownsampling; /** - * If AVIF_FALSE and libyuv conversion between RGB and YUV (including upsampling or downsampling if any) - * is available for the avifImage/avifRGBImage combination, then libyuv is used. Default is AVIF_FALSE. + * If AVIF_FALSE and libyuv conversion between RGB and YUV (including upsampling or downsampling if any)
+ * C type : avifBool */ public int avoidLibYUV; /** - * Used for XRGB formats, treats formats containing alpha (such as ARGB) as if they were
+ * Used for XRGB formats, treats formats containing alpha (such as ARGB) as if they were RGB, treating
* C type : avifBool */ public int ignoreAlpha; @@ -61,15 +61,15 @@ public class avifRGBImage extends Structure { * conversion. Setting this to zero has the same effect as setting it to one. Negative values are invalid. * Default: 1. */ -// public int maxThreads; + public int maxThreads; /** C type : uint8_t* */ public Pointer pixels; public int rowBytes; public avifRGBImage() { super(); } - protected List getFieldOrder() { - return Arrays.asList("width", "height", "depth", "format", "chromaUpsampling", "chromaDownsampling", "avoidLibYUV", "ignoreAlpha", "alphaPremultiplied", "isFloat", /*"maxThreads", */"pixels", "rowBytes"); + protected List getFieldOrder() { + return Arrays.asList("width", "height", "depth", "format", "chromaUpsampling", "chromaDownsampling", "avoidLibYUV", "ignoreAlpha", "alphaPremultiplied", "isFloat", "maxThreads", "pixels", "rowBytes"); } public avifRGBImage(Pointer peer) { super(peer); diff --git a/src/main/java/vavi/awt/image/jna/avif/avifROData.java b/src/main/java/vavi/awt/image/jna/avif/avifROData.java index 0cbfc0b..d82aec1 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifROData.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifROData.java @@ -1,4 +1,5 @@ package vavi.awt.image.jna.avif; +import com.sun.jna.NativeLong; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; @@ -12,7 +13,7 @@ public class avifROData extends Structure { /** C type : const uint8_t* */ public Pointer data; - public int size; + public NativeLong size; public avifROData() { super(); } @@ -20,7 +21,7 @@ protected List getFieldOrder() { return Arrays.asList("data", "size"); } /** @param data C type : const uint8_t* */ - public avifROData(Pointer data, int size) { + public avifROData(Pointer data, NativeLong size) { super(); this.data = data; this.size = size; @@ -29,10 +30,8 @@ public avifROData(Pointer peer) { super(peer); } public static class ByReference extends avifROData implements Structure.ByReference { - } - public static class ByValue extends avifROData implements Structure.ByValue { - + public static class ByValue extends avifROData implements Structure.ByValue { } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifRWData.java b/src/main/java/vavi/awt/image/jna/avif/avifRWData.java index c271a9c..58eb2be 100644 --- a/src/main/java/vavi/awt/image/jna/avif/avifRWData.java +++ b/src/main/java/vavi/awt/image/jna/avif/avifRWData.java @@ -1,4 +1,5 @@ package vavi.awt.image.jna.avif; +import com.sun.jna.NativeLong; import com.sun.jna.Pointer; import com.sun.jna.Structure; import java.util.Arrays; @@ -12,15 +13,15 @@ public class avifRWData extends Structure { /** C type : uint8_t* */ public Pointer data; - public int size; + public NativeLong size; public avifRWData() { super(); } - protected List getFieldOrder() { + protected List getFieldOrder() { return Arrays.asList("data", "size"); } /** @param data C type : uint8_t* */ - public avifRWData(Pointer data, int size) { + public avifRWData(Pointer data, NativeLong size) { super(); this.data = data; this.size = size; @@ -29,10 +30,8 @@ public avifRWData(Pointer peer) { super(peer); } public static class ByReference extends avifRWData implements Structure.ByReference { - } - public static class ByValue extends avifRWData implements Structure.ByValue { - + public static class ByValue extends avifRWData implements Structure.ByValue { } } diff --git a/src/main/java/vavi/awt/image/jna/avif/avifScalingMode.java b/src/main/java/vavi/awt/image/jna/avif/avifScalingMode.java new file mode 100644 index 0000000..ee8be7e --- /dev/null +++ b/src/main/java/vavi/awt/image/jna/avif/avifScalingMode.java @@ -0,0 +1,39 @@ +package vavi.awt.image.jna.avif; +import com.sun.jna.Pointer; +import com.sun.jna.Structure; +import java.util.Arrays; +import java.util.List; +/** + * native declaration : avif/avif.h
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class avifScalingMode extends Structure { + /** C type : avifFraction */ + public avifFraction horizontal; + /** C type : avifFraction */ + public avifFraction vertical; + public avifScalingMode() { + super(); + } + protected List getFieldOrder() { + return Arrays.asList("horizontal", "vertical"); + } + /** + * @param horizontal C type : avifFraction
+ * @param vertical C type : avifFraction + */ + public avifScalingMode(avifFraction horizontal, avifFraction vertical) { + super(); + this.horizontal = horizontal; + this.vertical = vertical; + } + public avifScalingMode(Pointer peer) { + super(peer); + } + public static class ByReference extends avifScalingMode implements Structure.ByReference { + }; + public static class ByValue extends avifScalingMode implements Structure.ByValue { + }; +}