From ab6556e393162fff0e0e0c80a9fff689b4e2ca05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 11 Nov 2017 18:47:31 +0100 Subject: New upstream version 3.26.2 --- src/libwebp.vapi | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/libwebp.vapi (limited to 'src/libwebp.vapi') diff --git a/src/libwebp.vapi b/src/libwebp.vapi new file mode 100644 index 0000000..74bfdd5 --- /dev/null +++ b/src/libwebp.vapi @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2017 Stéphane Fillion + * Authors: Stéphane Fillion + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. See http://www.gnu.org/copyleft/gpl.html the full text of the + * license. + */ + +namespace WebP +{ + // Returns the size of the compressed data (pointed to by *output), or 0 if + // an error occurred. The compressed data must be released by the caller + // using the call 'free(*output)'. + // These functions compress using the lossy format, and the quality_factor + // can go from 0 (smaller output, lower quality) to 100 (best quality, + // larger output). + [CCode (cheader_filename = "webp/encode.h", cname = "WebPEncodeRGB")] + private size_t _encode_rgb ([CCode (array_length = false)] uint8[] rgb, + int width, + int height, + int stride, + float quality_factor, + [CCode (array_length = false)] out uint8[] output); + [CCode (cname = "vala_encode_rgb")] + public uint8[] encode_rgb (uint8[] rgb, int width, int height, int stride, float quality_factor) + { + uint8[] output; + size_t length; + length = _encode_rgb (rgb, width, height, stride, quality_factor, out output); + output.length = (int) length; + return output; + } + + // These functions are the equivalent of the above, but compressing in a + // lossless manner. Files are usually larger than lossy format, but will + // not suffer any compression loss. + [CCode (cheader_filename = "webp/encode.h", cname = "WebPEncodeLosslessRGB")] + private size_t _encode_lossless_rgb ([CCode (array_length = false)] uint8[] rgb, + int width, + int height, + int stride, + [CCode (array_length = false)] out uint8[] output); + [CCode (cname = "vala_encode_lossless_rgb")] + public uint8[] encode_lossless_rgb (uint8[] rgb, int width, int height, int stride) + { + uint8[] output; + size_t length; + length = _encode_lossless_rgb (rgb, width, height, stride, out output); + output.length = (int) length; + return output; + } +} -- cgit v1.2.3