From aa8b1dd4c79e7085cd3eebb1232ae54f853b0557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Espeute?= Date: Fri, 24 Jul 2026 14:53:12 +0200 Subject: [PATCH] Added hl.Native.encodeJPG binding --- format/hl/Native.hx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/format/hl/Native.hx b/format/hl/Native.hx index 740ee64..08a3357 100644 --- a/format/hl/Native.hx +++ b/format/hl/Native.hx @@ -15,9 +15,29 @@ enum abstract PixelFormat(Int) { var CMYK = 11; } +enum abstract Subsampling(Int) { + var _444 = 0; + var _422 = 1; + var _420 = 2; + var Gray = 3; + var _440 = 4; + var _441 = 5; +} + class Native { #if hl + + #if (hl_ver >= version("1.16.0")) + /** + Encode JPG data and returns the buffer containing the encoded data. The length of the buffer is returned through outLength. Returns null if the encoding failed. + **/ + @:hlNative("fmt", "jpg_encode") + public static function encodeJPG(src:hl.Bytes, width:Int, height:Int, stride:Int, format:PixelFormat, subsampling:Subsampling, quality:Int, flags:Int, outLength:hl.Ref):Null { + return null; + } + #end + /** Decode JPG data into the target buffer. **/