diff --git a/app/Services/MarhunPhotoService.php b/app/Services/MarhunPhotoService.php index d86ea30e..e3add647 100644 --- a/app/Services/MarhunPhotoService.php +++ b/app/Services/MarhunPhotoService.php @@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Storage; use App\Models\FileMarhun; use App\Models\LelongBid; use Exception; +use Buglinjo\LaravelWebp\Facades\Webp; class MarhunPhotoService { @@ -14,10 +15,9 @@ class MarhunPhotoService public function store(Request $request) { - - try{ + try { $file_type = $request->gambarMarhun->getClientOriginalExtension(); - } catch(Exception $exception){ + } catch (Exception $exception) { $file_type = 'PNG'; logger($exception); } @@ -38,15 +38,27 @@ class MarhunPhotoService $photo_type_name = $request->photo_type === '1' ? 'overall_photo' : 'by_marhun_photo'; $directory = "/{$no_rujukan_sag}/{$photo_type_name}/"; - $imageExtension = $request->file('gambarMarhun')->getClientOriginalExtension(); + $imageExtension = $file_type; + + $marhunImageFileName = "overall"; - $marhunImageFileName = "overall.{$imageExtension}"; if (!empty($request->lelongbidmarhun_id)) { - $marhunImageFileName = "$request->lelongbidmarhun_id.$imageExtension"; + $marhunImageFileName = "$request->lelongbidmarhun_id"; } - Storage::disk('marhun')->putFileAs($directory, $request->gambarMarhun, $marhunImageFileName); + Storage::disk('marhun')->putFileAs($directory, $request->gambarMarhun, "${marhunImageFileName}.${imageExtension}"); + $stored_path = Storage::disk('marhun')->path("{$directory}{$marhunImageFileName}.${imageExtension}"); + + $convertedFilePath = $this->optimizeImageToWebP($stored_path, $directory, $marhunImageFileName); + + $this->changeFileOwnerToServerUser($convertedFilePath); + + Storage::disk('marhun')->delete("{$directory}${marhunImageFileName}.${imageExtension}"); + + $addfile->update([ + 'file_type' => 'webp', + ]); } public function delete(Request $request) @@ -89,7 +101,7 @@ class MarhunPhotoService $filePath = Storage::disk('marhun')->path("{$directory}${marhunImageFileName}"); header('Content-Type: ' . mime_content_type($filePath)); - header('Content-Disposition: inline; filename="'.basename($filePath).'"'); + header('Content-Disposition: inline; filename="' . basename($filePath) . '"'); readfile($filePath); } @@ -109,6 +121,47 @@ class MarhunPhotoService } return Storage::disk('marhun')->get("{$directory}${marhunImageFileName}"); + } + + private function getWebpCompilerByOS() + { + $cwebp_compilers = [ + 'Windows' => 'binaries\libwebp-1.2.4-windows-x64\bin\cwebp', + 'Linux' => 'binaries\libwebp-1.2.4-linux-x86-64\bin\cwebp', + ]; + + $cwebp_compilers_darwin = [ + 'X86-64' => 'binaries\libwebp-1.2.4-mac-X86-64\bin\cwebp', + 'arm64' => 'binaries\libwebp-1.2.4-mac-arm64\bin\cwebp', + ]; + + $server_operating_system = explode(' ', trim(php_uname()))[0]; + $server_processor_architecture = trim(php_uname('m')); + + if (in_array($server_operating_system, array_keys($cwebp_compilers))) { + return resource_path($cwebp_compilers[$server_operating_system]); + } + + if ($server_operating_system === 'Darwin') { + return resource_path($cwebp_compilers_darwin[$server_processor_architecture]); + } + } + + private function optimizeImageToWebP($originalFilePath, $directory, $lelongbidmarhun_id) + { + $convertedFilePath = config('filesystems.disks.marhun.root') . '/' . "{$directory}{$lelongbidmarhun_id}.webp"; + + $webpCompiler = $this->getWebpCompilerByOS(); + + exec($webpCompiler . ' -q 60 ' . $originalFilePath . ' -o ' . $convertedFilePath); + + return $convertedFilePath; + } + + + private function changeFileOwnerToServerUser($filepath) + { + chown($filepath, get_current_user()); } } diff --git a/composer.json b/composer.json index 1f1b6430..a337cc44 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "require": { "php": "^7.3|^8.0", "barryvdh/laravel-dompdf": "^0.9.0", + "buglinjo/laravel-webp": "^2.3", "enlightn/enlightn": "^1.26", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.4", @@ -18,6 +19,7 @@ "laravelcollective/html": "^6.3", "php-http/guzzle7-adapter": "^1.0", "pusher/pusher-php-server": "^7.0", + "spatie/laravel-image-optimizer": "^1.6", "spatie/laravel-permission": "^5.3" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 324488aa..16f87eaf 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2f10e37896fbd09e0db3f88edb605951", + "content-hash": "b693508e783afdca0b77c2e1dcf8217c", "packages": [ { "name": "asm89/stack-cors", @@ -184,6 +184,71 @@ ], "time": "2021-08-15T20:50:18+00:00" }, + { + "name": "buglinjo/laravel-webp", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/buglinjo/laravel-webp.git", + "reference": "8d28bad5dbb82d7257eb77f27b5c57daa0c0d6b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/buglinjo/laravel-webp/zipball/8d28bad5dbb82d7257eb77f27b5c57daa0c0d6b8", + "reference": "8d28bad5dbb82d7257eb77f27b5c57daa0c0d6b8", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "laravel/framework": "~5.1|~6.0|~7.0|~8.0|~9.0", + "php": "^7.1|^8.0|^8.1" + }, + "require-dev": { + "phpunit/phpunit": ">=5.4.3", + "squizlabs/php_codesniffer": "^2.3|^3.6" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Buglinjo\\LaravelWebp\\WebpServiceProvider" + ], + "aliases": { + "Webp": "Buglinjo\\LaravelWebp\\Webp" + } + } + }, + "autoload": { + "psr-4": { + "Buglinjo\\LaravelWebp\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Irakli Tchitadze", + "email": "irakli.tchitadze@gmail.com", + "homepage": "https://irakli.dev", + "role": "Developer" + } + ], + "description": "Laravel package for WebP image formatting.", + "homepage": "https://github.com/buglinjo/laravel-webp", + "keywords": [ + "Buglinjo", + "LaravelWebp", + "Webp", + "laravel" + ], + "support": { + "issues": "https://github.com/buglinjo/laravel-webp/issues", + "source": "https://github.com/buglinjo/laravel-webp/tree/v2.3.1" + }, + "time": "2022-03-15T01:49:23+00:00" + }, { "name": "clue/stream-filter", "version": "v1.6.0", @@ -5760,6 +5825,129 @@ ], "time": "2022-07-20T18:31:45+00:00" }, + { + "name": "spatie/image-optimizer", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/image-optimizer.git", + "reference": "6db75529cbf8fa84117046a9d513f277aead90a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/6db75529cbf8fa84117046a9d513f277aead90a0", + "reference": "6db75529cbf8fa84117046a9d513f277aead90a0", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.3|^8.0", + "psr/log": "^1.0 | ^2.0 | ^3.0", + "symfony/process": "^4.2|^5.0|^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.21|^9.4.4", + "symfony/var-dumper": "^4.2|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ImageOptimizer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily optimize images using PHP", + "homepage": "https://github.com/spatie/image-optimizer", + "keywords": [ + "image-optimizer", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/image-optimizer/issues", + "source": "https://github.com/spatie/image-optimizer/tree/1.6.2" + }, + "time": "2021-12-21T10:08:05+00:00" + }, + { + "name": "spatie/laravel-image-optimizer", + "version": "1.6.4", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-image-optimizer.git", + "reference": "c39e9ea77dee6b6eddfc26800adb1aa06a624294" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-image-optimizer/zipball/c39e9ea77dee6b6eddfc26800adb1aa06a624294", + "reference": "c39e9ea77dee6b6eddfc26800adb1aa06a624294", + "shasum": "" + }, + "require": { + "laravel/framework": "^6.0|^7.0|^8.0", + "php": "^7.2|^8.0", + "spatie/image-optimizer": "^1.2.0" + }, + "require-dev": { + "orchestra/testbench": "^4.0|^5.0|^6.0", + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\LaravelImageOptimizer\\ImageOptimizerServiceProvider" + ], + "aliases": { + "ImageOptimizer": "Spatie\\LaravelImageOptimizer\\Facades\\ImageOptimizer" + } + } + }, + "autoload": { + "psr-4": { + "Spatie\\LaravelImageOptimizer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Optimize images in your Laravel app", + "homepage": "https://github.com/spatie/laravel-image-optimizer", + "keywords": [ + "laravel-image-optimizer", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-image-optimizer/issues", + "source": "https://github.com/spatie/laravel-image-optimizer/tree/1.6.4" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "time": "2020-11-27T18:27:06+00:00" + }, { "name": "spatie/laravel-permission", "version": "5.5.16", @@ -10786,5 +10974,5 @@ "php": "^7.3|^8.0" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/config/database.php b/config/database.php index bf393ac0..4d0f0e9d 100644 --- a/config/database.php +++ b/config/database.php @@ -61,15 +61,15 @@ return [ 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], - // 'modes' => [ - // //'ONLY_FULL_GROUP_BY', // Disable this to allow grouping by one column - // 'STRICT_TRANS_TABLES', - // 'NO_ZERO_IN_DATE', - // 'NO_ZERO_DATE', - // 'ERROR_FOR_DIVISION_BY_ZERO', - // 'NO_AUTO_CREATE_USER', - // 'NO_ENGINE_SUBSTITUTION' - // ], + 'modes' => [ + //'ONLY_FULL_GROUP_BY', // Disable this to allow grouping by one column + 'STRICT_TRANS_TABLES', + 'NO_ZERO_IN_DATE', + 'NO_ZERO_DATE', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'NO_AUTO_CREATE_USER', + 'NO_ENGINE_SUBSTITUTION' + ], ], diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/CONTRIBUTING.md b/resources/binaries/libwebp-1.2.4-linux-x86-64/CONTRIBUTING.md new file mode 100644 index 00000000..7a73a303 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/CONTRIBUTING.md @@ -0,0 +1,29 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use a [Gerrit](https://www.gerritcodereview.com) instance hosted at +https://chromium-review.googlesource.com for this purpose. See the +[WebM Project page](https://www.webmproject.org/code/contribute/submitting-patches/) +for additional details. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/README.md b/resources/binaries/libwebp-1.2.4-linux-x86-64/README.md new file mode 100644 index 00000000..4dfe39c0 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/README.md @@ -0,0 +1,65 @@ +# WebP Codec + +``` + __ __ ____ ____ ____ + / \\/ \/ _ \/ _ )/ _ \ + \ / __/ _ \ __/ + \__\__/\____/\_____/__/ ____ ___ + / _/ / \ \ / _ \/ _/ + / \_/ / / \ \ __/ \__ + \____/____/\_____/_____/____/v1.2.4 +``` + +WebP codec is a library to encode and decode images in WebP format. This package +contains the library that can be used in other programs to add WebP support, as +well as the command line tools 'cwebp' and 'dwebp' to compress and decompress +images respectively. + +See https://developers.google.com/speed/webp for details on the image format. + +The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp + +It is released under the same license as the WebM project. See +https://www.webmproject.org/license/software/ or the "COPYING" file for details. +An additional intellectual property rights grant can be found in the file +PATENTS. + +## Files + +* bin/cwebp : encoding tool +* bin/dwebp : decoding tool +* bin/gif2webp : gif conversion tool +* bin/img2webp : animation creation tool +* bin/vwebp : webp visualization tool +* bin/webpinfo : webp analysis tool +* bin/webpmux : webp muxing tool +* bin/anim\_diff : webp file comparison tool +* bin/anim\_dump : tool for dumping animation frames +* bin/get\_disto : tool for calculating file distortion +* bin/webp\_quality : webp quality estimation tool +* doc/ : manual in HTML and text formats +* lib/ : static libraries +* include/webp : headers + +## Encoding and Decoding Tools + +The bin/ directory contains tools to encode and decode images and animations, +view information about WebP images, and more. See the +[tools documentation](doc/tools.md). + +## APIs + +See the [APIs documentation](doc/api.md). + +## Bugs + +Please report all bugs to the issue tracker: https://bugs.chromium.org/p/webp + +Patches welcome! See [how to contribute](CONTRIBUTING.md). + +## Discuss + +Email: webp-discuss@webmproject.org + +Web: https://groups.google.com/a/webmproject.org/group/webp-discuss diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/anim_diff b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/anim_diff new file mode 100644 index 00000000..2a781a72 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/anim_diff differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/anim_dump b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/anim_dump new file mode 100644 index 00000000..fcd397c5 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/anim_dump differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/cwebp b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/cwebp new file mode 100644 index 00000000..80076052 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/cwebp differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/dwebp b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/dwebp new file mode 100644 index 00000000..dbef690c Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/dwebp differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/get_disto b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/get_disto new file mode 100644 index 00000000..bae6691f Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/get_disto differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/gif2webp b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/gif2webp new file mode 100644 index 00000000..eb1f2daa Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/gif2webp differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/img2webp b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/img2webp new file mode 100644 index 00000000..ce01b75d Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/img2webp differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/vwebp b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/vwebp new file mode 100644 index 00000000..df44b3de Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/vwebp differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webp_quality b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webp_quality new file mode 100644 index 00000000..da49788e Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webp_quality differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webpinfo b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webpinfo new file mode 100644 index 00000000..a6852ee6 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webpinfo differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webpmux b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webpmux new file mode 100644 index 00000000..247707f4 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/bin/webpmux differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/api.md b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/api.md new file mode 100644 index 00000000..d0adafbd --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/api.md @@ -0,0 +1,385 @@ +# WebP APIs + +## Encoding API + +The main encoding functions are available in the header src/webp/encode.h + +The ready-to-use ones are: + +```c +size_t WebPEncodeRGB(const uint8_t* rgb, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeBGR(const uint8_t* bgr, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeRGBA(const uint8_t* rgba, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeBGRA(const uint8_t* bgra, int width, int height, int stride, + float quality_factor, uint8_t** output); +``` + +They will convert raw RGB samples to a WebP data. The only control supplied is +the quality factor. + +There are some variants for using the lossless format: + +```c +size_t WebPEncodeLosslessRGB(const uint8_t* rgb, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessBGR(const uint8_t* bgr, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, int width, int height, + int stride, uint8_t** output); +``` + +Of course in this case, no quality factor is needed since the compression occurs +without loss of the input values, at the expense of larger output sizes. + +### Advanced encoding API + +A more advanced API is based on the WebPConfig and WebPPicture structures. + +WebPConfig contains the encoding settings and is not tied to a particular +picture. WebPPicture contains input data, on which some WebPConfig will be used +for compression. The encoding flow looks like: + +```c +#include + +// Setup a config, starting form a preset and tuning some additional +// parameters +WebPConfig config; +if (!WebPConfigPreset(&config, WEBP_PRESET_PHOTO, quality_factor)) { + return 0; // version error +} +// ... additional tuning +config.sns_strength = 90; +config.filter_sharpness = 6; +config_error = WebPValidateConfig(&config); // not mandatory, but useful + +// Setup the input data +WebPPicture pic; +if (!WebPPictureInit(&pic)) { + return 0; // version error +} +pic.width = width; +pic.height = height; +// allocated picture of dimension width x height +if (!WebPPictureAlloc(&pic)) { + return 0; // memory error +} +// at this point, 'pic' has been initialized as a container, +// and can receive the Y/U/V samples. +// Alternatively, one could use ready-made import functions like +// WebPPictureImportRGB(), which will take care of memory allocation. +// In any case, past this point, one will have to call +// WebPPictureFree(&pic) to reclaim memory. + +// Set up a byte-output write method. WebPMemoryWriter, for instance. +WebPMemoryWriter wrt; +WebPMemoryWriterInit(&wrt); // initialize 'wrt' + +pic.writer = MyFileWriter; +pic.custom_ptr = my_opaque_structure_to_make_MyFileWriter_work; + +// Compress! +int ok = WebPEncode(&config, &pic); // ok = 0 => error occurred! +WebPPictureFree(&pic); // must be called independently of the 'ok' result. + +// output data should have been handled by the writer at that point. +// -> compressed data is the memory buffer described by wrt.mem / wrt.size + +// deallocate the memory used by compressed data +WebPMemoryWriterClear(&wrt); +``` + +## Decoding API + +This is mainly just one function to call: + +```c +#include "webp/decode.h" +uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, + int* width, int* height); +``` + +Please have a look at the file src/webp/decode.h for the details. There are +variants for decoding in BGR/RGBA/ARGB/BGRA order, along with decoding to raw +Y'CbCr samples. One can also decode the image directly into a pre-allocated +buffer. + +To detect a WebP file and gather the picture's dimensions, the function: + +```c +int WebPGetInfo(const uint8_t* data, size_t data_size, + int* width, int* height); +``` + +is supplied. No decoding is involved when using it. + +### Incremental decoding API + +In the case when data is being progressively transmitted, pictures can still be +incrementally decoded using a slightly more complicated API. Decoder state is +stored into an instance of the WebPIDecoder object. This object can be created +with the purpose of decoding either RGB or Y'CbCr samples. For instance: + +```c +WebPDecBuffer buffer; +WebPInitDecBuffer(&buffer); +buffer.colorspace = MODE_BGR; +... +WebPIDecoder* idec = WebPINewDecoder(&buffer); +``` + +As data is made progressively available, this incremental-decoder object can be +used to decode the picture further. There are two (mutually exclusive) ways to +pass freshly arrived data: + +either by appending the fresh bytes: + +```c +WebPIAppend(idec, fresh_data, size_of_fresh_data); +``` + +or by just mentioning the new size of the transmitted data: + +```c +WebPIUpdate(idec, buffer, size_of_transmitted_buffer); +``` + +Note that 'buffer' can be modified between each call to WebPIUpdate, in +particular when the buffer is resized to accommodate larger data. + +These functions will return the decoding status: either VP8_STATUS_SUSPENDED if +decoding is not finished yet or VP8_STATUS_OK when decoding is done. Any other +status is an error condition. + +The 'idec' object must always be released (even upon an error condition) by +calling: WebPDelete(idec). + +To retrieve partially decoded picture samples, one must use the corresponding +method: WebPIDecGetRGB or WebPIDecGetYUVA. It will return the last displayable +pixel row. + +Lastly, note that decoding can also be performed into a pre-allocated pixel +buffer. This buffer must be passed when creating a WebPIDecoder, calling +WebPINewRGB() or WebPINewYUVA(). + +Please have a look at the src/webp/decode.h header for further details. + +### Advanced Decoding API + +WebP decoding supports an advanced API which provides on-the-fly cropping and +rescaling, something of great usefulness on memory-constrained environments like +mobile phones. Basically, the memory usage will scale with the output's size, +not the input's, when one only needs a quick preview or a zoomed in portion of +an otherwise too-large picture. Some CPU can be saved too, incidentally. + +```c +// A) Init a configuration object +WebPDecoderConfig config; +CHECK(WebPInitDecoderConfig(&config)); + +// B) optional: retrieve the bitstream's features. +CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + +// C) Adjust 'config' options, if needed +config.options.no_fancy_upsampling = 1; +config.options.use_scaling = 1; +config.options.scaled_width = scaledWidth(); +config.options.scaled_height = scaledHeight(); +// etc. + +// D) Specify 'config' output options for specifying output colorspace. +// Optionally the external image decode buffer can also be specified. +config.output.colorspace = MODE_BGRA; +// Optionally, the config.output can be pointed to an external buffer as +// well for decoding the image. This externally supplied memory buffer +// should be big enough to store the decoded picture. +config.output.u.RGBA.rgba = (uint8_t*) memory_buffer; +config.output.u.RGBA.stride = scanline_stride; +config.output.u.RGBA.size = total_size_of_the_memory_buffer; +config.output.is_external_memory = 1; + +// E) Decode the WebP image. There are two variants w.r.t decoding image. +// The first one (E.1) decodes the full image and the second one (E.2) is +// used to incrementally decode the image using small input buffers. +// Any one of these steps can be used to decode the WebP image. + +// E.1) Decode full image. +CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + +// E.2) Decode image incrementally. +WebPIDecoder* const idec = WebPIDecode(NULL, NULL, &config); +CHECK(idec != NULL); +while (bytes_remaining > 0) { + VP8StatusCode status = WebPIAppend(idec, input, bytes_read); + if (status == VP8_STATUS_OK || status == VP8_STATUS_SUSPENDED) { + bytes_remaining -= bytes_read; + } else { + break; + } +} +WebPIDelete(idec); + +// F) Decoded image is now in config.output (and config.output.u.RGBA). +// It can be saved, displayed or otherwise processed. + +// G) Reclaim memory allocated in config's object. It's safe to call +// this function even if the memory is external and wasn't allocated +// by WebPDecode(). +WebPFreeDecBuffer(&config.output); +``` + +## Webp Mux + +WebPMux is a set of two libraries 'Mux' and 'Demux' for creation, extraction and +manipulation of an extended format WebP file, which can have features like color +profile, metadata and animation. Reference command-line tools `webpmux` and +`vwebp` as well as the WebP container specification +'doc/webp-container-spec.txt' are also provided in this package, see the +[tools documentation](tools.md). + +### Mux API + +The Mux API contains methods for adding data to and reading data from WebP +files. This API currently supports XMP/EXIF metadata, ICC profile and animation. +Other features may be added in subsequent releases. + +Example#1 (pseudo code): Creating a WebPMux object with image data, color +profile and XMP metadata. + +```c +int copy_data = 0; +WebPMux* mux = WebPMuxNew(); +// ... (Prepare image data). +WebPMuxSetImage(mux, &image, copy_data); +// ... (Prepare ICC profile data). +WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); +// ... (Prepare XMP metadata). +WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); +// Get data from mux in WebP RIFF format. +WebPMuxAssemble(mux, &output_data); +WebPMuxDelete(mux); +// ... (Consume output_data; e.g. write output_data.bytes to file). +WebPDataClear(&output_data); +``` + +Example#2 (pseudo code): Get image and color profile data from a WebP file. + +```c +int copy_data = 0; +// ... (Read data from file). +WebPMux* mux = WebPMuxCreate(&data, copy_data); +WebPMuxGetFrame(mux, 1, &image); +// ... (Consume image; e.g. call WebPDecode() to decode the data). +WebPMuxGetChunk(mux, "ICCP", &icc_profile); +// ... (Consume icc_profile). +WebPMuxDelete(mux); +free(data); +``` + +For a detailed Mux API reference, please refer to the header file +(src/webp/mux.h). + +### Demux API + +The Demux API enables extraction of images and extended format data from WebP +files. This API currently supports reading of XMP/EXIF metadata, ICC profile and +animated images. Other features may be added in subsequent releases. + +Code example: Demuxing WebP data to extract all the frames, ICC profile and +EXIF/XMP metadata. + +```c +WebPDemuxer* demux = WebPDemux(&webp_data); +uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); +uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); +// ... (Get information about the features present in the WebP file). +uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); + +// ... (Iterate over all frames). +WebPIterator iter; +if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), + // ... and get other frame properties like width, height, offsets etc. + // ... see 'struct WebPIterator' below for more info). + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); +} + +// ... (Extract metadata). +WebPChunkIterator chunk_iter; +if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); +// ... (Consume the ICC profile in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); +// ... (Consume the EXIF metadata in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); +// ... (Consume the XMP metadata in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +WebPDemuxDelete(demux); +``` + +For a detailed Demux API reference, please refer to the header file +(src/webp/demux.h). + +## AnimEncoder API + +The AnimEncoder API can be used to create animated WebP images. + +Code example: + +```c +WebPAnimEncoderOptions enc_options; +WebPAnimEncoderOptionsInit(&enc_options); +// ... (Tune 'enc_options' as needed). +WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); +while() { + WebPConfig config; + WebPConfigInit(&config); + // ... (Tune 'config' as needed). + WebPAnimEncoderAdd(enc, frame, duration, &config); +} +WebPAnimEncoderAssemble(enc, webp_data); +WebPAnimEncoderDelete(enc); +// ... (Write the 'webp_data' to a file, or re-mux it further). +``` + +For a detailed AnimEncoder API reference, please refer to the header file +(src/webp/mux.h). + +## AnimDecoder API + +This AnimDecoder API allows decoding (possibly) animated WebP images. + +Code Example: + +```c +WebPAnimDecoderOptions dec_options; +WebPAnimDecoderOptionsInit(&dec_options); +// Tune 'dec_options' as needed. +WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); +WebPAnimInfo anim_info; +WebPAnimDecoderGetInfo(dec, &anim_info); +for (uint32_t i = 0; i < anim_info.loop_count; ++i) { + while (WebPAnimDecoderHasMoreFrames(dec)) { + uint8_t* buf; + int timestamp; + WebPAnimDecoderGetNext(dec, &buf, ×tamp); + // ... (Render 'buf' based on 'timestamp'). + // ... (Do NOT free 'buf', as it is owned by 'dec'). + } + WebPAnimDecoderReset(dec); +} +const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); +// ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). +WebPAnimDecoderDelete(dec); +``` + +For a detailed AnimDecoder API reference, please refer to the header file +(src/webp/demux.h). diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/cwebp.html b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/cwebp.html new file mode 100644 index 00000000..efaa8f71 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/cwebp.html @@ -0,0 +1,635 @@ + + + + + + + + + +CWEBP + + + + +

CWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + +

NAME + +

+ + +

cwebp - +compress an image file to a WebP file

+ +

SYNOPSIS + +

+ + +

cwebp +[options] input_file -o output_file.webp

+ +

DESCRIPTION + +

+ + +

This manual +page documents the cwebp command.

+ +

cwebp +compresses an image using the WebP format. Input format can +be either PNG, JPEG, TIFF, WebP or raw Y’CbCr samples. +Note: Animated PNG and WebP files are not supported.

+ +

OPTIONS + +

+ + +

The basic +options are:
+-o
string

+ +

Specify the name of the output +WebP file. If omitted, cwebp will perform compression +but only report statistics. Using "-" as output +name will direct output to ’stdout’.

+ +

-- string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with a +’-’ for instance. This option must appear +last. Any other options afterward will be +ignored.

+ +

-h, -help

+ +

A short usage summary.

+ +

-H, -longhelp

+ +

A summary of all the possible +options.

+ +

-version

+ +

Print the version number (as +major.minor.revision) and exit.

+ +

-lossless

+ +

Encode the image without any +loss. For images with fully transparent area, the invisible +pixel values (R/G/B or Y/U/V) will be preserved only if the +-exact option is used.

+ +

-near_lossless +int

+ +

Specify the level of +near-lossless image preprocessing. This option adjusts pixel +values to help compressibility, but has minimal impact on +the visual quality. It triggers lossless compression mode +automatically. The range is 0 (maximum preprocessing) to 100 +(no preprocessing, the default). The typical value is around +60. Note that lossy with -q 100 can at times yield +better results.

+ +

-q float

+ +

Specify the compression factor +for RGB channels between 0 and 100. The default is 75.
+In case of lossy compression (default), a small factor +produces a smaller file with lower quality. Best quality is +achieved by using a value of 100.
+In case of lossless compression (specified by the +-lossless option), a small factor enables faster +compression speed, but produces a larger file. Maximum +compression is achieved by using a value of 100.

+ + + + + + + +
+ + +

-z int

+ + +

Switch on lossless compression mode with the +specified level between 0 and 9, with level 0 being the +fastest, 9 being the slowest. Fast mode produces larger file +size than slower ones. A good default is -z 6. This +option is actually a shortcut for some predefined settings +for quality and method. If options -q or -m +are subsequently used, they will invalidate the effect of +this option.

+ +

-alpha_q int

+ +

Specify the compression factor +for alpha compression between 0 and 100. Lossless +compression of alpha is achieved using a value of 100, while +the lower values result in a lossy compression. The default +is 100.

+ +

-preset +string

+ +

Specify a set of pre-defined +parameters to suit a particular type of source material. +Possible values are: default, photo, +picture, drawing, icon, text. +Since -preset overwrites the other parameters’ +values (except the -q one), this option should +preferably appear first in the order of the arguments.

+ + + + + + + +
+ + +

-m int

+ + +

Specify the compression method to use. This parameter +controls the trade off between encoding speed and the +compressed file size and quality. Possible values range from +0 to 6. Default value is 4. When higher values are used, the +encoder will spend more time inspecting additional encoding +possibilities and decide on the quality gain. Lower value +can result in faster processing time at the expense of +larger file size and lower compression quality.

+ +

-crop x_position +y_position width height

+ +

Crop the source to a rectangle +with top-left corner at coordinates (x_position, +y_position) and size width x height. +This cropping area must be fully contained within the source +rectangle. Note: the cropping is applied before any +scaling.

+ +

-resize width +height

+ +

Resize the source to a +rectangle with size width x height. If either +(but not both) of the width or height +parameters is 0, the value will be calculated preserving the +aspect-ratio. Note: scaling is applied after +cropping.

+ + + + + + + + +
+ + +

-mt

+ + +

Use multi-threading for encoding, if possible.

+
+ +

-low_memory

+ +

Reduce memory usage of lossy +encoding by saving four times the compressed size +(typically). This will make the encoding slower and the +output slightly different in size and distortion. This flag +is only effective for methods 3 and up, and is off by +default. Note that leaving this flag off will have some side +effects on the bitstream: it forces certain bitstream +features like number of partitions (forced to 1). Note that +a more detailed report of bitstream size is printed by +cwebp when using this option.

+ +

LOSSY +OPTIONS
+These options are only effective when doing lossy encoding +(the default, with or without alpha).
+-size
int

+ +

Specify a target size (in +bytes) to try and reach for the compressed output. The +compressor will make several passes of partial encoding in +order to get as close as possible to this target. If both +-size and -psnr are used, -size value +will prevail.

+ +

-psnr float

+ +

Specify a target PSNR (in dB) +to try and reach for the compressed output. The compressor +will make several passes of partial encoding in order to get +as close as possible to this target. If both -size +and -psnr are used, -size value will +prevail.

+ +

-pass int

+ +

Set a maximum number of passes +to use during the dichotomy used by options -size or +-psnr. Maximum value is 10, default is 1. If options +-size or -psnr were used, but -pass +wasn’t specified, a default value of ’6’ +passes will be used.

+ +

-qrange int +int

+ +

Specifies the permissible +interval for the quality factor. This is particularly useful +when using multi-pass (-size or -psnr +options). Default is 0 100. If the quality factor is outside +this range, it will be clamped. If the minimum value must be +less or equal to the maximum one.

+ + + + + + + +
+ + +

-af

+ + +

Turns auto-filter on. This algorithm will spend +additional time optimizing the filtering strength to reach a +well-balanced quality.

+ +

-jpeg_like

+ +

Change the internal parameter +mapping to better match the expected size of JPEG +compression. This flag will generally produce an output file +of similar size to its JPEG equivalent (for the same +-q setting), but with less visual distortion.

+ +

Advanced options:

+ + + + + + + +
+ + +

-f int

+ + +

Specify the strength of the deblocking filter, between 0 +(no filtering) and 100 (maximum filtering). A value of 0 +will turn off any filtering. Higher value will increase the +strength of the filtering process applied after decoding the +picture. The higher the value the smoother the picture will +appear. Typical values are usually in the range of 20 to +50.

+ +

-sharpness +int

+ +

Specify the sharpness of the +filtering (if used). Range is 0 (sharpest) to 7 (least +sharp). Default is 0.

+ +

-strong

+ +

Use strong filtering (if +filtering is being used thanks to the -f option). +Strong filtering is on by default.

+ +

-nostrong

+ +

Disable strong filtering (if +filtering is being used thanks to the -f option) and +use simple filtering instead.

+ +

-sharp_yuv

+ +

Use more accurate and sharper +RGB->YUV conversion if needed. Note that this process is +slower than the default ’fast’ RGB->YUV +conversion.

+ +

-sns int

+ +

Specify the amplitude of the +spatial noise shaping. Spatial noise shaping (or sns +for short) refers to a general collection of built-in +algorithms used to decide which area of the picture should +use relatively less bits, and where else to better transfer +these bits. The possible range goes from 0 (algorithm is +off) to 100 (the maximal effect). The default value is +50.

+ +

-segments int

+ +

Change the number of partitions +to use during the segmentation of the sns algorithm. +Segments should be in range 1 to 4. Default value is 4. This +option has no effect for methods 3 and up, unless +-low_memory is used.

+ +

-partition_limit +int

+ +

Degrade quality by limiting the +number of bits used by some macroblocks. Range is 0 (no +degradation, the default) to 100 (full degradation). Useful +values are usually around 30-70 for moderately large images. +In the VP8 format, the so-called control partition has a +limit of 512k and is used to store the following +information: whether the macroblock is skipped, which +segment it belongs to, whether it is coded as intra 4x4 or +intra 16x16 mode, and finally the prediction modes to use +for each of the sub-blocks. For a very large image, 512k +only leaves room to few bits per 16x16 macroblock. The +absolute minimum is 4 bits per macroblock. Skip, segment, +and mode information can use up almost all these 4 bits +(although the case is unlikely), which is problematic for +very large images. The partition_limit factor controls how +frequently the most bit-costly mode (intra 4x4) will be +used. This is useful in case the 512k limit is reached and +the following message is displayed: Error code: 6 +(PARTITION0_OVERFLOW: Partition #0 is too big to fit +512k). If using -partition_limit is not enough to +meet the 512k constraint, one should use less segments in +order to save more header bits per macroblock. See the +-segments option.

+ +

LOGGING +OPTIONS
+These options control the level of output:

+ + + + + + + +
+ + +

-v

+ + +

Print extra information (encoding time in +particular).

+ +

-print_psnr

+ +

Compute and report average PSNR +(Peak-Signal-To-Noise ratio).

+ +

-print_ssim

+ +

Compute and report average SSIM +(structural similarity metric, see +https://en.wikipedia.org/wiki/SSIM for additional +details).

+ +

-print_lsim

+ +

Compute and report local +similarity metric (sum of lowest error amongst the +collocated pixel neighbors).

+ +

-progress

+ +

Report encoding progress in +percent.

+ + + + + + + + + + + + +
+ + +

-quiet

+ + +

Do not print anything.

+ + +

-short

+ + +

Only print brief information (output file size and PSNR) +for testing purposes.

+ +

-map int

+ +

Output additional ASCII-map of +encoding information. Possible map values range from 1 to 6. +This is only meant to help debugging.

+ +

ADDITIONAL +OPTIONS
+More advanced options are:
+-s
width height

+ +

Specify that the input file +actually consists of raw Y’CbCr samples following the +ITU-R BT.601 recommendation, in 4:2:0 linear format. The +luma plane has size width x height.

+ +

-pre int

+ +

Specify some preprocessing +steps. Using a value of ’2’ will trigger +quality-dependent pseudo-random dithering during +RGBA->YUVA conversion (lossy compression only).

+ +

-alpha_filter +string

+ +

Specify the predictive +filtering method for the alpha plane. One of +’none’, ’fast’ or +’best’, in increasing complexity and slowness +order. Default is ’fast’. Internally, alpha +filtering is performed using four possible predictions +(none, horizontal, vertical, gradient). The +’best’ mode will try each mode in turn and pick +the one which gives the smaller size. The ’fast’ +mode will just try to form an a priori guess without testing +all modes.

+ +

-alpha_method +int

+ +

Specify the algorithm used for +alpha compression: 0 or 1. Algorithm 0 denotes no +compression, 1 uses WebP lossless format for compression. +The default is 1.

+ + + + + + + +
+ + +

-exact

+ + +

Preserve RGB values in transparent area. The default is +off, to help compressibility.

+ +

-blend_alpha +int

+ +

This option blends the alpha +channel (if present) with the source using the background +color specified in hexadecimal as 0xrrggbb. The alpha +channel is afterward reset to the opaque value 255.

+ +

-noalpha

+ +

Using this option will discard +the alpha channel.

+ +

-hint string

+ +

Specify the hint about input +image type. Possible values are: photo, +picture or graph.

+ +

-metadata +string

+ +

A comma separated list of +metadata to copy from the input to the output if present. +Valid values: all, none, exif, +icc, xmp. The default is none.

+ +

Note: each +input format may not support all combinations.

+ + + + + + + + +
+ + +

-noasm

+ + +

Disable all assembly optimizations.

+
+ +

BUGS + +

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting-patches/

+ +

EXAMPLES + +

+ + +

cwebp -q 50 +-lossless picture.png -o picture_lossless.webp
+cwebp -q 70 picture_with_alpha.png -o +picture_with_alpha.webp
+cwebp -sns 70 -f 50 -size 60000 picture.png -o picture.webp +
+cwebp -o picture.webp -- ---picture.png

+ +

AUTHORS + +

+ + +

cwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ +

SEE ALSO + +

+ + + +

dwebp(1), +gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/cwebp.txt b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/cwebp.txt new file mode 100644 index 00000000..edc31a86 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/cwebp.txt @@ -0,0 +1,340 @@ +CWEBP(1) General Commands Manual CWEBP(1) + + + +NAME + cwebp - compress an image file to a WebP file + +SYNOPSIS + cwebp [options] input_file -o output_file.webp + +DESCRIPTION + This manual page documents the cwebp command. + + cwebp compresses an image using the WebP format. Input format can be + either PNG, JPEG, TIFF, WebP or raw Y'CbCr samples. Note: Animated PNG + and WebP files are not supported. + +OPTIONS + The basic options are: + + -o string + Specify the name of the output WebP file. If omitted, cwebp will + perform compression but only report statistics. Using "-" as + output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with a '-' for instance. This option must ap- + pear last. Any other options afterward will be ignored. + + -h, -help + A short usage summary. + + -H, -longhelp + A summary of all the possible options. + + -version + Print the version number (as major.minor.revision) and exit. + + -lossless + Encode the image without any loss. For images with fully trans- + parent area, the invisible pixel values (R/G/B or Y/U/V) will be + preserved only if the -exact option is used. + + -near_lossless int + Specify the level of near-lossless image preprocessing. This op- + tion adjusts pixel values to help compressibility, but has mini- + mal impact on the visual quality. It triggers lossless compres- + sion mode automatically. The range is 0 (maximum preprocessing) + to 100 (no preprocessing, the default). The typical value is + around 60. Note that lossy with -q 100 can at times yield better + results. + + -q float + Specify the compression factor for RGB channels between 0 and + 100. The default is 75. + In case of lossy compression (default), a small factor produces + a smaller file with lower quality. Best quality is achieved by + using a value of 100. + In case of lossless compression (specified by the -lossless op- + tion), a small factor enables faster compression speed, but pro- + duces a larger file. Maximum compression is achieved by using a + value of 100. + + -z int Switch on lossless compression mode with the specified level be- + tween 0 and 9, with level 0 being the fastest, 9 being the slow- + est. Fast mode produces larger file size than slower ones. A + good default is -z 6. This option is actually a shortcut for + some predefined settings for quality and method. If options -q + or -m are subsequently used, they will invalidate the effect of + this option. + + -alpha_q int + Specify the compression factor for alpha compression between 0 + and 100. Lossless compression of alpha is achieved using a + value of 100, while the lower values result in a lossy compres- + sion. The default is 100. + + -preset string + Specify a set of pre-defined parameters to suit a particular + type of source material. Possible values are: default, photo, + picture, drawing, icon, text. Since -preset overwrites the other + parameters' values (except the -q one), this option should + preferably appear first in the order of the arguments. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. When higher values are used, the encoder will spend + more time inspecting additional encoding possibilities and de- + cide on the quality gain. Lower value can result in faster pro- + cessing time at the expense of larger file size and lower com- + pression quality. + + -crop x_position y_position width height + Crop the source to a rectangle with top-left corner at coordi- + nates (x_position, y_position) and size width x height. This + cropping area must be fully contained within the source rectan- + gle. Note: the cropping is applied before any scaling. + + -resize width height + Resize the source to a rectangle with size width x height. If + either (but not both) of the width or height parameters is 0, + the value will be calculated preserving the aspect-ratio. Note: + scaling is applied after cropping. + + -mt Use multi-threading for encoding, if possible. + + -low_memory + Reduce memory usage of lossy encoding by saving four times the + compressed size (typically). This will make the encoding slower + and the output slightly different in size and distortion. This + flag is only effective for methods 3 and up, and is off by de- + fault. Note that leaving this flag off will have some side ef- + fects on the bitstream: it forces certain bitstream features + like number of partitions (forced to 1). Note that a more de- + tailed report of bitstream size is printed by cwebp when using + this option. + + + LOSSY OPTIONS + These options are only effective when doing lossy encoding (the de- + fault, with or without alpha). + + + -size int + Specify a target size (in bytes) to try and reach for the com- + pressed output. The compressor will make several passes of par- + tial encoding in order to get as close as possible to this tar- + get. If both -size and -psnr are used, -size value will prevail. + + -psnr float + Specify a target PSNR (in dB) to try and reach for the com- + pressed output. The compressor will make several passes of par- + tial encoding in order to get as close as possible to this tar- + get. If both -size and -psnr are used, -size value will prevail. + + -pass int + Set a maximum number of passes to use during the dichotomy used + by options -size or -psnr. Maximum value is 10, default is 1. + If options -size or -psnr were used, but -pass wasn't specified, + a default value of '6' passes will be used. + + -qrange int int + Specifies the permissible interval for the quality factor. This + is particularly useful when using multi-pass (-size or -psnr op- + tions). Default is 0 100. If the quality factor is outside + this range, it will be clamped. If the minimum value must be + less or equal to the maximum one. + + -af Turns auto-filter on. This algorithm will spend additional time + optimizing the filtering strength to reach a well-balanced qual- + ity. + + -jpeg_like + Change the internal parameter mapping to better match the ex- + pected size of JPEG compression. This flag will generally pro- + duce an output file of similar size to its JPEG equivalent (for + the same -q setting), but with less visual distortion. + + + Advanced options: + + + -f int Specify the strength of the deblocking filter, between 0 (no + filtering) and 100 (maximum filtering). A value of 0 will turn + off any filtering. Higher value will increase the strength of + the filtering process applied after decoding the picture. The + higher the value the smoother the picture will appear. Typical + values are usually in the range of 20 to 50. + + -sharpness int + Specify the sharpness of the filtering (if used). Range is 0 + (sharpest) to 7 (least sharp). Default is 0. + + -strong + Use strong filtering (if filtering is being used thanks to the + -f option). Strong filtering is on by default. + + -nostrong + Disable strong filtering (if filtering is being used thanks to + the -f option) and use simple filtering instead. + + -sharp_yuv + Use more accurate and sharper RGB->YUV conversion if needed. + Note that this process is slower than the default 'fast' + RGB->YUV conversion. + + -sns int + Specify the amplitude of the spatial noise shaping. Spatial + noise shaping (or sns for short) refers to a general collection + of built-in algorithms used to decide which area of the picture + should use relatively less bits, and where else to better trans- + fer these bits. The possible range goes from 0 (algorithm is + off) to 100 (the maximal effect). The default value is 50. + + -segments int + Change the number of partitions to use during the segmentation + of the sns algorithm. Segments should be in range 1 to 4. De- + fault value is 4. This option has no effect for methods 3 and + up, unless -low_memory is used. + + -partition_limit int + Degrade quality by limiting the number of bits used by some mac- + roblocks. Range is 0 (no degradation, the default) to 100 (full + degradation). Useful values are usually around 30-70 for moder- + ately large images. In the VP8 format, the so-called control + partition has a limit of 512k and is used to store the following + information: whether the macroblock is skipped, which segment it + belongs to, whether it is coded as intra 4x4 or intra 16x16 + mode, and finally the prediction modes to use for each of the + sub-blocks. For a very large image, 512k only leaves room to + few bits per 16x16 macroblock. The absolute minimum is 4 bits + per macroblock. Skip, segment, and mode information can use up + almost all these 4 bits (although the case is unlikely), which + is problematic for very large images. The partition_limit factor + controls how frequently the most bit-costly mode (intra 4x4) + will be used. This is useful in case the 512k limit is reached + and the following message is displayed: Error code: 6 (PARTI- + TION0_OVERFLOW: Partition #0 is too big to fit 512k). If using + -partition_limit is not enough to meet the 512k constraint, one + should use less segments in order to save more header bits per + macroblock. See the -segments option. + + + LOGGING OPTIONS + These options control the level of output: + + -v Print extra information (encoding time in particular). + + -print_psnr + Compute and report average PSNR (Peak-Signal-To-Noise ratio). + + -print_ssim + Compute and report average SSIM (structural similarity metric, + see https://en.wikipedia.org/wiki/SSIM for additional details). + + -print_lsim + Compute and report local similarity metric (sum of lowest error + amongst the collocated pixel neighbors). + + -progress + Report encoding progress in percent. + + -quiet Do not print anything. + + -short Only print brief information (output file size and PSNR) for + testing purposes. + + -map int + Output additional ASCII-map of encoding information. Possible + map values range from 1 to 6. This is only meant to help debug- + ging. + + + ADDITIONAL OPTIONS + More advanced options are: + + -s width height + Specify that the input file actually consists of raw Y'CbCr sam- + ples following the ITU-R BT.601 recommendation, in 4:2:0 linear + format. The luma plane has size width x height. + + -pre int + Specify some preprocessing steps. Using a value of '2' will + trigger quality-dependent pseudo-random dithering during + RGBA->YUVA conversion (lossy compression only). + + -alpha_filter string + Specify the predictive filtering method for the alpha plane. One + of 'none', 'fast' or 'best', in increasing complexity and slow- + ness order. Default is 'fast'. Internally, alpha filtering is + performed using four possible predictions (none, horizontal, + vertical, gradient). The 'best' mode will try each mode in turn + and pick the one which gives the smaller size. The 'fast' mode + will just try to form an a priori guess without testing all + modes. + + -alpha_method int + Specify the algorithm used for alpha compression: 0 or 1. Algo- + rithm 0 denotes no compression, 1 uses WebP lossless format for + compression. The default is 1. + + -exact Preserve RGB values in transparent area. The default is off, to + help compressibility. + + -blend_alpha int + This option blends the alpha channel (if present) with the + source using the background color specified in hexadecimal as + 0xrrggbb. The alpha channel is afterward reset to the opaque + value 255. + + -noalpha + Using this option will discard the alpha channel. + + -hint string + Specify the hint about input image type. Possible values are: + photo, picture or graph. + + -metadata string + A comma separated list of metadata to copy from the input to the + output if present. Valid values: all, none, exif, icc, xmp. + The default is none. + + Note: each input format may not support all combinations. + + -noasm Disable all assembly optimizations. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + cwebp -q 50 -lossless picture.png -o picture_lossless.webp + cwebp -q 70 picture_with_alpha.png -o picture_with_alpha.webp + cwebp -sns 70 -f 50 -size 60000 picture.png -o picture.webp + cwebp -o picture.webp -- ---picture.png + + +AUTHORS + cwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + dwebp(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + March 17, 2022 CWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/dwebp.html b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/dwebp.html new file mode 100644 index 00000000..6f3f7f86 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/dwebp.html @@ -0,0 +1,369 @@ + + + + + + + + + +DWEBP + + + + +

DWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + +

NAME + +

+ + +

dwebp - +decompress a WebP file to an image file

+ +

SYNOPSIS + +

+ + +

dwebp +[options] input_file.webp

+ +

DESCRIPTION + +

+ + +

This manual +page documents the dwebp command.

+ +

dwebp +decompresses WebP files into PNG, PAM, PPM or PGM images. +Note: Animated WebP files are not supported.

+ +

OPTIONS + +

+ + +

The basic +options are:

+ + + + + + + + +
+ + +

-h

+ + +

Print usage summary.

+
+ +

-version

+ +

Print the version number (as +major.minor.revision) and exit.

+ +

-o string

+ +

Specify the name of the output +file (as PNG format by default). Using "-" as +output name will direct output to ’stdout’.

+ +

-- string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’-’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "-", the data will be read from +stdin instead of a file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

-bmp

+ + +

Change the output format to uncompressed BMP.

+ + +

-tiff

+ + +

Change the output format to uncompressed TIFF.

+ + +

-pam

+ + +

Change the output format to PAM (retains alpha).

+ + +

-ppm

+ + +

Change the output format to PPM (discards alpha).

+ + +

-pgm

+ + +

Change the output format to PGM. The output consists of +luma/chroma samples instead of RGB, using the IMC4 layout. +This option is mainly for verification and debugging +purposes.

+ + +

-yuv

+ + +

Change the output format to raw YUV. The output consists +of luma/chroma-U/chroma-V samples instead of RGB, saved +sequentially as individual planes. This option is mainly for +verification and debugging purposes.

+ +

-nofancy

+ +

Don’t use the fancy +upscaler for YUV420. This may lead to jaggy edges +(especially the red ones), but should be faster.

+ +

-nofilter

+ +

Don’t use the in-loop +filtering process even if it is required by the bitstream. +This may produce visible blocks on the non-compliant output, +but it will make the decoding faster.

+ +

-dither +strength

+ +

Specify a dithering +strength between 0 and 100. Dithering is a +post-processing effect applied to chroma components in lossy +compression. It helps by smoothing gradients and avoiding +banding artifacts.

+ +

-alpha_dither

+ +

If the compressed file contains +a transparency plane that was quantized during compression, +this flag will allow dithering the reconstructed plane in +order to generate smoother transparency gradients.

+ +

-nodither

+ +

Disable all dithering +(default).

+ + + + + + + + +
+ + +

-mt

+ + +

Use multi-threading for decoding, if possible.

+
+ +

-crop x_position +y_position width height

+ +

Crop the decoded picture to a +rectangle with top-left corner at coordinates +(x_position, y_position) and size width +x height. This cropping area must be fully contained +within the source rectangle. The top-left corner will be +snapped to even coordinates if needed. This option is meant +to reduce the memory needed for cropping large images. Note: +the cropping is applied before any scaling.

+ + + + + + + +
+ + +

-flip

+ + +

Flip decoded image vertically (can be useful for OpenGL +textures for instance).

+ +

-resize, -scale +width height

+ +

Rescale the decoded picture to +dimension width x height. This option is +mostly intended to reducing the memory needed to decode +large images, when only a small version is needed +(thumbnail, preview, etc.). Note: scaling is applied +after cropping. If either (but not both) of the +width or height parameters is 0, the value +will be calculated preserving the aspect-ratio.

+ + + + + + + + + + + + + + + + + +
+ + +

-quiet

+ + +

Do not print anything.

+ + +

-v

+ + +

Print extra information (decoding time in +particular).

+ + +

-noasm

+ + +

Disable all assembly optimizations.

+ +

BUGS + +

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting-patches/

+ +

EXAMPLES + +

+ + +

dwebp +picture.webp -o output.png
+dwebp picture.webp -ppm -o output.ppm
+dwebp -o output.ppm -- ---picture.webp
+cat picture.webp | dwebp -o - -- - > output.ppm

+ +

AUTHORS + +

+ + +

dwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ +

SEE ALSO + +

+ + + +

cwebp(1), +gif2webp(1), webpmux(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+ +

Output file +format details
+PAM: http://netpbm.sourceforge.net/doc/pam.html
+PGM: http://netpbm.sourceforge.net/doc/pgm.html
+PPM: http://netpbm.sourceforge.net/doc/ppm.html
+PNG: http://www.libpng.org/pub/png/png-sitemap.html#info

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/dwebp.txt b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/dwebp.txt new file mode 100644 index 00000000..92f4b5e7 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/dwebp.txt @@ -0,0 +1,142 @@ +DWEBP(1) General Commands Manual DWEBP(1) + + + +NAME + dwebp - decompress a WebP file to an image file + +SYNOPSIS + dwebp [options] input_file.webp + +DESCRIPTION + This manual page documents the dwebp command. + + dwebp decompresses WebP files into PNG, PAM, PPM or PGM images. Note: + Animated WebP files are not supported. + +OPTIONS + The basic options are: + + -h Print usage summary. + + -version + Print the version number (as major.minor.revision) and exit. + + -o string + Specify the name of the output file (as PNG format by default). + Using "-" as output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must ap- + pear last. Any other options afterward will be ignored. If the + input file is "-", the data will be read from stdin instead of a + file. + + -bmp Change the output format to uncompressed BMP. + + -tiff Change the output format to uncompressed TIFF. + + -pam Change the output format to PAM (retains alpha). + + -ppm Change the output format to PPM (discards alpha). + + -pgm Change the output format to PGM. The output consists of + luma/chroma samples instead of RGB, using the IMC4 layout. This + option is mainly for verification and debugging purposes. + + -yuv Change the output format to raw YUV. The output consists of + luma/chroma-U/chroma-V samples instead of RGB, saved sequen- + tially as individual planes. This option is mainly for verifica- + tion and debugging purposes. + + -nofancy + Don't use the fancy upscaler for YUV420. This may lead to jaggy + edges (especially the red ones), but should be faster. + + -nofilter + Don't use the in-loop filtering process even if it is required + by the bitstream. This may produce visible blocks on the non- + compliant output, but it will make the decoding faster. + + -dither strength + Specify a dithering strength between 0 and 100. Dithering is a + post-processing effect applied to chroma components in lossy + compression. It helps by smoothing gradients and avoiding band- + ing artifacts. + + -alpha_dither + If the compressed file contains a transparency plane that was + quantized during compression, this flag will allow dithering the + reconstructed plane in order to generate smoother transparency + gradients. + + -nodither + Disable all dithering (default). + + -mt Use multi-threading for decoding, if possible. + + -crop x_position y_position width height + Crop the decoded picture to a rectangle with top-left corner at + coordinates (x_position, y_position) and size width x height. + This cropping area must be fully contained within the source + rectangle. The top-left corner will be snapped to even coordi- + nates if needed. This option is meant to reduce the memory + needed for cropping large images. Note: the cropping is applied + before any scaling. + + -flip Flip decoded image vertically (can be useful for OpenGL textures + for instance). + + -resize, -scale width height + Rescale the decoded picture to dimension width x height. This + option is mostly intended to reducing the memory needed to de- + code large images, when only a small version is needed (thumb- + nail, preview, etc.). Note: scaling is applied after cropping. + If either (but not both) of the width or height parameters is 0, + the value will be calculated preserving the aspect-ratio. + + -quiet Do not print anything. + + -v Print extra information (decoding time in particular). + + -noasm Disable all assembly optimizations. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + dwebp picture.webp -o output.png + dwebp picture.webp -ppm -o output.ppm + dwebp -o output.ppm -- ---picture.webp + cat picture.webp | dwebp -o - -- - > output.ppm + + +AUTHORS + dwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), gif2webp(1), webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + Output file format details + PAM: http://netpbm.sourceforge.net/doc/pam.html + PGM: http://netpbm.sourceforge.net/doc/pgm.html + PPM: http://netpbm.sourceforge.net/doc/ppm.html + PNG: http://www.libpng.org/pub/png/png-sitemap.html#info + + + + November 17, 2021 DWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/gif2webp.html b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/gif2webp.html new file mode 100644 index 00000000..5bf094fe --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/gif2webp.html @@ -0,0 +1,327 @@ + + + + + + + + + +GIF2WEBP + + + + +

GIF2WEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + +

NAME + +

+ + +

gif2webp - +Convert a GIF image to WebP

+ +

SYNOPSIS + +

+ + + +

gif2webp +[options] input_file.gif -o +output_file.webp

+ +

DESCRIPTION + +

+ + +

This manual +page documents the gif2webp command.

+ + +

gif2webp +converts a GIF image to a WebP image.

+ +

OPTIONS + +

+ + +

The basic +options are:
+-o
string

+ +

Specify the name of the output +WebP file. If omitted, gif2webp will perform +conversion but only report statistics. Using "-" +as output name will direct output to +’stdout’.

+ +

-- string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’-’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "-", the data will be read from +stdin instead of a file.

+ +

-h, -help

+ +

Usage information.

+ +

-version

+ +

Print the version number (as +major.minor.revision) and exit.

+ + + + + + + + + + + + +
+ + +

-lossy

+ + +

Encode the image using lossy compression.

+ + +

-mixed

+ + +

Mixed compression mode: optimize compression of the +image by picking either lossy or lossless compression for +each frame heuristically.

+ +

-q float

+ +

Specify the compression factor +for RGB channels between 0 and 100. The default is 75.
+In case of lossless compression (default), a small factor +enables faster compression speed, but produces a larger +file. Maximum compression is achieved by using a value of +100.
+In case of lossy compression (specified by the -lossy +option), a small factor produces a smaller file with lower +quality. Best quality is achieved by using a value of +100.

+ + + + + + + +
+ + +

-m int

+ + +

Specify the compression method to use. This parameter +controls the trade off between encoding speed and the +compressed file size and quality. Possible values range from +0 to 6. Default value is 4. When higher values are used, the +encoder will spend more time inspecting additional encoding +possibilities and decide on the quality gain. Lower value +can result is faster processing time at the expense of +larger file size and lower compression quality.

+ +

-min_size

+ +

Encode image to achieve +smallest size. This disables key frame insertion and picks +the dispose method resulting in the smallest output for each +frame. It uses lossless compression by default, but can be +combined with -q, -m, -lossy or -mixed options.

+ +

-kmin int
+-kmax
int

+ +

Specify the minimum and maximum +distance between consecutive key frames (independently +decodable frames) in the output animation. The tool will +insert some key frames into the output animation as needed +so that this criteria is satisfied.
+A ’kmax’ value of 0 will turn off insertion of +key frames. A ’kmax’ value of 1 will result in +all frames being key frames. ’kmin’ value is not +taken into account in both these special cases. Typical +values are in the range 3 to 30. Default values are kmin = +9, kmax = 17 for lossless compression and kmin = 3, kmax = 5 +for lossy compression.
+These two options are relevant only for animated images with +large number of frames (>50).
+When lower values are used, more frames will be converted to +key frames. This may lead to smaller number of frames +required to decode a frame on average, thereby improving the +decoding performance. But this may lead to slightly bigger +file sizes. Higher values may lead to worse decoding +performance, but smaller file sizes.
+Some restrictions:
+(i) kmin < kmax,
+(ii) kmin >= kmax / 2 + 1 and
+(iii) kmax - kmin <= 30.
+If any of these restrictions are not met, they will be +enforced automatically.

+ +

-metadata +string

+ +

A comma separated list of +metadata to copy from the input to the output if present. +Valid values: all, none, icc, +xmp. The default is xmp.

+ + + + + + + + + + + + +
+ + +

-f int

+ + +

For lossy encoding only (specified by the -lossy +option). Specify the strength of the deblocking filter, +between 0 (no filtering) and 100 (maximum filtering). A +value of 0 will turn off any filtering. Higher value will +increase the strength of the filtering process applied after +decoding the picture. The higher the value the smoother the +picture will appear. Typical values are usually in the range +of 20 to 50.

+ + +

-mt

+ + +

Use multi-threading for encoding, if possible.

+ +

-loop_compatibility

+ +

If enabled, handle the loop +information in a compatible fashion for Chrome version prior +to M62 (inclusive) and Firefox.

+ + + + + + + + + + + + + + +
+ + +

-v

+ + +

Print extra information.

+
+ + +

-quiet

+ + +

Do not print anything.

+
+ +

BUGS + +

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting-patches/

+ +

EXAMPLES + +

+ + +

gif2webp +picture.gif -o picture.webp
+gif2webp -q 70 picture.gif -o picture.webp
+gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp
+gif2webp -lossy -f 50 picture.gif -o picture.webp
+gif2webp -q 70 -o picture.webp -- ---picture.gif
+cat picture.gif | gif2webp -o - -- - > output.webp

+ +

AUTHORS + +

+ + + +

gif2webp +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Urvang Joshi <urvang@google.com>, +for the Debian project (and may be used by others).

+ +

SEE ALSO + +

+ + + +

cwebp(1), +dwebp(1), webpmux(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/gif2webp.txt b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/gif2webp.txt new file mode 100644 index 00000000..6e13e422 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/gif2webp.txt @@ -0,0 +1,152 @@ +GIF2WEBP(1) General Commands Manual GIF2WEBP(1) + + + +NAME + gif2webp - Convert a GIF image to WebP + +SYNOPSIS + gif2webp [options] input_file.gif -o output_file.webp + +DESCRIPTION + This manual page documents the gif2webp command. + + gif2webp converts a GIF image to a WebP image. + +OPTIONS + The basic options are: + + -o string + Specify the name of the output WebP file. If omitted, gif2webp + will perform conversion but only report statistics. Using "-" + as output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must ap- + pear last. Any other options afterward will be ignored. If the + input file is "-", the data will be read from stdin instead of a + file. + + -h, -help + Usage information. + + -version + Print the version number (as major.minor.revision) and exit. + + -lossy Encode the image using lossy compression. + + -mixed Mixed compression mode: optimize compression of the image by + picking either lossy or lossless compression for each frame + heuristically. + + -q float + Specify the compression factor for RGB channels between 0 and + 100. The default is 75. + In case of lossless compression (default), a small factor en- + ables faster compression speed, but produces a larger file. Max- + imum compression is achieved by using a value of 100. + In case of lossy compression (specified by the -lossy option), a + small factor produces a smaller file with lower quality. Best + quality is achieved by using a value of 100. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. When higher values are used, the encoder will spend + more time inspecting additional encoding possibilities and de- + cide on the quality gain. Lower value can result is faster pro- + cessing time at the expense of larger file size and lower com- + pression quality. + + -min_size + Encode image to achieve smallest size. This disables key frame + insertion and picks the dispose method resulting in the smallest + output for each frame. It uses lossless compression by default, + but can be combined with -q, -m, -lossy or -mixed options. + + -kmin int + + -kmax int + Specify the minimum and maximum distance between consecutive key + frames (independently decodable frames) in the output animation. + The tool will insert some key frames into the output animation + as needed so that this criteria is satisfied. + A 'kmax' value of 0 will turn off insertion of key frames. A + 'kmax' value of 1 will result in all frames being key frames. + 'kmin' value is not taken into account in both these special + cases. Typical values are in the range 3 to 30. Default values + are kmin = 9, kmax = 17 for lossless compression and kmin = 3, + kmax = 5 for lossy compression. + These two options are relevant only for animated images with + large number of frames (>50). + When lower values are used, more frames will be converted to key + frames. This may lead to smaller number of frames required to + decode a frame on average, thereby improving the decoding per- + formance. But this may lead to slightly bigger file sizes. + Higher values may lead to worse decoding performance, but + smaller file sizes. + Some restrictions: + (i) kmin < kmax, + (ii) kmin >= kmax / 2 + 1 and + (iii) kmax - kmin <= 30. + If any of these restrictions are not met, they will be enforced + automatically. + + -metadata string + A comma separated list of metadata to copy from the input to the + output if present. Valid values: all, none, icc, xmp. The de- + fault is xmp. + + -f int For lossy encoding only (specified by the -lossy option). Spec- + ify the strength of the deblocking filter, between 0 (no filter- + ing) and 100 (maximum filtering). A value of 0 will turn off + any filtering. Higher value will increase the strength of the + filtering process applied after decoding the picture. The higher + the value the smoother the picture will appear. Typical values + are usually in the range of 20 to 50. + + -mt Use multi-threading for encoding, if possible. + + -loop_compatibility + If enabled, handle the loop information in a compatible fashion + for Chrome version prior to M62 (inclusive) and Firefox. + + -v Print extra information. + + -quiet Do not print anything. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + gif2webp picture.gif -o picture.webp + gif2webp -q 70 picture.gif -o picture.webp + gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp + gif2webp -lossy -f 50 picture.gif -o picture.webp + gif2webp -q 70 -o picture.webp -- ---picture.gif + cat picture.gif | gif2webp -o - -- - > output.webp + + +AUTHORS + gif2webp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Urvang Joshi , for + the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), dwebp(1), webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 GIF2WEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/img2webp.html b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/img2webp.html new file mode 100644 index 00000000..b2ec54e4 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/img2webp.html @@ -0,0 +1,242 @@ + + + + + + + + + +IMG2WEBP + + + + +

IMG2WEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+FILE-LEVEL OPTIONS
+PER-FRAME OPTIONS
+EXAMPLE
+BUGS
+AUTHORS
+SEE ALSO
+ +
+ + +

NAME + +

+ + +

img2webp - +create animated WebP file from a sequence of input +images.

+ +

SYNOPSIS + +

+ + + +

img2webp +[file_options] [[frame_options] frame_file]...
+img2webp argument_file_name

+ +

DESCRIPTION + +

+ + +

This manual +page documents the img2webp command.

+ + +

img2webp +compresses a sequence of images using the animated WebP +format. Input images can either be PNG, JPEG, TIFF or WebP. +If a single file name (not starting with the character +’-’) is supplied as the argument, the command +line arguments are actually tokenized from this file. This +allows for easy scripting or using a large number of +arguments.

+ +

FILE-LEVEL OPTIONS + +

+ + +

The file-level +options are applied at the beginning of the compression +process, before the input frames are read.
+-o
string

+ +

Specify the name of the output +WebP file.

+ +

-min_size

+ +

Encode images to achieve +smallest size. This disables key frame insertion and picks +the parameters resulting in the smallest output for each +frame. It uses lossless compression by default, but can be +combined with -q, -m, -lossy or -mixed options.

+ +

-kmin int
+-kmax
int

+ +

Specify the minimum and maximum +distance between consecutive key frames (independently +decodable frames) in the output animation. The tool will +insert some key frames into the output animation as needed +so that this criteria is satisfied.
+-mixed
Mixed compression mode: optimize compression of +the image by picking either lossy or lossless compression +for each frame heuristically. This global option disables +the local option -lossy and -lossless .

+ +

-loop int

+ +

Specifies the number of times +the animation should loop. Using ’0’ means +’loop indefinitely’.

+ + + + + + + + +
+ + +

-v

+ + +

Be more verbose.

+
+ +

-h, -help

+ +

A short usage summary.

+ +

-version

+ +

Print the version numbers of +the relevant libraries used.

+ +

PER-FRAME OPTIONS + +

+ + +

The per-frame +options are applied for the images following as arguments in +the command line. They can be modified any number of times +preceding each particular input image.

+ + + + + + + + +
+ + +

-d int

+ + +

Specify the image duration in milliseconds.

+
+ +

-lossless, -lossy

+ +

Compress the next image(s) +using lossless or lossy compression mode. The default mode +is lossless.

+ +

-q float

+ +

Specify the compression factor +between 0 and 100. The default is 75.

+ + + + + + + +
+ + +

-m int

+ + +

Specify the compression method to use. This parameter +controls the trade off between encoding speed and the +compressed file size and quality. Possible values range from +0 to 6. Default value is 4.

+ +

EXAMPLE + +

+ + +

img2webp -loop +2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp

+ +

BUGS + +

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting-patches/

+ +

AUTHORS + +

+ + + +

img2webp +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ +

SEE ALSO + +

+ + + +

webpmux(1), +gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/img2webp.txt b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/img2webp.txt new file mode 100644 index 00000000..1fdb8597 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/img2webp.txt @@ -0,0 +1,108 @@ +IMG2WEBP(1) General Commands Manual IMG2WEBP(1) + + + +NAME + img2webp - create animated WebP file from a sequence of input images. + +SYNOPSIS + img2webp [file_options] [[frame_options] frame_file]... + img2webp argument_file_name + +DESCRIPTION + This manual page documents the img2webp command. + + img2webp compresses a sequence of images using the animated WebP for- + mat. Input images can either be PNG, JPEG, TIFF or WebP. If a single + file name (not starting with the character '-') is supplied as the ar- + gument, the command line arguments are actually tokenized from this + file. This allows for easy scripting or using a large number of argu- + ments. + +FILE-LEVEL OPTIONS + The file-level options are applied at the beginning of the compression + process, before the input frames are read. + + -o string + Specify the name of the output WebP file. + + -min_size + Encode images to achieve smallest size. This disables key frame + insertion and picks the parameters resulting in the smallest + output for each frame. It uses lossless compression by default, + but can be combined with -q, -m, -lossy or -mixed options. + + -kmin int + + -kmax int + Specify the minimum and maximum distance between consecutive key + frames (independently decodable frames) in the output animation. + The tool will insert some key frames into the output animation + as needed so that this criteria is satisfied. + -mixed Mixed compression mode: optimize compression of the image + by picking either lossy or lossless compression for each frame + heuristically. This global option disables the local option + -lossy and -lossless . + + -loop int + Specifies the number of times the animation should loop. Using + '0' means 'loop indefinitely'. + + -v Be more verbose. + + -h, -help + A short usage summary. + + -version + Print the version numbers of the relevant libraries used. + + +PER-FRAME OPTIONS + The per-frame options are applied for the images following as arguments + in the command line. They can be modified any number of times preceding + each particular input image. + + -d int Specify the image duration in milliseconds. + + -lossless, -lossy + Compress the next image(s) using lossless or lossy compression + mode. The default mode is lossless. + + -q float + Specify the compression factor between 0 and 100. The default is + 75. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. + + +EXAMPLE + img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +AUTHORS + img2webp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + webpmux(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + January 5, 2022 IMG2WEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/tools.md b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/tools.md new file mode 100644 index 00000000..853af819 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/tools.md @@ -0,0 +1,512 @@ +# WebP tools + +## Encoding tool + +The examples/ directory contains tools for encoding (cwebp) and decoding (dwebp) +images. + +The easiest use should look like: + +```shell +cwebp input.png -q 80 -o output.webp +``` + +which will convert the input file to a WebP file using a quality factor of 80 on +a 0->100 scale (0 being the lowest quality, 100 being the best. Default value is +75). + +You might want to try the `-lossless` flag too, which will compress the source +(in RGBA format) without any loss. The `-q` quality parameter will in this case +control the amount of processing time spent trying to make the output file as +small as possible. + +A longer list of options is available using the `-longhelp` command line flag: + +```shell +> cwebp -longhelp +Usage: + cwebp [-preset <...>] [options] in_file [-o out_file] +``` + +If input size (-s) for an image is not specified, it is assumed to be a PNG, +JPEG, TIFF or WebP file. Note: Animated PNG and WebP files are not supported. + +Options: + +``` +-h / -help ............. short help +-H / -longhelp ......... long help +-q ............. quality factor (0:small..100:big), default=75 +-alpha_q ......... transparency-compression quality (0..100), + default=100 +-preset ....... preset setting, one of: + default, photo, picture, + drawing, icon, text + -preset must come first, as it overwrites other parameters +-z ............... activates lossless preset with given + level in [0:fast, ..., 9:slowest] + +-m ............... compression method (0=fast, 6=slowest), default=4 +-segments ........ number of segments to use (1..4), default=4 +-size ............ target size (in bytes) +-psnr .......... target PSNR (in dB. typically: 42) + +-s ......... input size (width x height) for YUV +-sns ............. spatial noise shaping (0:off, 100:max), default=50 +-f ............... filter strength (0=off..100), default=60 +-sharpness ....... filter sharpness (0:most .. 7:least sharp), default=0 +-strong ................ use strong filter instead of simple (default) +-nostrong .............. use simple filter instead of strong +-sharp_yuv ............. use sharper (and slower) RGB->YUV conversion +-partition_limit . limit quality to fit the 512k limit on + the first partition (0=no degradation ... 100=full) +-pass ............ analysis pass number (1..10) +-qrange .... specifies the permissible quality range + (default: 0 100) +-crop .. crop picture with the given rectangle +-resize ........ resize picture (*after* any cropping) +-mt .................... use multi-threading if available +-low_memory ............ reduce memory usage (slower encoding) +-map ............. print map of extra info +-print_psnr ............ prints averaged PSNR distortion +-print_ssim ............ prints averaged SSIM distortion +-print_lsim ............ prints local-similarity distortion +-d .......... dump the compressed output (PGM file) +-alpha_method .... transparency-compression method (0..1), default=1 +-alpha_filter . predictive filtering for alpha plane, + one of: none, fast (default) or best +-exact ................. preserve RGB values in transparent area, default=off +-blend_alpha ..... blend colors against background color + expressed as RGB values written in + hexadecimal, e.g. 0xc0e0d0 for red=0xc0 + green=0xe0 and blue=0xd0 +-noalpha ............... discard any transparency information +-lossless .............. encode image losslessly, default=off +-near_lossless ... use near-lossless image + preprocessing (0..100=off), default=100 +-hint ......... specify image characteristics hint, + one of: photo, picture or graph + +-metadata ..... comma separated list of metadata to + copy from the input to the output if present. + Valid values: all, none (default), exif, icc, xmp + +-short ................. condense printed message +-quiet ................. don't print anything +-version ............... print version number and exit +-noasm ................. disable all assembly optimizations +-v ..................... verbose, e.g. print encoding/decoding times +-progress .............. report encoding progress +``` + +Experimental Options: + +``` +-jpeg_like ............. roughly match expected JPEG size +-af .................... auto-adjust filter strength +-pre ............. pre-processing filter +``` + +The main options you might want to try in order to further tune the visual +quality are: + +-preset -sns -f -m + +Namely: + +* `preset` will set up a default encoding configuration targeting a particular + type of input. It should appear first in the list of options, so that + subsequent options can take effect on top of this preset. Default value is + 'default'. +* `sns` will progressively turn on (when going from 0 to 100) some additional + visual optimizations (like: segmentation map re-enforcement). This option + will balance the bit allocation differently. It tries to take bits from the + "easy" parts of the picture and use them in the "difficult" ones instead. + Usually, raising the sns value (at fixed -q value) leads to larger files, + but with better quality. Typical value is around '75'. +* `f` option directly links to the filtering strength used by the codec's + in-loop processing. The higher the value, the smoother the highly-compressed + area will look. This is particularly useful when aiming at very small files. + Typical values are around 20-30. Note that using the option + -strong/-nostrong will change the type of filtering. Use "-f 0" to turn + filtering off. +* `m` controls the trade-off between encoding speed and quality. Default is 4. + You can try -m 5 or -m 6 to explore more (time-consuming) encoding + possibilities. A lower value will result in faster encoding at the expense + of quality. + +## Decoding tool + +There is a decoding sample in examples/dwebp.c which will take a .webp file and +decode it to a PNG image file (amongst other formats). This is simply to +demonstrate the use of the API. You can verify the file test.webp decodes to +exactly the same as test_ref.ppm by using: + +```shell +cd examples +./dwebp test.webp -ppm -o test.ppm +diff test.ppm test_ref.ppm +``` + +The full list of options is available using -h: + +```shell +> dwebp -h +Usage: dwebp in_file [options] [-o out_file] +``` + +Decodes the WebP image file to PNG format [Default]. Note: Animated WebP files +are not supported. + +Use following options to convert into alternate image formats: + +``` +-pam ......... save the raw RGBA samples as a color PAM +-ppm ......... save the raw RGB samples as a color PPM +-bmp ......... save as uncompressed BMP format +-tiff ........ save as uncompressed TIFF format +-pgm ......... save the raw YUV samples as a grayscale PGM + file with IMC4 layout +-yuv ......... save the raw YUV samples in flat layout +``` + +Other options are: + +``` +-version ..... print version number and exit +-nofancy ..... don't use the fancy YUV420 upscaler +-nofilter .... disable in-loop filtering +-nodither .... disable dithering +-dither .. dithering strength (in 0..100) +-alpha_dither use alpha-plane dithering if needed +-mt .......... use multi-threading +-crop ... crop output with the given rectangle +-resize ......... resize output (*after* any cropping) +-flip ........ flip the output vertically +-alpha ....... only save the alpha plane +-incremental . use incremental decoding (useful for tests) +-h ........... this help message +-v ........... verbose (e.g. print encoding/decoding times) +-quiet ....... quiet mode, don't print anything +-noasm ....... disable all assembly optimizations +``` + +## WebP file analysis tool + +`webpinfo` can be used to print out the chunk level structure and bitstream +header information of WebP files. It can also check if the files are of valid +WebP format. + +Usage: + +```shell +webpinfo [options] in_files +``` + +Note: there could be multiple input files; options must come before input files. + +Options: + +``` +-version ........... Print version number and exit. +-quiet ............. Do not show chunk parsing information. +-diag .............. Show parsing error diagnosis. +-summary ........... Show chunk stats summary. +-bitstream_info .... Parse bitstream header. +``` + +## Visualization tool + +There's a little self-serve visualization tool called 'vwebp' under the +examples/ directory. It uses OpenGL to open a simple drawing window and show a +decoded WebP file. It's not yet integrated in the automake build system, but you +can try to manually compile it using the recommendations below. + +Usage: + +```shell +vwebp in_file [options] +``` + +Decodes the WebP image file and visualize it using OpenGL + +Options are: + +``` +-version ..... print version number and exit +-noicc ....... don't use the icc profile if present +-nofancy ..... don't use the fancy YUV420 upscaler +-nofilter .... disable in-loop filtering +-dither dithering strength (0..100), default=50 +-noalphadither disable alpha plane dithering +-usebgcolor .. display background color +-mt .......... use multi-threading +-info ........ print info +-h ........... this help message +``` + +Keyboard shortcuts: + +``` +'c' ................ toggle use of color profile +'b' ................ toggle background color display +'i' ................ overlay file information +'d' ................ disable blending & disposal (debug) +'q' / 'Q' / ESC .... quit +``` + +### Building + +Prerequisites: + +1. OpenGL & OpenGL Utility Toolkit (GLUT) + + Linux: `sudo apt-get install freeglut3-dev mesa-common-dev` + + Mac + Xcode: These libraries should be available in the OpenGL / GLUT + frameworks. + + Windows: http://freeglut.sourceforge.net/index.php#download + +2. (Optional) qcms (Quick Color Management System) + + 1. Download qcms from Mozilla / Chromium: + https://hg.mozilla.org/mozilla-central/file/0e7639e3bdfb/gfx/qcms + https://source.chromium.org/chromium/chromium/src/+/main:third_party/qcms/;drc=d4a2f8e1ed461d8fc05ed88d1ae2dc94c9773825 + 2. Build and archive the source files as libqcms.a / qcms.lib + 3. Update makefile.unix / Makefile.vc + 1. Define WEBP_HAVE_QCMS + 2. Update include / library paths to reference the qcms directory. + +Build using makefile.unix / Makefile.vc: + +```shell +$ make -f makefile.unix examples/vwebp +> nmake /f Makefile.vc CFG=release-static \ + ../obj/x64/release-static/bin/vwebp.exe +``` + +## Animation creation tool + +The utility `img2webp` can turn a sequence of input images (PNG, JPEG, ...) into +an animated WebP file. It offers fine control over duration, encoding modes, +etc. + +Usage: + +```shell +img2webp [file_options] [[frame_options] frame_file]... +``` + +File-level options (only used at the start of compression): + +``` +-min_size ............ minimize size +-loop .......... loop count (default: 0, = infinite loop) +-kmax .......... maximum number of frame between key-frames + (0=only keyframes) +-kmin .......... minimum number of frame between key-frames + (0=disable key-frames altogether) +-mixed ............... use mixed lossy/lossless automatic mode +-v ................... verbose mode +-h ................... this help +-version ............. print version number and exit +``` + +Per-frame options (only used for subsequent images input): + +``` +-d ............. frame duration in ms (default: 100) +-lossless ........... use lossless mode (default) +-lossy ... ........... use lossy mode +-q ........... quality +-m ............. method to use +``` + +example: `img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp` + +Note: if a single file name is passed as the argument, the arguments will be +tokenized from this file. The file name must not start with the character '-'. + +## Animated GIF conversion + +Animated GIF files can be converted to WebP files with animation using the +gif2webp utility available under examples/. The files can then be viewed using +vwebp. + +Usage: + +```shell +gif2webp [options] gif_file -o webp_file +``` + +Options: + +``` +-h / -help ............. this help +-lossy ................. encode image using lossy compression +-mixed ................. for each frame in the image, pick lossy + or lossless compression heuristically +-q ............. quality factor (0:small..100:big) +-m ............... compression method (0=fast, 6=slowest) +-min_size .............. minimize output size (default:off) + lossless compression by default; can be + combined with -q, -m, -lossy or -mixed + options +-kmin ............ min distance between key frames +-kmax ............ max distance between key frames +-f ............... filter strength (0=off..100) +-metadata ..... comma separated list of metadata to + copy from the input to the output if present + Valid values: all, none, icc, xmp (default) +-loop_compatibility .... use compatibility mode for Chrome + version prior to M62 (inclusive) +-mt .................... use multi-threading if available + +-version ............... print version number and exit +-v ..................... verbose +-quiet ................. don't print anything +``` + +### Building + +With the libgif development files installed, gif2webp can be built using +makefile.unix: + +```shell +$ make -f makefile.unix examples/gif2webp +``` + +or using autoconf: + +```shell +$ ./configure --enable-everything +$ make +``` + +## Comparison of animated images + +Test utility anim_diff under examples/ can be used to compare two animated +images (each can be GIF or WebP). + +Usage: + +```shell +anim_diff [options] +``` + +Options: + +``` +-dump_frames dump decoded frames in PAM format +-min_psnr ... minimum per-frame PSNR +-raw_comparison ..... if this flag is not used, RGB is + premultiplied before comparison +-max_diff ..... maximum allowed difference per channel + between corresponding pixels in subsequent + frames +-h .................. this help +-version ............ print version number and exit +``` + +### Building + +With the libgif development files installed, anim_diff can be built using +makefile.unix: + +```shell +$ make -f makefile.unix examples/anim_diff +``` + +or using autoconf: + +```shell +$ ./configure --enable-everything +$ make +``` + +## WebP Mux tool + +The examples/ directory contains a tool (webpmux) for manipulating WebP files. +The webpmux tool can be used to create an extended format WebP file and also to +extract or strip relevant data from such a file. + +A list of options is available using the -help command line flag: + +```shell +> webpmux -help +Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT + webpmux -set SET_OPTIONS INPUT -o OUTPUT + webpmux -duration DURATION_OPTIONS [-duration ...] + INPUT -o OUTPUT + webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT + webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT] + [-bgcolor BACKGROUND_COLOR] -o OUTPUT + webpmux -info INPUT + webpmux [-h|-help] + webpmux -version + webpmux argument_file_name + +GET_OPTIONS: + Extract relevant data: + icc get ICC profile + exif get EXIF metadata + xmp get XMP metadata + frame n get nth frame + +SET_OPTIONS: + Set color profile/metadata/parameters: + loop LOOP_COUNT set the loop count + bgcolor BACKGROUND_COLOR set the animation background color + icc file.icc set ICC profile + exif file.exif set EXIF metadata + xmp file.xmp set XMP metadata + where: 'file.icc' contains the ICC profile to be set, + 'file.exif' contains the EXIF metadata to be set + 'file.xmp' contains the XMP metadata to be set + +DURATION_OPTIONS: + Set duration of selected frames: + duration set duration for all frames + duration,frame set duration of a particular frame + duration,start,end set duration of frames in the + interval [start,end]) + where: 'duration' is the duration in milliseconds + 'start' is the start frame index + 'end' is the inclusive end frame index + The special 'end' value '0' means: last frame. + +STRIP_OPTIONS: + Strip color profile/metadata: + icc strip ICC profile + exif strip EXIF metadata + xmp strip XMP metadata + +FRAME_OPTIONS(i): + Create animation: + file_i +di[+xi+yi[+mi[bi]]] + where: 'file_i' is the i'th animation frame (WebP format), + 'di' is the pause duration before next frame, + 'xi','yi' specify the image offset for this frame, + 'mi' is the dispose method for this frame (0 or 1), + 'bi' is the blending method for this frame (+b or -b) + +LOOP_COUNT: + Number of times to repeat the animation. + Valid range is 0 to 65535 [Default: 0 (infinite)]. + +BACKGROUND_COLOR: + Background color of the canvas. + A,R,G,B + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying + the Alpha, Red, Green and Blue component values respectively + [Default: 255,255,255,255] + +INPUT & OUTPUT are in WebP format. + +Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be +valid. + +Note: if a single file name is passed as the argument, the arguments will be +tokenized from this file. The file name must not start with the character '-'. +``` diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/vwebp.html b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/vwebp.html new file mode 100644 index 00000000..95085ecd --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/vwebp.html @@ -0,0 +1,282 @@ + + + + + + + + + +VWEBP + + + + +

VWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+KEYBOARD SHORTCUTS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + +

NAME + +

+ + +

vwebp - +decompress a WebP file and display it in a window

+ +

SYNOPSIS + +

+ + +

vwebp +[options] input_file.webp

+ +

DESCRIPTION + +

+ + +

This manual +page documents the vwebp command.

+ +

vwebp +decompresses a WebP file and displays it in a window using +OpenGL.

+ +

OPTIONS + +

+ + + + + + + + + +
+ + +

-h

+ + +

Print usage summary.

+
+ +

-version

+ +

Print version number and +exit.

+ + + + + + + + +
+ + +

-noicc

+ + +

Don’t use the ICC profile if present.

+
+ +

-nofancy

+ +

Don’t use the fancy +YUV420 upscaler.

+ +

-nofilter

+ +

Disable in-loop filtering.

+ +

-dither +strength

+ +

Specify a dithering +strength between 0 and 100. Dithering is a +post-processing effect applied to chroma components in lossy +compression. It helps by smoothing gradients and avoiding +banding artifacts. Default: 50.

+ +

-noalphadither

+ +

By default, quantized +transparency planes are dithered during decompression, to +smooth the gradients. This flag will prevent this +dithering.

+ +

-usebgcolor

+ +

Fill transparent areas with the +bitstream’s own background color instead of +checkerboard only. Default is white for non-animated +images.

+ + + + + + + + + + + + +
+ + +

-mt

+ + +

Use multi-threading for decoding, if possible.

+ + +

-info

+ + +

Display image information on top of the decoded +image.

+ +

-- string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’-’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "-", the data will be read from +stdin instead of a file.

+ +

KEYBOARD SHORTCUTS + +

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +

’c’

+ + +

Toggle use of color profile.

+ + +

’b’

+ + +

Toggle display of background color.

+ + +

’i’

+ + +

Overlay file information.

+ + +

’d’

+ + +

Disable blending and disposal process, for debugging +purposes.

+ +

’q’ / +’Q’ / ESC

+ +

Quit.

+ +

BUGS + +

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting-patches/

+ +

EXAMPLES + +

+ + +

vwebp +picture.webp
+vwebp picture.webp -mt -dither 0
+vwebp -- ---picture.webp

+ +

AUTHORS + +

+ + +

vwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written for the Debian project (and may be used by +others).

+ +

SEE ALSO + +

+ + + +

dwebp(1) +
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/vwebp.txt b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/vwebp.txt new file mode 100644 index 00000000..e7b15269 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/vwebp.txt @@ -0,0 +1,103 @@ +VWEBP(1) General Commands Manual VWEBP(1) + + + +NAME + vwebp - decompress a WebP file and display it in a window + +SYNOPSIS + vwebp [options] input_file.webp + +DESCRIPTION + This manual page documents the vwebp command. + + vwebp decompresses a WebP file and displays it in a window using + OpenGL. + +OPTIONS + -h Print usage summary. + + -version + Print version number and exit. + + -noicc Don't use the ICC profile if present. + + -nofancy + Don't use the fancy YUV420 upscaler. + + -nofilter + Disable in-loop filtering. + + -dither strength + Specify a dithering strength between 0 and 100. Dithering is a + post-processing effect applied to chroma components in lossy + compression. It helps by smoothing gradients and avoiding band- + ing artifacts. Default: 50. + + -noalphadither + By default, quantized transparency planes are dithered during + decompression, to smooth the gradients. This flag will prevent + this dithering. + + -usebgcolor + Fill transparent areas with the bitstream's own background color + instead of checkerboard only. Default is white for non-animated + images. + + -mt Use multi-threading for decoding, if possible. + + -info Display image information on top of the decoded image. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must ap- + pear last. Any other options afterward will be ignored. If the + input file is "-", the data will be read from stdin instead of a + file. + + + + KEYBOARD SHORTCUTS + + 'c' Toggle use of color profile. + + 'b' Toggle display of background color. + + 'i' Overlay file information. + + 'd' Disable blending and disposal process, for debugging purposes. + + 'q' / 'Q' / ESC + Quit. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + vwebp picture.webp + vwebp picture.webp -mt -dither 0 + vwebp -- ---picture.webp + + +AUTHORS + vwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written for the Debian project (and may be used by + others). + + +SEE ALSO + dwebp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 VWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpinfo.html b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpinfo.html new file mode 100644 index 00000000..1452d3b2 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpinfo.html @@ -0,0 +1,186 @@ + + + + + + + + + +WEBPINFO + + + + +

WEBPINFO

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+INPUT
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + +

NAME + +

+ + +

webpinfo - +print out the chunk level structure of WebP files along with +basic integrity checks.

+ +

SYNOPSIS + +

+ + + +

webpinfo +OPTIONS INPUT
+webpinfo [-h|-help|-H|-longhelp]

+ +

DESCRIPTION + +

+ + +

This manual +page documents the webpinfo command.

+ + +

webpinfo +can be used to print out the chunk level structure and +bitstream header information of WebP files. It can also +check if the files are of valid WebP format.

+ +

OPTIONS + +

+ + + +

-version

+ +

Print the version number (as +major.minor.revision) and exit.

+ + + + + + + + + + + + + + +
+ + +

-quiet

+ + +

Do not show chunk parsing information.

+
+ + +

-diag

+ + +

Show parsing error diagnosis.

+
+ +

-summary

+ +

Show chunk stats summary.

+ +

-bitstream_info

+ +

Parse bitstream header.

+ +

-h, -help

+ +

A short usage summary.

+ +

-H, -longhelp

+ +

Detailed usage +instructions.

+ +

INPUT + +

+ + +

Input files in +WebP format. Input files must come last, following options +(if any). There can be multiple input files.

+ +

BUGS + +

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting-patches/

+ +

EXAMPLES + +

+ + +

webpinfo -h +
+webpinfo -diag -summary input_file.webp
+webpinfo -bitstream_info input_file_1.webp input_file_2.webp +
+webpinfo *.webp

+ +

AUTHORS + +

+ + + +

webpinfo +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Hui Su <huisu@google.com>, for the +Debian project (and may be used by others).

+ +

SEE ALSO + +

+ + + +

webpmux(1) +
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpinfo.txt b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpinfo.txt new file mode 100644 index 00000000..47c94c6b --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpinfo.txt @@ -0,0 +1,78 @@ +WEBPINFO(1) General Commands Manual WEBPINFO(1) + + + +NAME + webpinfo - print out the chunk level structure of WebP files along with + basic integrity checks. + +SYNOPSIS + webpinfo OPTIONS INPUT + webpinfo [-h|-help|-H|-longhelp] + + +DESCRIPTION + This manual page documents the webpinfo command. + + webpinfo can be used to print out the chunk level structure and bit- + stream header information of WebP files. It can also check if the files + are of valid WebP format. + + +OPTIONS + -version + Print the version number (as major.minor.revision) and exit. + + -quiet Do not show chunk parsing information. + + -diag Show parsing error diagnosis. + + -summary + Show chunk stats summary. + + -bitstream_info + Parse bitstream header. + + -h, -help + A short usage summary. + + -H, -longhelp + Detailed usage instructions. + + +INPUT + Input files in WebP format. Input files must come last, following op- + tions (if any). There can be multiple input files. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + webpinfo -h + webpinfo -diag -summary input_file.webp + webpinfo -bitstream_info input_file_1.webp input_file_2.webp + webpinfo *.webp + + +AUTHORS + webpinfo is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Hui Su , for the De- + bian project (and may be used by others). + + +SEE ALSO + webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 WEBPINFO(1) diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpmux.html b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpmux.html new file mode 100644 index 00000000..885e08a1 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpmux.html @@ -0,0 +1,434 @@ + + + + + + + + + +WEBPMUX + + + + +

WEBPMUX

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + +

NAME + +

+ + +

webpmux - +create animated WebP files from non-animated WebP images, +extract frames from animated WebP images, and manage +XMP/EXIF metadata and ICC profile.

+ +

SYNOPSIS + +

+ + +

webpmux +-get GET_OPTIONS INPUT -o OUTPUT +
+webpmux -set
SET_OPTIONS INPUT -o +OUTPUT
+webpmux -strip
STRIP_OPTIONS INPUT -o +OUTPUT
+webpmux -frame
FRAME_OPTIONS [ -frame ... ] [ +-loop LOOP_COUNT ]

+ +

[ -bgcolor +BACKGROUND_COLOR ] -o OUTPUT

+ +

webpmux -duration +DURATION OPTIONS [ -duration ... ] +INPUT -o OUTPUT
+webpmux -info
INPUT
+webpmux [-h|-help]
+webpmux -version
+webpmux argument_file_name

+ +

DESCRIPTION + +

+ + +

This manual +page documents the webpmux command.

+ +

webpmux +can be used to create/extract from animated WebP files, as +well as to add/extract/strip XMP/EXIF metadata and ICC +profile. If a single file name (not starting with the +character ’-’) is supplied as the argument, the +command line arguments are actually tokenized from this +file. This allows for easy scripting or using a large number +of arguments.

+ +

OPTIONS + +

+ + +

GET_OPTIONS +(-get):

+ + + + + + + + + + + + + + + + + + + + +
+ + +

icc

+ + +

Get ICC profile.

+
+ + +

exif

+ + +

Get EXIF metadata.

+
+ + +

xmp

+ + +

Get XMP metadata.

+
+ +

frame n

+ +

Get nth frame from an animated +image. (n = 0 has a special meaning: last frame).

+ +

SET_OPTIONS +(-set)
+loop
loop_count

+ +

Set loop count on an animated +file.

+ +

Where: +’loop_count’ must be in range [0, 65535]. +
+bgcolor
A,R,G,B

+ +

Set the background color of the +canvas on an animated file.

+ +

where: +’A’, ’R’, ’G’ and +’B’ are integers in the range 0 to 255 +specifying the Alpha, Red, Green and Blue component values +respectively.
+icc
file.icc

+ +

Set ICC profile.

+ +

Where: +’file.icc’ contains the ICC profile to be set. +
+exif
file.exif

+ +

Set EXIF metadata.

+ +

Where: +’file.exif’ contains the EXIF metadata to be +set.
+xmp
file.xmp

+ +

Set XMP metadata.

+ +

Where: +’file.xmp’ contains the XMP metadata to be +set.

+ + +

STRIP_OPTIONS +(-strip)

+ + + + + + + + + + + + + + + + + + + + +
+ + +

icc

+ + +

Strip ICC profile.

+
+ + +

exif

+ + +

Strip EXIF metadata.

+
+ + +

xmp

+ + +

Strip XMP metadata.

+
+ + +

DURATION_OPTIONS +(-duration)
+Amend the duration of a specific interval of frames. This +option is only effective on animated WebP and has no effect +on a single-frame file.
+duration[,start[,end]]

+ +

Where:
+duration
is the duration for the interval in +milliseconds (mandatory). Must be non-negative.
+start
is the starting frame index of the interval +(optional).
+end
is the ending frame index (inclusive) of the +interval (optional).

+ +

The three typical usages of +this option are:

+ +

-duration d
+set the duration to ’d’ for the whole animation. +
+-duration d,f

+set the duration of frame ’f’ to +’d’.
+-duration d,start,end

+set the duration to ’d’ for the whole +[start,end] interval.

+ +

Note that the +frames outside of the [start, end] interval will
+remain untouched.
+The ’end’ value ’0’ has the special +meaning ’last frame of the animation’.

+ +

Reminder:

+ +

frame indexing starts at +’1’.

+ + +

FRAME_OPTIONS +(-frame)
+Create an animated WebP file from multiple (non-animated) +WebP images.
+file_i +di[+xi+yi[+mi[bi]]]

+ +

Where: ’file_i’ is +the i’th frame (WebP format), +’xi’,’yi’ specify the image offset +for this frame, ’di’ is the pause duration +before next frame, ’mi’ is the dispose method +for this frame (0 for NONE or 1 for BACKGROUND) and +’bi’ is the blending method for this frame (+b +for BLEND or -b for NO_BLEND). Argument ’bi’ can +be omitted and will default to +b (BLEND). Also, +’mi’ can be omitted if ’bi’ is +omitted and will default to 0 (NONE). Finally, if +’mi’ and ’bi’ are omitted then +’xi’ and ’yi’ can be omitted and +will default to +0+0.

+ +

-loop n

+ +

Loop the frames n number of +times. 0 indicates the frames should loop forever. Valid +range is 0 to 65535 [Default: 0 (infinite)].

+ +

-bgcolor +A,R,G,B

+ +

Background color of the canvas. +
+where: ’A’, ’R’, ’G’ and +’B’ are integers in the range 0 to 255 +specifying the Alpha, Red, Green and Blue component values +respectively [Default: 255,255,255,255].

+ +

INPUT +
+Input file in WebP format.

+ +

OUTPUT +(-o)
+Output file in WebP format.

+ +

Note: +
+The nature of EXIF, XMP and ICC data is not checked and is +assumed to
+be valid.

+ +

BUGS + +

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting-patches/

+ +

EXAMPLES + +

+ + +

Add ICC +profile:
+webpmux -set icc image_profile.icc in.webp -o +icc_container.webp

+ +

Extract ICC +profile:
+webpmux -get icc icc_container.webp -o image_profile.icc

+ +

Strip ICC +profile:
+webpmux -strip icc icc_container.webp -o +without_icc.webp

+ +

Add XMP +metadata:
+webpmux -set xmp image_metadata.xmp in.webp -o +xmp_container.webp

+ +

Extract XMP +metadata:
+webpmux -get xmp xmp_container.webp -o +image_metadata.xmp

+ +

Strip XMP +metadata:
+webpmux -strip xmp xmp_container.webp -o +without_xmp.webp

+ +

Add EXIF +metadata:
+webpmux -set exif image_metadata.exif in.webp -o +exif_container.webp

+ +

Extract EXIF +metadata:
+webpmux -get exif exif_container.webp -o +image_metadata.exif

+ +

Strip EXIF +metadata:
+webpmux -strip exif exif_container.webp -o +without_exif.webp

+ +

Create an +animated WebP file from 3 (non-animated) WebP images:
+webpmux -frame 1.webp +100 -frame 2.webp +100+50+50

+ +

-frame 3.webp +100+50+50+1+b +-loop 10 -bgcolor 255,255,255,255
+-o anim_container.webp

+ +

Get the 2nd +frame from an animated WebP file:
+webpmux -get frame 2 anim_container.webp -o frame_2.webp

+ +

Using +-get/-set/-strip with input file name starting with +’-’:
+webpmux -set icc image_profile.icc -o icc_container.webp -- +---in.webp
+webpmux -get icc -o image_profile.icc -- +---icc_container.webp
+webpmux -strip icc -o without_icc.webp -- +---icc_container.webp

+ +

AUTHORS + +

+ + +

webpmux +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Vikas Arora +<vikaas.arora@gmail.com>, for the Debian project (and +may be used by others).

+ +

SEE ALSO + +

+ + + +

cwebp(1), +dwebp(1), gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpmux.txt b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpmux.txt new file mode 100644 index 00000000..3a7a287e --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/doc/webpmux.txt @@ -0,0 +1,216 @@ +WEBPMUX(1) General Commands Manual WEBPMUX(1) + + + +NAME + webpmux - create animated WebP files from non-animated WebP images, ex- + tract frames from animated WebP images, and manage XMP/EXIF metadata + and ICC profile. + +SYNOPSIS + webpmux -get GET_OPTIONS INPUT -o OUTPUT + webpmux -set SET_OPTIONS INPUT -o OUTPUT + webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT + webpmux -frame FRAME_OPTIONS [ -frame ... ] [ -loop LOOP_COUNT ] + [ -bgcolor BACKGROUND_COLOR ] -o OUTPUT + webpmux -duration DURATION OPTIONS [ -duration ... ] INPUT -o OUTPUT + webpmux -info INPUT + webpmux [-h|-help] + webpmux -version + webpmux argument_file_name + +DESCRIPTION + This manual page documents the webpmux command. + + webpmux can be used to create/extract from animated WebP files, as well + as to add/extract/strip XMP/EXIF metadata and ICC profile. If a single + file name (not starting with the character '-') is supplied as the ar- + gument, the command line arguments are actually tokenized from this + file. This allows for easy scripting or using a large number of argu- + ments. + +OPTIONS + GET_OPTIONS (-get): + icc Get ICC profile. + + exif Get EXIF metadata. + + xmp Get XMP metadata. + + frame n + Get nth frame from an animated image. (n = 0 has a special mean- + ing: last frame). + + + SET_OPTIONS (-set) + loop loop_count + Set loop count on an animated file. + + Where: 'loop_count' must be in range [0, 65535]. + + bgcolor A,R,G,B + Set the background color of the canvas on an animated file. + + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 speci- + fying the Alpha, Red, Green and Blue component values respectively. + + icc file.icc + Set ICC profile. + + Where: 'file.icc' contains the ICC profile to be set. + + exif file.exif + Set EXIF metadata. + + Where: 'file.exif' contains the EXIF metadata to be set. + + xmp file.xmp + Set XMP metadata. + + Where: 'file.xmp' contains the XMP metadata to be set. + + + STRIP_OPTIONS (-strip) + icc Strip ICC profile. + + exif Strip EXIF metadata. + + xmp Strip XMP metadata. + + + DURATION_OPTIONS (-duration) + Amend the duration of a specific interval of frames. This option is + only effective on animated WebP and has no effect on a single-frame + file. + + duration[,start[,end]] + Where: + duration is the duration for the interval in milliseconds + (mandatory). Must be non-negative. + start is the starting frame index of the interval (optional). + end is the ending frame index (inclusive) of the interval (op- + tional). + + The three typical usages of this option are: + -duration d + set the duration to 'd' for the whole animation. + -duration d,f + set the duration of frame 'f' to 'd'. + -duration d,start,end + set the duration to 'd' for the whole [start,end] interval. + + + Note that the frames outside of the [start, end] interval will + remain untouched. + The 'end' value '0' has the special meaning 'last frame of the + animation'. + + Reminder: + frame indexing starts at '1'. + + + FRAME_OPTIONS (-frame) + Create an animated WebP file from multiple (non-animated) WebP images. + + file_i +di[+xi+yi[+mi[bi]]] + Where: 'file_i' is the i'th frame (WebP format), 'xi','yi' spec- + ify the image offset for this frame, 'di' is the pause duration + before next frame, 'mi' is the dispose method for this frame (0 + for NONE or 1 for BACKGROUND) and 'bi' is the blending method + for this frame (+b for BLEND or -b for NO_BLEND). Argument 'bi' + can be omitted and will default to +b (BLEND). Also, 'mi' can + be omitted if 'bi' is omitted and will default to 0 (NONE). Fi- + nally, if 'mi' and 'bi' are omitted then 'xi' and 'yi' can be + omitted and will default to +0+0. + + -loop n + Loop the frames n number of times. 0 indicates the frames should + loop forever. Valid range is 0 to 65535 [Default: 0 (infi- + nite)]. + + -bgcolor A,R,G,B + Background color of the canvas. + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 + specifying the Alpha, Red, Green and Blue component values re- + spectively [Default: 255,255,255,255]. + + + INPUT + Input file in WebP format. + + + OUTPUT (-o) + Output file in WebP format. + + + Note: + The nature of EXIF, XMP and ICC data is not checked and is assumed to + be valid. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + Add ICC profile: + webpmux -set icc image_profile.icc in.webp -o icc_container.webp + + Extract ICC profile: + webpmux -get icc icc_container.webp -o image_profile.icc + + Strip ICC profile: + webpmux -strip icc icc_container.webp -o without_icc.webp + + Add XMP metadata: + webpmux -set xmp image_metadata.xmp in.webp -o xmp_container.webp + + Extract XMP metadata: + webpmux -get xmp xmp_container.webp -o image_metadata.xmp + + Strip XMP metadata: + webpmux -strip xmp xmp_container.webp -o without_xmp.webp + + Add EXIF metadata: + webpmux -set exif image_metadata.exif in.webp -o exif_container.webp + + Extract EXIF metadata: + webpmux -get exif exif_container.webp -o image_metadata.exif + + Strip EXIF metadata: + webpmux -strip exif exif_container.webp -o without_exif.webp + + Create an animated WebP file from 3 (non-animated) WebP images: + webpmux -frame 1.webp +100 -frame 2.webp +100+50+50 + -frame 3.webp +100+50+50+1+b -loop 10 -bgcolor 255,255,255,255 + -o anim_container.webp + + Get the 2nd frame from an animated WebP file: + webpmux -get frame 2 anim_container.webp -o frame_2.webp + + Using -get/-set/-strip with input file name starting with '-': + webpmux -set icc image_profile.icc -o icc_container.webp -- ---in.webp + webpmux -get icc -o image_profile.icc -- ---icc_container.webp + webpmux -strip icc -o without_icc.webp -- ---icc_container.webp + + +AUTHORS + webpmux is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Vikas Arora , + for the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), dwebp(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 WEBPMUX(1) diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/decode.h b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/decode.h new file mode 100644 index 00000000..d9824750 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/decode.h @@ -0,0 +1,503 @@ +// Copyright 2010 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Main decoding functions for WebP images. +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_DECODE_H_ +#define WEBP_WEBP_DECODE_H_ + +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_DECODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum VP8StatusCode VP8StatusCode; +// typedef enum WEBP_CSP_MODE WEBP_CSP_MODE; +typedef struct WebPRGBABuffer WebPRGBABuffer; +typedef struct WebPYUVABuffer WebPYUVABuffer; +typedef struct WebPDecBuffer WebPDecBuffer; +typedef struct WebPIDecoder WebPIDecoder; +typedef struct WebPBitstreamFeatures WebPBitstreamFeatures; +typedef struct WebPDecoderOptions WebPDecoderOptions; +typedef struct WebPDecoderConfig WebPDecoderConfig; + +// Return the decoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetDecoderVersion(void); + +// Retrieve basic header information: width, height. +// This function will also validate the header, returning true on success, +// false otherwise. '*width' and '*height' are only valid on successful return. +// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. +WEBP_EXTERN int WebPGetInfo(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Decodes WebP images pointed to by 'data' and returns RGBA samples, along +// with the dimensions in *width and *height. The ordering of samples in +// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). +// The returned pointer should be deleted calling WebPFree(). +// Returns NULL in case of error. +WEBP_EXTERN uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. +// If the bitstream contains transparency, it is ignored. +WEBP_EXTERN uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, + int* width, int* height); + + +// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer +// returned is the Y samples buffer. Upon return, *u and *v will point to +// the U and V chroma data. These U and V buffers need NOT be passed to +// WebPFree(), unlike the returned Y luma one. The dimension of the U and V +// planes are both (*width + 1) / 2 and (*height + 1)/ 2. +// Upon return, the Y buffer has a stride returned as '*stride', while U and V +// have a common stride returned as '*uv_stride'. +// Return NULL in case of error. +// (*) Also named Y'CbCr. See: https://en.wikipedia.org/wiki/YCbCr +WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, + int* width, int* height, + uint8_t** u, uint8_t** v, + int* stride, int* uv_stride); + +// These five functions are variants of the above ones, that decode the image +// directly into a pre-allocated buffer 'output_buffer'. The maximum storage +// available in this buffer is indicated by 'output_buffer_size'. If this +// storage is not sufficient (or an error occurred), NULL is returned. +// Otherwise, output_buffer is returned, for convenience. +// The parameter 'output_stride' specifies the distance (in bytes) +// between scanlines. Hence, output_buffer_size is expected to be at least +// output_stride x picture-height. +WEBP_EXTERN uint8_t* WebPDecodeRGBAInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeARGBInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeBGRAInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// RGB and BGR variants. Here too the transparency information, if present, +// will be dropped and ignored. +WEBP_EXTERN uint8_t* WebPDecodeRGBInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeBGRInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly +// into pre-allocated luma/chroma plane buffers. This function requires the +// strides to be passed: one for the luma plane and one for each of the +// chroma ones. The size of each plane buffer is passed as 'luma_size', +// 'u_size' and 'v_size' respectively. +// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred +// during decoding (or because some buffers were found to be too small). +WEBP_EXTERN uint8_t* WebPDecodeYUVInto( + const uint8_t* data, size_t data_size, + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride); + +//------------------------------------------------------------------------------ +// Output colorspaces and buffer + +// Colorspaces +// Note: the naming describes the byte-ordering of packed samples in memory. +// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,... +// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels. +// RGBA-4444 and RGB-565 colorspaces are represented by following byte-order: +// RGBA-4444: [r3 r2 r1 r0 g3 g2 g1 g0], [b3 b2 b1 b0 a3 a2 a1 a0], ... +// RGB-565: [r4 r3 r2 r1 r0 g5 g4 g3], [g2 g1 g0 b4 b3 b2 b1 b0], ... +// In the case WEBP_SWAP_16BITS_CSP is defined, the bytes are swapped for +// these two modes: +// RGBA-4444: [b3 b2 b1 b0 a3 a2 a1 a0], [r3 r2 r1 r0 g3 g2 g1 g0], ... +// RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ... + +typedef enum WEBP_CSP_MODE { + MODE_RGB = 0, MODE_RGBA = 1, + MODE_BGR = 2, MODE_BGRA = 3, + MODE_ARGB = 4, MODE_RGBA_4444 = 5, + MODE_RGB_565 = 6, + // RGB-premultiplied transparent modes (alpha value is preserved) + MODE_rgbA = 7, + MODE_bgrA = 8, + MODE_Argb = 9, + MODE_rgbA_4444 = 10, + // YUV modes must come after RGB ones. + MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 + MODE_LAST = 13 +} WEBP_CSP_MODE; + +// Some useful macros: +static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) { + return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb || + mode == MODE_rgbA_4444); +} + +static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) { + return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB || + mode == MODE_RGBA_4444 || mode == MODE_YUVA || + WebPIsPremultipliedMode(mode)); +} + +static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { + return (mode < MODE_YUV); +} + +//------------------------------------------------------------------------------ +// WebPDecBuffer: Generic structure for describing the output sample buffer. + +struct WebPRGBABuffer { // view as RGBA + uint8_t* rgba; // pointer to RGBA samples + int stride; // stride in bytes from one scanline to the next. + size_t size; // total size of the *rgba buffer. +}; + +struct WebPYUVABuffer { // view as YUVA + uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples + int y_stride; // luma stride + int u_stride, v_stride; // chroma strides + int a_stride; // alpha stride + size_t y_size; // luma plane size + size_t u_size, v_size; // chroma planes size + size_t a_size; // alpha-plane size +}; + +// Output buffer +struct WebPDecBuffer { + WEBP_CSP_MODE colorspace; // Colorspace. + int width, height; // Dimensions. + int is_external_memory; // If non-zero, 'internal_memory' pointer is not + // used. If value is '2' or more, the external + // memory is considered 'slow' and multiple + // read/write will be avoided. + union { + WebPRGBABuffer RGBA; + WebPYUVABuffer YUVA; + } u; // Nameless union of buffer parameters. + uint32_t pad[4]; // padding for later use + + uint8_t* private_memory; // Internally allocated memory (only when + // is_external_memory is 0). Should not be used + // externally, but accessed via the buffer union. +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPInitDecBufferInternal(WebPDecBuffer*, int); + +// Initialize the structure as empty. Must be called before any other use. +// Returns false in case of version mismatch +static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) { + return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); +} + +// Free any memory associated with the buffer. Must always be called last. +// Note: doesn't free the 'buffer' structure itself. +WEBP_EXTERN void WebPFreeDecBuffer(WebPDecBuffer* buffer); + +//------------------------------------------------------------------------------ +// Enumeration of the status codes + +typedef enum VP8StatusCode { + VP8_STATUS_OK = 0, + VP8_STATUS_OUT_OF_MEMORY, + VP8_STATUS_INVALID_PARAM, + VP8_STATUS_BITSTREAM_ERROR, + VP8_STATUS_UNSUPPORTED_FEATURE, + VP8_STATUS_SUSPENDED, + VP8_STATUS_USER_ABORT, + VP8_STATUS_NOT_ENOUGH_DATA +} VP8StatusCode; + +//------------------------------------------------------------------------------ +// Incremental decoding +// +// This API allows streamlined decoding of partial data. +// Picture can be incrementally decoded as data become available thanks to the +// WebPIDecoder object. This object can be left in a SUSPENDED state if the +// picture is only partially decoded, pending additional input. +// Code example: +// +// WebPInitDecBuffer(&output_buffer); +// output_buffer.colorspace = mode; +// ... +// WebPIDecoder* idec = WebPINewDecoder(&output_buffer); +// while (additional_data_is_available) { +// // ... (get additional data in some new_data[] buffer) +// status = WebPIAppend(idec, new_data, new_data_size); +// if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) { +// break; // an error occurred. +// } +// +// // The above call decodes the current available buffer. +// // Part of the image can now be refreshed by calling +// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. +// } +// WebPIDelete(idec); + +// Creates a new incremental decoder with the supplied buffer parameter. +// This output_buffer can be passed NULL, in which case a default output buffer +// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' +// is kept, which means that the lifespan of 'output_buffer' must be larger than +// that of the returned WebPIDecoder object. +// The supplied 'output_buffer' content MUST NOT be changed between calls to +// WebPIAppend() or WebPIUpdate() unless 'output_buffer.is_external_memory' is +// not set to 0. In such a case, it is allowed to modify the pointers, size and +// stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain +// within valid bounds. +// All other fields of WebPDecBuffer MUST remain constant between calls. +// Returns NULL if the allocation failed. +WEBP_EXTERN WebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer); + +// This function allocates and initializes an incremental-decoder object, which +// will output the RGB/A samples specified by 'csp' into a preallocated +// buffer 'output_buffer'. The size of this buffer is at least +// 'output_buffer_size' and the stride (distance in bytes between two scanlines) +// is specified by 'output_stride'. +// Additionally, output_buffer can be passed NULL in which case the output +// buffer will be allocated automatically when the decoding starts. The +// colorspace 'csp' is taken into account for allocating this buffer. All other +// parameters are ignored. +// Returns NULL if the allocation failed, or if some parameters are invalid. +WEBP_EXTERN WebPIDecoder* WebPINewRGB( + WEBP_CSP_MODE csp, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// This function allocates and initializes an incremental-decoder object, which +// will output the raw luma/chroma samples into a preallocated planes if +// supplied. The luma plane is specified by its pointer 'luma', its size +// 'luma_size' and its stride 'luma_stride'. Similarly, the chroma-u plane +// is specified by the 'u', 'u_size' and 'u_stride' parameters, and the chroma-v +// plane by 'v' and 'v_size'. And same for the alpha-plane. The 'a' pointer +// can be pass NULL in case one is not interested in the transparency plane. +// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied. +// In this case, the output buffer will be automatically allocated (using +// MODE_YUVA) when decoding starts. All parameters are then ignored. +// Returns NULL if the allocation failed or if a parameter is invalid. +WEBP_EXTERN WebPIDecoder* WebPINewYUVA( + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride, + uint8_t* a, size_t a_size, int a_stride); + +// Deprecated version of the above, without the alpha plane. +// Kept for backward compatibility. +WEBP_EXTERN WebPIDecoder* WebPINewYUV( + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride); + +// Deletes the WebPIDecoder object and associated memory. Must always be called +// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. +WEBP_EXTERN void WebPIDelete(WebPIDecoder* idec); + +// Copies and decodes the next available data. Returns VP8_STATUS_OK when +// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more +// data is expected. Returns error in other cases. +WEBP_EXTERN VP8StatusCode WebPIAppend( + WebPIDecoder* idec, const uint8_t* data, size_t data_size); + +// A variant of the above function to be used when data buffer contains +// partial data from the beginning. In this case data buffer is not copied +// to the internal memory. +// Note that the value of the 'data' pointer can change between calls to +// WebPIUpdate, for instance when the data buffer is resized to fit larger data. +WEBP_EXTERN VP8StatusCode WebPIUpdate( + WebPIDecoder* idec, const uint8_t* data, size_t data_size); + +// Returns the RGB/A image decoded so far. Returns NULL if output params +// are not initialized yet. The RGB/A output type corresponds to the colorspace +// specified during call to WebPINewDecoder() or WebPINewRGB(). +// *last_y is the index of last decoded row in raster scan order. Some pointers +// (*last_y, *width etc.) can be NULL if corresponding information is not +// needed. The values in these pointers are only valid on successful (non-NULL) +// return. +WEBP_EXTERN uint8_t* WebPIDecGetRGB( + const WebPIDecoder* idec, int* last_y, + int* width, int* height, int* stride); + +// Same as above function to get a YUVA image. Returns pointer to the luma +// plane or NULL in case of error. If there is no alpha information +// the alpha pointer '*a' will be returned NULL. +WEBP_EXTERN uint8_t* WebPIDecGetYUVA( + const WebPIDecoder* idec, int* last_y, + uint8_t** u, uint8_t** v, uint8_t** a, + int* width, int* height, int* stride, int* uv_stride, int* a_stride); + +// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the +// alpha information (if present). Kept for backward compatibility. +static WEBP_INLINE uint8_t* WebPIDecGetYUV( + const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, + int* width, int* height, int* stride, int* uv_stride) { + return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, + stride, uv_stride, NULL); +} + +// Generic call to retrieve information about the displayable area. +// If non NULL, the left/right/width/height pointers are filled with the visible +// rectangular area so far. +// Returns NULL in case the incremental decoder object is in an invalid state. +// Otherwise returns the pointer to the internal representation. This structure +// is read-only, tied to WebPIDecoder's lifespan and should not be modified. +WEBP_EXTERN const WebPDecBuffer* WebPIDecodedArea( + const WebPIDecoder* idec, int* left, int* top, int* width, int* height); + +//------------------------------------------------------------------------------ +// Advanced decoding parametrization +// +// Code sample for using the advanced decoding API +/* + // A) Init a configuration object + WebPDecoderConfig config; + CHECK(WebPInitDecoderConfig(&config)); + + // B) optional: retrieve the bitstream's features. + CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + + // C) Adjust 'config', if needed + config.no_fancy_upsampling = 1; + config.output.colorspace = MODE_BGRA; + // etc. + + // Note that you can also make config.output point to an externally + // supplied memory buffer, provided it's big enough to store the decoded + // picture. Otherwise, config.output will just be used to allocate memory + // and store the decoded picture. + + // D) Decode! + CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + + // E) Decoded image is now in config.output (and config.output.u.RGBA) + + // F) Reclaim memory allocated in config's object. It's safe to call + // this function even if the memory is external and wasn't allocated + // by WebPDecode(). + WebPFreeDecBuffer(&config.output); +*/ + +// Features gathered from the bitstream +struct WebPBitstreamFeatures { + int width; // Width in pixels, as read from the bitstream. + int height; // Height in pixels, as read from the bitstream. + int has_alpha; // True if the bitstream contains an alpha channel. + int has_animation; // True if the bitstream is an animation. + int format; // 0 = undefined (/mixed), 1 = lossy, 2 = lossless + + uint32_t pad[5]; // padding for later use +}; + +// Internal, version-checked, entry point +WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal( + const uint8_t*, size_t, WebPBitstreamFeatures*, int); + +// Retrieve features from the bitstream. The *features structure is filled +// with information gathered from the bitstream. +// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns +// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the +// features from headers. Returns error in other cases. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. +static WEBP_INLINE VP8StatusCode WebPGetFeatures( + const uint8_t* data, size_t data_size, + WebPBitstreamFeatures* features) { + return WebPGetFeaturesInternal(data, data_size, features, + WEBP_DECODER_ABI_VERSION); +} + +// Decoding options +struct WebPDecoderOptions { + int bypass_filtering; // if true, skip the in-loop filtering + int no_fancy_upsampling; // if true, use faster pointwise upsampler + int use_cropping; // if true, cropping is applied _first_ + int crop_left, crop_top; // top-left position for cropping. + // Will be snapped to even values. + int crop_width, crop_height; // dimension of the cropping area + int use_scaling; // if true, scaling is applied _afterward_ + int scaled_width, scaled_height; // final resolution + int use_threads; // if true, use multi-threaded decoding + int dithering_strength; // dithering strength (0=Off, 100=full) + int flip; // if true, flip output vertically + int alpha_dithering_strength; // alpha dithering strength in [0..100] + + uint32_t pad[5]; // padding for later use +}; + +// Main object storing the configuration for advanced decoding. +struct WebPDecoderConfig { + WebPBitstreamFeatures input; // Immutable bitstream features (optional) + WebPDecBuffer output; // Output buffer (can point to external mem) + WebPDecoderOptions options; // Decoding options +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPInitDecoderConfigInternal(WebPDecoderConfig*, int); + +// Initialize the configuration as empty. This function must always be +// called first, unless WebPGetFeatures() is to be called. +// Returns false in case of mismatched version. +static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { + return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); +} + +// Instantiate a new incremental decoder object with the requested +// configuration. The bitstream can be passed using 'data' and 'data_size' +// parameter, in which case the features will be parsed and stored into +// config->input. Otherwise, 'data' can be NULL and no parsing will occur. +// Note that 'config' can be NULL too, in which case a default configuration +// is used. If 'config' is not NULL, it must outlive the WebPIDecoder object +// as some references to its fields will be used. No internal copy of 'config' +// is made. +// The return WebPIDecoder object must always be deleted calling WebPIDelete(). +// Returns NULL in case of error (and config->status will then reflect +// the error condition, if available). +WEBP_EXTERN WebPIDecoder* WebPIDecode(const uint8_t* data, size_t data_size, + WebPDecoderConfig* config); + +// Non-incremental version. This version decodes the full data at once, taking +// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK +// if the decoding was successful). Note that 'config' cannot be NULL. +WEBP_EXTERN VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size, + WebPDecoderConfig* config); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_DECODE_H_ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/demux.h b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/demux.h new file mode 100644 index 00000000..846eeb15 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/demux.h @@ -0,0 +1,363 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Demux API. +// Enables extraction of image and extended format data from WebP files. + +// Code Example: Demuxing WebP data to extract all the frames, ICC profile +// and EXIF/XMP metadata. +/* + WebPDemuxer* demux = WebPDemux(&webp_data); + + uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); + uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); + // ... (Get information about the features present in the WebP file). + uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); + + // ... (Iterate over all frames). + WebPIterator iter; + if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), + // ... and get other frame properties like width, height, offsets etc. + // ... see 'struct WebPIterator' below for more info). + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); + } + + // ... (Extract metadata). + WebPChunkIterator chunk_iter; + if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); + // ... (Consume the ICC profile in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); + // ... (Consume the EXIF metadata in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); + // ... (Consume the XMP metadata in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + WebPDemuxDelete(demux); +*/ + +#ifndef WEBP_WEBP_DEMUX_H_ +#define WEBP_WEBP_DEMUX_H_ + +#include "./decode.h" // for WEBP_CSP_MODE +#include "./mux_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_DEMUX_ABI_VERSION 0x0107 // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPDemuxState WebPDemuxState; +// typedef enum WebPFormatFeature WebPFormatFeature; +typedef struct WebPDemuxer WebPDemuxer; +typedef struct WebPIterator WebPIterator; +typedef struct WebPChunkIterator WebPChunkIterator; +typedef struct WebPAnimInfo WebPAnimInfo; +typedef struct WebPAnimDecoderOptions WebPAnimDecoderOptions; + +//------------------------------------------------------------------------------ + +// Returns the version number of the demux library, packed in hexadecimal using +// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetDemuxVersion(void); + +//------------------------------------------------------------------------------ +// Life of a Demux object + +typedef enum WebPDemuxState { + WEBP_DEMUX_PARSE_ERROR = -1, // An error occurred while parsing. + WEBP_DEMUX_PARSING_HEADER = 0, // Not enough data to parse full header. + WEBP_DEMUX_PARSED_HEADER = 1, // Header parsing complete, + // data may be available. + WEBP_DEMUX_DONE = 2 // Entire file has been parsed. +} WebPDemuxState; + +// Internal, version-checked, entry point +WEBP_EXTERN WebPDemuxer* WebPDemuxInternal( + const WebPData*, int, WebPDemuxState*, int); + +// Parses the full WebP file given by 'data'. For single images the WebP file +// header alone or the file header and the chunk header may be absent. +// Returns a WebPDemuxer object on successful parse, NULL otherwise. +static WEBP_INLINE WebPDemuxer* WebPDemux(const WebPData* data) { + return WebPDemuxInternal(data, 0, NULL, WEBP_DEMUX_ABI_VERSION); +} + +// Parses the possibly incomplete WebP file given by 'data'. +// If 'state' is non-NULL it will be set to indicate the status of the demuxer. +// Returns NULL in case of error or if there isn't enough data to start parsing; +// and a WebPDemuxer object on successful parse. +// Note that WebPDemuxer keeps internal pointers to 'data' memory segment. +// If this data is volatile, the demuxer object should be deleted (by calling +// WebPDemuxDelete()) and WebPDemuxPartial() called again on the new data. +// This is usually an inexpensive operation. +static WEBP_INLINE WebPDemuxer* WebPDemuxPartial( + const WebPData* data, WebPDemuxState* state) { + return WebPDemuxInternal(data, 1, state, WEBP_DEMUX_ABI_VERSION); +} + +// Frees memory associated with 'dmux'. +WEBP_EXTERN void WebPDemuxDelete(WebPDemuxer* dmux); + +//------------------------------------------------------------------------------ +// Data/information extraction. + +typedef enum WebPFormatFeature { + WEBP_FF_FORMAT_FLAGS, // bit-wise combination of WebPFeatureFlags + // corresponding to the 'VP8X' chunk (if present). + WEBP_FF_CANVAS_WIDTH, + WEBP_FF_CANVAS_HEIGHT, + WEBP_FF_LOOP_COUNT, // only relevant for animated file + WEBP_FF_BACKGROUND_COLOR, // idem. + WEBP_FF_FRAME_COUNT // Number of frames present in the demux object. + // In case of a partial demux, this is the number + // of frames seen so far, with the last frame + // possibly being partial. +} WebPFormatFeature; + +// Get the 'feature' value from the 'dmux'. +// NOTE: values are only valid if WebPDemux() was used or WebPDemuxPartial() +// returned a state > WEBP_DEMUX_PARSING_HEADER. +// If 'feature' is WEBP_FF_FORMAT_FLAGS, the returned value is a bit-wise +// combination of WebPFeatureFlags values. +// If 'feature' is WEBP_FF_LOOP_COUNT, WEBP_FF_BACKGROUND_COLOR, the returned +// value is only meaningful if the bitstream is animated. +WEBP_EXTERN uint32_t WebPDemuxGetI( + const WebPDemuxer* dmux, WebPFormatFeature feature); + +//------------------------------------------------------------------------------ +// Frame iteration. + +struct WebPIterator { + int frame_num; + int num_frames; // equivalent to WEBP_FF_FRAME_COUNT. + int x_offset, y_offset; // offset relative to the canvas. + int width, height; // dimensions of this frame. + int duration; // display duration in milliseconds. + WebPMuxAnimDispose dispose_method; // dispose method for the frame. + int complete; // true if 'fragment' contains a full frame. partial images + // may still be decoded with the WebP incremental decoder. + WebPData fragment; // The frame given by 'frame_num'. Note for historical + // reasons this is called a fragment. + int has_alpha; // True if the frame contains transparency. + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + + uint32_t pad[2]; // padding for later use. + void* private_; // for internal use only. +}; + +// Retrieves frame 'frame_number' from 'dmux'. +// 'iter->fragment' points to the frame on return from this function. +// Setting 'frame_number' equal to 0 will return the last frame of the image. +// Returns false if 'dmux' is NULL or frame 'frame_number' is not present. +// Call WebPDemuxReleaseIterator() when use of the iterator is complete. +// NOTE: 'dmux' must persist for the lifetime of 'iter'. +WEBP_EXTERN int WebPDemuxGetFrame( + const WebPDemuxer* dmux, int frame_number, WebPIterator* iter); + +// Sets 'iter->fragment' to point to the next ('iter->frame_num' + 1) or +// previous ('iter->frame_num' - 1) frame. These functions do not loop. +// Returns true on success, false otherwise. +WEBP_EXTERN int WebPDemuxNextFrame(WebPIterator* iter); +WEBP_EXTERN int WebPDemuxPrevFrame(WebPIterator* iter); + +// Releases any memory associated with 'iter'. +// Must be called before any subsequent calls to WebPDemuxGetChunk() on the same +// iter. Also, must be called before destroying the associated WebPDemuxer with +// WebPDemuxDelete(). +WEBP_EXTERN void WebPDemuxReleaseIterator(WebPIterator* iter); + +//------------------------------------------------------------------------------ +// Chunk iteration. + +struct WebPChunkIterator { + // The current and total number of chunks with the fourcc given to + // WebPDemuxGetChunk(). + int chunk_num; + int num_chunks; + WebPData chunk; // The payload of the chunk. + + uint32_t pad[6]; // padding for later use + void* private_; +}; + +// Retrieves the 'chunk_number' instance of the chunk with id 'fourcc' from +// 'dmux'. +// 'fourcc' is a character array containing the fourcc of the chunk to return, +// e.g., "ICCP", "XMP ", "EXIF", etc. +// Setting 'chunk_number' equal to 0 will return the last chunk in a set. +// Returns true if the chunk is found, false otherwise. Image related chunk +// payloads are accessed through WebPDemuxGetFrame() and related functions. +// Call WebPDemuxReleaseChunkIterator() when use of the iterator is complete. +// NOTE: 'dmux' must persist for the lifetime of the iterator. +WEBP_EXTERN int WebPDemuxGetChunk(const WebPDemuxer* dmux, + const char fourcc[4], int chunk_number, + WebPChunkIterator* iter); + +// Sets 'iter->chunk' to point to the next ('iter->chunk_num' + 1) or previous +// ('iter->chunk_num' - 1) chunk. These functions do not loop. +// Returns true on success, false otherwise. +WEBP_EXTERN int WebPDemuxNextChunk(WebPChunkIterator* iter); +WEBP_EXTERN int WebPDemuxPrevChunk(WebPChunkIterator* iter); + +// Releases any memory associated with 'iter'. +// Must be called before destroying the associated WebPDemuxer with +// WebPDemuxDelete(). +WEBP_EXTERN void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter); + +//------------------------------------------------------------------------------ +// WebPAnimDecoder API +// +// This API allows decoding (possibly) animated WebP images. +// +// Code Example: +/* + WebPAnimDecoderOptions dec_options; + WebPAnimDecoderOptionsInit(&dec_options); + // Tune 'dec_options' as needed. + WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); + WebPAnimInfo anim_info; + WebPAnimDecoderGetInfo(dec, &anim_info); + for (uint32_t i = 0; i < anim_info.loop_count; ++i) { + while (WebPAnimDecoderHasMoreFrames(dec)) { + uint8_t* buf; + int timestamp; + WebPAnimDecoderGetNext(dec, &buf, ×tamp); + // ... (Render 'buf' based on 'timestamp'). + // ... (Do NOT free 'buf', as it is owned by 'dec'). + } + WebPAnimDecoderReset(dec); + } + const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); + // ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). + WebPAnimDecoderDelete(dec); +*/ + +typedef struct WebPAnimDecoder WebPAnimDecoder; // Main opaque object. + +// Global options. +struct WebPAnimDecoderOptions { + // Output colorspace. Only the following modes are supported: + // MODE_RGBA, MODE_BGRA, MODE_rgbA and MODE_bgrA. + WEBP_CSP_MODE color_mode; + int use_threads; // If true, use multi-threaded decoding. + uint32_t padding[7]; // Padding for later use. +}; + +// Internal, version-checked, entry point. +WEBP_EXTERN int WebPAnimDecoderOptionsInitInternal( + WebPAnimDecoderOptions*, int); + +// Should always be called, to initialize a fresh WebPAnimDecoderOptions +// structure before modification. Returns false in case of version mismatch. +// WebPAnimDecoderOptionsInit() must have succeeded before using the +// 'dec_options' object. +static WEBP_INLINE int WebPAnimDecoderOptionsInit( + WebPAnimDecoderOptions* dec_options) { + return WebPAnimDecoderOptionsInitInternal(dec_options, + WEBP_DEMUX_ABI_VERSION); +} + +// Internal, version-checked, entry point. +WEBP_EXTERN WebPAnimDecoder* WebPAnimDecoderNewInternal( + const WebPData*, const WebPAnimDecoderOptions*, int); + +// Creates and initializes a WebPAnimDecoder object. +// Parameters: +// webp_data - (in) WebP bitstream. This should remain unchanged during the +// lifetime of the output WebPAnimDecoder object. +// dec_options - (in) decoding options. Can be passed NULL to choose +// reasonable defaults (in particular, color mode MODE_RGBA +// will be picked). +// Returns: +// A pointer to the newly created WebPAnimDecoder object, or NULL in case of +// parsing error, invalid option or memory error. +static WEBP_INLINE WebPAnimDecoder* WebPAnimDecoderNew( + const WebPData* webp_data, const WebPAnimDecoderOptions* dec_options) { + return WebPAnimDecoderNewInternal(webp_data, dec_options, + WEBP_DEMUX_ABI_VERSION); +} + +// Global information about the animation.. +struct WebPAnimInfo { + uint32_t canvas_width; + uint32_t canvas_height; + uint32_t loop_count; + uint32_t bgcolor; + uint32_t frame_count; + uint32_t pad[4]; // padding for later use +}; + +// Get global information about the animation. +// Parameters: +// dec - (in) decoder instance to get information from. +// info - (out) global information fetched from the animation. +// Returns: +// True on success. +WEBP_EXTERN int WebPAnimDecoderGetInfo(const WebPAnimDecoder* dec, + WebPAnimInfo* info); + +// Fetch the next frame from 'dec' based on options supplied to +// WebPAnimDecoderNew(). This will be a fully reconstructed canvas of size +// 'canvas_width * 4 * canvas_height', and not just the frame sub-rectangle. The +// returned buffer 'buf' is valid only until the next call to +// WebPAnimDecoderGetNext(), WebPAnimDecoderReset() or WebPAnimDecoderDelete(). +// Parameters: +// dec - (in/out) decoder instance from which the next frame is to be fetched. +// buf - (out) decoded frame. +// timestamp - (out) timestamp of the frame in milliseconds. +// Returns: +// False if any of the arguments are NULL, or if there is a parsing or +// decoding error, or if there are no more frames. Otherwise, returns true. +WEBP_EXTERN int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, + uint8_t** buf, int* timestamp); + +// Check if there are more frames left to decode. +// Parameters: +// dec - (in) decoder instance to be checked. +// Returns: +// True if 'dec' is not NULL and some frames are yet to be decoded. +// Otherwise, returns false. +WEBP_EXTERN int WebPAnimDecoderHasMoreFrames(const WebPAnimDecoder* dec); + +// Resets the WebPAnimDecoder object, so that next call to +// WebPAnimDecoderGetNext() will restart decoding from 1st frame. This would be +// helpful when all frames need to be decoded multiple times (e.g. +// info.loop_count times) without destroying and recreating the 'dec' object. +// Parameters: +// dec - (in/out) decoder instance to be reset +WEBP_EXTERN void WebPAnimDecoderReset(WebPAnimDecoder* dec); + +// Grab the internal demuxer object. +// Getting the demuxer object can be useful if one wants to use operations only +// available through demuxer; e.g. to get XMP/EXIF/ICC metadata. The returned +// demuxer object is owned by 'dec' and is valid only until the next call to +// WebPAnimDecoderDelete(). +// +// Parameters: +// dec - (in) decoder instance from which the demuxer object is to be fetched. +WEBP_EXTERN const WebPDemuxer* WebPAnimDecoderGetDemuxer( + const WebPAnimDecoder* dec); + +// Deletes the WebPAnimDecoder object. +// Parameters: +// dec - (in/out) decoder instance to be deleted +WEBP_EXTERN void WebPAnimDecoderDelete(WebPAnimDecoder* dec); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_DEMUX_H_ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/encode.h b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/encode.h new file mode 100644 index 00000000..56b68e2f --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/encode.h @@ -0,0 +1,552 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// WebP encoder: main interface +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_ENCODE_H_ +#define WEBP_WEBP_ENCODE_H_ + +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_ENCODER_ABI_VERSION 0x020f // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPImageHint WebPImageHint; +// typedef enum WebPEncCSP WebPEncCSP; +// typedef enum WebPPreset WebPPreset; +// typedef enum WebPEncodingError WebPEncodingError; +typedef struct WebPConfig WebPConfig; +typedef struct WebPPicture WebPPicture; // main structure for I/O +typedef struct WebPAuxStats WebPAuxStats; +typedef struct WebPMemoryWriter WebPMemoryWriter; + +// Return the encoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetEncoderVersion(void); + +//------------------------------------------------------------------------------ +// One-stop-shop call! No questions asked: + +// 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 'WebPFree(*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). +WEBP_EXTERN size_t WebPEncodeRGB(const uint8_t* rgb, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGR(const uint8_t* bgr, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeRGBA(const uint8_t* rgba, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGRA(const uint8_t* bgra, + int width, int height, int stride, + float quality_factor, uint8_t** 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. +// Note these functions, like the lossy versions, use the library's default +// settings. For lossless this means 'exact' is disabled. RGB values in +// transparent areas will be modified to improve compression. To avoid this, +// use WebPEncode() and set WebPConfig::exact to 1. +WEBP_EXTERN size_t WebPEncodeLosslessRGB(const uint8_t* rgb, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessBGR(const uint8_t* bgr, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, + int width, int height, int stride, + uint8_t** output); + +//------------------------------------------------------------------------------ +// Coding parameters + +// Image characteristics hint for the underlying encoder. +typedef enum WebPImageHint { + WEBP_HINT_DEFAULT = 0, // default preset. + WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot + WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting + WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc). + WEBP_HINT_LAST +} WebPImageHint; + +// Compression parameters. +struct WebPConfig { + int lossless; // Lossless encoding (0=lossy(default), 1=lossless). + float quality; // between 0 and 100. For lossy, 0 gives the smallest + // size and 100 the largest. For lossless, this + // parameter is the amount of effort put into the + // compression: 0 is the fastest but gives larger + // files compared to the slowest, but best, 100. + int method; // quality/speed trade-off (0=fast, 6=slower-better) + + WebPImageHint image_hint; // Hint for image type (lossless only for now). + + int target_size; // if non-zero, set the desired target size in bytes. + // Takes precedence over the 'compression' parameter. + float target_PSNR; // if non-zero, specifies the minimal distortion to + // try to achieve. Takes precedence over target_size. + int segments; // maximum number of segments to use, in [1..4] + int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. + int filter_strength; // range: [0 = off .. 100 = strongest] + int filter_sharpness; // range: [0 = off .. 7 = least sharp] + int filter_type; // filtering type: 0 = simple, 1 = strong (only used + // if filter_strength > 0 or autofilter > 0) + int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] + int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, + // 1 = compressed with WebP lossless). Default is 1. + int alpha_filtering; // Predictive filtering method for alpha plane. + // 0: none, 1: fast, 2: best. Default if 1. + int alpha_quality; // Between 0 (smallest size) and 100 (lossless). + // Default is 100. + int pass; // number of entropy-analysis passes (in [1..10]). + + int show_compressed; // if true, export the compressed picture back. + // In-loop filtering is not applied. + int preprocessing; // preprocessing filter: + // 0=none, 1=segment-smooth, 2=pseudo-random dithering + int partitions; // log2(number of token partitions) in [0..3]. Default + // is set to 0 for easier progressive decoding. + int partition_limit; // quality degradation allowed to fit the 512k limit + // on prediction modes coding (0: no degradation, + // 100: maximum possible degradation). + int emulate_jpeg_size; // If true, compression parameters will be remapped + // to better match the expected output size from + // JPEG compression. Generally, the output size will + // be similar but the degradation will be lower. + int thread_level; // If non-zero, try and use multi-threaded encoding. + int low_memory; // If set, reduce memory usage (but increase CPU use). + + int near_lossless; // Near lossless encoding [0 = max loss .. 100 = off + // (default)]. + int exact; // if non-zero, preserve the exact RGB values under + // transparent area. Otherwise, discard this invisible + // RGB information for better compression. The default + // value is 0. + + int use_delta_palette; // reserved for future lossless feature + int use_sharp_yuv; // if needed, use sharp (and slow) RGB->YUV conversion + + int qmin; // minimum permissible quality factor + int qmax; // maximum permissible quality factor +}; + +// Enumerate some predefined settings for WebPConfig, depending on the type +// of source picture. These presets are used when calling WebPConfigPreset(). +typedef enum WebPPreset { + WEBP_PRESET_DEFAULT = 0, // default preset. + WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot + WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting + WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details + WEBP_PRESET_ICON, // small-sized colorful images + WEBP_PRESET_TEXT // text-like +} WebPPreset; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int); + +// Should always be called, to initialize a fresh WebPConfig structure before +// modification. Returns false in case of version mismatch. WebPConfigInit() +// must have succeeded before using the 'config' object. +// Note that the default values are lossless=0 and quality=75. +static WEBP_INLINE int WebPConfigInit(WebPConfig* config) { + return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, + WEBP_ENCODER_ABI_VERSION); +} + +// This function will initialize the configuration according to a predefined +// set of parameters (referred to by 'preset') and a given quality factor. +// This function can be called as a replacement to WebPConfigInit(). Will +// return false in case of error. +static WEBP_INLINE int WebPConfigPreset(WebPConfig* config, + WebPPreset preset, float quality) { + return WebPConfigInitInternal(config, preset, quality, + WEBP_ENCODER_ABI_VERSION); +} + +// Activate the lossless compression mode with the desired efficiency level +// between 0 (fastest, lowest compression) and 9 (slower, best compression). +// A good default level is '6', providing a fair tradeoff between compression +// speed and final compressed size. +// This function will overwrite several fields from config: 'method', 'quality' +// and 'lossless'. Returns false in case of parameter error. +WEBP_EXTERN int WebPConfigLosslessPreset(WebPConfig* config, int level); + +// Returns true if 'config' is non-NULL and all configuration parameters are +// within their valid ranges. +WEBP_EXTERN int WebPValidateConfig(const WebPConfig* config); + +//------------------------------------------------------------------------------ +// Input / Output +// Structure for storing auxiliary statistics. + +struct WebPAuxStats { + int coded_size; // final size + + float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha + int block_count[3]; // number of intra4/intra16/skipped macroblocks + int header_bytes[2]; // approximate number of bytes spent for header + // and mode-partition #0 + int residual_bytes[3][4]; // approximate number of bytes spent for + // DC/AC/uv coefficients for each (0..3) segments. + int segment_size[4]; // number of macroblocks in each segments + int segment_quant[4]; // quantizer values for each segments + int segment_level[4]; // filtering strength for each segments [0..63] + + int alpha_data_size; // size of the transparency data + int layer_data_size; // size of the enhancement layer data + + // lossless encoder statistics + uint32_t lossless_features; // bit0:predictor bit1:cross-color transform + // bit2:subtract-green bit3:color indexing + int histogram_bits; // number of precision bits of histogram + int transform_bits; // precision bits for transform + int cache_bits; // number of bits for color cache lookup + int palette_size; // number of color in palette, if used + int lossless_size; // final lossless size + int lossless_hdr_size; // lossless header (transform, huffman etc) size + int lossless_data_size; // lossless image data size + + uint32_t pad[2]; // padding for later use +}; + +// Signature for output function. Should return true if writing was successful. +// data/data_size is the segment of data to write, and 'picture' is for +// reference (and so one can make use of picture->custom_ptr). +typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, + const WebPPicture* picture); + +// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using +// the following WebPMemoryWriter object (to be set as a custom_ptr). +struct WebPMemoryWriter { + uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). + size_t size; // final size + size_t max_size; // total capacity + uint32_t pad[1]; // padding for later use +}; + +// The following must be called first before any use. +WEBP_EXTERN void WebPMemoryWriterInit(WebPMemoryWriter* writer); + +// The following must be called to deallocate writer->mem memory. The 'writer' +// object itself is not deallocated. +WEBP_EXTERN void WebPMemoryWriterClear(WebPMemoryWriter* writer); +// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon +// completion, writer.mem and writer.size will hold the coded data. +// writer.mem must be freed by calling WebPMemoryWriterClear. +WEBP_EXTERN int WebPMemoryWrite(const uint8_t* data, size_t data_size, + const WebPPicture* picture); + +// Progress hook, called from time to time to report progress. It can return +// false to request an abort of the encoding process, or true otherwise if +// everything is OK. +typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); + +// Color spaces. +typedef enum WebPEncCSP { + // chroma sampling + WEBP_YUV420 = 0, // 4:2:0 + WEBP_YUV420A = 4, // alpha channel variant + WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors + WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present +} WebPEncCSP; + +// Encoding error conditions. +typedef enum WebPEncodingError { + VP8_ENC_OK = 0, + VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects + VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits + VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL + VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid + VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height + VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k + VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M + VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes + VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G + VP8_ENC_ERROR_USER_ABORT, // abort request by user + VP8_ENC_ERROR_LAST // list terminator. always last. +} WebPEncodingError; + +// maximum width/height allowed (inclusive), in pixels +#define WEBP_MAX_DIMENSION 16383 + +// Main exchange structure (input samples, output bytes, statistics) +// +// Once WebPPictureInit() has been called, it's ok to make all the INPUT fields +// (use_argb, y/u/v, argb, ...) point to user-owned data, even if +// WebPPictureAlloc() has been called. Depending on the value use_argb, +// it's guaranteed that either *argb or *y/*u/*v content will be kept untouched. +struct WebPPicture { + // INPUT + ////////////// + // Main flag for encoder selecting between ARGB or YUV input. + // It is recommended to use ARGB input (*argb, argb_stride) for lossless + // compression, and YUV input (*y, *u, *v, etc.) for lossy compression + // since these are the respective native colorspace for these formats. + int use_argb; + + // YUV input (mostly used for input to lossy compression) + WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). + int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) + uint8_t* y, *u, *v; // pointers to luma/chroma planes. + int y_stride, uv_stride; // luma/chroma strides. + uint8_t* a; // pointer to the alpha plane + int a_stride; // stride of the alpha plane + uint32_t pad1[2]; // padding for later use + + // ARGB input (mostly used for input to lossless compression) + uint32_t* argb; // Pointer to argb (32 bit) plane. + int argb_stride; // This is stride in pixels units, not bytes. + uint32_t pad2[3]; // padding for later use + + // OUTPUT + /////////////// + // Byte-emission hook, to store compressed bytes as they are ready. + WebPWriterFunction writer; // can be NULL + void* custom_ptr; // can be used by the writer. + + // map for extra information (only for lossy compression mode) + int extra_info_type; // 1: intra type, 2: segment, 3: quant + // 4: intra-16 prediction mode, + // 5: chroma prediction mode, + // 6: bit cost, 7: distortion + uint8_t* extra_info; // if not NULL, points to an array of size + // ((width + 15) / 16) * ((height + 15) / 16) that + // will be filled with a macroblock map, depending + // on extra_info_type. + + // STATS AND REPORTS + /////////////////////////// + // Pointer to side statistics (updated only if not NULL) + WebPAuxStats* stats; + + // Error code for the latest error encountered during encoding + WebPEncodingError error_code; + + // If not NULL, report progress during encoding. + WebPProgressHook progress_hook; + + void* user_data; // this field is free to be set to any value and + // used during callbacks (like progress-report e.g.). + + uint32_t pad3[3]; // padding for later use + + // Unused for now + uint8_t* pad4, *pad5; + uint32_t pad6[8]; // padding for later use + + // PRIVATE FIELDS + //////////////////// + void* memory_; // row chunk of memory for yuva planes + void* memory_argb_; // and for argb too. + void* pad7[2]; // padding for later use +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPPictureInitInternal(WebPPicture*, int); + +// Should always be called, to initialize the structure. Returns false in case +// of version mismatch. WebPPictureInit() must have succeeded before using the +// 'picture' object. +// Note that, by default, use_argb is false and colorspace is WEBP_YUV420. +static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) { + return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// WebPPicture utils + +// Convenience allocation / deallocation based on picture->width/height: +// Allocate y/u/v buffers as per colorspace/width/height specification. +// Note! This function will free the previous buffer if needed. +// Returns false in case of memory error. +WEBP_EXTERN int WebPPictureAlloc(WebPPicture* picture); + +// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). +// Note that this function does _not_ free the memory used by the 'picture' +// object itself. +// Besides memory (which is reclaimed) all other fields of 'picture' are +// preserved. +WEBP_EXTERN void WebPPictureFree(WebPPicture* picture); + +// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, *dst +// will fully own the copied pixels (this is not a view). The 'dst' picture need +// not be initialized as its content is overwritten. +// Returns false in case of memory allocation error. +WEBP_EXTERN int WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); + +// Compute the single distortion for packed planes of samples. +// 'src' will be compared to 'ref', and the raw distortion stored into +// '*distortion'. The refined metric (log(MSE), log(1 - ssim),...' will be +// stored in '*result'. +// 'x_step' is the horizontal stride (in bytes) between samples. +// 'src/ref_stride' is the byte distance between rows. +// Returns false in case of error (bad parameter, memory allocation error, ...). +WEBP_EXTERN int WebPPlaneDistortion(const uint8_t* src, size_t src_stride, + const uint8_t* ref, size_t ref_stride, + int width, int height, + size_t x_step, + int type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float* distortion, float* result); + +// Compute PSNR, SSIM or LSIM distortion metric between two pictures. Results +// are in dB, stored in result[] in the B/G/R/A/All order. The distortion is +// always performed using ARGB samples. Hence if the input is YUV(A), the +// picture will be internally converted to ARGB (just for the measurement). +// Warning: this function is rather CPU-intensive. +WEBP_EXTERN int WebPPictureDistortion( + const WebPPicture* src, const WebPPicture* ref, + int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float result[5]); + +// self-crops a picture to the rectangle defined by top/left/width/height. +// Returns false in case of memory allocation error, or if the rectangle is +// outside of the source picture. +// The rectangle for the view is defined by the top-left corner pixel +// coordinates (left, top) as well as its width and height. This rectangle +// must be fully be comprised inside the 'src' source picture. If the source +// picture uses the YUV420 colorspace, the top and left coordinates will be +// snapped to even values. +WEBP_EXTERN int WebPPictureCrop(WebPPicture* picture, + int left, int top, int width, int height); + +// Extracts a view from 'src' picture into 'dst'. The rectangle for the view +// is defined by the top-left corner pixel coordinates (left, top) as well +// as its width and height. This rectangle must be fully be comprised inside +// the 'src' source picture. If the source picture uses the YUV420 colorspace, +// the top and left coordinates will be snapped to even values. +// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed +// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so, +// the original dimension will be lost). Picture 'dst' need not be initialized +// with WebPPictureInit() if it is different from 'src', since its content will +// be overwritten. +// Returns false in case of invalid parameters. +WEBP_EXTERN int WebPPictureView(const WebPPicture* src, + int left, int top, int width, int height, + WebPPicture* dst); + +// Returns true if the 'picture' is actually a view and therefore does +// not own the memory for pixels. +WEBP_EXTERN int WebPPictureIsView(const WebPPicture* picture); + +// Rescale a picture to new dimension width x height. +// If either 'width' or 'height' (but not both) is 0 the corresponding +// dimension will be calculated preserving the aspect ratio. +// No gamma correction is applied. +// Returns false in case of error (invalid parameter or insufficient memory). +WEBP_EXTERN int WebPPictureRescale(WebPPicture* picture, int width, int height); + +// Colorspace conversion function to import RGB samples. +// Previous buffer will be free'd, if any. +// *rgb buffer should have a size of at least height * rgb_stride. +// Returns false in case of memory error. +WEBP_EXTERN int WebPPictureImportRGB( + WebPPicture* picture, const uint8_t* rgb, int rgb_stride); +// Same, but for RGBA buffer. +WEBP_EXTERN int WebPPictureImportRGBA( + WebPPicture* picture, const uint8_t* rgba, int rgba_stride); +// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format +// input buffer ignoring the alpha channel. Avoids needing to copy the data +// to a temporary 24-bit RGB buffer to import the RGB only. +WEBP_EXTERN int WebPPictureImportRGBX( + WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); + +// Variants of the above, but taking BGR(A|X) input. +WEBP_EXTERN int WebPPictureImportBGR( + WebPPicture* picture, const uint8_t* bgr, int bgr_stride); +WEBP_EXTERN int WebPPictureImportBGRA( + WebPPicture* picture, const uint8_t* bgra, int bgra_stride); +WEBP_EXTERN int WebPPictureImportBGRX( + WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); + +// Converts picture->argb data to the YUV420A format. The 'colorspace' +// parameter is deprecated and should be equal to WEBP_YUV420. +// Upon return, picture->use_argb is set to false. The presence of real +// non-opaque transparent values is detected, and 'colorspace' will be +// adjusted accordingly. Note that this method is lossy. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureARGBToYUVA(WebPPicture* picture, + WebPEncCSP /*colorspace = WEBP_YUV420*/); + +// Same as WebPPictureARGBToYUVA(), but the conversion is done using +// pseudo-random dithering with a strength 'dithering' between +// 0.0 (no dithering) and 1.0 (maximum dithering). This is useful +// for photographic picture. +WEBP_EXTERN int WebPPictureARGBToYUVADithered( + WebPPicture* picture, WebPEncCSP colorspace, float dithering); + +// Performs 'sharp' RGBA->YUVA420 downsampling and colorspace conversion. +// Downsampling is handled with extra care in case of color clipping. This +// method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better +// and sharper YUV representation. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureSharpARGBToYUVA(WebPPicture* picture); +// kept for backward compatibility: +WEBP_EXTERN int WebPPictureSmartARGBToYUVA(WebPPicture* picture); + +// Converts picture->yuv to picture->argb and sets picture->use_argb to true. +// The input format must be YUV_420 or YUV_420A. The conversion from YUV420 to +// ARGB incurs a small loss too. +// Note that the use of this colorspace is discouraged if one has access to the +// raw ARGB samples, since using YUV420 is comparatively lossy. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureYUVAToARGB(WebPPicture* picture); + +// Helper function: given a width x height plane of RGBA or YUV(A) samples +// clean-up or smoothen the YUV or RGB samples under fully transparent area, +// to help compressibility (no guarantee, though). +WEBP_EXTERN void WebPCleanupTransparentArea(WebPPicture* picture); + +// Scan the picture 'picture' for the presence of non fully opaque alpha values. +// Returns true in such case. Otherwise returns false (indicating that the +// alpha plane can be ignored altogether e.g.). +WEBP_EXTERN int WebPPictureHasTransparency(const WebPPicture* picture); + +// Remove the transparency information (if present) by blending the color with +// the background color 'background_rgb' (specified as 24bit RGB triplet). +// After this call, all alpha values are reset to 0xff. +WEBP_EXTERN void WebPBlendAlpha(WebPPicture* picture, uint32_t background_rgb); + +//------------------------------------------------------------------------------ +// Main call + +// Main encoding call, after config and picture have been initialized. +// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), +// and the 'config' object must be a valid one. +// Returns false in case of error, true otherwise. +// In case of error, picture->error_code is updated accordingly. +// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending +// on the value of 'picture->use_argb'. It is highly recommended to use +// the former for lossy encoding, and the latter for lossless encoding +// (when config.lossless is true). Automatic conversion from one format to +// another is provided but they both incur some loss. +WEBP_EXTERN int WebPEncode(const WebPConfig* config, WebPPicture* picture); + +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_ENCODE_H_ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/mux.h b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/mux.h new file mode 100644 index 00000000..7d27489a --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/mux.h @@ -0,0 +1,530 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// RIFF container manipulation and encoding for WebP images. +// +// Authors: Urvang (urvang@google.com) +// Vikas (vikasa@google.com) + +#ifndef WEBP_WEBP_MUX_H_ +#define WEBP_WEBP_MUX_H_ + +#include "./mux_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_MUX_ABI_VERSION 0x0108 // MAJOR(8b) + MINOR(8b) + +//------------------------------------------------------------------------------ +// Mux API +// +// This API allows manipulation of WebP container images containing features +// like color profile, metadata, animation. +// +// Code Example#1: Create a WebPMux object with image data, color profile and +// XMP metadata. +/* + int copy_data = 0; + WebPMux* mux = WebPMuxNew(); + // ... (Prepare image data). + WebPMuxSetImage(mux, &image, copy_data); + // ... (Prepare ICCP color profile data). + WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); + // ... (Prepare XMP metadata). + WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); + // Get data from mux in WebP RIFF format. + WebPMuxAssemble(mux, &output_data); + WebPMuxDelete(mux); + // ... (Consume output_data; e.g. write output_data.bytes to file). + WebPDataClear(&output_data); +*/ + +// Code Example#2: Get image and color profile data from a WebP file. +/* + int copy_data = 0; + // ... (Read data from file). + WebPMux* mux = WebPMuxCreate(&data, copy_data); + WebPMuxGetFrame(mux, 1, &image); + // ... (Consume image; e.g. call WebPDecode() to decode the data). + WebPMuxGetChunk(mux, "ICCP", &icc_profile); + // ... (Consume icc_data). + WebPMuxDelete(mux); + WebPFree(data); +*/ + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPMuxError WebPMuxError; +// typedef enum WebPChunkId WebPChunkId; +typedef struct WebPMux WebPMux; // main opaque object. +typedef struct WebPMuxFrameInfo WebPMuxFrameInfo; +typedef struct WebPMuxAnimParams WebPMuxAnimParams; +typedef struct WebPAnimEncoderOptions WebPAnimEncoderOptions; + +// Error codes +typedef enum WebPMuxError { + WEBP_MUX_OK = 1, + WEBP_MUX_NOT_FOUND = 0, + WEBP_MUX_INVALID_ARGUMENT = -1, + WEBP_MUX_BAD_DATA = -2, + WEBP_MUX_MEMORY_ERROR = -3, + WEBP_MUX_NOT_ENOUGH_DATA = -4 +} WebPMuxError; + +// IDs for different types of chunks. +typedef enum WebPChunkId { + WEBP_CHUNK_VP8X, // VP8X + WEBP_CHUNK_ICCP, // ICCP + WEBP_CHUNK_ANIM, // ANIM + WEBP_CHUNK_ANMF, // ANMF + WEBP_CHUNK_DEPRECATED, // (deprecated from FRGM) + WEBP_CHUNK_ALPHA, // ALPH + WEBP_CHUNK_IMAGE, // VP8/VP8L + WEBP_CHUNK_EXIF, // EXIF + WEBP_CHUNK_XMP, // XMP + WEBP_CHUNK_UNKNOWN, // Other chunks. + WEBP_CHUNK_NIL +} WebPChunkId; + +//------------------------------------------------------------------------------ + +// Returns the version number of the mux library, packed in hexadecimal using +// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetMuxVersion(void); + +//------------------------------------------------------------------------------ +// Life of a Mux object + +// Internal, version-checked, entry point +WEBP_EXTERN WebPMux* WebPNewInternal(int); + +// Creates an empty mux object. +// Returns: +// A pointer to the newly created empty mux object. +// Or NULL in case of memory error. +static WEBP_INLINE WebPMux* WebPMuxNew(void) { + return WebPNewInternal(WEBP_MUX_ABI_VERSION); +} + +// Deletes the mux object. +// Parameters: +// mux - (in/out) object to be deleted +WEBP_EXTERN void WebPMuxDelete(WebPMux* mux); + +//------------------------------------------------------------------------------ +// Mux creation. + +// Internal, version-checked, entry point +WEBP_EXTERN WebPMux* WebPMuxCreateInternal(const WebPData*, int, int); + +// Creates a mux object from raw data given in WebP RIFF format. +// Parameters: +// bitstream - (in) the bitstream data in WebP RIFF format +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// A pointer to the mux object created from given data - on success. +// NULL - In case of invalid data or memory error. +static WEBP_INLINE WebPMux* WebPMuxCreate(const WebPData* bitstream, + int copy_data) { + return WebPMuxCreateInternal(bitstream, copy_data, WEBP_MUX_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// Non-image chunks. + +// Note: Only non-image related chunks should be managed through chunk APIs. +// (Image related chunks are: "ANMF", "VP8 ", "VP8L" and "ALPH"). +// To add, get and delete images, use WebPMuxSetImage(), WebPMuxPushFrame(), +// WebPMuxGetFrame() and WebPMuxDeleteFrame(). + +// Adds a chunk with id 'fourcc' and data 'chunk_data' in the mux object. +// Any existing chunk(s) with the same id will be removed. +// Parameters: +// mux - (in/out) object to which the chunk is to be added +// fourcc - (in) a character array containing the fourcc of the given chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// chunk_data - (in) the chunk data to be added +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetChunk( + WebPMux* mux, const char fourcc[4], const WebPData* chunk_data, + int copy_data); + +// Gets a reference to the data of the chunk with id 'fourcc' in the mux object. +// The caller should NOT free the returned data. +// Parameters: +// mux - (in) object from which the chunk data is to be fetched +// fourcc - (in) a character array containing the fourcc of the chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// chunk_data - (out) returned chunk data +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given id. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetChunk( + const WebPMux* mux, const char fourcc[4], WebPData* chunk_data); + +// Deletes the chunk with the given 'fourcc' from the mux object. +// Parameters: +// mux - (in/out) object from which the chunk is to be deleted +// fourcc - (in) a character array containing the fourcc of the chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or fourcc is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given fourcc. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxDeleteChunk( + WebPMux* mux, const char fourcc[4]); + +//------------------------------------------------------------------------------ +// Images. + +// Encapsulates data about a single frame. +struct WebPMuxFrameInfo { + WebPData bitstream; // image data: can be a raw VP8/VP8L bitstream + // or a single-image WebP file. + int x_offset; // x-offset of the frame. + int y_offset; // y-offset of the frame. + int duration; // duration of the frame (in milliseconds). + + WebPChunkId id; // frame type: should be one of WEBP_CHUNK_ANMF + // or WEBP_CHUNK_IMAGE + WebPMuxAnimDispose dispose_method; // Disposal method for the frame. + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + uint32_t pad[1]; // padding for later use +}; + +// Sets the (non-animated) image in the mux object. +// Note: Any existing images (including frames) will be removed. +// Parameters: +// mux - (in/out) object in which the image is to be set +// bitstream - (in) can be a raw VP8/VP8L bitstream or a single-image +// WebP file (non-animated) +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetImage( + WebPMux* mux, const WebPData* bitstream, int copy_data); + +// Adds a frame at the end of the mux object. +// Notes: (1) frame.id should be WEBP_CHUNK_ANMF +// (2) For setting a non-animated image, use WebPMuxSetImage() instead. +// (3) Type of frame being pushed must be same as the frames in mux. +// (4) As WebP only supports even offsets, any odd offset will be snapped +// to an even location using: offset &= ~1 +// Parameters: +// mux - (in/out) object to which the frame is to be added +// frame - (in) frame data. +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL +// or if content of 'frame' is invalid. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxPushFrame( + WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data); + +// Gets the nth frame from the mux object. +// The content of 'frame->bitstream' is allocated using WebPMalloc(), and NOT +// owned by the 'mux' object. It MUST be deallocated by the caller by calling +// WebPDataClear(). +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in) object from which the info is to be fetched +// nth - (in) index of the frame in the mux object +// frame - (out) data of the returned frame +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL. +// WEBP_MUX_NOT_FOUND - if there are less than nth frames in the mux object. +// WEBP_MUX_BAD_DATA - if nth frame chunk in mux is invalid. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetFrame( + const WebPMux* mux, uint32_t nth, WebPMuxFrameInfo* frame); + +// Deletes a frame from the mux object. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in/out) object from which a frame is to be deleted +// nth - (in) The position from which the frame is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL. +// WEBP_MUX_NOT_FOUND - If there are less than nth frames in the mux object +// before deletion. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth); + +//------------------------------------------------------------------------------ +// Animation. + +// Animation parameters. +struct WebPMuxAnimParams { + uint32_t bgcolor; // Background color of the canvas stored (in MSB order) as: + // Bits 00 to 07: Alpha. + // Bits 08 to 15: Red. + // Bits 16 to 23: Green. + // Bits 24 to 31: Blue. + int loop_count; // Number of times to repeat the animation [0 = infinite]. +}; + +// Sets the animation parameters in the mux object. Any existing ANIM chunks +// will be removed. +// Parameters: +// mux - (in/out) object in which ANIM chunk is to be set/added +// params - (in) animation parameters. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetAnimationParams( + WebPMux* mux, const WebPMuxAnimParams* params); + +// Gets the animation parameters from the mux object. +// Parameters: +// mux - (in) object from which the animation parameters to be fetched +// params - (out) animation parameters extracted from the ANIM chunk +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. +// WEBP_MUX_NOT_FOUND - if ANIM chunk is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetAnimationParams( + const WebPMux* mux, WebPMuxAnimParams* params); + +//------------------------------------------------------------------------------ +// Misc Utilities. + +// Sets the canvas size for the mux object. The width and height can be +// specified explicitly or left as zero (0, 0). +// * When width and height are specified explicitly, then this frame bound is +// enforced during subsequent calls to WebPMuxAssemble() and an error is +// reported if any animated frame does not completely fit within the canvas. +// * When unspecified (0, 0), the constructed canvas will get the frame bounds +// from the bounding-box over all frames after calling WebPMuxAssemble(). +// Parameters: +// mux - (in) object to which the canvas size is to be set +// width - (in) canvas width +// height - (in) canvas height +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL; or +// width or height are invalid or out of bounds +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, + int width, int height); + +// Gets the canvas size from the mux object. +// Note: This method assumes that the VP8X chunk, if present, is up-to-date. +// That is, the mux object hasn't been modified since the last call to +// WebPMuxAssemble() or WebPMuxCreate(). +// Parameters: +// mux - (in) object from which the canvas size is to be fetched +// width - (out) canvas width +// height - (out) canvas height +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, width or height is NULL. +// WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetCanvasSize(const WebPMux* mux, + int* width, int* height); + +// Gets the feature flags from the mux object. +// Note: This method assumes that the VP8X chunk, if present, is up-to-date. +// That is, the mux object hasn't been modified since the last call to +// WebPMuxAssemble() or WebPMuxCreate(). +// Parameters: +// mux - (in) object from which the features are to be fetched +// flags - (out) the flags specifying which features are present in the +// mux object. This will be an OR of various flag values. +// Enum 'WebPFeatureFlags' can be used to test individual flag values. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or flags is NULL. +// WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetFeatures(const WebPMux* mux, + uint32_t* flags); + +// Gets number of chunks with the given 'id' in the mux object. +// Parameters: +// mux - (in) object from which the info is to be fetched +// id - (in) chunk id specifying the type of chunk +// num_elements - (out) number of chunks with the given chunk id +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, or num_elements is NULL. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxNumChunks(const WebPMux* mux, + WebPChunkId id, int* num_elements); + +// Assembles all chunks in WebP RIFF format and returns in 'assembled_data'. +// This function also validates the mux object. +// Note: The content of 'assembled_data' will be ignored and overwritten. +// Also, the content of 'assembled_data' is allocated using WebPMalloc(), and +// NOT owned by the 'mux' object. It MUST be deallocated by the caller by +// calling WebPDataClear(). It's always safe to call WebPDataClear() upon +// return, even in case of error. +// Parameters: +// mux - (in/out) object whose chunks are to be assembled +// assembled_data - (out) assembled WebP data +// Returns: +// WEBP_MUX_BAD_DATA - if mux object is invalid. +// WEBP_MUX_INVALID_ARGUMENT - if mux or assembled_data is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxAssemble(WebPMux* mux, + WebPData* assembled_data); + +//------------------------------------------------------------------------------ +// WebPAnimEncoder API +// +// This API allows encoding (possibly) animated WebP images. +// +// Code Example: +/* + WebPAnimEncoderOptions enc_options; + WebPAnimEncoderOptionsInit(&enc_options); + // Tune 'enc_options' as needed. + WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); + while() { + WebPConfig config; + WebPConfigInit(&config); + // Tune 'config' as needed. + WebPAnimEncoderAdd(enc, frame, timestamp_ms, &config); + } + WebPAnimEncoderAdd(enc, NULL, timestamp_ms, NULL); + WebPAnimEncoderAssemble(enc, webp_data); + WebPAnimEncoderDelete(enc); + // Write the 'webp_data' to a file, or re-mux it further. +*/ + +typedef struct WebPAnimEncoder WebPAnimEncoder; // Main opaque object. + +// Forward declarations. Defined in encode.h. +struct WebPPicture; +struct WebPConfig; + +// Global options. +struct WebPAnimEncoderOptions { + WebPMuxAnimParams anim_params; // Animation parameters. + int minimize_size; // If true, minimize the output size (slow). Implicitly + // disables key-frame insertion. + int kmin; + int kmax; // Minimum and maximum distance between consecutive key + // frames in the output. The library may insert some key + // frames as needed to satisfy this criteria. + // Note that these conditions should hold: kmax > kmin + // and kmin >= kmax / 2 + 1. Also, if kmax <= 0, then + // key-frame insertion is disabled; and if kmax == 1, + // then all frames will be key-frames (kmin value does + // not matter for these special cases). + int allow_mixed; // If true, use mixed compression mode; may choose + // either lossy and lossless for each frame. + int verbose; // If true, print info and warning messages to stderr. + + uint32_t padding[4]; // Padding for later use. +}; + +// Internal, version-checked, entry point. +WEBP_EXTERN int WebPAnimEncoderOptionsInitInternal( + WebPAnimEncoderOptions*, int); + +// Should always be called, to initialize a fresh WebPAnimEncoderOptions +// structure before modification. Returns false in case of version mismatch. +// WebPAnimEncoderOptionsInit() must have succeeded before using the +// 'enc_options' object. +static WEBP_INLINE int WebPAnimEncoderOptionsInit( + WebPAnimEncoderOptions* enc_options) { + return WebPAnimEncoderOptionsInitInternal(enc_options, WEBP_MUX_ABI_VERSION); +} + +// Internal, version-checked, entry point. +WEBP_EXTERN WebPAnimEncoder* WebPAnimEncoderNewInternal( + int, int, const WebPAnimEncoderOptions*, int); + +// Creates and initializes a WebPAnimEncoder object. +// Parameters: +// width/height - (in) canvas width and height of the animation. +// enc_options - (in) encoding options; can be passed NULL to pick +// reasonable defaults. +// Returns: +// A pointer to the newly created WebPAnimEncoder object. +// Or NULL in case of memory error. +static WEBP_INLINE WebPAnimEncoder* WebPAnimEncoderNew( + int width, int height, const WebPAnimEncoderOptions* enc_options) { + return WebPAnimEncoderNewInternal(width, height, enc_options, + WEBP_MUX_ABI_VERSION); +} + +// Optimize the given frame for WebP, encode it and add it to the +// WebPAnimEncoder object. +// The last call to 'WebPAnimEncoderAdd' should be with frame = NULL, which +// indicates that no more frames are to be added. This call is also used to +// determine the duration of the last frame. +// Parameters: +// enc - (in/out) object to which the frame is to be added. +// frame - (in/out) frame data in ARGB or YUV(A) format. If it is in YUV(A) +// format, it will be converted to ARGB, which incurs a small loss. +// timestamp_ms - (in) timestamp of this frame in milliseconds. +// Duration of a frame would be calculated as +// "timestamp of next frame - timestamp of this frame". +// Hence, timestamps should be in non-decreasing order. +// config - (in) encoding options; can be passed NULL to pick +// reasonable defaults. +// Returns: +// On error, returns false and frame->error_code is set appropriately. +// Otherwise, returns true. +WEBP_EXTERN int WebPAnimEncoderAdd( + WebPAnimEncoder* enc, struct WebPPicture* frame, int timestamp_ms, + const struct WebPConfig* config); + +// Assemble all frames added so far into a WebP bitstream. +// This call should be preceded by a call to 'WebPAnimEncoderAdd' with +// frame = NULL; if not, the duration of the last frame will be internally +// estimated. +// Parameters: +// enc - (in/out) object from which the frames are to be assembled. +// webp_data - (out) generated WebP bitstream. +// Returns: +// True on success. +WEBP_EXTERN int WebPAnimEncoderAssemble(WebPAnimEncoder* enc, + WebPData* webp_data); + +// Get error string corresponding to the most recent call using 'enc'. The +// returned string is owned by 'enc' and is valid only until the next call to +// WebPAnimEncoderAdd() or WebPAnimEncoderAssemble() or WebPAnimEncoderDelete(). +// Parameters: +// enc - (in/out) object from which the error string is to be fetched. +// Returns: +// NULL if 'enc' is NULL. Otherwise, returns the error string if the last call +// to 'enc' had an error, or an empty string if the last call was a success. +WEBP_EXTERN const char* WebPAnimEncoderGetError(WebPAnimEncoder* enc); + +// Deletes the WebPAnimEncoder object. +// Parameters: +// enc - (in/out) object to be deleted +WEBP_EXTERN void WebPAnimEncoderDelete(WebPAnimEncoder* enc); + +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_MUX_H_ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/mux_types.h b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/mux_types.h new file mode 100644 index 00000000..2fe81958 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/mux_types.h @@ -0,0 +1,98 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Data-types common to the mux and demux libraries. +// +// Author: Urvang (urvang@google.com) + +#ifndef WEBP_WEBP_MUX_TYPES_H_ +#define WEBP_WEBP_MUX_TYPES_H_ + +#include // memset() +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPFeatureFlags WebPFeatureFlags; +// typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; +// typedef enum WebPMuxAnimBlend WebPMuxAnimBlend; +typedef struct WebPData WebPData; + +// VP8X Feature Flags. +typedef enum WebPFeatureFlags { + ANIMATION_FLAG = 0x00000002, + XMP_FLAG = 0x00000004, + EXIF_FLAG = 0x00000008, + ALPHA_FLAG = 0x00000010, + ICCP_FLAG = 0x00000020, + + ALL_VALID_FLAGS = 0x0000003e +} WebPFeatureFlags; + +// Dispose method (animation only). Indicates how the area used by the current +// frame is to be treated before rendering the next frame on the canvas. +typedef enum WebPMuxAnimDispose { + WEBP_MUX_DISPOSE_NONE, // Do not dispose. + WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. +} WebPMuxAnimDispose; + +// Blend operation (animation only). Indicates how transparent pixels of the +// current frame are blended with those of the previous canvas. +typedef enum WebPMuxAnimBlend { + WEBP_MUX_BLEND, // Blend. + WEBP_MUX_NO_BLEND // Do not blend. +} WebPMuxAnimBlend; + +// Data type used to describe 'raw' data, e.g., chunk data +// (ICC profile, metadata) and WebP compressed image data. +// 'bytes' memory must be allocated using WebPMalloc() and such. +struct WebPData { + const uint8_t* bytes; + size_t size; +}; + +// Initializes the contents of the 'webp_data' object with default values. +static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { + if (webp_data != NULL) { + memset(webp_data, 0, sizeof(*webp_data)); + } +} + +// Clears the contents of the 'webp_data' object by calling WebPFree(). +// Does not deallocate the object itself. +static WEBP_INLINE void WebPDataClear(WebPData* webp_data) { + if (webp_data != NULL) { + WebPFree((void*)webp_data->bytes); + WebPDataInit(webp_data); + } +} + +// Allocates necessary storage for 'dst' and copies the contents of 'src'. +// Returns true on success. +static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) { + if (src == NULL || dst == NULL) return 0; + WebPDataInit(dst); + if (src->bytes != NULL && src->size != 0) { + dst->bytes = (uint8_t*)WebPMalloc(src->size); + if (dst->bytes == NULL) return 0; + memcpy((void*)dst->bytes, src->bytes, src->size); + dst->size = src->size; + } + return 1; +} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_MUX_TYPES_H_ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/types.h b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/types.h new file mode 100644 index 00000000..47f7f2b0 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-linux-x86-64/include/webp/types.h @@ -0,0 +1,68 @@ +// Copyright 2010 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Common types + memory wrappers +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_TYPES_H_ +#define WEBP_WEBP_TYPES_H_ + +#include // for size_t + +#ifndef _MSC_VER +#include +#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ + (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) +#define WEBP_INLINE inline +#else +#define WEBP_INLINE +#endif +#else +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned long long int uint64_t; +typedef long long int int64_t; +#define WEBP_INLINE __forceinline +#endif /* _MSC_VER */ + +#ifndef WEBP_EXTERN +// This explicitly marks library functions and allows for changing the +// signature for e.g., Windows DLL builds. +# if defined(__GNUC__) && __GNUC__ >= 4 +# define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) +# else +# define WEBP_EXTERN extern +# endif /* __GNUC__ >= 4 */ +#endif /* WEBP_EXTERN */ + +// Macro to check ABI compatibility (same major revision number) +#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) + +#ifdef __cplusplus +extern "C" { +#endif + +// Allocates 'size' bytes of memory. Returns NULL upon error. Memory +// must be deallocated by calling WebPFree(). This function is made available +// by the core 'libwebp' library. +WEBP_EXTERN void* WebPMalloc(size_t size); + +// Releases memory returned by the WebPDecode*() functions (from decode.h). +WEBP_EXTERN void WebPFree(void* ptr); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_TYPES_H_ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebp.a b/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebp.a new file mode 100644 index 00000000..e7fcbd0a Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebp.a differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebpdemux.a b/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebpdemux.a new file mode 100644 index 00000000..3c8458d6 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebpdemux.a differ diff --git a/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebpmux.a b/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebpmux.a new file mode 100644 index 00000000..9defb9e6 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-linux-x86-64/lib/libwebpmux.a differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/CONTRIBUTING.md b/resources/binaries/libwebp-1.2.4-mac-arm64/CONTRIBUTING.md new file mode 100644 index 00000000..7a73a303 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/CONTRIBUTING.md @@ -0,0 +1,29 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use a [Gerrit](https://www.gerritcodereview.com) instance hosted at +https://chromium-review.googlesource.com for this purpose. See the +[WebM Project page](https://www.webmproject.org/code/contribute/submitting-patches/) +for additional details. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/README.md b/resources/binaries/libwebp-1.2.4-mac-arm64/README.md new file mode 100644 index 00000000..4dfe39c0 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/README.md @@ -0,0 +1,65 @@ +# WebP Codec + +``` + __ __ ____ ____ ____ + / \\/ \/ _ \/ _ )/ _ \ + \ / __/ _ \ __/ + \__\__/\____/\_____/__/ ____ ___ + / _/ / \ \ / _ \/ _/ + / \_/ / / \ \ __/ \__ + \____/____/\_____/_____/____/v1.2.4 +``` + +WebP codec is a library to encode and decode images in WebP format. This package +contains the library that can be used in other programs to add WebP support, as +well as the command line tools 'cwebp' and 'dwebp' to compress and decompress +images respectively. + +See https://developers.google.com/speed/webp for details on the image format. + +The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp + +It is released under the same license as the WebM project. See +https://www.webmproject.org/license/software/ or the "COPYING" file for details. +An additional intellectual property rights grant can be found in the file +PATENTS. + +## Files + +* bin/cwebp : encoding tool +* bin/dwebp : decoding tool +* bin/gif2webp : gif conversion tool +* bin/img2webp : animation creation tool +* bin/vwebp : webp visualization tool +* bin/webpinfo : webp analysis tool +* bin/webpmux : webp muxing tool +* bin/anim\_diff : webp file comparison tool +* bin/anim\_dump : tool for dumping animation frames +* bin/get\_disto : tool for calculating file distortion +* bin/webp\_quality : webp quality estimation tool +* doc/ : manual in HTML and text formats +* lib/ : static libraries +* include/webp : headers + +## Encoding and Decoding Tools + +The bin/ directory contains tools to encode and decode images and animations, +view information about WebP images, and more. See the +[tools documentation](doc/tools.md). + +## APIs + +See the [APIs documentation](doc/api.md). + +## Bugs + +Please report all bugs to the issue tracker: https://bugs.chromium.org/p/webp + +Patches welcome! See [how to contribute](CONTRIBUTING.md). + +## Discuss + +Email: webp-discuss@webmproject.org + +Web: https://groups.google.com/a/webmproject.org/group/webp-discuss diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/anim_diff b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/anim_diff new file mode 100644 index 00000000..4e5d6e78 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/anim_diff differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/anim_dump b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/anim_dump new file mode 100644 index 00000000..1919b14d Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/anim_dump differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/cwebp b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/cwebp new file mode 100644 index 00000000..61df9108 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/cwebp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/dwebp b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/dwebp new file mode 100644 index 00000000..0f034c9a Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/dwebp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/get_disto b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/get_disto new file mode 100644 index 00000000..c984820f Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/get_disto differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/gif2webp b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/gif2webp new file mode 100644 index 00000000..e1d0bfb2 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/gif2webp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/img2webp b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/img2webp new file mode 100644 index 00000000..0c913e36 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/img2webp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/vwebp b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/vwebp new file mode 100644 index 00000000..82be8541 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/vwebp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webp_quality b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webp_quality new file mode 100644 index 00000000..371e1281 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webp_quality differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webpinfo b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webpinfo new file mode 100644 index 00000000..3ecbfafd Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webpinfo differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webpmux b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webpmux new file mode 100644 index 00000000..8088f30d Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/bin/webpmux differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/api.md b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/api.md new file mode 100644 index 00000000..d0adafbd --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/api.md @@ -0,0 +1,385 @@ +# WebP APIs + +## Encoding API + +The main encoding functions are available in the header src/webp/encode.h + +The ready-to-use ones are: + +```c +size_t WebPEncodeRGB(const uint8_t* rgb, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeBGR(const uint8_t* bgr, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeRGBA(const uint8_t* rgba, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeBGRA(const uint8_t* bgra, int width, int height, int stride, + float quality_factor, uint8_t** output); +``` + +They will convert raw RGB samples to a WebP data. The only control supplied is +the quality factor. + +There are some variants for using the lossless format: + +```c +size_t WebPEncodeLosslessRGB(const uint8_t* rgb, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessBGR(const uint8_t* bgr, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, int width, int height, + int stride, uint8_t** output); +``` + +Of course in this case, no quality factor is needed since the compression occurs +without loss of the input values, at the expense of larger output sizes. + +### Advanced encoding API + +A more advanced API is based on the WebPConfig and WebPPicture structures. + +WebPConfig contains the encoding settings and is not tied to a particular +picture. WebPPicture contains input data, on which some WebPConfig will be used +for compression. The encoding flow looks like: + +```c +#include + +// Setup a config, starting form a preset and tuning some additional +// parameters +WebPConfig config; +if (!WebPConfigPreset(&config, WEBP_PRESET_PHOTO, quality_factor)) { + return 0; // version error +} +// ... additional tuning +config.sns_strength = 90; +config.filter_sharpness = 6; +config_error = WebPValidateConfig(&config); // not mandatory, but useful + +// Setup the input data +WebPPicture pic; +if (!WebPPictureInit(&pic)) { + return 0; // version error +} +pic.width = width; +pic.height = height; +// allocated picture of dimension width x height +if (!WebPPictureAlloc(&pic)) { + return 0; // memory error +} +// at this point, 'pic' has been initialized as a container, +// and can receive the Y/U/V samples. +// Alternatively, one could use ready-made import functions like +// WebPPictureImportRGB(), which will take care of memory allocation. +// In any case, past this point, one will have to call +// WebPPictureFree(&pic) to reclaim memory. + +// Set up a byte-output write method. WebPMemoryWriter, for instance. +WebPMemoryWriter wrt; +WebPMemoryWriterInit(&wrt); // initialize 'wrt' + +pic.writer = MyFileWriter; +pic.custom_ptr = my_opaque_structure_to_make_MyFileWriter_work; + +// Compress! +int ok = WebPEncode(&config, &pic); // ok = 0 => error occurred! +WebPPictureFree(&pic); // must be called independently of the 'ok' result. + +// output data should have been handled by the writer at that point. +// -> compressed data is the memory buffer described by wrt.mem / wrt.size + +// deallocate the memory used by compressed data +WebPMemoryWriterClear(&wrt); +``` + +## Decoding API + +This is mainly just one function to call: + +```c +#include "webp/decode.h" +uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, + int* width, int* height); +``` + +Please have a look at the file src/webp/decode.h for the details. There are +variants for decoding in BGR/RGBA/ARGB/BGRA order, along with decoding to raw +Y'CbCr samples. One can also decode the image directly into a pre-allocated +buffer. + +To detect a WebP file and gather the picture's dimensions, the function: + +```c +int WebPGetInfo(const uint8_t* data, size_t data_size, + int* width, int* height); +``` + +is supplied. No decoding is involved when using it. + +### Incremental decoding API + +In the case when data is being progressively transmitted, pictures can still be +incrementally decoded using a slightly more complicated API. Decoder state is +stored into an instance of the WebPIDecoder object. This object can be created +with the purpose of decoding either RGB or Y'CbCr samples. For instance: + +```c +WebPDecBuffer buffer; +WebPInitDecBuffer(&buffer); +buffer.colorspace = MODE_BGR; +... +WebPIDecoder* idec = WebPINewDecoder(&buffer); +``` + +As data is made progressively available, this incremental-decoder object can be +used to decode the picture further. There are two (mutually exclusive) ways to +pass freshly arrived data: + +either by appending the fresh bytes: + +```c +WebPIAppend(idec, fresh_data, size_of_fresh_data); +``` + +or by just mentioning the new size of the transmitted data: + +```c +WebPIUpdate(idec, buffer, size_of_transmitted_buffer); +``` + +Note that 'buffer' can be modified between each call to WebPIUpdate, in +particular when the buffer is resized to accommodate larger data. + +These functions will return the decoding status: either VP8_STATUS_SUSPENDED if +decoding is not finished yet or VP8_STATUS_OK when decoding is done. Any other +status is an error condition. + +The 'idec' object must always be released (even upon an error condition) by +calling: WebPDelete(idec). + +To retrieve partially decoded picture samples, one must use the corresponding +method: WebPIDecGetRGB or WebPIDecGetYUVA. It will return the last displayable +pixel row. + +Lastly, note that decoding can also be performed into a pre-allocated pixel +buffer. This buffer must be passed when creating a WebPIDecoder, calling +WebPINewRGB() or WebPINewYUVA(). + +Please have a look at the src/webp/decode.h header for further details. + +### Advanced Decoding API + +WebP decoding supports an advanced API which provides on-the-fly cropping and +rescaling, something of great usefulness on memory-constrained environments like +mobile phones. Basically, the memory usage will scale with the output's size, +not the input's, when one only needs a quick preview or a zoomed in portion of +an otherwise too-large picture. Some CPU can be saved too, incidentally. + +```c +// A) Init a configuration object +WebPDecoderConfig config; +CHECK(WebPInitDecoderConfig(&config)); + +// B) optional: retrieve the bitstream's features. +CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + +// C) Adjust 'config' options, if needed +config.options.no_fancy_upsampling = 1; +config.options.use_scaling = 1; +config.options.scaled_width = scaledWidth(); +config.options.scaled_height = scaledHeight(); +// etc. + +// D) Specify 'config' output options for specifying output colorspace. +// Optionally the external image decode buffer can also be specified. +config.output.colorspace = MODE_BGRA; +// Optionally, the config.output can be pointed to an external buffer as +// well for decoding the image. This externally supplied memory buffer +// should be big enough to store the decoded picture. +config.output.u.RGBA.rgba = (uint8_t*) memory_buffer; +config.output.u.RGBA.stride = scanline_stride; +config.output.u.RGBA.size = total_size_of_the_memory_buffer; +config.output.is_external_memory = 1; + +// E) Decode the WebP image. There are two variants w.r.t decoding image. +// The first one (E.1) decodes the full image and the second one (E.2) is +// used to incrementally decode the image using small input buffers. +// Any one of these steps can be used to decode the WebP image. + +// E.1) Decode full image. +CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + +// E.2) Decode image incrementally. +WebPIDecoder* const idec = WebPIDecode(NULL, NULL, &config); +CHECK(idec != NULL); +while (bytes_remaining > 0) { + VP8StatusCode status = WebPIAppend(idec, input, bytes_read); + if (status == VP8_STATUS_OK || status == VP8_STATUS_SUSPENDED) { + bytes_remaining -= bytes_read; + } else { + break; + } +} +WebPIDelete(idec); + +// F) Decoded image is now in config.output (and config.output.u.RGBA). +// It can be saved, displayed or otherwise processed. + +// G) Reclaim memory allocated in config's object. It's safe to call +// this function even if the memory is external and wasn't allocated +// by WebPDecode(). +WebPFreeDecBuffer(&config.output); +``` + +## Webp Mux + +WebPMux is a set of two libraries 'Mux' and 'Demux' for creation, extraction and +manipulation of an extended format WebP file, which can have features like color +profile, metadata and animation. Reference command-line tools `webpmux` and +`vwebp` as well as the WebP container specification +'doc/webp-container-spec.txt' are also provided in this package, see the +[tools documentation](tools.md). + +### Mux API + +The Mux API contains methods for adding data to and reading data from WebP +files. This API currently supports XMP/EXIF metadata, ICC profile and animation. +Other features may be added in subsequent releases. + +Example#1 (pseudo code): Creating a WebPMux object with image data, color +profile and XMP metadata. + +```c +int copy_data = 0; +WebPMux* mux = WebPMuxNew(); +// ... (Prepare image data). +WebPMuxSetImage(mux, &image, copy_data); +// ... (Prepare ICC profile data). +WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); +// ... (Prepare XMP metadata). +WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); +// Get data from mux in WebP RIFF format. +WebPMuxAssemble(mux, &output_data); +WebPMuxDelete(mux); +// ... (Consume output_data; e.g. write output_data.bytes to file). +WebPDataClear(&output_data); +``` + +Example#2 (pseudo code): Get image and color profile data from a WebP file. + +```c +int copy_data = 0; +// ... (Read data from file). +WebPMux* mux = WebPMuxCreate(&data, copy_data); +WebPMuxGetFrame(mux, 1, &image); +// ... (Consume image; e.g. call WebPDecode() to decode the data). +WebPMuxGetChunk(mux, "ICCP", &icc_profile); +// ... (Consume icc_profile). +WebPMuxDelete(mux); +free(data); +``` + +For a detailed Mux API reference, please refer to the header file +(src/webp/mux.h). + +### Demux API + +The Demux API enables extraction of images and extended format data from WebP +files. This API currently supports reading of XMP/EXIF metadata, ICC profile and +animated images. Other features may be added in subsequent releases. + +Code example: Demuxing WebP data to extract all the frames, ICC profile and +EXIF/XMP metadata. + +```c +WebPDemuxer* demux = WebPDemux(&webp_data); +uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); +uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); +// ... (Get information about the features present in the WebP file). +uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); + +// ... (Iterate over all frames). +WebPIterator iter; +if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), + // ... and get other frame properties like width, height, offsets etc. + // ... see 'struct WebPIterator' below for more info). + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); +} + +// ... (Extract metadata). +WebPChunkIterator chunk_iter; +if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); +// ... (Consume the ICC profile in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); +// ... (Consume the EXIF metadata in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); +// ... (Consume the XMP metadata in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +WebPDemuxDelete(demux); +``` + +For a detailed Demux API reference, please refer to the header file +(src/webp/demux.h). + +## AnimEncoder API + +The AnimEncoder API can be used to create animated WebP images. + +Code example: + +```c +WebPAnimEncoderOptions enc_options; +WebPAnimEncoderOptionsInit(&enc_options); +// ... (Tune 'enc_options' as needed). +WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); +while() { + WebPConfig config; + WebPConfigInit(&config); + // ... (Tune 'config' as needed). + WebPAnimEncoderAdd(enc, frame, duration, &config); +} +WebPAnimEncoderAssemble(enc, webp_data); +WebPAnimEncoderDelete(enc); +// ... (Write the 'webp_data' to a file, or re-mux it further). +``` + +For a detailed AnimEncoder API reference, please refer to the header file +(src/webp/mux.h). + +## AnimDecoder API + +This AnimDecoder API allows decoding (possibly) animated WebP images. + +Code Example: + +```c +WebPAnimDecoderOptions dec_options; +WebPAnimDecoderOptionsInit(&dec_options); +// Tune 'dec_options' as needed. +WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); +WebPAnimInfo anim_info; +WebPAnimDecoderGetInfo(dec, &anim_info); +for (uint32_t i = 0; i < anim_info.loop_count; ++i) { + while (WebPAnimDecoderHasMoreFrames(dec)) { + uint8_t* buf; + int timestamp; + WebPAnimDecoderGetNext(dec, &buf, ×tamp); + // ... (Render 'buf' based on 'timestamp'). + // ... (Do NOT free 'buf', as it is owned by 'dec'). + } + WebPAnimDecoderReset(dec); +} +const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); +// ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). +WebPAnimDecoderDelete(dec); +``` + +For a detailed AnimDecoder API reference, please refer to the header file +(src/webp/demux.h). diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/cwebp.html b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/cwebp.html new file mode 100644 index 00000000..f0e49355 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/cwebp.html @@ -0,0 +1,663 @@ + + + + + + + + + +CWEBP + + + + +

CWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

cwebp − +compress an image file to a WebP file

+ + +

SYNOPSIS

+ + +

cwebp +[options] input_file −o +output_file.webp

+ + +

DESCRIPTION

+ + +

This manual +page documents the cwebp command.

+ +

cwebp +compresses an image using the WebP format. Input format can +be either PNG, JPEG, TIFF, WebP or raw Y’CbCr samples. +Note: Animated PNG and WebP files are not supported.

+ + +

OPTIONS

+ + +

The basic +options are:
+−o
string

+ +

Specify the name of the output +WebP file. If omitted, cwebp will perform compression +but only report statistics. Using "−" as +output name will direct output to ’stdout’.

+ +

−− +string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with a +’−’ for instance. This option must appear +last. Any other options afterward will be +ignored.

+ +

−h, +−help

+ +

A short usage summary.

+ +

−H, +−longhelp

+ +

A summary of all the possible +options.

+ +

−version

+ +

Print the version number (as +major.minor.revision) and exit.

+ +

−lossless

+ +

Encode the image without any +loss. For images with fully transparent area, the invisible +pixel values (R/G/B or Y/U/V) will be preserved only if the +−exact option is used.

+ +

−near_lossless +int

+ +

Specify the level of +near−lossless image preprocessing. This option adjusts +pixel values to help compressibility, but has minimal impact +on the visual quality. It triggers lossless compression mode +automatically. The range is 0 (maximum preprocessing) to 100 +(no preprocessing, the default). The typical value is around +60. Note that lossy with −q 100 can at times +yield better results.

+ +

−q +float

+ +

Specify the compression factor +for RGB channels between 0 and 100. The default is 75.
+In case of lossy compression (default), a small factor +produces a smaller file with lower quality. Best quality is +achieved by using a value of 100.
+In case of lossless compression (specified by the +−lossless option), a small factor enables +faster compression speed, but produces a larger file. +Maximum compression is achieved by using a value of 100.

+ + + + + + + +
+ + +

−z +int

+ + +

Switch on +lossless compression mode with the specified level +between 0 and 9, with level 0 being the fastest, 9 being the +slowest. Fast mode produces larger file size than slower +ones. A good default is −z 6. This option is +actually a shortcut for some predefined settings for quality +and method. If options −q or −m +are subsequently used, they will invalidate the effect of +this option.

+ +

−alpha_q +int

+ +

Specify the compression factor +for alpha compression between 0 and 100. Lossless +compression of alpha is achieved using a value of 100, while +the lower values result in a lossy compression. The default +is 100.

+ +

−preset +string

+ +

Specify a set of +pre−defined parameters to suit a particular type of +source material. Possible values are: default, +photo, picture, drawing, icon, +text. Since −preset overwrites the other +parameters’ values (except the −q one), +this option should preferably appear first in the order of +the arguments.

+ + + + + + + +
+ + +

−m +int

+ + +

Specify the +compression method to use. This parameter controls the trade +off between encoding speed and the compressed file size and +quality. Possible values range from 0 to 6. Default value is +4. When higher values are used, the encoder will spend more +time inspecting additional encoding possibilities and decide +on the quality gain. Lower value can result in faster +processing time at the expense of larger file size and lower +compression quality.

+ +

−crop +x_position y_position width height

+ +

Crop the source to a rectangle +with top−left corner at coordinates +(x_position, y_position) and size width +x height. This cropping area must be fully contained +within the source rectangle. Note: the cropping is applied +before any scaling.

+ +

−resize width +height

+ +

Resize the source to a +rectangle with size width x height. If either +(but not both) of the width or height +parameters is 0, the value will be calculated preserving the +aspect−ratio. Note: scaling is applied after +cropping.

+ + + + + + + + +
+ + + +

−mt

+ + +

Use +multi−threading for encoding, if possible.

+
+ +

−low_memory

+ +

Reduce memory usage of lossy +encoding by saving four times the compressed size +(typically). This will make the encoding slower and the +output slightly different in size and distortion. This flag +is only effective for methods 3 and up, and is off by +default. Note that leaving this flag off will have some side +effects on the bitstream: it forces certain bitstream +features like number of partitions (forced to 1). Note that +a more detailed report of bitstream size is printed by +cwebp when using this option.

+ +

LOSSY +OPTIONS
+These options are only effective when doing lossy encoding +(the default, with or without alpha).
+−size
int

+ +

Specify a target size (in +bytes) to try and reach for the compressed output. The +compressor will make several passes of partial encoding in +order to get as close as possible to this target. If both +−size and −psnr are used, +−size value will prevail.

+ +

−psnr +float

+ +

Specify a target PSNR (in dB) +to try and reach for the compressed output. The compressor +will make several passes of partial encoding in order to get +as close as possible to this target. If both +−size and −psnr are used, +−size value will prevail.

+ +

−pass +int

+ +

Set a maximum number of passes +to use during the dichotomy used by options +−size or −psnr. Maximum value is +10, default is 1. If options −size or +−psnr were used, but −pass +wasn’t specified, a default value of ’6’ +passes will be used.

+ +

−qrange int +int

+ +

Specifies the permissible +interval for the quality factor. This is particularly useful +when using multi-pass (−size or +−psnr options). Default is 0 100. If the +quality factor is outside this range, it will be clamped. If +the minimum value must be less or equal to the maximum +one.

+ + + + + + + +
+ + + +

−af

+ + +

Turns +auto−filter on. This algorithm will spend additional +time optimizing the filtering strength to reach a +well−balanced quality.

+ +

−jpeg_like

+ +

Change the internal parameter +mapping to better match the expected size of JPEG +compression. This flag will generally produce an output file +of similar size to its JPEG equivalent (for the same +−q setting), but with less visual +distortion.

+ +

Advanced options:

+ + + + + + + +
+ + +

−f +int

+ + +

Specify the +strength of the deblocking filter, between 0 (no filtering) +and 100 (maximum filtering). A value of 0 will turn off any +filtering. Higher value will increase the strength of the +filtering process applied after decoding the picture. The +higher the value the smoother the picture will appear. +Typical values are usually in the range of 20 to 50.

+ +

−sharpness +int

+ +

Specify the sharpness of the +filtering (if used). Range is 0 (sharpest) to 7 (least +sharp). Default is 0.

+ +

−strong

+ +

Use strong filtering (if +filtering is being used thanks to the −f +option). Strong filtering is on by default.

+ +

−nostrong

+ +

Disable strong filtering (if +filtering is being used thanks to the −f +option) and use simple filtering instead.

+ +

−sharp_yuv

+ +

Use more accurate and sharper +RGB->YUV conversion if needed. Note that this process is +slower than the default ’fast’ RGB->YUV +conversion.

+ +

−sns +int

+ +

Specify the amplitude of the +spatial noise shaping. Spatial noise shaping (or sns +for short) refers to a general collection of built−in +algorithms used to decide which area of the picture should +use relatively less bits, and where else to better transfer +these bits. The possible range goes from 0 (algorithm is +off) to 100 (the maximal effect). The default value is +50.

+ +

−segments +int

+ +

Change the number of partitions +to use during the segmentation of the sns algorithm. +Segments should be in range 1 to 4. Default value is 4. This +option has no effect for methods 3 and up, unless +−low_memory is used.

+ +

−partition_limit +int

+ +

Degrade quality by limiting the +number of bits used by some macroblocks. Range is 0 (no +degradation, the default) to 100 (full degradation). Useful +values are usually around 30−70 for moderately large +images. In the VP8 format, the so−called control +partition has a limit of 512k and is used to store the +following information: whether the macroblock is skipped, +which segment it belongs to, whether it is coded as intra +4x4 or intra 16x16 mode, and finally the prediction modes to +use for each of the sub−blocks. For a very large +image, 512k only leaves room to few bits per 16x16 +macroblock. The absolute minimum is 4 bits per macroblock. +Skip, segment, and mode information can use up almost all +these 4 bits (although the case is unlikely), which is +problematic for very large images. The partition_limit +factor controls how frequently the most bit−costly +mode (intra 4x4) will be used. This is useful in case the +512k limit is reached and the following message is +displayed: Error code: 6 (PARTITION0_OVERFLOW: Partition +#0 is too big to fit 512k). If using +−partition_limit is not enough to meet the 512k +constraint, one should use less segments in order to save +more header bits per macroblock. See the +−segments option.

+ +

LOGGING +OPTIONS
+These options control the level of output:

+ + + + + + + +
+ + + +

−v

+ + +

Print extra +information (encoding time in particular).

+ +

−print_psnr

+ +

Compute and report average PSNR +(Peak−Signal−To−Noise ratio).

+ +

−print_ssim

+ +

Compute and report average SSIM +(structural similarity metric, see +https://en.wikipedia.org/wiki/SSIM for additional +details).

+ +

−print_lsim

+ +

Compute and report local +similarity metric (sum of lowest error amongst the +collocated pixel neighbors).

+ +

−progress

+ +

Report encoding progress in +percent.

+ + + + + + + + + + + + +
+ + + +

−quiet

+ + +

Do not print +anything.

+ + + +

−short

+ + +

Only print brief +information (output file size and PSNR) for testing +purposes.

+ +

−map +int

+ +

Output additional +ASCII−map of encoding information. Possible map values +range from 1 to 6. This is only meant to help debugging.

+ +

ADDITIONAL +OPTIONS
+More advanced options are:
+−s
width height

+ +

Specify that the input file +actually consists of raw Y’CbCr samples following the +ITU−R BT.601 recommendation, in 4:2:0 linear format. +The luma plane has size width x height.

+ +

−pre +int

+ +

Specify some preprocessing +steps. Using a value of ’2’ will trigger +quality−dependent pseudo−random dithering during +RGBA−>YUVA conversion (lossy compression only).

+ +

−alpha_filter +string

+ +

Specify the predictive +filtering method for the alpha plane. One of +’none’, ’fast’ or +’best’, in increasing complexity and slowness +order. Default is ’fast’. Internally, alpha +filtering is performed using four possible predictions +(none, horizontal, vertical, gradient). The +’best’ mode will try each mode in turn and pick +the one which gives the smaller size. The ’fast’ +mode will just try to form an a priori guess without testing +all modes.

+ +

−alpha_method +int

+ +

Specify the algorithm used for +alpha compression: 0 or 1. Algorithm 0 denotes no +compression, 1 uses WebP lossless format for compression. +The default is 1.

+ + + + + + + +
+ + + +

−exact

+ + +

Preserve RGB values +in transparent area. The default is off, to help +compressibility.

+ +

−blend_alpha +int

+ +

This option blends the alpha +channel (if present) with the source using the background +color specified in hexadecimal as 0xrrggbb. The alpha +channel is afterward reset to the opaque value 255.

+ +

−noalpha

+ +

Using this option will discard +the alpha channel.

+ +

−hint +string

+ +

Specify the hint about input +image type. Possible values are: photo, +picture or graph.

+ +

−metadata +string

+ +

A comma separated list of +metadata to copy from the input to the output if present. +Valid values: all, none, exif, +icc, xmp. The default is none.

+ +

Note: each +input format may not support all combinations.

+ + + + + + + + +
+ + + +

−noasm

+ + +

Disable all +assembly optimizations.

+
+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

cwebp −q +50 -lossless picture.png −o picture_lossless.webp
+cwebp −q 70 picture_with_alpha.png −o +picture_with_alpha.webp
+cwebp −sns 70 −f 50 −size 60000 +picture.png −o picture.webp
+cwebp −o picture.webp −− +−−−picture.png

+ + +

AUTHORS

+ + +

cwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ + +

SEE ALSO

+ + + +

dwebp(1), +gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/cwebp.txt b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/cwebp.txt new file mode 100644 index 00000000..24439d6e --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/cwebp.txt @@ -0,0 +1,340 @@ +CWEBP(1) CWEBP(1) + + + +NAME + cwebp - compress an image file to a WebP file + +SYNOPSIS + cwebp [options] input_file -o output_file.webp + +DESCRIPTION + This manual page documents the cwebp command. + + cwebp compresses an image using the WebP format. Input format can be + either PNG, JPEG, TIFF, WebP or raw Y'CbCr samples. Note: Animated PNG + and WebP files are not supported. + +OPTIONS + The basic options are: + + -o string + Specify the name of the output WebP file. If omitted, cwebp will + perform compression but only report statistics. Using "-" as + output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with a '-' for instance. This option must + appear last. Any other options afterward will be ignored. + + -h, -help + A short usage summary. + + -H, -longhelp + A summary of all the possible options. + + -version + Print the version number (as major.minor.revision) and exit. + + -lossless + Encode the image without any loss. For images with fully trans- + parent area, the invisible pixel values (R/G/B or Y/U/V) will be + preserved only if the -exact option is used. + + -near_lossless int + Specify the level of near-lossless image preprocessing. This + option adjusts pixel values to help compressibility, but has + minimal impact on the visual quality. It triggers lossless com- + pression mode automatically. The range is 0 (maximum preprocess- + ing) to 100 (no preprocessing, the default). The typical value + is around 60. Note that lossy with -q 100 can at times yield + better results. + + -q float + Specify the compression factor for RGB channels between 0 and + 100. The default is 75. + In case of lossy compression (default), a small factor produces + a smaller file with lower quality. Best quality is achieved by + using a value of 100. + In case of lossless compression (specified by the -lossless + option), a small factor enables faster compression speed, but + produces a larger file. Maximum compression is achieved by + using a value of 100. + + -z int Switch on lossless compression mode with the specified level + between 0 and 9, with level 0 being the fastest, 9 being the + slowest. Fast mode produces larger file size than slower ones. A + good default is -z 6. This option is actually a shortcut for + some predefined settings for quality and method. If options -q + or -m are subsequently used, they will invalidate the effect of + this option. + + -alpha_q int + Specify the compression factor for alpha compression between 0 + and 100. Lossless compression of alpha is achieved using a + value of 100, while the lower values result in a lossy compres- + sion. The default is 100. + + -preset string + Specify a set of pre-defined parameters to suit a particular + type of source material. Possible values are: default, photo, + picture, drawing, icon, text. Since -preset overwrites the other + parameters' values (except the -q one), this option should + preferably appear first in the order of the arguments. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. When higher values are used, the encoder will spend + more time inspecting additional encoding possibilities and + decide on the quality gain. Lower value can result in faster + processing time at the expense of larger file size and lower + compression quality. + + -crop x_position y_position width height + Crop the source to a rectangle with top-left corner at coordi- + nates (x_position, y_position) and size width x height. This + cropping area must be fully contained within the source rectan- + gle. Note: the cropping is applied before any scaling. + + -resize width height + Resize the source to a rectangle with size width x height. If + either (but not both) of the width or height parameters is 0, + the value will be calculated preserving the aspect-ratio. Note: + scaling is applied after cropping. + + -mt Use multi-threading for encoding, if possible. + + -low_memory + Reduce memory usage of lossy encoding by saving four times the + compressed size (typically). This will make the encoding slower + and the output slightly different in size and distortion. This + flag is only effective for methods 3 and up, and is off by + default. Note that leaving this flag off will have some side + effects on the bitstream: it forces certain bitstream features + like number of partitions (forced to 1). Note that a more + detailed report of bitstream size is printed by cwebp when using + this option. + + + LOSSY OPTIONS + These options are only effective when doing lossy encoding (the + default, with or without alpha). + + + -size int + Specify a target size (in bytes) to try and reach for the com- + pressed output. The compressor will make several passes of par- + tial encoding in order to get as close as possible to this tar- + get. If both -size and -psnr are used, -size value will prevail. + + -psnr float + Specify a target PSNR (in dB) to try and reach for the com- + pressed output. The compressor will make several passes of par- + tial encoding in order to get as close as possible to this tar- + get. If both -size and -psnr are used, -size value will prevail. + + -pass int + Set a maximum number of passes to use during the dichotomy used + by options -size or -psnr. Maximum value is 10, default is 1. + If options -size or -psnr were used, but -pass wasn't specified, + a default value of '6' passes will be used. + + -qrange int int + Specifies the permissible interval for the quality factor. This + is particularly useful when using multi-pass (-size or -psnr + options). Default is 0 100. If the quality factor is outside + this range, it will be clamped. If the minimum value must be + less or equal to the maximum one. + + -af Turns auto-filter on. This algorithm will spend additional time + optimizing the filtering strength to reach a well-balanced qual- + ity. + + -jpeg_like + Change the internal parameter mapping to better match the + expected size of JPEG compression. This flag will generally pro- + duce an output file of similar size to its JPEG equivalent (for + the same -q setting), but with less visual distortion. + + + Advanced options: + + + -f int Specify the strength of the deblocking filter, between 0 (no + filtering) and 100 (maximum filtering). A value of 0 will turn + off any filtering. Higher value will increase the strength of + the filtering process applied after decoding the picture. The + higher the value the smoother the picture will appear. Typical + values are usually in the range of 20 to 50. + + -sharpness int + Specify the sharpness of the filtering (if used). Range is 0 + (sharpest) to 7 (least sharp). Default is 0. + + -strong + Use strong filtering (if filtering is being used thanks to the + -f option). Strong filtering is on by default. + + -nostrong + Disable strong filtering (if filtering is being used thanks to + the -f option) and use simple filtering instead. + + -sharp_yuv + Use more accurate and sharper RGB->YUV conversion if needed. + Note that this process is slower than the default 'fast' + RGB->YUV conversion. + + -sns int + Specify the amplitude of the spatial noise shaping. Spatial + noise shaping (or sns for short) refers to a general collection + of built-in algorithms used to decide which area of the picture + should use relatively less bits, and where else to better trans- + fer these bits. The possible range goes from 0 (algorithm is + off) to 100 (the maximal effect). The default value is 50. + + -segments int + Change the number of partitions to use during the segmentation + of the sns algorithm. Segments should be in range 1 to 4. + Default value is 4. This option has no effect for methods 3 and + up, unless -low_memory is used. + + -partition_limit int + Degrade quality by limiting the number of bits used by some mac- + roblocks. Range is 0 (no degradation, the default) to 100 (full + degradation). Useful values are usually around 30-70 for moder- + ately large images. In the VP8 format, the so-called control + partition has a limit of 512k and is used to store the following + information: whether the macroblock is skipped, which segment it + belongs to, whether it is coded as intra 4x4 or intra 16x16 + mode, and finally the prediction modes to use for each of the + sub-blocks. For a very large image, 512k only leaves room to + few bits per 16x16 macroblock. The absolute minimum is 4 bits + per macroblock. Skip, segment, and mode information can use up + almost all these 4 bits (although the case is unlikely), which + is problematic for very large images. The partition_limit factor + controls how frequently the most bit-costly mode (intra 4x4) + will be used. This is useful in case the 512k limit is reached + and the following message is displayed: Error code: 6 (PARTI- + TION0_OVERFLOW: Partition #0 is too big to fit 512k). If using + -partition_limit is not enough to meet the 512k constraint, one + should use less segments in order to save more header bits per + macroblock. See the -segments option. + + + LOGGING OPTIONS + These options control the level of output: + + -v Print extra information (encoding time in particular). + + -print_psnr + Compute and report average PSNR (Peak-Signal-To-Noise ratio). + + -print_ssim + Compute and report average SSIM (structural similarity metric, + see https://en.wikipedia.org/wiki/SSIM for additional details). + + -print_lsim + Compute and report local similarity metric (sum of lowest error + amongst the collocated pixel neighbors). + + -progress + Report encoding progress in percent. + + -quiet Do not print anything. + + -short Only print brief information (output file size and PSNR) for + testing purposes. + + -map int + Output additional ASCII-map of encoding information. Possible + map values range from 1 to 6. This is only meant to help debug- + ging. + + + ADDITIONAL OPTIONS + More advanced options are: + + -s width height + Specify that the input file actually consists of raw Y'CbCr sam- + ples following the ITU-R BT.601 recommendation, in 4:2:0 linear + format. The luma plane has size width x height. + + -pre int + Specify some preprocessing steps. Using a value of '2' will + trigger quality-dependent pseudo-random dithering during + RGBA->YUVA conversion (lossy compression only). + + -alpha_filter string + Specify the predictive filtering method for the alpha plane. One + of 'none', 'fast' or 'best', in increasing complexity and slow- + ness order. Default is 'fast'. Internally, alpha filtering is + performed using four possible predictions (none, horizontal, + vertical, gradient). The 'best' mode will try each mode in turn + and pick the one which gives the smaller size. The 'fast' mode + will just try to form an a priori guess without testing all + modes. + + -alpha_method int + Specify the algorithm used for alpha compression: 0 or 1. Algo- + rithm 0 denotes no compression, 1 uses WebP lossless format for + compression. The default is 1. + + -exact Preserve RGB values in transparent area. The default is off, to + help compressibility. + + -blend_alpha int + This option blends the alpha channel (if present) with the + source using the background color specified in hexadecimal as + 0xrrggbb. The alpha channel is afterward reset to the opaque + value 255. + + -noalpha + Using this option will discard the alpha channel. + + -hint string + Specify the hint about input image type. Possible values are: + photo, picture or graph. + + -metadata string + A comma separated list of metadata to copy from the input to the + output if present. Valid values: all, none, exif, icc, xmp. + The default is none. + + Note: each input format may not support all combinations. + + -noasm Disable all assembly optimizations. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + cwebp -q 50 -lossless picture.png -o picture_lossless.webp + cwebp -q 70 picture_with_alpha.png -o picture_with_alpha.webp + cwebp -sns 70 -f 50 -size 60000 picture.png -o picture.webp + cwebp -o picture.webp -- ---picture.png + + +AUTHORS + cwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + dwebp(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + March 17, 2022 CWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/dwebp.html b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/dwebp.html new file mode 100644 index 00000000..96fc69db --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/dwebp.html @@ -0,0 +1,386 @@ + + + + + + + + + +DWEBP + + + + +

DWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

dwebp − +decompress a WebP file to an image file

+ + +

SYNOPSIS

+ + +

dwebp +[options] input_file.webp

+ + +

DESCRIPTION

+ + +

This manual +page documents the dwebp command.

+ +

dwebp +decompresses WebP files into PNG, PAM, PPM or PGM images. +Note: Animated WebP files are not supported.

+ + +

OPTIONS

+ + +

The basic +options are:

+ + + + + + + + +
+ + + +

−h

+ + +

Print usage +summary.

+
+ +

−version

+ +

Print the version number (as +major.minor.revision) and exit.

+ +

−o +string

+ +

Specify the name of the output +file (as PNG format by default). Using "-" as +output name will direct output to ’stdout’.

+ +

−− +string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’−’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "−", the data will be read +from stdin instead of a file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

−bmp

+ + +

Change the output +format to uncompressed BMP.

+ + + +

−tiff

+ + +

Change the output +format to uncompressed TIFF.

+ + + +

−pam

+ + +

Change the output +format to PAM (retains alpha).

+ + + +

−ppm

+ + +

Change the output +format to PPM (discards alpha).

+ + + +

−pgm

+ + +

Change the output +format to PGM. The output consists of luma/chroma samples +instead of RGB, using the IMC4 layout. This option is mainly +for verification and debugging purposes.

+ + + +

−yuv

+ + +

Change the output +format to raw YUV. The output consists of +luma/chroma-U/chroma-V samples instead of RGB, saved +sequentially as individual planes. This option is mainly for +verification and debugging purposes.

+ +

−nofancy

+ +

Don’t use the fancy +upscaler for YUV420. This may lead to jaggy edges +(especially the red ones), but should be faster.

+ +

−nofilter

+ +

Don’t use the in-loop +filtering process even if it is required by the bitstream. +This may produce visible blocks on the non-compliant output, +but it will make the decoding faster.

+ +

−dither +strength

+ +

Specify a dithering +strength between 0 and 100. Dithering is a +post-processing effect applied to chroma components in lossy +compression. It helps by smoothing gradients and avoiding +banding artifacts.

+ +

−alpha_dither

+ +

If the compressed file contains +a transparency plane that was quantized during compression, +this flag will allow dithering the reconstructed plane in +order to generate smoother transparency gradients.

+ +

−nodither

+ +

Disable all dithering +(default).

+ + + + + + + + +
+ + + +

−mt

+ + +

Use multi-threading +for decoding, if possible.

+
+ +

−crop +x_position y_position width height

+ +

Crop the decoded picture to a +rectangle with top-left corner at coordinates +(x_position, y_position) and size width +x height. This cropping area must be fully contained +within the source rectangle. The top-left corner will be +snapped to even coordinates if needed. This option is meant +to reduce the memory needed for cropping large images. Note: +the cropping is applied before any scaling.

+ + + + + + + +
+ + + +

−flip

+ + +

Flip decoded image +vertically (can be useful for OpenGL textures for +instance).

+ +

−resize, +−scale width height

+ +

Rescale the decoded picture to +dimension width x height. This option is +mostly intended to reducing the memory needed to decode +large images, when only a small version is needed +(thumbnail, preview, etc.). Note: scaling is applied +after cropping. If either (but not both) of the +width or height parameters is 0, the value +will be calculated preserving the aspect-ratio.

+ + + + + + + + + + + + + + + + + +
+ + + +

−quiet

+ + +

Do not print +anything.

+ + + +

−v

+ + +

Print extra +information (decoding time in particular).

+ + + +

−noasm

+ + +

Disable all +assembly optimizations.

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

dwebp +picture.webp −o output.png
+dwebp picture.webp −ppm −o output.ppm
+dwebp −o output.ppm −− +−−−picture.webp
+cat picture.webp | dwebp −o − −− +− > output.ppm

+ + +

AUTHORS

+ + +

dwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ + +

SEE ALSO

+ + + +

cwebp(1), +gif2webp(1), webpmux(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+ +

Output file +format details
+PAM: http://netpbm.sourceforge.net/doc/pam.html
+PGM: http://netpbm.sourceforge.net/doc/pgm.html
+PPM: http://netpbm.sourceforge.net/doc/ppm.html
+PNG: http://www.libpng.org/pub/png/png-sitemap.html#info

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/dwebp.txt b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/dwebp.txt new file mode 100644 index 00000000..de82c2e4 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/dwebp.txt @@ -0,0 +1,142 @@ +DWEBP(1) DWEBP(1) + + + +NAME + dwebp - decompress a WebP file to an image file + +SYNOPSIS + dwebp [options] input_file.webp + +DESCRIPTION + This manual page documents the dwebp command. + + dwebp decompresses WebP files into PNG, PAM, PPM or PGM images. Note: + Animated WebP files are not supported. + +OPTIONS + The basic options are: + + -h Print usage summary. + + -version + Print the version number (as major.minor.revision) and exit. + + -o string + Specify the name of the output file (as PNG format by default). + Using "-" as output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must + appear last. Any other options afterward will be ignored. If + the input file is "-", the data will be read from stdin instead + of a file. + + -bmp Change the output format to uncompressed BMP. + + -tiff Change the output format to uncompressed TIFF. + + -pam Change the output format to PAM (retains alpha). + + -ppm Change the output format to PPM (discards alpha). + + -pgm Change the output format to PGM. The output consists of + luma/chroma samples instead of RGB, using the IMC4 layout. This + option is mainly for verification and debugging purposes. + + -yuv Change the output format to raw YUV. The output consists of + luma/chroma-U/chroma-V samples instead of RGB, saved sequen- + tially as individual planes. This option is mainly for verifica- + tion and debugging purposes. + + -nofancy + Don't use the fancy upscaler for YUV420. This may lead to jaggy + edges (especially the red ones), but should be faster. + + -nofilter + Don't use the in-loop filtering process even if it is required + by the bitstream. This may produce visible blocks on the non- + compliant output, but it will make the decoding faster. + + -dither strength + Specify a dithering strength between 0 and 100. Dithering is a + post-processing effect applied to chroma components in lossy + compression. It helps by smoothing gradients and avoiding band- + ing artifacts. + + -alpha_dither + If the compressed file contains a transparency plane that was + quantized during compression, this flag will allow dithering the + reconstructed plane in order to generate smoother transparency + gradients. + + -nodither + Disable all dithering (default). + + -mt Use multi-threading for decoding, if possible. + + -crop x_position y_position width height + Crop the decoded picture to a rectangle with top-left corner at + coordinates (x_position, y_position) and size width x height. + This cropping area must be fully contained within the source + rectangle. The top-left corner will be snapped to even coordi- + nates if needed. This option is meant to reduce the memory + needed for cropping large images. Note: the cropping is applied + before any scaling. + + -flip Flip decoded image vertically (can be useful for OpenGL textures + for instance). + + -resize, -scale width height + Rescale the decoded picture to dimension width x height. This + option is mostly intended to reducing the memory needed to + decode large images, when only a small version is needed (thumb- + nail, preview, etc.). Note: scaling is applied after cropping. + If either (but not both) of the width or height parameters is 0, + the value will be calculated preserving the aspect-ratio. + + -quiet Do not print anything. + + -v Print extra information (decoding time in particular). + + -noasm Disable all assembly optimizations. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + dwebp picture.webp -o output.png + dwebp picture.webp -ppm -o output.ppm + dwebp -o output.ppm -- ---picture.webp + cat picture.webp | dwebp -o - -- - > output.ppm + + +AUTHORS + dwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), gif2webp(1), webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + Output file format details + PAM: http://netpbm.sourceforge.net/doc/pam.html + PGM: http://netpbm.sourceforge.net/doc/pgm.html + PPM: http://netpbm.sourceforge.net/doc/ppm.html + PNG: http://www.libpng.org/pub/png/png-sitemap.html#info + + + + November 17, 2021 DWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/gif2webp.html b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/gif2webp.html new file mode 100644 index 00000000..f441e8d2 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/gif2webp.html @@ -0,0 +1,341 @@ + + + + + + + + + +GIF2WEBP + + + + +

GIF2WEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

gif2webp +− Convert a GIF image to WebP

+ + +

SYNOPSIS

+ + + +

gif2webp +[options] input_file.gif −o +output_file.webp

+ + +

DESCRIPTION

+ + +

This manual +page documents the gif2webp command.

+ + +

gif2webp +converts a GIF image to a WebP image.

+ + +

OPTIONS

+ + +

The basic +options are:
+−o
string

+ +

Specify the name of the output +WebP file. If omitted, gif2webp will perform +conversion but only report statistics. Using +"−" as output name will direct output to +’stdout’.

+ +

−− +string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’−’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "−", the data will be read +from stdin instead of a file.

+ +

−h, +−help

+ +

Usage information.

+ +

−version

+ +

Print the version number (as +major.minor.revision) and exit.

+ + + + + + + + + + + + +
+ + + +

−lossy

+ + +

Encode the image +using lossy compression.

+ + + +

−mixed

+ + +

Mixed compression +mode: optimize compression of the image by picking either +lossy or lossless compression for each frame +heuristically.

+ +

−q +float

+ +

Specify the compression factor +for RGB channels between 0 and 100. The default is 75.
+In case of lossless compression (default), a small factor +enables faster compression speed, but produces a larger +file. Maximum compression is achieved by using a value of +100.
+In case of lossy compression (specified by the −lossy +option), a small factor produces a smaller file with lower +quality. Best quality is achieved by using a value of +100.

+ + + + + + + +
+ + +

−m +int

+ + +

Specify the +compression method to use. This parameter controls the trade +off between encoding speed and the compressed file size and +quality. Possible values range from 0 to 6. Default value is +4. When higher values are used, the encoder will spend more +time inspecting additional encoding possibilities and decide +on the quality gain. Lower value can result is faster +processing time at the expense of larger file size and lower +compression quality.

+ +

−min_size

+ +

Encode image to achieve +smallest size. This disables key frame insertion and picks +the dispose method resulting in the smallest output for each +frame. It uses lossless compression by default, but can be +combined with −q, −m, −lossy or +−mixed options.

+ +

−kmin int +
+−kmax
int

+ +

Specify the minimum and maximum +distance between consecutive key frames (independently +decodable frames) in the output animation. The tool will +insert some key frames into the output animation as needed +so that this criteria is satisfied.
+A ’kmax’ value of 0 will turn off insertion of +key frames. A ’kmax’ value of 1 will result in +all frames being key frames. ’kmin’ value is not +taken into account in both these special cases. Typical +values are in the range 3 to 30. Default values are kmin = +9, kmax = 17 for lossless compression and kmin = 3, kmax = 5 +for lossy compression.
+These two options are relevant only for animated images with +large number of frames (>50).
+When lower values are used, more frames will be converted to +key frames. This may lead to smaller number of frames +required to decode a frame on average, thereby improving the +decoding performance. But this may lead to slightly bigger +file sizes. Higher values may lead to worse decoding +performance, but smaller file sizes.
+Some restrictions:
+(i) kmin < kmax,
+(ii) kmin >= kmax / 2 + 1 and
+(iii) kmax - kmin <= 30.
+If any of these restrictions are not met, they will be +enforced automatically.

+ +

−metadata +string

+ +

A comma separated list of +metadata to copy from the input to the output if present. +Valid values: all, none, icc, +xmp. The default is xmp.

+ + + + + + + + + + + + +
+ + +

−f +int

+ + +

For lossy encoding +only (specified by the −lossy option). Specify the +strength of the deblocking filter, between 0 (no filtering) +and 100 (maximum filtering). A value of 0 will turn off any +filtering. Higher value will increase the strength of the +filtering process applied after decoding the picture. The +higher the value the smoother the picture will appear. +Typical values are usually in the range of 20 to 50.

+ + + +

−mt

+ + +

Use multi-threading +for encoding, if possible.

+ + +

−loop_compatibility

+ +

If enabled, handle the loop +information in a compatible fashion for Chrome version prior +to M62 (inclusive) and Firefox.

+ + + + + + + + + + + + + + +
+ + + +

−v

+ + +

Print extra +information.

+
+ + + +

−quiet

+ + +

Do not print +anything.

+
+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

gif2webp +picture.gif −o picture.webp
+gif2webp −q 70 picture.gif −o picture.webp
+gif2webp −lossy −m 3 picture.gif −o +picture_lossy.webp
+gif2webp −lossy −f 50 picture.gif −o +picture.webp
+gif2webp −q 70 −o picture.webp −− +−−−picture.gif
+cat picture.gif | gif2webp −o − −− +− > output.webp

+ + +

AUTHORS

+ + + +

gif2webp +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Urvang Joshi <urvang@google.com>, +for the Debian project (and may be used by others).

+ + +

SEE ALSO

+ + + +

cwebp(1), +dwebp(1), webpmux(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/gif2webp.txt b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/gif2webp.txt new file mode 100644 index 00000000..724953e8 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/gif2webp.txt @@ -0,0 +1,152 @@ +GIF2WEBP(1) GIF2WEBP(1) + + + +NAME + gif2webp - Convert a GIF image to WebP + +SYNOPSIS + gif2webp [options] input_file.gif -o output_file.webp + +DESCRIPTION + This manual page documents the gif2webp command. + + gif2webp converts a GIF image to a WebP image. + +OPTIONS + The basic options are: + + -o string + Specify the name of the output WebP file. If omitted, gif2webp + will perform conversion but only report statistics. Using "-" + as output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must + appear last. Any other options afterward will be ignored. If + the input file is "-", the data will be read from stdin instead + of a file. + + -h, -help + Usage information. + + -version + Print the version number (as major.minor.revision) and exit. + + -lossy Encode the image using lossy compression. + + -mixed Mixed compression mode: optimize compression of the image by + picking either lossy or lossless compression for each frame + heuristically. + + -q float + Specify the compression factor for RGB channels between 0 and + 100. The default is 75. + In case of lossless compression (default), a small factor + enables faster compression speed, but produces a larger file. + Maximum compression is achieved by using a value of 100. + In case of lossy compression (specified by the -lossy option), a + small factor produces a smaller file with lower quality. Best + quality is achieved by using a value of 100. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. When higher values are used, the encoder will spend + more time inspecting additional encoding possibilities and + decide on the quality gain. Lower value can result is faster + processing time at the expense of larger file size and lower + compression quality. + + -min_size + Encode image to achieve smallest size. This disables key frame + insertion and picks the dispose method resulting in the smallest + output for each frame. It uses lossless compression by default, + but can be combined with -q, -m, -lossy or -mixed options. + + -kmin int + + -kmax int + Specify the minimum and maximum distance between consecutive key + frames (independently decodable frames) in the output animation. + The tool will insert some key frames into the output animation + as needed so that this criteria is satisfied. + A 'kmax' value of 0 will turn off insertion of key frames. A + 'kmax' value of 1 will result in all frames being key frames. + 'kmin' value is not taken into account in both these special + cases. Typical values are in the range 3 to 30. Default values + are kmin = 9, kmax = 17 for lossless compression and kmin = 3, + kmax = 5 for lossy compression. + These two options are relevant only for animated images with + large number of frames (>50). + When lower values are used, more frames will be converted to key + frames. This may lead to smaller number of frames required to + decode a frame on average, thereby improving the decoding per- + formance. But this may lead to slightly bigger file sizes. + Higher values may lead to worse decoding performance, but + smaller file sizes. + Some restrictions: + (i) kmin < kmax, + (ii) kmin >= kmax / 2 + 1 and + (iii) kmax - kmin <= 30. + If any of these restrictions are not met, they will be enforced + automatically. + + -metadata string + A comma separated list of metadata to copy from the input to the + output if present. Valid values: all, none, icc, xmp. The + default is xmp. + + -f int For lossy encoding only (specified by the -lossy option). Spec- + ify the strength of the deblocking filter, between 0 (no filter- + ing) and 100 (maximum filtering). A value of 0 will turn off + any filtering. Higher value will increase the strength of the + filtering process applied after decoding the picture. The higher + the value the smoother the picture will appear. Typical values + are usually in the range of 20 to 50. + + -mt Use multi-threading for encoding, if possible. + + -loop_compatibility + If enabled, handle the loop information in a compatible fashion + for Chrome version prior to M62 (inclusive) and Firefox. + + -v Print extra information. + + -quiet Do not print anything. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + gif2webp picture.gif -o picture.webp + gif2webp -q 70 picture.gif -o picture.webp + gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp + gif2webp -lossy -f 50 picture.gif -o picture.webp + gif2webp -q 70 -o picture.webp -- ---picture.gif + cat picture.gif | gif2webp -o - -- - > output.webp + + +AUTHORS + gif2webp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Urvang Joshi , for + the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), dwebp(1), webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 GIF2WEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/img2webp.html b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/img2webp.html new file mode 100644 index 00000000..0a18f3be --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/img2webp.html @@ -0,0 +1,245 @@ + + + + + + + + + +IMG2WEBP + + + + +

IMG2WEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+FILE-LEVEL OPTIONS
+PER-FRAME OPTIONS
+EXAMPLE
+BUGS
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

img2webp +− create animated WebP file from a sequence of input +images.

+ + +

SYNOPSIS

+ + + +

img2webp +[file_options] [[frame_options] frame_file]...
+img2webp argument_file_name

+ + +

DESCRIPTION

+ + +

This manual +page documents the img2webp command.

+ + +

img2webp +compresses a sequence of images using the animated WebP +format. Input images can either be PNG, JPEG, TIFF or WebP. +If a single file name (not starting with the character +’−’) is supplied as the argument, the +command line arguments are actually tokenized from this +file. This allows for easy scripting or using a large number +of arguments.

+ + +

FILE-LEVEL OPTIONS

+ + +

The file-level +options are applied at the beginning of the compression +process, before the input frames are read.
+−o
string

+ +

Specify the name of the output +WebP file.

+ +

−min_size

+ +

Encode images to achieve +smallest size. This disables key frame insertion and picks +the parameters resulting in the smallest output for each +frame. It uses lossless compression by default, but can be +combined with −q, −m, −lossy or +−mixed options.

+ +

−kmin int +
+−kmax
int

+ +

Specify the minimum and maximum +distance between consecutive key frames (independently +decodable frames) in the output animation. The tool will +insert some key frames into the output animation as needed +so that this criteria is satisfied.
+−mixed
Mixed compression mode: optimize +compression of the image by picking either lossy or lossless +compression for each frame heuristically. This global option +disables the local option -lossy and -lossless +.

+ +

−loop +int

+ +

Specifies the number of times +the animation should loop. Using ’0’ means +’loop indefinitely’.

+ + + + + + + + +
+ + + +

−v

+ + +

Be more +verbose.

+
+ +

−h, +−help

+ +

A short usage summary.

+ +

−version

+ +

Print the version numbers of +the relevant libraries used.

+ + +

PER-FRAME OPTIONS

+ + +

The per-frame +options are applied for the images following as arguments in +the command line. They can be modified any number of times +preceding each particular input image.

+ + + + + + + + +
+ + +

−d +int

+ + +

Specify the image +duration in milliseconds.

+
+ +

−lossless, +−lossy

+ +

Compress the next image(s) +using lossless or lossy compression mode. The default mode +is lossless.

+ +

−q +float

+ +

Specify the compression factor +between 0 and 100. The default is 75.

+ + + + + + + +
+ + +

−m +int

+ + +

Specify the +compression method to use. This parameter controls the trade +off between encoding speed and the compressed file size and +quality. Possible values range from 0 to 6. Default value is +4.

+ + +

EXAMPLE

+ + +

img2webp -loop +2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

AUTHORS

+ + + +

img2webp +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ + +

SEE ALSO

+ + + +

webpmux(1), +gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/img2webp.txt b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/img2webp.txt new file mode 100644 index 00000000..1ff3de42 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/img2webp.txt @@ -0,0 +1,108 @@ +IMG2WEBP(1) IMG2WEBP(1) + + + +NAME + img2webp - create animated WebP file from a sequence of input images. + +SYNOPSIS + img2webp [file_options] [[frame_options] frame_file]... + img2webp argument_file_name + +DESCRIPTION + This manual page documents the img2webp command. + + img2webp compresses a sequence of images using the animated WebP for- + mat. Input images can either be PNG, JPEG, TIFF or WebP. If a single + file name (not starting with the character '-') is supplied as the + argument, the command line arguments are actually tokenized from this + file. This allows for easy scripting or using a large number of argu- + ments. + +FILE-LEVEL OPTIONS + The file-level options are applied at the beginning of the compression + process, before the input frames are read. + + -o string + Specify the name of the output WebP file. + + -min_size + Encode images to achieve smallest size. This disables key frame + insertion and picks the parameters resulting in the smallest + output for each frame. It uses lossless compression by default, + but can be combined with -q, -m, -lossy or -mixed options. + + -kmin int + + -kmax int + Specify the minimum and maximum distance between consecutive key + frames (independently decodable frames) in the output animation. + The tool will insert some key frames into the output animation + as needed so that this criteria is satisfied. + -mixed Mixed compression mode: optimize compression of the image + by picking either lossy or lossless compression for each frame + heuristically. This global option disables the local option + -lossy and -lossless . + + -loop int + Specifies the number of times the animation should loop. Using + '0' means 'loop indefinitely'. + + -v Be more verbose. + + -h, -help + A short usage summary. + + -version + Print the version numbers of the relevant libraries used. + + +PER-FRAME OPTIONS + The per-frame options are applied for the images following as arguments + in the command line. They can be modified any number of times preceding + each particular input image. + + -d int Specify the image duration in milliseconds. + + -lossless, -lossy + Compress the next image(s) using lossless or lossy compression + mode. The default mode is lossless. + + -q float + Specify the compression factor between 0 and 100. The default is + 75. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. + + +EXAMPLE + img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +AUTHORS + img2webp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + webpmux(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + January 5, 2022 IMG2WEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/tools.md b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/tools.md new file mode 100644 index 00000000..853af819 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/tools.md @@ -0,0 +1,512 @@ +# WebP tools + +## Encoding tool + +The examples/ directory contains tools for encoding (cwebp) and decoding (dwebp) +images. + +The easiest use should look like: + +```shell +cwebp input.png -q 80 -o output.webp +``` + +which will convert the input file to a WebP file using a quality factor of 80 on +a 0->100 scale (0 being the lowest quality, 100 being the best. Default value is +75). + +You might want to try the `-lossless` flag too, which will compress the source +(in RGBA format) without any loss. The `-q` quality parameter will in this case +control the amount of processing time spent trying to make the output file as +small as possible. + +A longer list of options is available using the `-longhelp` command line flag: + +```shell +> cwebp -longhelp +Usage: + cwebp [-preset <...>] [options] in_file [-o out_file] +``` + +If input size (-s) for an image is not specified, it is assumed to be a PNG, +JPEG, TIFF or WebP file. Note: Animated PNG and WebP files are not supported. + +Options: + +``` +-h / -help ............. short help +-H / -longhelp ......... long help +-q ............. quality factor (0:small..100:big), default=75 +-alpha_q ......... transparency-compression quality (0..100), + default=100 +-preset ....... preset setting, one of: + default, photo, picture, + drawing, icon, text + -preset must come first, as it overwrites other parameters +-z ............... activates lossless preset with given + level in [0:fast, ..., 9:slowest] + +-m ............... compression method (0=fast, 6=slowest), default=4 +-segments ........ number of segments to use (1..4), default=4 +-size ............ target size (in bytes) +-psnr .......... target PSNR (in dB. typically: 42) + +-s ......... input size (width x height) for YUV +-sns ............. spatial noise shaping (0:off, 100:max), default=50 +-f ............... filter strength (0=off..100), default=60 +-sharpness ....... filter sharpness (0:most .. 7:least sharp), default=0 +-strong ................ use strong filter instead of simple (default) +-nostrong .............. use simple filter instead of strong +-sharp_yuv ............. use sharper (and slower) RGB->YUV conversion +-partition_limit . limit quality to fit the 512k limit on + the first partition (0=no degradation ... 100=full) +-pass ............ analysis pass number (1..10) +-qrange .... specifies the permissible quality range + (default: 0 100) +-crop .. crop picture with the given rectangle +-resize ........ resize picture (*after* any cropping) +-mt .................... use multi-threading if available +-low_memory ............ reduce memory usage (slower encoding) +-map ............. print map of extra info +-print_psnr ............ prints averaged PSNR distortion +-print_ssim ............ prints averaged SSIM distortion +-print_lsim ............ prints local-similarity distortion +-d .......... dump the compressed output (PGM file) +-alpha_method .... transparency-compression method (0..1), default=1 +-alpha_filter . predictive filtering for alpha plane, + one of: none, fast (default) or best +-exact ................. preserve RGB values in transparent area, default=off +-blend_alpha ..... blend colors against background color + expressed as RGB values written in + hexadecimal, e.g. 0xc0e0d0 for red=0xc0 + green=0xe0 and blue=0xd0 +-noalpha ............... discard any transparency information +-lossless .............. encode image losslessly, default=off +-near_lossless ... use near-lossless image + preprocessing (0..100=off), default=100 +-hint ......... specify image characteristics hint, + one of: photo, picture or graph + +-metadata ..... comma separated list of metadata to + copy from the input to the output if present. + Valid values: all, none (default), exif, icc, xmp + +-short ................. condense printed message +-quiet ................. don't print anything +-version ............... print version number and exit +-noasm ................. disable all assembly optimizations +-v ..................... verbose, e.g. print encoding/decoding times +-progress .............. report encoding progress +``` + +Experimental Options: + +``` +-jpeg_like ............. roughly match expected JPEG size +-af .................... auto-adjust filter strength +-pre ............. pre-processing filter +``` + +The main options you might want to try in order to further tune the visual +quality are: + +-preset -sns -f -m + +Namely: + +* `preset` will set up a default encoding configuration targeting a particular + type of input. It should appear first in the list of options, so that + subsequent options can take effect on top of this preset. Default value is + 'default'. +* `sns` will progressively turn on (when going from 0 to 100) some additional + visual optimizations (like: segmentation map re-enforcement). This option + will balance the bit allocation differently. It tries to take bits from the + "easy" parts of the picture and use them in the "difficult" ones instead. + Usually, raising the sns value (at fixed -q value) leads to larger files, + but with better quality. Typical value is around '75'. +* `f` option directly links to the filtering strength used by the codec's + in-loop processing. The higher the value, the smoother the highly-compressed + area will look. This is particularly useful when aiming at very small files. + Typical values are around 20-30. Note that using the option + -strong/-nostrong will change the type of filtering. Use "-f 0" to turn + filtering off. +* `m` controls the trade-off between encoding speed and quality. Default is 4. + You can try -m 5 or -m 6 to explore more (time-consuming) encoding + possibilities. A lower value will result in faster encoding at the expense + of quality. + +## Decoding tool + +There is a decoding sample in examples/dwebp.c which will take a .webp file and +decode it to a PNG image file (amongst other formats). This is simply to +demonstrate the use of the API. You can verify the file test.webp decodes to +exactly the same as test_ref.ppm by using: + +```shell +cd examples +./dwebp test.webp -ppm -o test.ppm +diff test.ppm test_ref.ppm +``` + +The full list of options is available using -h: + +```shell +> dwebp -h +Usage: dwebp in_file [options] [-o out_file] +``` + +Decodes the WebP image file to PNG format [Default]. Note: Animated WebP files +are not supported. + +Use following options to convert into alternate image formats: + +``` +-pam ......... save the raw RGBA samples as a color PAM +-ppm ......... save the raw RGB samples as a color PPM +-bmp ......... save as uncompressed BMP format +-tiff ........ save as uncompressed TIFF format +-pgm ......... save the raw YUV samples as a grayscale PGM + file with IMC4 layout +-yuv ......... save the raw YUV samples in flat layout +``` + +Other options are: + +``` +-version ..... print version number and exit +-nofancy ..... don't use the fancy YUV420 upscaler +-nofilter .... disable in-loop filtering +-nodither .... disable dithering +-dither .. dithering strength (in 0..100) +-alpha_dither use alpha-plane dithering if needed +-mt .......... use multi-threading +-crop ... crop output with the given rectangle +-resize ......... resize output (*after* any cropping) +-flip ........ flip the output vertically +-alpha ....... only save the alpha plane +-incremental . use incremental decoding (useful for tests) +-h ........... this help message +-v ........... verbose (e.g. print encoding/decoding times) +-quiet ....... quiet mode, don't print anything +-noasm ....... disable all assembly optimizations +``` + +## WebP file analysis tool + +`webpinfo` can be used to print out the chunk level structure and bitstream +header information of WebP files. It can also check if the files are of valid +WebP format. + +Usage: + +```shell +webpinfo [options] in_files +``` + +Note: there could be multiple input files; options must come before input files. + +Options: + +``` +-version ........... Print version number and exit. +-quiet ............. Do not show chunk parsing information. +-diag .............. Show parsing error diagnosis. +-summary ........... Show chunk stats summary. +-bitstream_info .... Parse bitstream header. +``` + +## Visualization tool + +There's a little self-serve visualization tool called 'vwebp' under the +examples/ directory. It uses OpenGL to open a simple drawing window and show a +decoded WebP file. It's not yet integrated in the automake build system, but you +can try to manually compile it using the recommendations below. + +Usage: + +```shell +vwebp in_file [options] +``` + +Decodes the WebP image file and visualize it using OpenGL + +Options are: + +``` +-version ..... print version number and exit +-noicc ....... don't use the icc profile if present +-nofancy ..... don't use the fancy YUV420 upscaler +-nofilter .... disable in-loop filtering +-dither dithering strength (0..100), default=50 +-noalphadither disable alpha plane dithering +-usebgcolor .. display background color +-mt .......... use multi-threading +-info ........ print info +-h ........... this help message +``` + +Keyboard shortcuts: + +``` +'c' ................ toggle use of color profile +'b' ................ toggle background color display +'i' ................ overlay file information +'d' ................ disable blending & disposal (debug) +'q' / 'Q' / ESC .... quit +``` + +### Building + +Prerequisites: + +1. OpenGL & OpenGL Utility Toolkit (GLUT) + + Linux: `sudo apt-get install freeglut3-dev mesa-common-dev` + + Mac + Xcode: These libraries should be available in the OpenGL / GLUT + frameworks. + + Windows: http://freeglut.sourceforge.net/index.php#download + +2. (Optional) qcms (Quick Color Management System) + + 1. Download qcms from Mozilla / Chromium: + https://hg.mozilla.org/mozilla-central/file/0e7639e3bdfb/gfx/qcms + https://source.chromium.org/chromium/chromium/src/+/main:third_party/qcms/;drc=d4a2f8e1ed461d8fc05ed88d1ae2dc94c9773825 + 2. Build and archive the source files as libqcms.a / qcms.lib + 3. Update makefile.unix / Makefile.vc + 1. Define WEBP_HAVE_QCMS + 2. Update include / library paths to reference the qcms directory. + +Build using makefile.unix / Makefile.vc: + +```shell +$ make -f makefile.unix examples/vwebp +> nmake /f Makefile.vc CFG=release-static \ + ../obj/x64/release-static/bin/vwebp.exe +``` + +## Animation creation tool + +The utility `img2webp` can turn a sequence of input images (PNG, JPEG, ...) into +an animated WebP file. It offers fine control over duration, encoding modes, +etc. + +Usage: + +```shell +img2webp [file_options] [[frame_options] frame_file]... +``` + +File-level options (only used at the start of compression): + +``` +-min_size ............ minimize size +-loop .......... loop count (default: 0, = infinite loop) +-kmax .......... maximum number of frame between key-frames + (0=only keyframes) +-kmin .......... minimum number of frame between key-frames + (0=disable key-frames altogether) +-mixed ............... use mixed lossy/lossless automatic mode +-v ................... verbose mode +-h ................... this help +-version ............. print version number and exit +``` + +Per-frame options (only used for subsequent images input): + +``` +-d ............. frame duration in ms (default: 100) +-lossless ........... use lossless mode (default) +-lossy ... ........... use lossy mode +-q ........... quality +-m ............. method to use +``` + +example: `img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp` + +Note: if a single file name is passed as the argument, the arguments will be +tokenized from this file. The file name must not start with the character '-'. + +## Animated GIF conversion + +Animated GIF files can be converted to WebP files with animation using the +gif2webp utility available under examples/. The files can then be viewed using +vwebp. + +Usage: + +```shell +gif2webp [options] gif_file -o webp_file +``` + +Options: + +``` +-h / -help ............. this help +-lossy ................. encode image using lossy compression +-mixed ................. for each frame in the image, pick lossy + or lossless compression heuristically +-q ............. quality factor (0:small..100:big) +-m ............... compression method (0=fast, 6=slowest) +-min_size .............. minimize output size (default:off) + lossless compression by default; can be + combined with -q, -m, -lossy or -mixed + options +-kmin ............ min distance between key frames +-kmax ............ max distance between key frames +-f ............... filter strength (0=off..100) +-metadata ..... comma separated list of metadata to + copy from the input to the output if present + Valid values: all, none, icc, xmp (default) +-loop_compatibility .... use compatibility mode for Chrome + version prior to M62 (inclusive) +-mt .................... use multi-threading if available + +-version ............... print version number and exit +-v ..................... verbose +-quiet ................. don't print anything +``` + +### Building + +With the libgif development files installed, gif2webp can be built using +makefile.unix: + +```shell +$ make -f makefile.unix examples/gif2webp +``` + +or using autoconf: + +```shell +$ ./configure --enable-everything +$ make +``` + +## Comparison of animated images + +Test utility anim_diff under examples/ can be used to compare two animated +images (each can be GIF or WebP). + +Usage: + +```shell +anim_diff [options] +``` + +Options: + +``` +-dump_frames dump decoded frames in PAM format +-min_psnr ... minimum per-frame PSNR +-raw_comparison ..... if this flag is not used, RGB is + premultiplied before comparison +-max_diff ..... maximum allowed difference per channel + between corresponding pixels in subsequent + frames +-h .................. this help +-version ............ print version number and exit +``` + +### Building + +With the libgif development files installed, anim_diff can be built using +makefile.unix: + +```shell +$ make -f makefile.unix examples/anim_diff +``` + +or using autoconf: + +```shell +$ ./configure --enable-everything +$ make +``` + +## WebP Mux tool + +The examples/ directory contains a tool (webpmux) for manipulating WebP files. +The webpmux tool can be used to create an extended format WebP file and also to +extract or strip relevant data from such a file. + +A list of options is available using the -help command line flag: + +```shell +> webpmux -help +Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT + webpmux -set SET_OPTIONS INPUT -o OUTPUT + webpmux -duration DURATION_OPTIONS [-duration ...] + INPUT -o OUTPUT + webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT + webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT] + [-bgcolor BACKGROUND_COLOR] -o OUTPUT + webpmux -info INPUT + webpmux [-h|-help] + webpmux -version + webpmux argument_file_name + +GET_OPTIONS: + Extract relevant data: + icc get ICC profile + exif get EXIF metadata + xmp get XMP metadata + frame n get nth frame + +SET_OPTIONS: + Set color profile/metadata/parameters: + loop LOOP_COUNT set the loop count + bgcolor BACKGROUND_COLOR set the animation background color + icc file.icc set ICC profile + exif file.exif set EXIF metadata + xmp file.xmp set XMP metadata + where: 'file.icc' contains the ICC profile to be set, + 'file.exif' contains the EXIF metadata to be set + 'file.xmp' contains the XMP metadata to be set + +DURATION_OPTIONS: + Set duration of selected frames: + duration set duration for all frames + duration,frame set duration of a particular frame + duration,start,end set duration of frames in the + interval [start,end]) + where: 'duration' is the duration in milliseconds + 'start' is the start frame index + 'end' is the inclusive end frame index + The special 'end' value '0' means: last frame. + +STRIP_OPTIONS: + Strip color profile/metadata: + icc strip ICC profile + exif strip EXIF metadata + xmp strip XMP metadata + +FRAME_OPTIONS(i): + Create animation: + file_i +di[+xi+yi[+mi[bi]]] + where: 'file_i' is the i'th animation frame (WebP format), + 'di' is the pause duration before next frame, + 'xi','yi' specify the image offset for this frame, + 'mi' is the dispose method for this frame (0 or 1), + 'bi' is the blending method for this frame (+b or -b) + +LOOP_COUNT: + Number of times to repeat the animation. + Valid range is 0 to 65535 [Default: 0 (infinite)]. + +BACKGROUND_COLOR: + Background color of the canvas. + A,R,G,B + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying + the Alpha, Red, Green and Blue component values respectively + [Default: 255,255,255,255] + +INPUT & OUTPUT are in WebP format. + +Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be +valid. + +Note: if a single file name is passed as the argument, the arguments will be +tokenized from this file. The file name must not start with the character '-'. +``` diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/vwebp.html b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/vwebp.html new file mode 100644 index 00000000..4d91ec86 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/vwebp.html @@ -0,0 +1,288 @@ + + + + + + + + + +VWEBP + + + + +

VWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+KEYBOARD SHORTCUTS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

vwebp − +decompress a WebP file and display it in a window

+ + +

SYNOPSIS

+ + +

vwebp +[options] input_file.webp

+ + +

DESCRIPTION

+ + +

This manual +page documents the vwebp command.

+ +

vwebp +decompresses a WebP file and displays it in a window using +OpenGL.

+ + +

OPTIONS

+ + + + + + + + + +
+ + + +

−h

+ + +

Print usage +summary.

+
+ +

−version

+ +

Print version number and +exit.

+ + + + + + + + +
+ + + +

−noicc

+ + +

Don’t use the +ICC profile if present.

+
+ +

−nofancy

+ +

Don’t use the fancy +YUV420 upscaler.

+ +

−nofilter

+ +

Disable in-loop filtering.

+ +

−dither +strength

+ +

Specify a dithering +strength between 0 and 100. Dithering is a +post-processing effect applied to chroma components in lossy +compression. It helps by smoothing gradients and avoiding +banding artifacts. Default: 50.

+ + +

−noalphadither

+ +

By default, quantized +transparency planes are dithered during decompression, to +smooth the gradients. This flag will prevent this +dithering.

+ +

−usebgcolor

+ +

Fill transparent areas with the +bitstream’s own background color instead of +checkerboard only. Default is white for non-animated +images.

+ + + + + + + + + + + + +
+ + + +

−mt

+ + +

Use multi-threading +for decoding, if possible.

+ + + +

−info

+ + +

Display image +information on top of the decoded image.

+ +

−− +string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’−’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "−", the data will be read +from stdin instead of a file.

+ + +

KEYBOARD SHORTCUTS

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

’c’

+ + +

Toggle use of color +profile.

+ + + +

’b’

+ + +

Toggle display of +background color.

+ + + +

’i’

+ + +

Overlay file +information.

+ + + +

’d’

+ + +

Disable blending +and disposal process, for debugging purposes.

+ +

’q’ / +’Q’ / ESC

+ +

Quit.

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

vwebp +picture.webp
+vwebp picture.webp -mt -dither 0
+vwebp −− −−−picture.webp

+ + +

AUTHORS

+ + +

vwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written for the Debian project (and may be used by +others).

+ + +

SEE ALSO

+ + + +

dwebp(1) +
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/vwebp.txt b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/vwebp.txt new file mode 100644 index 00000000..1295fa2f --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/vwebp.txt @@ -0,0 +1,103 @@ +VWEBP(1) VWEBP(1) + + + +NAME + vwebp - decompress a WebP file and display it in a window + +SYNOPSIS + vwebp [options] input_file.webp + +DESCRIPTION + This manual page documents the vwebp command. + + vwebp decompresses a WebP file and displays it in a window using + OpenGL. + +OPTIONS + -h Print usage summary. + + -version + Print version number and exit. + + -noicc Don't use the ICC profile if present. + + -nofancy + Don't use the fancy YUV420 upscaler. + + -nofilter + Disable in-loop filtering. + + -dither strength + Specify a dithering strength between 0 and 100. Dithering is a + post-processing effect applied to chroma components in lossy + compression. It helps by smoothing gradients and avoiding band- + ing artifacts. Default: 50. + + -noalphadither + By default, quantized transparency planes are dithered during + decompression, to smooth the gradients. This flag will prevent + this dithering. + + -usebgcolor + Fill transparent areas with the bitstream's own background color + instead of checkerboard only. Default is white for non-animated + images. + + -mt Use multi-threading for decoding, if possible. + + -info Display image information on top of the decoded image. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must + appear last. Any other options afterward will be ignored. If + the input file is "-", the data will be read from stdin instead + of a file. + + + + KEYBOARD SHORTCUTS + + 'c' Toggle use of color profile. + + 'b' Toggle display of background color. + + 'i' Overlay file information. + + 'd' Disable blending and disposal process, for debugging purposes. + + 'q' / 'Q' / ESC + Quit. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + vwebp picture.webp + vwebp picture.webp -mt -dither 0 + vwebp -- ---picture.webp + + +AUTHORS + vwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written for the Debian project (and may be used by + others). + + +SEE ALSO + dwebp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 VWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpinfo.html b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpinfo.html new file mode 100644 index 00000000..4da49385 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpinfo.html @@ -0,0 +1,184 @@ + + + + + + + + + +WEBPINFO + + + + +

WEBPINFO

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+INPUT
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

webpinfo +− print out the chunk level structure of WebP files +along with basic integrity checks.

+ + +

SYNOPSIS

+ + + +

webpinfo +OPTIONS INPUT
+webpinfo +[−h|−help|−H|−longhelp]

+ + +

DESCRIPTION

+ + +

This manual +page documents the webpinfo command.

+ + +

webpinfo +can be used to print out the chunk level structure and +bitstream header information of WebP files. It can also +check if the files are of valid WebP format.

+ + +

OPTIONS

+ + + +

−version

+ +

Print the version number (as +major.minor.revision) and exit.

+ + + + + + + + + + + + + + +
+ + + +

−quiet

+ + +

Do not show chunk +parsing information.

+
+ + + +

−diag

+ + +

Show parsing error +diagnosis.

+
+ +

−summary

+ +

Show chunk stats summary.

+ + +

−bitstream_info

+ +

Parse bitstream header.

+ +

−h, +−help

+ +

A short usage summary.

+ +

−H, +−longhelp

+ +

Detailed usage +instructions.

+ + +

INPUT

+ + +

Input files in +WebP format. Input files must come last, following options +(if any). There can be multiple input files.

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

webpinfo +−h
+webpinfo −diag −summary input_file.webp
+webpinfo −bitstream_info input_file_1.webp +input_file_2.webp
+webpinfo *.webp

+ + +

AUTHORS

+ + + +

webpinfo +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Hui Su <huisu@google.com>, for the +Debian project (and may be used by others).

+ + +

SEE ALSO

+ + + +

webpmux(1) +
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpinfo.txt b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpinfo.txt new file mode 100644 index 00000000..3229dd1c --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpinfo.txt @@ -0,0 +1,78 @@ +WEBPINFO(1) WEBPINFO(1) + + + +NAME + webpinfo - print out the chunk level structure of WebP files along with + basic integrity checks. + +SYNOPSIS + webpinfo OPTIONS INPUT + webpinfo [-h|-help|-H|-longhelp] + + +DESCRIPTION + This manual page documents the webpinfo command. + + webpinfo can be used to print out the chunk level structure and bit- + stream header information of WebP files. It can also check if the files + are of valid WebP format. + + +OPTIONS + -version + Print the version number (as major.minor.revision) and exit. + + -quiet Do not show chunk parsing information. + + -diag Show parsing error diagnosis. + + -summary + Show chunk stats summary. + + -bitstream_info + Parse bitstream header. + + -h, -help + A short usage summary. + + -H, -longhelp + Detailed usage instructions. + + +INPUT + Input files in WebP format. Input files must come last, following + options (if any). There can be multiple input files. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + webpinfo -h + webpinfo -diag -summary input_file.webp + webpinfo -bitstream_info input_file_1.webp input_file_2.webp + webpinfo *.webp + + +AUTHORS + webpinfo is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Hui Su , for the + Debian project (and may be used by others). + + +SEE ALSO + webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 WEBPINFO(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpmux.html b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpmux.html new file mode 100644 index 00000000..24a1d968 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpmux.html @@ -0,0 +1,436 @@ + + + + + + + + + +WEBPMUX + + + + +

WEBPMUX

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

webpmux − +create animated WebP files from non−animated WebP +images, extract frames from animated WebP images, and manage +XMP/EXIF metadata and ICC profile.

+ + +

SYNOPSIS

+ + +

webpmux +−get GET_OPTIONS INPUT −o +OUTPUT
+webpmux −set
SET_OPTIONS INPUT +−o OUTPUT
+webpmux −strip
STRIP_OPTIONS INPUT +−o OUTPUT
+webpmux −frame
FRAME_OPTIONS [ +−frame ... ] [ −loop LOOP_COUNT +]

+ +

[ −bgcolor +BACKGROUND_COLOR ] −o OUTPUT

+ +

webpmux −duration +DURATION OPTIONS [ −duration ... ] +INPUT −o OUTPUT
+webpmux −info
INPUT
+webpmux [−h|−help]
+webpmux −version
+webpmux argument_file_name

+ + +

DESCRIPTION

+ + +

This manual +page documents the webpmux command.

+ +

webpmux +can be used to create/extract from animated WebP files, as +well as to add/extract/strip XMP/EXIF metadata and ICC +profile. If a single file name (not starting with the +character ’−’) is supplied as the +argument, the command line arguments are actually tokenized +from this file. This allows for easy scripting or using a +large number of arguments.

+ + +

OPTIONS

+ + +

GET_OPTIONS +(−get):

+ + + + + + + + + + + + + + + + + + + + +
+ + +

icc

+ + +

Get ICC profile.

+
+ + +

exif

+ + +

Get EXIF +metadata.

+
+ + +

xmp

+ + +

Get XMP +metadata.

+
+ +

frame n

+ +

Get nth frame from an animated +image. (n = 0 has a special meaning: last frame).

+ +

SET_OPTIONS +(−set)
+loop
loop_count

+ +

Set loop count on an animated +file.

+ +

Where: +’loop_count’ must be in range [0, 65535]. +
+bgcolor
A,R,G,B

+ +

Set the background color of the +canvas on an animated file.

+ +

where: +’A’, ’R’, ’G’ and +’B’ are integers in the range 0 to 255 +specifying the Alpha, Red, Green and Blue component values +respectively.
+icc
file.icc

+ +

Set ICC profile.

+ +

Where: +’file.icc’ contains the ICC profile to be set. +
+exif
file.exif

+ +

Set EXIF metadata.

+ +

Where: +’file.exif’ contains the EXIF metadata to be +set.
+xmp
file.xmp

+ +

Set XMP metadata.

+ +

Where: +’file.xmp’ contains the XMP metadata to be +set.

+ + +

STRIP_OPTIONS +(−strip)

+ + + + + + + + + + + + + + + + + + + + +
+ + +

icc

+ + +

Strip ICC profile.

+
+ + +

exif

+ + +

Strip EXIF +metadata.

+
+ + +

xmp

+ + +

Strip XMP +metadata.

+
+ + +

DURATION_OPTIONS +(−duration)
+Amend the duration of a specific interval of frames. This +option is only effective on animated WebP and has no effect +on a single-frame file.
+duration[,start[,end]]

+ +

Where:
+duration
is the duration for the interval in +milliseconds (mandatory). Must be non-negative.
+start
is the starting frame index of the interval +(optional).
+end
is the ending frame index (inclusive) of the +interval (optional).

+ +

The three typical usages of +this option are:

+ +

-duration d
+set the duration to ’d’ for the whole animation. +
+-duration d,f

+set the duration of frame ’f’ to +’d’.
+-duration d,start,end

+set the duration to ’d’ for the whole +[start,end] interval.

+ +

Note that the +frames outside of the [start, end] interval will
+remain untouched.
+The ’end’ value ’0’ has the special +meaning ’last frame of the animation’.

+ +

Reminder:

+ +

frame indexing starts at +’1’.

+ + +

FRAME_OPTIONS +(−frame)
+Create an animated WebP file from multiple +(non−animated) WebP images.
+file_i +di[+xi+yi[+mi[bi]]]

+ +

Where: ’file_i’ is +the i’th frame (WebP format), +’xi’,’yi’ specify the image offset +for this frame, ’di’ is the pause duration +before next frame, ’mi’ is the dispose method +for this frame (0 for NONE or 1 for BACKGROUND) and +’bi’ is the blending method for this frame (+b +for BLEND or −b for NO_BLEND). Argument +’bi’ can be omitted and will default to +b +(BLEND). Also, ’mi’ can be omitted if +’bi’ is omitted and will default to 0 (NONE). +Finally, if ’mi’ and ’bi’ are +omitted then ’xi’ and ’yi’ can be +omitted and will default to +0+0.

+ +

−loop n

+ +

Loop the frames n number of +times. 0 indicates the frames should loop forever. Valid +range is 0 to 65535 [Default: 0 (infinite)].

+ +

−bgcolor +A,R,G,B

+ +

Background color of the canvas. +
+where: ’A’, ’R’, ’G’ and +’B’ are integers in the range 0 to 255 +specifying the Alpha, Red, Green and Blue component values +respectively [Default: 255,255,255,255].

+ +

INPUT +
+Input file in WebP format.

+ +

OUTPUT +(−o)
+Output file in WebP format.

+ +

Note: +
+The nature of EXIF, XMP and ICC data is not checked and is +assumed to
+be valid.

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

Add ICC +profile:
+webpmux −set icc image_profile.icc in.webp −o +icc_container.webp

+ +

Extract ICC +profile:
+webpmux −get icc icc_container.webp −o +image_profile.icc

+ +

Strip ICC +profile:
+webpmux −strip icc icc_container.webp −o +without_icc.webp

+ +

Add XMP +metadata:
+webpmux −set xmp image_metadata.xmp in.webp −o +xmp_container.webp

+ +

Extract XMP +metadata:
+webpmux −get xmp xmp_container.webp −o +image_metadata.xmp

+ +

Strip XMP +metadata:
+webpmux −strip xmp xmp_container.webp −o +without_xmp.webp

+ +

Add EXIF +metadata:
+webpmux −set exif image_metadata.exif in.webp −o +exif_container.webp

+ +

Extract EXIF +metadata:
+webpmux −get exif exif_container.webp −o +image_metadata.exif

+ +

Strip EXIF +metadata:
+webpmux −strip exif exif_container.webp −o +without_exif.webp

+ +

Create an +animated WebP file from 3 (non−animated) WebP images: +
+webpmux −frame 1.webp +100 −frame 2.webp ++100+50+50

+ +

−frame 3.webp ++100+50+50+1+b −loop 10 −bgcolor 255,255,255,255 +
+−o anim_container.webp

+ +

Get the 2nd +frame from an animated WebP file:
+webpmux −get frame 2 anim_container.webp −o +frame_2.webp

+ +

Using +−get/−set/−strip with input file name +starting with ’−’:
+webpmux −set icc image_profile.icc −o +icc_container.webp −− +−−−in.webp
+webpmux −get icc −o image_profile.icc +−− −−−icc_container.webp
+webpmux −strip icc −o without_icc.webp +−− −−−icc_container.webp

+ + +

AUTHORS

+ + +

webpmux +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Vikas Arora +<vikaas.arora@gmail.com>, for the Debian project (and +may be used by others).

+ + +

SEE ALSO

+ + + +

cwebp(1), +dwebp(1), gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpmux.txt b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpmux.txt new file mode 100644 index 00000000..7473be8e --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/doc/webpmux.txt @@ -0,0 +1,216 @@ +WEBPMUX(1) WEBPMUX(1) + + + +NAME + webpmux - create animated WebP files from non-animated WebP images, + extract frames from animated WebP images, and manage XMP/EXIF metadata + and ICC profile. + +SYNOPSIS + webpmux -get GET_OPTIONS INPUT -o OUTPUT + webpmux -set SET_OPTIONS INPUT -o OUTPUT + webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT + webpmux -frame FRAME_OPTIONS [ -frame ... ] [ -loop LOOP_COUNT ] + [ -bgcolor BACKGROUND_COLOR ] -o OUTPUT + webpmux -duration DURATION OPTIONS [ -duration ... ] INPUT -o OUTPUT + webpmux -info INPUT + webpmux [-h|-help] + webpmux -version + webpmux argument_file_name + +DESCRIPTION + This manual page documents the webpmux command. + + webpmux can be used to create/extract from animated WebP files, as well + as to add/extract/strip XMP/EXIF metadata and ICC profile. If a single + file name (not starting with the character '-') is supplied as the + argument, the command line arguments are actually tokenized from this + file. This allows for easy scripting or using a large number of argu- + ments. + +OPTIONS + GET_OPTIONS (-get): + icc Get ICC profile. + + exif Get EXIF metadata. + + xmp Get XMP metadata. + + frame n + Get nth frame from an animated image. (n = 0 has a special mean- + ing: last frame). + + + SET_OPTIONS (-set) + loop loop_count + Set loop count on an animated file. + + Where: 'loop_count' must be in range [0, 65535]. + + bgcolor A,R,G,B + Set the background color of the canvas on an animated file. + + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 speci- + fying the Alpha, Red, Green and Blue component values respectively. + + icc file.icc + Set ICC profile. + + Where: 'file.icc' contains the ICC profile to be set. + + exif file.exif + Set EXIF metadata. + + Where: 'file.exif' contains the EXIF metadata to be set. + + xmp file.xmp + Set XMP metadata. + + Where: 'file.xmp' contains the XMP metadata to be set. + + + STRIP_OPTIONS (-strip) + icc Strip ICC profile. + + exif Strip EXIF metadata. + + xmp Strip XMP metadata. + + + DURATION_OPTIONS (-duration) + Amend the duration of a specific interval of frames. This option is + only effective on animated WebP and has no effect on a single-frame + file. + + duration[,start[,end]] + Where: + duration is the duration for the interval in milliseconds + (mandatory). Must be non-negative. + start is the starting frame index of the interval (optional). + end is the ending frame index (inclusive) of the interval + (optional). + + The three typical usages of this option are: + -duration d + set the duration to 'd' for the whole animation. + -duration d,f + set the duration of frame 'f' to 'd'. + -duration d,start,end + set the duration to 'd' for the whole [start,end] interval. + + + Note that the frames outside of the [start, end] interval will + remain untouched. + The 'end' value '0' has the special meaning 'last frame of the + animation'. + + Reminder: + frame indexing starts at '1'. + + + FRAME_OPTIONS (-frame) + Create an animated WebP file from multiple (non-animated) WebP images. + + file_i +di[+xi+yi[+mi[bi]]] + Where: 'file_i' is the i'th frame (WebP format), 'xi','yi' spec- + ify the image offset for this frame, 'di' is the pause duration + before next frame, 'mi' is the dispose method for this frame (0 + for NONE or 1 for BACKGROUND) and 'bi' is the blending method + for this frame (+b for BLEND or -b for NO_BLEND). Argument 'bi' + can be omitted and will default to +b (BLEND). Also, 'mi' can + be omitted if 'bi' is omitted and will default to 0 (NONE). + Finally, if 'mi' and 'bi' are omitted then 'xi' and 'yi' can be + omitted and will default to +0+0. + + -loop n + Loop the frames n number of times. 0 indicates the frames should + loop forever. Valid range is 0 to 65535 [Default: 0 (infi- + nite)]. + + -bgcolor A,R,G,B + Background color of the canvas. + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 + specifying the Alpha, Red, Green and Blue component values + respectively [Default: 255,255,255,255]. + + + INPUT + Input file in WebP format. + + + OUTPUT (-o) + Output file in WebP format. + + + Note: + The nature of EXIF, XMP and ICC data is not checked and is assumed to + be valid. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + Add ICC profile: + webpmux -set icc image_profile.icc in.webp -o icc_container.webp + + Extract ICC profile: + webpmux -get icc icc_container.webp -o image_profile.icc + + Strip ICC profile: + webpmux -strip icc icc_container.webp -o without_icc.webp + + Add XMP metadata: + webpmux -set xmp image_metadata.xmp in.webp -o xmp_container.webp + + Extract XMP metadata: + webpmux -get xmp xmp_container.webp -o image_metadata.xmp + + Strip XMP metadata: + webpmux -strip xmp xmp_container.webp -o without_xmp.webp + + Add EXIF metadata: + webpmux -set exif image_metadata.exif in.webp -o exif_container.webp + + Extract EXIF metadata: + webpmux -get exif exif_container.webp -o image_metadata.exif + + Strip EXIF metadata: + webpmux -strip exif exif_container.webp -o without_exif.webp + + Create an animated WebP file from 3 (non-animated) WebP images: + webpmux -frame 1.webp +100 -frame 2.webp +100+50+50 + -frame 3.webp +100+50+50+1+b -loop 10 -bgcolor 255,255,255,255 + -o anim_container.webp + + Get the 2nd frame from an animated WebP file: + webpmux -get frame 2 anim_container.webp -o frame_2.webp + + Using -get/-set/-strip with input file name starting with '-': + webpmux -set icc image_profile.icc -o icc_container.webp -- ---in.webp + webpmux -get icc -o image_profile.icc -- ---icc_container.webp + webpmux -strip icc -o without_icc.webp -- ---icc_container.webp + + +AUTHORS + webpmux is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Vikas Arora , + for the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), dwebp(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 WEBPMUX(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/decode.h b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/decode.h new file mode 100644 index 00000000..d9824750 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/decode.h @@ -0,0 +1,503 @@ +// Copyright 2010 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Main decoding functions for WebP images. +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_DECODE_H_ +#define WEBP_WEBP_DECODE_H_ + +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_DECODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum VP8StatusCode VP8StatusCode; +// typedef enum WEBP_CSP_MODE WEBP_CSP_MODE; +typedef struct WebPRGBABuffer WebPRGBABuffer; +typedef struct WebPYUVABuffer WebPYUVABuffer; +typedef struct WebPDecBuffer WebPDecBuffer; +typedef struct WebPIDecoder WebPIDecoder; +typedef struct WebPBitstreamFeatures WebPBitstreamFeatures; +typedef struct WebPDecoderOptions WebPDecoderOptions; +typedef struct WebPDecoderConfig WebPDecoderConfig; + +// Return the decoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetDecoderVersion(void); + +// Retrieve basic header information: width, height. +// This function will also validate the header, returning true on success, +// false otherwise. '*width' and '*height' are only valid on successful return. +// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. +WEBP_EXTERN int WebPGetInfo(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Decodes WebP images pointed to by 'data' and returns RGBA samples, along +// with the dimensions in *width and *height. The ordering of samples in +// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). +// The returned pointer should be deleted calling WebPFree(). +// Returns NULL in case of error. +WEBP_EXTERN uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. +// If the bitstream contains transparency, it is ignored. +WEBP_EXTERN uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, + int* width, int* height); + + +// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer +// returned is the Y samples buffer. Upon return, *u and *v will point to +// the U and V chroma data. These U and V buffers need NOT be passed to +// WebPFree(), unlike the returned Y luma one. The dimension of the U and V +// planes are both (*width + 1) / 2 and (*height + 1)/ 2. +// Upon return, the Y buffer has a stride returned as '*stride', while U and V +// have a common stride returned as '*uv_stride'. +// Return NULL in case of error. +// (*) Also named Y'CbCr. See: https://en.wikipedia.org/wiki/YCbCr +WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, + int* width, int* height, + uint8_t** u, uint8_t** v, + int* stride, int* uv_stride); + +// These five functions are variants of the above ones, that decode the image +// directly into a pre-allocated buffer 'output_buffer'. The maximum storage +// available in this buffer is indicated by 'output_buffer_size'. If this +// storage is not sufficient (or an error occurred), NULL is returned. +// Otherwise, output_buffer is returned, for convenience. +// The parameter 'output_stride' specifies the distance (in bytes) +// between scanlines. Hence, output_buffer_size is expected to be at least +// output_stride x picture-height. +WEBP_EXTERN uint8_t* WebPDecodeRGBAInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeARGBInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeBGRAInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// RGB and BGR variants. Here too the transparency information, if present, +// will be dropped and ignored. +WEBP_EXTERN uint8_t* WebPDecodeRGBInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeBGRInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly +// into pre-allocated luma/chroma plane buffers. This function requires the +// strides to be passed: one for the luma plane and one for each of the +// chroma ones. The size of each plane buffer is passed as 'luma_size', +// 'u_size' and 'v_size' respectively. +// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred +// during decoding (or because some buffers were found to be too small). +WEBP_EXTERN uint8_t* WebPDecodeYUVInto( + const uint8_t* data, size_t data_size, + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride); + +//------------------------------------------------------------------------------ +// Output colorspaces and buffer + +// Colorspaces +// Note: the naming describes the byte-ordering of packed samples in memory. +// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,... +// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels. +// RGBA-4444 and RGB-565 colorspaces are represented by following byte-order: +// RGBA-4444: [r3 r2 r1 r0 g3 g2 g1 g0], [b3 b2 b1 b0 a3 a2 a1 a0], ... +// RGB-565: [r4 r3 r2 r1 r0 g5 g4 g3], [g2 g1 g0 b4 b3 b2 b1 b0], ... +// In the case WEBP_SWAP_16BITS_CSP is defined, the bytes are swapped for +// these two modes: +// RGBA-4444: [b3 b2 b1 b0 a3 a2 a1 a0], [r3 r2 r1 r0 g3 g2 g1 g0], ... +// RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ... + +typedef enum WEBP_CSP_MODE { + MODE_RGB = 0, MODE_RGBA = 1, + MODE_BGR = 2, MODE_BGRA = 3, + MODE_ARGB = 4, MODE_RGBA_4444 = 5, + MODE_RGB_565 = 6, + // RGB-premultiplied transparent modes (alpha value is preserved) + MODE_rgbA = 7, + MODE_bgrA = 8, + MODE_Argb = 9, + MODE_rgbA_4444 = 10, + // YUV modes must come after RGB ones. + MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 + MODE_LAST = 13 +} WEBP_CSP_MODE; + +// Some useful macros: +static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) { + return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb || + mode == MODE_rgbA_4444); +} + +static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) { + return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB || + mode == MODE_RGBA_4444 || mode == MODE_YUVA || + WebPIsPremultipliedMode(mode)); +} + +static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { + return (mode < MODE_YUV); +} + +//------------------------------------------------------------------------------ +// WebPDecBuffer: Generic structure for describing the output sample buffer. + +struct WebPRGBABuffer { // view as RGBA + uint8_t* rgba; // pointer to RGBA samples + int stride; // stride in bytes from one scanline to the next. + size_t size; // total size of the *rgba buffer. +}; + +struct WebPYUVABuffer { // view as YUVA + uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples + int y_stride; // luma stride + int u_stride, v_stride; // chroma strides + int a_stride; // alpha stride + size_t y_size; // luma plane size + size_t u_size, v_size; // chroma planes size + size_t a_size; // alpha-plane size +}; + +// Output buffer +struct WebPDecBuffer { + WEBP_CSP_MODE colorspace; // Colorspace. + int width, height; // Dimensions. + int is_external_memory; // If non-zero, 'internal_memory' pointer is not + // used. If value is '2' or more, the external + // memory is considered 'slow' and multiple + // read/write will be avoided. + union { + WebPRGBABuffer RGBA; + WebPYUVABuffer YUVA; + } u; // Nameless union of buffer parameters. + uint32_t pad[4]; // padding for later use + + uint8_t* private_memory; // Internally allocated memory (only when + // is_external_memory is 0). Should not be used + // externally, but accessed via the buffer union. +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPInitDecBufferInternal(WebPDecBuffer*, int); + +// Initialize the structure as empty. Must be called before any other use. +// Returns false in case of version mismatch +static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) { + return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); +} + +// Free any memory associated with the buffer. Must always be called last. +// Note: doesn't free the 'buffer' structure itself. +WEBP_EXTERN void WebPFreeDecBuffer(WebPDecBuffer* buffer); + +//------------------------------------------------------------------------------ +// Enumeration of the status codes + +typedef enum VP8StatusCode { + VP8_STATUS_OK = 0, + VP8_STATUS_OUT_OF_MEMORY, + VP8_STATUS_INVALID_PARAM, + VP8_STATUS_BITSTREAM_ERROR, + VP8_STATUS_UNSUPPORTED_FEATURE, + VP8_STATUS_SUSPENDED, + VP8_STATUS_USER_ABORT, + VP8_STATUS_NOT_ENOUGH_DATA +} VP8StatusCode; + +//------------------------------------------------------------------------------ +// Incremental decoding +// +// This API allows streamlined decoding of partial data. +// Picture can be incrementally decoded as data become available thanks to the +// WebPIDecoder object. This object can be left in a SUSPENDED state if the +// picture is only partially decoded, pending additional input. +// Code example: +// +// WebPInitDecBuffer(&output_buffer); +// output_buffer.colorspace = mode; +// ... +// WebPIDecoder* idec = WebPINewDecoder(&output_buffer); +// while (additional_data_is_available) { +// // ... (get additional data in some new_data[] buffer) +// status = WebPIAppend(idec, new_data, new_data_size); +// if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) { +// break; // an error occurred. +// } +// +// // The above call decodes the current available buffer. +// // Part of the image can now be refreshed by calling +// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. +// } +// WebPIDelete(idec); + +// Creates a new incremental decoder with the supplied buffer parameter. +// This output_buffer can be passed NULL, in which case a default output buffer +// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' +// is kept, which means that the lifespan of 'output_buffer' must be larger than +// that of the returned WebPIDecoder object. +// The supplied 'output_buffer' content MUST NOT be changed between calls to +// WebPIAppend() or WebPIUpdate() unless 'output_buffer.is_external_memory' is +// not set to 0. In such a case, it is allowed to modify the pointers, size and +// stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain +// within valid bounds. +// All other fields of WebPDecBuffer MUST remain constant between calls. +// Returns NULL if the allocation failed. +WEBP_EXTERN WebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer); + +// This function allocates and initializes an incremental-decoder object, which +// will output the RGB/A samples specified by 'csp' into a preallocated +// buffer 'output_buffer'. The size of this buffer is at least +// 'output_buffer_size' and the stride (distance in bytes between two scanlines) +// is specified by 'output_stride'. +// Additionally, output_buffer can be passed NULL in which case the output +// buffer will be allocated automatically when the decoding starts. The +// colorspace 'csp' is taken into account for allocating this buffer. All other +// parameters are ignored. +// Returns NULL if the allocation failed, or if some parameters are invalid. +WEBP_EXTERN WebPIDecoder* WebPINewRGB( + WEBP_CSP_MODE csp, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// This function allocates and initializes an incremental-decoder object, which +// will output the raw luma/chroma samples into a preallocated planes if +// supplied. The luma plane is specified by its pointer 'luma', its size +// 'luma_size' and its stride 'luma_stride'. Similarly, the chroma-u plane +// is specified by the 'u', 'u_size' and 'u_stride' parameters, and the chroma-v +// plane by 'v' and 'v_size'. And same for the alpha-plane. The 'a' pointer +// can be pass NULL in case one is not interested in the transparency plane. +// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied. +// In this case, the output buffer will be automatically allocated (using +// MODE_YUVA) when decoding starts. All parameters are then ignored. +// Returns NULL if the allocation failed or if a parameter is invalid. +WEBP_EXTERN WebPIDecoder* WebPINewYUVA( + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride, + uint8_t* a, size_t a_size, int a_stride); + +// Deprecated version of the above, without the alpha plane. +// Kept for backward compatibility. +WEBP_EXTERN WebPIDecoder* WebPINewYUV( + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride); + +// Deletes the WebPIDecoder object and associated memory. Must always be called +// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. +WEBP_EXTERN void WebPIDelete(WebPIDecoder* idec); + +// Copies and decodes the next available data. Returns VP8_STATUS_OK when +// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more +// data is expected. Returns error in other cases. +WEBP_EXTERN VP8StatusCode WebPIAppend( + WebPIDecoder* idec, const uint8_t* data, size_t data_size); + +// A variant of the above function to be used when data buffer contains +// partial data from the beginning. In this case data buffer is not copied +// to the internal memory. +// Note that the value of the 'data' pointer can change between calls to +// WebPIUpdate, for instance when the data buffer is resized to fit larger data. +WEBP_EXTERN VP8StatusCode WebPIUpdate( + WebPIDecoder* idec, const uint8_t* data, size_t data_size); + +// Returns the RGB/A image decoded so far. Returns NULL if output params +// are not initialized yet. The RGB/A output type corresponds to the colorspace +// specified during call to WebPINewDecoder() or WebPINewRGB(). +// *last_y is the index of last decoded row in raster scan order. Some pointers +// (*last_y, *width etc.) can be NULL if corresponding information is not +// needed. The values in these pointers are only valid on successful (non-NULL) +// return. +WEBP_EXTERN uint8_t* WebPIDecGetRGB( + const WebPIDecoder* idec, int* last_y, + int* width, int* height, int* stride); + +// Same as above function to get a YUVA image. Returns pointer to the luma +// plane or NULL in case of error. If there is no alpha information +// the alpha pointer '*a' will be returned NULL. +WEBP_EXTERN uint8_t* WebPIDecGetYUVA( + const WebPIDecoder* idec, int* last_y, + uint8_t** u, uint8_t** v, uint8_t** a, + int* width, int* height, int* stride, int* uv_stride, int* a_stride); + +// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the +// alpha information (if present). Kept for backward compatibility. +static WEBP_INLINE uint8_t* WebPIDecGetYUV( + const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, + int* width, int* height, int* stride, int* uv_stride) { + return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, + stride, uv_stride, NULL); +} + +// Generic call to retrieve information about the displayable area. +// If non NULL, the left/right/width/height pointers are filled with the visible +// rectangular area so far. +// Returns NULL in case the incremental decoder object is in an invalid state. +// Otherwise returns the pointer to the internal representation. This structure +// is read-only, tied to WebPIDecoder's lifespan and should not be modified. +WEBP_EXTERN const WebPDecBuffer* WebPIDecodedArea( + const WebPIDecoder* idec, int* left, int* top, int* width, int* height); + +//------------------------------------------------------------------------------ +// Advanced decoding parametrization +// +// Code sample for using the advanced decoding API +/* + // A) Init a configuration object + WebPDecoderConfig config; + CHECK(WebPInitDecoderConfig(&config)); + + // B) optional: retrieve the bitstream's features. + CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + + // C) Adjust 'config', if needed + config.no_fancy_upsampling = 1; + config.output.colorspace = MODE_BGRA; + // etc. + + // Note that you can also make config.output point to an externally + // supplied memory buffer, provided it's big enough to store the decoded + // picture. Otherwise, config.output will just be used to allocate memory + // and store the decoded picture. + + // D) Decode! + CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + + // E) Decoded image is now in config.output (and config.output.u.RGBA) + + // F) Reclaim memory allocated in config's object. It's safe to call + // this function even if the memory is external and wasn't allocated + // by WebPDecode(). + WebPFreeDecBuffer(&config.output); +*/ + +// Features gathered from the bitstream +struct WebPBitstreamFeatures { + int width; // Width in pixels, as read from the bitstream. + int height; // Height in pixels, as read from the bitstream. + int has_alpha; // True if the bitstream contains an alpha channel. + int has_animation; // True if the bitstream is an animation. + int format; // 0 = undefined (/mixed), 1 = lossy, 2 = lossless + + uint32_t pad[5]; // padding for later use +}; + +// Internal, version-checked, entry point +WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal( + const uint8_t*, size_t, WebPBitstreamFeatures*, int); + +// Retrieve features from the bitstream. The *features structure is filled +// with information gathered from the bitstream. +// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns +// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the +// features from headers. Returns error in other cases. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. +static WEBP_INLINE VP8StatusCode WebPGetFeatures( + const uint8_t* data, size_t data_size, + WebPBitstreamFeatures* features) { + return WebPGetFeaturesInternal(data, data_size, features, + WEBP_DECODER_ABI_VERSION); +} + +// Decoding options +struct WebPDecoderOptions { + int bypass_filtering; // if true, skip the in-loop filtering + int no_fancy_upsampling; // if true, use faster pointwise upsampler + int use_cropping; // if true, cropping is applied _first_ + int crop_left, crop_top; // top-left position for cropping. + // Will be snapped to even values. + int crop_width, crop_height; // dimension of the cropping area + int use_scaling; // if true, scaling is applied _afterward_ + int scaled_width, scaled_height; // final resolution + int use_threads; // if true, use multi-threaded decoding + int dithering_strength; // dithering strength (0=Off, 100=full) + int flip; // if true, flip output vertically + int alpha_dithering_strength; // alpha dithering strength in [0..100] + + uint32_t pad[5]; // padding for later use +}; + +// Main object storing the configuration for advanced decoding. +struct WebPDecoderConfig { + WebPBitstreamFeatures input; // Immutable bitstream features (optional) + WebPDecBuffer output; // Output buffer (can point to external mem) + WebPDecoderOptions options; // Decoding options +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPInitDecoderConfigInternal(WebPDecoderConfig*, int); + +// Initialize the configuration as empty. This function must always be +// called first, unless WebPGetFeatures() is to be called. +// Returns false in case of mismatched version. +static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { + return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); +} + +// Instantiate a new incremental decoder object with the requested +// configuration. The bitstream can be passed using 'data' and 'data_size' +// parameter, in which case the features will be parsed and stored into +// config->input. Otherwise, 'data' can be NULL and no parsing will occur. +// Note that 'config' can be NULL too, in which case a default configuration +// is used. If 'config' is not NULL, it must outlive the WebPIDecoder object +// as some references to its fields will be used. No internal copy of 'config' +// is made. +// The return WebPIDecoder object must always be deleted calling WebPIDelete(). +// Returns NULL in case of error (and config->status will then reflect +// the error condition, if available). +WEBP_EXTERN WebPIDecoder* WebPIDecode(const uint8_t* data, size_t data_size, + WebPDecoderConfig* config); + +// Non-incremental version. This version decodes the full data at once, taking +// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK +// if the decoding was successful). Note that 'config' cannot be NULL. +WEBP_EXTERN VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size, + WebPDecoderConfig* config); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_DECODE_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/demux.h b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/demux.h new file mode 100644 index 00000000..846eeb15 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/demux.h @@ -0,0 +1,363 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Demux API. +// Enables extraction of image and extended format data from WebP files. + +// Code Example: Demuxing WebP data to extract all the frames, ICC profile +// and EXIF/XMP metadata. +/* + WebPDemuxer* demux = WebPDemux(&webp_data); + + uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); + uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); + // ... (Get information about the features present in the WebP file). + uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); + + // ... (Iterate over all frames). + WebPIterator iter; + if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), + // ... and get other frame properties like width, height, offsets etc. + // ... see 'struct WebPIterator' below for more info). + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); + } + + // ... (Extract metadata). + WebPChunkIterator chunk_iter; + if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); + // ... (Consume the ICC profile in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); + // ... (Consume the EXIF metadata in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); + // ... (Consume the XMP metadata in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + WebPDemuxDelete(demux); +*/ + +#ifndef WEBP_WEBP_DEMUX_H_ +#define WEBP_WEBP_DEMUX_H_ + +#include "./decode.h" // for WEBP_CSP_MODE +#include "./mux_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_DEMUX_ABI_VERSION 0x0107 // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPDemuxState WebPDemuxState; +// typedef enum WebPFormatFeature WebPFormatFeature; +typedef struct WebPDemuxer WebPDemuxer; +typedef struct WebPIterator WebPIterator; +typedef struct WebPChunkIterator WebPChunkIterator; +typedef struct WebPAnimInfo WebPAnimInfo; +typedef struct WebPAnimDecoderOptions WebPAnimDecoderOptions; + +//------------------------------------------------------------------------------ + +// Returns the version number of the demux library, packed in hexadecimal using +// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetDemuxVersion(void); + +//------------------------------------------------------------------------------ +// Life of a Demux object + +typedef enum WebPDemuxState { + WEBP_DEMUX_PARSE_ERROR = -1, // An error occurred while parsing. + WEBP_DEMUX_PARSING_HEADER = 0, // Not enough data to parse full header. + WEBP_DEMUX_PARSED_HEADER = 1, // Header parsing complete, + // data may be available. + WEBP_DEMUX_DONE = 2 // Entire file has been parsed. +} WebPDemuxState; + +// Internal, version-checked, entry point +WEBP_EXTERN WebPDemuxer* WebPDemuxInternal( + const WebPData*, int, WebPDemuxState*, int); + +// Parses the full WebP file given by 'data'. For single images the WebP file +// header alone or the file header and the chunk header may be absent. +// Returns a WebPDemuxer object on successful parse, NULL otherwise. +static WEBP_INLINE WebPDemuxer* WebPDemux(const WebPData* data) { + return WebPDemuxInternal(data, 0, NULL, WEBP_DEMUX_ABI_VERSION); +} + +// Parses the possibly incomplete WebP file given by 'data'. +// If 'state' is non-NULL it will be set to indicate the status of the demuxer. +// Returns NULL in case of error or if there isn't enough data to start parsing; +// and a WebPDemuxer object on successful parse. +// Note that WebPDemuxer keeps internal pointers to 'data' memory segment. +// If this data is volatile, the demuxer object should be deleted (by calling +// WebPDemuxDelete()) and WebPDemuxPartial() called again on the new data. +// This is usually an inexpensive operation. +static WEBP_INLINE WebPDemuxer* WebPDemuxPartial( + const WebPData* data, WebPDemuxState* state) { + return WebPDemuxInternal(data, 1, state, WEBP_DEMUX_ABI_VERSION); +} + +// Frees memory associated with 'dmux'. +WEBP_EXTERN void WebPDemuxDelete(WebPDemuxer* dmux); + +//------------------------------------------------------------------------------ +// Data/information extraction. + +typedef enum WebPFormatFeature { + WEBP_FF_FORMAT_FLAGS, // bit-wise combination of WebPFeatureFlags + // corresponding to the 'VP8X' chunk (if present). + WEBP_FF_CANVAS_WIDTH, + WEBP_FF_CANVAS_HEIGHT, + WEBP_FF_LOOP_COUNT, // only relevant for animated file + WEBP_FF_BACKGROUND_COLOR, // idem. + WEBP_FF_FRAME_COUNT // Number of frames present in the demux object. + // In case of a partial demux, this is the number + // of frames seen so far, with the last frame + // possibly being partial. +} WebPFormatFeature; + +// Get the 'feature' value from the 'dmux'. +// NOTE: values are only valid if WebPDemux() was used or WebPDemuxPartial() +// returned a state > WEBP_DEMUX_PARSING_HEADER. +// If 'feature' is WEBP_FF_FORMAT_FLAGS, the returned value is a bit-wise +// combination of WebPFeatureFlags values. +// If 'feature' is WEBP_FF_LOOP_COUNT, WEBP_FF_BACKGROUND_COLOR, the returned +// value is only meaningful if the bitstream is animated. +WEBP_EXTERN uint32_t WebPDemuxGetI( + const WebPDemuxer* dmux, WebPFormatFeature feature); + +//------------------------------------------------------------------------------ +// Frame iteration. + +struct WebPIterator { + int frame_num; + int num_frames; // equivalent to WEBP_FF_FRAME_COUNT. + int x_offset, y_offset; // offset relative to the canvas. + int width, height; // dimensions of this frame. + int duration; // display duration in milliseconds. + WebPMuxAnimDispose dispose_method; // dispose method for the frame. + int complete; // true if 'fragment' contains a full frame. partial images + // may still be decoded with the WebP incremental decoder. + WebPData fragment; // The frame given by 'frame_num'. Note for historical + // reasons this is called a fragment. + int has_alpha; // True if the frame contains transparency. + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + + uint32_t pad[2]; // padding for later use. + void* private_; // for internal use only. +}; + +// Retrieves frame 'frame_number' from 'dmux'. +// 'iter->fragment' points to the frame on return from this function. +// Setting 'frame_number' equal to 0 will return the last frame of the image. +// Returns false if 'dmux' is NULL or frame 'frame_number' is not present. +// Call WebPDemuxReleaseIterator() when use of the iterator is complete. +// NOTE: 'dmux' must persist for the lifetime of 'iter'. +WEBP_EXTERN int WebPDemuxGetFrame( + const WebPDemuxer* dmux, int frame_number, WebPIterator* iter); + +// Sets 'iter->fragment' to point to the next ('iter->frame_num' + 1) or +// previous ('iter->frame_num' - 1) frame. These functions do not loop. +// Returns true on success, false otherwise. +WEBP_EXTERN int WebPDemuxNextFrame(WebPIterator* iter); +WEBP_EXTERN int WebPDemuxPrevFrame(WebPIterator* iter); + +// Releases any memory associated with 'iter'. +// Must be called before any subsequent calls to WebPDemuxGetChunk() on the same +// iter. Also, must be called before destroying the associated WebPDemuxer with +// WebPDemuxDelete(). +WEBP_EXTERN void WebPDemuxReleaseIterator(WebPIterator* iter); + +//------------------------------------------------------------------------------ +// Chunk iteration. + +struct WebPChunkIterator { + // The current and total number of chunks with the fourcc given to + // WebPDemuxGetChunk(). + int chunk_num; + int num_chunks; + WebPData chunk; // The payload of the chunk. + + uint32_t pad[6]; // padding for later use + void* private_; +}; + +// Retrieves the 'chunk_number' instance of the chunk with id 'fourcc' from +// 'dmux'. +// 'fourcc' is a character array containing the fourcc of the chunk to return, +// e.g., "ICCP", "XMP ", "EXIF", etc. +// Setting 'chunk_number' equal to 0 will return the last chunk in a set. +// Returns true if the chunk is found, false otherwise. Image related chunk +// payloads are accessed through WebPDemuxGetFrame() and related functions. +// Call WebPDemuxReleaseChunkIterator() when use of the iterator is complete. +// NOTE: 'dmux' must persist for the lifetime of the iterator. +WEBP_EXTERN int WebPDemuxGetChunk(const WebPDemuxer* dmux, + const char fourcc[4], int chunk_number, + WebPChunkIterator* iter); + +// Sets 'iter->chunk' to point to the next ('iter->chunk_num' + 1) or previous +// ('iter->chunk_num' - 1) chunk. These functions do not loop. +// Returns true on success, false otherwise. +WEBP_EXTERN int WebPDemuxNextChunk(WebPChunkIterator* iter); +WEBP_EXTERN int WebPDemuxPrevChunk(WebPChunkIterator* iter); + +// Releases any memory associated with 'iter'. +// Must be called before destroying the associated WebPDemuxer with +// WebPDemuxDelete(). +WEBP_EXTERN void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter); + +//------------------------------------------------------------------------------ +// WebPAnimDecoder API +// +// This API allows decoding (possibly) animated WebP images. +// +// Code Example: +/* + WebPAnimDecoderOptions dec_options; + WebPAnimDecoderOptionsInit(&dec_options); + // Tune 'dec_options' as needed. + WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); + WebPAnimInfo anim_info; + WebPAnimDecoderGetInfo(dec, &anim_info); + for (uint32_t i = 0; i < anim_info.loop_count; ++i) { + while (WebPAnimDecoderHasMoreFrames(dec)) { + uint8_t* buf; + int timestamp; + WebPAnimDecoderGetNext(dec, &buf, ×tamp); + // ... (Render 'buf' based on 'timestamp'). + // ... (Do NOT free 'buf', as it is owned by 'dec'). + } + WebPAnimDecoderReset(dec); + } + const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); + // ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). + WebPAnimDecoderDelete(dec); +*/ + +typedef struct WebPAnimDecoder WebPAnimDecoder; // Main opaque object. + +// Global options. +struct WebPAnimDecoderOptions { + // Output colorspace. Only the following modes are supported: + // MODE_RGBA, MODE_BGRA, MODE_rgbA and MODE_bgrA. + WEBP_CSP_MODE color_mode; + int use_threads; // If true, use multi-threaded decoding. + uint32_t padding[7]; // Padding for later use. +}; + +// Internal, version-checked, entry point. +WEBP_EXTERN int WebPAnimDecoderOptionsInitInternal( + WebPAnimDecoderOptions*, int); + +// Should always be called, to initialize a fresh WebPAnimDecoderOptions +// structure before modification. Returns false in case of version mismatch. +// WebPAnimDecoderOptionsInit() must have succeeded before using the +// 'dec_options' object. +static WEBP_INLINE int WebPAnimDecoderOptionsInit( + WebPAnimDecoderOptions* dec_options) { + return WebPAnimDecoderOptionsInitInternal(dec_options, + WEBP_DEMUX_ABI_VERSION); +} + +// Internal, version-checked, entry point. +WEBP_EXTERN WebPAnimDecoder* WebPAnimDecoderNewInternal( + const WebPData*, const WebPAnimDecoderOptions*, int); + +// Creates and initializes a WebPAnimDecoder object. +// Parameters: +// webp_data - (in) WebP bitstream. This should remain unchanged during the +// lifetime of the output WebPAnimDecoder object. +// dec_options - (in) decoding options. Can be passed NULL to choose +// reasonable defaults (in particular, color mode MODE_RGBA +// will be picked). +// Returns: +// A pointer to the newly created WebPAnimDecoder object, or NULL in case of +// parsing error, invalid option or memory error. +static WEBP_INLINE WebPAnimDecoder* WebPAnimDecoderNew( + const WebPData* webp_data, const WebPAnimDecoderOptions* dec_options) { + return WebPAnimDecoderNewInternal(webp_data, dec_options, + WEBP_DEMUX_ABI_VERSION); +} + +// Global information about the animation.. +struct WebPAnimInfo { + uint32_t canvas_width; + uint32_t canvas_height; + uint32_t loop_count; + uint32_t bgcolor; + uint32_t frame_count; + uint32_t pad[4]; // padding for later use +}; + +// Get global information about the animation. +// Parameters: +// dec - (in) decoder instance to get information from. +// info - (out) global information fetched from the animation. +// Returns: +// True on success. +WEBP_EXTERN int WebPAnimDecoderGetInfo(const WebPAnimDecoder* dec, + WebPAnimInfo* info); + +// Fetch the next frame from 'dec' based on options supplied to +// WebPAnimDecoderNew(). This will be a fully reconstructed canvas of size +// 'canvas_width * 4 * canvas_height', and not just the frame sub-rectangle. The +// returned buffer 'buf' is valid only until the next call to +// WebPAnimDecoderGetNext(), WebPAnimDecoderReset() or WebPAnimDecoderDelete(). +// Parameters: +// dec - (in/out) decoder instance from which the next frame is to be fetched. +// buf - (out) decoded frame. +// timestamp - (out) timestamp of the frame in milliseconds. +// Returns: +// False if any of the arguments are NULL, or if there is a parsing or +// decoding error, or if there are no more frames. Otherwise, returns true. +WEBP_EXTERN int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, + uint8_t** buf, int* timestamp); + +// Check if there are more frames left to decode. +// Parameters: +// dec - (in) decoder instance to be checked. +// Returns: +// True if 'dec' is not NULL and some frames are yet to be decoded. +// Otherwise, returns false. +WEBP_EXTERN int WebPAnimDecoderHasMoreFrames(const WebPAnimDecoder* dec); + +// Resets the WebPAnimDecoder object, so that next call to +// WebPAnimDecoderGetNext() will restart decoding from 1st frame. This would be +// helpful when all frames need to be decoded multiple times (e.g. +// info.loop_count times) without destroying and recreating the 'dec' object. +// Parameters: +// dec - (in/out) decoder instance to be reset +WEBP_EXTERN void WebPAnimDecoderReset(WebPAnimDecoder* dec); + +// Grab the internal demuxer object. +// Getting the demuxer object can be useful if one wants to use operations only +// available through demuxer; e.g. to get XMP/EXIF/ICC metadata. The returned +// demuxer object is owned by 'dec' and is valid only until the next call to +// WebPAnimDecoderDelete(). +// +// Parameters: +// dec - (in) decoder instance from which the demuxer object is to be fetched. +WEBP_EXTERN const WebPDemuxer* WebPAnimDecoderGetDemuxer( + const WebPAnimDecoder* dec); + +// Deletes the WebPAnimDecoder object. +// Parameters: +// dec - (in/out) decoder instance to be deleted +WEBP_EXTERN void WebPAnimDecoderDelete(WebPAnimDecoder* dec); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_DEMUX_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/encode.h b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/encode.h new file mode 100644 index 00000000..56b68e2f --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/encode.h @@ -0,0 +1,552 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// WebP encoder: main interface +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_ENCODE_H_ +#define WEBP_WEBP_ENCODE_H_ + +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_ENCODER_ABI_VERSION 0x020f // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPImageHint WebPImageHint; +// typedef enum WebPEncCSP WebPEncCSP; +// typedef enum WebPPreset WebPPreset; +// typedef enum WebPEncodingError WebPEncodingError; +typedef struct WebPConfig WebPConfig; +typedef struct WebPPicture WebPPicture; // main structure for I/O +typedef struct WebPAuxStats WebPAuxStats; +typedef struct WebPMemoryWriter WebPMemoryWriter; + +// Return the encoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetEncoderVersion(void); + +//------------------------------------------------------------------------------ +// One-stop-shop call! No questions asked: + +// 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 'WebPFree(*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). +WEBP_EXTERN size_t WebPEncodeRGB(const uint8_t* rgb, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGR(const uint8_t* bgr, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeRGBA(const uint8_t* rgba, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGRA(const uint8_t* bgra, + int width, int height, int stride, + float quality_factor, uint8_t** 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. +// Note these functions, like the lossy versions, use the library's default +// settings. For lossless this means 'exact' is disabled. RGB values in +// transparent areas will be modified to improve compression. To avoid this, +// use WebPEncode() and set WebPConfig::exact to 1. +WEBP_EXTERN size_t WebPEncodeLosslessRGB(const uint8_t* rgb, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessBGR(const uint8_t* bgr, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, + int width, int height, int stride, + uint8_t** output); + +//------------------------------------------------------------------------------ +// Coding parameters + +// Image characteristics hint for the underlying encoder. +typedef enum WebPImageHint { + WEBP_HINT_DEFAULT = 0, // default preset. + WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot + WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting + WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc). + WEBP_HINT_LAST +} WebPImageHint; + +// Compression parameters. +struct WebPConfig { + int lossless; // Lossless encoding (0=lossy(default), 1=lossless). + float quality; // between 0 and 100. For lossy, 0 gives the smallest + // size and 100 the largest. For lossless, this + // parameter is the amount of effort put into the + // compression: 0 is the fastest but gives larger + // files compared to the slowest, but best, 100. + int method; // quality/speed trade-off (0=fast, 6=slower-better) + + WebPImageHint image_hint; // Hint for image type (lossless only for now). + + int target_size; // if non-zero, set the desired target size in bytes. + // Takes precedence over the 'compression' parameter. + float target_PSNR; // if non-zero, specifies the minimal distortion to + // try to achieve. Takes precedence over target_size. + int segments; // maximum number of segments to use, in [1..4] + int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. + int filter_strength; // range: [0 = off .. 100 = strongest] + int filter_sharpness; // range: [0 = off .. 7 = least sharp] + int filter_type; // filtering type: 0 = simple, 1 = strong (only used + // if filter_strength > 0 or autofilter > 0) + int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] + int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, + // 1 = compressed with WebP lossless). Default is 1. + int alpha_filtering; // Predictive filtering method for alpha plane. + // 0: none, 1: fast, 2: best. Default if 1. + int alpha_quality; // Between 0 (smallest size) and 100 (lossless). + // Default is 100. + int pass; // number of entropy-analysis passes (in [1..10]). + + int show_compressed; // if true, export the compressed picture back. + // In-loop filtering is not applied. + int preprocessing; // preprocessing filter: + // 0=none, 1=segment-smooth, 2=pseudo-random dithering + int partitions; // log2(number of token partitions) in [0..3]. Default + // is set to 0 for easier progressive decoding. + int partition_limit; // quality degradation allowed to fit the 512k limit + // on prediction modes coding (0: no degradation, + // 100: maximum possible degradation). + int emulate_jpeg_size; // If true, compression parameters will be remapped + // to better match the expected output size from + // JPEG compression. Generally, the output size will + // be similar but the degradation will be lower. + int thread_level; // If non-zero, try and use multi-threaded encoding. + int low_memory; // If set, reduce memory usage (but increase CPU use). + + int near_lossless; // Near lossless encoding [0 = max loss .. 100 = off + // (default)]. + int exact; // if non-zero, preserve the exact RGB values under + // transparent area. Otherwise, discard this invisible + // RGB information for better compression. The default + // value is 0. + + int use_delta_palette; // reserved for future lossless feature + int use_sharp_yuv; // if needed, use sharp (and slow) RGB->YUV conversion + + int qmin; // minimum permissible quality factor + int qmax; // maximum permissible quality factor +}; + +// Enumerate some predefined settings for WebPConfig, depending on the type +// of source picture. These presets are used when calling WebPConfigPreset(). +typedef enum WebPPreset { + WEBP_PRESET_DEFAULT = 0, // default preset. + WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot + WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting + WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details + WEBP_PRESET_ICON, // small-sized colorful images + WEBP_PRESET_TEXT // text-like +} WebPPreset; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int); + +// Should always be called, to initialize a fresh WebPConfig structure before +// modification. Returns false in case of version mismatch. WebPConfigInit() +// must have succeeded before using the 'config' object. +// Note that the default values are lossless=0 and quality=75. +static WEBP_INLINE int WebPConfigInit(WebPConfig* config) { + return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, + WEBP_ENCODER_ABI_VERSION); +} + +// This function will initialize the configuration according to a predefined +// set of parameters (referred to by 'preset') and a given quality factor. +// This function can be called as a replacement to WebPConfigInit(). Will +// return false in case of error. +static WEBP_INLINE int WebPConfigPreset(WebPConfig* config, + WebPPreset preset, float quality) { + return WebPConfigInitInternal(config, preset, quality, + WEBP_ENCODER_ABI_VERSION); +} + +// Activate the lossless compression mode with the desired efficiency level +// between 0 (fastest, lowest compression) and 9 (slower, best compression). +// A good default level is '6', providing a fair tradeoff between compression +// speed and final compressed size. +// This function will overwrite several fields from config: 'method', 'quality' +// and 'lossless'. Returns false in case of parameter error. +WEBP_EXTERN int WebPConfigLosslessPreset(WebPConfig* config, int level); + +// Returns true if 'config' is non-NULL and all configuration parameters are +// within their valid ranges. +WEBP_EXTERN int WebPValidateConfig(const WebPConfig* config); + +//------------------------------------------------------------------------------ +// Input / Output +// Structure for storing auxiliary statistics. + +struct WebPAuxStats { + int coded_size; // final size + + float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha + int block_count[3]; // number of intra4/intra16/skipped macroblocks + int header_bytes[2]; // approximate number of bytes spent for header + // and mode-partition #0 + int residual_bytes[3][4]; // approximate number of bytes spent for + // DC/AC/uv coefficients for each (0..3) segments. + int segment_size[4]; // number of macroblocks in each segments + int segment_quant[4]; // quantizer values for each segments + int segment_level[4]; // filtering strength for each segments [0..63] + + int alpha_data_size; // size of the transparency data + int layer_data_size; // size of the enhancement layer data + + // lossless encoder statistics + uint32_t lossless_features; // bit0:predictor bit1:cross-color transform + // bit2:subtract-green bit3:color indexing + int histogram_bits; // number of precision bits of histogram + int transform_bits; // precision bits for transform + int cache_bits; // number of bits for color cache lookup + int palette_size; // number of color in palette, if used + int lossless_size; // final lossless size + int lossless_hdr_size; // lossless header (transform, huffman etc) size + int lossless_data_size; // lossless image data size + + uint32_t pad[2]; // padding for later use +}; + +// Signature for output function. Should return true if writing was successful. +// data/data_size is the segment of data to write, and 'picture' is for +// reference (and so one can make use of picture->custom_ptr). +typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, + const WebPPicture* picture); + +// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using +// the following WebPMemoryWriter object (to be set as a custom_ptr). +struct WebPMemoryWriter { + uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). + size_t size; // final size + size_t max_size; // total capacity + uint32_t pad[1]; // padding for later use +}; + +// The following must be called first before any use. +WEBP_EXTERN void WebPMemoryWriterInit(WebPMemoryWriter* writer); + +// The following must be called to deallocate writer->mem memory. The 'writer' +// object itself is not deallocated. +WEBP_EXTERN void WebPMemoryWriterClear(WebPMemoryWriter* writer); +// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon +// completion, writer.mem and writer.size will hold the coded data. +// writer.mem must be freed by calling WebPMemoryWriterClear. +WEBP_EXTERN int WebPMemoryWrite(const uint8_t* data, size_t data_size, + const WebPPicture* picture); + +// Progress hook, called from time to time to report progress. It can return +// false to request an abort of the encoding process, or true otherwise if +// everything is OK. +typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); + +// Color spaces. +typedef enum WebPEncCSP { + // chroma sampling + WEBP_YUV420 = 0, // 4:2:0 + WEBP_YUV420A = 4, // alpha channel variant + WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors + WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present +} WebPEncCSP; + +// Encoding error conditions. +typedef enum WebPEncodingError { + VP8_ENC_OK = 0, + VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects + VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits + VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL + VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid + VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height + VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k + VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M + VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes + VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G + VP8_ENC_ERROR_USER_ABORT, // abort request by user + VP8_ENC_ERROR_LAST // list terminator. always last. +} WebPEncodingError; + +// maximum width/height allowed (inclusive), in pixels +#define WEBP_MAX_DIMENSION 16383 + +// Main exchange structure (input samples, output bytes, statistics) +// +// Once WebPPictureInit() has been called, it's ok to make all the INPUT fields +// (use_argb, y/u/v, argb, ...) point to user-owned data, even if +// WebPPictureAlloc() has been called. Depending on the value use_argb, +// it's guaranteed that either *argb or *y/*u/*v content will be kept untouched. +struct WebPPicture { + // INPUT + ////////////// + // Main flag for encoder selecting between ARGB or YUV input. + // It is recommended to use ARGB input (*argb, argb_stride) for lossless + // compression, and YUV input (*y, *u, *v, etc.) for lossy compression + // since these are the respective native colorspace for these formats. + int use_argb; + + // YUV input (mostly used for input to lossy compression) + WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). + int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) + uint8_t* y, *u, *v; // pointers to luma/chroma planes. + int y_stride, uv_stride; // luma/chroma strides. + uint8_t* a; // pointer to the alpha plane + int a_stride; // stride of the alpha plane + uint32_t pad1[2]; // padding for later use + + // ARGB input (mostly used for input to lossless compression) + uint32_t* argb; // Pointer to argb (32 bit) plane. + int argb_stride; // This is stride in pixels units, not bytes. + uint32_t pad2[3]; // padding for later use + + // OUTPUT + /////////////// + // Byte-emission hook, to store compressed bytes as they are ready. + WebPWriterFunction writer; // can be NULL + void* custom_ptr; // can be used by the writer. + + // map for extra information (only for lossy compression mode) + int extra_info_type; // 1: intra type, 2: segment, 3: quant + // 4: intra-16 prediction mode, + // 5: chroma prediction mode, + // 6: bit cost, 7: distortion + uint8_t* extra_info; // if not NULL, points to an array of size + // ((width + 15) / 16) * ((height + 15) / 16) that + // will be filled with a macroblock map, depending + // on extra_info_type. + + // STATS AND REPORTS + /////////////////////////// + // Pointer to side statistics (updated only if not NULL) + WebPAuxStats* stats; + + // Error code for the latest error encountered during encoding + WebPEncodingError error_code; + + // If not NULL, report progress during encoding. + WebPProgressHook progress_hook; + + void* user_data; // this field is free to be set to any value and + // used during callbacks (like progress-report e.g.). + + uint32_t pad3[3]; // padding for later use + + // Unused for now + uint8_t* pad4, *pad5; + uint32_t pad6[8]; // padding for later use + + // PRIVATE FIELDS + //////////////////// + void* memory_; // row chunk of memory for yuva planes + void* memory_argb_; // and for argb too. + void* pad7[2]; // padding for later use +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPPictureInitInternal(WebPPicture*, int); + +// Should always be called, to initialize the structure. Returns false in case +// of version mismatch. WebPPictureInit() must have succeeded before using the +// 'picture' object. +// Note that, by default, use_argb is false and colorspace is WEBP_YUV420. +static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) { + return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// WebPPicture utils + +// Convenience allocation / deallocation based on picture->width/height: +// Allocate y/u/v buffers as per colorspace/width/height specification. +// Note! This function will free the previous buffer if needed. +// Returns false in case of memory error. +WEBP_EXTERN int WebPPictureAlloc(WebPPicture* picture); + +// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). +// Note that this function does _not_ free the memory used by the 'picture' +// object itself. +// Besides memory (which is reclaimed) all other fields of 'picture' are +// preserved. +WEBP_EXTERN void WebPPictureFree(WebPPicture* picture); + +// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, *dst +// will fully own the copied pixels (this is not a view). The 'dst' picture need +// not be initialized as its content is overwritten. +// Returns false in case of memory allocation error. +WEBP_EXTERN int WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); + +// Compute the single distortion for packed planes of samples. +// 'src' will be compared to 'ref', and the raw distortion stored into +// '*distortion'. The refined metric (log(MSE), log(1 - ssim),...' will be +// stored in '*result'. +// 'x_step' is the horizontal stride (in bytes) between samples. +// 'src/ref_stride' is the byte distance between rows. +// Returns false in case of error (bad parameter, memory allocation error, ...). +WEBP_EXTERN int WebPPlaneDistortion(const uint8_t* src, size_t src_stride, + const uint8_t* ref, size_t ref_stride, + int width, int height, + size_t x_step, + int type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float* distortion, float* result); + +// Compute PSNR, SSIM or LSIM distortion metric between two pictures. Results +// are in dB, stored in result[] in the B/G/R/A/All order. The distortion is +// always performed using ARGB samples. Hence if the input is YUV(A), the +// picture will be internally converted to ARGB (just for the measurement). +// Warning: this function is rather CPU-intensive. +WEBP_EXTERN int WebPPictureDistortion( + const WebPPicture* src, const WebPPicture* ref, + int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float result[5]); + +// self-crops a picture to the rectangle defined by top/left/width/height. +// Returns false in case of memory allocation error, or if the rectangle is +// outside of the source picture. +// The rectangle for the view is defined by the top-left corner pixel +// coordinates (left, top) as well as its width and height. This rectangle +// must be fully be comprised inside the 'src' source picture. If the source +// picture uses the YUV420 colorspace, the top and left coordinates will be +// snapped to even values. +WEBP_EXTERN int WebPPictureCrop(WebPPicture* picture, + int left, int top, int width, int height); + +// Extracts a view from 'src' picture into 'dst'. The rectangle for the view +// is defined by the top-left corner pixel coordinates (left, top) as well +// as its width and height. This rectangle must be fully be comprised inside +// the 'src' source picture. If the source picture uses the YUV420 colorspace, +// the top and left coordinates will be snapped to even values. +// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed +// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so, +// the original dimension will be lost). Picture 'dst' need not be initialized +// with WebPPictureInit() if it is different from 'src', since its content will +// be overwritten. +// Returns false in case of invalid parameters. +WEBP_EXTERN int WebPPictureView(const WebPPicture* src, + int left, int top, int width, int height, + WebPPicture* dst); + +// Returns true if the 'picture' is actually a view and therefore does +// not own the memory for pixels. +WEBP_EXTERN int WebPPictureIsView(const WebPPicture* picture); + +// Rescale a picture to new dimension width x height. +// If either 'width' or 'height' (but not both) is 0 the corresponding +// dimension will be calculated preserving the aspect ratio. +// No gamma correction is applied. +// Returns false in case of error (invalid parameter or insufficient memory). +WEBP_EXTERN int WebPPictureRescale(WebPPicture* picture, int width, int height); + +// Colorspace conversion function to import RGB samples. +// Previous buffer will be free'd, if any. +// *rgb buffer should have a size of at least height * rgb_stride. +// Returns false in case of memory error. +WEBP_EXTERN int WebPPictureImportRGB( + WebPPicture* picture, const uint8_t* rgb, int rgb_stride); +// Same, but for RGBA buffer. +WEBP_EXTERN int WebPPictureImportRGBA( + WebPPicture* picture, const uint8_t* rgba, int rgba_stride); +// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format +// input buffer ignoring the alpha channel. Avoids needing to copy the data +// to a temporary 24-bit RGB buffer to import the RGB only. +WEBP_EXTERN int WebPPictureImportRGBX( + WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); + +// Variants of the above, but taking BGR(A|X) input. +WEBP_EXTERN int WebPPictureImportBGR( + WebPPicture* picture, const uint8_t* bgr, int bgr_stride); +WEBP_EXTERN int WebPPictureImportBGRA( + WebPPicture* picture, const uint8_t* bgra, int bgra_stride); +WEBP_EXTERN int WebPPictureImportBGRX( + WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); + +// Converts picture->argb data to the YUV420A format. The 'colorspace' +// parameter is deprecated and should be equal to WEBP_YUV420. +// Upon return, picture->use_argb is set to false. The presence of real +// non-opaque transparent values is detected, and 'colorspace' will be +// adjusted accordingly. Note that this method is lossy. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureARGBToYUVA(WebPPicture* picture, + WebPEncCSP /*colorspace = WEBP_YUV420*/); + +// Same as WebPPictureARGBToYUVA(), but the conversion is done using +// pseudo-random dithering with a strength 'dithering' between +// 0.0 (no dithering) and 1.0 (maximum dithering). This is useful +// for photographic picture. +WEBP_EXTERN int WebPPictureARGBToYUVADithered( + WebPPicture* picture, WebPEncCSP colorspace, float dithering); + +// Performs 'sharp' RGBA->YUVA420 downsampling and colorspace conversion. +// Downsampling is handled with extra care in case of color clipping. This +// method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better +// and sharper YUV representation. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureSharpARGBToYUVA(WebPPicture* picture); +// kept for backward compatibility: +WEBP_EXTERN int WebPPictureSmartARGBToYUVA(WebPPicture* picture); + +// Converts picture->yuv to picture->argb and sets picture->use_argb to true. +// The input format must be YUV_420 or YUV_420A. The conversion from YUV420 to +// ARGB incurs a small loss too. +// Note that the use of this colorspace is discouraged if one has access to the +// raw ARGB samples, since using YUV420 is comparatively lossy. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureYUVAToARGB(WebPPicture* picture); + +// Helper function: given a width x height plane of RGBA or YUV(A) samples +// clean-up or smoothen the YUV or RGB samples under fully transparent area, +// to help compressibility (no guarantee, though). +WEBP_EXTERN void WebPCleanupTransparentArea(WebPPicture* picture); + +// Scan the picture 'picture' for the presence of non fully opaque alpha values. +// Returns true in such case. Otherwise returns false (indicating that the +// alpha plane can be ignored altogether e.g.). +WEBP_EXTERN int WebPPictureHasTransparency(const WebPPicture* picture); + +// Remove the transparency information (if present) by blending the color with +// the background color 'background_rgb' (specified as 24bit RGB triplet). +// After this call, all alpha values are reset to 0xff. +WEBP_EXTERN void WebPBlendAlpha(WebPPicture* picture, uint32_t background_rgb); + +//------------------------------------------------------------------------------ +// Main call + +// Main encoding call, after config and picture have been initialized. +// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), +// and the 'config' object must be a valid one. +// Returns false in case of error, true otherwise. +// In case of error, picture->error_code is updated accordingly. +// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending +// on the value of 'picture->use_argb'. It is highly recommended to use +// the former for lossy encoding, and the latter for lossless encoding +// (when config.lossless is true). Automatic conversion from one format to +// another is provided but they both incur some loss. +WEBP_EXTERN int WebPEncode(const WebPConfig* config, WebPPicture* picture); + +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_ENCODE_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/mux.h b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/mux.h new file mode 100644 index 00000000..7d27489a --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/mux.h @@ -0,0 +1,530 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// RIFF container manipulation and encoding for WebP images. +// +// Authors: Urvang (urvang@google.com) +// Vikas (vikasa@google.com) + +#ifndef WEBP_WEBP_MUX_H_ +#define WEBP_WEBP_MUX_H_ + +#include "./mux_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_MUX_ABI_VERSION 0x0108 // MAJOR(8b) + MINOR(8b) + +//------------------------------------------------------------------------------ +// Mux API +// +// This API allows manipulation of WebP container images containing features +// like color profile, metadata, animation. +// +// Code Example#1: Create a WebPMux object with image data, color profile and +// XMP metadata. +/* + int copy_data = 0; + WebPMux* mux = WebPMuxNew(); + // ... (Prepare image data). + WebPMuxSetImage(mux, &image, copy_data); + // ... (Prepare ICCP color profile data). + WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); + // ... (Prepare XMP metadata). + WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); + // Get data from mux in WebP RIFF format. + WebPMuxAssemble(mux, &output_data); + WebPMuxDelete(mux); + // ... (Consume output_data; e.g. write output_data.bytes to file). + WebPDataClear(&output_data); +*/ + +// Code Example#2: Get image and color profile data from a WebP file. +/* + int copy_data = 0; + // ... (Read data from file). + WebPMux* mux = WebPMuxCreate(&data, copy_data); + WebPMuxGetFrame(mux, 1, &image); + // ... (Consume image; e.g. call WebPDecode() to decode the data). + WebPMuxGetChunk(mux, "ICCP", &icc_profile); + // ... (Consume icc_data). + WebPMuxDelete(mux); + WebPFree(data); +*/ + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPMuxError WebPMuxError; +// typedef enum WebPChunkId WebPChunkId; +typedef struct WebPMux WebPMux; // main opaque object. +typedef struct WebPMuxFrameInfo WebPMuxFrameInfo; +typedef struct WebPMuxAnimParams WebPMuxAnimParams; +typedef struct WebPAnimEncoderOptions WebPAnimEncoderOptions; + +// Error codes +typedef enum WebPMuxError { + WEBP_MUX_OK = 1, + WEBP_MUX_NOT_FOUND = 0, + WEBP_MUX_INVALID_ARGUMENT = -1, + WEBP_MUX_BAD_DATA = -2, + WEBP_MUX_MEMORY_ERROR = -3, + WEBP_MUX_NOT_ENOUGH_DATA = -4 +} WebPMuxError; + +// IDs for different types of chunks. +typedef enum WebPChunkId { + WEBP_CHUNK_VP8X, // VP8X + WEBP_CHUNK_ICCP, // ICCP + WEBP_CHUNK_ANIM, // ANIM + WEBP_CHUNK_ANMF, // ANMF + WEBP_CHUNK_DEPRECATED, // (deprecated from FRGM) + WEBP_CHUNK_ALPHA, // ALPH + WEBP_CHUNK_IMAGE, // VP8/VP8L + WEBP_CHUNK_EXIF, // EXIF + WEBP_CHUNK_XMP, // XMP + WEBP_CHUNK_UNKNOWN, // Other chunks. + WEBP_CHUNK_NIL +} WebPChunkId; + +//------------------------------------------------------------------------------ + +// Returns the version number of the mux library, packed in hexadecimal using +// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetMuxVersion(void); + +//------------------------------------------------------------------------------ +// Life of a Mux object + +// Internal, version-checked, entry point +WEBP_EXTERN WebPMux* WebPNewInternal(int); + +// Creates an empty mux object. +// Returns: +// A pointer to the newly created empty mux object. +// Or NULL in case of memory error. +static WEBP_INLINE WebPMux* WebPMuxNew(void) { + return WebPNewInternal(WEBP_MUX_ABI_VERSION); +} + +// Deletes the mux object. +// Parameters: +// mux - (in/out) object to be deleted +WEBP_EXTERN void WebPMuxDelete(WebPMux* mux); + +//------------------------------------------------------------------------------ +// Mux creation. + +// Internal, version-checked, entry point +WEBP_EXTERN WebPMux* WebPMuxCreateInternal(const WebPData*, int, int); + +// Creates a mux object from raw data given in WebP RIFF format. +// Parameters: +// bitstream - (in) the bitstream data in WebP RIFF format +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// A pointer to the mux object created from given data - on success. +// NULL - In case of invalid data or memory error. +static WEBP_INLINE WebPMux* WebPMuxCreate(const WebPData* bitstream, + int copy_data) { + return WebPMuxCreateInternal(bitstream, copy_data, WEBP_MUX_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// Non-image chunks. + +// Note: Only non-image related chunks should be managed through chunk APIs. +// (Image related chunks are: "ANMF", "VP8 ", "VP8L" and "ALPH"). +// To add, get and delete images, use WebPMuxSetImage(), WebPMuxPushFrame(), +// WebPMuxGetFrame() and WebPMuxDeleteFrame(). + +// Adds a chunk with id 'fourcc' and data 'chunk_data' in the mux object. +// Any existing chunk(s) with the same id will be removed. +// Parameters: +// mux - (in/out) object to which the chunk is to be added +// fourcc - (in) a character array containing the fourcc of the given chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// chunk_data - (in) the chunk data to be added +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetChunk( + WebPMux* mux, const char fourcc[4], const WebPData* chunk_data, + int copy_data); + +// Gets a reference to the data of the chunk with id 'fourcc' in the mux object. +// The caller should NOT free the returned data. +// Parameters: +// mux - (in) object from which the chunk data is to be fetched +// fourcc - (in) a character array containing the fourcc of the chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// chunk_data - (out) returned chunk data +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given id. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetChunk( + const WebPMux* mux, const char fourcc[4], WebPData* chunk_data); + +// Deletes the chunk with the given 'fourcc' from the mux object. +// Parameters: +// mux - (in/out) object from which the chunk is to be deleted +// fourcc - (in) a character array containing the fourcc of the chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or fourcc is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given fourcc. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxDeleteChunk( + WebPMux* mux, const char fourcc[4]); + +//------------------------------------------------------------------------------ +// Images. + +// Encapsulates data about a single frame. +struct WebPMuxFrameInfo { + WebPData bitstream; // image data: can be a raw VP8/VP8L bitstream + // or a single-image WebP file. + int x_offset; // x-offset of the frame. + int y_offset; // y-offset of the frame. + int duration; // duration of the frame (in milliseconds). + + WebPChunkId id; // frame type: should be one of WEBP_CHUNK_ANMF + // or WEBP_CHUNK_IMAGE + WebPMuxAnimDispose dispose_method; // Disposal method for the frame. + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + uint32_t pad[1]; // padding for later use +}; + +// Sets the (non-animated) image in the mux object. +// Note: Any existing images (including frames) will be removed. +// Parameters: +// mux - (in/out) object in which the image is to be set +// bitstream - (in) can be a raw VP8/VP8L bitstream or a single-image +// WebP file (non-animated) +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetImage( + WebPMux* mux, const WebPData* bitstream, int copy_data); + +// Adds a frame at the end of the mux object. +// Notes: (1) frame.id should be WEBP_CHUNK_ANMF +// (2) For setting a non-animated image, use WebPMuxSetImage() instead. +// (3) Type of frame being pushed must be same as the frames in mux. +// (4) As WebP only supports even offsets, any odd offset will be snapped +// to an even location using: offset &= ~1 +// Parameters: +// mux - (in/out) object to which the frame is to be added +// frame - (in) frame data. +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL +// or if content of 'frame' is invalid. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxPushFrame( + WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data); + +// Gets the nth frame from the mux object. +// The content of 'frame->bitstream' is allocated using WebPMalloc(), and NOT +// owned by the 'mux' object. It MUST be deallocated by the caller by calling +// WebPDataClear(). +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in) object from which the info is to be fetched +// nth - (in) index of the frame in the mux object +// frame - (out) data of the returned frame +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL. +// WEBP_MUX_NOT_FOUND - if there are less than nth frames in the mux object. +// WEBP_MUX_BAD_DATA - if nth frame chunk in mux is invalid. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetFrame( + const WebPMux* mux, uint32_t nth, WebPMuxFrameInfo* frame); + +// Deletes a frame from the mux object. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in/out) object from which a frame is to be deleted +// nth - (in) The position from which the frame is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL. +// WEBP_MUX_NOT_FOUND - If there are less than nth frames in the mux object +// before deletion. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth); + +//------------------------------------------------------------------------------ +// Animation. + +// Animation parameters. +struct WebPMuxAnimParams { + uint32_t bgcolor; // Background color of the canvas stored (in MSB order) as: + // Bits 00 to 07: Alpha. + // Bits 08 to 15: Red. + // Bits 16 to 23: Green. + // Bits 24 to 31: Blue. + int loop_count; // Number of times to repeat the animation [0 = infinite]. +}; + +// Sets the animation parameters in the mux object. Any existing ANIM chunks +// will be removed. +// Parameters: +// mux - (in/out) object in which ANIM chunk is to be set/added +// params - (in) animation parameters. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetAnimationParams( + WebPMux* mux, const WebPMuxAnimParams* params); + +// Gets the animation parameters from the mux object. +// Parameters: +// mux - (in) object from which the animation parameters to be fetched +// params - (out) animation parameters extracted from the ANIM chunk +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. +// WEBP_MUX_NOT_FOUND - if ANIM chunk is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetAnimationParams( + const WebPMux* mux, WebPMuxAnimParams* params); + +//------------------------------------------------------------------------------ +// Misc Utilities. + +// Sets the canvas size for the mux object. The width and height can be +// specified explicitly or left as zero (0, 0). +// * When width and height are specified explicitly, then this frame bound is +// enforced during subsequent calls to WebPMuxAssemble() and an error is +// reported if any animated frame does not completely fit within the canvas. +// * When unspecified (0, 0), the constructed canvas will get the frame bounds +// from the bounding-box over all frames after calling WebPMuxAssemble(). +// Parameters: +// mux - (in) object to which the canvas size is to be set +// width - (in) canvas width +// height - (in) canvas height +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL; or +// width or height are invalid or out of bounds +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, + int width, int height); + +// Gets the canvas size from the mux object. +// Note: This method assumes that the VP8X chunk, if present, is up-to-date. +// That is, the mux object hasn't been modified since the last call to +// WebPMuxAssemble() or WebPMuxCreate(). +// Parameters: +// mux - (in) object from which the canvas size is to be fetched +// width - (out) canvas width +// height - (out) canvas height +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, width or height is NULL. +// WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetCanvasSize(const WebPMux* mux, + int* width, int* height); + +// Gets the feature flags from the mux object. +// Note: This method assumes that the VP8X chunk, if present, is up-to-date. +// That is, the mux object hasn't been modified since the last call to +// WebPMuxAssemble() or WebPMuxCreate(). +// Parameters: +// mux - (in) object from which the features are to be fetched +// flags - (out) the flags specifying which features are present in the +// mux object. This will be an OR of various flag values. +// Enum 'WebPFeatureFlags' can be used to test individual flag values. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or flags is NULL. +// WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetFeatures(const WebPMux* mux, + uint32_t* flags); + +// Gets number of chunks with the given 'id' in the mux object. +// Parameters: +// mux - (in) object from which the info is to be fetched +// id - (in) chunk id specifying the type of chunk +// num_elements - (out) number of chunks with the given chunk id +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, or num_elements is NULL. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxNumChunks(const WebPMux* mux, + WebPChunkId id, int* num_elements); + +// Assembles all chunks in WebP RIFF format and returns in 'assembled_data'. +// This function also validates the mux object. +// Note: The content of 'assembled_data' will be ignored and overwritten. +// Also, the content of 'assembled_data' is allocated using WebPMalloc(), and +// NOT owned by the 'mux' object. It MUST be deallocated by the caller by +// calling WebPDataClear(). It's always safe to call WebPDataClear() upon +// return, even in case of error. +// Parameters: +// mux - (in/out) object whose chunks are to be assembled +// assembled_data - (out) assembled WebP data +// Returns: +// WEBP_MUX_BAD_DATA - if mux object is invalid. +// WEBP_MUX_INVALID_ARGUMENT - if mux or assembled_data is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxAssemble(WebPMux* mux, + WebPData* assembled_data); + +//------------------------------------------------------------------------------ +// WebPAnimEncoder API +// +// This API allows encoding (possibly) animated WebP images. +// +// Code Example: +/* + WebPAnimEncoderOptions enc_options; + WebPAnimEncoderOptionsInit(&enc_options); + // Tune 'enc_options' as needed. + WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); + while() { + WebPConfig config; + WebPConfigInit(&config); + // Tune 'config' as needed. + WebPAnimEncoderAdd(enc, frame, timestamp_ms, &config); + } + WebPAnimEncoderAdd(enc, NULL, timestamp_ms, NULL); + WebPAnimEncoderAssemble(enc, webp_data); + WebPAnimEncoderDelete(enc); + // Write the 'webp_data' to a file, or re-mux it further. +*/ + +typedef struct WebPAnimEncoder WebPAnimEncoder; // Main opaque object. + +// Forward declarations. Defined in encode.h. +struct WebPPicture; +struct WebPConfig; + +// Global options. +struct WebPAnimEncoderOptions { + WebPMuxAnimParams anim_params; // Animation parameters. + int minimize_size; // If true, minimize the output size (slow). Implicitly + // disables key-frame insertion. + int kmin; + int kmax; // Minimum and maximum distance between consecutive key + // frames in the output. The library may insert some key + // frames as needed to satisfy this criteria. + // Note that these conditions should hold: kmax > kmin + // and kmin >= kmax / 2 + 1. Also, if kmax <= 0, then + // key-frame insertion is disabled; and if kmax == 1, + // then all frames will be key-frames (kmin value does + // not matter for these special cases). + int allow_mixed; // If true, use mixed compression mode; may choose + // either lossy and lossless for each frame. + int verbose; // If true, print info and warning messages to stderr. + + uint32_t padding[4]; // Padding for later use. +}; + +// Internal, version-checked, entry point. +WEBP_EXTERN int WebPAnimEncoderOptionsInitInternal( + WebPAnimEncoderOptions*, int); + +// Should always be called, to initialize a fresh WebPAnimEncoderOptions +// structure before modification. Returns false in case of version mismatch. +// WebPAnimEncoderOptionsInit() must have succeeded before using the +// 'enc_options' object. +static WEBP_INLINE int WebPAnimEncoderOptionsInit( + WebPAnimEncoderOptions* enc_options) { + return WebPAnimEncoderOptionsInitInternal(enc_options, WEBP_MUX_ABI_VERSION); +} + +// Internal, version-checked, entry point. +WEBP_EXTERN WebPAnimEncoder* WebPAnimEncoderNewInternal( + int, int, const WebPAnimEncoderOptions*, int); + +// Creates and initializes a WebPAnimEncoder object. +// Parameters: +// width/height - (in) canvas width and height of the animation. +// enc_options - (in) encoding options; can be passed NULL to pick +// reasonable defaults. +// Returns: +// A pointer to the newly created WebPAnimEncoder object. +// Or NULL in case of memory error. +static WEBP_INLINE WebPAnimEncoder* WebPAnimEncoderNew( + int width, int height, const WebPAnimEncoderOptions* enc_options) { + return WebPAnimEncoderNewInternal(width, height, enc_options, + WEBP_MUX_ABI_VERSION); +} + +// Optimize the given frame for WebP, encode it and add it to the +// WebPAnimEncoder object. +// The last call to 'WebPAnimEncoderAdd' should be with frame = NULL, which +// indicates that no more frames are to be added. This call is also used to +// determine the duration of the last frame. +// Parameters: +// enc - (in/out) object to which the frame is to be added. +// frame - (in/out) frame data in ARGB or YUV(A) format. If it is in YUV(A) +// format, it will be converted to ARGB, which incurs a small loss. +// timestamp_ms - (in) timestamp of this frame in milliseconds. +// Duration of a frame would be calculated as +// "timestamp of next frame - timestamp of this frame". +// Hence, timestamps should be in non-decreasing order. +// config - (in) encoding options; can be passed NULL to pick +// reasonable defaults. +// Returns: +// On error, returns false and frame->error_code is set appropriately. +// Otherwise, returns true. +WEBP_EXTERN int WebPAnimEncoderAdd( + WebPAnimEncoder* enc, struct WebPPicture* frame, int timestamp_ms, + const struct WebPConfig* config); + +// Assemble all frames added so far into a WebP bitstream. +// This call should be preceded by a call to 'WebPAnimEncoderAdd' with +// frame = NULL; if not, the duration of the last frame will be internally +// estimated. +// Parameters: +// enc - (in/out) object from which the frames are to be assembled. +// webp_data - (out) generated WebP bitstream. +// Returns: +// True on success. +WEBP_EXTERN int WebPAnimEncoderAssemble(WebPAnimEncoder* enc, + WebPData* webp_data); + +// Get error string corresponding to the most recent call using 'enc'. The +// returned string is owned by 'enc' and is valid only until the next call to +// WebPAnimEncoderAdd() or WebPAnimEncoderAssemble() or WebPAnimEncoderDelete(). +// Parameters: +// enc - (in/out) object from which the error string is to be fetched. +// Returns: +// NULL if 'enc' is NULL. Otherwise, returns the error string if the last call +// to 'enc' had an error, or an empty string if the last call was a success. +WEBP_EXTERN const char* WebPAnimEncoderGetError(WebPAnimEncoder* enc); + +// Deletes the WebPAnimEncoder object. +// Parameters: +// enc - (in/out) object to be deleted +WEBP_EXTERN void WebPAnimEncoderDelete(WebPAnimEncoder* enc); + +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_MUX_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/mux_types.h b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/mux_types.h new file mode 100644 index 00000000..2fe81958 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/mux_types.h @@ -0,0 +1,98 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Data-types common to the mux and demux libraries. +// +// Author: Urvang (urvang@google.com) + +#ifndef WEBP_WEBP_MUX_TYPES_H_ +#define WEBP_WEBP_MUX_TYPES_H_ + +#include // memset() +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPFeatureFlags WebPFeatureFlags; +// typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; +// typedef enum WebPMuxAnimBlend WebPMuxAnimBlend; +typedef struct WebPData WebPData; + +// VP8X Feature Flags. +typedef enum WebPFeatureFlags { + ANIMATION_FLAG = 0x00000002, + XMP_FLAG = 0x00000004, + EXIF_FLAG = 0x00000008, + ALPHA_FLAG = 0x00000010, + ICCP_FLAG = 0x00000020, + + ALL_VALID_FLAGS = 0x0000003e +} WebPFeatureFlags; + +// Dispose method (animation only). Indicates how the area used by the current +// frame is to be treated before rendering the next frame on the canvas. +typedef enum WebPMuxAnimDispose { + WEBP_MUX_DISPOSE_NONE, // Do not dispose. + WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. +} WebPMuxAnimDispose; + +// Blend operation (animation only). Indicates how transparent pixels of the +// current frame are blended with those of the previous canvas. +typedef enum WebPMuxAnimBlend { + WEBP_MUX_BLEND, // Blend. + WEBP_MUX_NO_BLEND // Do not blend. +} WebPMuxAnimBlend; + +// Data type used to describe 'raw' data, e.g., chunk data +// (ICC profile, metadata) and WebP compressed image data. +// 'bytes' memory must be allocated using WebPMalloc() and such. +struct WebPData { + const uint8_t* bytes; + size_t size; +}; + +// Initializes the contents of the 'webp_data' object with default values. +static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { + if (webp_data != NULL) { + memset(webp_data, 0, sizeof(*webp_data)); + } +} + +// Clears the contents of the 'webp_data' object by calling WebPFree(). +// Does not deallocate the object itself. +static WEBP_INLINE void WebPDataClear(WebPData* webp_data) { + if (webp_data != NULL) { + WebPFree((void*)webp_data->bytes); + WebPDataInit(webp_data); + } +} + +// Allocates necessary storage for 'dst' and copies the contents of 'src'. +// Returns true on success. +static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) { + if (src == NULL || dst == NULL) return 0; + WebPDataInit(dst); + if (src->bytes != NULL && src->size != 0) { + dst->bytes = (uint8_t*)WebPMalloc(src->size); + if (dst->bytes == NULL) return 0; + memcpy((void*)dst->bytes, src->bytes, src->size); + dst->size = src->size; + } + return 1; +} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_MUX_TYPES_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/types.h b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/types.h new file mode 100644 index 00000000..47f7f2b0 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-arm64/include/webp/types.h @@ -0,0 +1,68 @@ +// Copyright 2010 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Common types + memory wrappers +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_TYPES_H_ +#define WEBP_WEBP_TYPES_H_ + +#include // for size_t + +#ifndef _MSC_VER +#include +#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ + (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) +#define WEBP_INLINE inline +#else +#define WEBP_INLINE +#endif +#else +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned long long int uint64_t; +typedef long long int int64_t; +#define WEBP_INLINE __forceinline +#endif /* _MSC_VER */ + +#ifndef WEBP_EXTERN +// This explicitly marks library functions and allows for changing the +// signature for e.g., Windows DLL builds. +# if defined(__GNUC__) && __GNUC__ >= 4 +# define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) +# else +# define WEBP_EXTERN extern +# endif /* __GNUC__ >= 4 */ +#endif /* WEBP_EXTERN */ + +// Macro to check ABI compatibility (same major revision number) +#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) + +#ifdef __cplusplus +extern "C" { +#endif + +// Allocates 'size' bytes of memory. Returns NULL upon error. Memory +// must be deallocated by calling WebPFree(). This function is made available +// by the core 'libwebp' library. +WEBP_EXTERN void* WebPMalloc(size_t size); + +// Releases memory returned by the WebPDecode*() functions (from decode.h). +WEBP_EXTERN void WebPFree(void* ptr); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_TYPES_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebp.a b/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebp.a new file mode 100644 index 00000000..3d8589d0 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebp.a differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebpdemux.a b/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebpdemux.a new file mode 100644 index 00000000..8fa541d4 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebpdemux.a differ diff --git a/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebpmux.a b/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebpmux.a new file mode 100644 index 00000000..97d64064 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-arm64/lib/libwebpmux.a differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/CONTRIBUTING.md b/resources/binaries/libwebp-1.2.4-mac-x86-64/CONTRIBUTING.md new file mode 100644 index 00000000..7a73a303 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/CONTRIBUTING.md @@ -0,0 +1,29 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use a [Gerrit](https://www.gerritcodereview.com) instance hosted at +https://chromium-review.googlesource.com for this purpose. See the +[WebM Project page](https://www.webmproject.org/code/contribute/submitting-patches/) +for additional details. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/README.md b/resources/binaries/libwebp-1.2.4-mac-x86-64/README.md new file mode 100644 index 00000000..4dfe39c0 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/README.md @@ -0,0 +1,65 @@ +# WebP Codec + +``` + __ __ ____ ____ ____ + / \\/ \/ _ \/ _ )/ _ \ + \ / __/ _ \ __/ + \__\__/\____/\_____/__/ ____ ___ + / _/ / \ \ / _ \/ _/ + / \_/ / / \ \ __/ \__ + \____/____/\_____/_____/____/v1.2.4 +``` + +WebP codec is a library to encode and decode images in WebP format. This package +contains the library that can be used in other programs to add WebP support, as +well as the command line tools 'cwebp' and 'dwebp' to compress and decompress +images respectively. + +See https://developers.google.com/speed/webp for details on the image format. + +The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp + +It is released under the same license as the WebM project. See +https://www.webmproject.org/license/software/ or the "COPYING" file for details. +An additional intellectual property rights grant can be found in the file +PATENTS. + +## Files + +* bin/cwebp : encoding tool +* bin/dwebp : decoding tool +* bin/gif2webp : gif conversion tool +* bin/img2webp : animation creation tool +* bin/vwebp : webp visualization tool +* bin/webpinfo : webp analysis tool +* bin/webpmux : webp muxing tool +* bin/anim\_diff : webp file comparison tool +* bin/anim\_dump : tool for dumping animation frames +* bin/get\_disto : tool for calculating file distortion +* bin/webp\_quality : webp quality estimation tool +* doc/ : manual in HTML and text formats +* lib/ : static libraries +* include/webp : headers + +## Encoding and Decoding Tools + +The bin/ directory contains tools to encode and decode images and animations, +view information about WebP images, and more. See the +[tools documentation](doc/tools.md). + +## APIs + +See the [APIs documentation](doc/api.md). + +## Bugs + +Please report all bugs to the issue tracker: https://bugs.chromium.org/p/webp + +Patches welcome! See [how to contribute](CONTRIBUTING.md). + +## Discuss + +Email: webp-discuss@webmproject.org + +Web: https://groups.google.com/a/webmproject.org/group/webp-discuss diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/anim_diff b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/anim_diff new file mode 100644 index 00000000..d6300a47 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/anim_diff differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/anim_dump b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/anim_dump new file mode 100644 index 00000000..64e7a617 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/anim_dump differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/cwebp b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/cwebp new file mode 100644 index 00000000..ef1174a1 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/cwebp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/dwebp b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/dwebp new file mode 100644 index 00000000..0b21109d Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/dwebp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/get_disto b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/get_disto new file mode 100644 index 00000000..08e4f586 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/get_disto differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/gif2webp b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/gif2webp new file mode 100644 index 00000000..19388d67 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/gif2webp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/img2webp b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/img2webp new file mode 100644 index 00000000..7cfba354 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/img2webp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/vwebp b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/vwebp new file mode 100644 index 00000000..683a4b66 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/vwebp differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webp_quality b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webp_quality new file mode 100644 index 00000000..b5959438 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webp_quality differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webpinfo b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webpinfo new file mode 100644 index 00000000..60b35cb7 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webpinfo differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webpmux b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webpmux new file mode 100644 index 00000000..7e973d70 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/bin/webpmux differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/api.md b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/api.md new file mode 100644 index 00000000..d0adafbd --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/api.md @@ -0,0 +1,385 @@ +# WebP APIs + +## Encoding API + +The main encoding functions are available in the header src/webp/encode.h + +The ready-to-use ones are: + +```c +size_t WebPEncodeRGB(const uint8_t* rgb, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeBGR(const uint8_t* bgr, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeRGBA(const uint8_t* rgba, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeBGRA(const uint8_t* bgra, int width, int height, int stride, + float quality_factor, uint8_t** output); +``` + +They will convert raw RGB samples to a WebP data. The only control supplied is +the quality factor. + +There are some variants for using the lossless format: + +```c +size_t WebPEncodeLosslessRGB(const uint8_t* rgb, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessBGR(const uint8_t* bgr, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, int width, int height, + int stride, uint8_t** output); +``` + +Of course in this case, no quality factor is needed since the compression occurs +without loss of the input values, at the expense of larger output sizes. + +### Advanced encoding API + +A more advanced API is based on the WebPConfig and WebPPicture structures. + +WebPConfig contains the encoding settings and is not tied to a particular +picture. WebPPicture contains input data, on which some WebPConfig will be used +for compression. The encoding flow looks like: + +```c +#include + +// Setup a config, starting form a preset and tuning some additional +// parameters +WebPConfig config; +if (!WebPConfigPreset(&config, WEBP_PRESET_PHOTO, quality_factor)) { + return 0; // version error +} +// ... additional tuning +config.sns_strength = 90; +config.filter_sharpness = 6; +config_error = WebPValidateConfig(&config); // not mandatory, but useful + +// Setup the input data +WebPPicture pic; +if (!WebPPictureInit(&pic)) { + return 0; // version error +} +pic.width = width; +pic.height = height; +// allocated picture of dimension width x height +if (!WebPPictureAlloc(&pic)) { + return 0; // memory error +} +// at this point, 'pic' has been initialized as a container, +// and can receive the Y/U/V samples. +// Alternatively, one could use ready-made import functions like +// WebPPictureImportRGB(), which will take care of memory allocation. +// In any case, past this point, one will have to call +// WebPPictureFree(&pic) to reclaim memory. + +// Set up a byte-output write method. WebPMemoryWriter, for instance. +WebPMemoryWriter wrt; +WebPMemoryWriterInit(&wrt); // initialize 'wrt' + +pic.writer = MyFileWriter; +pic.custom_ptr = my_opaque_structure_to_make_MyFileWriter_work; + +// Compress! +int ok = WebPEncode(&config, &pic); // ok = 0 => error occurred! +WebPPictureFree(&pic); // must be called independently of the 'ok' result. + +// output data should have been handled by the writer at that point. +// -> compressed data is the memory buffer described by wrt.mem / wrt.size + +// deallocate the memory used by compressed data +WebPMemoryWriterClear(&wrt); +``` + +## Decoding API + +This is mainly just one function to call: + +```c +#include "webp/decode.h" +uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, + int* width, int* height); +``` + +Please have a look at the file src/webp/decode.h for the details. There are +variants for decoding in BGR/RGBA/ARGB/BGRA order, along with decoding to raw +Y'CbCr samples. One can also decode the image directly into a pre-allocated +buffer. + +To detect a WebP file and gather the picture's dimensions, the function: + +```c +int WebPGetInfo(const uint8_t* data, size_t data_size, + int* width, int* height); +``` + +is supplied. No decoding is involved when using it. + +### Incremental decoding API + +In the case when data is being progressively transmitted, pictures can still be +incrementally decoded using a slightly more complicated API. Decoder state is +stored into an instance of the WebPIDecoder object. This object can be created +with the purpose of decoding either RGB or Y'CbCr samples. For instance: + +```c +WebPDecBuffer buffer; +WebPInitDecBuffer(&buffer); +buffer.colorspace = MODE_BGR; +... +WebPIDecoder* idec = WebPINewDecoder(&buffer); +``` + +As data is made progressively available, this incremental-decoder object can be +used to decode the picture further. There are two (mutually exclusive) ways to +pass freshly arrived data: + +either by appending the fresh bytes: + +```c +WebPIAppend(idec, fresh_data, size_of_fresh_data); +``` + +or by just mentioning the new size of the transmitted data: + +```c +WebPIUpdate(idec, buffer, size_of_transmitted_buffer); +``` + +Note that 'buffer' can be modified between each call to WebPIUpdate, in +particular when the buffer is resized to accommodate larger data. + +These functions will return the decoding status: either VP8_STATUS_SUSPENDED if +decoding is not finished yet or VP8_STATUS_OK when decoding is done. Any other +status is an error condition. + +The 'idec' object must always be released (even upon an error condition) by +calling: WebPDelete(idec). + +To retrieve partially decoded picture samples, one must use the corresponding +method: WebPIDecGetRGB or WebPIDecGetYUVA. It will return the last displayable +pixel row. + +Lastly, note that decoding can also be performed into a pre-allocated pixel +buffer. This buffer must be passed when creating a WebPIDecoder, calling +WebPINewRGB() or WebPINewYUVA(). + +Please have a look at the src/webp/decode.h header for further details. + +### Advanced Decoding API + +WebP decoding supports an advanced API which provides on-the-fly cropping and +rescaling, something of great usefulness on memory-constrained environments like +mobile phones. Basically, the memory usage will scale with the output's size, +not the input's, when one only needs a quick preview or a zoomed in portion of +an otherwise too-large picture. Some CPU can be saved too, incidentally. + +```c +// A) Init a configuration object +WebPDecoderConfig config; +CHECK(WebPInitDecoderConfig(&config)); + +// B) optional: retrieve the bitstream's features. +CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + +// C) Adjust 'config' options, if needed +config.options.no_fancy_upsampling = 1; +config.options.use_scaling = 1; +config.options.scaled_width = scaledWidth(); +config.options.scaled_height = scaledHeight(); +// etc. + +// D) Specify 'config' output options for specifying output colorspace. +// Optionally the external image decode buffer can also be specified. +config.output.colorspace = MODE_BGRA; +// Optionally, the config.output can be pointed to an external buffer as +// well for decoding the image. This externally supplied memory buffer +// should be big enough to store the decoded picture. +config.output.u.RGBA.rgba = (uint8_t*) memory_buffer; +config.output.u.RGBA.stride = scanline_stride; +config.output.u.RGBA.size = total_size_of_the_memory_buffer; +config.output.is_external_memory = 1; + +// E) Decode the WebP image. There are two variants w.r.t decoding image. +// The first one (E.1) decodes the full image and the second one (E.2) is +// used to incrementally decode the image using small input buffers. +// Any one of these steps can be used to decode the WebP image. + +// E.1) Decode full image. +CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + +// E.2) Decode image incrementally. +WebPIDecoder* const idec = WebPIDecode(NULL, NULL, &config); +CHECK(idec != NULL); +while (bytes_remaining > 0) { + VP8StatusCode status = WebPIAppend(idec, input, bytes_read); + if (status == VP8_STATUS_OK || status == VP8_STATUS_SUSPENDED) { + bytes_remaining -= bytes_read; + } else { + break; + } +} +WebPIDelete(idec); + +// F) Decoded image is now in config.output (and config.output.u.RGBA). +// It can be saved, displayed or otherwise processed. + +// G) Reclaim memory allocated in config's object. It's safe to call +// this function even if the memory is external and wasn't allocated +// by WebPDecode(). +WebPFreeDecBuffer(&config.output); +``` + +## Webp Mux + +WebPMux is a set of two libraries 'Mux' and 'Demux' for creation, extraction and +manipulation of an extended format WebP file, which can have features like color +profile, metadata and animation. Reference command-line tools `webpmux` and +`vwebp` as well as the WebP container specification +'doc/webp-container-spec.txt' are also provided in this package, see the +[tools documentation](tools.md). + +### Mux API + +The Mux API contains methods for adding data to and reading data from WebP +files. This API currently supports XMP/EXIF metadata, ICC profile and animation. +Other features may be added in subsequent releases. + +Example#1 (pseudo code): Creating a WebPMux object with image data, color +profile and XMP metadata. + +```c +int copy_data = 0; +WebPMux* mux = WebPMuxNew(); +// ... (Prepare image data). +WebPMuxSetImage(mux, &image, copy_data); +// ... (Prepare ICC profile data). +WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); +// ... (Prepare XMP metadata). +WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); +// Get data from mux in WebP RIFF format. +WebPMuxAssemble(mux, &output_data); +WebPMuxDelete(mux); +// ... (Consume output_data; e.g. write output_data.bytes to file). +WebPDataClear(&output_data); +``` + +Example#2 (pseudo code): Get image and color profile data from a WebP file. + +```c +int copy_data = 0; +// ... (Read data from file). +WebPMux* mux = WebPMuxCreate(&data, copy_data); +WebPMuxGetFrame(mux, 1, &image); +// ... (Consume image; e.g. call WebPDecode() to decode the data). +WebPMuxGetChunk(mux, "ICCP", &icc_profile); +// ... (Consume icc_profile). +WebPMuxDelete(mux); +free(data); +``` + +For a detailed Mux API reference, please refer to the header file +(src/webp/mux.h). + +### Demux API + +The Demux API enables extraction of images and extended format data from WebP +files. This API currently supports reading of XMP/EXIF metadata, ICC profile and +animated images. Other features may be added in subsequent releases. + +Code example: Demuxing WebP data to extract all the frames, ICC profile and +EXIF/XMP metadata. + +```c +WebPDemuxer* demux = WebPDemux(&webp_data); +uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); +uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); +// ... (Get information about the features present in the WebP file). +uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); + +// ... (Iterate over all frames). +WebPIterator iter; +if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), + // ... and get other frame properties like width, height, offsets etc. + // ... see 'struct WebPIterator' below for more info). + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); +} + +// ... (Extract metadata). +WebPChunkIterator chunk_iter; +if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); +// ... (Consume the ICC profile in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); +// ... (Consume the EXIF metadata in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); +// ... (Consume the XMP metadata in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +WebPDemuxDelete(demux); +``` + +For a detailed Demux API reference, please refer to the header file +(src/webp/demux.h). + +## AnimEncoder API + +The AnimEncoder API can be used to create animated WebP images. + +Code example: + +```c +WebPAnimEncoderOptions enc_options; +WebPAnimEncoderOptionsInit(&enc_options); +// ... (Tune 'enc_options' as needed). +WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); +while() { + WebPConfig config; + WebPConfigInit(&config); + // ... (Tune 'config' as needed). + WebPAnimEncoderAdd(enc, frame, duration, &config); +} +WebPAnimEncoderAssemble(enc, webp_data); +WebPAnimEncoderDelete(enc); +// ... (Write the 'webp_data' to a file, or re-mux it further). +``` + +For a detailed AnimEncoder API reference, please refer to the header file +(src/webp/mux.h). + +## AnimDecoder API + +This AnimDecoder API allows decoding (possibly) animated WebP images. + +Code Example: + +```c +WebPAnimDecoderOptions dec_options; +WebPAnimDecoderOptionsInit(&dec_options); +// Tune 'dec_options' as needed. +WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); +WebPAnimInfo anim_info; +WebPAnimDecoderGetInfo(dec, &anim_info); +for (uint32_t i = 0; i < anim_info.loop_count; ++i) { + while (WebPAnimDecoderHasMoreFrames(dec)) { + uint8_t* buf; + int timestamp; + WebPAnimDecoderGetNext(dec, &buf, ×tamp); + // ... (Render 'buf' based on 'timestamp'). + // ... (Do NOT free 'buf', as it is owned by 'dec'). + } + WebPAnimDecoderReset(dec); +} +const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); +// ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). +WebPAnimDecoderDelete(dec); +``` + +For a detailed AnimDecoder API reference, please refer to the header file +(src/webp/demux.h). diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/cwebp.html b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/cwebp.html new file mode 100644 index 00000000..b7fda0bf --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/cwebp.html @@ -0,0 +1,663 @@ + + + + + + + + + +CWEBP + + + + +

CWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

cwebp − +compress an image file to a WebP file

+ + +

SYNOPSIS

+ + +

cwebp +[options] input_file −o +output_file.webp

+ + +

DESCRIPTION

+ + +

This manual +page documents the cwebp command.

+ +

cwebp +compresses an image using the WebP format. Input format can +be either PNG, JPEG, TIFF, WebP or raw Y’CbCr samples. +Note: Animated PNG and WebP files are not supported.

+ + +

OPTIONS

+ + +

The basic +options are:
+−o
string

+ +

Specify the name of the output +WebP file. If omitted, cwebp will perform compression +but only report statistics. Using "−" as +output name will direct output to ’stdout’.

+ +

−− +string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with a +’−’ for instance. This option must appear +last. Any other options afterward will be +ignored.

+ +

−h, +−help

+ +

A short usage summary.

+ +

−H, +−longhelp

+ +

A summary of all the possible +options.

+ +

−version

+ +

Print the version number (as +major.minor.revision) and exit.

+ +

−lossless

+ +

Encode the image without any +loss. For images with fully transparent area, the invisible +pixel values (R/G/B or Y/U/V) will be preserved only if the +−exact option is used.

+ +

−near_lossless +int

+ +

Specify the level of +near−lossless image preprocessing. This option adjusts +pixel values to help compressibility, but has minimal impact +on the visual quality. It triggers lossless compression mode +automatically. The range is 0 (maximum preprocessing) to 100 +(no preprocessing, the default). The typical value is around +60. Note that lossy with −q 100 can at times +yield better results.

+ +

−q +float

+ +

Specify the compression factor +for RGB channels between 0 and 100. The default is 75.
+In case of lossy compression (default), a small factor +produces a smaller file with lower quality. Best quality is +achieved by using a value of 100.
+In case of lossless compression (specified by the +−lossless option), a small factor enables +faster compression speed, but produces a larger file. +Maximum compression is achieved by using a value of 100.

+ + + + + + + +
+ + +

−z +int

+ + +

Switch on +lossless compression mode with the specified level +between 0 and 9, with level 0 being the fastest, 9 being the +slowest. Fast mode produces larger file size than slower +ones. A good default is −z 6. This option is +actually a shortcut for some predefined settings for quality +and method. If options −q or −m +are subsequently used, they will invalidate the effect of +this option.

+ +

−alpha_q +int

+ +

Specify the compression factor +for alpha compression between 0 and 100. Lossless +compression of alpha is achieved using a value of 100, while +the lower values result in a lossy compression. The default +is 100.

+ +

−preset +string

+ +

Specify a set of +pre−defined parameters to suit a particular type of +source material. Possible values are: default, +photo, picture, drawing, icon, +text. Since −preset overwrites the other +parameters’ values (except the −q one), +this option should preferably appear first in the order of +the arguments.

+ + + + + + + +
+ + +

−m +int

+ + +

Specify the +compression method to use. This parameter controls the trade +off between encoding speed and the compressed file size and +quality. Possible values range from 0 to 6. Default value is +4. When higher values are used, the encoder will spend more +time inspecting additional encoding possibilities and decide +on the quality gain. Lower value can result in faster +processing time at the expense of larger file size and lower +compression quality.

+ +

−crop +x_position y_position width height

+ +

Crop the source to a rectangle +with top−left corner at coordinates +(x_position, y_position) and size width +x height. This cropping area must be fully contained +within the source rectangle. Note: the cropping is applied +before any scaling.

+ +

−resize width +height

+ +

Resize the source to a +rectangle with size width x height. If either +(but not both) of the width or height +parameters is 0, the value will be calculated preserving the +aspect−ratio. Note: scaling is applied after +cropping.

+ + + + + + + + +
+ + + +

−mt

+ + +

Use +multi−threading for encoding, if possible.

+
+ +

−low_memory

+ +

Reduce memory usage of lossy +encoding by saving four times the compressed size +(typically). This will make the encoding slower and the +output slightly different in size and distortion. This flag +is only effective for methods 3 and up, and is off by +default. Note that leaving this flag off will have some side +effects on the bitstream: it forces certain bitstream +features like number of partitions (forced to 1). Note that +a more detailed report of bitstream size is printed by +cwebp when using this option.

+ +

LOSSY +OPTIONS
+These options are only effective when doing lossy encoding +(the default, with or without alpha).
+−size
int

+ +

Specify a target size (in +bytes) to try and reach for the compressed output. The +compressor will make several passes of partial encoding in +order to get as close as possible to this target. If both +−size and −psnr are used, +−size value will prevail.

+ +

−psnr +float

+ +

Specify a target PSNR (in dB) +to try and reach for the compressed output. The compressor +will make several passes of partial encoding in order to get +as close as possible to this target. If both +−size and −psnr are used, +−size value will prevail.

+ +

−pass +int

+ +

Set a maximum number of passes +to use during the dichotomy used by options +−size or −psnr. Maximum value is +10, default is 1. If options −size or +−psnr were used, but −pass +wasn’t specified, a default value of ’6’ +passes will be used.

+ +

−qrange int +int

+ +

Specifies the permissible +interval for the quality factor. This is particularly useful +when using multi-pass (−size or +−psnr options). Default is 0 100. If the +quality factor is outside this range, it will be clamped. If +the minimum value must be less or equal to the maximum +one.

+ + + + + + + +
+ + + +

−af

+ + +

Turns +auto−filter on. This algorithm will spend additional +time optimizing the filtering strength to reach a +well−balanced quality.

+ +

−jpeg_like

+ +

Change the internal parameter +mapping to better match the expected size of JPEG +compression. This flag will generally produce an output file +of similar size to its JPEG equivalent (for the same +−q setting), but with less visual +distortion.

+ +

Advanced options:

+ + + + + + + +
+ + +

−f +int

+ + +

Specify the +strength of the deblocking filter, between 0 (no filtering) +and 100 (maximum filtering). A value of 0 will turn off any +filtering. Higher value will increase the strength of the +filtering process applied after decoding the picture. The +higher the value the smoother the picture will appear. +Typical values are usually in the range of 20 to 50.

+ +

−sharpness +int

+ +

Specify the sharpness of the +filtering (if used). Range is 0 (sharpest) to 7 (least +sharp). Default is 0.

+ +

−strong

+ +

Use strong filtering (if +filtering is being used thanks to the −f +option). Strong filtering is on by default.

+ +

−nostrong

+ +

Disable strong filtering (if +filtering is being used thanks to the −f +option) and use simple filtering instead.

+ +

−sharp_yuv

+ +

Use more accurate and sharper +RGB->YUV conversion if needed. Note that this process is +slower than the default ’fast’ RGB->YUV +conversion.

+ +

−sns +int

+ +

Specify the amplitude of the +spatial noise shaping. Spatial noise shaping (or sns +for short) refers to a general collection of built−in +algorithms used to decide which area of the picture should +use relatively less bits, and where else to better transfer +these bits. The possible range goes from 0 (algorithm is +off) to 100 (the maximal effect). The default value is +50.

+ +

−segments +int

+ +

Change the number of partitions +to use during the segmentation of the sns algorithm. +Segments should be in range 1 to 4. Default value is 4. This +option has no effect for methods 3 and up, unless +−low_memory is used.

+ +

−partition_limit +int

+ +

Degrade quality by limiting the +number of bits used by some macroblocks. Range is 0 (no +degradation, the default) to 100 (full degradation). Useful +values are usually around 30−70 for moderately large +images. In the VP8 format, the so−called control +partition has a limit of 512k and is used to store the +following information: whether the macroblock is skipped, +which segment it belongs to, whether it is coded as intra +4x4 or intra 16x16 mode, and finally the prediction modes to +use for each of the sub−blocks. For a very large +image, 512k only leaves room to few bits per 16x16 +macroblock. The absolute minimum is 4 bits per macroblock. +Skip, segment, and mode information can use up almost all +these 4 bits (although the case is unlikely), which is +problematic for very large images. The partition_limit +factor controls how frequently the most bit−costly +mode (intra 4x4) will be used. This is useful in case the +512k limit is reached and the following message is +displayed: Error code: 6 (PARTITION0_OVERFLOW: Partition +#0 is too big to fit 512k). If using +−partition_limit is not enough to meet the 512k +constraint, one should use less segments in order to save +more header bits per macroblock. See the +−segments option.

+ +

LOGGING +OPTIONS
+These options control the level of output:

+ + + + + + + +
+ + + +

−v

+ + +

Print extra +information (encoding time in particular).

+ +

−print_psnr

+ +

Compute and report average PSNR +(Peak−Signal−To−Noise ratio).

+ +

−print_ssim

+ +

Compute and report average SSIM +(structural similarity metric, see +https://en.wikipedia.org/wiki/SSIM for additional +details).

+ +

−print_lsim

+ +

Compute and report local +similarity metric (sum of lowest error amongst the +collocated pixel neighbors).

+ +

−progress

+ +

Report encoding progress in +percent.

+ + + + + + + + + + + + +
+ + + +

−quiet

+ + +

Do not print +anything.

+ + + +

−short

+ + +

Only print brief +information (output file size and PSNR) for testing +purposes.

+ +

−map +int

+ +

Output additional +ASCII−map of encoding information. Possible map values +range from 1 to 6. This is only meant to help debugging.

+ +

ADDITIONAL +OPTIONS
+More advanced options are:
+−s
width height

+ +

Specify that the input file +actually consists of raw Y’CbCr samples following the +ITU−R BT.601 recommendation, in 4:2:0 linear format. +The luma plane has size width x height.

+ +

−pre +int

+ +

Specify some preprocessing +steps. Using a value of ’2’ will trigger +quality−dependent pseudo−random dithering during +RGBA−>YUVA conversion (lossy compression only).

+ +

−alpha_filter +string

+ +

Specify the predictive +filtering method for the alpha plane. One of +’none’, ’fast’ or +’best’, in increasing complexity and slowness +order. Default is ’fast’. Internally, alpha +filtering is performed using four possible predictions +(none, horizontal, vertical, gradient). The +’best’ mode will try each mode in turn and pick +the one which gives the smaller size. The ’fast’ +mode will just try to form an a priori guess without testing +all modes.

+ +

−alpha_method +int

+ +

Specify the algorithm used for +alpha compression: 0 or 1. Algorithm 0 denotes no +compression, 1 uses WebP lossless format for compression. +The default is 1.

+ + + + + + + +
+ + + +

−exact

+ + +

Preserve RGB values +in transparent area. The default is off, to help +compressibility.

+ +

−blend_alpha +int

+ +

This option blends the alpha +channel (if present) with the source using the background +color specified in hexadecimal as 0xrrggbb. The alpha +channel is afterward reset to the opaque value 255.

+ +

−noalpha

+ +

Using this option will discard +the alpha channel.

+ +

−hint +string

+ +

Specify the hint about input +image type. Possible values are: photo, +picture or graph.

+ +

−metadata +string

+ +

A comma separated list of +metadata to copy from the input to the output if present. +Valid values: all, none, exif, +icc, xmp. The default is none.

+ +

Note: each +input format may not support all combinations.

+ + + + + + + + +
+ + + +

−noasm

+ + +

Disable all +assembly optimizations.

+
+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

cwebp −q +50 -lossless picture.png −o picture_lossless.webp
+cwebp −q 70 picture_with_alpha.png −o +picture_with_alpha.webp
+cwebp −sns 70 −f 50 −size 60000 +picture.png −o picture.webp
+cwebp −o picture.webp −− +−−−picture.png

+ + +

AUTHORS

+ + +

cwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ + +

SEE ALSO

+ + + +

dwebp(1), +gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/cwebp.txt b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/cwebp.txt new file mode 100644 index 00000000..24439d6e --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/cwebp.txt @@ -0,0 +1,340 @@ +CWEBP(1) CWEBP(1) + + + +NAME + cwebp - compress an image file to a WebP file + +SYNOPSIS + cwebp [options] input_file -o output_file.webp + +DESCRIPTION + This manual page documents the cwebp command. + + cwebp compresses an image using the WebP format. Input format can be + either PNG, JPEG, TIFF, WebP or raw Y'CbCr samples. Note: Animated PNG + and WebP files are not supported. + +OPTIONS + The basic options are: + + -o string + Specify the name of the output WebP file. If omitted, cwebp will + perform compression but only report statistics. Using "-" as + output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with a '-' for instance. This option must + appear last. Any other options afterward will be ignored. + + -h, -help + A short usage summary. + + -H, -longhelp + A summary of all the possible options. + + -version + Print the version number (as major.minor.revision) and exit. + + -lossless + Encode the image without any loss. For images with fully trans- + parent area, the invisible pixel values (R/G/B or Y/U/V) will be + preserved only if the -exact option is used. + + -near_lossless int + Specify the level of near-lossless image preprocessing. This + option adjusts pixel values to help compressibility, but has + minimal impact on the visual quality. It triggers lossless com- + pression mode automatically. The range is 0 (maximum preprocess- + ing) to 100 (no preprocessing, the default). The typical value + is around 60. Note that lossy with -q 100 can at times yield + better results. + + -q float + Specify the compression factor for RGB channels between 0 and + 100. The default is 75. + In case of lossy compression (default), a small factor produces + a smaller file with lower quality. Best quality is achieved by + using a value of 100. + In case of lossless compression (specified by the -lossless + option), a small factor enables faster compression speed, but + produces a larger file. Maximum compression is achieved by + using a value of 100. + + -z int Switch on lossless compression mode with the specified level + between 0 and 9, with level 0 being the fastest, 9 being the + slowest. Fast mode produces larger file size than slower ones. A + good default is -z 6. This option is actually a shortcut for + some predefined settings for quality and method. If options -q + or -m are subsequently used, they will invalidate the effect of + this option. + + -alpha_q int + Specify the compression factor for alpha compression between 0 + and 100. Lossless compression of alpha is achieved using a + value of 100, while the lower values result in a lossy compres- + sion. The default is 100. + + -preset string + Specify a set of pre-defined parameters to suit a particular + type of source material. Possible values are: default, photo, + picture, drawing, icon, text. Since -preset overwrites the other + parameters' values (except the -q one), this option should + preferably appear first in the order of the arguments. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. When higher values are used, the encoder will spend + more time inspecting additional encoding possibilities and + decide on the quality gain. Lower value can result in faster + processing time at the expense of larger file size and lower + compression quality. + + -crop x_position y_position width height + Crop the source to a rectangle with top-left corner at coordi- + nates (x_position, y_position) and size width x height. This + cropping area must be fully contained within the source rectan- + gle. Note: the cropping is applied before any scaling. + + -resize width height + Resize the source to a rectangle with size width x height. If + either (but not both) of the width or height parameters is 0, + the value will be calculated preserving the aspect-ratio. Note: + scaling is applied after cropping. + + -mt Use multi-threading for encoding, if possible. + + -low_memory + Reduce memory usage of lossy encoding by saving four times the + compressed size (typically). This will make the encoding slower + and the output slightly different in size and distortion. This + flag is only effective for methods 3 and up, and is off by + default. Note that leaving this flag off will have some side + effects on the bitstream: it forces certain bitstream features + like number of partitions (forced to 1). Note that a more + detailed report of bitstream size is printed by cwebp when using + this option. + + + LOSSY OPTIONS + These options are only effective when doing lossy encoding (the + default, with or without alpha). + + + -size int + Specify a target size (in bytes) to try and reach for the com- + pressed output. The compressor will make several passes of par- + tial encoding in order to get as close as possible to this tar- + get. If both -size and -psnr are used, -size value will prevail. + + -psnr float + Specify a target PSNR (in dB) to try and reach for the com- + pressed output. The compressor will make several passes of par- + tial encoding in order to get as close as possible to this tar- + get. If both -size and -psnr are used, -size value will prevail. + + -pass int + Set a maximum number of passes to use during the dichotomy used + by options -size or -psnr. Maximum value is 10, default is 1. + If options -size or -psnr were used, but -pass wasn't specified, + a default value of '6' passes will be used. + + -qrange int int + Specifies the permissible interval for the quality factor. This + is particularly useful when using multi-pass (-size or -psnr + options). Default is 0 100. If the quality factor is outside + this range, it will be clamped. If the minimum value must be + less or equal to the maximum one. + + -af Turns auto-filter on. This algorithm will spend additional time + optimizing the filtering strength to reach a well-balanced qual- + ity. + + -jpeg_like + Change the internal parameter mapping to better match the + expected size of JPEG compression. This flag will generally pro- + duce an output file of similar size to its JPEG equivalent (for + the same -q setting), but with less visual distortion. + + + Advanced options: + + + -f int Specify the strength of the deblocking filter, between 0 (no + filtering) and 100 (maximum filtering). A value of 0 will turn + off any filtering. Higher value will increase the strength of + the filtering process applied after decoding the picture. The + higher the value the smoother the picture will appear. Typical + values are usually in the range of 20 to 50. + + -sharpness int + Specify the sharpness of the filtering (if used). Range is 0 + (sharpest) to 7 (least sharp). Default is 0. + + -strong + Use strong filtering (if filtering is being used thanks to the + -f option). Strong filtering is on by default. + + -nostrong + Disable strong filtering (if filtering is being used thanks to + the -f option) and use simple filtering instead. + + -sharp_yuv + Use more accurate and sharper RGB->YUV conversion if needed. + Note that this process is slower than the default 'fast' + RGB->YUV conversion. + + -sns int + Specify the amplitude of the spatial noise shaping. Spatial + noise shaping (or sns for short) refers to a general collection + of built-in algorithms used to decide which area of the picture + should use relatively less bits, and where else to better trans- + fer these bits. The possible range goes from 0 (algorithm is + off) to 100 (the maximal effect). The default value is 50. + + -segments int + Change the number of partitions to use during the segmentation + of the sns algorithm. Segments should be in range 1 to 4. + Default value is 4. This option has no effect for methods 3 and + up, unless -low_memory is used. + + -partition_limit int + Degrade quality by limiting the number of bits used by some mac- + roblocks. Range is 0 (no degradation, the default) to 100 (full + degradation). Useful values are usually around 30-70 for moder- + ately large images. In the VP8 format, the so-called control + partition has a limit of 512k and is used to store the following + information: whether the macroblock is skipped, which segment it + belongs to, whether it is coded as intra 4x4 or intra 16x16 + mode, and finally the prediction modes to use for each of the + sub-blocks. For a very large image, 512k only leaves room to + few bits per 16x16 macroblock. The absolute minimum is 4 bits + per macroblock. Skip, segment, and mode information can use up + almost all these 4 bits (although the case is unlikely), which + is problematic for very large images. The partition_limit factor + controls how frequently the most bit-costly mode (intra 4x4) + will be used. This is useful in case the 512k limit is reached + and the following message is displayed: Error code: 6 (PARTI- + TION0_OVERFLOW: Partition #0 is too big to fit 512k). If using + -partition_limit is not enough to meet the 512k constraint, one + should use less segments in order to save more header bits per + macroblock. See the -segments option. + + + LOGGING OPTIONS + These options control the level of output: + + -v Print extra information (encoding time in particular). + + -print_psnr + Compute and report average PSNR (Peak-Signal-To-Noise ratio). + + -print_ssim + Compute and report average SSIM (structural similarity metric, + see https://en.wikipedia.org/wiki/SSIM for additional details). + + -print_lsim + Compute and report local similarity metric (sum of lowest error + amongst the collocated pixel neighbors). + + -progress + Report encoding progress in percent. + + -quiet Do not print anything. + + -short Only print brief information (output file size and PSNR) for + testing purposes. + + -map int + Output additional ASCII-map of encoding information. Possible + map values range from 1 to 6. This is only meant to help debug- + ging. + + + ADDITIONAL OPTIONS + More advanced options are: + + -s width height + Specify that the input file actually consists of raw Y'CbCr sam- + ples following the ITU-R BT.601 recommendation, in 4:2:0 linear + format. The luma plane has size width x height. + + -pre int + Specify some preprocessing steps. Using a value of '2' will + trigger quality-dependent pseudo-random dithering during + RGBA->YUVA conversion (lossy compression only). + + -alpha_filter string + Specify the predictive filtering method for the alpha plane. One + of 'none', 'fast' or 'best', in increasing complexity and slow- + ness order. Default is 'fast'. Internally, alpha filtering is + performed using four possible predictions (none, horizontal, + vertical, gradient). The 'best' mode will try each mode in turn + and pick the one which gives the smaller size. The 'fast' mode + will just try to form an a priori guess without testing all + modes. + + -alpha_method int + Specify the algorithm used for alpha compression: 0 or 1. Algo- + rithm 0 denotes no compression, 1 uses WebP lossless format for + compression. The default is 1. + + -exact Preserve RGB values in transparent area. The default is off, to + help compressibility. + + -blend_alpha int + This option blends the alpha channel (if present) with the + source using the background color specified in hexadecimal as + 0xrrggbb. The alpha channel is afterward reset to the opaque + value 255. + + -noalpha + Using this option will discard the alpha channel. + + -hint string + Specify the hint about input image type. Possible values are: + photo, picture or graph. + + -metadata string + A comma separated list of metadata to copy from the input to the + output if present. Valid values: all, none, exif, icc, xmp. + The default is none. + + Note: each input format may not support all combinations. + + -noasm Disable all assembly optimizations. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + cwebp -q 50 -lossless picture.png -o picture_lossless.webp + cwebp -q 70 picture_with_alpha.png -o picture_with_alpha.webp + cwebp -sns 70 -f 50 -size 60000 picture.png -o picture.webp + cwebp -o picture.webp -- ---picture.png + + +AUTHORS + cwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + dwebp(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + March 17, 2022 CWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/dwebp.html b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/dwebp.html new file mode 100644 index 00000000..30d0db79 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/dwebp.html @@ -0,0 +1,386 @@ + + + + + + + + + +DWEBP + + + + +

DWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

dwebp − +decompress a WebP file to an image file

+ + +

SYNOPSIS

+ + +

dwebp +[options] input_file.webp

+ + +

DESCRIPTION

+ + +

This manual +page documents the dwebp command.

+ +

dwebp +decompresses WebP files into PNG, PAM, PPM or PGM images. +Note: Animated WebP files are not supported.

+ + +

OPTIONS

+ + +

The basic +options are:

+ + + + + + + + +
+ + + +

−h

+ + +

Print usage +summary.

+
+ +

−version

+ +

Print the version number (as +major.minor.revision) and exit.

+ +

−o +string

+ +

Specify the name of the output +file (as PNG format by default). Using "-" as +output name will direct output to ’stdout’.

+ +

−− +string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’−’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "−", the data will be read +from stdin instead of a file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

−bmp

+ + +

Change the output +format to uncompressed BMP.

+ + + +

−tiff

+ + +

Change the output +format to uncompressed TIFF.

+ + + +

−pam

+ + +

Change the output +format to PAM (retains alpha).

+ + + +

−ppm

+ + +

Change the output +format to PPM (discards alpha).

+ + + +

−pgm

+ + +

Change the output +format to PGM. The output consists of luma/chroma samples +instead of RGB, using the IMC4 layout. This option is mainly +for verification and debugging purposes.

+ + + +

−yuv

+ + +

Change the output +format to raw YUV. The output consists of +luma/chroma-U/chroma-V samples instead of RGB, saved +sequentially as individual planes. This option is mainly for +verification and debugging purposes.

+ +

−nofancy

+ +

Don’t use the fancy +upscaler for YUV420. This may lead to jaggy edges +(especially the red ones), but should be faster.

+ +

−nofilter

+ +

Don’t use the in-loop +filtering process even if it is required by the bitstream. +This may produce visible blocks on the non-compliant output, +but it will make the decoding faster.

+ +

−dither +strength

+ +

Specify a dithering +strength between 0 and 100. Dithering is a +post-processing effect applied to chroma components in lossy +compression. It helps by smoothing gradients and avoiding +banding artifacts.

+ +

−alpha_dither

+ +

If the compressed file contains +a transparency plane that was quantized during compression, +this flag will allow dithering the reconstructed plane in +order to generate smoother transparency gradients.

+ +

−nodither

+ +

Disable all dithering +(default).

+ + + + + + + + +
+ + + +

−mt

+ + +

Use multi-threading +for decoding, if possible.

+
+ +

−crop +x_position y_position width height

+ +

Crop the decoded picture to a +rectangle with top-left corner at coordinates +(x_position, y_position) and size width +x height. This cropping area must be fully contained +within the source rectangle. The top-left corner will be +snapped to even coordinates if needed. This option is meant +to reduce the memory needed for cropping large images. Note: +the cropping is applied before any scaling.

+ + + + + + + +
+ + + +

−flip

+ + +

Flip decoded image +vertically (can be useful for OpenGL textures for +instance).

+ +

−resize, +−scale width height

+ +

Rescale the decoded picture to +dimension width x height. This option is +mostly intended to reducing the memory needed to decode +large images, when only a small version is needed +(thumbnail, preview, etc.). Note: scaling is applied +after cropping. If either (but not both) of the +width or height parameters is 0, the value +will be calculated preserving the aspect-ratio.

+ + + + + + + + + + + + + + + + + +
+ + + +

−quiet

+ + +

Do not print +anything.

+ + + +

−v

+ + +

Print extra +information (decoding time in particular).

+ + + +

−noasm

+ + +

Disable all +assembly optimizations.

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

dwebp +picture.webp −o output.png
+dwebp picture.webp −ppm −o output.ppm
+dwebp −o output.ppm −− +−−−picture.webp
+cat picture.webp | dwebp −o − −− +− > output.ppm

+ + +

AUTHORS

+ + +

dwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ + +

SEE ALSO

+ + + +

cwebp(1), +gif2webp(1), webpmux(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+ +

Output file +format details
+PAM: http://netpbm.sourceforge.net/doc/pam.html
+PGM: http://netpbm.sourceforge.net/doc/pgm.html
+PPM: http://netpbm.sourceforge.net/doc/ppm.html
+PNG: http://www.libpng.org/pub/png/png-sitemap.html#info

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/dwebp.txt b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/dwebp.txt new file mode 100644 index 00000000..de82c2e4 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/dwebp.txt @@ -0,0 +1,142 @@ +DWEBP(1) DWEBP(1) + + + +NAME + dwebp - decompress a WebP file to an image file + +SYNOPSIS + dwebp [options] input_file.webp + +DESCRIPTION + This manual page documents the dwebp command. + + dwebp decompresses WebP files into PNG, PAM, PPM or PGM images. Note: + Animated WebP files are not supported. + +OPTIONS + The basic options are: + + -h Print usage summary. + + -version + Print the version number (as major.minor.revision) and exit. + + -o string + Specify the name of the output file (as PNG format by default). + Using "-" as output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must + appear last. Any other options afterward will be ignored. If + the input file is "-", the data will be read from stdin instead + of a file. + + -bmp Change the output format to uncompressed BMP. + + -tiff Change the output format to uncompressed TIFF. + + -pam Change the output format to PAM (retains alpha). + + -ppm Change the output format to PPM (discards alpha). + + -pgm Change the output format to PGM. The output consists of + luma/chroma samples instead of RGB, using the IMC4 layout. This + option is mainly for verification and debugging purposes. + + -yuv Change the output format to raw YUV. The output consists of + luma/chroma-U/chroma-V samples instead of RGB, saved sequen- + tially as individual planes. This option is mainly for verifica- + tion and debugging purposes. + + -nofancy + Don't use the fancy upscaler for YUV420. This may lead to jaggy + edges (especially the red ones), but should be faster. + + -nofilter + Don't use the in-loop filtering process even if it is required + by the bitstream. This may produce visible blocks on the non- + compliant output, but it will make the decoding faster. + + -dither strength + Specify a dithering strength between 0 and 100. Dithering is a + post-processing effect applied to chroma components in lossy + compression. It helps by smoothing gradients and avoiding band- + ing artifacts. + + -alpha_dither + If the compressed file contains a transparency plane that was + quantized during compression, this flag will allow dithering the + reconstructed plane in order to generate smoother transparency + gradients. + + -nodither + Disable all dithering (default). + + -mt Use multi-threading for decoding, if possible. + + -crop x_position y_position width height + Crop the decoded picture to a rectangle with top-left corner at + coordinates (x_position, y_position) and size width x height. + This cropping area must be fully contained within the source + rectangle. The top-left corner will be snapped to even coordi- + nates if needed. This option is meant to reduce the memory + needed for cropping large images. Note: the cropping is applied + before any scaling. + + -flip Flip decoded image vertically (can be useful for OpenGL textures + for instance). + + -resize, -scale width height + Rescale the decoded picture to dimension width x height. This + option is mostly intended to reducing the memory needed to + decode large images, when only a small version is needed (thumb- + nail, preview, etc.). Note: scaling is applied after cropping. + If either (but not both) of the width or height parameters is 0, + the value will be calculated preserving the aspect-ratio. + + -quiet Do not print anything. + + -v Print extra information (decoding time in particular). + + -noasm Disable all assembly optimizations. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + dwebp picture.webp -o output.png + dwebp picture.webp -ppm -o output.ppm + dwebp -o output.ppm -- ---picture.webp + cat picture.webp | dwebp -o - -- - > output.ppm + + +AUTHORS + dwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), gif2webp(1), webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + Output file format details + PAM: http://netpbm.sourceforge.net/doc/pam.html + PGM: http://netpbm.sourceforge.net/doc/pgm.html + PPM: http://netpbm.sourceforge.net/doc/ppm.html + PNG: http://www.libpng.org/pub/png/png-sitemap.html#info + + + + November 17, 2021 DWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/gif2webp.html b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/gif2webp.html new file mode 100644 index 00000000..91649101 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/gif2webp.html @@ -0,0 +1,341 @@ + + + + + + + + + +GIF2WEBP + + + + +

GIF2WEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

gif2webp +− Convert a GIF image to WebP

+ + +

SYNOPSIS

+ + + +

gif2webp +[options] input_file.gif −o +output_file.webp

+ + +

DESCRIPTION

+ + +

This manual +page documents the gif2webp command.

+ + +

gif2webp +converts a GIF image to a WebP image.

+ + +

OPTIONS

+ + +

The basic +options are:
+−o
string

+ +

Specify the name of the output +WebP file. If omitted, gif2webp will perform +conversion but only report statistics. Using +"−" as output name will direct output to +’stdout’.

+ +

−− +string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’−’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "−", the data will be read +from stdin instead of a file.

+ +

−h, +−help

+ +

Usage information.

+ +

−version

+ +

Print the version number (as +major.minor.revision) and exit.

+ + + + + + + + + + + + +
+ + + +

−lossy

+ + +

Encode the image +using lossy compression.

+ + + +

−mixed

+ + +

Mixed compression +mode: optimize compression of the image by picking either +lossy or lossless compression for each frame +heuristically.

+ +

−q +float

+ +

Specify the compression factor +for RGB channels between 0 and 100. The default is 75.
+In case of lossless compression (default), a small factor +enables faster compression speed, but produces a larger +file. Maximum compression is achieved by using a value of +100.
+In case of lossy compression (specified by the −lossy +option), a small factor produces a smaller file with lower +quality. Best quality is achieved by using a value of +100.

+ + + + + + + +
+ + +

−m +int

+ + +

Specify the +compression method to use. This parameter controls the trade +off between encoding speed and the compressed file size and +quality. Possible values range from 0 to 6. Default value is +4. When higher values are used, the encoder will spend more +time inspecting additional encoding possibilities and decide +on the quality gain. Lower value can result is faster +processing time at the expense of larger file size and lower +compression quality.

+ +

−min_size

+ +

Encode image to achieve +smallest size. This disables key frame insertion and picks +the dispose method resulting in the smallest output for each +frame. It uses lossless compression by default, but can be +combined with −q, −m, −lossy or +−mixed options.

+ +

−kmin int +
+−kmax
int

+ +

Specify the minimum and maximum +distance between consecutive key frames (independently +decodable frames) in the output animation. The tool will +insert some key frames into the output animation as needed +so that this criteria is satisfied.
+A ’kmax’ value of 0 will turn off insertion of +key frames. A ’kmax’ value of 1 will result in +all frames being key frames. ’kmin’ value is not +taken into account in both these special cases. Typical +values are in the range 3 to 30. Default values are kmin = +9, kmax = 17 for lossless compression and kmin = 3, kmax = 5 +for lossy compression.
+These two options are relevant only for animated images with +large number of frames (>50).
+When lower values are used, more frames will be converted to +key frames. This may lead to smaller number of frames +required to decode a frame on average, thereby improving the +decoding performance. But this may lead to slightly bigger +file sizes. Higher values may lead to worse decoding +performance, but smaller file sizes.
+Some restrictions:
+(i) kmin < kmax,
+(ii) kmin >= kmax / 2 + 1 and
+(iii) kmax - kmin <= 30.
+If any of these restrictions are not met, they will be +enforced automatically.

+ +

−metadata +string

+ +

A comma separated list of +metadata to copy from the input to the output if present. +Valid values: all, none, icc, +xmp. The default is xmp.

+ + + + + + + + + + + + +
+ + +

−f +int

+ + +

For lossy encoding +only (specified by the −lossy option). Specify the +strength of the deblocking filter, between 0 (no filtering) +and 100 (maximum filtering). A value of 0 will turn off any +filtering. Higher value will increase the strength of the +filtering process applied after decoding the picture. The +higher the value the smoother the picture will appear. +Typical values are usually in the range of 20 to 50.

+ + + +

−mt

+ + +

Use multi-threading +for encoding, if possible.

+ + +

−loop_compatibility

+ +

If enabled, handle the loop +information in a compatible fashion for Chrome version prior +to M62 (inclusive) and Firefox.

+ + + + + + + + + + + + + + +
+ + + +

−v

+ + +

Print extra +information.

+
+ + + +

−quiet

+ + +

Do not print +anything.

+
+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

gif2webp +picture.gif −o picture.webp
+gif2webp −q 70 picture.gif −o picture.webp
+gif2webp −lossy −m 3 picture.gif −o +picture_lossy.webp
+gif2webp −lossy −f 50 picture.gif −o +picture.webp
+gif2webp −q 70 −o picture.webp −− +−−−picture.gif
+cat picture.gif | gif2webp −o − −− +− > output.webp

+ + +

AUTHORS

+ + + +

gif2webp +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Urvang Joshi <urvang@google.com>, +for the Debian project (and may be used by others).

+ + +

SEE ALSO

+ + + +

cwebp(1), +dwebp(1), webpmux(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/gif2webp.txt b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/gif2webp.txt new file mode 100644 index 00000000..724953e8 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/gif2webp.txt @@ -0,0 +1,152 @@ +GIF2WEBP(1) GIF2WEBP(1) + + + +NAME + gif2webp - Convert a GIF image to WebP + +SYNOPSIS + gif2webp [options] input_file.gif -o output_file.webp + +DESCRIPTION + This manual page documents the gif2webp command. + + gif2webp converts a GIF image to a WebP image. + +OPTIONS + The basic options are: + + -o string + Specify the name of the output WebP file. If omitted, gif2webp + will perform conversion but only report statistics. Using "-" + as output name will direct output to 'stdout'. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must + appear last. Any other options afterward will be ignored. If + the input file is "-", the data will be read from stdin instead + of a file. + + -h, -help + Usage information. + + -version + Print the version number (as major.minor.revision) and exit. + + -lossy Encode the image using lossy compression. + + -mixed Mixed compression mode: optimize compression of the image by + picking either lossy or lossless compression for each frame + heuristically. + + -q float + Specify the compression factor for RGB channels between 0 and + 100. The default is 75. + In case of lossless compression (default), a small factor + enables faster compression speed, but produces a larger file. + Maximum compression is achieved by using a value of 100. + In case of lossy compression (specified by the -lossy option), a + small factor produces a smaller file with lower quality. Best + quality is achieved by using a value of 100. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. When higher values are used, the encoder will spend + more time inspecting additional encoding possibilities and + decide on the quality gain. Lower value can result is faster + processing time at the expense of larger file size and lower + compression quality. + + -min_size + Encode image to achieve smallest size. This disables key frame + insertion and picks the dispose method resulting in the smallest + output for each frame. It uses lossless compression by default, + but can be combined with -q, -m, -lossy or -mixed options. + + -kmin int + + -kmax int + Specify the minimum and maximum distance between consecutive key + frames (independently decodable frames) in the output animation. + The tool will insert some key frames into the output animation + as needed so that this criteria is satisfied. + A 'kmax' value of 0 will turn off insertion of key frames. A + 'kmax' value of 1 will result in all frames being key frames. + 'kmin' value is not taken into account in both these special + cases. Typical values are in the range 3 to 30. Default values + are kmin = 9, kmax = 17 for lossless compression and kmin = 3, + kmax = 5 for lossy compression. + These two options are relevant only for animated images with + large number of frames (>50). + When lower values are used, more frames will be converted to key + frames. This may lead to smaller number of frames required to + decode a frame on average, thereby improving the decoding per- + formance. But this may lead to slightly bigger file sizes. + Higher values may lead to worse decoding performance, but + smaller file sizes. + Some restrictions: + (i) kmin < kmax, + (ii) kmin >= kmax / 2 + 1 and + (iii) kmax - kmin <= 30. + If any of these restrictions are not met, they will be enforced + automatically. + + -metadata string + A comma separated list of metadata to copy from the input to the + output if present. Valid values: all, none, icc, xmp. The + default is xmp. + + -f int For lossy encoding only (specified by the -lossy option). Spec- + ify the strength of the deblocking filter, between 0 (no filter- + ing) and 100 (maximum filtering). A value of 0 will turn off + any filtering. Higher value will increase the strength of the + filtering process applied after decoding the picture. The higher + the value the smoother the picture will appear. Typical values + are usually in the range of 20 to 50. + + -mt Use multi-threading for encoding, if possible. + + -loop_compatibility + If enabled, handle the loop information in a compatible fashion + for Chrome version prior to M62 (inclusive) and Firefox. + + -v Print extra information. + + -quiet Do not print anything. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + gif2webp picture.gif -o picture.webp + gif2webp -q 70 picture.gif -o picture.webp + gif2webp -lossy -m 3 picture.gif -o picture_lossy.webp + gif2webp -lossy -f 50 picture.gif -o picture.webp + gif2webp -q 70 -o picture.webp -- ---picture.gif + cat picture.gif | gif2webp -o - -- - > output.webp + + +AUTHORS + gif2webp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Urvang Joshi , for + the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), dwebp(1), webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 GIF2WEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/img2webp.html b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/img2webp.html new file mode 100644 index 00000000..62ef60a3 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/img2webp.html @@ -0,0 +1,245 @@ + + + + + + + + + +IMG2WEBP + + + + +

IMG2WEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+FILE-LEVEL OPTIONS
+PER-FRAME OPTIONS
+EXAMPLE
+BUGS
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

img2webp +− create animated WebP file from a sequence of input +images.

+ + +

SYNOPSIS

+ + + +

img2webp +[file_options] [[frame_options] frame_file]...
+img2webp argument_file_name

+ + +

DESCRIPTION

+ + +

This manual +page documents the img2webp command.

+ + +

img2webp +compresses a sequence of images using the animated WebP +format. Input images can either be PNG, JPEG, TIFF or WebP. +If a single file name (not starting with the character +’−’) is supplied as the argument, the +command line arguments are actually tokenized from this +file. This allows for easy scripting or using a large number +of arguments.

+ + +

FILE-LEVEL OPTIONS

+ + +

The file-level +options are applied at the beginning of the compression +process, before the input frames are read.
+−o
string

+ +

Specify the name of the output +WebP file.

+ +

−min_size

+ +

Encode images to achieve +smallest size. This disables key frame insertion and picks +the parameters resulting in the smallest output for each +frame. It uses lossless compression by default, but can be +combined with −q, −m, −lossy or +−mixed options.

+ +

−kmin int +
+−kmax
int

+ +

Specify the minimum and maximum +distance between consecutive key frames (independently +decodable frames) in the output animation. The tool will +insert some key frames into the output animation as needed +so that this criteria is satisfied.
+−mixed
Mixed compression mode: optimize +compression of the image by picking either lossy or lossless +compression for each frame heuristically. This global option +disables the local option -lossy and -lossless +.

+ +

−loop +int

+ +

Specifies the number of times +the animation should loop. Using ’0’ means +’loop indefinitely’.

+ + + + + + + + +
+ + + +

−v

+ + +

Be more +verbose.

+
+ +

−h, +−help

+ +

A short usage summary.

+ +

−version

+ +

Print the version numbers of +the relevant libraries used.

+ + +

PER-FRAME OPTIONS

+ + +

The per-frame +options are applied for the images following as arguments in +the command line. They can be modified any number of times +preceding each particular input image.

+ + + + + + + + +
+ + +

−d +int

+ + +

Specify the image +duration in milliseconds.

+
+ +

−lossless, +−lossy

+ +

Compress the next image(s) +using lossless or lossy compression mode. The default mode +is lossless.

+ +

−q +float

+ +

Specify the compression factor +between 0 and 100. The default is 75.

+ + + + + + + +
+ + +

−m +int

+ + +

Specify the +compression method to use. This parameter controls the trade +off between encoding speed and the compressed file size and +quality. Possible values range from 0 to 6. Default value is +4.

+ + +

EXAMPLE

+ + +

img2webp -loop +2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

AUTHORS

+ + + +

img2webp +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Pascal Massimino +<pascal.massimino@gmail.com>, for the Debian project +(and may be used by others).

+ + +

SEE ALSO

+ + + +

webpmux(1), +gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/img2webp.txt b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/img2webp.txt new file mode 100644 index 00000000..1ff3de42 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/img2webp.txt @@ -0,0 +1,108 @@ +IMG2WEBP(1) IMG2WEBP(1) + + + +NAME + img2webp - create animated WebP file from a sequence of input images. + +SYNOPSIS + img2webp [file_options] [[frame_options] frame_file]... + img2webp argument_file_name + +DESCRIPTION + This manual page documents the img2webp command. + + img2webp compresses a sequence of images using the animated WebP for- + mat. Input images can either be PNG, JPEG, TIFF or WebP. If a single + file name (not starting with the character '-') is supplied as the + argument, the command line arguments are actually tokenized from this + file. This allows for easy scripting or using a large number of argu- + ments. + +FILE-LEVEL OPTIONS + The file-level options are applied at the beginning of the compression + process, before the input frames are read. + + -o string + Specify the name of the output WebP file. + + -min_size + Encode images to achieve smallest size. This disables key frame + insertion and picks the parameters resulting in the smallest + output for each frame. It uses lossless compression by default, + but can be combined with -q, -m, -lossy or -mixed options. + + -kmin int + + -kmax int + Specify the minimum and maximum distance between consecutive key + frames (independently decodable frames) in the output animation. + The tool will insert some key frames into the output animation + as needed so that this criteria is satisfied. + -mixed Mixed compression mode: optimize compression of the image + by picking either lossy or lossless compression for each frame + heuristically. This global option disables the local option + -lossy and -lossless . + + -loop int + Specifies the number of times the animation should loop. Using + '0' means 'loop indefinitely'. + + -v Be more verbose. + + -h, -help + A short usage summary. + + -version + Print the version numbers of the relevant libraries used. + + +PER-FRAME OPTIONS + The per-frame options are applied for the images following as arguments + in the command line. They can be modified any number of times preceding + each particular input image. + + -d int Specify the image duration in milliseconds. + + -lossless, -lossy + Compress the next image(s) using lossless or lossy compression + mode. The default mode is lossless. + + -q float + Specify the compression factor between 0 and 100. The default is + 75. + + -m int Specify the compression method to use. This parameter controls + the trade off between encoding speed and the compressed file + size and quality. Possible values range from 0 to 6. Default + value is 4. + + +EXAMPLE + img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +AUTHORS + img2webp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Pascal Massimino , for the Debian project (and may be used by others). + + +SEE ALSO + webpmux(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + January 5, 2022 IMG2WEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/tools.md b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/tools.md new file mode 100644 index 00000000..853af819 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/tools.md @@ -0,0 +1,512 @@ +# WebP tools + +## Encoding tool + +The examples/ directory contains tools for encoding (cwebp) and decoding (dwebp) +images. + +The easiest use should look like: + +```shell +cwebp input.png -q 80 -o output.webp +``` + +which will convert the input file to a WebP file using a quality factor of 80 on +a 0->100 scale (0 being the lowest quality, 100 being the best. Default value is +75). + +You might want to try the `-lossless` flag too, which will compress the source +(in RGBA format) without any loss. The `-q` quality parameter will in this case +control the amount of processing time spent trying to make the output file as +small as possible. + +A longer list of options is available using the `-longhelp` command line flag: + +```shell +> cwebp -longhelp +Usage: + cwebp [-preset <...>] [options] in_file [-o out_file] +``` + +If input size (-s) for an image is not specified, it is assumed to be a PNG, +JPEG, TIFF or WebP file. Note: Animated PNG and WebP files are not supported. + +Options: + +``` +-h / -help ............. short help +-H / -longhelp ......... long help +-q ............. quality factor (0:small..100:big), default=75 +-alpha_q ......... transparency-compression quality (0..100), + default=100 +-preset ....... preset setting, one of: + default, photo, picture, + drawing, icon, text + -preset must come first, as it overwrites other parameters +-z ............... activates lossless preset with given + level in [0:fast, ..., 9:slowest] + +-m ............... compression method (0=fast, 6=slowest), default=4 +-segments ........ number of segments to use (1..4), default=4 +-size ............ target size (in bytes) +-psnr .......... target PSNR (in dB. typically: 42) + +-s ......... input size (width x height) for YUV +-sns ............. spatial noise shaping (0:off, 100:max), default=50 +-f ............... filter strength (0=off..100), default=60 +-sharpness ....... filter sharpness (0:most .. 7:least sharp), default=0 +-strong ................ use strong filter instead of simple (default) +-nostrong .............. use simple filter instead of strong +-sharp_yuv ............. use sharper (and slower) RGB->YUV conversion +-partition_limit . limit quality to fit the 512k limit on + the first partition (0=no degradation ... 100=full) +-pass ............ analysis pass number (1..10) +-qrange .... specifies the permissible quality range + (default: 0 100) +-crop .. crop picture with the given rectangle +-resize ........ resize picture (*after* any cropping) +-mt .................... use multi-threading if available +-low_memory ............ reduce memory usage (slower encoding) +-map ............. print map of extra info +-print_psnr ............ prints averaged PSNR distortion +-print_ssim ............ prints averaged SSIM distortion +-print_lsim ............ prints local-similarity distortion +-d .......... dump the compressed output (PGM file) +-alpha_method .... transparency-compression method (0..1), default=1 +-alpha_filter . predictive filtering for alpha plane, + one of: none, fast (default) or best +-exact ................. preserve RGB values in transparent area, default=off +-blend_alpha ..... blend colors against background color + expressed as RGB values written in + hexadecimal, e.g. 0xc0e0d0 for red=0xc0 + green=0xe0 and blue=0xd0 +-noalpha ............... discard any transparency information +-lossless .............. encode image losslessly, default=off +-near_lossless ... use near-lossless image + preprocessing (0..100=off), default=100 +-hint ......... specify image characteristics hint, + one of: photo, picture or graph + +-metadata ..... comma separated list of metadata to + copy from the input to the output if present. + Valid values: all, none (default), exif, icc, xmp + +-short ................. condense printed message +-quiet ................. don't print anything +-version ............... print version number and exit +-noasm ................. disable all assembly optimizations +-v ..................... verbose, e.g. print encoding/decoding times +-progress .............. report encoding progress +``` + +Experimental Options: + +``` +-jpeg_like ............. roughly match expected JPEG size +-af .................... auto-adjust filter strength +-pre ............. pre-processing filter +``` + +The main options you might want to try in order to further tune the visual +quality are: + +-preset -sns -f -m + +Namely: + +* `preset` will set up a default encoding configuration targeting a particular + type of input. It should appear first in the list of options, so that + subsequent options can take effect on top of this preset. Default value is + 'default'. +* `sns` will progressively turn on (when going from 0 to 100) some additional + visual optimizations (like: segmentation map re-enforcement). This option + will balance the bit allocation differently. It tries to take bits from the + "easy" parts of the picture and use them in the "difficult" ones instead. + Usually, raising the sns value (at fixed -q value) leads to larger files, + but with better quality. Typical value is around '75'. +* `f` option directly links to the filtering strength used by the codec's + in-loop processing. The higher the value, the smoother the highly-compressed + area will look. This is particularly useful when aiming at very small files. + Typical values are around 20-30. Note that using the option + -strong/-nostrong will change the type of filtering. Use "-f 0" to turn + filtering off. +* `m` controls the trade-off between encoding speed and quality. Default is 4. + You can try -m 5 or -m 6 to explore more (time-consuming) encoding + possibilities. A lower value will result in faster encoding at the expense + of quality. + +## Decoding tool + +There is a decoding sample in examples/dwebp.c which will take a .webp file and +decode it to a PNG image file (amongst other formats). This is simply to +demonstrate the use of the API. You can verify the file test.webp decodes to +exactly the same as test_ref.ppm by using: + +```shell +cd examples +./dwebp test.webp -ppm -o test.ppm +diff test.ppm test_ref.ppm +``` + +The full list of options is available using -h: + +```shell +> dwebp -h +Usage: dwebp in_file [options] [-o out_file] +``` + +Decodes the WebP image file to PNG format [Default]. Note: Animated WebP files +are not supported. + +Use following options to convert into alternate image formats: + +``` +-pam ......... save the raw RGBA samples as a color PAM +-ppm ......... save the raw RGB samples as a color PPM +-bmp ......... save as uncompressed BMP format +-tiff ........ save as uncompressed TIFF format +-pgm ......... save the raw YUV samples as a grayscale PGM + file with IMC4 layout +-yuv ......... save the raw YUV samples in flat layout +``` + +Other options are: + +``` +-version ..... print version number and exit +-nofancy ..... don't use the fancy YUV420 upscaler +-nofilter .... disable in-loop filtering +-nodither .... disable dithering +-dither .. dithering strength (in 0..100) +-alpha_dither use alpha-plane dithering if needed +-mt .......... use multi-threading +-crop ... crop output with the given rectangle +-resize ......... resize output (*after* any cropping) +-flip ........ flip the output vertically +-alpha ....... only save the alpha plane +-incremental . use incremental decoding (useful for tests) +-h ........... this help message +-v ........... verbose (e.g. print encoding/decoding times) +-quiet ....... quiet mode, don't print anything +-noasm ....... disable all assembly optimizations +``` + +## WebP file analysis tool + +`webpinfo` can be used to print out the chunk level structure and bitstream +header information of WebP files. It can also check if the files are of valid +WebP format. + +Usage: + +```shell +webpinfo [options] in_files +``` + +Note: there could be multiple input files; options must come before input files. + +Options: + +``` +-version ........... Print version number and exit. +-quiet ............. Do not show chunk parsing information. +-diag .............. Show parsing error diagnosis. +-summary ........... Show chunk stats summary. +-bitstream_info .... Parse bitstream header. +``` + +## Visualization tool + +There's a little self-serve visualization tool called 'vwebp' under the +examples/ directory. It uses OpenGL to open a simple drawing window and show a +decoded WebP file. It's not yet integrated in the automake build system, but you +can try to manually compile it using the recommendations below. + +Usage: + +```shell +vwebp in_file [options] +``` + +Decodes the WebP image file and visualize it using OpenGL + +Options are: + +``` +-version ..... print version number and exit +-noicc ....... don't use the icc profile if present +-nofancy ..... don't use the fancy YUV420 upscaler +-nofilter .... disable in-loop filtering +-dither dithering strength (0..100), default=50 +-noalphadither disable alpha plane dithering +-usebgcolor .. display background color +-mt .......... use multi-threading +-info ........ print info +-h ........... this help message +``` + +Keyboard shortcuts: + +``` +'c' ................ toggle use of color profile +'b' ................ toggle background color display +'i' ................ overlay file information +'d' ................ disable blending & disposal (debug) +'q' / 'Q' / ESC .... quit +``` + +### Building + +Prerequisites: + +1. OpenGL & OpenGL Utility Toolkit (GLUT) + + Linux: `sudo apt-get install freeglut3-dev mesa-common-dev` + + Mac + Xcode: These libraries should be available in the OpenGL / GLUT + frameworks. + + Windows: http://freeglut.sourceforge.net/index.php#download + +2. (Optional) qcms (Quick Color Management System) + + 1. Download qcms from Mozilla / Chromium: + https://hg.mozilla.org/mozilla-central/file/0e7639e3bdfb/gfx/qcms + https://source.chromium.org/chromium/chromium/src/+/main:third_party/qcms/;drc=d4a2f8e1ed461d8fc05ed88d1ae2dc94c9773825 + 2. Build and archive the source files as libqcms.a / qcms.lib + 3. Update makefile.unix / Makefile.vc + 1. Define WEBP_HAVE_QCMS + 2. Update include / library paths to reference the qcms directory. + +Build using makefile.unix / Makefile.vc: + +```shell +$ make -f makefile.unix examples/vwebp +> nmake /f Makefile.vc CFG=release-static \ + ../obj/x64/release-static/bin/vwebp.exe +``` + +## Animation creation tool + +The utility `img2webp` can turn a sequence of input images (PNG, JPEG, ...) into +an animated WebP file. It offers fine control over duration, encoding modes, +etc. + +Usage: + +```shell +img2webp [file_options] [[frame_options] frame_file]... +``` + +File-level options (only used at the start of compression): + +``` +-min_size ............ minimize size +-loop .......... loop count (default: 0, = infinite loop) +-kmax .......... maximum number of frame between key-frames + (0=only keyframes) +-kmin .......... minimum number of frame between key-frames + (0=disable key-frames altogether) +-mixed ............... use mixed lossy/lossless automatic mode +-v ................... verbose mode +-h ................... this help +-version ............. print version number and exit +``` + +Per-frame options (only used for subsequent images input): + +``` +-d ............. frame duration in ms (default: 100) +-lossless ........... use lossless mode (default) +-lossy ... ........... use lossy mode +-q ........... quality +-m ............. method to use +``` + +example: `img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp` + +Note: if a single file name is passed as the argument, the arguments will be +tokenized from this file. The file name must not start with the character '-'. + +## Animated GIF conversion + +Animated GIF files can be converted to WebP files with animation using the +gif2webp utility available under examples/. The files can then be viewed using +vwebp. + +Usage: + +```shell +gif2webp [options] gif_file -o webp_file +``` + +Options: + +``` +-h / -help ............. this help +-lossy ................. encode image using lossy compression +-mixed ................. for each frame in the image, pick lossy + or lossless compression heuristically +-q ............. quality factor (0:small..100:big) +-m ............... compression method (0=fast, 6=slowest) +-min_size .............. minimize output size (default:off) + lossless compression by default; can be + combined with -q, -m, -lossy or -mixed + options +-kmin ............ min distance between key frames +-kmax ............ max distance between key frames +-f ............... filter strength (0=off..100) +-metadata ..... comma separated list of metadata to + copy from the input to the output if present + Valid values: all, none, icc, xmp (default) +-loop_compatibility .... use compatibility mode for Chrome + version prior to M62 (inclusive) +-mt .................... use multi-threading if available + +-version ............... print version number and exit +-v ..................... verbose +-quiet ................. don't print anything +``` + +### Building + +With the libgif development files installed, gif2webp can be built using +makefile.unix: + +```shell +$ make -f makefile.unix examples/gif2webp +``` + +or using autoconf: + +```shell +$ ./configure --enable-everything +$ make +``` + +## Comparison of animated images + +Test utility anim_diff under examples/ can be used to compare two animated +images (each can be GIF or WebP). + +Usage: + +```shell +anim_diff [options] +``` + +Options: + +``` +-dump_frames dump decoded frames in PAM format +-min_psnr ... minimum per-frame PSNR +-raw_comparison ..... if this flag is not used, RGB is + premultiplied before comparison +-max_diff ..... maximum allowed difference per channel + between corresponding pixels in subsequent + frames +-h .................. this help +-version ............ print version number and exit +``` + +### Building + +With the libgif development files installed, anim_diff can be built using +makefile.unix: + +```shell +$ make -f makefile.unix examples/anim_diff +``` + +or using autoconf: + +```shell +$ ./configure --enable-everything +$ make +``` + +## WebP Mux tool + +The examples/ directory contains a tool (webpmux) for manipulating WebP files. +The webpmux tool can be used to create an extended format WebP file and also to +extract or strip relevant data from such a file. + +A list of options is available using the -help command line flag: + +```shell +> webpmux -help +Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT + webpmux -set SET_OPTIONS INPUT -o OUTPUT + webpmux -duration DURATION_OPTIONS [-duration ...] + INPUT -o OUTPUT + webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT + webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT] + [-bgcolor BACKGROUND_COLOR] -o OUTPUT + webpmux -info INPUT + webpmux [-h|-help] + webpmux -version + webpmux argument_file_name + +GET_OPTIONS: + Extract relevant data: + icc get ICC profile + exif get EXIF metadata + xmp get XMP metadata + frame n get nth frame + +SET_OPTIONS: + Set color profile/metadata/parameters: + loop LOOP_COUNT set the loop count + bgcolor BACKGROUND_COLOR set the animation background color + icc file.icc set ICC profile + exif file.exif set EXIF metadata + xmp file.xmp set XMP metadata + where: 'file.icc' contains the ICC profile to be set, + 'file.exif' contains the EXIF metadata to be set + 'file.xmp' contains the XMP metadata to be set + +DURATION_OPTIONS: + Set duration of selected frames: + duration set duration for all frames + duration,frame set duration of a particular frame + duration,start,end set duration of frames in the + interval [start,end]) + where: 'duration' is the duration in milliseconds + 'start' is the start frame index + 'end' is the inclusive end frame index + The special 'end' value '0' means: last frame. + +STRIP_OPTIONS: + Strip color profile/metadata: + icc strip ICC profile + exif strip EXIF metadata + xmp strip XMP metadata + +FRAME_OPTIONS(i): + Create animation: + file_i +di[+xi+yi[+mi[bi]]] + where: 'file_i' is the i'th animation frame (WebP format), + 'di' is the pause duration before next frame, + 'xi','yi' specify the image offset for this frame, + 'mi' is the dispose method for this frame (0 or 1), + 'bi' is the blending method for this frame (+b or -b) + +LOOP_COUNT: + Number of times to repeat the animation. + Valid range is 0 to 65535 [Default: 0 (infinite)]. + +BACKGROUND_COLOR: + Background color of the canvas. + A,R,G,B + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying + the Alpha, Red, Green and Blue component values respectively + [Default: 255,255,255,255] + +INPUT & OUTPUT are in WebP format. + +Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be +valid. + +Note: if a single file name is passed as the argument, the arguments will be +tokenized from this file. The file name must not start with the character '-'. +``` diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/vwebp.html b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/vwebp.html new file mode 100644 index 00000000..74839c81 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/vwebp.html @@ -0,0 +1,288 @@ + + + + + + + + + +VWEBP + + + + +

VWEBP

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+KEYBOARD SHORTCUTS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

vwebp − +decompress a WebP file and display it in a window

+ + +

SYNOPSIS

+ + +

vwebp +[options] input_file.webp

+ + +

DESCRIPTION

+ + +

This manual +page documents the vwebp command.

+ +

vwebp +decompresses a WebP file and displays it in a window using +OpenGL.

+ + +

OPTIONS

+ + + + + + + + + +
+ + + +

−h

+ + +

Print usage +summary.

+
+ +

−version

+ +

Print version number and +exit.

+ + + + + + + + +
+ + + +

−noicc

+ + +

Don’t use the +ICC profile if present.

+
+ +

−nofancy

+ +

Don’t use the fancy +YUV420 upscaler.

+ +

−nofilter

+ +

Disable in-loop filtering.

+ +

−dither +strength

+ +

Specify a dithering +strength between 0 and 100. Dithering is a +post-processing effect applied to chroma components in lossy +compression. It helps by smoothing gradients and avoiding +banding artifacts. Default: 50.

+ + +

−noalphadither

+ +

By default, quantized +transparency planes are dithered during decompression, to +smooth the gradients. This flag will prevent this +dithering.

+ +

−usebgcolor

+ +

Fill transparent areas with the +bitstream’s own background color instead of +checkerboard only. Default is white for non-animated +images.

+ + + + + + + + + + + + +
+ + + +

−mt

+ + +

Use multi-threading +for decoding, if possible.

+ + + +

−info

+ + +

Display image +information on top of the decoded image.

+ +

−− +string

+ +

Explicitly specify the input +file. This option is useful if the input file starts with an +’−’ for instance. This option must appear +last. Any other options afterward will be ignored. If +the input file is "−", the data will be read +from stdin instead of a file.

+ + +

KEYBOARD SHORTCUTS

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

’c’

+ + +

Toggle use of color +profile.

+ + + +

’b’

+ + +

Toggle display of +background color.

+ + + +

’i’

+ + +

Overlay file +information.

+ + + +

’d’

+ + +

Disable blending +and disposal process, for debugging purposes.

+ +

’q’ / +’Q’ / ESC

+ +

Quit.

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

vwebp +picture.webp
+vwebp picture.webp -mt -dither 0
+vwebp −− −−−picture.webp

+ + +

AUTHORS

+ + +

vwebp is +a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written for the Debian project (and may be used by +others).

+ + +

SEE ALSO

+ + + +

dwebp(1) +
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/vwebp.txt b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/vwebp.txt new file mode 100644 index 00000000..1295fa2f --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/vwebp.txt @@ -0,0 +1,103 @@ +VWEBP(1) VWEBP(1) + + + +NAME + vwebp - decompress a WebP file and display it in a window + +SYNOPSIS + vwebp [options] input_file.webp + +DESCRIPTION + This manual page documents the vwebp command. + + vwebp decompresses a WebP file and displays it in a window using + OpenGL. + +OPTIONS + -h Print usage summary. + + -version + Print version number and exit. + + -noicc Don't use the ICC profile if present. + + -nofancy + Don't use the fancy YUV420 upscaler. + + -nofilter + Disable in-loop filtering. + + -dither strength + Specify a dithering strength between 0 and 100. Dithering is a + post-processing effect applied to chroma components in lossy + compression. It helps by smoothing gradients and avoiding band- + ing artifacts. Default: 50. + + -noalphadither + By default, quantized transparency planes are dithered during + decompression, to smooth the gradients. This flag will prevent + this dithering. + + -usebgcolor + Fill transparent areas with the bitstream's own background color + instead of checkerboard only. Default is white for non-animated + images. + + -mt Use multi-threading for decoding, if possible. + + -info Display image information on top of the decoded image. + + -- string + Explicitly specify the input file. This option is useful if the + input file starts with an '-' for instance. This option must + appear last. Any other options afterward will be ignored. If + the input file is "-", the data will be read from stdin instead + of a file. + + + + KEYBOARD SHORTCUTS + + 'c' Toggle use of color profile. + + 'b' Toggle display of background color. + + 'i' Overlay file information. + + 'd' Disable blending and disposal process, for debugging purposes. + + 'q' / 'Q' / ESC + Quit. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + vwebp picture.webp + vwebp picture.webp -mt -dither 0 + vwebp -- ---picture.webp + + +AUTHORS + vwebp is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written for the Debian project (and may be used by + others). + + +SEE ALSO + dwebp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 VWEBP(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpinfo.html b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpinfo.html new file mode 100644 index 00000000..f1f24b45 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpinfo.html @@ -0,0 +1,184 @@ + + + + + + + + + +WEBPINFO + + + + +

WEBPINFO

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+INPUT
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

webpinfo +− print out the chunk level structure of WebP files +along with basic integrity checks.

+ + +

SYNOPSIS

+ + + +

webpinfo +OPTIONS INPUT
+webpinfo +[−h|−help|−H|−longhelp]

+ + +

DESCRIPTION

+ + +

This manual +page documents the webpinfo command.

+ + +

webpinfo +can be used to print out the chunk level structure and +bitstream header information of WebP files. It can also +check if the files are of valid WebP format.

+ + +

OPTIONS

+ + + +

−version

+ +

Print the version number (as +major.minor.revision) and exit.

+ + + + + + + + + + + + + + +
+ + + +

−quiet

+ + +

Do not show chunk +parsing information.

+
+ + + +

−diag

+ + +

Show parsing error +diagnosis.

+
+ +

−summary

+ +

Show chunk stats summary.

+ + +

−bitstream_info

+ +

Parse bitstream header.

+ +

−h, +−help

+ +

A short usage summary.

+ +

−H, +−longhelp

+ +

Detailed usage +instructions.

+ + +

INPUT

+ + +

Input files in +WebP format. Input files must come last, following options +(if any). There can be multiple input files.

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

webpinfo +−h
+webpinfo −diag −summary input_file.webp
+webpinfo −bitstream_info input_file_1.webp +input_file_2.webp
+webpinfo *.webp

+ + +

AUTHORS

+ + + +

webpinfo +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Hui Su <huisu@google.com>, for the +Debian project (and may be used by others).

+ + +

SEE ALSO

+ + + +

webpmux(1) +
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpinfo.txt b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpinfo.txt new file mode 100644 index 00000000..3229dd1c --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpinfo.txt @@ -0,0 +1,78 @@ +WEBPINFO(1) WEBPINFO(1) + + + +NAME + webpinfo - print out the chunk level structure of WebP files along with + basic integrity checks. + +SYNOPSIS + webpinfo OPTIONS INPUT + webpinfo [-h|-help|-H|-longhelp] + + +DESCRIPTION + This manual page documents the webpinfo command. + + webpinfo can be used to print out the chunk level structure and bit- + stream header information of WebP files. It can also check if the files + are of valid WebP format. + + +OPTIONS + -version + Print the version number (as major.minor.revision) and exit. + + -quiet Do not show chunk parsing information. + + -diag Show parsing error diagnosis. + + -summary + Show chunk stats summary. + + -bitstream_info + Parse bitstream header. + + -h, -help + A short usage summary. + + -H, -longhelp + Detailed usage instructions. + + +INPUT + Input files in WebP format. Input files must come last, following + options (if any). There can be multiple input files. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + webpinfo -h + webpinfo -diag -summary input_file.webp + webpinfo -bitstream_info input_file_1.webp input_file_2.webp + webpinfo *.webp + + +AUTHORS + webpinfo is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Hui Su , for the + Debian project (and may be used by others). + + +SEE ALSO + webpmux(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 WEBPINFO(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpmux.html b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpmux.html new file mode 100644 index 00000000..c8c4f586 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpmux.html @@ -0,0 +1,436 @@ + + + + + + + + + +WEBPMUX + + + + +

WEBPMUX

+ +NAME
+SYNOPSIS
+DESCRIPTION
+OPTIONS
+BUGS
+EXAMPLES
+AUTHORS
+SEE ALSO
+ +
+ + + +

NAME

+ + +

webpmux − +create animated WebP files from non−animated WebP +images, extract frames from animated WebP images, and manage +XMP/EXIF metadata and ICC profile.

+ + +

SYNOPSIS

+ + +

webpmux +−get GET_OPTIONS INPUT −o +OUTPUT
+webpmux −set
SET_OPTIONS INPUT +−o OUTPUT
+webpmux −strip
STRIP_OPTIONS INPUT +−o OUTPUT
+webpmux −frame
FRAME_OPTIONS [ +−frame ... ] [ −loop LOOP_COUNT +]

+ +

[ −bgcolor +BACKGROUND_COLOR ] −o OUTPUT

+ +

webpmux −duration +DURATION OPTIONS [ −duration ... ] +INPUT −o OUTPUT
+webpmux −info
INPUT
+webpmux [−h|−help]
+webpmux −version
+webpmux argument_file_name

+ + +

DESCRIPTION

+ + +

This manual +page documents the webpmux command.

+ +

webpmux +can be used to create/extract from animated WebP files, as +well as to add/extract/strip XMP/EXIF metadata and ICC +profile. If a single file name (not starting with the +character ’−’) is supplied as the +argument, the command line arguments are actually tokenized +from this file. This allows for easy scripting or using a +large number of arguments.

+ + +

OPTIONS

+ + +

GET_OPTIONS +(−get):

+ + + + + + + + + + + + + + + + + + + + +
+ + +

icc

+ + +

Get ICC profile.

+
+ + +

exif

+ + +

Get EXIF +metadata.

+
+ + +

xmp

+ + +

Get XMP +metadata.

+
+ +

frame n

+ +

Get nth frame from an animated +image. (n = 0 has a special meaning: last frame).

+ +

SET_OPTIONS +(−set)
+loop
loop_count

+ +

Set loop count on an animated +file.

+ +

Where: +’loop_count’ must be in range [0, 65535]. +
+bgcolor
A,R,G,B

+ +

Set the background color of the +canvas on an animated file.

+ +

where: +’A’, ’R’, ’G’ and +’B’ are integers in the range 0 to 255 +specifying the Alpha, Red, Green and Blue component values +respectively.
+icc
file.icc

+ +

Set ICC profile.

+ +

Where: +’file.icc’ contains the ICC profile to be set. +
+exif
file.exif

+ +

Set EXIF metadata.

+ +

Where: +’file.exif’ contains the EXIF metadata to be +set.
+xmp
file.xmp

+ +

Set XMP metadata.

+ +

Where: +’file.xmp’ contains the XMP metadata to be +set.

+ + +

STRIP_OPTIONS +(−strip)

+ + + + + + + + + + + + + + + + + + + + +
+ + +

icc

+ + +

Strip ICC profile.

+
+ + +

exif

+ + +

Strip EXIF +metadata.

+
+ + +

xmp

+ + +

Strip XMP +metadata.

+
+ + +

DURATION_OPTIONS +(−duration)
+Amend the duration of a specific interval of frames. This +option is only effective on animated WebP and has no effect +on a single-frame file.
+duration[,start[,end]]

+ +

Where:
+duration
is the duration for the interval in +milliseconds (mandatory). Must be non-negative.
+start
is the starting frame index of the interval +(optional).
+end
is the ending frame index (inclusive) of the +interval (optional).

+ +

The three typical usages of +this option are:

+ +

-duration d
+set the duration to ’d’ for the whole animation. +
+-duration d,f

+set the duration of frame ’f’ to +’d’.
+-duration d,start,end

+set the duration to ’d’ for the whole +[start,end] interval.

+ +

Note that the +frames outside of the [start, end] interval will
+remain untouched.
+The ’end’ value ’0’ has the special +meaning ’last frame of the animation’.

+ +

Reminder:

+ +

frame indexing starts at +’1’.

+ + +

FRAME_OPTIONS +(−frame)
+Create an animated WebP file from multiple +(non−animated) WebP images.
+file_i +di[+xi+yi[+mi[bi]]]

+ +

Where: ’file_i’ is +the i’th frame (WebP format), +’xi’,’yi’ specify the image offset +for this frame, ’di’ is the pause duration +before next frame, ’mi’ is the dispose method +for this frame (0 for NONE or 1 for BACKGROUND) and +’bi’ is the blending method for this frame (+b +for BLEND or −b for NO_BLEND). Argument +’bi’ can be omitted and will default to +b +(BLEND). Also, ’mi’ can be omitted if +’bi’ is omitted and will default to 0 (NONE). +Finally, if ’mi’ and ’bi’ are +omitted then ’xi’ and ’yi’ can be +omitted and will default to +0+0.

+ +

−loop n

+ +

Loop the frames n number of +times. 0 indicates the frames should loop forever. Valid +range is 0 to 65535 [Default: 0 (infinite)].

+ +

−bgcolor +A,R,G,B

+ +

Background color of the canvas. +
+where: ’A’, ’R’, ’G’ and +’B’ are integers in the range 0 to 255 +specifying the Alpha, Red, Green and Blue component values +respectively [Default: 255,255,255,255].

+ +

INPUT +
+Input file in WebP format.

+ +

OUTPUT +(−o)
+Output file in WebP format.

+ +

Note: +
+The nature of EXIF, XMP and ICC data is not checked and is +assumed to
+be valid.

+ + +

BUGS

+ + +

Please report +all bugs to the issue tracker: +https://bugs.chromium.org/p/webp
+Patches welcome! See this page to get started: +https://www.webmproject.org/code/contribute/submitting−patches/

+ + +

EXAMPLES

+ + +

Add ICC +profile:
+webpmux −set icc image_profile.icc in.webp −o +icc_container.webp

+ +

Extract ICC +profile:
+webpmux −get icc icc_container.webp −o +image_profile.icc

+ +

Strip ICC +profile:
+webpmux −strip icc icc_container.webp −o +without_icc.webp

+ +

Add XMP +metadata:
+webpmux −set xmp image_metadata.xmp in.webp −o +xmp_container.webp

+ +

Extract XMP +metadata:
+webpmux −get xmp xmp_container.webp −o +image_metadata.xmp

+ +

Strip XMP +metadata:
+webpmux −strip xmp xmp_container.webp −o +without_xmp.webp

+ +

Add EXIF +metadata:
+webpmux −set exif image_metadata.exif in.webp −o +exif_container.webp

+ +

Extract EXIF +metadata:
+webpmux −get exif exif_container.webp −o +image_metadata.exif

+ +

Strip EXIF +metadata:
+webpmux −strip exif exif_container.webp −o +without_exif.webp

+ +

Create an +animated WebP file from 3 (non−animated) WebP images: +
+webpmux −frame 1.webp +100 −frame 2.webp ++100+50+50

+ +

−frame 3.webp ++100+50+50+1+b −loop 10 −bgcolor 255,255,255,255 +
+−o anim_container.webp

+ +

Get the 2nd +frame from an animated WebP file:
+webpmux −get frame 2 anim_container.webp −o +frame_2.webp

+ +

Using +−get/−set/−strip with input file name +starting with ’−’:
+webpmux −set icc image_profile.icc −o +icc_container.webp −− +−−−in.webp
+webpmux −get icc −o image_profile.icc +−− −−−icc_container.webp
+webpmux −strip icc −o without_icc.webp +−− −−−icc_container.webp

+ + +

AUTHORS

+ + +

webpmux +is a part of libwebp and was written by the WebP team.
+The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp

+ +

This manual +page was written by Vikas Arora +<vikaas.arora@gmail.com>, for the Debian project (and +may be used by others).

+ + +

SEE ALSO

+ + + +

cwebp(1), +dwebp(1), gif2webp(1)
+Please refer to https://developers.google.com/speed/webp/ +for additional information.

+
+ + diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpmux.txt b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpmux.txt new file mode 100644 index 00000000..7473be8e --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/doc/webpmux.txt @@ -0,0 +1,216 @@ +WEBPMUX(1) WEBPMUX(1) + + + +NAME + webpmux - create animated WebP files from non-animated WebP images, + extract frames from animated WebP images, and manage XMP/EXIF metadata + and ICC profile. + +SYNOPSIS + webpmux -get GET_OPTIONS INPUT -o OUTPUT + webpmux -set SET_OPTIONS INPUT -o OUTPUT + webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT + webpmux -frame FRAME_OPTIONS [ -frame ... ] [ -loop LOOP_COUNT ] + [ -bgcolor BACKGROUND_COLOR ] -o OUTPUT + webpmux -duration DURATION OPTIONS [ -duration ... ] INPUT -o OUTPUT + webpmux -info INPUT + webpmux [-h|-help] + webpmux -version + webpmux argument_file_name + +DESCRIPTION + This manual page documents the webpmux command. + + webpmux can be used to create/extract from animated WebP files, as well + as to add/extract/strip XMP/EXIF metadata and ICC profile. If a single + file name (not starting with the character '-') is supplied as the + argument, the command line arguments are actually tokenized from this + file. This allows for easy scripting or using a large number of argu- + ments. + +OPTIONS + GET_OPTIONS (-get): + icc Get ICC profile. + + exif Get EXIF metadata. + + xmp Get XMP metadata. + + frame n + Get nth frame from an animated image. (n = 0 has a special mean- + ing: last frame). + + + SET_OPTIONS (-set) + loop loop_count + Set loop count on an animated file. + + Where: 'loop_count' must be in range [0, 65535]. + + bgcolor A,R,G,B + Set the background color of the canvas on an animated file. + + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 speci- + fying the Alpha, Red, Green and Blue component values respectively. + + icc file.icc + Set ICC profile. + + Where: 'file.icc' contains the ICC profile to be set. + + exif file.exif + Set EXIF metadata. + + Where: 'file.exif' contains the EXIF metadata to be set. + + xmp file.xmp + Set XMP metadata. + + Where: 'file.xmp' contains the XMP metadata to be set. + + + STRIP_OPTIONS (-strip) + icc Strip ICC profile. + + exif Strip EXIF metadata. + + xmp Strip XMP metadata. + + + DURATION_OPTIONS (-duration) + Amend the duration of a specific interval of frames. This option is + only effective on animated WebP and has no effect on a single-frame + file. + + duration[,start[,end]] + Where: + duration is the duration for the interval in milliseconds + (mandatory). Must be non-negative. + start is the starting frame index of the interval (optional). + end is the ending frame index (inclusive) of the interval + (optional). + + The three typical usages of this option are: + -duration d + set the duration to 'd' for the whole animation. + -duration d,f + set the duration of frame 'f' to 'd'. + -duration d,start,end + set the duration to 'd' for the whole [start,end] interval. + + + Note that the frames outside of the [start, end] interval will + remain untouched. + The 'end' value '0' has the special meaning 'last frame of the + animation'. + + Reminder: + frame indexing starts at '1'. + + + FRAME_OPTIONS (-frame) + Create an animated WebP file from multiple (non-animated) WebP images. + + file_i +di[+xi+yi[+mi[bi]]] + Where: 'file_i' is the i'th frame (WebP format), 'xi','yi' spec- + ify the image offset for this frame, 'di' is the pause duration + before next frame, 'mi' is the dispose method for this frame (0 + for NONE or 1 for BACKGROUND) and 'bi' is the blending method + for this frame (+b for BLEND or -b for NO_BLEND). Argument 'bi' + can be omitted and will default to +b (BLEND). Also, 'mi' can + be omitted if 'bi' is omitted and will default to 0 (NONE). + Finally, if 'mi' and 'bi' are omitted then 'xi' and 'yi' can be + omitted and will default to +0+0. + + -loop n + Loop the frames n number of times. 0 indicates the frames should + loop forever. Valid range is 0 to 65535 [Default: 0 (infi- + nite)]. + + -bgcolor A,R,G,B + Background color of the canvas. + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 + specifying the Alpha, Red, Green and Blue component values + respectively [Default: 255,255,255,255]. + + + INPUT + Input file in WebP format. + + + OUTPUT (-o) + Output file in WebP format. + + + Note: + The nature of EXIF, XMP and ICC data is not checked and is assumed to + be valid. + + +BUGS + Please report all bugs to the issue tracker: + https://bugs.chromium.org/p/webp + Patches welcome! See this page to get started: https://www.webmpro- + ject.org/code/contribute/submitting-patches/ + + +EXAMPLES + Add ICC profile: + webpmux -set icc image_profile.icc in.webp -o icc_container.webp + + Extract ICC profile: + webpmux -get icc icc_container.webp -o image_profile.icc + + Strip ICC profile: + webpmux -strip icc icc_container.webp -o without_icc.webp + + Add XMP metadata: + webpmux -set xmp image_metadata.xmp in.webp -o xmp_container.webp + + Extract XMP metadata: + webpmux -get xmp xmp_container.webp -o image_metadata.xmp + + Strip XMP metadata: + webpmux -strip xmp xmp_container.webp -o without_xmp.webp + + Add EXIF metadata: + webpmux -set exif image_metadata.exif in.webp -o exif_container.webp + + Extract EXIF metadata: + webpmux -get exif exif_container.webp -o image_metadata.exif + + Strip EXIF metadata: + webpmux -strip exif exif_container.webp -o without_exif.webp + + Create an animated WebP file from 3 (non-animated) WebP images: + webpmux -frame 1.webp +100 -frame 2.webp +100+50+50 + -frame 3.webp +100+50+50+1+b -loop 10 -bgcolor 255,255,255,255 + -o anim_container.webp + + Get the 2nd frame from an animated WebP file: + webpmux -get frame 2 anim_container.webp -o frame_2.webp + + Using -get/-set/-strip with input file name starting with '-': + webpmux -set icc image_profile.icc -o icc_container.webp -- ---in.webp + webpmux -get icc -o image_profile.icc -- ---icc_container.webp + webpmux -strip icc -o without_icc.webp -- ---icc_container.webp + + +AUTHORS + webpmux is a part of libwebp and was written by the WebP team. + The latest source tree is available at https://chromium.google- + source.com/webm/libwebp + + This manual page was written by Vikas Arora , + for the Debian project (and may be used by others). + + +SEE ALSO + cwebp(1), dwebp(1), gif2webp(1) + Please refer to https://developers.google.com/speed/webp/ for addi- + tional information. + + + + November 17, 2021 WEBPMUX(1) diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/decode.h b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/decode.h new file mode 100644 index 00000000..d9824750 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/decode.h @@ -0,0 +1,503 @@ +// Copyright 2010 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Main decoding functions for WebP images. +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_DECODE_H_ +#define WEBP_WEBP_DECODE_H_ + +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_DECODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum VP8StatusCode VP8StatusCode; +// typedef enum WEBP_CSP_MODE WEBP_CSP_MODE; +typedef struct WebPRGBABuffer WebPRGBABuffer; +typedef struct WebPYUVABuffer WebPYUVABuffer; +typedef struct WebPDecBuffer WebPDecBuffer; +typedef struct WebPIDecoder WebPIDecoder; +typedef struct WebPBitstreamFeatures WebPBitstreamFeatures; +typedef struct WebPDecoderOptions WebPDecoderOptions; +typedef struct WebPDecoderConfig WebPDecoderConfig; + +// Return the decoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetDecoderVersion(void); + +// Retrieve basic header information: width, height. +// This function will also validate the header, returning true on success, +// false otherwise. '*width' and '*height' are only valid on successful return. +// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. +WEBP_EXTERN int WebPGetInfo(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Decodes WebP images pointed to by 'data' and returns RGBA samples, along +// with the dimensions in *width and *height. The ordering of samples in +// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). +// The returned pointer should be deleted calling WebPFree(). +// Returns NULL in case of error. +WEBP_EXTERN uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. +// If the bitstream contains transparency, it is ignored. +WEBP_EXTERN uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, + int* width, int* height); + + +// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer +// returned is the Y samples buffer. Upon return, *u and *v will point to +// the U and V chroma data. These U and V buffers need NOT be passed to +// WebPFree(), unlike the returned Y luma one. The dimension of the U and V +// planes are both (*width + 1) / 2 and (*height + 1)/ 2. +// Upon return, the Y buffer has a stride returned as '*stride', while U and V +// have a common stride returned as '*uv_stride'. +// Return NULL in case of error. +// (*) Also named Y'CbCr. See: https://en.wikipedia.org/wiki/YCbCr +WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, + int* width, int* height, + uint8_t** u, uint8_t** v, + int* stride, int* uv_stride); + +// These five functions are variants of the above ones, that decode the image +// directly into a pre-allocated buffer 'output_buffer'. The maximum storage +// available in this buffer is indicated by 'output_buffer_size'. If this +// storage is not sufficient (or an error occurred), NULL is returned. +// Otherwise, output_buffer is returned, for convenience. +// The parameter 'output_stride' specifies the distance (in bytes) +// between scanlines. Hence, output_buffer_size is expected to be at least +// output_stride x picture-height. +WEBP_EXTERN uint8_t* WebPDecodeRGBAInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeARGBInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeBGRAInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// RGB and BGR variants. Here too the transparency information, if present, +// will be dropped and ignored. +WEBP_EXTERN uint8_t* WebPDecodeRGBInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeBGRInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly +// into pre-allocated luma/chroma plane buffers. This function requires the +// strides to be passed: one for the luma plane and one for each of the +// chroma ones. The size of each plane buffer is passed as 'luma_size', +// 'u_size' and 'v_size' respectively. +// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred +// during decoding (or because some buffers were found to be too small). +WEBP_EXTERN uint8_t* WebPDecodeYUVInto( + const uint8_t* data, size_t data_size, + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride); + +//------------------------------------------------------------------------------ +// Output colorspaces and buffer + +// Colorspaces +// Note: the naming describes the byte-ordering of packed samples in memory. +// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,... +// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels. +// RGBA-4444 and RGB-565 colorspaces are represented by following byte-order: +// RGBA-4444: [r3 r2 r1 r0 g3 g2 g1 g0], [b3 b2 b1 b0 a3 a2 a1 a0], ... +// RGB-565: [r4 r3 r2 r1 r0 g5 g4 g3], [g2 g1 g0 b4 b3 b2 b1 b0], ... +// In the case WEBP_SWAP_16BITS_CSP is defined, the bytes are swapped for +// these two modes: +// RGBA-4444: [b3 b2 b1 b0 a3 a2 a1 a0], [r3 r2 r1 r0 g3 g2 g1 g0], ... +// RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ... + +typedef enum WEBP_CSP_MODE { + MODE_RGB = 0, MODE_RGBA = 1, + MODE_BGR = 2, MODE_BGRA = 3, + MODE_ARGB = 4, MODE_RGBA_4444 = 5, + MODE_RGB_565 = 6, + // RGB-premultiplied transparent modes (alpha value is preserved) + MODE_rgbA = 7, + MODE_bgrA = 8, + MODE_Argb = 9, + MODE_rgbA_4444 = 10, + // YUV modes must come after RGB ones. + MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 + MODE_LAST = 13 +} WEBP_CSP_MODE; + +// Some useful macros: +static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) { + return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb || + mode == MODE_rgbA_4444); +} + +static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) { + return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB || + mode == MODE_RGBA_4444 || mode == MODE_YUVA || + WebPIsPremultipliedMode(mode)); +} + +static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { + return (mode < MODE_YUV); +} + +//------------------------------------------------------------------------------ +// WebPDecBuffer: Generic structure for describing the output sample buffer. + +struct WebPRGBABuffer { // view as RGBA + uint8_t* rgba; // pointer to RGBA samples + int stride; // stride in bytes from one scanline to the next. + size_t size; // total size of the *rgba buffer. +}; + +struct WebPYUVABuffer { // view as YUVA + uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples + int y_stride; // luma stride + int u_stride, v_stride; // chroma strides + int a_stride; // alpha stride + size_t y_size; // luma plane size + size_t u_size, v_size; // chroma planes size + size_t a_size; // alpha-plane size +}; + +// Output buffer +struct WebPDecBuffer { + WEBP_CSP_MODE colorspace; // Colorspace. + int width, height; // Dimensions. + int is_external_memory; // If non-zero, 'internal_memory' pointer is not + // used. If value is '2' or more, the external + // memory is considered 'slow' and multiple + // read/write will be avoided. + union { + WebPRGBABuffer RGBA; + WebPYUVABuffer YUVA; + } u; // Nameless union of buffer parameters. + uint32_t pad[4]; // padding for later use + + uint8_t* private_memory; // Internally allocated memory (only when + // is_external_memory is 0). Should not be used + // externally, but accessed via the buffer union. +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPInitDecBufferInternal(WebPDecBuffer*, int); + +// Initialize the structure as empty. Must be called before any other use. +// Returns false in case of version mismatch +static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) { + return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); +} + +// Free any memory associated with the buffer. Must always be called last. +// Note: doesn't free the 'buffer' structure itself. +WEBP_EXTERN void WebPFreeDecBuffer(WebPDecBuffer* buffer); + +//------------------------------------------------------------------------------ +// Enumeration of the status codes + +typedef enum VP8StatusCode { + VP8_STATUS_OK = 0, + VP8_STATUS_OUT_OF_MEMORY, + VP8_STATUS_INVALID_PARAM, + VP8_STATUS_BITSTREAM_ERROR, + VP8_STATUS_UNSUPPORTED_FEATURE, + VP8_STATUS_SUSPENDED, + VP8_STATUS_USER_ABORT, + VP8_STATUS_NOT_ENOUGH_DATA +} VP8StatusCode; + +//------------------------------------------------------------------------------ +// Incremental decoding +// +// This API allows streamlined decoding of partial data. +// Picture can be incrementally decoded as data become available thanks to the +// WebPIDecoder object. This object can be left in a SUSPENDED state if the +// picture is only partially decoded, pending additional input. +// Code example: +// +// WebPInitDecBuffer(&output_buffer); +// output_buffer.colorspace = mode; +// ... +// WebPIDecoder* idec = WebPINewDecoder(&output_buffer); +// while (additional_data_is_available) { +// // ... (get additional data in some new_data[] buffer) +// status = WebPIAppend(idec, new_data, new_data_size); +// if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) { +// break; // an error occurred. +// } +// +// // The above call decodes the current available buffer. +// // Part of the image can now be refreshed by calling +// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. +// } +// WebPIDelete(idec); + +// Creates a new incremental decoder with the supplied buffer parameter. +// This output_buffer can be passed NULL, in which case a default output buffer +// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' +// is kept, which means that the lifespan of 'output_buffer' must be larger than +// that of the returned WebPIDecoder object. +// The supplied 'output_buffer' content MUST NOT be changed between calls to +// WebPIAppend() or WebPIUpdate() unless 'output_buffer.is_external_memory' is +// not set to 0. In such a case, it is allowed to modify the pointers, size and +// stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain +// within valid bounds. +// All other fields of WebPDecBuffer MUST remain constant between calls. +// Returns NULL if the allocation failed. +WEBP_EXTERN WebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer); + +// This function allocates and initializes an incremental-decoder object, which +// will output the RGB/A samples specified by 'csp' into a preallocated +// buffer 'output_buffer'. The size of this buffer is at least +// 'output_buffer_size' and the stride (distance in bytes between two scanlines) +// is specified by 'output_stride'. +// Additionally, output_buffer can be passed NULL in which case the output +// buffer will be allocated automatically when the decoding starts. The +// colorspace 'csp' is taken into account for allocating this buffer. All other +// parameters are ignored. +// Returns NULL if the allocation failed, or if some parameters are invalid. +WEBP_EXTERN WebPIDecoder* WebPINewRGB( + WEBP_CSP_MODE csp, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// This function allocates and initializes an incremental-decoder object, which +// will output the raw luma/chroma samples into a preallocated planes if +// supplied. The luma plane is specified by its pointer 'luma', its size +// 'luma_size' and its stride 'luma_stride'. Similarly, the chroma-u plane +// is specified by the 'u', 'u_size' and 'u_stride' parameters, and the chroma-v +// plane by 'v' and 'v_size'. And same for the alpha-plane. The 'a' pointer +// can be pass NULL in case one is not interested in the transparency plane. +// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied. +// In this case, the output buffer will be automatically allocated (using +// MODE_YUVA) when decoding starts. All parameters are then ignored. +// Returns NULL if the allocation failed or if a parameter is invalid. +WEBP_EXTERN WebPIDecoder* WebPINewYUVA( + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride, + uint8_t* a, size_t a_size, int a_stride); + +// Deprecated version of the above, without the alpha plane. +// Kept for backward compatibility. +WEBP_EXTERN WebPIDecoder* WebPINewYUV( + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride); + +// Deletes the WebPIDecoder object and associated memory. Must always be called +// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. +WEBP_EXTERN void WebPIDelete(WebPIDecoder* idec); + +// Copies and decodes the next available data. Returns VP8_STATUS_OK when +// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more +// data is expected. Returns error in other cases. +WEBP_EXTERN VP8StatusCode WebPIAppend( + WebPIDecoder* idec, const uint8_t* data, size_t data_size); + +// A variant of the above function to be used when data buffer contains +// partial data from the beginning. In this case data buffer is not copied +// to the internal memory. +// Note that the value of the 'data' pointer can change between calls to +// WebPIUpdate, for instance when the data buffer is resized to fit larger data. +WEBP_EXTERN VP8StatusCode WebPIUpdate( + WebPIDecoder* idec, const uint8_t* data, size_t data_size); + +// Returns the RGB/A image decoded so far. Returns NULL if output params +// are not initialized yet. The RGB/A output type corresponds to the colorspace +// specified during call to WebPINewDecoder() or WebPINewRGB(). +// *last_y is the index of last decoded row in raster scan order. Some pointers +// (*last_y, *width etc.) can be NULL if corresponding information is not +// needed. The values in these pointers are only valid on successful (non-NULL) +// return. +WEBP_EXTERN uint8_t* WebPIDecGetRGB( + const WebPIDecoder* idec, int* last_y, + int* width, int* height, int* stride); + +// Same as above function to get a YUVA image. Returns pointer to the luma +// plane or NULL in case of error. If there is no alpha information +// the alpha pointer '*a' will be returned NULL. +WEBP_EXTERN uint8_t* WebPIDecGetYUVA( + const WebPIDecoder* idec, int* last_y, + uint8_t** u, uint8_t** v, uint8_t** a, + int* width, int* height, int* stride, int* uv_stride, int* a_stride); + +// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the +// alpha information (if present). Kept for backward compatibility. +static WEBP_INLINE uint8_t* WebPIDecGetYUV( + const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, + int* width, int* height, int* stride, int* uv_stride) { + return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, + stride, uv_stride, NULL); +} + +// Generic call to retrieve information about the displayable area. +// If non NULL, the left/right/width/height pointers are filled with the visible +// rectangular area so far. +// Returns NULL in case the incremental decoder object is in an invalid state. +// Otherwise returns the pointer to the internal representation. This structure +// is read-only, tied to WebPIDecoder's lifespan and should not be modified. +WEBP_EXTERN const WebPDecBuffer* WebPIDecodedArea( + const WebPIDecoder* idec, int* left, int* top, int* width, int* height); + +//------------------------------------------------------------------------------ +// Advanced decoding parametrization +// +// Code sample for using the advanced decoding API +/* + // A) Init a configuration object + WebPDecoderConfig config; + CHECK(WebPInitDecoderConfig(&config)); + + // B) optional: retrieve the bitstream's features. + CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + + // C) Adjust 'config', if needed + config.no_fancy_upsampling = 1; + config.output.colorspace = MODE_BGRA; + // etc. + + // Note that you can also make config.output point to an externally + // supplied memory buffer, provided it's big enough to store the decoded + // picture. Otherwise, config.output will just be used to allocate memory + // and store the decoded picture. + + // D) Decode! + CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + + // E) Decoded image is now in config.output (and config.output.u.RGBA) + + // F) Reclaim memory allocated in config's object. It's safe to call + // this function even if the memory is external and wasn't allocated + // by WebPDecode(). + WebPFreeDecBuffer(&config.output); +*/ + +// Features gathered from the bitstream +struct WebPBitstreamFeatures { + int width; // Width in pixels, as read from the bitstream. + int height; // Height in pixels, as read from the bitstream. + int has_alpha; // True if the bitstream contains an alpha channel. + int has_animation; // True if the bitstream is an animation. + int format; // 0 = undefined (/mixed), 1 = lossy, 2 = lossless + + uint32_t pad[5]; // padding for later use +}; + +// Internal, version-checked, entry point +WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal( + const uint8_t*, size_t, WebPBitstreamFeatures*, int); + +// Retrieve features from the bitstream. The *features structure is filled +// with information gathered from the bitstream. +// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns +// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the +// features from headers. Returns error in other cases. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. +static WEBP_INLINE VP8StatusCode WebPGetFeatures( + const uint8_t* data, size_t data_size, + WebPBitstreamFeatures* features) { + return WebPGetFeaturesInternal(data, data_size, features, + WEBP_DECODER_ABI_VERSION); +} + +// Decoding options +struct WebPDecoderOptions { + int bypass_filtering; // if true, skip the in-loop filtering + int no_fancy_upsampling; // if true, use faster pointwise upsampler + int use_cropping; // if true, cropping is applied _first_ + int crop_left, crop_top; // top-left position for cropping. + // Will be snapped to even values. + int crop_width, crop_height; // dimension of the cropping area + int use_scaling; // if true, scaling is applied _afterward_ + int scaled_width, scaled_height; // final resolution + int use_threads; // if true, use multi-threaded decoding + int dithering_strength; // dithering strength (0=Off, 100=full) + int flip; // if true, flip output vertically + int alpha_dithering_strength; // alpha dithering strength in [0..100] + + uint32_t pad[5]; // padding for later use +}; + +// Main object storing the configuration for advanced decoding. +struct WebPDecoderConfig { + WebPBitstreamFeatures input; // Immutable bitstream features (optional) + WebPDecBuffer output; // Output buffer (can point to external mem) + WebPDecoderOptions options; // Decoding options +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPInitDecoderConfigInternal(WebPDecoderConfig*, int); + +// Initialize the configuration as empty. This function must always be +// called first, unless WebPGetFeatures() is to be called. +// Returns false in case of mismatched version. +static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { + return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); +} + +// Instantiate a new incremental decoder object with the requested +// configuration. The bitstream can be passed using 'data' and 'data_size' +// parameter, in which case the features will be parsed and stored into +// config->input. Otherwise, 'data' can be NULL and no parsing will occur. +// Note that 'config' can be NULL too, in which case a default configuration +// is used. If 'config' is not NULL, it must outlive the WebPIDecoder object +// as some references to its fields will be used. No internal copy of 'config' +// is made. +// The return WebPIDecoder object must always be deleted calling WebPIDelete(). +// Returns NULL in case of error (and config->status will then reflect +// the error condition, if available). +WEBP_EXTERN WebPIDecoder* WebPIDecode(const uint8_t* data, size_t data_size, + WebPDecoderConfig* config); + +// Non-incremental version. This version decodes the full data at once, taking +// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK +// if the decoding was successful). Note that 'config' cannot be NULL. +WEBP_EXTERN VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size, + WebPDecoderConfig* config); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_DECODE_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/demux.h b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/demux.h new file mode 100644 index 00000000..846eeb15 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/demux.h @@ -0,0 +1,363 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Demux API. +// Enables extraction of image and extended format data from WebP files. + +// Code Example: Demuxing WebP data to extract all the frames, ICC profile +// and EXIF/XMP metadata. +/* + WebPDemuxer* demux = WebPDemux(&webp_data); + + uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); + uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); + // ... (Get information about the features present in the WebP file). + uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); + + // ... (Iterate over all frames). + WebPIterator iter; + if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), + // ... and get other frame properties like width, height, offsets etc. + // ... see 'struct WebPIterator' below for more info). + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); + } + + // ... (Extract metadata). + WebPChunkIterator chunk_iter; + if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); + // ... (Consume the ICC profile in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); + // ... (Consume the EXIF metadata in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); + // ... (Consume the XMP metadata in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + WebPDemuxDelete(demux); +*/ + +#ifndef WEBP_WEBP_DEMUX_H_ +#define WEBP_WEBP_DEMUX_H_ + +#include "./decode.h" // for WEBP_CSP_MODE +#include "./mux_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_DEMUX_ABI_VERSION 0x0107 // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPDemuxState WebPDemuxState; +// typedef enum WebPFormatFeature WebPFormatFeature; +typedef struct WebPDemuxer WebPDemuxer; +typedef struct WebPIterator WebPIterator; +typedef struct WebPChunkIterator WebPChunkIterator; +typedef struct WebPAnimInfo WebPAnimInfo; +typedef struct WebPAnimDecoderOptions WebPAnimDecoderOptions; + +//------------------------------------------------------------------------------ + +// Returns the version number of the demux library, packed in hexadecimal using +// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetDemuxVersion(void); + +//------------------------------------------------------------------------------ +// Life of a Demux object + +typedef enum WebPDemuxState { + WEBP_DEMUX_PARSE_ERROR = -1, // An error occurred while parsing. + WEBP_DEMUX_PARSING_HEADER = 0, // Not enough data to parse full header. + WEBP_DEMUX_PARSED_HEADER = 1, // Header parsing complete, + // data may be available. + WEBP_DEMUX_DONE = 2 // Entire file has been parsed. +} WebPDemuxState; + +// Internal, version-checked, entry point +WEBP_EXTERN WebPDemuxer* WebPDemuxInternal( + const WebPData*, int, WebPDemuxState*, int); + +// Parses the full WebP file given by 'data'. For single images the WebP file +// header alone or the file header and the chunk header may be absent. +// Returns a WebPDemuxer object on successful parse, NULL otherwise. +static WEBP_INLINE WebPDemuxer* WebPDemux(const WebPData* data) { + return WebPDemuxInternal(data, 0, NULL, WEBP_DEMUX_ABI_VERSION); +} + +// Parses the possibly incomplete WebP file given by 'data'. +// If 'state' is non-NULL it will be set to indicate the status of the demuxer. +// Returns NULL in case of error or if there isn't enough data to start parsing; +// and a WebPDemuxer object on successful parse. +// Note that WebPDemuxer keeps internal pointers to 'data' memory segment. +// If this data is volatile, the demuxer object should be deleted (by calling +// WebPDemuxDelete()) and WebPDemuxPartial() called again on the new data. +// This is usually an inexpensive operation. +static WEBP_INLINE WebPDemuxer* WebPDemuxPartial( + const WebPData* data, WebPDemuxState* state) { + return WebPDemuxInternal(data, 1, state, WEBP_DEMUX_ABI_VERSION); +} + +// Frees memory associated with 'dmux'. +WEBP_EXTERN void WebPDemuxDelete(WebPDemuxer* dmux); + +//------------------------------------------------------------------------------ +// Data/information extraction. + +typedef enum WebPFormatFeature { + WEBP_FF_FORMAT_FLAGS, // bit-wise combination of WebPFeatureFlags + // corresponding to the 'VP8X' chunk (if present). + WEBP_FF_CANVAS_WIDTH, + WEBP_FF_CANVAS_HEIGHT, + WEBP_FF_LOOP_COUNT, // only relevant for animated file + WEBP_FF_BACKGROUND_COLOR, // idem. + WEBP_FF_FRAME_COUNT // Number of frames present in the demux object. + // In case of a partial demux, this is the number + // of frames seen so far, with the last frame + // possibly being partial. +} WebPFormatFeature; + +// Get the 'feature' value from the 'dmux'. +// NOTE: values are only valid if WebPDemux() was used or WebPDemuxPartial() +// returned a state > WEBP_DEMUX_PARSING_HEADER. +// If 'feature' is WEBP_FF_FORMAT_FLAGS, the returned value is a bit-wise +// combination of WebPFeatureFlags values. +// If 'feature' is WEBP_FF_LOOP_COUNT, WEBP_FF_BACKGROUND_COLOR, the returned +// value is only meaningful if the bitstream is animated. +WEBP_EXTERN uint32_t WebPDemuxGetI( + const WebPDemuxer* dmux, WebPFormatFeature feature); + +//------------------------------------------------------------------------------ +// Frame iteration. + +struct WebPIterator { + int frame_num; + int num_frames; // equivalent to WEBP_FF_FRAME_COUNT. + int x_offset, y_offset; // offset relative to the canvas. + int width, height; // dimensions of this frame. + int duration; // display duration in milliseconds. + WebPMuxAnimDispose dispose_method; // dispose method for the frame. + int complete; // true if 'fragment' contains a full frame. partial images + // may still be decoded with the WebP incremental decoder. + WebPData fragment; // The frame given by 'frame_num'. Note for historical + // reasons this is called a fragment. + int has_alpha; // True if the frame contains transparency. + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + + uint32_t pad[2]; // padding for later use. + void* private_; // for internal use only. +}; + +// Retrieves frame 'frame_number' from 'dmux'. +// 'iter->fragment' points to the frame on return from this function. +// Setting 'frame_number' equal to 0 will return the last frame of the image. +// Returns false if 'dmux' is NULL or frame 'frame_number' is not present. +// Call WebPDemuxReleaseIterator() when use of the iterator is complete. +// NOTE: 'dmux' must persist for the lifetime of 'iter'. +WEBP_EXTERN int WebPDemuxGetFrame( + const WebPDemuxer* dmux, int frame_number, WebPIterator* iter); + +// Sets 'iter->fragment' to point to the next ('iter->frame_num' + 1) or +// previous ('iter->frame_num' - 1) frame. These functions do not loop. +// Returns true on success, false otherwise. +WEBP_EXTERN int WebPDemuxNextFrame(WebPIterator* iter); +WEBP_EXTERN int WebPDemuxPrevFrame(WebPIterator* iter); + +// Releases any memory associated with 'iter'. +// Must be called before any subsequent calls to WebPDemuxGetChunk() on the same +// iter. Also, must be called before destroying the associated WebPDemuxer with +// WebPDemuxDelete(). +WEBP_EXTERN void WebPDemuxReleaseIterator(WebPIterator* iter); + +//------------------------------------------------------------------------------ +// Chunk iteration. + +struct WebPChunkIterator { + // The current and total number of chunks with the fourcc given to + // WebPDemuxGetChunk(). + int chunk_num; + int num_chunks; + WebPData chunk; // The payload of the chunk. + + uint32_t pad[6]; // padding for later use + void* private_; +}; + +// Retrieves the 'chunk_number' instance of the chunk with id 'fourcc' from +// 'dmux'. +// 'fourcc' is a character array containing the fourcc of the chunk to return, +// e.g., "ICCP", "XMP ", "EXIF", etc. +// Setting 'chunk_number' equal to 0 will return the last chunk in a set. +// Returns true if the chunk is found, false otherwise. Image related chunk +// payloads are accessed through WebPDemuxGetFrame() and related functions. +// Call WebPDemuxReleaseChunkIterator() when use of the iterator is complete. +// NOTE: 'dmux' must persist for the lifetime of the iterator. +WEBP_EXTERN int WebPDemuxGetChunk(const WebPDemuxer* dmux, + const char fourcc[4], int chunk_number, + WebPChunkIterator* iter); + +// Sets 'iter->chunk' to point to the next ('iter->chunk_num' + 1) or previous +// ('iter->chunk_num' - 1) chunk. These functions do not loop. +// Returns true on success, false otherwise. +WEBP_EXTERN int WebPDemuxNextChunk(WebPChunkIterator* iter); +WEBP_EXTERN int WebPDemuxPrevChunk(WebPChunkIterator* iter); + +// Releases any memory associated with 'iter'. +// Must be called before destroying the associated WebPDemuxer with +// WebPDemuxDelete(). +WEBP_EXTERN void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter); + +//------------------------------------------------------------------------------ +// WebPAnimDecoder API +// +// This API allows decoding (possibly) animated WebP images. +// +// Code Example: +/* + WebPAnimDecoderOptions dec_options; + WebPAnimDecoderOptionsInit(&dec_options); + // Tune 'dec_options' as needed. + WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); + WebPAnimInfo anim_info; + WebPAnimDecoderGetInfo(dec, &anim_info); + for (uint32_t i = 0; i < anim_info.loop_count; ++i) { + while (WebPAnimDecoderHasMoreFrames(dec)) { + uint8_t* buf; + int timestamp; + WebPAnimDecoderGetNext(dec, &buf, ×tamp); + // ... (Render 'buf' based on 'timestamp'). + // ... (Do NOT free 'buf', as it is owned by 'dec'). + } + WebPAnimDecoderReset(dec); + } + const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); + // ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). + WebPAnimDecoderDelete(dec); +*/ + +typedef struct WebPAnimDecoder WebPAnimDecoder; // Main opaque object. + +// Global options. +struct WebPAnimDecoderOptions { + // Output colorspace. Only the following modes are supported: + // MODE_RGBA, MODE_BGRA, MODE_rgbA and MODE_bgrA. + WEBP_CSP_MODE color_mode; + int use_threads; // If true, use multi-threaded decoding. + uint32_t padding[7]; // Padding for later use. +}; + +// Internal, version-checked, entry point. +WEBP_EXTERN int WebPAnimDecoderOptionsInitInternal( + WebPAnimDecoderOptions*, int); + +// Should always be called, to initialize a fresh WebPAnimDecoderOptions +// structure before modification. Returns false in case of version mismatch. +// WebPAnimDecoderOptionsInit() must have succeeded before using the +// 'dec_options' object. +static WEBP_INLINE int WebPAnimDecoderOptionsInit( + WebPAnimDecoderOptions* dec_options) { + return WebPAnimDecoderOptionsInitInternal(dec_options, + WEBP_DEMUX_ABI_VERSION); +} + +// Internal, version-checked, entry point. +WEBP_EXTERN WebPAnimDecoder* WebPAnimDecoderNewInternal( + const WebPData*, const WebPAnimDecoderOptions*, int); + +// Creates and initializes a WebPAnimDecoder object. +// Parameters: +// webp_data - (in) WebP bitstream. This should remain unchanged during the +// lifetime of the output WebPAnimDecoder object. +// dec_options - (in) decoding options. Can be passed NULL to choose +// reasonable defaults (in particular, color mode MODE_RGBA +// will be picked). +// Returns: +// A pointer to the newly created WebPAnimDecoder object, or NULL in case of +// parsing error, invalid option or memory error. +static WEBP_INLINE WebPAnimDecoder* WebPAnimDecoderNew( + const WebPData* webp_data, const WebPAnimDecoderOptions* dec_options) { + return WebPAnimDecoderNewInternal(webp_data, dec_options, + WEBP_DEMUX_ABI_VERSION); +} + +// Global information about the animation.. +struct WebPAnimInfo { + uint32_t canvas_width; + uint32_t canvas_height; + uint32_t loop_count; + uint32_t bgcolor; + uint32_t frame_count; + uint32_t pad[4]; // padding for later use +}; + +// Get global information about the animation. +// Parameters: +// dec - (in) decoder instance to get information from. +// info - (out) global information fetched from the animation. +// Returns: +// True on success. +WEBP_EXTERN int WebPAnimDecoderGetInfo(const WebPAnimDecoder* dec, + WebPAnimInfo* info); + +// Fetch the next frame from 'dec' based on options supplied to +// WebPAnimDecoderNew(). This will be a fully reconstructed canvas of size +// 'canvas_width * 4 * canvas_height', and not just the frame sub-rectangle. The +// returned buffer 'buf' is valid only until the next call to +// WebPAnimDecoderGetNext(), WebPAnimDecoderReset() or WebPAnimDecoderDelete(). +// Parameters: +// dec - (in/out) decoder instance from which the next frame is to be fetched. +// buf - (out) decoded frame. +// timestamp - (out) timestamp of the frame in milliseconds. +// Returns: +// False if any of the arguments are NULL, or if there is a parsing or +// decoding error, or if there are no more frames. Otherwise, returns true. +WEBP_EXTERN int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, + uint8_t** buf, int* timestamp); + +// Check if there are more frames left to decode. +// Parameters: +// dec - (in) decoder instance to be checked. +// Returns: +// True if 'dec' is not NULL and some frames are yet to be decoded. +// Otherwise, returns false. +WEBP_EXTERN int WebPAnimDecoderHasMoreFrames(const WebPAnimDecoder* dec); + +// Resets the WebPAnimDecoder object, so that next call to +// WebPAnimDecoderGetNext() will restart decoding from 1st frame. This would be +// helpful when all frames need to be decoded multiple times (e.g. +// info.loop_count times) without destroying and recreating the 'dec' object. +// Parameters: +// dec - (in/out) decoder instance to be reset +WEBP_EXTERN void WebPAnimDecoderReset(WebPAnimDecoder* dec); + +// Grab the internal demuxer object. +// Getting the demuxer object can be useful if one wants to use operations only +// available through demuxer; e.g. to get XMP/EXIF/ICC metadata. The returned +// demuxer object is owned by 'dec' and is valid only until the next call to +// WebPAnimDecoderDelete(). +// +// Parameters: +// dec - (in) decoder instance from which the demuxer object is to be fetched. +WEBP_EXTERN const WebPDemuxer* WebPAnimDecoderGetDemuxer( + const WebPAnimDecoder* dec); + +// Deletes the WebPAnimDecoder object. +// Parameters: +// dec - (in/out) decoder instance to be deleted +WEBP_EXTERN void WebPAnimDecoderDelete(WebPAnimDecoder* dec); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_DEMUX_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/encode.h b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/encode.h new file mode 100644 index 00000000..56b68e2f --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/encode.h @@ -0,0 +1,552 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// WebP encoder: main interface +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_ENCODE_H_ +#define WEBP_WEBP_ENCODE_H_ + +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_ENCODER_ABI_VERSION 0x020f // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPImageHint WebPImageHint; +// typedef enum WebPEncCSP WebPEncCSP; +// typedef enum WebPPreset WebPPreset; +// typedef enum WebPEncodingError WebPEncodingError; +typedef struct WebPConfig WebPConfig; +typedef struct WebPPicture WebPPicture; // main structure for I/O +typedef struct WebPAuxStats WebPAuxStats; +typedef struct WebPMemoryWriter WebPMemoryWriter; + +// Return the encoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetEncoderVersion(void); + +//------------------------------------------------------------------------------ +// One-stop-shop call! No questions asked: + +// 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 'WebPFree(*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). +WEBP_EXTERN size_t WebPEncodeRGB(const uint8_t* rgb, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGR(const uint8_t* bgr, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeRGBA(const uint8_t* rgba, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGRA(const uint8_t* bgra, + int width, int height, int stride, + float quality_factor, uint8_t** 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. +// Note these functions, like the lossy versions, use the library's default +// settings. For lossless this means 'exact' is disabled. RGB values in +// transparent areas will be modified to improve compression. To avoid this, +// use WebPEncode() and set WebPConfig::exact to 1. +WEBP_EXTERN size_t WebPEncodeLosslessRGB(const uint8_t* rgb, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessBGR(const uint8_t* bgr, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, + int width, int height, int stride, + uint8_t** output); + +//------------------------------------------------------------------------------ +// Coding parameters + +// Image characteristics hint for the underlying encoder. +typedef enum WebPImageHint { + WEBP_HINT_DEFAULT = 0, // default preset. + WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot + WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting + WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc). + WEBP_HINT_LAST +} WebPImageHint; + +// Compression parameters. +struct WebPConfig { + int lossless; // Lossless encoding (0=lossy(default), 1=lossless). + float quality; // between 0 and 100. For lossy, 0 gives the smallest + // size and 100 the largest. For lossless, this + // parameter is the amount of effort put into the + // compression: 0 is the fastest but gives larger + // files compared to the slowest, but best, 100. + int method; // quality/speed trade-off (0=fast, 6=slower-better) + + WebPImageHint image_hint; // Hint for image type (lossless only for now). + + int target_size; // if non-zero, set the desired target size in bytes. + // Takes precedence over the 'compression' parameter. + float target_PSNR; // if non-zero, specifies the minimal distortion to + // try to achieve. Takes precedence over target_size. + int segments; // maximum number of segments to use, in [1..4] + int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. + int filter_strength; // range: [0 = off .. 100 = strongest] + int filter_sharpness; // range: [0 = off .. 7 = least sharp] + int filter_type; // filtering type: 0 = simple, 1 = strong (only used + // if filter_strength > 0 or autofilter > 0) + int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] + int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, + // 1 = compressed with WebP lossless). Default is 1. + int alpha_filtering; // Predictive filtering method for alpha plane. + // 0: none, 1: fast, 2: best. Default if 1. + int alpha_quality; // Between 0 (smallest size) and 100 (lossless). + // Default is 100. + int pass; // number of entropy-analysis passes (in [1..10]). + + int show_compressed; // if true, export the compressed picture back. + // In-loop filtering is not applied. + int preprocessing; // preprocessing filter: + // 0=none, 1=segment-smooth, 2=pseudo-random dithering + int partitions; // log2(number of token partitions) in [0..3]. Default + // is set to 0 for easier progressive decoding. + int partition_limit; // quality degradation allowed to fit the 512k limit + // on prediction modes coding (0: no degradation, + // 100: maximum possible degradation). + int emulate_jpeg_size; // If true, compression parameters will be remapped + // to better match the expected output size from + // JPEG compression. Generally, the output size will + // be similar but the degradation will be lower. + int thread_level; // If non-zero, try and use multi-threaded encoding. + int low_memory; // If set, reduce memory usage (but increase CPU use). + + int near_lossless; // Near lossless encoding [0 = max loss .. 100 = off + // (default)]. + int exact; // if non-zero, preserve the exact RGB values under + // transparent area. Otherwise, discard this invisible + // RGB information for better compression. The default + // value is 0. + + int use_delta_palette; // reserved for future lossless feature + int use_sharp_yuv; // if needed, use sharp (and slow) RGB->YUV conversion + + int qmin; // minimum permissible quality factor + int qmax; // maximum permissible quality factor +}; + +// Enumerate some predefined settings for WebPConfig, depending on the type +// of source picture. These presets are used when calling WebPConfigPreset(). +typedef enum WebPPreset { + WEBP_PRESET_DEFAULT = 0, // default preset. + WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot + WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting + WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details + WEBP_PRESET_ICON, // small-sized colorful images + WEBP_PRESET_TEXT // text-like +} WebPPreset; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int); + +// Should always be called, to initialize a fresh WebPConfig structure before +// modification. Returns false in case of version mismatch. WebPConfigInit() +// must have succeeded before using the 'config' object. +// Note that the default values are lossless=0 and quality=75. +static WEBP_INLINE int WebPConfigInit(WebPConfig* config) { + return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, + WEBP_ENCODER_ABI_VERSION); +} + +// This function will initialize the configuration according to a predefined +// set of parameters (referred to by 'preset') and a given quality factor. +// This function can be called as a replacement to WebPConfigInit(). Will +// return false in case of error. +static WEBP_INLINE int WebPConfigPreset(WebPConfig* config, + WebPPreset preset, float quality) { + return WebPConfigInitInternal(config, preset, quality, + WEBP_ENCODER_ABI_VERSION); +} + +// Activate the lossless compression mode with the desired efficiency level +// between 0 (fastest, lowest compression) and 9 (slower, best compression). +// A good default level is '6', providing a fair tradeoff between compression +// speed and final compressed size. +// This function will overwrite several fields from config: 'method', 'quality' +// and 'lossless'. Returns false in case of parameter error. +WEBP_EXTERN int WebPConfigLosslessPreset(WebPConfig* config, int level); + +// Returns true if 'config' is non-NULL and all configuration parameters are +// within their valid ranges. +WEBP_EXTERN int WebPValidateConfig(const WebPConfig* config); + +//------------------------------------------------------------------------------ +// Input / Output +// Structure for storing auxiliary statistics. + +struct WebPAuxStats { + int coded_size; // final size + + float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha + int block_count[3]; // number of intra4/intra16/skipped macroblocks + int header_bytes[2]; // approximate number of bytes spent for header + // and mode-partition #0 + int residual_bytes[3][4]; // approximate number of bytes spent for + // DC/AC/uv coefficients for each (0..3) segments. + int segment_size[4]; // number of macroblocks in each segments + int segment_quant[4]; // quantizer values for each segments + int segment_level[4]; // filtering strength for each segments [0..63] + + int alpha_data_size; // size of the transparency data + int layer_data_size; // size of the enhancement layer data + + // lossless encoder statistics + uint32_t lossless_features; // bit0:predictor bit1:cross-color transform + // bit2:subtract-green bit3:color indexing + int histogram_bits; // number of precision bits of histogram + int transform_bits; // precision bits for transform + int cache_bits; // number of bits for color cache lookup + int palette_size; // number of color in palette, if used + int lossless_size; // final lossless size + int lossless_hdr_size; // lossless header (transform, huffman etc) size + int lossless_data_size; // lossless image data size + + uint32_t pad[2]; // padding for later use +}; + +// Signature for output function. Should return true if writing was successful. +// data/data_size is the segment of data to write, and 'picture' is for +// reference (and so one can make use of picture->custom_ptr). +typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, + const WebPPicture* picture); + +// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using +// the following WebPMemoryWriter object (to be set as a custom_ptr). +struct WebPMemoryWriter { + uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). + size_t size; // final size + size_t max_size; // total capacity + uint32_t pad[1]; // padding for later use +}; + +// The following must be called first before any use. +WEBP_EXTERN void WebPMemoryWriterInit(WebPMemoryWriter* writer); + +// The following must be called to deallocate writer->mem memory. The 'writer' +// object itself is not deallocated. +WEBP_EXTERN void WebPMemoryWriterClear(WebPMemoryWriter* writer); +// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon +// completion, writer.mem and writer.size will hold the coded data. +// writer.mem must be freed by calling WebPMemoryWriterClear. +WEBP_EXTERN int WebPMemoryWrite(const uint8_t* data, size_t data_size, + const WebPPicture* picture); + +// Progress hook, called from time to time to report progress. It can return +// false to request an abort of the encoding process, or true otherwise if +// everything is OK. +typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); + +// Color spaces. +typedef enum WebPEncCSP { + // chroma sampling + WEBP_YUV420 = 0, // 4:2:0 + WEBP_YUV420A = 4, // alpha channel variant + WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors + WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present +} WebPEncCSP; + +// Encoding error conditions. +typedef enum WebPEncodingError { + VP8_ENC_OK = 0, + VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects + VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits + VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL + VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid + VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height + VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k + VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M + VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes + VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G + VP8_ENC_ERROR_USER_ABORT, // abort request by user + VP8_ENC_ERROR_LAST // list terminator. always last. +} WebPEncodingError; + +// maximum width/height allowed (inclusive), in pixels +#define WEBP_MAX_DIMENSION 16383 + +// Main exchange structure (input samples, output bytes, statistics) +// +// Once WebPPictureInit() has been called, it's ok to make all the INPUT fields +// (use_argb, y/u/v, argb, ...) point to user-owned data, even if +// WebPPictureAlloc() has been called. Depending on the value use_argb, +// it's guaranteed that either *argb or *y/*u/*v content will be kept untouched. +struct WebPPicture { + // INPUT + ////////////// + // Main flag for encoder selecting between ARGB or YUV input. + // It is recommended to use ARGB input (*argb, argb_stride) for lossless + // compression, and YUV input (*y, *u, *v, etc.) for lossy compression + // since these are the respective native colorspace for these formats. + int use_argb; + + // YUV input (mostly used for input to lossy compression) + WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). + int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) + uint8_t* y, *u, *v; // pointers to luma/chroma planes. + int y_stride, uv_stride; // luma/chroma strides. + uint8_t* a; // pointer to the alpha plane + int a_stride; // stride of the alpha plane + uint32_t pad1[2]; // padding for later use + + // ARGB input (mostly used for input to lossless compression) + uint32_t* argb; // Pointer to argb (32 bit) plane. + int argb_stride; // This is stride in pixels units, not bytes. + uint32_t pad2[3]; // padding for later use + + // OUTPUT + /////////////// + // Byte-emission hook, to store compressed bytes as they are ready. + WebPWriterFunction writer; // can be NULL + void* custom_ptr; // can be used by the writer. + + // map for extra information (only for lossy compression mode) + int extra_info_type; // 1: intra type, 2: segment, 3: quant + // 4: intra-16 prediction mode, + // 5: chroma prediction mode, + // 6: bit cost, 7: distortion + uint8_t* extra_info; // if not NULL, points to an array of size + // ((width + 15) / 16) * ((height + 15) / 16) that + // will be filled with a macroblock map, depending + // on extra_info_type. + + // STATS AND REPORTS + /////////////////////////// + // Pointer to side statistics (updated only if not NULL) + WebPAuxStats* stats; + + // Error code for the latest error encountered during encoding + WebPEncodingError error_code; + + // If not NULL, report progress during encoding. + WebPProgressHook progress_hook; + + void* user_data; // this field is free to be set to any value and + // used during callbacks (like progress-report e.g.). + + uint32_t pad3[3]; // padding for later use + + // Unused for now + uint8_t* pad4, *pad5; + uint32_t pad6[8]; // padding for later use + + // PRIVATE FIELDS + //////////////////// + void* memory_; // row chunk of memory for yuva planes + void* memory_argb_; // and for argb too. + void* pad7[2]; // padding for later use +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPPictureInitInternal(WebPPicture*, int); + +// Should always be called, to initialize the structure. Returns false in case +// of version mismatch. WebPPictureInit() must have succeeded before using the +// 'picture' object. +// Note that, by default, use_argb is false and colorspace is WEBP_YUV420. +static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) { + return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// WebPPicture utils + +// Convenience allocation / deallocation based on picture->width/height: +// Allocate y/u/v buffers as per colorspace/width/height specification. +// Note! This function will free the previous buffer if needed. +// Returns false in case of memory error. +WEBP_EXTERN int WebPPictureAlloc(WebPPicture* picture); + +// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). +// Note that this function does _not_ free the memory used by the 'picture' +// object itself. +// Besides memory (which is reclaimed) all other fields of 'picture' are +// preserved. +WEBP_EXTERN void WebPPictureFree(WebPPicture* picture); + +// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, *dst +// will fully own the copied pixels (this is not a view). The 'dst' picture need +// not be initialized as its content is overwritten. +// Returns false in case of memory allocation error. +WEBP_EXTERN int WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); + +// Compute the single distortion for packed planes of samples. +// 'src' will be compared to 'ref', and the raw distortion stored into +// '*distortion'. The refined metric (log(MSE), log(1 - ssim),...' will be +// stored in '*result'. +// 'x_step' is the horizontal stride (in bytes) between samples. +// 'src/ref_stride' is the byte distance between rows. +// Returns false in case of error (bad parameter, memory allocation error, ...). +WEBP_EXTERN int WebPPlaneDistortion(const uint8_t* src, size_t src_stride, + const uint8_t* ref, size_t ref_stride, + int width, int height, + size_t x_step, + int type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float* distortion, float* result); + +// Compute PSNR, SSIM or LSIM distortion metric between two pictures. Results +// are in dB, stored in result[] in the B/G/R/A/All order. The distortion is +// always performed using ARGB samples. Hence if the input is YUV(A), the +// picture will be internally converted to ARGB (just for the measurement). +// Warning: this function is rather CPU-intensive. +WEBP_EXTERN int WebPPictureDistortion( + const WebPPicture* src, const WebPPicture* ref, + int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float result[5]); + +// self-crops a picture to the rectangle defined by top/left/width/height. +// Returns false in case of memory allocation error, or if the rectangle is +// outside of the source picture. +// The rectangle for the view is defined by the top-left corner pixel +// coordinates (left, top) as well as its width and height. This rectangle +// must be fully be comprised inside the 'src' source picture. If the source +// picture uses the YUV420 colorspace, the top and left coordinates will be +// snapped to even values. +WEBP_EXTERN int WebPPictureCrop(WebPPicture* picture, + int left, int top, int width, int height); + +// Extracts a view from 'src' picture into 'dst'. The rectangle for the view +// is defined by the top-left corner pixel coordinates (left, top) as well +// as its width and height. This rectangle must be fully be comprised inside +// the 'src' source picture. If the source picture uses the YUV420 colorspace, +// the top and left coordinates will be snapped to even values. +// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed +// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so, +// the original dimension will be lost). Picture 'dst' need not be initialized +// with WebPPictureInit() if it is different from 'src', since its content will +// be overwritten. +// Returns false in case of invalid parameters. +WEBP_EXTERN int WebPPictureView(const WebPPicture* src, + int left, int top, int width, int height, + WebPPicture* dst); + +// Returns true if the 'picture' is actually a view and therefore does +// not own the memory for pixels. +WEBP_EXTERN int WebPPictureIsView(const WebPPicture* picture); + +// Rescale a picture to new dimension width x height. +// If either 'width' or 'height' (but not both) is 0 the corresponding +// dimension will be calculated preserving the aspect ratio. +// No gamma correction is applied. +// Returns false in case of error (invalid parameter or insufficient memory). +WEBP_EXTERN int WebPPictureRescale(WebPPicture* picture, int width, int height); + +// Colorspace conversion function to import RGB samples. +// Previous buffer will be free'd, if any. +// *rgb buffer should have a size of at least height * rgb_stride. +// Returns false in case of memory error. +WEBP_EXTERN int WebPPictureImportRGB( + WebPPicture* picture, const uint8_t* rgb, int rgb_stride); +// Same, but for RGBA buffer. +WEBP_EXTERN int WebPPictureImportRGBA( + WebPPicture* picture, const uint8_t* rgba, int rgba_stride); +// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format +// input buffer ignoring the alpha channel. Avoids needing to copy the data +// to a temporary 24-bit RGB buffer to import the RGB only. +WEBP_EXTERN int WebPPictureImportRGBX( + WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); + +// Variants of the above, but taking BGR(A|X) input. +WEBP_EXTERN int WebPPictureImportBGR( + WebPPicture* picture, const uint8_t* bgr, int bgr_stride); +WEBP_EXTERN int WebPPictureImportBGRA( + WebPPicture* picture, const uint8_t* bgra, int bgra_stride); +WEBP_EXTERN int WebPPictureImportBGRX( + WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); + +// Converts picture->argb data to the YUV420A format. The 'colorspace' +// parameter is deprecated and should be equal to WEBP_YUV420. +// Upon return, picture->use_argb is set to false. The presence of real +// non-opaque transparent values is detected, and 'colorspace' will be +// adjusted accordingly. Note that this method is lossy. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureARGBToYUVA(WebPPicture* picture, + WebPEncCSP /*colorspace = WEBP_YUV420*/); + +// Same as WebPPictureARGBToYUVA(), but the conversion is done using +// pseudo-random dithering with a strength 'dithering' between +// 0.0 (no dithering) and 1.0 (maximum dithering). This is useful +// for photographic picture. +WEBP_EXTERN int WebPPictureARGBToYUVADithered( + WebPPicture* picture, WebPEncCSP colorspace, float dithering); + +// Performs 'sharp' RGBA->YUVA420 downsampling and colorspace conversion. +// Downsampling is handled with extra care in case of color clipping. This +// method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better +// and sharper YUV representation. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureSharpARGBToYUVA(WebPPicture* picture); +// kept for backward compatibility: +WEBP_EXTERN int WebPPictureSmartARGBToYUVA(WebPPicture* picture); + +// Converts picture->yuv to picture->argb and sets picture->use_argb to true. +// The input format must be YUV_420 or YUV_420A. The conversion from YUV420 to +// ARGB incurs a small loss too. +// Note that the use of this colorspace is discouraged if one has access to the +// raw ARGB samples, since using YUV420 is comparatively lossy. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureYUVAToARGB(WebPPicture* picture); + +// Helper function: given a width x height plane of RGBA or YUV(A) samples +// clean-up or smoothen the YUV or RGB samples under fully transparent area, +// to help compressibility (no guarantee, though). +WEBP_EXTERN void WebPCleanupTransparentArea(WebPPicture* picture); + +// Scan the picture 'picture' for the presence of non fully opaque alpha values. +// Returns true in such case. Otherwise returns false (indicating that the +// alpha plane can be ignored altogether e.g.). +WEBP_EXTERN int WebPPictureHasTransparency(const WebPPicture* picture); + +// Remove the transparency information (if present) by blending the color with +// the background color 'background_rgb' (specified as 24bit RGB triplet). +// After this call, all alpha values are reset to 0xff. +WEBP_EXTERN void WebPBlendAlpha(WebPPicture* picture, uint32_t background_rgb); + +//------------------------------------------------------------------------------ +// Main call + +// Main encoding call, after config and picture have been initialized. +// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), +// and the 'config' object must be a valid one. +// Returns false in case of error, true otherwise. +// In case of error, picture->error_code is updated accordingly. +// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending +// on the value of 'picture->use_argb'. It is highly recommended to use +// the former for lossy encoding, and the latter for lossless encoding +// (when config.lossless is true). Automatic conversion from one format to +// another is provided but they both incur some loss. +WEBP_EXTERN int WebPEncode(const WebPConfig* config, WebPPicture* picture); + +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_ENCODE_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/mux.h b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/mux.h new file mode 100644 index 00000000..7d27489a --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/mux.h @@ -0,0 +1,530 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// RIFF container manipulation and encoding for WebP images. +// +// Authors: Urvang (urvang@google.com) +// Vikas (vikasa@google.com) + +#ifndef WEBP_WEBP_MUX_H_ +#define WEBP_WEBP_MUX_H_ + +#include "./mux_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_MUX_ABI_VERSION 0x0108 // MAJOR(8b) + MINOR(8b) + +//------------------------------------------------------------------------------ +// Mux API +// +// This API allows manipulation of WebP container images containing features +// like color profile, metadata, animation. +// +// Code Example#1: Create a WebPMux object with image data, color profile and +// XMP metadata. +/* + int copy_data = 0; + WebPMux* mux = WebPMuxNew(); + // ... (Prepare image data). + WebPMuxSetImage(mux, &image, copy_data); + // ... (Prepare ICCP color profile data). + WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); + // ... (Prepare XMP metadata). + WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); + // Get data from mux in WebP RIFF format. + WebPMuxAssemble(mux, &output_data); + WebPMuxDelete(mux); + // ... (Consume output_data; e.g. write output_data.bytes to file). + WebPDataClear(&output_data); +*/ + +// Code Example#2: Get image and color profile data from a WebP file. +/* + int copy_data = 0; + // ... (Read data from file). + WebPMux* mux = WebPMuxCreate(&data, copy_data); + WebPMuxGetFrame(mux, 1, &image); + // ... (Consume image; e.g. call WebPDecode() to decode the data). + WebPMuxGetChunk(mux, "ICCP", &icc_profile); + // ... (Consume icc_data). + WebPMuxDelete(mux); + WebPFree(data); +*/ + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPMuxError WebPMuxError; +// typedef enum WebPChunkId WebPChunkId; +typedef struct WebPMux WebPMux; // main opaque object. +typedef struct WebPMuxFrameInfo WebPMuxFrameInfo; +typedef struct WebPMuxAnimParams WebPMuxAnimParams; +typedef struct WebPAnimEncoderOptions WebPAnimEncoderOptions; + +// Error codes +typedef enum WebPMuxError { + WEBP_MUX_OK = 1, + WEBP_MUX_NOT_FOUND = 0, + WEBP_MUX_INVALID_ARGUMENT = -1, + WEBP_MUX_BAD_DATA = -2, + WEBP_MUX_MEMORY_ERROR = -3, + WEBP_MUX_NOT_ENOUGH_DATA = -4 +} WebPMuxError; + +// IDs for different types of chunks. +typedef enum WebPChunkId { + WEBP_CHUNK_VP8X, // VP8X + WEBP_CHUNK_ICCP, // ICCP + WEBP_CHUNK_ANIM, // ANIM + WEBP_CHUNK_ANMF, // ANMF + WEBP_CHUNK_DEPRECATED, // (deprecated from FRGM) + WEBP_CHUNK_ALPHA, // ALPH + WEBP_CHUNK_IMAGE, // VP8/VP8L + WEBP_CHUNK_EXIF, // EXIF + WEBP_CHUNK_XMP, // XMP + WEBP_CHUNK_UNKNOWN, // Other chunks. + WEBP_CHUNK_NIL +} WebPChunkId; + +//------------------------------------------------------------------------------ + +// Returns the version number of the mux library, packed in hexadecimal using +// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetMuxVersion(void); + +//------------------------------------------------------------------------------ +// Life of a Mux object + +// Internal, version-checked, entry point +WEBP_EXTERN WebPMux* WebPNewInternal(int); + +// Creates an empty mux object. +// Returns: +// A pointer to the newly created empty mux object. +// Or NULL in case of memory error. +static WEBP_INLINE WebPMux* WebPMuxNew(void) { + return WebPNewInternal(WEBP_MUX_ABI_VERSION); +} + +// Deletes the mux object. +// Parameters: +// mux - (in/out) object to be deleted +WEBP_EXTERN void WebPMuxDelete(WebPMux* mux); + +//------------------------------------------------------------------------------ +// Mux creation. + +// Internal, version-checked, entry point +WEBP_EXTERN WebPMux* WebPMuxCreateInternal(const WebPData*, int, int); + +// Creates a mux object from raw data given in WebP RIFF format. +// Parameters: +// bitstream - (in) the bitstream data in WebP RIFF format +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// A pointer to the mux object created from given data - on success. +// NULL - In case of invalid data or memory error. +static WEBP_INLINE WebPMux* WebPMuxCreate(const WebPData* bitstream, + int copy_data) { + return WebPMuxCreateInternal(bitstream, copy_data, WEBP_MUX_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// Non-image chunks. + +// Note: Only non-image related chunks should be managed through chunk APIs. +// (Image related chunks are: "ANMF", "VP8 ", "VP8L" and "ALPH"). +// To add, get and delete images, use WebPMuxSetImage(), WebPMuxPushFrame(), +// WebPMuxGetFrame() and WebPMuxDeleteFrame(). + +// Adds a chunk with id 'fourcc' and data 'chunk_data' in the mux object. +// Any existing chunk(s) with the same id will be removed. +// Parameters: +// mux - (in/out) object to which the chunk is to be added +// fourcc - (in) a character array containing the fourcc of the given chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// chunk_data - (in) the chunk data to be added +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetChunk( + WebPMux* mux, const char fourcc[4], const WebPData* chunk_data, + int copy_data); + +// Gets a reference to the data of the chunk with id 'fourcc' in the mux object. +// The caller should NOT free the returned data. +// Parameters: +// mux - (in) object from which the chunk data is to be fetched +// fourcc - (in) a character array containing the fourcc of the chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// chunk_data - (out) returned chunk data +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given id. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetChunk( + const WebPMux* mux, const char fourcc[4], WebPData* chunk_data); + +// Deletes the chunk with the given 'fourcc' from the mux object. +// Parameters: +// mux - (in/out) object from which the chunk is to be deleted +// fourcc - (in) a character array containing the fourcc of the chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or fourcc is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given fourcc. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxDeleteChunk( + WebPMux* mux, const char fourcc[4]); + +//------------------------------------------------------------------------------ +// Images. + +// Encapsulates data about a single frame. +struct WebPMuxFrameInfo { + WebPData bitstream; // image data: can be a raw VP8/VP8L bitstream + // or a single-image WebP file. + int x_offset; // x-offset of the frame. + int y_offset; // y-offset of the frame. + int duration; // duration of the frame (in milliseconds). + + WebPChunkId id; // frame type: should be one of WEBP_CHUNK_ANMF + // or WEBP_CHUNK_IMAGE + WebPMuxAnimDispose dispose_method; // Disposal method for the frame. + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + uint32_t pad[1]; // padding for later use +}; + +// Sets the (non-animated) image in the mux object. +// Note: Any existing images (including frames) will be removed. +// Parameters: +// mux - (in/out) object in which the image is to be set +// bitstream - (in) can be a raw VP8/VP8L bitstream or a single-image +// WebP file (non-animated) +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetImage( + WebPMux* mux, const WebPData* bitstream, int copy_data); + +// Adds a frame at the end of the mux object. +// Notes: (1) frame.id should be WEBP_CHUNK_ANMF +// (2) For setting a non-animated image, use WebPMuxSetImage() instead. +// (3) Type of frame being pushed must be same as the frames in mux. +// (4) As WebP only supports even offsets, any odd offset will be snapped +// to an even location using: offset &= ~1 +// Parameters: +// mux - (in/out) object to which the frame is to be added +// frame - (in) frame data. +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL +// or if content of 'frame' is invalid. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxPushFrame( + WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data); + +// Gets the nth frame from the mux object. +// The content of 'frame->bitstream' is allocated using WebPMalloc(), and NOT +// owned by the 'mux' object. It MUST be deallocated by the caller by calling +// WebPDataClear(). +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in) object from which the info is to be fetched +// nth - (in) index of the frame in the mux object +// frame - (out) data of the returned frame +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL. +// WEBP_MUX_NOT_FOUND - if there are less than nth frames in the mux object. +// WEBP_MUX_BAD_DATA - if nth frame chunk in mux is invalid. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetFrame( + const WebPMux* mux, uint32_t nth, WebPMuxFrameInfo* frame); + +// Deletes a frame from the mux object. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in/out) object from which a frame is to be deleted +// nth - (in) The position from which the frame is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL. +// WEBP_MUX_NOT_FOUND - If there are less than nth frames in the mux object +// before deletion. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth); + +//------------------------------------------------------------------------------ +// Animation. + +// Animation parameters. +struct WebPMuxAnimParams { + uint32_t bgcolor; // Background color of the canvas stored (in MSB order) as: + // Bits 00 to 07: Alpha. + // Bits 08 to 15: Red. + // Bits 16 to 23: Green. + // Bits 24 to 31: Blue. + int loop_count; // Number of times to repeat the animation [0 = infinite]. +}; + +// Sets the animation parameters in the mux object. Any existing ANIM chunks +// will be removed. +// Parameters: +// mux - (in/out) object in which ANIM chunk is to be set/added +// params - (in) animation parameters. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetAnimationParams( + WebPMux* mux, const WebPMuxAnimParams* params); + +// Gets the animation parameters from the mux object. +// Parameters: +// mux - (in) object from which the animation parameters to be fetched +// params - (out) animation parameters extracted from the ANIM chunk +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. +// WEBP_MUX_NOT_FOUND - if ANIM chunk is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetAnimationParams( + const WebPMux* mux, WebPMuxAnimParams* params); + +//------------------------------------------------------------------------------ +// Misc Utilities. + +// Sets the canvas size for the mux object. The width and height can be +// specified explicitly or left as zero (0, 0). +// * When width and height are specified explicitly, then this frame bound is +// enforced during subsequent calls to WebPMuxAssemble() and an error is +// reported if any animated frame does not completely fit within the canvas. +// * When unspecified (0, 0), the constructed canvas will get the frame bounds +// from the bounding-box over all frames after calling WebPMuxAssemble(). +// Parameters: +// mux - (in) object to which the canvas size is to be set +// width - (in) canvas width +// height - (in) canvas height +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL; or +// width or height are invalid or out of bounds +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, + int width, int height); + +// Gets the canvas size from the mux object. +// Note: This method assumes that the VP8X chunk, if present, is up-to-date. +// That is, the mux object hasn't been modified since the last call to +// WebPMuxAssemble() or WebPMuxCreate(). +// Parameters: +// mux - (in) object from which the canvas size is to be fetched +// width - (out) canvas width +// height - (out) canvas height +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, width or height is NULL. +// WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetCanvasSize(const WebPMux* mux, + int* width, int* height); + +// Gets the feature flags from the mux object. +// Note: This method assumes that the VP8X chunk, if present, is up-to-date. +// That is, the mux object hasn't been modified since the last call to +// WebPMuxAssemble() or WebPMuxCreate(). +// Parameters: +// mux - (in) object from which the features are to be fetched +// flags - (out) the flags specifying which features are present in the +// mux object. This will be an OR of various flag values. +// Enum 'WebPFeatureFlags' can be used to test individual flag values. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or flags is NULL. +// WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetFeatures(const WebPMux* mux, + uint32_t* flags); + +// Gets number of chunks with the given 'id' in the mux object. +// Parameters: +// mux - (in) object from which the info is to be fetched +// id - (in) chunk id specifying the type of chunk +// num_elements - (out) number of chunks with the given chunk id +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, or num_elements is NULL. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxNumChunks(const WebPMux* mux, + WebPChunkId id, int* num_elements); + +// Assembles all chunks in WebP RIFF format and returns in 'assembled_data'. +// This function also validates the mux object. +// Note: The content of 'assembled_data' will be ignored and overwritten. +// Also, the content of 'assembled_data' is allocated using WebPMalloc(), and +// NOT owned by the 'mux' object. It MUST be deallocated by the caller by +// calling WebPDataClear(). It's always safe to call WebPDataClear() upon +// return, even in case of error. +// Parameters: +// mux - (in/out) object whose chunks are to be assembled +// assembled_data - (out) assembled WebP data +// Returns: +// WEBP_MUX_BAD_DATA - if mux object is invalid. +// WEBP_MUX_INVALID_ARGUMENT - if mux or assembled_data is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxAssemble(WebPMux* mux, + WebPData* assembled_data); + +//------------------------------------------------------------------------------ +// WebPAnimEncoder API +// +// This API allows encoding (possibly) animated WebP images. +// +// Code Example: +/* + WebPAnimEncoderOptions enc_options; + WebPAnimEncoderOptionsInit(&enc_options); + // Tune 'enc_options' as needed. + WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); + while() { + WebPConfig config; + WebPConfigInit(&config); + // Tune 'config' as needed. + WebPAnimEncoderAdd(enc, frame, timestamp_ms, &config); + } + WebPAnimEncoderAdd(enc, NULL, timestamp_ms, NULL); + WebPAnimEncoderAssemble(enc, webp_data); + WebPAnimEncoderDelete(enc); + // Write the 'webp_data' to a file, or re-mux it further. +*/ + +typedef struct WebPAnimEncoder WebPAnimEncoder; // Main opaque object. + +// Forward declarations. Defined in encode.h. +struct WebPPicture; +struct WebPConfig; + +// Global options. +struct WebPAnimEncoderOptions { + WebPMuxAnimParams anim_params; // Animation parameters. + int minimize_size; // If true, minimize the output size (slow). Implicitly + // disables key-frame insertion. + int kmin; + int kmax; // Minimum and maximum distance between consecutive key + // frames in the output. The library may insert some key + // frames as needed to satisfy this criteria. + // Note that these conditions should hold: kmax > kmin + // and kmin >= kmax / 2 + 1. Also, if kmax <= 0, then + // key-frame insertion is disabled; and if kmax == 1, + // then all frames will be key-frames (kmin value does + // not matter for these special cases). + int allow_mixed; // If true, use mixed compression mode; may choose + // either lossy and lossless for each frame. + int verbose; // If true, print info and warning messages to stderr. + + uint32_t padding[4]; // Padding for later use. +}; + +// Internal, version-checked, entry point. +WEBP_EXTERN int WebPAnimEncoderOptionsInitInternal( + WebPAnimEncoderOptions*, int); + +// Should always be called, to initialize a fresh WebPAnimEncoderOptions +// structure before modification. Returns false in case of version mismatch. +// WebPAnimEncoderOptionsInit() must have succeeded before using the +// 'enc_options' object. +static WEBP_INLINE int WebPAnimEncoderOptionsInit( + WebPAnimEncoderOptions* enc_options) { + return WebPAnimEncoderOptionsInitInternal(enc_options, WEBP_MUX_ABI_VERSION); +} + +// Internal, version-checked, entry point. +WEBP_EXTERN WebPAnimEncoder* WebPAnimEncoderNewInternal( + int, int, const WebPAnimEncoderOptions*, int); + +// Creates and initializes a WebPAnimEncoder object. +// Parameters: +// width/height - (in) canvas width and height of the animation. +// enc_options - (in) encoding options; can be passed NULL to pick +// reasonable defaults. +// Returns: +// A pointer to the newly created WebPAnimEncoder object. +// Or NULL in case of memory error. +static WEBP_INLINE WebPAnimEncoder* WebPAnimEncoderNew( + int width, int height, const WebPAnimEncoderOptions* enc_options) { + return WebPAnimEncoderNewInternal(width, height, enc_options, + WEBP_MUX_ABI_VERSION); +} + +// Optimize the given frame for WebP, encode it and add it to the +// WebPAnimEncoder object. +// The last call to 'WebPAnimEncoderAdd' should be with frame = NULL, which +// indicates that no more frames are to be added. This call is also used to +// determine the duration of the last frame. +// Parameters: +// enc - (in/out) object to which the frame is to be added. +// frame - (in/out) frame data in ARGB or YUV(A) format. If it is in YUV(A) +// format, it will be converted to ARGB, which incurs a small loss. +// timestamp_ms - (in) timestamp of this frame in milliseconds. +// Duration of a frame would be calculated as +// "timestamp of next frame - timestamp of this frame". +// Hence, timestamps should be in non-decreasing order. +// config - (in) encoding options; can be passed NULL to pick +// reasonable defaults. +// Returns: +// On error, returns false and frame->error_code is set appropriately. +// Otherwise, returns true. +WEBP_EXTERN int WebPAnimEncoderAdd( + WebPAnimEncoder* enc, struct WebPPicture* frame, int timestamp_ms, + const struct WebPConfig* config); + +// Assemble all frames added so far into a WebP bitstream. +// This call should be preceded by a call to 'WebPAnimEncoderAdd' with +// frame = NULL; if not, the duration of the last frame will be internally +// estimated. +// Parameters: +// enc - (in/out) object from which the frames are to be assembled. +// webp_data - (out) generated WebP bitstream. +// Returns: +// True on success. +WEBP_EXTERN int WebPAnimEncoderAssemble(WebPAnimEncoder* enc, + WebPData* webp_data); + +// Get error string corresponding to the most recent call using 'enc'. The +// returned string is owned by 'enc' and is valid only until the next call to +// WebPAnimEncoderAdd() or WebPAnimEncoderAssemble() or WebPAnimEncoderDelete(). +// Parameters: +// enc - (in/out) object from which the error string is to be fetched. +// Returns: +// NULL if 'enc' is NULL. Otherwise, returns the error string if the last call +// to 'enc' had an error, or an empty string if the last call was a success. +WEBP_EXTERN const char* WebPAnimEncoderGetError(WebPAnimEncoder* enc); + +// Deletes the WebPAnimEncoder object. +// Parameters: +// enc - (in/out) object to be deleted +WEBP_EXTERN void WebPAnimEncoderDelete(WebPAnimEncoder* enc); + +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_MUX_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/mux_types.h b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/mux_types.h new file mode 100644 index 00000000..2fe81958 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/mux_types.h @@ -0,0 +1,98 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Data-types common to the mux and demux libraries. +// +// Author: Urvang (urvang@google.com) + +#ifndef WEBP_WEBP_MUX_TYPES_H_ +#define WEBP_WEBP_MUX_TYPES_H_ + +#include // memset() +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPFeatureFlags WebPFeatureFlags; +// typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; +// typedef enum WebPMuxAnimBlend WebPMuxAnimBlend; +typedef struct WebPData WebPData; + +// VP8X Feature Flags. +typedef enum WebPFeatureFlags { + ANIMATION_FLAG = 0x00000002, + XMP_FLAG = 0x00000004, + EXIF_FLAG = 0x00000008, + ALPHA_FLAG = 0x00000010, + ICCP_FLAG = 0x00000020, + + ALL_VALID_FLAGS = 0x0000003e +} WebPFeatureFlags; + +// Dispose method (animation only). Indicates how the area used by the current +// frame is to be treated before rendering the next frame on the canvas. +typedef enum WebPMuxAnimDispose { + WEBP_MUX_DISPOSE_NONE, // Do not dispose. + WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. +} WebPMuxAnimDispose; + +// Blend operation (animation only). Indicates how transparent pixels of the +// current frame are blended with those of the previous canvas. +typedef enum WebPMuxAnimBlend { + WEBP_MUX_BLEND, // Blend. + WEBP_MUX_NO_BLEND // Do not blend. +} WebPMuxAnimBlend; + +// Data type used to describe 'raw' data, e.g., chunk data +// (ICC profile, metadata) and WebP compressed image data. +// 'bytes' memory must be allocated using WebPMalloc() and such. +struct WebPData { + const uint8_t* bytes; + size_t size; +}; + +// Initializes the contents of the 'webp_data' object with default values. +static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { + if (webp_data != NULL) { + memset(webp_data, 0, sizeof(*webp_data)); + } +} + +// Clears the contents of the 'webp_data' object by calling WebPFree(). +// Does not deallocate the object itself. +static WEBP_INLINE void WebPDataClear(WebPData* webp_data) { + if (webp_data != NULL) { + WebPFree((void*)webp_data->bytes); + WebPDataInit(webp_data); + } +} + +// Allocates necessary storage for 'dst' and copies the contents of 'src'. +// Returns true on success. +static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) { + if (src == NULL || dst == NULL) return 0; + WebPDataInit(dst); + if (src->bytes != NULL && src->size != 0) { + dst->bytes = (uint8_t*)WebPMalloc(src->size); + if (dst->bytes == NULL) return 0; + memcpy((void*)dst->bytes, src->bytes, src->size); + dst->size = src->size; + } + return 1; +} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_MUX_TYPES_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/types.h b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/types.h new file mode 100644 index 00000000..47f7f2b0 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-mac-x86-64/include/webp/types.h @@ -0,0 +1,68 @@ +// Copyright 2010 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Common types + memory wrappers +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_TYPES_H_ +#define WEBP_WEBP_TYPES_H_ + +#include // for size_t + +#ifndef _MSC_VER +#include +#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ + (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) +#define WEBP_INLINE inline +#else +#define WEBP_INLINE +#endif +#else +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned long long int uint64_t; +typedef long long int int64_t; +#define WEBP_INLINE __forceinline +#endif /* _MSC_VER */ + +#ifndef WEBP_EXTERN +// This explicitly marks library functions and allows for changing the +// signature for e.g., Windows DLL builds. +# if defined(__GNUC__) && __GNUC__ >= 4 +# define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) +# else +# define WEBP_EXTERN extern +# endif /* __GNUC__ >= 4 */ +#endif /* WEBP_EXTERN */ + +// Macro to check ABI compatibility (same major revision number) +#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) + +#ifdef __cplusplus +extern "C" { +#endif + +// Allocates 'size' bytes of memory. Returns NULL upon error. Memory +// must be deallocated by calling WebPFree(). This function is made available +// by the core 'libwebp' library. +WEBP_EXTERN void* WebPMalloc(size_t size); + +// Releases memory returned by the WebPDecode*() functions (from decode.h). +WEBP_EXTERN void WebPFree(void* ptr); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_TYPES_H_ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebp.a b/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebp.a new file mode 100644 index 00000000..e4dccbc6 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebp.a differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebpdemux.a b/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebpdemux.a new file mode 100644 index 00000000..c892374f Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebpdemux.a differ diff --git a/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebpmux.a b/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebpmux.a new file mode 100644 index 00000000..ef588723 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-mac-x86-64/lib/libwebpmux.a differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/README.md b/resources/binaries/libwebp-1.2.4-windows-x64/README.md new file mode 100644 index 00000000..4dfe39c0 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/README.md @@ -0,0 +1,65 @@ +# WebP Codec + +``` + __ __ ____ ____ ____ + / \\/ \/ _ \/ _ )/ _ \ + \ / __/ _ \ __/ + \__\__/\____/\_____/__/ ____ ___ + / _/ / \ \ / _ \/ _/ + / \_/ / / \ \ __/ \__ + \____/____/\_____/_____/____/v1.2.4 +``` + +WebP codec is a library to encode and decode images in WebP format. This package +contains the library that can be used in other programs to add WebP support, as +well as the command line tools 'cwebp' and 'dwebp' to compress and decompress +images respectively. + +See https://developers.google.com/speed/webp for details on the image format. + +The latest source tree is available at +https://chromium.googlesource.com/webm/libwebp + +It is released under the same license as the WebM project. See +https://www.webmproject.org/license/software/ or the "COPYING" file for details. +An additional intellectual property rights grant can be found in the file +PATENTS. + +## Files + +* bin/cwebp : encoding tool +* bin/dwebp : decoding tool +* bin/gif2webp : gif conversion tool +* bin/img2webp : animation creation tool +* bin/vwebp : webp visualization tool +* bin/webpinfo : webp analysis tool +* bin/webpmux : webp muxing tool +* bin/anim\_diff : webp file comparison tool +* bin/anim\_dump : tool for dumping animation frames +* bin/get\_disto : tool for calculating file distortion +* bin/webp\_quality : webp quality estimation tool +* doc/ : manual in HTML and text formats +* lib/ : static libraries +* include/webp : headers + +## Encoding and Decoding Tools + +The bin/ directory contains tools to encode and decode images and animations, +view information about WebP images, and more. See the +[tools documentation](doc/tools.md). + +## APIs + +See the [APIs documentation](doc/api.md). + +## Bugs + +Please report all bugs to the issue tracker: https://bugs.chromium.org/p/webp + +Patches welcome! See [how to contribute](CONTRIBUTING.md). + +## Discuss + +Email: webp-discuss@webmproject.org + +Web: https://groups.google.com/a/webmproject.org/group/webp-discuss diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/api.md b/resources/binaries/libwebp-1.2.4-windows-x64/api.md new file mode 100644 index 00000000..d0adafbd --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/api.md @@ -0,0 +1,385 @@ +# WebP APIs + +## Encoding API + +The main encoding functions are available in the header src/webp/encode.h + +The ready-to-use ones are: + +```c +size_t WebPEncodeRGB(const uint8_t* rgb, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeBGR(const uint8_t* bgr, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeRGBA(const uint8_t* rgba, int width, int height, int stride, + float quality_factor, uint8_t** output); +size_t WebPEncodeBGRA(const uint8_t* bgra, int width, int height, int stride, + float quality_factor, uint8_t** output); +``` + +They will convert raw RGB samples to a WebP data. The only control supplied is +the quality factor. + +There are some variants for using the lossless format: + +```c +size_t WebPEncodeLosslessRGB(const uint8_t* rgb, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessBGR(const uint8_t* bgr, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, int width, int height, + int stride, uint8_t** output); +size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, int width, int height, + int stride, uint8_t** output); +``` + +Of course in this case, no quality factor is needed since the compression occurs +without loss of the input values, at the expense of larger output sizes. + +### Advanced encoding API + +A more advanced API is based on the WebPConfig and WebPPicture structures. + +WebPConfig contains the encoding settings and is not tied to a particular +picture. WebPPicture contains input data, on which some WebPConfig will be used +for compression. The encoding flow looks like: + +```c +#include + +// Setup a config, starting form a preset and tuning some additional +// parameters +WebPConfig config; +if (!WebPConfigPreset(&config, WEBP_PRESET_PHOTO, quality_factor)) { + return 0; // version error +} +// ... additional tuning +config.sns_strength = 90; +config.filter_sharpness = 6; +config_error = WebPValidateConfig(&config); // not mandatory, but useful + +// Setup the input data +WebPPicture pic; +if (!WebPPictureInit(&pic)) { + return 0; // version error +} +pic.width = width; +pic.height = height; +// allocated picture of dimension width x height +if (!WebPPictureAlloc(&pic)) { + return 0; // memory error +} +// at this point, 'pic' has been initialized as a container, +// and can receive the Y/U/V samples. +// Alternatively, one could use ready-made import functions like +// WebPPictureImportRGB(), which will take care of memory allocation. +// In any case, past this point, one will have to call +// WebPPictureFree(&pic) to reclaim memory. + +// Set up a byte-output write method. WebPMemoryWriter, for instance. +WebPMemoryWriter wrt; +WebPMemoryWriterInit(&wrt); // initialize 'wrt' + +pic.writer = MyFileWriter; +pic.custom_ptr = my_opaque_structure_to_make_MyFileWriter_work; + +// Compress! +int ok = WebPEncode(&config, &pic); // ok = 0 => error occurred! +WebPPictureFree(&pic); // must be called independently of the 'ok' result. + +// output data should have been handled by the writer at that point. +// -> compressed data is the memory buffer described by wrt.mem / wrt.size + +// deallocate the memory used by compressed data +WebPMemoryWriterClear(&wrt); +``` + +## Decoding API + +This is mainly just one function to call: + +```c +#include "webp/decode.h" +uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, + int* width, int* height); +``` + +Please have a look at the file src/webp/decode.h for the details. There are +variants for decoding in BGR/RGBA/ARGB/BGRA order, along with decoding to raw +Y'CbCr samples. One can also decode the image directly into a pre-allocated +buffer. + +To detect a WebP file and gather the picture's dimensions, the function: + +```c +int WebPGetInfo(const uint8_t* data, size_t data_size, + int* width, int* height); +``` + +is supplied. No decoding is involved when using it. + +### Incremental decoding API + +In the case when data is being progressively transmitted, pictures can still be +incrementally decoded using a slightly more complicated API. Decoder state is +stored into an instance of the WebPIDecoder object. This object can be created +with the purpose of decoding either RGB or Y'CbCr samples. For instance: + +```c +WebPDecBuffer buffer; +WebPInitDecBuffer(&buffer); +buffer.colorspace = MODE_BGR; +... +WebPIDecoder* idec = WebPINewDecoder(&buffer); +``` + +As data is made progressively available, this incremental-decoder object can be +used to decode the picture further. There are two (mutually exclusive) ways to +pass freshly arrived data: + +either by appending the fresh bytes: + +```c +WebPIAppend(idec, fresh_data, size_of_fresh_data); +``` + +or by just mentioning the new size of the transmitted data: + +```c +WebPIUpdate(idec, buffer, size_of_transmitted_buffer); +``` + +Note that 'buffer' can be modified between each call to WebPIUpdate, in +particular when the buffer is resized to accommodate larger data. + +These functions will return the decoding status: either VP8_STATUS_SUSPENDED if +decoding is not finished yet or VP8_STATUS_OK when decoding is done. Any other +status is an error condition. + +The 'idec' object must always be released (even upon an error condition) by +calling: WebPDelete(idec). + +To retrieve partially decoded picture samples, one must use the corresponding +method: WebPIDecGetRGB or WebPIDecGetYUVA. It will return the last displayable +pixel row. + +Lastly, note that decoding can also be performed into a pre-allocated pixel +buffer. This buffer must be passed when creating a WebPIDecoder, calling +WebPINewRGB() or WebPINewYUVA(). + +Please have a look at the src/webp/decode.h header for further details. + +### Advanced Decoding API + +WebP decoding supports an advanced API which provides on-the-fly cropping and +rescaling, something of great usefulness on memory-constrained environments like +mobile phones. Basically, the memory usage will scale with the output's size, +not the input's, when one only needs a quick preview or a zoomed in portion of +an otherwise too-large picture. Some CPU can be saved too, incidentally. + +```c +// A) Init a configuration object +WebPDecoderConfig config; +CHECK(WebPInitDecoderConfig(&config)); + +// B) optional: retrieve the bitstream's features. +CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + +// C) Adjust 'config' options, if needed +config.options.no_fancy_upsampling = 1; +config.options.use_scaling = 1; +config.options.scaled_width = scaledWidth(); +config.options.scaled_height = scaledHeight(); +// etc. + +// D) Specify 'config' output options for specifying output colorspace. +// Optionally the external image decode buffer can also be specified. +config.output.colorspace = MODE_BGRA; +// Optionally, the config.output can be pointed to an external buffer as +// well for decoding the image. This externally supplied memory buffer +// should be big enough to store the decoded picture. +config.output.u.RGBA.rgba = (uint8_t*) memory_buffer; +config.output.u.RGBA.stride = scanline_stride; +config.output.u.RGBA.size = total_size_of_the_memory_buffer; +config.output.is_external_memory = 1; + +// E) Decode the WebP image. There are two variants w.r.t decoding image. +// The first one (E.1) decodes the full image and the second one (E.2) is +// used to incrementally decode the image using small input buffers. +// Any one of these steps can be used to decode the WebP image. + +// E.1) Decode full image. +CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + +// E.2) Decode image incrementally. +WebPIDecoder* const idec = WebPIDecode(NULL, NULL, &config); +CHECK(idec != NULL); +while (bytes_remaining > 0) { + VP8StatusCode status = WebPIAppend(idec, input, bytes_read); + if (status == VP8_STATUS_OK || status == VP8_STATUS_SUSPENDED) { + bytes_remaining -= bytes_read; + } else { + break; + } +} +WebPIDelete(idec); + +// F) Decoded image is now in config.output (and config.output.u.RGBA). +// It can be saved, displayed or otherwise processed. + +// G) Reclaim memory allocated in config's object. It's safe to call +// this function even if the memory is external and wasn't allocated +// by WebPDecode(). +WebPFreeDecBuffer(&config.output); +``` + +## Webp Mux + +WebPMux is a set of two libraries 'Mux' and 'Demux' for creation, extraction and +manipulation of an extended format WebP file, which can have features like color +profile, metadata and animation. Reference command-line tools `webpmux` and +`vwebp` as well as the WebP container specification +'doc/webp-container-spec.txt' are also provided in this package, see the +[tools documentation](tools.md). + +### Mux API + +The Mux API contains methods for adding data to and reading data from WebP +files. This API currently supports XMP/EXIF metadata, ICC profile and animation. +Other features may be added in subsequent releases. + +Example#1 (pseudo code): Creating a WebPMux object with image data, color +profile and XMP metadata. + +```c +int copy_data = 0; +WebPMux* mux = WebPMuxNew(); +// ... (Prepare image data). +WebPMuxSetImage(mux, &image, copy_data); +// ... (Prepare ICC profile data). +WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); +// ... (Prepare XMP metadata). +WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); +// Get data from mux in WebP RIFF format. +WebPMuxAssemble(mux, &output_data); +WebPMuxDelete(mux); +// ... (Consume output_data; e.g. write output_data.bytes to file). +WebPDataClear(&output_data); +``` + +Example#2 (pseudo code): Get image and color profile data from a WebP file. + +```c +int copy_data = 0; +// ... (Read data from file). +WebPMux* mux = WebPMuxCreate(&data, copy_data); +WebPMuxGetFrame(mux, 1, &image); +// ... (Consume image; e.g. call WebPDecode() to decode the data). +WebPMuxGetChunk(mux, "ICCP", &icc_profile); +// ... (Consume icc_profile). +WebPMuxDelete(mux); +free(data); +``` + +For a detailed Mux API reference, please refer to the header file +(src/webp/mux.h). + +### Demux API + +The Demux API enables extraction of images and extended format data from WebP +files. This API currently supports reading of XMP/EXIF metadata, ICC profile and +animated images. Other features may be added in subsequent releases. + +Code example: Demuxing WebP data to extract all the frames, ICC profile and +EXIF/XMP metadata. + +```c +WebPDemuxer* demux = WebPDemux(&webp_data); +uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); +uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); +// ... (Get information about the features present in the WebP file). +uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); + +// ... (Iterate over all frames). +WebPIterator iter; +if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), + // ... and get other frame properties like width, height, offsets etc. + // ... see 'struct WebPIterator' below for more info). + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); +} + +// ... (Extract metadata). +WebPChunkIterator chunk_iter; +if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); +// ... (Consume the ICC profile in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); +// ... (Consume the EXIF metadata in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); +// ... (Consume the XMP metadata in 'chunk_iter.chunk'). +WebPDemuxReleaseChunkIterator(&chunk_iter); +WebPDemuxDelete(demux); +``` + +For a detailed Demux API reference, please refer to the header file +(src/webp/demux.h). + +## AnimEncoder API + +The AnimEncoder API can be used to create animated WebP images. + +Code example: + +```c +WebPAnimEncoderOptions enc_options; +WebPAnimEncoderOptionsInit(&enc_options); +// ... (Tune 'enc_options' as needed). +WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); +while() { + WebPConfig config; + WebPConfigInit(&config); + // ... (Tune 'config' as needed). + WebPAnimEncoderAdd(enc, frame, duration, &config); +} +WebPAnimEncoderAssemble(enc, webp_data); +WebPAnimEncoderDelete(enc); +// ... (Write the 'webp_data' to a file, or re-mux it further). +``` + +For a detailed AnimEncoder API reference, please refer to the header file +(src/webp/mux.h). + +## AnimDecoder API + +This AnimDecoder API allows decoding (possibly) animated WebP images. + +Code Example: + +```c +WebPAnimDecoderOptions dec_options; +WebPAnimDecoderOptionsInit(&dec_options); +// Tune 'dec_options' as needed. +WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); +WebPAnimInfo anim_info; +WebPAnimDecoderGetInfo(dec, &anim_info); +for (uint32_t i = 0; i < anim_info.loop_count; ++i) { + while (WebPAnimDecoderHasMoreFrames(dec)) { + uint8_t* buf; + int timestamp; + WebPAnimDecoderGetNext(dec, &buf, ×tamp); + // ... (Render 'buf' based on 'timestamp'). + // ... (Do NOT free 'buf', as it is owned by 'dec'). + } + WebPAnimDecoderReset(dec); +} +const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); +// ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). +WebPAnimDecoderDelete(dec); +``` + +For a detailed AnimDecoder API reference, please refer to the header file +(src/webp/demux.h). diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/anim_diff.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/anim_diff.exe new file mode 100644 index 00000000..25d7998b Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/anim_diff.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/anim_dump.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/anim_dump.exe new file mode 100644 index 00000000..eebcbd8c Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/anim_dump.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/cwebp.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/cwebp.exe new file mode 100644 index 00000000..68cec74b Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/cwebp.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/dwebp.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/dwebp.exe new file mode 100644 index 00000000..0bb866e2 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/dwebp.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/freeglut.dll b/resources/binaries/libwebp-1.2.4-windows-x64/bin/freeglut.dll new file mode 100644 index 00000000..8624d4ec Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/freeglut.dll differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/get_disto.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/get_disto.exe new file mode 100644 index 00000000..b3ad6305 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/get_disto.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/gif2webp.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/gif2webp.exe new file mode 100644 index 00000000..d1cefbf0 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/gif2webp.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/img2webp.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/img2webp.exe new file mode 100644 index 00000000..90f021e2 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/img2webp.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/vwebp.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/vwebp.exe new file mode 100644 index 00000000..d08b3278 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/vwebp.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/webp_quality.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/webp_quality.exe new file mode 100644 index 00000000..2df1d01e Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/webp_quality.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/webpinfo.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/webpinfo.exe new file mode 100644 index 00000000..1b4775df Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/webpinfo.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/bin/webpmux.exe b/resources/binaries/libwebp-1.2.4-windows-x64/bin/webpmux.exe new file mode 100644 index 00000000..3010995d Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/bin/webpmux.exe differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/decode.h b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/decode.h new file mode 100644 index 00000000..d9824750 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/decode.h @@ -0,0 +1,503 @@ +// Copyright 2010 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Main decoding functions for WebP images. +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_DECODE_H_ +#define WEBP_WEBP_DECODE_H_ + +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_DECODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum VP8StatusCode VP8StatusCode; +// typedef enum WEBP_CSP_MODE WEBP_CSP_MODE; +typedef struct WebPRGBABuffer WebPRGBABuffer; +typedef struct WebPYUVABuffer WebPYUVABuffer; +typedef struct WebPDecBuffer WebPDecBuffer; +typedef struct WebPIDecoder WebPIDecoder; +typedef struct WebPBitstreamFeatures WebPBitstreamFeatures; +typedef struct WebPDecoderOptions WebPDecoderOptions; +typedef struct WebPDecoderConfig WebPDecoderConfig; + +// Return the decoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetDecoderVersion(void); + +// Retrieve basic header information: width, height. +// This function will also validate the header, returning true on success, +// false otherwise. '*width' and '*height' are only valid on successful return. +// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. +WEBP_EXTERN int WebPGetInfo(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Decodes WebP images pointed to by 'data' and returns RGBA samples, along +// with the dimensions in *width and *height. The ordering of samples in +// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent). +// The returned pointer should be deleted calling WebPFree(). +// Returns NULL in case of error. +WEBP_EXTERN uint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data. +// If the bitstream contains transparency, it is ignored. +WEBP_EXTERN uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, + int* width, int* height); + +// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data. +WEBP_EXTERN uint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size, + int* width, int* height); + + +// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer +// returned is the Y samples buffer. Upon return, *u and *v will point to +// the U and V chroma data. These U and V buffers need NOT be passed to +// WebPFree(), unlike the returned Y luma one. The dimension of the U and V +// planes are both (*width + 1) / 2 and (*height + 1)/ 2. +// Upon return, the Y buffer has a stride returned as '*stride', while U and V +// have a common stride returned as '*uv_stride'. +// Return NULL in case of error. +// (*) Also named Y'CbCr. See: https://en.wikipedia.org/wiki/YCbCr +WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size, + int* width, int* height, + uint8_t** u, uint8_t** v, + int* stride, int* uv_stride); + +// These five functions are variants of the above ones, that decode the image +// directly into a pre-allocated buffer 'output_buffer'. The maximum storage +// available in this buffer is indicated by 'output_buffer_size'. If this +// storage is not sufficient (or an error occurred), NULL is returned. +// Otherwise, output_buffer is returned, for convenience. +// The parameter 'output_stride' specifies the distance (in bytes) +// between scanlines. Hence, output_buffer_size is expected to be at least +// output_stride x picture-height. +WEBP_EXTERN uint8_t* WebPDecodeRGBAInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeARGBInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeBGRAInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// RGB and BGR variants. Here too the transparency information, if present, +// will be dropped and ignored. +WEBP_EXTERN uint8_t* WebPDecodeRGBInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); +WEBP_EXTERN uint8_t* WebPDecodeBGRInto( + const uint8_t* data, size_t data_size, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly +// into pre-allocated luma/chroma plane buffers. This function requires the +// strides to be passed: one for the luma plane and one for each of the +// chroma ones. The size of each plane buffer is passed as 'luma_size', +// 'u_size' and 'v_size' respectively. +// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred +// during decoding (or because some buffers were found to be too small). +WEBP_EXTERN uint8_t* WebPDecodeYUVInto( + const uint8_t* data, size_t data_size, + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride); + +//------------------------------------------------------------------------------ +// Output colorspaces and buffer + +// Colorspaces +// Note: the naming describes the byte-ordering of packed samples in memory. +// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,... +// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels. +// RGBA-4444 and RGB-565 colorspaces are represented by following byte-order: +// RGBA-4444: [r3 r2 r1 r0 g3 g2 g1 g0], [b3 b2 b1 b0 a3 a2 a1 a0], ... +// RGB-565: [r4 r3 r2 r1 r0 g5 g4 g3], [g2 g1 g0 b4 b3 b2 b1 b0], ... +// In the case WEBP_SWAP_16BITS_CSP is defined, the bytes are swapped for +// these two modes: +// RGBA-4444: [b3 b2 b1 b0 a3 a2 a1 a0], [r3 r2 r1 r0 g3 g2 g1 g0], ... +// RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ... + +typedef enum WEBP_CSP_MODE { + MODE_RGB = 0, MODE_RGBA = 1, + MODE_BGR = 2, MODE_BGRA = 3, + MODE_ARGB = 4, MODE_RGBA_4444 = 5, + MODE_RGB_565 = 6, + // RGB-premultiplied transparent modes (alpha value is preserved) + MODE_rgbA = 7, + MODE_bgrA = 8, + MODE_Argb = 9, + MODE_rgbA_4444 = 10, + // YUV modes must come after RGB ones. + MODE_YUV = 11, MODE_YUVA = 12, // yuv 4:2:0 + MODE_LAST = 13 +} WEBP_CSP_MODE; + +// Some useful macros: +static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) { + return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb || + mode == MODE_rgbA_4444); +} + +static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) { + return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB || + mode == MODE_RGBA_4444 || mode == MODE_YUVA || + WebPIsPremultipliedMode(mode)); +} + +static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) { + return (mode < MODE_YUV); +} + +//------------------------------------------------------------------------------ +// WebPDecBuffer: Generic structure for describing the output sample buffer. + +struct WebPRGBABuffer { // view as RGBA + uint8_t* rgba; // pointer to RGBA samples + int stride; // stride in bytes from one scanline to the next. + size_t size; // total size of the *rgba buffer. +}; + +struct WebPYUVABuffer { // view as YUVA + uint8_t* y, *u, *v, *a; // pointer to luma, chroma U/V, alpha samples + int y_stride; // luma stride + int u_stride, v_stride; // chroma strides + int a_stride; // alpha stride + size_t y_size; // luma plane size + size_t u_size, v_size; // chroma planes size + size_t a_size; // alpha-plane size +}; + +// Output buffer +struct WebPDecBuffer { + WEBP_CSP_MODE colorspace; // Colorspace. + int width, height; // Dimensions. + int is_external_memory; // If non-zero, 'internal_memory' pointer is not + // used. If value is '2' or more, the external + // memory is considered 'slow' and multiple + // read/write will be avoided. + union { + WebPRGBABuffer RGBA; + WebPYUVABuffer YUVA; + } u; // Nameless union of buffer parameters. + uint32_t pad[4]; // padding for later use + + uint8_t* private_memory; // Internally allocated memory (only when + // is_external_memory is 0). Should not be used + // externally, but accessed via the buffer union. +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPInitDecBufferInternal(WebPDecBuffer*, int); + +// Initialize the structure as empty. Must be called before any other use. +// Returns false in case of version mismatch +static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) { + return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION); +} + +// Free any memory associated with the buffer. Must always be called last. +// Note: doesn't free the 'buffer' structure itself. +WEBP_EXTERN void WebPFreeDecBuffer(WebPDecBuffer* buffer); + +//------------------------------------------------------------------------------ +// Enumeration of the status codes + +typedef enum VP8StatusCode { + VP8_STATUS_OK = 0, + VP8_STATUS_OUT_OF_MEMORY, + VP8_STATUS_INVALID_PARAM, + VP8_STATUS_BITSTREAM_ERROR, + VP8_STATUS_UNSUPPORTED_FEATURE, + VP8_STATUS_SUSPENDED, + VP8_STATUS_USER_ABORT, + VP8_STATUS_NOT_ENOUGH_DATA +} VP8StatusCode; + +//------------------------------------------------------------------------------ +// Incremental decoding +// +// This API allows streamlined decoding of partial data. +// Picture can be incrementally decoded as data become available thanks to the +// WebPIDecoder object. This object can be left in a SUSPENDED state if the +// picture is only partially decoded, pending additional input. +// Code example: +// +// WebPInitDecBuffer(&output_buffer); +// output_buffer.colorspace = mode; +// ... +// WebPIDecoder* idec = WebPINewDecoder(&output_buffer); +// while (additional_data_is_available) { +// // ... (get additional data in some new_data[] buffer) +// status = WebPIAppend(idec, new_data, new_data_size); +// if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) { +// break; // an error occurred. +// } +// +// // The above call decodes the current available buffer. +// // Part of the image can now be refreshed by calling +// // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. +// } +// WebPIDelete(idec); + +// Creates a new incremental decoder with the supplied buffer parameter. +// This output_buffer can be passed NULL, in which case a default output buffer +// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer' +// is kept, which means that the lifespan of 'output_buffer' must be larger than +// that of the returned WebPIDecoder object. +// The supplied 'output_buffer' content MUST NOT be changed between calls to +// WebPIAppend() or WebPIUpdate() unless 'output_buffer.is_external_memory' is +// not set to 0. In such a case, it is allowed to modify the pointers, size and +// stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain +// within valid bounds. +// All other fields of WebPDecBuffer MUST remain constant between calls. +// Returns NULL if the allocation failed. +WEBP_EXTERN WebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer); + +// This function allocates and initializes an incremental-decoder object, which +// will output the RGB/A samples specified by 'csp' into a preallocated +// buffer 'output_buffer'. The size of this buffer is at least +// 'output_buffer_size' and the stride (distance in bytes between two scanlines) +// is specified by 'output_stride'. +// Additionally, output_buffer can be passed NULL in which case the output +// buffer will be allocated automatically when the decoding starts. The +// colorspace 'csp' is taken into account for allocating this buffer. All other +// parameters are ignored. +// Returns NULL if the allocation failed, or if some parameters are invalid. +WEBP_EXTERN WebPIDecoder* WebPINewRGB( + WEBP_CSP_MODE csp, + uint8_t* output_buffer, size_t output_buffer_size, int output_stride); + +// This function allocates and initializes an incremental-decoder object, which +// will output the raw luma/chroma samples into a preallocated planes if +// supplied. The luma plane is specified by its pointer 'luma', its size +// 'luma_size' and its stride 'luma_stride'. Similarly, the chroma-u plane +// is specified by the 'u', 'u_size' and 'u_stride' parameters, and the chroma-v +// plane by 'v' and 'v_size'. And same for the alpha-plane. The 'a' pointer +// can be pass NULL in case one is not interested in the transparency plane. +// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied. +// In this case, the output buffer will be automatically allocated (using +// MODE_YUVA) when decoding starts. All parameters are then ignored. +// Returns NULL if the allocation failed or if a parameter is invalid. +WEBP_EXTERN WebPIDecoder* WebPINewYUVA( + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride, + uint8_t* a, size_t a_size, int a_stride); + +// Deprecated version of the above, without the alpha plane. +// Kept for backward compatibility. +WEBP_EXTERN WebPIDecoder* WebPINewYUV( + uint8_t* luma, size_t luma_size, int luma_stride, + uint8_t* u, size_t u_size, int u_stride, + uint8_t* v, size_t v_size, int v_stride); + +// Deletes the WebPIDecoder object and associated memory. Must always be called +// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded. +WEBP_EXTERN void WebPIDelete(WebPIDecoder* idec); + +// Copies and decodes the next available data. Returns VP8_STATUS_OK when +// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more +// data is expected. Returns error in other cases. +WEBP_EXTERN VP8StatusCode WebPIAppend( + WebPIDecoder* idec, const uint8_t* data, size_t data_size); + +// A variant of the above function to be used when data buffer contains +// partial data from the beginning. In this case data buffer is not copied +// to the internal memory. +// Note that the value of the 'data' pointer can change between calls to +// WebPIUpdate, for instance when the data buffer is resized to fit larger data. +WEBP_EXTERN VP8StatusCode WebPIUpdate( + WebPIDecoder* idec, const uint8_t* data, size_t data_size); + +// Returns the RGB/A image decoded so far. Returns NULL if output params +// are not initialized yet. The RGB/A output type corresponds to the colorspace +// specified during call to WebPINewDecoder() or WebPINewRGB(). +// *last_y is the index of last decoded row in raster scan order. Some pointers +// (*last_y, *width etc.) can be NULL if corresponding information is not +// needed. The values in these pointers are only valid on successful (non-NULL) +// return. +WEBP_EXTERN uint8_t* WebPIDecGetRGB( + const WebPIDecoder* idec, int* last_y, + int* width, int* height, int* stride); + +// Same as above function to get a YUVA image. Returns pointer to the luma +// plane or NULL in case of error. If there is no alpha information +// the alpha pointer '*a' will be returned NULL. +WEBP_EXTERN uint8_t* WebPIDecGetYUVA( + const WebPIDecoder* idec, int* last_y, + uint8_t** u, uint8_t** v, uint8_t** a, + int* width, int* height, int* stride, int* uv_stride, int* a_stride); + +// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the +// alpha information (if present). Kept for backward compatibility. +static WEBP_INLINE uint8_t* WebPIDecGetYUV( + const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v, + int* width, int* height, int* stride, int* uv_stride) { + return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height, + stride, uv_stride, NULL); +} + +// Generic call to retrieve information about the displayable area. +// If non NULL, the left/right/width/height pointers are filled with the visible +// rectangular area so far. +// Returns NULL in case the incremental decoder object is in an invalid state. +// Otherwise returns the pointer to the internal representation. This structure +// is read-only, tied to WebPIDecoder's lifespan and should not be modified. +WEBP_EXTERN const WebPDecBuffer* WebPIDecodedArea( + const WebPIDecoder* idec, int* left, int* top, int* width, int* height); + +//------------------------------------------------------------------------------ +// Advanced decoding parametrization +// +// Code sample for using the advanced decoding API +/* + // A) Init a configuration object + WebPDecoderConfig config; + CHECK(WebPInitDecoderConfig(&config)); + + // B) optional: retrieve the bitstream's features. + CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK); + + // C) Adjust 'config', if needed + config.no_fancy_upsampling = 1; + config.output.colorspace = MODE_BGRA; + // etc. + + // Note that you can also make config.output point to an externally + // supplied memory buffer, provided it's big enough to store the decoded + // picture. Otherwise, config.output will just be used to allocate memory + // and store the decoded picture. + + // D) Decode! + CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK); + + // E) Decoded image is now in config.output (and config.output.u.RGBA) + + // F) Reclaim memory allocated in config's object. It's safe to call + // this function even if the memory is external and wasn't allocated + // by WebPDecode(). + WebPFreeDecBuffer(&config.output); +*/ + +// Features gathered from the bitstream +struct WebPBitstreamFeatures { + int width; // Width in pixels, as read from the bitstream. + int height; // Height in pixels, as read from the bitstream. + int has_alpha; // True if the bitstream contains an alpha channel. + int has_animation; // True if the bitstream is an animation. + int format; // 0 = undefined (/mixed), 1 = lossy, 2 = lossless + + uint32_t pad[5]; // padding for later use +}; + +// Internal, version-checked, entry point +WEBP_EXTERN VP8StatusCode WebPGetFeaturesInternal( + const uint8_t*, size_t, WebPBitstreamFeatures*, int); + +// Retrieve features from the bitstream. The *features structure is filled +// with information gathered from the bitstream. +// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns +// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the +// features from headers. Returns error in other cases. +// Note: The following chunk sequences (before the raw VP8/VP8L data) are +// considered valid by this function: +// RIFF + VP8(L) +// RIFF + VP8X + (optional chunks) + VP8(L) +// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose. +// VP8(L) <-- Not a valid WebP format: only allowed for internal purpose. +static WEBP_INLINE VP8StatusCode WebPGetFeatures( + const uint8_t* data, size_t data_size, + WebPBitstreamFeatures* features) { + return WebPGetFeaturesInternal(data, data_size, features, + WEBP_DECODER_ABI_VERSION); +} + +// Decoding options +struct WebPDecoderOptions { + int bypass_filtering; // if true, skip the in-loop filtering + int no_fancy_upsampling; // if true, use faster pointwise upsampler + int use_cropping; // if true, cropping is applied _first_ + int crop_left, crop_top; // top-left position for cropping. + // Will be snapped to even values. + int crop_width, crop_height; // dimension of the cropping area + int use_scaling; // if true, scaling is applied _afterward_ + int scaled_width, scaled_height; // final resolution + int use_threads; // if true, use multi-threaded decoding + int dithering_strength; // dithering strength (0=Off, 100=full) + int flip; // if true, flip output vertically + int alpha_dithering_strength; // alpha dithering strength in [0..100] + + uint32_t pad[5]; // padding for later use +}; + +// Main object storing the configuration for advanced decoding. +struct WebPDecoderConfig { + WebPBitstreamFeatures input; // Immutable bitstream features (optional) + WebPDecBuffer output; // Output buffer (can point to external mem) + WebPDecoderOptions options; // Decoding options +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPInitDecoderConfigInternal(WebPDecoderConfig*, int); + +// Initialize the configuration as empty. This function must always be +// called first, unless WebPGetFeatures() is to be called. +// Returns false in case of mismatched version. +static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) { + return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION); +} + +// Instantiate a new incremental decoder object with the requested +// configuration. The bitstream can be passed using 'data' and 'data_size' +// parameter, in which case the features will be parsed and stored into +// config->input. Otherwise, 'data' can be NULL and no parsing will occur. +// Note that 'config' can be NULL too, in which case a default configuration +// is used. If 'config' is not NULL, it must outlive the WebPIDecoder object +// as some references to its fields will be used. No internal copy of 'config' +// is made. +// The return WebPIDecoder object must always be deleted calling WebPIDelete(). +// Returns NULL in case of error (and config->status will then reflect +// the error condition, if available). +WEBP_EXTERN WebPIDecoder* WebPIDecode(const uint8_t* data, size_t data_size, + WebPDecoderConfig* config); + +// Non-incremental version. This version decodes the full data at once, taking +// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK +// if the decoding was successful). Note that 'config' cannot be NULL. +WEBP_EXTERN VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size, + WebPDecoderConfig* config); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_DECODE_H_ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/demux.h b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/demux.h new file mode 100644 index 00000000..846eeb15 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/demux.h @@ -0,0 +1,363 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Demux API. +// Enables extraction of image and extended format data from WebP files. + +// Code Example: Demuxing WebP data to extract all the frames, ICC profile +// and EXIF/XMP metadata. +/* + WebPDemuxer* demux = WebPDemux(&webp_data); + + uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH); + uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT); + // ... (Get information about the features present in the WebP file). + uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS); + + // ... (Iterate over all frames). + WebPIterator iter; + if (WebPDemuxGetFrame(demux, 1, &iter)) { + do { + // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(), + // ... and get other frame properties like width, height, offsets etc. + // ... see 'struct WebPIterator' below for more info). + } while (WebPDemuxNextFrame(&iter)); + WebPDemuxReleaseIterator(&iter); + } + + // ... (Extract metadata). + WebPChunkIterator chunk_iter; + if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter); + // ... (Consume the ICC profile in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter); + // ... (Consume the EXIF metadata in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter); + // ... (Consume the XMP metadata in 'chunk_iter.chunk'). + WebPDemuxReleaseChunkIterator(&chunk_iter); + WebPDemuxDelete(demux); +*/ + +#ifndef WEBP_WEBP_DEMUX_H_ +#define WEBP_WEBP_DEMUX_H_ + +#include "./decode.h" // for WEBP_CSP_MODE +#include "./mux_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_DEMUX_ABI_VERSION 0x0107 // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPDemuxState WebPDemuxState; +// typedef enum WebPFormatFeature WebPFormatFeature; +typedef struct WebPDemuxer WebPDemuxer; +typedef struct WebPIterator WebPIterator; +typedef struct WebPChunkIterator WebPChunkIterator; +typedef struct WebPAnimInfo WebPAnimInfo; +typedef struct WebPAnimDecoderOptions WebPAnimDecoderOptions; + +//------------------------------------------------------------------------------ + +// Returns the version number of the demux library, packed in hexadecimal using +// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetDemuxVersion(void); + +//------------------------------------------------------------------------------ +// Life of a Demux object + +typedef enum WebPDemuxState { + WEBP_DEMUX_PARSE_ERROR = -1, // An error occurred while parsing. + WEBP_DEMUX_PARSING_HEADER = 0, // Not enough data to parse full header. + WEBP_DEMUX_PARSED_HEADER = 1, // Header parsing complete, + // data may be available. + WEBP_DEMUX_DONE = 2 // Entire file has been parsed. +} WebPDemuxState; + +// Internal, version-checked, entry point +WEBP_EXTERN WebPDemuxer* WebPDemuxInternal( + const WebPData*, int, WebPDemuxState*, int); + +// Parses the full WebP file given by 'data'. For single images the WebP file +// header alone or the file header and the chunk header may be absent. +// Returns a WebPDemuxer object on successful parse, NULL otherwise. +static WEBP_INLINE WebPDemuxer* WebPDemux(const WebPData* data) { + return WebPDemuxInternal(data, 0, NULL, WEBP_DEMUX_ABI_VERSION); +} + +// Parses the possibly incomplete WebP file given by 'data'. +// If 'state' is non-NULL it will be set to indicate the status of the demuxer. +// Returns NULL in case of error or if there isn't enough data to start parsing; +// and a WebPDemuxer object on successful parse. +// Note that WebPDemuxer keeps internal pointers to 'data' memory segment. +// If this data is volatile, the demuxer object should be deleted (by calling +// WebPDemuxDelete()) and WebPDemuxPartial() called again on the new data. +// This is usually an inexpensive operation. +static WEBP_INLINE WebPDemuxer* WebPDemuxPartial( + const WebPData* data, WebPDemuxState* state) { + return WebPDemuxInternal(data, 1, state, WEBP_DEMUX_ABI_VERSION); +} + +// Frees memory associated with 'dmux'. +WEBP_EXTERN void WebPDemuxDelete(WebPDemuxer* dmux); + +//------------------------------------------------------------------------------ +// Data/information extraction. + +typedef enum WebPFormatFeature { + WEBP_FF_FORMAT_FLAGS, // bit-wise combination of WebPFeatureFlags + // corresponding to the 'VP8X' chunk (if present). + WEBP_FF_CANVAS_WIDTH, + WEBP_FF_CANVAS_HEIGHT, + WEBP_FF_LOOP_COUNT, // only relevant for animated file + WEBP_FF_BACKGROUND_COLOR, // idem. + WEBP_FF_FRAME_COUNT // Number of frames present in the demux object. + // In case of a partial demux, this is the number + // of frames seen so far, with the last frame + // possibly being partial. +} WebPFormatFeature; + +// Get the 'feature' value from the 'dmux'. +// NOTE: values are only valid if WebPDemux() was used or WebPDemuxPartial() +// returned a state > WEBP_DEMUX_PARSING_HEADER. +// If 'feature' is WEBP_FF_FORMAT_FLAGS, the returned value is a bit-wise +// combination of WebPFeatureFlags values. +// If 'feature' is WEBP_FF_LOOP_COUNT, WEBP_FF_BACKGROUND_COLOR, the returned +// value is only meaningful if the bitstream is animated. +WEBP_EXTERN uint32_t WebPDemuxGetI( + const WebPDemuxer* dmux, WebPFormatFeature feature); + +//------------------------------------------------------------------------------ +// Frame iteration. + +struct WebPIterator { + int frame_num; + int num_frames; // equivalent to WEBP_FF_FRAME_COUNT. + int x_offset, y_offset; // offset relative to the canvas. + int width, height; // dimensions of this frame. + int duration; // display duration in milliseconds. + WebPMuxAnimDispose dispose_method; // dispose method for the frame. + int complete; // true if 'fragment' contains a full frame. partial images + // may still be decoded with the WebP incremental decoder. + WebPData fragment; // The frame given by 'frame_num'. Note for historical + // reasons this is called a fragment. + int has_alpha; // True if the frame contains transparency. + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + + uint32_t pad[2]; // padding for later use. + void* private_; // for internal use only. +}; + +// Retrieves frame 'frame_number' from 'dmux'. +// 'iter->fragment' points to the frame on return from this function. +// Setting 'frame_number' equal to 0 will return the last frame of the image. +// Returns false if 'dmux' is NULL or frame 'frame_number' is not present. +// Call WebPDemuxReleaseIterator() when use of the iterator is complete. +// NOTE: 'dmux' must persist for the lifetime of 'iter'. +WEBP_EXTERN int WebPDemuxGetFrame( + const WebPDemuxer* dmux, int frame_number, WebPIterator* iter); + +// Sets 'iter->fragment' to point to the next ('iter->frame_num' + 1) or +// previous ('iter->frame_num' - 1) frame. These functions do not loop. +// Returns true on success, false otherwise. +WEBP_EXTERN int WebPDemuxNextFrame(WebPIterator* iter); +WEBP_EXTERN int WebPDemuxPrevFrame(WebPIterator* iter); + +// Releases any memory associated with 'iter'. +// Must be called before any subsequent calls to WebPDemuxGetChunk() on the same +// iter. Also, must be called before destroying the associated WebPDemuxer with +// WebPDemuxDelete(). +WEBP_EXTERN void WebPDemuxReleaseIterator(WebPIterator* iter); + +//------------------------------------------------------------------------------ +// Chunk iteration. + +struct WebPChunkIterator { + // The current and total number of chunks with the fourcc given to + // WebPDemuxGetChunk(). + int chunk_num; + int num_chunks; + WebPData chunk; // The payload of the chunk. + + uint32_t pad[6]; // padding for later use + void* private_; +}; + +// Retrieves the 'chunk_number' instance of the chunk with id 'fourcc' from +// 'dmux'. +// 'fourcc' is a character array containing the fourcc of the chunk to return, +// e.g., "ICCP", "XMP ", "EXIF", etc. +// Setting 'chunk_number' equal to 0 will return the last chunk in a set. +// Returns true if the chunk is found, false otherwise. Image related chunk +// payloads are accessed through WebPDemuxGetFrame() and related functions. +// Call WebPDemuxReleaseChunkIterator() when use of the iterator is complete. +// NOTE: 'dmux' must persist for the lifetime of the iterator. +WEBP_EXTERN int WebPDemuxGetChunk(const WebPDemuxer* dmux, + const char fourcc[4], int chunk_number, + WebPChunkIterator* iter); + +// Sets 'iter->chunk' to point to the next ('iter->chunk_num' + 1) or previous +// ('iter->chunk_num' - 1) chunk. These functions do not loop. +// Returns true on success, false otherwise. +WEBP_EXTERN int WebPDemuxNextChunk(WebPChunkIterator* iter); +WEBP_EXTERN int WebPDemuxPrevChunk(WebPChunkIterator* iter); + +// Releases any memory associated with 'iter'. +// Must be called before destroying the associated WebPDemuxer with +// WebPDemuxDelete(). +WEBP_EXTERN void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter); + +//------------------------------------------------------------------------------ +// WebPAnimDecoder API +// +// This API allows decoding (possibly) animated WebP images. +// +// Code Example: +/* + WebPAnimDecoderOptions dec_options; + WebPAnimDecoderOptionsInit(&dec_options); + // Tune 'dec_options' as needed. + WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options); + WebPAnimInfo anim_info; + WebPAnimDecoderGetInfo(dec, &anim_info); + for (uint32_t i = 0; i < anim_info.loop_count; ++i) { + while (WebPAnimDecoderHasMoreFrames(dec)) { + uint8_t* buf; + int timestamp; + WebPAnimDecoderGetNext(dec, &buf, ×tamp); + // ... (Render 'buf' based on 'timestamp'). + // ... (Do NOT free 'buf', as it is owned by 'dec'). + } + WebPAnimDecoderReset(dec); + } + const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec); + // ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data). + WebPAnimDecoderDelete(dec); +*/ + +typedef struct WebPAnimDecoder WebPAnimDecoder; // Main opaque object. + +// Global options. +struct WebPAnimDecoderOptions { + // Output colorspace. Only the following modes are supported: + // MODE_RGBA, MODE_BGRA, MODE_rgbA and MODE_bgrA. + WEBP_CSP_MODE color_mode; + int use_threads; // If true, use multi-threaded decoding. + uint32_t padding[7]; // Padding for later use. +}; + +// Internal, version-checked, entry point. +WEBP_EXTERN int WebPAnimDecoderOptionsInitInternal( + WebPAnimDecoderOptions*, int); + +// Should always be called, to initialize a fresh WebPAnimDecoderOptions +// structure before modification. Returns false in case of version mismatch. +// WebPAnimDecoderOptionsInit() must have succeeded before using the +// 'dec_options' object. +static WEBP_INLINE int WebPAnimDecoderOptionsInit( + WebPAnimDecoderOptions* dec_options) { + return WebPAnimDecoderOptionsInitInternal(dec_options, + WEBP_DEMUX_ABI_VERSION); +} + +// Internal, version-checked, entry point. +WEBP_EXTERN WebPAnimDecoder* WebPAnimDecoderNewInternal( + const WebPData*, const WebPAnimDecoderOptions*, int); + +// Creates and initializes a WebPAnimDecoder object. +// Parameters: +// webp_data - (in) WebP bitstream. This should remain unchanged during the +// lifetime of the output WebPAnimDecoder object. +// dec_options - (in) decoding options. Can be passed NULL to choose +// reasonable defaults (in particular, color mode MODE_RGBA +// will be picked). +// Returns: +// A pointer to the newly created WebPAnimDecoder object, or NULL in case of +// parsing error, invalid option or memory error. +static WEBP_INLINE WebPAnimDecoder* WebPAnimDecoderNew( + const WebPData* webp_data, const WebPAnimDecoderOptions* dec_options) { + return WebPAnimDecoderNewInternal(webp_data, dec_options, + WEBP_DEMUX_ABI_VERSION); +} + +// Global information about the animation.. +struct WebPAnimInfo { + uint32_t canvas_width; + uint32_t canvas_height; + uint32_t loop_count; + uint32_t bgcolor; + uint32_t frame_count; + uint32_t pad[4]; // padding for later use +}; + +// Get global information about the animation. +// Parameters: +// dec - (in) decoder instance to get information from. +// info - (out) global information fetched from the animation. +// Returns: +// True on success. +WEBP_EXTERN int WebPAnimDecoderGetInfo(const WebPAnimDecoder* dec, + WebPAnimInfo* info); + +// Fetch the next frame from 'dec' based on options supplied to +// WebPAnimDecoderNew(). This will be a fully reconstructed canvas of size +// 'canvas_width * 4 * canvas_height', and not just the frame sub-rectangle. The +// returned buffer 'buf' is valid only until the next call to +// WebPAnimDecoderGetNext(), WebPAnimDecoderReset() or WebPAnimDecoderDelete(). +// Parameters: +// dec - (in/out) decoder instance from which the next frame is to be fetched. +// buf - (out) decoded frame. +// timestamp - (out) timestamp of the frame in milliseconds. +// Returns: +// False if any of the arguments are NULL, or if there is a parsing or +// decoding error, or if there are no more frames. Otherwise, returns true. +WEBP_EXTERN int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, + uint8_t** buf, int* timestamp); + +// Check if there are more frames left to decode. +// Parameters: +// dec - (in) decoder instance to be checked. +// Returns: +// True if 'dec' is not NULL and some frames are yet to be decoded. +// Otherwise, returns false. +WEBP_EXTERN int WebPAnimDecoderHasMoreFrames(const WebPAnimDecoder* dec); + +// Resets the WebPAnimDecoder object, so that next call to +// WebPAnimDecoderGetNext() will restart decoding from 1st frame. This would be +// helpful when all frames need to be decoded multiple times (e.g. +// info.loop_count times) without destroying and recreating the 'dec' object. +// Parameters: +// dec - (in/out) decoder instance to be reset +WEBP_EXTERN void WebPAnimDecoderReset(WebPAnimDecoder* dec); + +// Grab the internal demuxer object. +// Getting the demuxer object can be useful if one wants to use operations only +// available through demuxer; e.g. to get XMP/EXIF/ICC metadata. The returned +// demuxer object is owned by 'dec' and is valid only until the next call to +// WebPAnimDecoderDelete(). +// +// Parameters: +// dec - (in) decoder instance from which the demuxer object is to be fetched. +WEBP_EXTERN const WebPDemuxer* WebPAnimDecoderGetDemuxer( + const WebPAnimDecoder* dec); + +// Deletes the WebPAnimDecoder object. +// Parameters: +// dec - (in/out) decoder instance to be deleted +WEBP_EXTERN void WebPAnimDecoderDelete(WebPAnimDecoder* dec); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_DEMUX_H_ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/encode.h b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/encode.h new file mode 100644 index 00000000..56b68e2f --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/encode.h @@ -0,0 +1,552 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// WebP encoder: main interface +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_ENCODE_H_ +#define WEBP_WEBP_ENCODE_H_ + +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_ENCODER_ABI_VERSION 0x020f // MAJOR(8b) + MINOR(8b) + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPImageHint WebPImageHint; +// typedef enum WebPEncCSP WebPEncCSP; +// typedef enum WebPPreset WebPPreset; +// typedef enum WebPEncodingError WebPEncodingError; +typedef struct WebPConfig WebPConfig; +typedef struct WebPPicture WebPPicture; // main structure for I/O +typedef struct WebPAuxStats WebPAuxStats; +typedef struct WebPMemoryWriter WebPMemoryWriter; + +// Return the encoder's version number, packed in hexadecimal using 8bits for +// each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetEncoderVersion(void); + +//------------------------------------------------------------------------------ +// One-stop-shop call! No questions asked: + +// 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 'WebPFree(*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). +WEBP_EXTERN size_t WebPEncodeRGB(const uint8_t* rgb, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGR(const uint8_t* bgr, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeRGBA(const uint8_t* rgba, + int width, int height, int stride, + float quality_factor, uint8_t** output); +WEBP_EXTERN size_t WebPEncodeBGRA(const uint8_t* bgra, + int width, int height, int stride, + float quality_factor, uint8_t** 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. +// Note these functions, like the lossy versions, use the library's default +// settings. For lossless this means 'exact' is disabled. RGB values in +// transparent areas will be modified to improve compression. To avoid this, +// use WebPEncode() and set WebPConfig::exact to 1. +WEBP_EXTERN size_t WebPEncodeLosslessRGB(const uint8_t* rgb, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessBGR(const uint8_t* bgr, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessRGBA(const uint8_t* rgba, + int width, int height, int stride, + uint8_t** output); +WEBP_EXTERN size_t WebPEncodeLosslessBGRA(const uint8_t* bgra, + int width, int height, int stride, + uint8_t** output); + +//------------------------------------------------------------------------------ +// Coding parameters + +// Image characteristics hint for the underlying encoder. +typedef enum WebPImageHint { + WEBP_HINT_DEFAULT = 0, // default preset. + WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot + WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting + WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc). + WEBP_HINT_LAST +} WebPImageHint; + +// Compression parameters. +struct WebPConfig { + int lossless; // Lossless encoding (0=lossy(default), 1=lossless). + float quality; // between 0 and 100. For lossy, 0 gives the smallest + // size and 100 the largest. For lossless, this + // parameter is the amount of effort put into the + // compression: 0 is the fastest but gives larger + // files compared to the slowest, but best, 100. + int method; // quality/speed trade-off (0=fast, 6=slower-better) + + WebPImageHint image_hint; // Hint for image type (lossless only for now). + + int target_size; // if non-zero, set the desired target size in bytes. + // Takes precedence over the 'compression' parameter. + float target_PSNR; // if non-zero, specifies the minimal distortion to + // try to achieve. Takes precedence over target_size. + int segments; // maximum number of segments to use, in [1..4] + int sns_strength; // Spatial Noise Shaping. 0=off, 100=maximum. + int filter_strength; // range: [0 = off .. 100 = strongest] + int filter_sharpness; // range: [0 = off .. 7 = least sharp] + int filter_type; // filtering type: 0 = simple, 1 = strong (only used + // if filter_strength > 0 or autofilter > 0) + int autofilter; // Auto adjust filter's strength [0 = off, 1 = on] + int alpha_compression; // Algorithm for encoding the alpha plane (0 = none, + // 1 = compressed with WebP lossless). Default is 1. + int alpha_filtering; // Predictive filtering method for alpha plane. + // 0: none, 1: fast, 2: best. Default if 1. + int alpha_quality; // Between 0 (smallest size) and 100 (lossless). + // Default is 100. + int pass; // number of entropy-analysis passes (in [1..10]). + + int show_compressed; // if true, export the compressed picture back. + // In-loop filtering is not applied. + int preprocessing; // preprocessing filter: + // 0=none, 1=segment-smooth, 2=pseudo-random dithering + int partitions; // log2(number of token partitions) in [0..3]. Default + // is set to 0 for easier progressive decoding. + int partition_limit; // quality degradation allowed to fit the 512k limit + // on prediction modes coding (0: no degradation, + // 100: maximum possible degradation). + int emulate_jpeg_size; // If true, compression parameters will be remapped + // to better match the expected output size from + // JPEG compression. Generally, the output size will + // be similar but the degradation will be lower. + int thread_level; // If non-zero, try and use multi-threaded encoding. + int low_memory; // If set, reduce memory usage (but increase CPU use). + + int near_lossless; // Near lossless encoding [0 = max loss .. 100 = off + // (default)]. + int exact; // if non-zero, preserve the exact RGB values under + // transparent area. Otherwise, discard this invisible + // RGB information for better compression. The default + // value is 0. + + int use_delta_palette; // reserved for future lossless feature + int use_sharp_yuv; // if needed, use sharp (and slow) RGB->YUV conversion + + int qmin; // minimum permissible quality factor + int qmax; // maximum permissible quality factor +}; + +// Enumerate some predefined settings for WebPConfig, depending on the type +// of source picture. These presets are used when calling WebPConfigPreset(). +typedef enum WebPPreset { + WEBP_PRESET_DEFAULT = 0, // default preset. + WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot + WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting + WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details + WEBP_PRESET_ICON, // small-sized colorful images + WEBP_PRESET_TEXT // text-like +} WebPPreset; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int); + +// Should always be called, to initialize a fresh WebPConfig structure before +// modification. Returns false in case of version mismatch. WebPConfigInit() +// must have succeeded before using the 'config' object. +// Note that the default values are lossless=0 and quality=75. +static WEBP_INLINE int WebPConfigInit(WebPConfig* config) { + return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f, + WEBP_ENCODER_ABI_VERSION); +} + +// This function will initialize the configuration according to a predefined +// set of parameters (referred to by 'preset') and a given quality factor. +// This function can be called as a replacement to WebPConfigInit(). Will +// return false in case of error. +static WEBP_INLINE int WebPConfigPreset(WebPConfig* config, + WebPPreset preset, float quality) { + return WebPConfigInitInternal(config, preset, quality, + WEBP_ENCODER_ABI_VERSION); +} + +// Activate the lossless compression mode with the desired efficiency level +// between 0 (fastest, lowest compression) and 9 (slower, best compression). +// A good default level is '6', providing a fair tradeoff between compression +// speed and final compressed size. +// This function will overwrite several fields from config: 'method', 'quality' +// and 'lossless'. Returns false in case of parameter error. +WEBP_EXTERN int WebPConfigLosslessPreset(WebPConfig* config, int level); + +// Returns true if 'config' is non-NULL and all configuration parameters are +// within their valid ranges. +WEBP_EXTERN int WebPValidateConfig(const WebPConfig* config); + +//------------------------------------------------------------------------------ +// Input / Output +// Structure for storing auxiliary statistics. + +struct WebPAuxStats { + int coded_size; // final size + + float PSNR[5]; // peak-signal-to-noise ratio for Y/U/V/All/Alpha + int block_count[3]; // number of intra4/intra16/skipped macroblocks + int header_bytes[2]; // approximate number of bytes spent for header + // and mode-partition #0 + int residual_bytes[3][4]; // approximate number of bytes spent for + // DC/AC/uv coefficients for each (0..3) segments. + int segment_size[4]; // number of macroblocks in each segments + int segment_quant[4]; // quantizer values for each segments + int segment_level[4]; // filtering strength for each segments [0..63] + + int alpha_data_size; // size of the transparency data + int layer_data_size; // size of the enhancement layer data + + // lossless encoder statistics + uint32_t lossless_features; // bit0:predictor bit1:cross-color transform + // bit2:subtract-green bit3:color indexing + int histogram_bits; // number of precision bits of histogram + int transform_bits; // precision bits for transform + int cache_bits; // number of bits for color cache lookup + int palette_size; // number of color in palette, if used + int lossless_size; // final lossless size + int lossless_hdr_size; // lossless header (transform, huffman etc) size + int lossless_data_size; // lossless image data size + + uint32_t pad[2]; // padding for later use +}; + +// Signature for output function. Should return true if writing was successful. +// data/data_size is the segment of data to write, and 'picture' is for +// reference (and so one can make use of picture->custom_ptr). +typedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size, + const WebPPicture* picture); + +// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using +// the following WebPMemoryWriter object (to be set as a custom_ptr). +struct WebPMemoryWriter { + uint8_t* mem; // final buffer (of size 'max_size', larger than 'size'). + size_t size; // final size + size_t max_size; // total capacity + uint32_t pad[1]; // padding for later use +}; + +// The following must be called first before any use. +WEBP_EXTERN void WebPMemoryWriterInit(WebPMemoryWriter* writer); + +// The following must be called to deallocate writer->mem memory. The 'writer' +// object itself is not deallocated. +WEBP_EXTERN void WebPMemoryWriterClear(WebPMemoryWriter* writer); +// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon +// completion, writer.mem and writer.size will hold the coded data. +// writer.mem must be freed by calling WebPMemoryWriterClear. +WEBP_EXTERN int WebPMemoryWrite(const uint8_t* data, size_t data_size, + const WebPPicture* picture); + +// Progress hook, called from time to time to report progress. It can return +// false to request an abort of the encoding process, or true otherwise if +// everything is OK. +typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture); + +// Color spaces. +typedef enum WebPEncCSP { + // chroma sampling + WEBP_YUV420 = 0, // 4:2:0 + WEBP_YUV420A = 4, // alpha channel variant + WEBP_CSP_UV_MASK = 3, // bit-mask to get the UV sampling factors + WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present +} WebPEncCSP; + +// Encoding error conditions. +typedef enum WebPEncodingError { + VP8_ENC_OK = 0, + VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects + VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits + VP8_ENC_ERROR_NULL_PARAMETER, // a pointer parameter is NULL + VP8_ENC_ERROR_INVALID_CONFIGURATION, // configuration is invalid + VP8_ENC_ERROR_BAD_DIMENSION, // picture has invalid width/height + VP8_ENC_ERROR_PARTITION0_OVERFLOW, // partition is bigger than 512k + VP8_ENC_ERROR_PARTITION_OVERFLOW, // partition is bigger than 16M + VP8_ENC_ERROR_BAD_WRITE, // error while flushing bytes + VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G + VP8_ENC_ERROR_USER_ABORT, // abort request by user + VP8_ENC_ERROR_LAST // list terminator. always last. +} WebPEncodingError; + +// maximum width/height allowed (inclusive), in pixels +#define WEBP_MAX_DIMENSION 16383 + +// Main exchange structure (input samples, output bytes, statistics) +// +// Once WebPPictureInit() has been called, it's ok to make all the INPUT fields +// (use_argb, y/u/v, argb, ...) point to user-owned data, even if +// WebPPictureAlloc() has been called. Depending on the value use_argb, +// it's guaranteed that either *argb or *y/*u/*v content will be kept untouched. +struct WebPPicture { + // INPUT + ////////////// + // Main flag for encoder selecting between ARGB or YUV input. + // It is recommended to use ARGB input (*argb, argb_stride) for lossless + // compression, and YUV input (*y, *u, *v, etc.) for lossy compression + // since these are the respective native colorspace for these formats. + int use_argb; + + // YUV input (mostly used for input to lossy compression) + WebPEncCSP colorspace; // colorspace: should be YUV420 for now (=Y'CbCr). + int width, height; // dimensions (less or equal to WEBP_MAX_DIMENSION) + uint8_t* y, *u, *v; // pointers to luma/chroma planes. + int y_stride, uv_stride; // luma/chroma strides. + uint8_t* a; // pointer to the alpha plane + int a_stride; // stride of the alpha plane + uint32_t pad1[2]; // padding for later use + + // ARGB input (mostly used for input to lossless compression) + uint32_t* argb; // Pointer to argb (32 bit) plane. + int argb_stride; // This is stride in pixels units, not bytes. + uint32_t pad2[3]; // padding for later use + + // OUTPUT + /////////////// + // Byte-emission hook, to store compressed bytes as they are ready. + WebPWriterFunction writer; // can be NULL + void* custom_ptr; // can be used by the writer. + + // map for extra information (only for lossy compression mode) + int extra_info_type; // 1: intra type, 2: segment, 3: quant + // 4: intra-16 prediction mode, + // 5: chroma prediction mode, + // 6: bit cost, 7: distortion + uint8_t* extra_info; // if not NULL, points to an array of size + // ((width + 15) / 16) * ((height + 15) / 16) that + // will be filled with a macroblock map, depending + // on extra_info_type. + + // STATS AND REPORTS + /////////////////////////// + // Pointer to side statistics (updated only if not NULL) + WebPAuxStats* stats; + + // Error code for the latest error encountered during encoding + WebPEncodingError error_code; + + // If not NULL, report progress during encoding. + WebPProgressHook progress_hook; + + void* user_data; // this field is free to be set to any value and + // used during callbacks (like progress-report e.g.). + + uint32_t pad3[3]; // padding for later use + + // Unused for now + uint8_t* pad4, *pad5; + uint32_t pad6[8]; // padding for later use + + // PRIVATE FIELDS + //////////////////// + void* memory_; // row chunk of memory for yuva planes + void* memory_argb_; // and for argb too. + void* pad7[2]; // padding for later use +}; + +// Internal, version-checked, entry point +WEBP_EXTERN int WebPPictureInitInternal(WebPPicture*, int); + +// Should always be called, to initialize the structure. Returns false in case +// of version mismatch. WebPPictureInit() must have succeeded before using the +// 'picture' object. +// Note that, by default, use_argb is false and colorspace is WEBP_YUV420. +static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) { + return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// WebPPicture utils + +// Convenience allocation / deallocation based on picture->width/height: +// Allocate y/u/v buffers as per colorspace/width/height specification. +// Note! This function will free the previous buffer if needed. +// Returns false in case of memory error. +WEBP_EXTERN int WebPPictureAlloc(WebPPicture* picture); + +// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). +// Note that this function does _not_ free the memory used by the 'picture' +// object itself. +// Besides memory (which is reclaimed) all other fields of 'picture' are +// preserved. +WEBP_EXTERN void WebPPictureFree(WebPPicture* picture); + +// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, *dst +// will fully own the copied pixels (this is not a view). The 'dst' picture need +// not be initialized as its content is overwritten. +// Returns false in case of memory allocation error. +WEBP_EXTERN int WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); + +// Compute the single distortion for packed planes of samples. +// 'src' will be compared to 'ref', and the raw distortion stored into +// '*distortion'. The refined metric (log(MSE), log(1 - ssim),...' will be +// stored in '*result'. +// 'x_step' is the horizontal stride (in bytes) between samples. +// 'src/ref_stride' is the byte distance between rows. +// Returns false in case of error (bad parameter, memory allocation error, ...). +WEBP_EXTERN int WebPPlaneDistortion(const uint8_t* src, size_t src_stride, + const uint8_t* ref, size_t ref_stride, + int width, int height, + size_t x_step, + int type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float* distortion, float* result); + +// Compute PSNR, SSIM or LSIM distortion metric between two pictures. Results +// are in dB, stored in result[] in the B/G/R/A/All order. The distortion is +// always performed using ARGB samples. Hence if the input is YUV(A), the +// picture will be internally converted to ARGB (just for the measurement). +// Warning: this function is rather CPU-intensive. +WEBP_EXTERN int WebPPictureDistortion( + const WebPPicture* src, const WebPPicture* ref, + int metric_type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float result[5]); + +// self-crops a picture to the rectangle defined by top/left/width/height. +// Returns false in case of memory allocation error, or if the rectangle is +// outside of the source picture. +// The rectangle for the view is defined by the top-left corner pixel +// coordinates (left, top) as well as its width and height. This rectangle +// must be fully be comprised inside the 'src' source picture. If the source +// picture uses the YUV420 colorspace, the top and left coordinates will be +// snapped to even values. +WEBP_EXTERN int WebPPictureCrop(WebPPicture* picture, + int left, int top, int width, int height); + +// Extracts a view from 'src' picture into 'dst'. The rectangle for the view +// is defined by the top-left corner pixel coordinates (left, top) as well +// as its width and height. This rectangle must be fully be comprised inside +// the 'src' source picture. If the source picture uses the YUV420 colorspace, +// the top and left coordinates will be snapped to even values. +// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed +// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so, +// the original dimension will be lost). Picture 'dst' need not be initialized +// with WebPPictureInit() if it is different from 'src', since its content will +// be overwritten. +// Returns false in case of invalid parameters. +WEBP_EXTERN int WebPPictureView(const WebPPicture* src, + int left, int top, int width, int height, + WebPPicture* dst); + +// Returns true if the 'picture' is actually a view and therefore does +// not own the memory for pixels. +WEBP_EXTERN int WebPPictureIsView(const WebPPicture* picture); + +// Rescale a picture to new dimension width x height. +// If either 'width' or 'height' (but not both) is 0 the corresponding +// dimension will be calculated preserving the aspect ratio. +// No gamma correction is applied. +// Returns false in case of error (invalid parameter or insufficient memory). +WEBP_EXTERN int WebPPictureRescale(WebPPicture* picture, int width, int height); + +// Colorspace conversion function to import RGB samples. +// Previous buffer will be free'd, if any. +// *rgb buffer should have a size of at least height * rgb_stride. +// Returns false in case of memory error. +WEBP_EXTERN int WebPPictureImportRGB( + WebPPicture* picture, const uint8_t* rgb, int rgb_stride); +// Same, but for RGBA buffer. +WEBP_EXTERN int WebPPictureImportRGBA( + WebPPicture* picture, const uint8_t* rgba, int rgba_stride); +// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format +// input buffer ignoring the alpha channel. Avoids needing to copy the data +// to a temporary 24-bit RGB buffer to import the RGB only. +WEBP_EXTERN int WebPPictureImportRGBX( + WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride); + +// Variants of the above, but taking BGR(A|X) input. +WEBP_EXTERN int WebPPictureImportBGR( + WebPPicture* picture, const uint8_t* bgr, int bgr_stride); +WEBP_EXTERN int WebPPictureImportBGRA( + WebPPicture* picture, const uint8_t* bgra, int bgra_stride); +WEBP_EXTERN int WebPPictureImportBGRX( + WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride); + +// Converts picture->argb data to the YUV420A format. The 'colorspace' +// parameter is deprecated and should be equal to WEBP_YUV420. +// Upon return, picture->use_argb is set to false. The presence of real +// non-opaque transparent values is detected, and 'colorspace' will be +// adjusted accordingly. Note that this method is lossy. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureARGBToYUVA(WebPPicture* picture, + WebPEncCSP /*colorspace = WEBP_YUV420*/); + +// Same as WebPPictureARGBToYUVA(), but the conversion is done using +// pseudo-random dithering with a strength 'dithering' between +// 0.0 (no dithering) and 1.0 (maximum dithering). This is useful +// for photographic picture. +WEBP_EXTERN int WebPPictureARGBToYUVADithered( + WebPPicture* picture, WebPEncCSP colorspace, float dithering); + +// Performs 'sharp' RGBA->YUVA420 downsampling and colorspace conversion. +// Downsampling is handled with extra care in case of color clipping. This +// method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better +// and sharper YUV representation. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureSharpARGBToYUVA(WebPPicture* picture); +// kept for backward compatibility: +WEBP_EXTERN int WebPPictureSmartARGBToYUVA(WebPPicture* picture); + +// Converts picture->yuv to picture->argb and sets picture->use_argb to true. +// The input format must be YUV_420 or YUV_420A. The conversion from YUV420 to +// ARGB incurs a small loss too. +// Note that the use of this colorspace is discouraged if one has access to the +// raw ARGB samples, since using YUV420 is comparatively lossy. +// Returns false in case of error. +WEBP_EXTERN int WebPPictureYUVAToARGB(WebPPicture* picture); + +// Helper function: given a width x height plane of RGBA or YUV(A) samples +// clean-up or smoothen the YUV or RGB samples under fully transparent area, +// to help compressibility (no guarantee, though). +WEBP_EXTERN void WebPCleanupTransparentArea(WebPPicture* picture); + +// Scan the picture 'picture' for the presence of non fully opaque alpha values. +// Returns true in such case. Otherwise returns false (indicating that the +// alpha plane can be ignored altogether e.g.). +WEBP_EXTERN int WebPPictureHasTransparency(const WebPPicture* picture); + +// Remove the transparency information (if present) by blending the color with +// the background color 'background_rgb' (specified as 24bit RGB triplet). +// After this call, all alpha values are reset to 0xff. +WEBP_EXTERN void WebPBlendAlpha(WebPPicture* picture, uint32_t background_rgb); + +//------------------------------------------------------------------------------ +// Main call + +// Main encoding call, after config and picture have been initialized. +// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), +// and the 'config' object must be a valid one. +// Returns false in case of error, true otherwise. +// In case of error, picture->error_code is updated accordingly. +// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending +// on the value of 'picture->use_argb'. It is highly recommended to use +// the former for lossy encoding, and the latter for lossless encoding +// (when config.lossless is true). Automatic conversion from one format to +// another is provided but they both incur some loss. +WEBP_EXTERN int WebPEncode(const WebPConfig* config, WebPPicture* picture); + +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_ENCODE_H_ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/mux.h b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/mux.h new file mode 100644 index 00000000..7d27489a --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/mux.h @@ -0,0 +1,530 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// RIFF container manipulation and encoding for WebP images. +// +// Authors: Urvang (urvang@google.com) +// Vikas (vikasa@google.com) + +#ifndef WEBP_WEBP_MUX_H_ +#define WEBP_WEBP_MUX_H_ + +#include "./mux_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEBP_MUX_ABI_VERSION 0x0108 // MAJOR(8b) + MINOR(8b) + +//------------------------------------------------------------------------------ +// Mux API +// +// This API allows manipulation of WebP container images containing features +// like color profile, metadata, animation. +// +// Code Example#1: Create a WebPMux object with image data, color profile and +// XMP metadata. +/* + int copy_data = 0; + WebPMux* mux = WebPMuxNew(); + // ... (Prepare image data). + WebPMuxSetImage(mux, &image, copy_data); + // ... (Prepare ICCP color profile data). + WebPMuxSetChunk(mux, "ICCP", &icc_profile, copy_data); + // ... (Prepare XMP metadata). + WebPMuxSetChunk(mux, "XMP ", &xmp, copy_data); + // Get data from mux in WebP RIFF format. + WebPMuxAssemble(mux, &output_data); + WebPMuxDelete(mux); + // ... (Consume output_data; e.g. write output_data.bytes to file). + WebPDataClear(&output_data); +*/ + +// Code Example#2: Get image and color profile data from a WebP file. +/* + int copy_data = 0; + // ... (Read data from file). + WebPMux* mux = WebPMuxCreate(&data, copy_data); + WebPMuxGetFrame(mux, 1, &image); + // ... (Consume image; e.g. call WebPDecode() to decode the data). + WebPMuxGetChunk(mux, "ICCP", &icc_profile); + // ... (Consume icc_data). + WebPMuxDelete(mux); + WebPFree(data); +*/ + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPMuxError WebPMuxError; +// typedef enum WebPChunkId WebPChunkId; +typedef struct WebPMux WebPMux; // main opaque object. +typedef struct WebPMuxFrameInfo WebPMuxFrameInfo; +typedef struct WebPMuxAnimParams WebPMuxAnimParams; +typedef struct WebPAnimEncoderOptions WebPAnimEncoderOptions; + +// Error codes +typedef enum WebPMuxError { + WEBP_MUX_OK = 1, + WEBP_MUX_NOT_FOUND = 0, + WEBP_MUX_INVALID_ARGUMENT = -1, + WEBP_MUX_BAD_DATA = -2, + WEBP_MUX_MEMORY_ERROR = -3, + WEBP_MUX_NOT_ENOUGH_DATA = -4 +} WebPMuxError; + +// IDs for different types of chunks. +typedef enum WebPChunkId { + WEBP_CHUNK_VP8X, // VP8X + WEBP_CHUNK_ICCP, // ICCP + WEBP_CHUNK_ANIM, // ANIM + WEBP_CHUNK_ANMF, // ANMF + WEBP_CHUNK_DEPRECATED, // (deprecated from FRGM) + WEBP_CHUNK_ALPHA, // ALPH + WEBP_CHUNK_IMAGE, // VP8/VP8L + WEBP_CHUNK_EXIF, // EXIF + WEBP_CHUNK_XMP, // XMP + WEBP_CHUNK_UNKNOWN, // Other chunks. + WEBP_CHUNK_NIL +} WebPChunkId; + +//------------------------------------------------------------------------------ + +// Returns the version number of the mux library, packed in hexadecimal using +// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507. +WEBP_EXTERN int WebPGetMuxVersion(void); + +//------------------------------------------------------------------------------ +// Life of a Mux object + +// Internal, version-checked, entry point +WEBP_EXTERN WebPMux* WebPNewInternal(int); + +// Creates an empty mux object. +// Returns: +// A pointer to the newly created empty mux object. +// Or NULL in case of memory error. +static WEBP_INLINE WebPMux* WebPMuxNew(void) { + return WebPNewInternal(WEBP_MUX_ABI_VERSION); +} + +// Deletes the mux object. +// Parameters: +// mux - (in/out) object to be deleted +WEBP_EXTERN void WebPMuxDelete(WebPMux* mux); + +//------------------------------------------------------------------------------ +// Mux creation. + +// Internal, version-checked, entry point +WEBP_EXTERN WebPMux* WebPMuxCreateInternal(const WebPData*, int, int); + +// Creates a mux object from raw data given in WebP RIFF format. +// Parameters: +// bitstream - (in) the bitstream data in WebP RIFF format +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// A pointer to the mux object created from given data - on success. +// NULL - In case of invalid data or memory error. +static WEBP_INLINE WebPMux* WebPMuxCreate(const WebPData* bitstream, + int copy_data) { + return WebPMuxCreateInternal(bitstream, copy_data, WEBP_MUX_ABI_VERSION); +} + +//------------------------------------------------------------------------------ +// Non-image chunks. + +// Note: Only non-image related chunks should be managed through chunk APIs. +// (Image related chunks are: "ANMF", "VP8 ", "VP8L" and "ALPH"). +// To add, get and delete images, use WebPMuxSetImage(), WebPMuxPushFrame(), +// WebPMuxGetFrame() and WebPMuxDeleteFrame(). + +// Adds a chunk with id 'fourcc' and data 'chunk_data' in the mux object. +// Any existing chunk(s) with the same id will be removed. +// Parameters: +// mux - (in/out) object to which the chunk is to be added +// fourcc - (in) a character array containing the fourcc of the given chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// chunk_data - (in) the chunk data to be added +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetChunk( + WebPMux* mux, const char fourcc[4], const WebPData* chunk_data, + int copy_data); + +// Gets a reference to the data of the chunk with id 'fourcc' in the mux object. +// The caller should NOT free the returned data. +// Parameters: +// mux - (in) object from which the chunk data is to be fetched +// fourcc - (in) a character array containing the fourcc of the chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// chunk_data - (out) returned chunk data +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given id. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetChunk( + const WebPMux* mux, const char fourcc[4], WebPData* chunk_data); + +// Deletes the chunk with the given 'fourcc' from the mux object. +// Parameters: +// mux - (in/out) object from which the chunk is to be deleted +// fourcc - (in) a character array containing the fourcc of the chunk; +// e.g., "ICCP", "XMP ", "EXIF" etc. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or fourcc is NULL +// or if fourcc corresponds to an image chunk. +// WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given fourcc. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxDeleteChunk( + WebPMux* mux, const char fourcc[4]); + +//------------------------------------------------------------------------------ +// Images. + +// Encapsulates data about a single frame. +struct WebPMuxFrameInfo { + WebPData bitstream; // image data: can be a raw VP8/VP8L bitstream + // or a single-image WebP file. + int x_offset; // x-offset of the frame. + int y_offset; // y-offset of the frame. + int duration; // duration of the frame (in milliseconds). + + WebPChunkId id; // frame type: should be one of WEBP_CHUNK_ANMF + // or WEBP_CHUNK_IMAGE + WebPMuxAnimDispose dispose_method; // Disposal method for the frame. + WebPMuxAnimBlend blend_method; // Blend operation for the frame. + uint32_t pad[1]; // padding for later use +}; + +// Sets the (non-animated) image in the mux object. +// Note: Any existing images (including frames) will be removed. +// Parameters: +// mux - (in/out) object in which the image is to be set +// bitstream - (in) can be a raw VP8/VP8L bitstream or a single-image +// WebP file (non-animated) +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetImage( + WebPMux* mux, const WebPData* bitstream, int copy_data); + +// Adds a frame at the end of the mux object. +// Notes: (1) frame.id should be WEBP_CHUNK_ANMF +// (2) For setting a non-animated image, use WebPMuxSetImage() instead. +// (3) Type of frame being pushed must be same as the frames in mux. +// (4) As WebP only supports even offsets, any odd offset will be snapped +// to an even location using: offset &= ~1 +// Parameters: +// mux - (in/out) object to which the frame is to be added +// frame - (in) frame data. +// copy_data - (in) value 1 indicates given data WILL be copied to the mux +// object and value 0 indicates data will NOT be copied. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL +// or if content of 'frame' is invalid. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxPushFrame( + WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data); + +// Gets the nth frame from the mux object. +// The content of 'frame->bitstream' is allocated using WebPMalloc(), and NOT +// owned by the 'mux' object. It MUST be deallocated by the caller by calling +// WebPDataClear(). +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in) object from which the info is to be fetched +// nth - (in) index of the frame in the mux object +// frame - (out) data of the returned frame +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL. +// WEBP_MUX_NOT_FOUND - if there are less than nth frames in the mux object. +// WEBP_MUX_BAD_DATA - if nth frame chunk in mux is invalid. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetFrame( + const WebPMux* mux, uint32_t nth, WebPMuxFrameInfo* frame); + +// Deletes a frame from the mux object. +// nth=0 has a special meaning - last position. +// Parameters: +// mux - (in/out) object from which a frame is to be deleted +// nth - (in) The position from which the frame is to be deleted +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL. +// WEBP_MUX_NOT_FOUND - If there are less than nth frames in the mux object +// before deletion. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth); + +//------------------------------------------------------------------------------ +// Animation. + +// Animation parameters. +struct WebPMuxAnimParams { + uint32_t bgcolor; // Background color of the canvas stored (in MSB order) as: + // Bits 00 to 07: Alpha. + // Bits 08 to 15: Red. + // Bits 16 to 23: Green. + // Bits 24 to 31: Blue. + int loop_count; // Number of times to repeat the animation [0 = infinite]. +}; + +// Sets the animation parameters in the mux object. Any existing ANIM chunks +// will be removed. +// Parameters: +// mux - (in/out) object in which ANIM chunk is to be set/added +// params - (in) animation parameters. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetAnimationParams( + WebPMux* mux, const WebPMuxAnimParams* params); + +// Gets the animation parameters from the mux object. +// Parameters: +// mux - (in) object from which the animation parameters to be fetched +// params - (out) animation parameters extracted from the ANIM chunk +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL. +// WEBP_MUX_NOT_FOUND - if ANIM chunk is not present in mux object. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetAnimationParams( + const WebPMux* mux, WebPMuxAnimParams* params); + +//------------------------------------------------------------------------------ +// Misc Utilities. + +// Sets the canvas size for the mux object. The width and height can be +// specified explicitly or left as zero (0, 0). +// * When width and height are specified explicitly, then this frame bound is +// enforced during subsequent calls to WebPMuxAssemble() and an error is +// reported if any animated frame does not completely fit within the canvas. +// * When unspecified (0, 0), the constructed canvas will get the frame bounds +// from the bounding-box over all frames after calling WebPMuxAssemble(). +// Parameters: +// mux - (in) object to which the canvas size is to be set +// width - (in) canvas width +// height - (in) canvas height +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux is NULL; or +// width or height are invalid or out of bounds +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxSetCanvasSize(WebPMux* mux, + int width, int height); + +// Gets the canvas size from the mux object. +// Note: This method assumes that the VP8X chunk, if present, is up-to-date. +// That is, the mux object hasn't been modified since the last call to +// WebPMuxAssemble() or WebPMuxCreate(). +// Parameters: +// mux - (in) object from which the canvas size is to be fetched +// width - (out) canvas width +// height - (out) canvas height +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, width or height is NULL. +// WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetCanvasSize(const WebPMux* mux, + int* width, int* height); + +// Gets the feature flags from the mux object. +// Note: This method assumes that the VP8X chunk, if present, is up-to-date. +// That is, the mux object hasn't been modified since the last call to +// WebPMuxAssemble() or WebPMuxCreate(). +// Parameters: +// mux - (in) object from which the features are to be fetched +// flags - (out) the flags specifying which features are present in the +// mux object. This will be an OR of various flag values. +// Enum 'WebPFeatureFlags' can be used to test individual flag values. +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux or flags is NULL. +// WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxGetFeatures(const WebPMux* mux, + uint32_t* flags); + +// Gets number of chunks with the given 'id' in the mux object. +// Parameters: +// mux - (in) object from which the info is to be fetched +// id - (in) chunk id specifying the type of chunk +// num_elements - (out) number of chunks with the given chunk id +// Returns: +// WEBP_MUX_INVALID_ARGUMENT - if mux, or num_elements is NULL. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxNumChunks(const WebPMux* mux, + WebPChunkId id, int* num_elements); + +// Assembles all chunks in WebP RIFF format and returns in 'assembled_data'. +// This function also validates the mux object. +// Note: The content of 'assembled_data' will be ignored and overwritten. +// Also, the content of 'assembled_data' is allocated using WebPMalloc(), and +// NOT owned by the 'mux' object. It MUST be deallocated by the caller by +// calling WebPDataClear(). It's always safe to call WebPDataClear() upon +// return, even in case of error. +// Parameters: +// mux - (in/out) object whose chunks are to be assembled +// assembled_data - (out) assembled WebP data +// Returns: +// WEBP_MUX_BAD_DATA - if mux object is invalid. +// WEBP_MUX_INVALID_ARGUMENT - if mux or assembled_data is NULL. +// WEBP_MUX_MEMORY_ERROR - on memory allocation error. +// WEBP_MUX_OK - on success. +WEBP_EXTERN WebPMuxError WebPMuxAssemble(WebPMux* mux, + WebPData* assembled_data); + +//------------------------------------------------------------------------------ +// WebPAnimEncoder API +// +// This API allows encoding (possibly) animated WebP images. +// +// Code Example: +/* + WebPAnimEncoderOptions enc_options; + WebPAnimEncoderOptionsInit(&enc_options); + // Tune 'enc_options' as needed. + WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); + while() { + WebPConfig config; + WebPConfigInit(&config); + // Tune 'config' as needed. + WebPAnimEncoderAdd(enc, frame, timestamp_ms, &config); + } + WebPAnimEncoderAdd(enc, NULL, timestamp_ms, NULL); + WebPAnimEncoderAssemble(enc, webp_data); + WebPAnimEncoderDelete(enc); + // Write the 'webp_data' to a file, or re-mux it further. +*/ + +typedef struct WebPAnimEncoder WebPAnimEncoder; // Main opaque object. + +// Forward declarations. Defined in encode.h. +struct WebPPicture; +struct WebPConfig; + +// Global options. +struct WebPAnimEncoderOptions { + WebPMuxAnimParams anim_params; // Animation parameters. + int minimize_size; // If true, minimize the output size (slow). Implicitly + // disables key-frame insertion. + int kmin; + int kmax; // Minimum and maximum distance between consecutive key + // frames in the output. The library may insert some key + // frames as needed to satisfy this criteria. + // Note that these conditions should hold: kmax > kmin + // and kmin >= kmax / 2 + 1. Also, if kmax <= 0, then + // key-frame insertion is disabled; and if kmax == 1, + // then all frames will be key-frames (kmin value does + // not matter for these special cases). + int allow_mixed; // If true, use mixed compression mode; may choose + // either lossy and lossless for each frame. + int verbose; // If true, print info and warning messages to stderr. + + uint32_t padding[4]; // Padding for later use. +}; + +// Internal, version-checked, entry point. +WEBP_EXTERN int WebPAnimEncoderOptionsInitInternal( + WebPAnimEncoderOptions*, int); + +// Should always be called, to initialize a fresh WebPAnimEncoderOptions +// structure before modification. Returns false in case of version mismatch. +// WebPAnimEncoderOptionsInit() must have succeeded before using the +// 'enc_options' object. +static WEBP_INLINE int WebPAnimEncoderOptionsInit( + WebPAnimEncoderOptions* enc_options) { + return WebPAnimEncoderOptionsInitInternal(enc_options, WEBP_MUX_ABI_VERSION); +} + +// Internal, version-checked, entry point. +WEBP_EXTERN WebPAnimEncoder* WebPAnimEncoderNewInternal( + int, int, const WebPAnimEncoderOptions*, int); + +// Creates and initializes a WebPAnimEncoder object. +// Parameters: +// width/height - (in) canvas width and height of the animation. +// enc_options - (in) encoding options; can be passed NULL to pick +// reasonable defaults. +// Returns: +// A pointer to the newly created WebPAnimEncoder object. +// Or NULL in case of memory error. +static WEBP_INLINE WebPAnimEncoder* WebPAnimEncoderNew( + int width, int height, const WebPAnimEncoderOptions* enc_options) { + return WebPAnimEncoderNewInternal(width, height, enc_options, + WEBP_MUX_ABI_VERSION); +} + +// Optimize the given frame for WebP, encode it and add it to the +// WebPAnimEncoder object. +// The last call to 'WebPAnimEncoderAdd' should be with frame = NULL, which +// indicates that no more frames are to be added. This call is also used to +// determine the duration of the last frame. +// Parameters: +// enc - (in/out) object to which the frame is to be added. +// frame - (in/out) frame data in ARGB or YUV(A) format. If it is in YUV(A) +// format, it will be converted to ARGB, which incurs a small loss. +// timestamp_ms - (in) timestamp of this frame in milliseconds. +// Duration of a frame would be calculated as +// "timestamp of next frame - timestamp of this frame". +// Hence, timestamps should be in non-decreasing order. +// config - (in) encoding options; can be passed NULL to pick +// reasonable defaults. +// Returns: +// On error, returns false and frame->error_code is set appropriately. +// Otherwise, returns true. +WEBP_EXTERN int WebPAnimEncoderAdd( + WebPAnimEncoder* enc, struct WebPPicture* frame, int timestamp_ms, + const struct WebPConfig* config); + +// Assemble all frames added so far into a WebP bitstream. +// This call should be preceded by a call to 'WebPAnimEncoderAdd' with +// frame = NULL; if not, the duration of the last frame will be internally +// estimated. +// Parameters: +// enc - (in/out) object from which the frames are to be assembled. +// webp_data - (out) generated WebP bitstream. +// Returns: +// True on success. +WEBP_EXTERN int WebPAnimEncoderAssemble(WebPAnimEncoder* enc, + WebPData* webp_data); + +// Get error string corresponding to the most recent call using 'enc'. The +// returned string is owned by 'enc' and is valid only until the next call to +// WebPAnimEncoderAdd() or WebPAnimEncoderAssemble() or WebPAnimEncoderDelete(). +// Parameters: +// enc - (in/out) object from which the error string is to be fetched. +// Returns: +// NULL if 'enc' is NULL. Otherwise, returns the error string if the last call +// to 'enc' had an error, or an empty string if the last call was a success. +WEBP_EXTERN const char* WebPAnimEncoderGetError(WebPAnimEncoder* enc); + +// Deletes the WebPAnimEncoder object. +// Parameters: +// enc - (in/out) object to be deleted +WEBP_EXTERN void WebPAnimEncoderDelete(WebPAnimEncoder* enc); + +//------------------------------------------------------------------------------ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_MUX_H_ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/mux_types.h b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/mux_types.h new file mode 100644 index 00000000..2fe81958 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/mux_types.h @@ -0,0 +1,98 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Data-types common to the mux and demux libraries. +// +// Author: Urvang (urvang@google.com) + +#ifndef WEBP_WEBP_MUX_TYPES_H_ +#define WEBP_WEBP_MUX_TYPES_H_ + +#include // memset() +#include "./types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Note: forward declaring enumerations is not allowed in (strict) C and C++, +// the types are left here for reference. +// typedef enum WebPFeatureFlags WebPFeatureFlags; +// typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; +// typedef enum WebPMuxAnimBlend WebPMuxAnimBlend; +typedef struct WebPData WebPData; + +// VP8X Feature Flags. +typedef enum WebPFeatureFlags { + ANIMATION_FLAG = 0x00000002, + XMP_FLAG = 0x00000004, + EXIF_FLAG = 0x00000008, + ALPHA_FLAG = 0x00000010, + ICCP_FLAG = 0x00000020, + + ALL_VALID_FLAGS = 0x0000003e +} WebPFeatureFlags; + +// Dispose method (animation only). Indicates how the area used by the current +// frame is to be treated before rendering the next frame on the canvas. +typedef enum WebPMuxAnimDispose { + WEBP_MUX_DISPOSE_NONE, // Do not dispose. + WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. +} WebPMuxAnimDispose; + +// Blend operation (animation only). Indicates how transparent pixels of the +// current frame are blended with those of the previous canvas. +typedef enum WebPMuxAnimBlend { + WEBP_MUX_BLEND, // Blend. + WEBP_MUX_NO_BLEND // Do not blend. +} WebPMuxAnimBlend; + +// Data type used to describe 'raw' data, e.g., chunk data +// (ICC profile, metadata) and WebP compressed image data. +// 'bytes' memory must be allocated using WebPMalloc() and such. +struct WebPData { + const uint8_t* bytes; + size_t size; +}; + +// Initializes the contents of the 'webp_data' object with default values. +static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { + if (webp_data != NULL) { + memset(webp_data, 0, sizeof(*webp_data)); + } +} + +// Clears the contents of the 'webp_data' object by calling WebPFree(). +// Does not deallocate the object itself. +static WEBP_INLINE void WebPDataClear(WebPData* webp_data) { + if (webp_data != NULL) { + WebPFree((void*)webp_data->bytes); + WebPDataInit(webp_data); + } +} + +// Allocates necessary storage for 'dst' and copies the contents of 'src'. +// Returns true on success. +static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) { + if (src == NULL || dst == NULL) return 0; + WebPDataInit(dst); + if (src->bytes != NULL && src->size != 0) { + dst->bytes = (uint8_t*)WebPMalloc(src->size); + if (dst->bytes == NULL) return 0; + memcpy((void*)dst->bytes, src->bytes, src->size); + dst->size = src->size; + } + return 1; +} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_MUX_TYPES_H_ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/types.h b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/types.h new file mode 100644 index 00000000..47f7f2b0 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/include/webp/types.h @@ -0,0 +1,68 @@ +// Copyright 2010 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Common types + memory wrappers +// +// Author: Skal (pascal.massimino@gmail.com) + +#ifndef WEBP_WEBP_TYPES_H_ +#define WEBP_WEBP_TYPES_H_ + +#include // for size_t + +#ifndef _MSC_VER +#include +#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ + (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) +#define WEBP_INLINE inline +#else +#define WEBP_INLINE +#endif +#else +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned long long int uint64_t; +typedef long long int int64_t; +#define WEBP_INLINE __forceinline +#endif /* _MSC_VER */ + +#ifndef WEBP_EXTERN +// This explicitly marks library functions and allows for changing the +// signature for e.g., Windows DLL builds. +# if defined(__GNUC__) && __GNUC__ >= 4 +# define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) +# else +# define WEBP_EXTERN extern +# endif /* __GNUC__ >= 4 */ +#endif /* WEBP_EXTERN */ + +// Macro to check ABI compatibility (same major revision number) +#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) + +#ifdef __cplusplus +extern "C" { +#endif + +// Allocates 'size' bytes of memory. Returns NULL upon error. Memory +// must be deallocated by calling WebPFree(). This function is made available +// by the core 'libwebp' library. +WEBP_EXTERN void* WebPMalloc(size_t size); + +// Releases memory returned by the WebPDecode*() functions (from decode.h). +WEBP_EXTERN void WebPFree(void* ptr); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_WEBP_TYPES_H_ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebp.lib b/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebp.lib new file mode 100644 index 00000000..d545ad6f Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebp.lib differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebpdemux.lib b/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebpdemux.lib new file mode 100644 index 00000000..9582378c Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebpdemux.lib differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebpmux.lib b/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebpmux.lib new file mode 100644 index 00000000..6135eee3 Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/lib/libwebpmux.lib differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/test.webp b/resources/binaries/libwebp-1.2.4-windows-x64/test.webp new file mode 100644 index 00000000..3e4bca1d Binary files /dev/null and b/resources/binaries/libwebp-1.2.4-windows-x64/test.webp differ diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/test_ref.ppm b/resources/binaries/libwebp-1.2.4-windows-x64/test_ref.ppm new file mode 100644 index 00000000..97719f01 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/test_ref.ppm @@ -0,0 +1,4 @@ +P6 +128 128 +255 +ËáûËáûËáûËáûËáûËáûËáûËáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãûÎãûÎãûÎãûÏäýÏäýÏäýÏäýÐãýÐãýÐãýÐãýÒäþÒäþÒäþÒäþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒäþÒäþÒäþÒäþÓåÿÓåÿÓåÿÓåÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèýÔèýÔèýÔèýÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÔêûÔêûÔêûÔêûÔêûÔêûÔêûÔêûÓéúÓéúÓéúÓéúÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷ËáûËáûËáûËáûËáûËáûËáûËáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãûÎãûÎãûÎãûÏäýÏäýÏäýÏäýÏäýÐãýÐãýÐãýÒäþÒäþÒäþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒäþÒäþÒäþÒäþÓåÿÓåÿÓåÿÓåÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèýÔèýÔèýÔèýÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÔêûÔêûÔêûÔêûÔêûÔêûÔêûÔêûÓéúÓéúÓéúÓéúÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷ËáûËáûËáûËáûËáûËáûËáûËáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãûÎãûÎãûÎãûÏäýÏäýÏäýÏäýÏäûÏäûÏäûÏäûÐåýÐåýÐåýÐåýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒäþÒäþÒäþÒäþÓåÿÓåÿÓåÿÓåÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèýÔèýÔèýÔèýÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÔêûÔêûÔêûÔêûÔêûÔêûÔêûÔêûÓéúÓéúÓéúÓéúÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷ËáûËáûËáûËáûËáûËáûËáûËáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÌáûÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãûÎãûÎãûÎãûÏäýÏäýÏäýÏäýÎåûÎåûÎåûÎåûÏæýÏæýÏæýÏæýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒäþÒäþÒäþÒäþÓåÿÓåÿÓåÿÓåÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèýÔèýÔèýÔèýÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÔêûÔêûÔêûÔêûÔêûÔêûÔêûÔêûÓéúÓéúÓéúÓéúÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷Ïå÷ËáûËáûËáûËáûÌâýÌâýÌâýÌâýÍâýÍâýÍâýÍâýÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãþÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÎåûÎåùÎåùÎåùÏæúÏæúÏæúÏæýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÓåÿÓåÿÓåÿÓåÿÔæÿÔæÿÔæÿÔæÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÖêÿÖêÿÖêÿÖêÿÔêûÔêûÔêûÔêûÔêûÔêûÔêûÔêûÓéúÓéúÓéúÓéúÒèùÒèùÒèùÒèùÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷ËáûËáûËáûËáûÌâýÌâýÌâýÌâýÍâýÍâýÍâýÍâýÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãþÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåýÒèûÒèûÒèûÒèûÐæúÐæúÐæúÐæúÐåýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÓåÿÓåÿÓåÿÓåÿÔæÿÔæÿÔæÿÔæÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÖêÿÖêÿÖêÿÖêÿÔêûÔêûÔêûÔêûÔêûÔêûÔêûÔêûÓéúÓéúÓéúÓéúÒèùÒèùÒèùÒèùÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷ËáûËáûËáûËáûÌâýÌâýÌâýÌâýÍâýÍâýÍâýÍâýÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãþÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäÿÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåýÐæúÒåøÒåøÒåøÒåøÒåøÒåøÐæúÐåýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÓåÿÓåÿÓåÿÓåÿÔæÿÔæÿÔæÿÔæÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÖêÿÖêÿÖêÿÖêÿÔêûÔêûÔêûÔêûÔêûÔêûÔêûÔêûÓéúÓéúÓéúÓéúÒèùÒèùÒèùÒèùÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷ËáûËáûËáûËáûÌâýÌâýÌâýÌâýÍâýÍâýÍâýÍâýÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãþÎãþÎãþÎãþÏäÿÏäÿÏäÿÏäÿÏäÿÐãÿÐãÿÐãÿÏäýÏäýÏäýÐãýÒäþÒåýÒåýÒåýÏáóÏáóÏáóÏáñÔåöÔåöÔåöÔåøÒåúÒåýÒåýÐåýÐåýÐåýÐåýÐåþÓåÿÓåÿÓåÿÓåÿÔæÿÔæÿÔæÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÔèÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéÿÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÖêÿÖêÿÖêÿÖêÿÔêûÔêûÔêûÔêûÔêûÔêûÔêûÔêûÓéúÓéúÓéúÓéúÒèùÒèùÒèùÒèùÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷ÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãûÎãûÎãûÎãûÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒæÿÐåþÒäþÐãýÎáúÒâûÐáúÕåÿÎáýÔæÿÔæÿÓãýÏßøÉÚð·ÆÜ‡–ª‰—©�›­±»ÎŸª»©³ÅÌÖèÖáòÓáñÖèøÔåö×éûÒåøÒåúÖêÿÐæúÒæþÓæþÓæþÓæþÓæþÔèÿÔèÿÔèÿÔèýÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÕëÿÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëý×ëþ×ëþ×ëþ×ëþÖêýÖêýÖêýÖêýÕéûÕéûÕéûÕéûÔèúÔèúÔèúÔèúÓæùÓæùÓæùÓæùÒåøÒåøÒåøÒåøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷ÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãûÎãûÎãûÎãûÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒäþÒäþÓãý×èÿÕãþÒßúÕäÿÌÛøÈÙò�«Åm{•dqˆhtŒlvŒs{�…‹�y‘‡�Ÿ‘—¨¤ªº°¶Æ½ÆÕÎÜêÓäóÕæ÷ÔåöÖèúÓæùÐäùÔêþÓæûÓæûÓæûÓæûÔèýÔèýÔèýÔèýÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëý×ëþ×ëþ×ëþ×ëþÖêýÖêýÖêýÖêýÕéûÕéûÕéûÕéûÔèúÔèúÔèúÔèúÓæùÓæùÓæùÓæùÒåøÒåøÒåøÒåøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷ÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãûÎãûÎãûÎãûÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÌáùÎãûÓåÿÕèÿÒâûÓãýÔâýÙæÿÓáû©·Òlz•\j„mz”hqŒmw�‚‹¡†‰ž��¥‚–‡‹ž‚”°³Å¸½Ë•›©¿ËÙÓãòÖæö׿øÔåöÖèúÕéûÐä÷ÓæûÓæûÓæûÓæûÔèýÔèýÔèýÔèýÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëý×ëþ×ëþ×ëþ×ëþÖêýÖêýÖêýÖêýÕéûÕéûÕéûÕéûÔèúÔèúÔèúÔèúÓæùÓæùÓæùÓæùÒåøÒåøÒåøÒåøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷ÍâýÍâýÍâýÍâýÎãþÎãþÎãþÎãþÎãûÎãûÎãûÎãûÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÓèÿÒæÿÐãýÏâûÓãýÕåÿ±¿Ú��ªr€›Wd~\i‚~‹¤˜¢½jq�‡Žªz˜„…�›œ²‚„š…†›‚…–—𩲴Á¯³¿–Ÿ¬±½ËÆÔäÔâòÙèùÔãôÖèúÕæùÓæûÓæûÓæûÓæûÔèýÔèýÔèýÔèýÕéþÕéþÕéþÕéþÕéþÕéþÕéþÕéþÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëýÕëý×ëþ×ëþ×ëþ×ëþÖêýÖêýÖêýÖêýÕéûÕéûÕéûÕéûÔèúÔèúÔèúÔèúÓæùÓæùÓæùÓæùÒåøÒåøÒåøÒåøÐæøÐæøÐæøÐæøÏå÷Ïå÷Ïå÷Ïå÷ÎãþÎãþÎãþÎãþÏäÿÏäÿÏäÿÏäÿÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÓèÿÉÞ÷ÚìÿÔæÿÈÙòy‰£M[vXf�Vc}[deo‰ipŒ‡Žªfj‡Œ�¬xz—}}˜~{•qo†‘�¥—–©‰ˆ˜——¤ž¡­ÆÌÚ½ÆÕ˜¢±¯¹ËÖáò×å÷Úèù׿úÖæýÔèýÔèýÔèýÔèýÔèýÔèýÔèýÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþ×íÿ×íÿ×íÿ×íÿ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþÖêýÕéûÔèúÕéûÕéûÕéûÕéûÓæùÓæùÓæùÓæùÓæùÓæùÓæùÓæùÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÎãþÎãþÎãþÎãþÏäÿÏäÿÏäÿÏäÿÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒæÿÒäþÅ×ñfw�M]wLZtMZsOXq_f€jq�~�žrv“rs“ˆ‰©……¤ss‘vs�}–ž�²›š¬€€�šš¥¤¨²·»Ç‹�ž‘—¨ˆ‘¡­¶ÈÓÝïÚä÷ÛéúÖèúÔèýÔèýÔèýÔèýÔèýÔèýÔèýÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþ×íÿ×íÿ×íÿ×íÿ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþÖêýÕéûÔèúÕéûÕéûÕéûÕéûÓæùÓæùÓæùÓæùÓæùÓæùÓæùÓæùÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÎãþÎãþÎãþÎãþÏäÿÏäÿÏäÿÏäÿÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒæÿÏäý½ÏéXk…IZsL\vP^yN[tbi‚sx‘Ž“¬€‚Ÿ~€�‚‚¢©¨Ë��¡}}›qq�~—œ�²œž­‚…‘±´¿¤¨²„�¨¬º{€Ž‰�Ÿ˜ž¯³»Î×ßò×å÷ÖèúÔèýÔèýÔèýÔèýÔèýÔèýÔèýÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþ×íÿ×íÿ×íÿ×íÿ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþÖêýÕéûÔèúÕéûÕéûÕéûÕéûÓæùÓæùÓæùÓæùÓæùÓæùÓæùÓæùÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÎãþÎãþÎãþÎãþÏäÿÏäÿÏäÿÏäÿÏäýÏäýÏäýÏäýÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåýÐåýÐåþÐåþÍßù[m‡GWqLZtIWrFQmox“›Ÿ´¡¤¸‘•ªyz�ss�¤¤Â½¹Ù²°Ì‰‹£lm„z{�vx‰œž««¯¹ÌÏÚ�“›Œ�š›ž©˜›¨„‘�•£ª°ÀÔÚê×âó׿úÔèýÔèýÔèýÔèýÔèýÔèýÔèýÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖêÿÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþÖìþ×íÿ×íÿ×íÿ×íÿ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþÖêýÕéûÔèúÕéûÕéûÕéûÕéûÓæùÓæùÓæùÓæùÓæùÓæùÓæùÓæùÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐæøÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÏåÿÏåÿÏæþÏæþÎãúÏåùÖêÿÒåýºÍæk~šJXvLWvLTqFNkQXtlqˆÆÈÚ£¥²áäï··Ä…„–£¢·ÎÍâÝÜïìëû¸¸Å£¢²yy†——£²²»ººÆˆˆ‘•–œ�ž¤­­·•˜£‚…‘¡¥±¬±¿ÕÞíÖå÷×éûÔèúÓæùÔêþÔêþÔéÿÕéþÖêÿÙêýÙêýÙêýÙêýÙêýÙêýÙêýÖêýÖêýÖêýÖêý×ëþ×ëþ×ëþ×ëþ×íÿ×íý×íý×íý×íý×íý×íý×íý×íý×íý×íý×íý×íý×íý×íý×íýÙíýÙíýÙíýÙíý×ìû×ìû×ìû×ìû×íýÖìûÕëúÔêùÔêùÔêùÔêùÔêùÓéøÓéøÓéøÓéøÒè÷Òè÷Òè÷Òè÷ÐæöÐæöÐæöÐæöÐæöÐæöÐæöÐæöÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÏåÿÏåÿÏæþÐåýÕêÿÐäùÏãø¬ÀÕVi‚IXvN\yHPpLSpHOlei†��¨“•¢²²»ÚÛáÒÒÛ‚�‘”“£º¹ÉÌÌÙ°°»——£ŒŒ˜yy†··À££¬žžª‹›š¡¯­´ªª³»»Åª­¸œŸªšžª£©·ÌÚêÒãóÚëûÚíÿÕéûÔêþÔéÿÕéþÙêýÙêýÙêýÙêýÙêýÙêýÙêýÙêýÖêýÖêýÖêýÖêý×ëþ×ëþ×ëþ×ëþ×íý×íý×íý×íý×íý×íý×íý×íý×ïû×ïû×ïû×ïû×ïû×ïû×ïû×ïûÙíûÙíûÙíûÙíû×ìú×ìú×ìú×ìú×ïûÖíúÕìùÔëøÔëøÔëøÔëøÔëøÓê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÐèôÐèôÐèôÐèôÐèôÐèôÐèôÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÏæþÏæþÐåþÐåýÐäûÐäû½ÍãSc{FVpIWtS^}MUtLSpHOllp�“•­ˆ‹š�¡©Ž‘—‰�•jly…‡–wy†�“Ÿikxjlysv…ˆ‹šÉÍ×…ˆ“xz‡��œ¦¥¯©¨±šš£­­·²¶À•˜£¦«¶‡Ž˜¦²ÀÈÖæ×è÷×éùÙêýÕéþÕéþÕéþÙêýÙêýÙêýÙêýÙêýÙêýÙêýÙêýÖêýÖêýÖêýÖêý×ëþ×ëþ×ëþ×ëþ×íý×íý×íý×íý×íý×íý×íý×íý×ïû×ïû×ïû×ïû×ïû×ïû×ïû×ïûÙíûÙíûÙíûÙíû×ìú×ìú×ìú×ìú×ïûÖíúÕìùÔëøÔëøÔëøÔëøÔëøÓê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÐèôÐèôÐèôÐèôÐèôÐèôÐèôÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÏæþÐåýÐåýÒåýÒåý£³ÌTd}IWqIWrQ]{P\zOWwLTqFMjcf„z–il~x{†y}…z~ˆ]_o~€�¥¨´kmzikxehw^artwˆŽ��~€�‡‰˜sv…iit£¢«ÂÂÌ••ž‰�—}€‹‘–¡†‹•—ž©ÌÕâÖâðÝëûÜëý×éûÕéûÕéþÙêýÙêýÙêýÙêýÙêýÙêýÙêýÙêýÖêýÖêýÖêýÖêý×ëþ×ëþ×ëþ×ëþ×íý×íý×íý×íý×íý×íý×íý×íý×ïû×ïû×ïû×ïû×ïû×ïû×ïû×ïûÙíûÙíûÙíûÙíû×ìú×ìú×ìú×ìú×ïûÖíúÕìùÔëøÔëøÔëøÔëøÔëøÓê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÐèôÐèôÐèôÐèôÐèôÐèôÐèôÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÓèÿÎãúÕéÿÈÜóq�šIZrJXrIWrO[yJVtPXxT\{FNkV]zv}˜os�X\pqv„fkw‚‡“fj{ˆŒ��†‘sx„†‹˜y}Žhkei}X]kty‡‡‹œcewbbo†„�°°»½½È±´½ÇËÓ·½Ä¡¦­·»Æ¶ºÅÀÇÒ×ãïÙæ÷ÙèùÖèúÙìÿÖêýÖêýÖêýÖêý×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþÙìÿÙìÿÙìÿÙìÿ×íý×íý×íý×íý×íý×íý×íý×íý×ïû×ïû×ïû×ïû×ïû×ïû×ïû×ïûÙíûÙíûÙíûÙíû×ìú×ìú×ìú×ìúÕìùÕìùÕìùÕìùÔëøÔëøÔëøÔëøÔëøÔëøÔëøÔëøÓê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÐèôÐèôÐèôÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåýÎäøÓæûÄ×ï^o‡HXqM[vDQlP\xNZxIUsLTsMUtHPm]e‚krŽSZsSWoW[pfj{qt†txŒjm�]arZ^lmq‚^bv[^sdh}fj{dhyil€ehy~~‹˜–£¢¢­©©´¢¥­»¿Çª°·±·¾ÁÅËÌÏ×¶ºÅÁÈÓÚåóÚèøÛìýÖêýÖêýÖêýÖêýÖêý×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþ×ëþÙìÿÙìÿÙìÿÙìÿ×íý×íý×íý×íý×íý×íý×íý×íý×ïû×ïû×ïû×ïû×ïû×ïû×ïû×ïûÙíûÙíûÙíûÙíû×ìú×ìú×ìú×ìúÕìùÕìùÕìùÕìùÔëøÔëøÔëøÔëøÔëøÔëøÔëøÔëøÓê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÐèôÐèôÐèôÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåýÕéþ²ÆÛTdzEUmM[tAOjWc�MXwJSrS[zIQqJSr[c€^f„NWrLSoPTqINhW\sim‚X]tae}V\oX^qU[m]bwW\s]bykq„flV[pTWkqp€•“¡ªª¶˜˜¤ˆŒ”Œ�—…‹�²¶»·¸»ÌËÏÚÝå½Á̹ÂÏÔâòÛêûÕéûÖêýÕëýÕëýÕëýÖìþÖìþÖìþÖìþ×ëþ×ëþ×ëþ×ëþÙìÿÙìÿÙìÿÙìÿ×íý×íý×íý×íý×íý×íý×íý×íý×ïû×ïû×ïû×ïû×ïû×ïû×ïû×ïûÙíûÙíûÙíûÙíû×ìú×ìú×ìú×ìúÕìùÕìùÕìùÕìùÔëøÔëøÔëøÔëøÔëøÔëøÔëøÔëøÓê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÐèôÐèôÐèôÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÐåþÒåý³ÄÚN^tIZpIWqHVqQ_zJXvLWvNZxEPoLWvQZyV^{W_}U\yOVsQUsTWt{€š\azSWqPUoPUlOTiV[pmr‡TXrOTmmr‡x}‘_d{X\qz}Œœœ¨��›––¢z~ˆ†‰”{‰ww€Œ‹‘ÆÅÌÌÌÕ¥ª´°·ÁÅÐÞ×åöÛëúÙêúÖêýÖêýÕëýÖìþÖìþÖìþÖìþ×ëþ×ëþ×ëþ×ëþÙìÿÙìÿÙìÿÙìÿ×íý×íý×íý×íý×íý×íý×íý×íý×ïû×ïû×ïû×ïû×ïû×ïû×ïû×ïûÙíûÙíûÙíûÙíû×ìú×ìú×ìú×ìúÕìùÕìùÕìùÕìùÔëøÔëøÔëøÔëøÔëøÔëøÔëøÔëøÓê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÐèôÐèôÐèôÒæþÒæþÒæþÒæþÓèÿÓèÿÓèÿÓèÿÒäþÔæÿÕèÿÐãýÐãýÕèÿÕèÿ¨¸ÒZh�N[tN[tO]xQ_zM[vLZtL\vJZwBQoP^{Q]{W_W]~W[{UXwQUs\_}hl†TXrLOmIMkDGdDH_EI^‚‡œlq‹TXr~‚š„›TWtaeqv„¦ª´‡‹•~€�qp€‡†–�Œœ‚€�‰‡”¡Ÿ©ÅÅг·Á¡¥°¤©³ÅÌÕÙâìÜêúÞíÿÚëûÖëúÖìû×íý×ðþÙñÿ×íýÙíýÙíýÙíýÙíýÙíýÙíýÙíý×íý×ïû×ïû×ïûÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðúÙðúÙðúÙðú×ïù×ïù×ïù×ïùÖíúÖíúÖíúÖíúÕìùÕìùÕìùÕìùÕìùÔëøÔëøÔëøÓê÷Óê÷ÒéöÒéöÓê÷ÒéöÒéöÒéöÒéöÐèôÐèôÐèôÒæþÒæþÒæþÒæþÓèÿÓèÿÓèÿÓèÿÒäþÖéÿÒäþÓåÿÐãýÐãý}�©O_yNZvNVsLWsQ]yLWsN\wN\wHXrIZsHWtSa~S^}[a�be†hi‹WXxW[yVZwZ^xTWtPTrOSqNQoBGaINc{€•^c}[_y–›²€…œX\yQVpjo}ˆ�—¢¤±­°¿wv†‰ˆ›‰†šš–ª‰‡•rp}——£¿¿Ë„‡�¢¥­»ÁÆÉÐÚÝé÷ÙæøÜëýÝïÿÚïþÙïþÖïýÕíû×íýÙíýÙíýÙíýÙíýÙíýÙíýÙíý×ïû×ïû×ïû×ïûÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðúÙðúÙðúÙðú×ïù×ïù×ïù×ïùÖíúÖíúÖíúÖíúÕìùÕìùÕìùÕìùÕìùÕìùÕìùÔëøÓê÷Óê÷Óê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÐèôÒæþÒæþÒæþÒæþÓèÿÓèÿÓèÿÓèÿÔæÿÓãýÖæÿÕåÿÛëÿw‡¡M]wDQlLWsLTqS[xV^{O[wS^zLWsBPkLZtO]xUa}Zbls�_c�op��ž^bUXv\azW\vGJiHLjMPmFJbIObX^qZ^vy~•Ÿ¥¸w{�UZq[_tty‡ty…‡‰–��ž…„”‰ˆ˜£¡±¬ªº»»Èvv‚‹ŸŸ«¦ª²©¬´¤¨°¹¾ÈÛæôÛéùÛëúÙêùÛðþÙðýÖïûÕíú×íýÙíýÙíýÙíýÙíýÙíýÙíýÙíý×ïû×ïû×ïû×ïûÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðúÙðúÙðúÙðú×ïù×ïù×ïù×ïùÖíúÖíúÖíúÖíúÕìùÕìùÕìùÕìùÕìùÕìùÕìùÕìùÔëøÓê÷Óê÷Óê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÐèôÒæþÒæþÒæþÒæþÓèÿÓèÿÓèÿÔèÿÖæÿÔäþÓãý×èÿ~ލHXrHXrIWrIUqMUrQZwNVsQZwPXvNVsJVrS_yO\vU^y^e�VZw^bsv“†ˆ¥y}šUZs]byX]wPTqPTqMQkNSjPViLQdSWo~‚—ž¤·jp‚]bw[_trv‡UZhZ\kkm}�€�šš¦±¯½À¾Ì©©¶ffsxx…‰‰•Œ�š–š¢˜œ¤ž£­ÆÏÞÝëûÜêúÛëúÙíûÖíúÙðýÚñþÙíýÙíýÙíýÙíýÙíýÙíýÙíýÙíý×ïû×ïû×ïû×ïûÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðúÙðúÙðúÙðú×ïù×ïù×ïù×ïùÖíúÖíúÖíúÖíúÕìùÕìùÕìùÕìùÕìùÕìùÕìùÕìùÔëøÔëøÔëøÓê÷Óê÷Óê÷Óê÷Óê÷ÒéöÒéöÒéöÒéöÒæþÒæþÒæþÒæþÒæþÒæþÒæþÓæþÚêÿÏÝøÎÜ÷hv�HVqHVqHVqGUpHTpOWtU]zLTqLTqOVsLSpS\wOXqV]wU\v]b{ptŽjoˆkmˆz}—kp‰X]wLPhNSjTWtOSpW\vLPhMQfPUjV[rae}U[mU[mkp…X]r^bv^bvehybdseerŸŸ«©¦³¢Ÿ¬‹‰škm}fixtw„Œ��˜��˜¢¤±Ÿ¥³ÎÚèÜêøÙéöÞñýÙíùÙðúÕìùÚïþÚïþÚïþÚïþÚïþÚïþÚïþÚïþÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÚñþÚñþÚñþÚñþÚñþÚñþÚñþÚñþÚñûÚñûÚñûÚñûÙðúÙðúÙðúÙðú×ïû×ïû×ïû×ïûÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÕìùÔëøÔëøÔëøÔëøÔëøÔëøÓê÷ÒéöÒéöÒéöÒæþÒæþÒæþÒæþÒæþÒæþÒæþÓæþÕåÿÎÜ÷dr�FToIWrESmFToMXtS^zU]zHPmLSpJQoU\y\c€sw”[_w\ax^czdi€chchdf_bzSWoNSjX]r\ax\azOTmPUlae}QVmHMdLPjINhMQfdj}y~“ejVZojm‚€�–‹�œ��އ‡“¨¦°žž¨y{‹…‡˜€‚‘z}Œ}{Œ��œ‘‘ž¨ª·•›©ÀÉÙÙäòÙæôÚê÷ÜïúÙíùÛòýÚïýÚïþÚïþÚïþÚïþÚïþÚïþÚïþÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÚñþÚñþÚñþÚñþÚñþÚñþÚñþÚñþÚñûÚñûÚñûÚñûÙðúÙðúÙðúÙðú×ïû×ïû×ïû×ïûÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÕìùÔëøÔëøÔëøÔëøÔëøÓê÷ÒéöÒéöÒæþÒæþÒæþÒæþÒæþÒæþÒæþÓæþÕãþw‚žHTpMXtO[wLWsNZvT_{P\xLTqIQoLSpOSq\_~il‹�„¡mpˆSVkdh}…ˆ�W[p[^sUZoNShV[r_h~^fzw“qx‘PWqPXock�DJdGNjNUqFMiXawt}�€ˆœV[rSUmtw��‘¦”–¨��ª››¤±°·‰‹�xz‡‚”„†—‹�ž}{Œ”“£œš¨´´Á‘–¤¦°½ËÖâÜëöÝíøÝðù×íöÚïúÚïýÚïþÚïþÚïþÚïþÚïþÚïþÚïþÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÚñþÚñþÚñþÚñþÚñþÚñþÚñþÚñþÚñûÚñûÚñûÚñûÙðúÙðúÙðúÙðú×ïû×ïû×ïû×ïûÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÔëøÔëøÔëøÔëøÔëøÔëøÓê÷ÒéöÒæÿÒæþÒæþÒæþÒæþÓæþÓæþÕåþ}‹¥DOkIUqMXtJVrMXtP\xS^zLWvHPpGNkELiNQodh…Œ�ª¦©Ä›ž³[^r{“il�SVkQUjMQfGLaJSf_h{ltˆW_vT[t^eJSiGNhNUqLSoFMjFMiIPjrz�V^tLPhOQlxz“˜š°„…š‡†–��˜¸·¾•”�‚‚�„†—„†—xw‰ts„��Ÿ››¨´´Á«­º—œ¨©°ºÍÙâÛêòÚêôßòûÜòúÚïýÚïþÚïþÚïþÚïþÚïþÚïþÚïýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÙðýÚñþÚñþÚñþÚñþÚñþÚñþÚñþÚñûÚñûÚñûÚñûÚñûÙðúÙðúÙðúÙðú×ïù×ïû×ïû×ïûÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÖíúÔëøÔëøÔëøÔëøÔëøÔëøÔëøÓê÷ÓèÿÐåþÓåÿÓåÿÒåýÓãûÔäúm{•LWsJSpJSpNVsT\yZbXa~NVvGOqFLoGMmIPlQXrbj~𢴴ºÍˆ�¢fk€im‚\axNSjJOfQVmLPeV[p^cxchFIfMTqHOlFOjNUqZa}FIfQUrMPmTWtej„MQkMQkWZt}šxz“[\rbasfev˜–¤��›�‹˜ŽŒœŸœ°]\oa_r‹‰šŸŸ¬ÄÄл»Ç¤¤­¡¤¯¦­·Ë×ÞÝìôÝð÷ÝðùÜïúÜíýÜíýÜíýÜñÿÜñÿÛòÿÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÜóþÜóþÜóþÜóþÜóþÜóþÜóþÜóûÛòúÛòúÚñùÚñùÚñùÚñùÚñùÚñùÙðøÙðúÙðúÙðú×ïù×ïù×ïù×ïù×ïù×ïù×ïù×ïùÖíøÖíøÖíøÖíøÕì÷Õì÷Õì÷Õì÷ÔëöÔëöÔëöÓêôÐãýÖéÿÓæþÔäýÔäý×åÿp~—TazNVsLTsLTsNVvV^~V^~NVvEMlGMpNTwLSpFMi[cypxŒ�¦¶«´Ä^cx_d{\axW\sTXpNSjNSj\avio�Z^sdi‚FIfGNkIOpGOlSZvfk…^c}}�›[_yPTqei†OTmNSlbd��ª]_x]^t{z�zyŒœšªŽŒœ•�Ÿ—“¤ž›¯]Zm[Zlkj}›�¬³³¿º¹Â¾½Ä¬¬¶¨­´±»ÄÐÝäßñøÚêôÝíúÝíúÜïúÜïúÜñýÜñýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷ÖíöÖíöÖíöÖíöÕìôÕìôÕìôÕìôÔëóÔëóÔëóÓêò×éûÒãöÕåû׿ýÖäþ„�ªIVpW_}PXxMUwMUwPXzU]NVxGOqDLmNTwIOpBIfJQmLTjmv‰¯·Épx‹W\schZ^vMQiSWoOTkPUjaez\btio�ae}AEbLSpLSpGOlJQkW\sswŒ£¥¾tw�X[vik†JMjQTopr��šMOh\]syx‹‰ˆ˜£¡±�‹˜�˜¨�ˆšsp„ro‚a_r^]p‰Œ›¯¯º³²»·¶½ÀÀÉ�£ª¯¶¿¿ÌÓÛêòÜì÷ÝíúÝíúÜïúÜïúÜñýÜñýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷ÖíöÖíöÖíöÖíöÕìôÕìôÕìôÕìôÔëóÔëóÔëóÓêòÕåô×è÷Öå÷×äùŒ˜°PZtS\wLTqQZyNVxNVxQZ{OWyHPrFNpIQqQWxW^{LSoMTmHOiS[qz‚–[cwX]wV[tHMf@E\INebf~PUjrx‹iodjzPUjHMfOVrHOlMUrFMiHMdX\qjm‚ei~�š€‚›PSkik„wy‘lo‡TWl_av{z�Ž��¢Ÿ­�Žœ¡œ«“ŽŸ�ŒŸ��¡rq„ZXkmp¡¡¬–•žº¹ÀËËÔ›ž¦ž¥¯¬·¿ËÖßÛêôÝíúÝíúÜïúÜïúÜñýÜñýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÛòýÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÜóûÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷×ï÷ÖíöÖíöÖíöÖíöÕìôÕìôÕìôÕìôÔëóÔëóÔëóÓêò•¤¯¯¾È½ËÙz…–S\rV]wQXtV]zS[zT\{PXxLTsFNmIQqOWwT\{W^zQXtJQkELeELeNUoU]sGNhGLePTqNSlUZqMQipt‰[_tz€�jq{}„ŽX^oHMdT[wOVsNVvSZwUWrHI_TUkrsˆ€•wx�hi~st‰UXmMPeUXmst‰�Œœ••¢­«¹•“Ÿ¤Ÿ¯ª¥·¨¤¸¢ž²¡Ÿ²qp‚mp››¦¡Ÿ©¬«²´´¾³·¿Ÿ¤¯«²»ª±»ÙäðáïýÜìùáóÿáóÿÜñýÜñýÛòýÛòýÜóþÜóþÜóþÜóþÜóþÜóþÜóþÜóþÝôýÝôýÝôýÝôýÝôýÝôýÝôýÝôýÜóûÜóûÜóûÜóûÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷ÖíöÖíöÖíöÖíöÖíöÖíöÖíöÖíöÕìôÕìôÕìôÔëóeqzit~NZeOXhPXlX]tX]w[^{QXvS[xS[xPXvNVsQZwT\yT\yMTmMTmBIcAHbMTmELeBIc@GcIMjOSpOTmjoˆrwŽhl�dj}MScPWaahrMScV[pT[tQXvOWtT[wVXqVWlijqs…actqs…ŒŽ�vx‰SVjTWlW[ohj{‘�¡¦¦³œš¦�›¨¶±À£ž°Ž‹žŒˆœ��¢š˜«�“¢��›š˜¢�Œ“¹¹ÂÅÅΦª´¯³¾¦«·¶¿ÌáïýÞïûáóÿáóÿÜñýÜñýÛòýÛòýÜóþÜóþÜóþÜóþÜóþÜóþÜóþÜóþÝôýÝôýÝôýÝôýÝôýÝôýÝôýÝôýÜóûÜóûÜóûÜóûÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷ÖíöÖíöÖíöÖíöÖíöÖíöÖíöÖíöÕìôÕìôÕìôÔë󀉔y‚�bkxNTdV\oX\qW[p^aySZsU^yU^yQ[vS\wU^yS\wNWpFNdAI_BJa>E^GNhGNj7>Z;B_?Ba?B_BGaX]wINech}‰�¢GM]DIWOUeafy_dyJSiMTmWawdl€[]ofevsr‚hfwfevml}š˜«ž¡²qtˆ_cxadx[]o€�¦¦³�›¨œš¦­©¸–‘£}y�zw‹{z�†…—•—¦��œŽ�–Œ‹‘©©²ÀÀɲ¶À¸»Æ´·Äœ¢°ÁÏÝÜìùáóÿÞñýÜñýÜñýÛòýÛòýÜóþÜóþÜóþÜóþÜóþÜóþÜóþÜóþÝôýÝôýÝôýÝôýÝôýÝôýÝôýÝôýÜóûÜóûÜóûÜóûÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷ÖíöÖíöÖíöÖíöÖíöÖíöÖíöÖíöÕìôÕìôÕìôÔë󅌖t{†pt€lqhlzehyTVh_avZ^sXatU]sPXoQXrT[tNUoELeAHbDH_AF_@GaELh=Da=Da@Gd>A_>A^JNkHMfAF]PUjOTiOUhX^qsyŒejOTiS[qFNdLViT\pX\pZ\m^arihzdcvjiy‹‰š£¢´rsˆy}�~�“xz‰wy†„„�——£‰‡”~{‰‡…“‰‡—�‰�†…—‹‰š”–£ŒŒ—š˜¢¸·¾»»Å¾¾Ç¿¿Ë½½È¶¶Áª¯º�›¦ÓãðáñþÜïúÞñýÜñýÜñýÛòýÜóþÜóþÜóþÜóþÜóþÜóþÜóþÜóþÝôýÝôýÝôýÝôýÝôýÝôýÝôýÝôýÜóûÜóûÜóûÜóûÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷ÖíöÖíöÖíöÖíöÖíöÖíöÖíöÖíöÕìôÕìôÕìôÔëó�“�•˜£ˆŒ–‹Ž˜ÆÉÔ±±½šš¥››¨sv‚hjyps…VZmUZqPUoLOlFIhFIhGHhEFeAEc@Db@Dd>Dd>Eb>Eb?FbHOkFMiAHbAHbBIcNVlXatS[m]eydl€U]sLSlJQkLSlTWtHJhOQj]^tcdyxz‰±±¾‡†–mp�}~“‘”£ž¡­–˜¥‚…‘�Žvv‚Œss€‹‹—�Žž€�……‘““Ÿ��©œ›¤­¬¶º¹Â¾½Æ¤£¬¹¸Á¾½Æ²¶À—ž©œ¨³ßïùáñûÛíùßòþÝòÿÚïúÞóÿÞôýÞôýÞôýÞôýÞôýÞôýÞôýÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÝöúÝöúÝöúÝöúÜôùÜôùÜôùÜôùÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷ÕïöÕïöÕïöÕïöÔíôÔíôÔíôÓìó��–‰‹�›œ¢¢£©³´ºÙÚßÈÉϬ­³½¾Ä··À¨ª·[]obc{bd�MNmIMkJLkLMlIJjFGi@Dd@Dd>Dd>Eb?Fb>EaGNjDJfBIeAHd?FbFMfDLb@H\IQeck�QZpIPjFMfOVrMPoLOmPSm]_x]^spr„……‘~}��“~€‘vx‡‡‰–¢¥°£¥²pr�vx‡��Ž……‘ss€���ŽŽ›~~‹��š��ªš—¤œ›¤¤£¬ÓÒÛ¤£¬­¬¶³²»°°¹±¶À‚Œ–ÒÝéßïùáñþáóÿßôÿÝòþÞôýÞôýÞôýÞôýÞôýÞôýÞôýÞôýÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÝöúÝöúÝöúÝöúÜôùÜôùÜôùÜôùÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷ÕïöÕïöÕïöÕïöÔíôÔíôÔíôÓìóÁÂÆ¤¥©Œ��”•˜—˜œÞßãÎÏÓÅÆÉ¿ÀÄ´¶»··Â{z�cd}hh†VWyLMoILiJMjHJhEFe@Db@Db>Eb>Eb?Fb>EaELhAHdAHdAHd>Ea@GcELh>E^ELe]e{JSiGOcNVjV^rPUoNSlOQjX\qQShbdvom€{z�{}‘mp�QTc[]j…ˆ“‹�š†ˆ—ŒŽ�††“ddqbboyy†ˆˆ•ŒŒ˜��œ““Ÿ�›¨›š£ž�¦²±ºž�¦¦¥¯¡Ÿ©��š´¹Ä˜Ÿª¬¶ÀâíùáñûÞñýÛðûÝòþÞôýÞôýÞôýÞôýÞôýÞôýÞôýÞôýÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÝöúÝöúÝöúÝöúÜôùÜôùÜôùÜôùÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷ÕïöÕïöÕïöÕïöÔíôÔíôÔíôÓìóÉËÍ´¶¸¦¨ª‘“•‹ŒŽ·¸ºÜÝßÚÛݸ¹»²³·ÇÇЪ©¹zx�dd€__NOoDFaDFaAD^?A^@Da@Db>Eb>Eb@Gc>EaDJf?Fb=D_@Gc>Ea@GcFMi@GcJQkXawPXoJSfXasPXlGLcQVm\_tQUjSTi\^pts„vt‡�‚—ik}UWfikxx{†…‡”‡‰˜�‘¡���^^kzz‡‚‚�‰‰–‡‡”‘‘ž””¡”‘ž£¢«¡Ÿ©±°¹†…Ž£¢«¢¡ªŸŸ©²¶À­²½‹‘œÚãíãòýáóýÞóÿáöÿÞôýÞôýÞôýÞôýÞôýÞôýÞôýÞôýÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÝöúÝöúÝöúÝöúÜôùÜôùÜôùÜôùÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ï÷×ï÷×ï÷×ï÷ÕïöÕïöÕïöÕïöÔíôÔíôÔíôÓì󩫪¾À¿‘”“ˆ‹‰mpoz}{ËÍÌßâáÖÖÖÒÒÔÁÀÇÀ¾Ë²±Ä–”«de~OOkHLaGJ_HJcFHa@E^=@]:A]=D_>Ea?Fb>Ea;B^>Ea?Fb@GcAHdMTmSZsHPfFNdS[qOWmQZpLTjJOi_d{JNc_cw]_qjl{llyŒy{�VXjWZirt�lpz€‚�•—¦¢¤³””¡ww„}}‰‹‹—††“””¡¡¡­““Ÿ›˜¥”“œ›š£ÆÅΣ¢«ž�¦ª©²°¯¸ßß黻ǔ˜£ºÄÎÝìôáóýßöþÛòúÞôýÞôýÞôýÞôýßöþßöþßöþßöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞ÷ûÞ÷ûÞ÷ûÞ÷ûÝöúÝöúÝöúÝöúÜóûÜóûÜóûÜóûÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ñø×ñø×ñø×ñøÖð÷Öð÷Öð÷Õïö~�±²´‰‹��‚…deh�‘”¯°²ÎÎθ¶·ÓÐÔÜÚÞÒÐ×°­ºª©¹wvˆWXmOSdNQeNQeLOd@E\>B\:A]>Ea?Fb>Ea;B^=D_@Gc?Fb>Ea=D]=E[FNdDLbMUkS[qQZpT[tU\vV[rej�TWlX\pcewjlyyy…ŽŽ›y{�\^plo~y{ˆ‹Ž˜”–£vx‡~€�••¢‘‘ž‚‚�““Ÿ••¢‰‰–––£˜˜¥Ÿ�ª¡Ÿ©¦¥¯Ÿž¨±°¹£¢«©¨±ª©²±°¹´³½¬°º‹‘›ßëôÛíôÞôýß÷ÿÞôýÞôýÞôýÞôýßöþßöþßöþßöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞ÷ûÞ÷ûÞ÷ûÞ÷ûÝöúÝöúÝöúÝöúÜóûÜóûÜóûÜóûÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ñø×ñø×ñø×ñøÖð÷Öð÷Öð÷Õïö¡¢¥”•˜‚„‡{}€dei…†‰˜š�ššœ›˜šÅÀÁÛÙÜÓÐÔÍÌÐÆÅ̰°¹eisV[fTXfQUfOSfAF]>B\;B^?Fb>Ea;B^=D_=D_?Fb>Ea=D_;B\BJaEMa@H^MUkIQhJSiNUoV^tdi~{�”W[odhysv…z}Œ¢¢¯qp€VXjxzŒrt„vx…€„Ž“•¢fixdfvŽŽ›���ww„‡‡”££°¾¾Ë——¤››¨œš¦š˜¢¯­·ÁÀÉ¥¤­´³½­¬¶°¯¸¦£«ÍÉÔ½½Æž£­©¶½Þð÷ÞôúÝöúÞôýÞôýÞôýÞôýßöþßöþßöþßöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞöþÞ÷ûÞ÷ûÞ÷ûÞ÷ûÝöúÝöúÝöúÝöúÜóûÜóûÜóûÜóûÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ñø×ñø×ñø×ñøÖð÷Öð÷Öð÷Õïö°±´°±´¥¦ªŽ�“{}€efjmor_^c¯¬°ÕÓÖ—•˜¦¤¨��”Œ‹�•–œ‰‰“^blV[fSWePTeBF[?D[?B_>Ea;B^=D_=D_>Ea:A];B^=D_>EaFNdAI_;DZJQkHOiBIc;B\AHbV[pafy]arhlzy{‹��ž�­jiywy‹bdvjl{}Œfiv~€�oq~zz‡˜˜¤ŽŽš��œ‡‡“~~‰““Ÿ««¸““žœ›¤¡Ÿ©˜—¡£¢«�œ¥ª©²Ÿž¨¶´»¥¢ªÒÐ×ÀÁǯ´»¥°¶Úéðßñ÷ãöýÞôúÞôýÞôýÞôýßöþßöûßöûßöûÞöþÞöþÞöþÞöþÞöþÞ÷ûÞ÷ûÞ÷ûÞ÷ûÞ÷ûÞ÷ûÞ÷ûÝöúÝöúÝöúÝöúÜôùÜóûÜóûÜóûÛòúÛòúÛòúÛòúÚñùÚñùÚñùÚñùÙðøÙðøÙðøÙðø×ñø×ñø×ñø×ñøÖð÷Öð÷Öð÷Õïö¶´¹¨¦«Ÿž£š˜�~}�zy~‹‰Žtsxqpt«ª¯ÄÂÉ�Œ“VU^WV_ljwyy…lpzTWbSVaUWfGJ^GIb@Da>Eb?Fc>Gb=Fa;E];E];E_;E_;E_?Ha?Ha?Ha?Hc@Id>Gb>GbAHdMQiNSh_ctqv„‡‰–�Žvt…sr‚zy‰kjzvt…~Žyy†••¢““Ÿ––¢±°¹©¨¯ž�¦•”��€‰”‘ž�Ž›¡ž«¢¡ª—–Ÿ‹‰�£¢©ÐÏÖª©°¥¤«°¯³±°´ª«¯³¸º²¶»°¶½´»ÂÖáæßïöáóúÝöúÞ÷ûÞ÷ûßøýáùýâøýá÷ûá÷ýá÷ýá÷ýá÷ýâøþâøýâøýâøýáùýáùýßøûÞ÷úÞ÷úÞ÷úÞ÷úÞ÷úÝöùÝöúÝöúÝöúÜôùÜôùÜôùÜôùÛóøÛóøÛóøÛóøÚò÷Úò÷Úò÷Úò÷×ñö×ñö×ñö×ñöÖðôÖðôÖðôÕïórqv¥¤©›šžœ›Ÿ{z“‘–„‚‡wvz€†¥¤«º¹Â˜—¡a^k_]jb_mdbpss\_hNQ\\^kNQeGIbDGd>A_?Fc>Fc=Fa;E];E];E_;Da;Da>Gb>G_>Gb>Gb=Fa=Fa?GdELhUZsOTi]ar€…“‚…‘sv‚yxˆkjzom~dcs~މˆ˜~~‹}}‰šš¥““œ°¯¶¬«°¨¦­›š¡•”�¬«´”‘ž”‘ž¥¤­–•ž”“𢡍´³¸ÅÄÈÓÒÖ½»À¬­°ª«­º»¿»¿Å¤¨°ÀÆÍž¤«äï÷âôûÞ÷ûÝöúÜôùâúþÞ÷úß÷øãùþá÷ýá÷ýá÷ýá÷ýâøýâøýâùúâùúáùýáùýßøûÞ÷úÞ÷úÞ÷úÞ÷úÞ÷úÝöùÝöùÝöùÝöùÜôøÜôøÜôøÜôøÛóøÛóøÛóøÛóøÚò÷Úò÷Úò÷Úò÷×òô×òô×òô×òôÖñóÖñóÖñóÕðò}{€wvzrqvvty�€…°¯³¡Ÿ¤��”‹‰�‰ˆ�‰ˆ‘š˜¢„�ŽŒ‰–a^lZWe^^j[^iZ]h]_lPTeJNcGLe@Db?Fc>Fc=Fa;E_;E_;E_;Da;Da=Fa=F^=Fa=Fa=Fa=Fa?GdELh\azOTicfx€…“jly\^k{z‹_^oVUebaqqp€~Ž}}‰ss€��˜��–©¨¯«ª¯¯­´�œ£¡Ÿ©ÆÅΨ¥²�Ž›­¬¶‘�šž�¤¥¤«¡Ÿ¤ÂÁÆëêïÌËÏÆÆÈ±±³ÅÆÉ¾¿Å¯²º½ÀÈ“˜ŸÁÌÔßñøßöûÞôúßöûßöúãùþâúûÞ÷úá÷ýá÷ýá÷ýá÷ýâøýâøýâùúâùúáùýáùýßøûÞ÷úÞ÷úÞ÷úÞ÷úÞ÷úÝöùÝöùÝöùÝöùÜôøÜôøÜôøÜôøÛóøÛóøÛóøÛóøÚò÷Úò÷Úò÷Úò÷×òô×òô×òô×òôÖñóÖñóÖñóÕðò¿¾Â‰ˆ�\[_edi„‚‡±°´¶´¹—–›”“š‹‰�„‚Œ[Zc…‚�¿½É“�žcao]]iVZdkoy_boNQcNQfGLeGJh?Fb>Fc=Fa;E_;E_;E_;Da;E_=F^=F^=Fa=Fa@Id>Gb>FcAHdGLeX]rcfxdiw]_leht~Žbaq\[ksr‚xw‡{z‹‚‚�yy†‰‰•••ž£¢©ª©­³²¹ž�¤”“œª©²¡ž«¤¢¯·¶¿Œ‹”¤£ªª©°¦¥ª©¨¬ÇÆËÁÀ޽¿¿¿Áº¹¾ÆÇ͹¹Â¾ÁɾÁÉ�”�ÒáéÞñøä÷þäúÿâøýá÷ûßøùáùýá÷ýá÷ýá÷ýá÷ýâøýâøýâùúâùúáùýáùýßøûÞ÷úÞ÷úÞ÷úÞ÷úÞ÷úÝöùÝöùÝöùÝöùÜôøÜôøÜôøÜôøÛóøÛóøÛóøÛóøÚò÷Úò÷Úò÷Úò÷×òô×òô×òô×òôÖñóÖñóÖñóÕðò©¨¬´³¸edi~‚¡Ÿ¤—–›­¬±¬«°š˜Ÿ–•œž�¦~}†WUb¬ª·ÍËÙhesbbmps~Z]ecfq_drMPdINeJOiAHd=Fa=Eb;Da;Da;Da;E_;E_;E];E];E_;E_>Gb;E_AIfJQmJOiW\qZ]olq_boz}‰€�ml}ihxrq�~}�vt…tt�tt�””Ÿ��¦¬«²¬«°ª©°š˜Ÿ“‘›ž�¦¥£°½ºÇ¦¥¯–•ž�Œ“š˜Ÿœ›Ÿ¦¥ª¿¾ÂÆÅÉÀ¾ÁÅÂÆ¿¾ÂÔÓÚ²²»»»Å¾ÁÉŸ¤¯…�šÉÙáäöýÜïöá÷ûãùþãûýäýÿâøþâøþâøþâøþâøýâøýâùúâùúáùýáùýáùýáùýßøûßøûßøûßøûÞ÷úÞ÷úÞ÷úÞ÷úÝöùÝöùÝöùÝöùÛó÷Ûó÷Ûó÷Ûó÷ÚòöÚòöÚòöÚòö×òô×òô×òô×òôÖñóÖñóÖñóÕðò»º¿ÂÁÆ¡Ÿ¤Œ‹�©¨¬£¢¦–•𔓗¨¦­œ›¢ž�¦°¯¸‚€�[Xe^\j¸¶Ä]]iX\f_ck\_jlq}fj{DH]GLcDJd>Gb=Eb;Da;Da;Da;E_;E_;E];E];E_;E_=Fa;E_?GdGNjPUoQVkSVhlqvx…y{ˆedtedtxw‡xw‡sr‚„‚“‰‰–qq~‰‰•¨¨±ÆÅ̽»À±°·½»ÂŸž¨�Ž—“��{y†€ˆ��˜¤£ª“‘˜��”¦¥ª»º¿ËÉÎÈÆÉËÈÌÂÀÅÀ¿Æ»ºÄ¿¿ÈÂÂ̰´¿}†��œ¥ßï÷èùÿáôùá÷ûáùúáùýâøþâøþâøþâøþâøýâøýâùúâùúáùýáùýáùýáùýßøûßøûßøûßøûÞ÷úÞ÷úÞ÷úÞ÷úÝöùÝöùÝöùÝöùÛó÷Ûó÷Ûó÷Ûó÷ÚòöÚòöÚòöÚòö×òô×òô×òô×òôÖñóÖñóÖñóÕðòÐÏÔ¯­²¥¤©¦¥ª—–››šž�œ¡‘�•‘�—ˆ‡Ž–•ž¸·ÀÆÄÐ^\ib_mqo}SS^Z]h[^fadohlx}��FL^=AVFMf@Id=Eb=Eb;Da;Da;E_;E];E];E];E_;E_:D^:D^=EbAHdFJdNShMPb]bp�„��‘ž„‚“‡†–xw‡�€�yxˆ€���šŒtt€ŽŽ—±°·º¹¾¦¥¬¹¸¿­¬¶–•ž¥£°��š˜—¡š˜¢•”›š˜ŸŽ�‘©¨¬»º¿ËÉÎâßãÔÎÓÄÁÆÌÈÐÏÎ×ÎÍÖ»»Å¦ª´£ª´y‚�¬¸Áè÷ÿåùþßöúßøùßøûâøþâøþâøþâøþâøýâøýâùúâùúáùýáùýáùýáùýßøûßøûßøûßøûÞ÷úÞ÷úÞ÷úÞ÷úÝöùÝöùÝöùÝöùÛóôÛóôÛóôÛóôÚòóÚòóÚòóÚòó×òô×òô×òô×òôÖñóÖñóÖñóÕðòÈÇ̪©­–•𝭲©¨¬£¢¦³²·­¬±£¢¦{z‡†�œ›¤¤¢¯ljwVTbVVcNP]Z]hilwbepcfqimyrv‡FL^BJaDJd?Fb>Eb=Da;Da;E_;E];E];E_;E_;E_9B]:D^;Da=D_@Ga?D[FI]ps…ŒŽ�œž«——¤‚�‘‚�‘xw‡~Ž€€�‡‡”„„�vv�††�¿¾Å²±¶ª©°–•œ‰ˆ‘¡Ÿ©¸·À©¨±»ºÄ­¬³¸·¾¡Ÿ¦—–›­¬±¾½ÁÄÂÇÍËÎÍËι·»½º¿°¯¶³²»ÁÁËÁÁ˾ÁÌ¢¦²‚‰”Ë×ÞåôûèûÿâøýßøûáùýáùþâøþâøýâøýâøýáùúáùúáùúáùýáùýáùýßøûßøûßøûßøûÞ÷úÞ÷úÞ÷úÞ÷úÝöùÝöùÝöùÝöùÛóôÛóôÛóôÛóôÚòóÚòóÚòóÚòó×òô×òô×òô×òôÖñóÖñóÖñóÕðòÇÇÉÏÏÒÀÀÂ¥¥¨““•¨¨ª··¹¯¯±›››œœœ�‚…rsy˜˜¢hhtNM]NP_SUdacrllxffrllxrt�}ŽfizAEZHJcJNkDGd>A_9@];B^@Ga?Fb?Fc>Eb>Eb=D_;B^;B^=D_;B\AF_DHb@B[LOcmpŽ��˜›¨‹‹—zz‡��Žrr~xx„tt€‹‚‚Œ¶·½¹ºÀ°±·¥¦¬•–œ«¬²³´º±²¸¯­´²±¶·¶ºº¹¾Ÿž£¡Ÿ¤½»ÀÇÆËÁÀŲ±¶´³¸º¹¾³²·ÐÏÖÆÅÌÄÂɾ½Æ´´ÀŽ‘œ•œ¥Ýêñè÷ÿåøÿá÷ýáûþáûþâúþãúûäûýãûýâýýâýýâúûâúûâúûâúûáùúáùúáùúáùúßøùßøùßøùßøùÞ÷øÞ÷øÞ÷øÞ÷øÛööÛööÛööÛööÚôôÚôôÚôôÚôôÙñòÙñòÙñòÙñò×ðñ×ðñ×ðñÖïðÞÞáÈÈ˽½¿³³¶••—““•ÀÀÂÇÇÉ«««¯¯¯º»¾‰‹Ž[^fTVcPSbX[lVXjbdsoo{±±½››¦~~‰hhtkjz^_tHI_HJeMOlFIf?B_9@\;B^>Eb>Eb>Eb>Eb>Ea=D_;B^;B^;B\@Ga>A^@E^QUjNQcUWd�…�••¡……�‡‡“iitffrllx€€Œ‰‰•°°¹´¶»±²¸£¤ª…†Œ¯°¶¦¨­²³¹¹¸½²±¶¸·»ÁÀʏ½›šž¢¡¥»º¿ÉÈ͹¸½¬«°·¶º´³¸Ù×ÜÄÂÇÈÇÎÀ½Ç¥¤­²²»‡Œ–¥¯¹ßëôæ÷ÿäúÿáûþáûûâúûãúûäûýãûýâýýâýýâûùâûùâûùâûùáúøáúøáúøáúøßøùßøùßøùßøùÞ÷øÞ÷øÞ÷øÞ÷øÛööÛööÛööÛööÚôôÚôôÚôôÚôôÙñòÙñòÙñòÙñò×ðñ×ðñ×ðñÖïðßßâÒÒÔššœ��Ÿ££¥““•­­°³³¶¯¯¯ŸŸŸ—˜›¯°³z~†jlyNP_QTewy‹hjyzz‡””¡ÈÈÔ\\hllyts„y{�PQfEG_HJeGJhAEb=D_>Ea>Eb>Eb=Da=Da>Ea>Ea=D_;B^=D]9@Z@Da?D]PTi^bsdfswz…]]immy‰‰•{{‡jjvzz†††‘““ž¢¢«³´º¹ºÀ²³¹–—�‘“˜³´º©ª°¸·»²±¶­¬±¯­²¾½Á¸·»±°´¥¤©¾½ÁÇÆËº¹¾”“—½»À·¶ºÀ¿ÄÎÍÔÇÆÏ°¯¸½½Æšž©x‰±½Æéøÿä÷þâúþáûûâúûâúûãûýãûýâýýâýýâûùâûùâûùâûùáúøáúøáúøáúøßøùßøùßøùßøùÞ÷øÞ÷øÞ÷øÞ÷øÛööÛööÛööÛööÚôôÚôôÚôôÚôôÙñòÙñòÙñòÙñò×ðñ×ðñ×ðñÖïðÌÌÎ××Ú³³¶ªª¬°°²¬¬¯ššœ””–¡¡¡¥¥¥£¤¦¤¥©˜œ¤‚…‘WZiTVhpr„\^m~Žffs““ŸZZe‰‰–¡¡­¤¦¶twˆEH]FHaLPjGJh?Fb;B^=Da=Da=Da=Da=D_>Ea>Ea=D_>E^:A[;?\@E^NQfcfx…‡”£¦±ŒŒ—€€Œww‚„„�{{‡‹��œŽŽš˜˜¢´¶»³´º³´º¤¥«�‚ˆ¤¥«¡¢¨´³¸³²·±°´·¶ºÌËϽ»À¾½Á¹¸½¿¾Â»º¿ÆÅɘ—œÌËÏÂÁÆìëðáßæÄÂÌÇÆÏ¶¶¿°³¾y€‹‰“�ë÷ÿãôûãùþáûûâúûâúûãûýãûýâýýâýýâûùâûùâûùâûùáúøáúøáúøáúøßøùßøùßøùßøùÞ÷øÞ÷øÞ÷øÞ÷øÛööÛööÛööÛööÚôôÚôôÚôôÚôôÙñòÙñòÙñòÙñò×ðñ×ðñ×ðñÖïðÄÄÆÌÌÎÏÏÒ¸¸ººº½³³¶ÂÂŬ¬¯˜˜˜���“”–—˜œœŸ¨‡‰–LN]IL]qs‚lo~kjzNM]FFSOO\eeq~~‹y{ˆ…‡–_cw>@XOTmFIfAHd>Ea>Eb>Eb>Eb>Eb9@\:A]>Ea>Ea=D]=D];?\HMfHLa\_q�„�¬°º¯¯º““ž††‘‰‰•ŽŽšˆˆ”——£ˆˆ”��¦¥¦¬¯°¶²³¹¸¹¿š›¡�Ž”°±·´³¸¹¸½±°´º¹¾ÅÄÈÇÆË½»À¹¸½ÅÄÈÈÇÌÅÄȤ£¨¨¦«ÖÕÚãâæÝÜãÔÓÜËÉÓÀÀÉÍÐÛ–›¦�—¢ÈÎÜë÷ÿãùþãûýâýýâýýâýýâýýãûýãûýãýúâûùáúøáúøáúøáúøáúøáúøßøùßøùßøùßøùÞ÷øÞ÷øÞ÷øÞ÷øÜ÷÷Ü÷÷Ü÷÷Ü÷÷ÛööÛööÛööÛööÙñòÙñòÙñòÙñò×ðñ×ðñ×ðñÖïðÀÀ··¹ËË;¾À¨¨ª¶¶¸ÈÈËÇÇɲ²²ªªª¬­°Ÿ¡¤˜œ¤›�ªGIXIL]SUdehw„‚“XWhML\^^k]]ipp{Ž‘œ¯±À“–ªILdINhHLiAHdAHd?Fc>Eb>Eb>Eb:A]:A]=D_>Ea>E^@Ga>A^AF_AEZ]arrt�{‰}}ˆˆˆ”���……���›——£¥¥±ŸŸ«¦¦°ª«±¸¹¿¶·½­¯´±²¸†‡�ª«±»º¿ÌËÏÂÁÆ«ª¯¹¸½ÍÌÐÄÂǺ¹¾·¶º½»À¾½Á±°´¿¾ÂßÞãÄÂÇÝÜãíìöÂÁËÇÇÐÐÐÜÅÇÔ�”Ÿª¯½ëôÿåùþâúûâýýâýýâýýâýýãûýãûýãýúâûùáúøáúøáúøáúøáúøáúøßøùßøùßøùßøùÞ÷øÞ÷øÞ÷øÞ÷øÜ÷÷Ü÷÷Ü÷÷Ü÷÷ÛööÛööÛööÛööÙñòÙñòÙñòÙñò×ðñ×ðñ×ðñÖïðÁÁĺº½ÅÅǾ¾À��“¥¥¨»»¾ÁÁÄÅÅž¾¾³´·°±´¬°¸”–£LN]OQc\^macr…„”ji{TScbboZZejjs¯²ºº½É_ctVZo@E^>A^FMiBIeBIf?Fc>Eb>Eb:A];B^=D_=D_?F_>E^@Da@E^GJ_\_q{~‹z~ˆss††‘……�‹‹‹–˜˜¤““ž��›¤¤­ÍÎÔ»½Â³´º¤¥«Ÿ¡¦­¯´�ž¤±°´¿¾ÂÏÎÓ­¬±±°´ž�¢¯­²ÂÁÆ¿¾Â³²·¸·»«ª¯º¹¾¿¾ÂÍÌÐ÷öýÙ×áÄÂ̽½ÆÆÆÒ××äšœ©�“¢ÉÐÛèùÿâúûâýýßþýßþýâýýãûýäûýãýúâûùáúøáúøáúøáúøáúøáúøßøùßøùßøùßøùÞ÷øÞ÷øÞ÷øÞ÷øÜ÷÷Ü÷÷Ü÷÷Ü÷÷ÛööÛööÛööÛööÙñòÙñòÙñòÙñò×ðñ×ðñ×ðñÖïðÇÇÉÄÄÆ½½¿½½¿¦¦©¹¹»±±³³³³ÁÁ¿ÇÇDz³¶°±´ªª³¡¡­NM_IL]UWiik}PObqp‚edt^^kaaljjs­­·©¬·}Ž{}‘SUmFHcHLiGJhDJfAJe>Gb>Ea:A];B^>Ea=D_?F_9@Z@DaFJd=?WLOc~‚Žwz…ooz‚‚Ž——£���‚‚Žˆˆ”––¢……�–—�•–œ³´º¿ÀÆŒ�“¡¢¨½½Æ¦¨­¨¦«ÅÄÈÎÍÒ´³¸¬«°·¶ºÀ¿Ä²±¶»º¿ÅÄÈÇÆË¶´¹À¿ÄÎÍÒÜÛßÔÓ××ÖÝãâé¿ÀƬ¬¶ÀÀÌ´´ÁŒœ¡¬áð÷åùûâúûâýýâýýâýýãûýãýúãýúâûùáúøáúøáúøáúøáúøáúøßøùßøùßøùßøùÞ÷øÞ÷øÞ÷øÞ÷øÜ÷÷Ü÷÷Ü÷÷Ü÷÷ÛööÛööÛööÛööÙñòÙñòÙñòÙñò×ðñ×ðñ×ðñÖïð‘‘‘ÀÀÀ«««ËË˾¾¾ÁÁÁ¹¹¹½½½ÄÄÁ¿¿¿ÎÎЭ¬³¯¬¹Ÿ�­PMaNMbHF]qo†\[pzyŒ€�\\i‚‚Žllv}~„‚‚Œ˜˜¤­¬½�›²NLeNLhJMjJTlGTkANe=F^=D]:A[;?\=@]?D]?D]?B_?B_AF_?DXfmx~„‹swvvŽŽ—~~‡���ww„žž«‡‡“��–¥¤«‹‰“£¢«“‘˜œ›¤¯¬¹¡Ÿ©¢¡¥²²´ÏÏÒÀÀÂÆÆÈ±±³££¥±±³½½¿ÈÈËÇÇÉÂÂÅÄÄÆÇÇÉÍÍÏÌÌÎñðôöôùÈÇÌ­¬³¿¾ÅÅÄÍ‘�œ–š¤¸ÂËæöýäöùëÿÿãýúãþûÞýùâþøäþùãýøâû÷âû÷áúöáúöáúöáúøßù÷ßù÷ßù÷ßù÷ÞøöÞøöÞøöÞøöÝ÷ôÝ÷ôÝ÷ôÝ÷ôÜöóÜöóÜöóÛôòÚóñÚóñÚóñÚóñÙòðÙòðÙòð×ñïxxxÌÌÌÒÒÒ¶¶¶ÌÌÌœœœ‡‡‡°°°¦¦¤¢¢¢¸¸º²±¸°­º¢Ÿ­OL_LH^VTkWUlMLahfy˜˜¥ddpœœ¥ss}iho…„‹¥¤­±¯½ÉÆÚ‰†�XToTTpDMeN[rDPh>G_:A[:A[>A^>A^?D]?D]?B_?B_BFc=AXZ_my~ˆtx‚ppyˆˆ‘‰‰•““Ÿ‹‹—zz‡””Ÿ�Ž—Ÿž¥–•ž�Œ••”��Ž—¶³À»ºÄš˜�²²´ÁÁĸ¸º¿¿ÁÇÇɬ¬¯¡¡£»»¾ÆÆÈ¾¾ÀÁÁÄÀÀÂÅÅÇÌÌÎÇÇÉããåÂÂÅÒÐÕ·¶ºÀ¿Æ¿¾Å«ª³ŽŽ—¢©²áëóåöùéúþåýûáúøâÿúÞý÷ãÿùãýøâû÷âû÷áúöáúöáúöáúößù÷ßù÷ßù÷ßù÷ÞøöÞøöÞøöÞøöÝ÷ôÝ÷ôÝ÷ôÝ÷ôÜöóÜöóÜöóÛôòÚóñÚóñÚóñÚóñÙòðÙòðÙòð×ñïllj––”ÏÏÍ¿¿½¸¸¶~~{……‚¿¿½¡¡žžžœ££¥±°´©¨±«©¶HFTOM]XWjXWjSQb\\itt�ww‚{{…fhmomt–•œ¯­·¾»È½ºË²¯Â[WmVWpBIcQ[vISmBIe=D_>A^?B_>A^?D]?D]?D]?D]?B_BG^MSasx„xz‡zz‡Œ––£{{‡šš£……Ž‚‚Žzx…˜–£�œ¥—–Ÿ—–Ÿ–•žª©°ÇÆÍ°¯³³³¶««­±±³²²´««­¿¿ÁÆÆÈ³³¶ÁÁÄÇÇÉÁÁĹ¹»½½¿ÈÈËÈÈ˽½¿ÇÇɸ·»ÁÀʏ¿ÉÈϹ¸Á‹‹”Œ�›ÆÐÙíúÿèùýåùùåÿýßûöáÿùãÿùãýøâû÷âû÷áúöáúöáúöáúößù÷ßù÷ßù÷ßù÷ÞøöÞøöÞøöÞøöÝ÷ôÝ÷ôÝ÷ôÝ÷ôÜöóÜöóÜöóÛôòÚóñÚóñÚóñÚóñÙòðÙòðÙòð×ñïaa^yywÙÙÖËËÈÈÈÆ……‚wwt¡¡žŸ¡œ´´²���ŸŸ¢¦¥¬œ›¤VTaLIVNN[UUbPP\EEPaalMMVMNThiokjož�¢½»Â£¢«ÄÁÏ»¹Éws‡QPeFJdMTpNUqHLiEHeAEb>A^=A[?D[?D[?D]?D]?B_DHbBHXqv�sv‚qq~wv†——¤……Ž‹Œ‘��˜””Ÿqo}Œ‰–¥¤­¨¦°�›¨›š£��–»º¿¸¸º¸¸º»»¾ÄÄÆ»»¾´´·²²´íí𸸺ÅÅÇÂÂÅÅÅǽ½¿´´···¹¹¹»¨¨ªÉÉÌÄÂǺ¹¾±°·¸·¾ÈÇОž¨‚‡‘“š£Üéíâòöæúúãúùãÿùâþøäþùãýøâû÷âû÷áúöáúöáúöáúößù÷ßù÷ßù÷ßù÷ÞøöÞøöÞøöÞøöÝ÷ôÝ÷ôÝ÷ôÝ÷ôÜöóÜöóÜöóÛôòÚóñÚóñÚóñÚóñÙòðÙòðÙòð×ñïVWSopk½¾¹½¾¹��Œvwr€�}”•�‚„²³¯³³±„„„¡¡£Œ‹�–•œkjqddmTT]TT]OOXZ[aTU[NOSdeiomrˆ‡Œ¥¤©£¢©ÂÁ˦¤±qo}edtSVk?D]OTmOTmHLiBFc;?\>B\?DX?DX>BZ>B\AEb>B\?EWz�sv‚oo{ml}��š––Ÿ‚„‰��¦““ž��›rp}�Ž—±°¹°­ºž�¦Œ‹‘�Ž“±±³ÁÁÄÄÄÆºº½ÆÆÈÆÆÈÉÉÌÌÌθ¸ºÌÌÎÇÇÉÅÅÇÀÀÂÀÀºº½²²´ºº½èèêÜÛß¿¾Â½»Â¸·¾ÍÌÕÈÈÒ‡‹•y€‰©³¹íúÿä÷÷åýûäþùáý÷åÿúäþùãýøãýøâû÷âû÷âû÷âû÷ßù÷ßù÷ßù÷ßù÷ÞøöÞøöÞøöÞøöÜöóÜöóÜöóÜöóÜöóÜöóÜöóÛôòÚóñÚóñÚóñÚóñÙòðÙòðÙòð×ñïTUPbc^}~y«¬¨¢£žbc^‡ˆ„stpklh‹Œ‡‹‹ˆ€€~€€€‡‡‰°°²°¯³ijm]^bXZ]deiZ[^\]aTUXefjooqwwy¹¹»œ›Ÿ¹¸¿Œ‹”°¯¸††“cewLOdPTiPSkOQlIMj?B_>B\?DX@EZ?D[?D]?B_?D]BH[jo}€‚�{{ˆddqxx…œœ¨††�‘‘›˜˜¤£¡­“��xw€�Ž—°¯¸±°¹˜—ž†…Œ«ª¯»»¾ÄÄÆÉÉ̾¾ÀÌÌÎÈÈËââäÍÍϸ¸ºËËÍÉÉÌÇÇÉÂÂÅÁÁÄÂÂÅ»»¾ÀÀÂÄÂÇÈÇÌÇÆÍ¨¦­ÒÐÚÅÅΟ£­{€‹†�”Ôáååøøåùùãýøãÿùåÿúäþùãýøãýøâû÷âû÷âû÷âû÷ßù÷ßù÷ßù÷ßù÷ÞøöÞøöÞøöÞøöÜöóÜöóÜöóÜöóÜöóÜöóÜöóÛôòÚóñÚóñÚóñÚóñÙòðÙòðÙòð×ñïUVOef_lmf©ª£‰‹„WXQ„…~mohde^stpjkfddbaa^eeeŸŸŸŽŽŽijljkm^_b]^aefi„…‡LMOijlrrtkkkžžž‹‹�——šjimfel…„�}}ˆfivUWiPQfPSkOTmDGd;B\@EZAGZ@E\?D]?B_@E^BH[SWey}‡yy‚mmwww‚……‘��Ž……‘šš¥�Œ•Ÿž¥Ÿž¨‚�‹”“œ³²»š—¤Œ‹”¤£¨»»¾ÅÅÇÕÕ×ÏÏÒÆÆÈÔÔÖÈÈËßßâ»»¾ÍÍÏÇÇÉÈÈËÌÌÎËËÍÆÆÈÂÂÅÎÎÐÇÆË¬«°¶´»«ª±º¹ÂÎÎ×¾ÁÌ{€‹‚‰�Ÿ¬±ãóôæúúæþúåÿúåÿúäþùãýøãýøâû÷âû÷âû÷âû÷ßù÷ßù÷ßù÷ßù÷ÞøöÞøöÞøöÞøöÜöóÜöóÜöóÜöóÜöóÜöóÜöóÛôòÚóñÚóñÚóñÚóñÙòðÙòðÙòð×ñïUVQ[\Wfhclmffha^_Xef_cd][\U^_[^_[Z[ViifccaŽŽŒttrceddfe]_^TVUehf{}bcekmlsssiiilll‘‘‘}}}vvxxxz{z‰ˆ�€�‡ddpVXhTUjTVoINh@E^AGZAGZ@EZ?D[?B_@E^>BWBFWkmz€€‰llvxx„‡‡”jiytt�‚‚މˆ�–•œŸž¨¨¦°zy‚ˆ†“ŽŒš…‚�”“—¤¤¦··¹ÄÄÆÎÎÐÎÎÐÐÐÓ××ÚÔÔÖÛÛÝÏÏÒÎÎÐÏÏÒÌÌÎËËÍÍÍÏÅÅÇÈÈËÂÁƾ½Ä´³º·¶½²±ºÒÐÚÒÒÝŒ�š„‰�~ˆŽÞïðêýýêÿþãýøåÿúäþùãýøãýøâû÷âû÷âû÷âû÷ßù÷áø÷áø÷áø÷ß÷öß÷öß÷öß÷öÝôóÝôóÝôóÝôóÝôóÝôóÝôóÜóòÛòñÛòñÛòñÛòñÚñðÚñðÚñðÙðïOOM[[Xiif…†�klhefbcd]cd]NOJTTQUUSQQOppmppmXXVddbjjhbb_[[XWWUffdjjjjjjffdhheddbaa^^^\iifxxxqqqttrmmmomr__iPO_LMbGIbAD\AEVLOaNQf?AZAD\?AZ?BWBFZacr††‘}}ˆkkx‰‰–ˆˆ•ddq‹ŽŽ—‡‡���˜˜˜¢ªª¶‹‹—˜˜¥��˜�Œ�žž¡°°²ÀÀÂËËÍÀÀÂÏÏÒÔÔÖÈÈËÛÛÝÅÅÇÒÒÔÆÆÈÇÇÉÆÆÈÍÍÏÆÆÆËËÍÉÈϾ½Ä­¬±¥¤©³²»ÆÄÐÒÐÚ·¶¿‡‹“‘š�ê÷ùéûùéþúäý÷æÿùåþøäý÷äý÷ãûöãûöãûöãú÷áøôãøôãøôãøôâ÷óâ÷óâ÷óâ÷óáöòáöòáöòáöòßôñßôñßôñÞóðÞóðÝòïÝòïÝòïÝòïÜñíÜñíÜñíSSSNNNkkissqqrm]^Zbc\ijeQQOLLIZZWMMJbb_ŽŽŒ^^\ZZWiifbb_\\Z[[Xbb_hheaa^ddbeecVVTddbaa^__]eeceecmmksrojieiii…„ˆ__kTScTVhQUfLP\UZeUXjEH\AEZ?AZ?BWBDXIHXlly††“}}‰‚‚Ž©©´¤¤°„„�__kppyˆ””Ÿ••¢””¡¡¡­ªª³��”žž¡´´···¹ËËÍÉÉÌÅÅÇÎÎÐÇÇÉÛÛÝÍÍÏÓÓÕÄÄÆÉÉÌÓÓÕÝÝßÚÚÚÆÆÈÆÅÌÄÂÉËÉÎ�œ¡¯­·¿½ÉËÇÒÖÕÞœ�£�•šßíìëþûéþùæÿùæÿùåþøäý÷äý÷ãûöãûöãûöãûöãøôãøôãøôãøôâ÷óâ÷óâ÷óâ÷óáöòáöòáöòáöòßôñßôñßôñÞóðÞóðÝòïÝòïÝòïÝòïÜñíÜñíÜñíJJJMMM]][hhefhcbc^_aZfhcTTQOOM__]TTQUUS‚‚€~~{SSPbc^]^Z[\W\]Xbc^efb^_[efbiifPPN]][eechhemmkjjhddbppmbb____�Ž�{}‚^^hZZeX\dU[_\biZ^jFI[@DW@DXBF[HI^TSeiivzz‡ww‚��–£¤ª²³¹ÅÆÌ‰‰•bboZZf��Ž““žŽŽ—““œ¶¶¿¶´¹œœž¸¸º¸¸ºÂÂÅÒÒÔÂÂÅÐÐÓÔÔÖÔÔÖÓÓÕÐÐÓÇÇÉÆÆÈÈÈË¥¥¨···»»¾ÄÂÇÉÈÍ¿¾ÂÇÆË›š£²±ºÍÉÔ¾½ÆÀÁÇŽ”˜Üêéåøöéþùäý÷æÿùåþøäý÷äý÷ãûöãûöãûöãûöãøôãøôãøôãøôâ÷óâ÷óâ÷óâ÷óáöòáöòáöòáöòßôñßôñßôñÞóðÞóðÞóðÝòïÝòïÝòïÝòïÜñíÜñíAAALLLUUSccabc^Z[V^_Xab]WWUXXVUUSNNLXXVeec““�LLI[\WWXTWXTZ[V_a\\]X\]X_a\^^\ZZW]][eeceecmmkjjhZZWffd[]\^a_vxwˆ‰Œklo]^bZ[]X]\]bcX\dDFS@BTDEZLMbTVhLJ[aam~~‰€€‰…†Œ¡¢¥¶·¹ÆÇËÆÆÒ……‘XWhbbo‹‹”„…‹——¡¤¥«ž�¢¥¥¨¨¨ªÀÀ¶¶¸»»¾ËËÍÌÌÎÀÀÂÌÌÎÆÆÈÆÆÈÎÎÐÉÉÌŽŽ�yy{‹‹‹¨¨ªÂÂÅÀ¿Ä¿¾ÂÕÔÛ«ª±“‘›¹¶ÀÏÎ×Ö×Ý•›ŸÍÛÚèúøêÿúèÿúæÿùåþøäý÷äý÷ãûöãûöãûöãûöãøôãøôãøôãøôâ÷óâ÷óâ÷óâ÷óáöòáöòáöòáöòßôñßôñßôñÞóðÞóðÞóðÝòïÝòïÝòïÝòïÜñíÜñíHHHNNNVVTffd]^ZNOJQSL_a\WWU\\ZPPNPPN^^\cca}}zVVTXZU_aZWXQ_aZab[\]VZ[T_a\bb_]][ZZW^^\eeceecddbUUSX[ZX[Z^a_ceddddiiihheTVSTVQ[]Z^_cQQ[IIVEDTML\^]m]]jaaliir�‚ˆ}~�‰‹�¯±°¾¿ÁÉÉÓÎÎÛ‡†–QQ^qqz˜šŸ˜˜¢��–~}�ÅÅǬ¬¯¿¿ÁËËÍÀÀž¾ÀÍÍÏÆÆÈ¸¸º½½¿ÎÎÐÍÍÏÓÓÕÎÎÐÌÌί¯±¾¾ÀÉÈ͸·¾½»ÂÐÏÖ“‘˜¹¶ÀÍÌÕÜÝãÍÓ×Õãâéûùæû÷ãûöæÿùåþøäý÷äý÷ãûöãûöãûöãûöäùöäùöäùöäùöãøôãøôãøôãøôâ÷óâ÷óâ÷óâ÷óßôñßôñßôñÞóðßôñßôñÞóðÞóðÝòïÝòïÝòïÝòïOOOGGGQQO]][VWSMNIUVOab]]][__]__][[XVVTaa^aa^]][TUPhibUVObc\bc\]^WWXQ^_[[[X]][VVT]][eecddbddbVXWSWXX]^[\^bdcbbbccalljWXTZ[Vbd_abdTU[JJTFFQJJVWWcaajijp\]c€„z{~}~¥¨¦±²´ÁÁËÐÐÝÍÍÚss€^^j››¤››¤¢¢«š˜�¿¿Á³³¶ÅÅdz³¶ÈÈËÂÂÅËËÍÓÓÕÒÒÔªª¬ŸŸ¢¹¹»ËËÍÓÓÕÔÔÖããåééë··¹ÄÂÇËÉв±ºÂÁȯ­´¯«¶ÁÀÉÎÏÕÙÞãÛéèèúøæû÷äý÷æÿùåþøäý÷äý÷ãûöãûöãûöãûöäùöäùöäùöäùöãøôãøôãøôãøôâ÷óâ÷óâ÷óâ÷óßôñßôñßôñÞóðßôñßôñÞóðÞóðÝòïÝòïÝòïÝòïZZZPPPQQOOOMPQMNOJWXQ^_[[[X^^\__]\\ZVVTcca^^\ZZW_a\de^XZSde^ab[_aZbc\TUPZZW]][\\Z__]cca__]aa^VXWUZ[PUWNSUcdfiik]]]cab[ZWVWSccaddd\[_WV]TSZSQVTSW]^bvwycdfqrttwvwyx›�œ˜šœ©ª°ÉÉÓ××á¾¾É[[hxx…ˆˆ•””�‰ˆ�½½¿ÝÝߢ¢¤°°²¾¾ÀÌÌÎÂÂÅËËÍÒÒÔ¦¦©––˜½½¿ÆÆÈÕÕ×ÚÚÜææéææéÛÛÛ¿¿ÁÍÌÕ¿¾ÇÍÌÓÈÇΣŸª·¶¿ÀÁÇÝãèáïíèúøèýøåþøæÿùåþøäý÷äý÷ãûöãûöãûöãûöäùöäùöäùöäùöãøôãøôãøôãøôâ÷óâ÷óâ÷óâ÷óßôñßôñßôñÞóðßôñßôñÞóðÞóðÝòïÝòïÝòïÝòïXXXaa^XXVTTQOPLOPLWXQZ[V[\Weec__]bb_[[X__]XXVUVQbc\de^STMXZSde^cd]]^WUVOWXTSSP]][XXV]][XXV[[XTVSNSTGLMEIJ_acaac]]]b_a_^\VVTcca^^^VVXTTVWWZZZ\WWWZ\[fih_ba_bafihqsr��Ž�‚…‹Œ‘ÅÆÌÖ×ÝÒÓÙ¥¥±vv�eeq‡‡“‡†��Ž“âá囚ž´´·ÅÅÇÍÍÏÈÈËÈÈËÒÒÔÍÍÏææéÒÒÔÍÍÏÌÌÎßßâååèññóäääÇÇÉÆÅÌÐÏÖÈÇÎÄÂǽ¹Á­¬³ÅÆÉÎÔÖßëëé÷ôêûøêýùéþùåþøäý÷äý÷ãûöãûöãûöåúöäùöäùöäùöäùöãøôãøôãøôãøôâ÷óâ÷óâ÷óâ÷óßôñßóóßóóÞòòßôñßôñÞóðÞóðÝòïÝññÝññÝññUUS\]X_a\UVQQSNIJFOPL\]XZ[V]^Z^_[]^Z]^ZWXTZ[VXZUab[de^[\UMNG^_XWXQZ[TZ[TVWSWXT_a\XZUab]QSNXZU\\ZNPMVXWGIHXXXeee^^\aa^ccaUUSeecddbZZZSSS___[[[OOO[[[hhhXXVddbjjhyyw‡‡‡€€‚Œ‹�¿¾ÅÒÒÔÈÈ˶´¹£¢¦~}„^]fvs€ˆ†“Ÿž¨“‘˜ž�¢ÞÞáÒÒÔÌÌÌÇÇÉÅÅÇßßâÉÉÌÖÖÙÐÐÓÒÒÔÙÙÛÞÞÞêêêêêêÕÕÕÅÅÇÈÈË××ÚÀÀÂÀÀ··¹½¾ÀÉÎÏËÒÒÙßÝìöòìøôêýùéþùèýöåúóéþ÷åúóäùòäùôãööä÷÷ä÷ôåøöãöòåøôåøôâôñâôñâôñâôòáóñáóóáòöáòöáòöáóñáóðáóñáóñßòòßñôßñôßñôOPLUVQ]^ZZ[VHIEEFAMNIXZUTUP]^Z^_[WXT^_[XZUTUP]^Z\]V]^WXZSEF?WXQUVOZ[TZ[TXZU]^Z[\WZ[V^_[STOQSN]^ZSSP\\ZPPNVVTZZWQQOWWU\\ZPPNXXViif^^\LLIUUSWWUSSP^^^cca_a\cd_rsowxsttrqqs{z—–›¤¤¦‚‚‚ŸŸŸ¹¹»˜—œ�€‰dbp}zˆ‡…‘�Œ•–•œ©¨¬ÂÂÅÀÀÀÇÇÉÐÐÓÖÖÙºº½ÏÏÒÛÛÝÈÈËÉÉÌÝÝÝ×××ßßßÖÖÖÄÄÄÍÍÍÌÌÌÅÅÅÁÁÁÇÇǰ²±ÅÇÆÅÉÈÂÇÆìñðïøôìþúêÿúéþ÷éþ÷åúöèýøåúóâ÷òæù÷åøøãöóâôòæùöãöòâöïåøôâôñâôòáóñßòòáóóáòöáòøáòöáóñáóñáóñáóóßòòßñôßñ÷ßñ÷IJFQSN^_[^_[JLGBD?GHDTUPSTO\]X]^ZVWS^_[XZUTUP]^ZZ[T[\U]^WGHAVWPVWP[\UXZSXZS^_XZ[TXZS\]VNOHOPI^_[]^ZZ[VQSNSTO^_[QSNSTOXZUQSNWXTjkfXZUMNIQSNZ[V[[X__]eec_a\de^fhadeappmlllihl~}�rrp€€~¥¥¥‰ˆ�£¢©ecpb_lljw´³½´³º�œ¡±±³––˜´´·ÕÕ×ÛÛÝÜÜÞÍÍÏÖÖÙÈÈËÐÐÓÓÓÓÐÐÐÜÜÜÓÓÓÍÍÍÔÔÔÆÆÆÈÈÈÆÆÆ¾¾¾‹�Œ¹»ºÎÓÒÁÆÅ×ÜÛôþúìþøèûôåøôåøôéûùåøöä÷ôæù÷âôòãöóåøôæùöãöòåøôåøôâôñä÷ôãöóâôôâôôáóóáòöáòöáòöáóñáóñáóóáóóßòòßñôßñôßñôHIETUPbc^^_[MNI>?:EFA[\WXZU\]X]^Z\]X]^ZWXTZ[VXZU^_X^_Xbc\STM[\U[\U]^WVWPZ[T]^WZ[TUVO[\UHIBQSL_aZUVQWXTWXTQSN\]XOPLSTO]^ZPQM\]XijeXZUVWSUVQbc^^_[ccaab]fhacd]bc\de^efb___aacqqsmmmhheqqo{{~ÂÁÆ{z„\[d[Zcdcjjimˆ‡Œ¨¨ª••—««­ËËÍÇÇÉßßâÔÔÖÕÕ×ÕÕ×ÓÓÕÙÙÙÙÙÙßßßáááÔÔÔÍÍÍÕÕÕÌÌ̹¹¹ÉÉÌœ�Ÿ²³¶³¸¹ÐÕÖÌÐÒéððíûùëûúìýûéùúéùýéøÿè÷ÿåôûå÷úä÷÷ä÷÷ãöóä÷ôâôòâôñä÷ôä÷ôãööãööâôôáóóáóóáóóáóóáóóáóóáóóáóóßòòßòòßòòßñôIJFIJFZ[V\]XLMH9:6BD?]^ZVWSUVQXZU\]X[\WZ[V^_[WXTab[\]V]^WXZSNOHTUNXZSXZSZ[Q]^UbcZ\]T\]TTULWXOZ[TSTMXZS]^WLMFZ[T[\U_aZbc\OPI]^Wde^bc\^_XWXQab[]^Z[\W^_[hibde\abX_aZ]^Zbb_VVXjjljjh_a\jkfccahhj¦¥ªÌËÏŽ�”•”›zy~~‚ªª¬¥¥¨bbd­­°¾¾À¤¤¦¾¾ÀÀÀÂÍÍÏÓÓÕÒÒÔÜÜÜåååßßßâââÜÜÜÔÔÔÈÈÈÁÁÁÆÆÈÅÄÈ�ž¢°±´­²´ÂÇÉÛßââèêêôøéöúÕâé·ÂÌ—£±—¢´š£¹¡«¾·ÅÓ°À˺ÌÓÍÞäâó÷áóóÝðíä÷ôÝððáóóáóóßòòáóóáóóáóóáóóáóóáóóáóóáóóáóóáóóáóóáóóLMHLMH\]X^_[QSN?@;EFA[\WOPLQSNZ[VVWSZ[VZ[VZ[VUVQ\]V[\U]^W\]VJLEPQJUVOUVOWXO\]TabXZ[QQSITULXZP[\SOPIWXQbc\UVOTUNWXQ[\U[\UNOHde^ab[[\U\]VUVO]^WXZS\]Xcd]Z[Q]^Ucd[]^UZ[T__]ZZZfffbb_Z[V_a\bb____‹‹�žž¡¶´¹²±¶‰ˆ�~~€œœž¸¸ºkkm‚‚…��‘œœž¨¨ª´´·²²´½½¿ÍÍÏÐÐÐÚÚÚßßßéééæææÛÛÛÌÌ̸¸ºÎÍÒ¿¾Â¡¢¥©ª­«°²´¹»ÎÓÕáæëÏÖÝÇÎ×­´¿Ÿ¥¶¬±Æ�¢»„‡¤„‹¦„�¥€�Ÿ‹›¨—¨²¨¹ÀÆ×ÝÜíñÞðóäöùâó÷ßñôÞññáóóáóóáóñáóñáòöáòöáòöáóóáóóáóóáóñáóñVWSQSN[\WZ[V[\WGHDHIEXZUNOJSTOZ[VXZUZ[VVWSXZUOPLWXQXZSWXQXZSGHAMNGPQJQSLSTJ[\S_aWUVMMNEQSIUVMZ[Q\]VQSLXZSXZSVWPZ[TXZSUVOOPIde^^_XWXQ\]VTUN[\UUVOZ[VZ[T]^U_bU^aTbcZUVOaa^\\\bbb\\ZXZUbc^iif^^^iiikkk�´´·¡¡£‡‡‰œœž¥¥¨jjl‡‡‰ÄÄÆ””–††ˆ••—¹¹»¹¹»��„‘‘‘ÒÒÒðððÔÔÔÙÙÙåååÙÙÙÆÆÈÂÁÆÎÍÔš›¡¬­³°³¹¥©¯»¿ÅÞâèëñóÖÜáÇÌÖ¸½Ëßãø±³Î�Ž­„‹¨~‹¢z‰›}Œ�ŽŸŽž­�¡­¢²¿¾ÎÙÙêñãôúáòöÝððáóóáóñáóñáóñáòöáòøáòöáóóáóóáóñáóñáóðWXTTUP]^Z\]Xab]MNIJLGWXTIJFPQMNOJ[\W[\WPQMZ[VIJFUVOVWPOPIPQMDE@IJFNOJNOJPQJZ[Q^_VSTJOPGOPGNOFXZP[\UNOHUVOVWPIJDSTMWXQUVOPQJ\]V_aZZ[T^_XUVO[\UTUP\]XZ[V_aWcd[WXO\]Tab]^^\]][aa^\]X^_[dealmieecbbbTTQddb———¢¢¢}}}«««›››SSUyy{»»¾……‡ppr€€‚¾¾À˜˜›†††ppp¶¶¶äääíííæææâââÝÝÝÏÏÏÄÂÇÄÂÇÁÂÆŽ�“±²¶—˜œ¨©¬ÒÖÙèìïÓ×Ú»¿Ç½Á͸»Ïœž·€‚Ÿ�…¢}†ž{ˆ�{ˆ�y†›x…š}‰žˆ•ª•£´¡¯½ËÜãáòøáòöáóóáóñáóðáóðáóóáòöáòöáóóáóóáóñáóñáóñSTOVWSWXTUVQUVQVWSPQMXZUGHDJLGOPLab]LMH[\WPQMIJFQSNMNISTOTTQIIGNNLLLLMMJSTOSTMUVOUVOQSLWXQSTMVWPVWPPQJOPISTMGHAQSLPQJSTMUVMUVM\]V^_XXZUUVQUVQMMJTTQZ[V]^W_aZab[[\UXZU^^\[[X\\Zdeade^ab[lmiffd__]UVQZ[Tjkf}~yool‚‚€iifXXXlll¡¡¡���ŒŒŒ•••žžž~~~hhhddb““�¸¸¶ÎÎÌååãÕÕÓÖÖÔ¯¯¬ÇÇǺº½ÐÐÓ±±³©©«ŸŸ¢��Ÿ¥¦©ÍÎÒæèí¯¯¸©«¸›�¯Ž�¥†‡Ÿ„†¡ˆ�¤”˜­Ÿ¤»¤©À“—¯‰Ž¨„�t{•…�¢¤²ÂÕåðáòøÞòòßôðßôíãøñâôñãóòãóòãóôâòóâòöâòöâòöJLGPQMVWSVWS[\WXZUNOJSTOGHDIJFUVQ_a\LMHWXTNOJEFAQSNLMHNNLUUSLLLLLLGGIJJJOPLPQJTUNTUNSTMMNGZ[T[\UVWPPQJOPISTMNOHLMFSTMOPIUVMUVMXZS]^WVWSTUPOOMHHFPPNXXV]^Zab[cd]^_[XXV]][^^\__]^_[^_XUVO^_[XXVTUPQSLVWNcd]mohbc^xytffd\\Z___qqq‡‡‡†††vvvmmm\\\^^\qrm¦¨£‰‹†×ÙÔ«¬¨ÄÅÀ��‹ÌÌÌ···ÎÎÎÐÐÐÛÛÛ½½½ºººªª¬ÝÜãÒÐÚ¾¾É¬«»”–¨‡ˆ�ˆ‰¢‰‹£…‡Ÿ†ˆ¡�“«›�¶¢¤½–˜±Ž�©„ˆŸy‚˜‡•¦£±¿ÕæíÞðóÛðìáöïßôíâôñãóòãóòãóôâòóâòöâñøâñøFGBNOJTUPVWSVWSTUPJLGOPLPQMLMHZ[VTUPJLGVWSVWSNOJOPLMNIMMJSSPPPPGGG@@BGGGIJFQSLMNGUVONOHWXQ]^W^_XVWPPQJOPISTMUVOHIBOPINOHUVMUVMVWN[\UQSLUVQQSNPQMOOMVVTWXTZ[Tef_deaZZW^^\[[Xaa^XZU^_X[\U]^ZPPNJLGUVO\]Tab[bc\TUPefb[[XQQO\\Z__]eeeqqqxxxiiiqqsVVV\\Zffdlljyyw¶¶³{{y——•rrp´´´³³³ÆÆÆÁÁÁÈÈȬ¬¬½½½»»¾âáèÇÅÒÍÌÜ–•¨‘“©€˜{{—„„¢€‚Ÿwy–~€›�‘ª£¦»²¶ÉŸ£´�–©€ˆœ{†˜‚�¡¬»ÆÚëñæùùãøôáöñâôòãóòãóôãóôâòóâòöâòöâòö@@>FFDJJHJJHVVTPPNBB@DE@QSNJLG[\WTUPJLGTUPUVQIJFIJFPQMNNLOOMSSSEEE::=EEEHIEHIEQSNQSNNOJQSNTUPZ[VVWSPQMOPLSTOXZUIJFJLGNOHJLBTULXZP]^WNOHSTOMNIJLGPPNPPNOPLPQJ]^Wbc^XXVVVT\\ZccaPQMVWPWXQWXTJJHGHDVWP]^U^_XXZSPQMcd_bb_]][TTQ\\Z___hhh[[[TTV^^aLLNNNNbb_ddbiif‚‚€eecmmk]][ŸŸŸ³³³ººº¾¾¾………{{{žžžÂÂÅÙ×ÜÆÅÎÆÆÒ°¯¿Ö×ì¿ÀÙ••±††¤wx—xy˜}œ€‚›‹Ž£”—©�¢°šŸ­�•©t‘w�“Œ›¥ÏÞæÜíóßñôä÷÷ãóôãóôãóôãóôâòóâòóâòóâòö>>>AAAMMMFFFHHHJJJAAA@@>PQMPQMXZUMNI@A=HIENOJEFAGHDFGBFFDGGENNNAAA99;>>>DDA@@>LLIMMJLLIJJHNNLOOMUUSMMJIIGPPN]][SSPJJHMNISTJWXO^_X^_XPQMEFAHHFIIGLLIPPNVWSSTM^_X]^ZSSPTTQUUS]][UVQUVOZ[TUVQHHFMNIWXQ_aWab[]^WUVQ\]XZZWPPNUVQXXVQQO[[[UUUMMOONSGGIPPPZZZZZZ\\\TTT[[[\\\iii‹‹‹Â–––°°°sss€€€ˆˆˆžžž½½ºÉÉÇÀÁÅ••žÅÇÖÐÒæ˜š²‡‡¥{}œxy˜xz•}—‚†š˜œ­šžª¨­»¢ª½‹“¦r}Žs�Ž�¨·ÆÐÜíôÛìòãó÷äôöãóôäôöãóôâòóâòóâòó666;;;GGG>>>DDDAAA>>>AAAMMJJLGPQMNOJBD?HIELMHDE@DE@EFAEEBDDASSSFFF88:::=;;;@@>??=IIGGGELLIGGEFFDOOMLLIFFDQQOXXVSSPNNLHIELMFSTJ\]V^_XWXTGHDFFDDDAGGEJJHQSNMNG[\U]^ZSSPOOMVVTXXVUVQPQJVWPLMHIIGSTO^_Xfh^fhabc\VWSQSNSSPXXVNOJTUPWWUPPPQQTGGIHGLA@ENNP[[[UUU___WWWSSS]]]ZZZbbbœœœ~~~jjjlllooo‚‚‚‹‹‹±²­ÇÈά«xy¦ª´}Ž�‚—xy‘rt�y{–{~–wz��…˜��¢šž¬£¨¶¢¨º�˜¬rz�lwˆr}ŽŒšª²ÀÎãóþâñøãó÷äôøâòóãóôãóôâòñâòñ>>@::=FFHFFHJJMHHJBBE999MMJIJFGHDDE@BD?FGBLMHGHDBD?FGBFFDBB@TTTJJJ88:99;888777>>>BBBLLLEEEGGGGGGJJJFFFGGGQQQQQQUUUOOODDAMNGPQHVWPVWPWXTIJFLLILLINNLLLIMNIHIB^_Xfhc\\ZTTQWWU[[XZ[VUVOWXQOPLHHFTUPbc\ijahibab[XZUFGBJJHXXVOPLXZUUUSNNNSSUPPSQPUDBGJJMUUWPPS^^aJJMHHJPPSbbd^^acceXX[VVX[[]ddf~~€‚‚…¯¯¯–––£¤¦mot��˜z~ˆoq~qs‚ps‡{”{”rv‹tx�„‡œ‚†›Ž‘¦—œ±�‘¦iq…fo‚s~�ˆ“¥—¥·ÄÒâÜëóâñøâòöâòóãóôãóòãóòâóð???>>>IIIGGI??A;;>AADAAAEEBHIEEFA?@;?@;BD?LMHMNIDE@IJFIIGDDAQQQNNN:::;;;777666===AAAJJJNNNMMMNNNGGG>>>JJJPPPMMMVVVLLLFFDGHDMNGUVOVWP]^ZOPLQQOQQOJJHEEBHIEFGBUVQbc^VVTJJHOOMZ[VVWSXZUQSNXZULLI]][^_Xde\cd]\]Vab]NOJNNLSSP\]XXZUXXVJJHQQQPPSUTXLJOFEIIHMNMQZZ\PPSMMOOOQ[[][[]]]___bWWZTTViikŽŽ�ooq‚‚…yy{ˆ‰�fhkz~„kotfjrilwoq~vx‡rt„fizwx�„…›~•„†žˆ‹£…‰¡vz�‰‘¤qy�py�ˆ‘ª˜¥ºÅÔÞÛêñßðóßðñâòóãóòãóòãóò480794BEALNM>?A236687FHE@@>FFDFFD>>;GGEAA?FFDHHFDDALLIJJHJJHVVT]][TTQFFD442997;;9@@>DDALLIJJHBB@BEAEGFILJEFHFGINPO@BAGIFDDAIIGUVQ[\WOPLLMH997???GGEBB@FFDEEB]][[[XQQONNLLMHSTONOJWWUSSPMMMIIIUUSef_de\ab[ef_cd_TUPMMJNNLWWU\\Z[[XTUPMMJNNLUUUSSUDEJEFLFGMVW[MNQIJNIJMUVX[[[QQQUUUVVVOOO]]]eeeeeeefi^_bijlabdcdhopshilefjdekqqzssjjwrq�‹‰œ˜—¬‡ˆž„„ŸoqŒcfzw}�{�”s{‘t{˜~‡¢�›¬ÌÙßßìïâðïäôöáñòãööáóóAE:AE=EGBDFE9:=013687ILHEEBLLIGGE886663@@>GGEEEB??=MMJPPNQQOaa^bb_XXVTTQ??=@@>;;9DDAFFDLLIJJHAA?JMIEGFGHJFGIDEGIJMJMLFHEFFFGGGVVTXZUQSNTTQ???;;;FFD@@>FFDNNLiif__]SSPSSPMNIOPLOOMJJHQQQFFFDDFBBBVWPab[ab[TUP\]XVVTMMJMMJSSSWWWPPNXZUIJFNNLNNNOOQFGMDDMGHNTU[NOSEFIEFHVWZSSSMMMTTTXXXQQQVVV[[[WWW^_bUVX^_b]^a]^abcebce]^abcfdei{}‚ffpvv‚�Œœ«ª½Œ‰¡‰‰¥ij‚advsx†£¦º{€—tx–t{—€ˆ›��¤ÛèêäòñãóôäôöÛííä÷÷BF;=@8>@;>@?78:-/1243BEAMMJOOMFFD220220??=EEBGGE@@>IIGJJHLLIUUSbb_ccaaa^OOMEEB997BB@DDALLIJJHBB@DFB>@??@B?@B:;>@ADNPOILHLLLNNNZZW\]XUVQOOMPPP@@@LLIMMJIIGJJHbb___]TTQLLIUVQMNIOOMNNLNNN===::=???PQMXZS[\WGHD\\ZLLIFFFIIIQQQWWWLLIXZUJLGOOMOOOJJMGHL@AGEFLNOSOPTFGIFGIWZXMMMHHHNNNTTTVVVUUUSSSWWWTUWUVX\]_VWZbce]^a]^abcebcfdeibci^^hhhsllyzy‰‹‰žˆ‰¢qrˆikzšœ©¬°Á–š¯qs�rw�r{‹v€ˆÅÒÔâðïáñôãó÷åö÷ßðñTWMNQI?A=@BA@AD347243?A>NNLIIG??=774>>;;;9==:JJHGGEHHFHHFQQOJJHQQOSSPXXV]][HHF774AA???=IIGMMJGGE:=9;>=@AD=>@;=?;=?EGFDFBGGGOOOOOMXZUWXTJJHJJJ???LLIHHFAA?GGEZZWTTQJJHJJHHIEHIEHHFGGE@@@;;;88:AAA\]XXZUXZUUUSLLI???IIIGGGJJJQQQQQO_a\QSNQQOSSSFFH@AE;=BBDGGHLPQTMNPMONX[ZJJJEEEIIINNNIIITTTTTTVVVOPSNOQTUWVWZXZ\_acXZ\[\^^_cefjfhmQSXeeoddpxx…†…•‘“¨z}Ž_bomq{��ž—˜­~—tx�qw…w�‰Ÿª­Üéëäñøâñøãó÷áñò[^TOSJ8:68:9@AD124364>@=LLIJJHAA?::8HHF;;9??=QQOBB@??=QQOSSPNNLOOMOOMNNLZZWEEB::8EEBEEBFFDLLIPPN9;80219:=46801389;>@?@B?FFFQQQSSPNOJXZUSSP>>>BBBOOMLLIGGEFFDOOMHHFBB@BB@EFA?@;AA?DDADDD???::=EEEPPNPQM[[XAA?>>>:::FFHPPSFFFMMMNNLXZUSTOMMJSSSIIL?@D:;?GHLSTVIJMMONNPOUWTOOONNNFFFMMMHHHQQQOOOQQQLMONOQOPSMNPXZ\]^aVWZPQTVWZVW[^_c]^b[\b_afffpmmyz}‰acp[^feiqmp}‰ˆ˜{z�oq‚lq{ipw‡�“ÅÏÕáëóÞëòßìñéöúTWMLOGDFA;>=@AD679132@B?LLIQQOGGE774MMJEEBAA?NNLEEBAA?PPNLLIWWULLIFFDIIGVVTAA?442??=BB@IIGJJHTTQ>@=79889;/02124>?A?A@GIFGGGEEEHHFQSN[\W^^\LLLLLLLLIIIGJJHEEBIIGIIGAA?GGE@A=DE@HHF@@>BBBHHHEEGBBBJJHMMJZZWBBB@@@NNPGGIMMODDDAAA>>;NOJXZUMMJPPPIIIBDFBDGNOQZ[]LNMLNMJMIQTPVVVQQQEEELLLHHHNNNSSSVVVPQTOPSPQTFGITUW[\^UVXTUWQSUTUW\]_^_cOPTVW[cdhklrdhpSV^W\^efjss}€€�vt…oo{eiqekpv~�¶½ÄÜãì¸ÁÌâìòâïóMPFMPHNPL=?>=>@78:8:9LNJGGENNLHHF>>;PPNNNL>>;JJHBB@@@>MMJFFDUUSTTQNNLHHFWWU@@>331;;9DDAQQOIIGUUSFHE;>=89;34789;@AD:=;>@=HHH>>>HHF]^Zab]\\ZZZZLLLLLIMMJHHF@@>DDAEEB774IIG@A=;=8FFDBB@DDDJJJNNPGGGGGELLI[[[EEENNPQQT@?DBBE;;;>>>??=QSN^_[LLIJJJIIIGHJHILMNPUWVNPOHJGEGDMOLSSSVVVLLLOOOMMMJJJWWWWWWVWZMNPIJMIJMPQTPQTZ[]WX[LMONOQ[\^_acUVXUVX^_bbceX]_TX[dehdehdcjvt~wt�jirbfibhjjpt£©°¿ÆÐ�”žÌÖÜÙãæIMBSVNPSN=?>=>@1249;:HJGMMJFFD??=@@>AA?UUS>>;TTQFFDGGEUUSMMJLLIOOMOOMLLI\\ZEEB663>>;FFD[[XFFDNNLBEA8:92364682369;:HJGILHDDDFFDIJFJLG[\WPQMJJH??=GGETTQJJH886>>;MMJ;;9HHFFGB?@;NNLIIGFFFSSSUUU???GGGMMM^^^JJMIILEDHDBG;:?88:>>>==:HIE^_[GGEFFFHHJBDFFGIGHJSUTOQPGIF@B?ILHGGEXXXWWWVVVSSSHHHXXXUUUQTSQSUGHJMNPMNPNOQXZ\\]_QSUPQTVXWX[Z[]\UWV^a_abd^cdPUVacbbdcbaehfmmlsbah^cdejkilrv{‚‚‡“}„Ž»ÂÉÙãæGH?PQJWXTMMM@@B//1BBBBB@JMH:=8362798>@?TVSFHDTVQDE@MNIVWSOPLNOJJLGMNIHIEQQOOOM9:6FGBVWSab]GHDLMHJJJ>>@224224DDDIII??=DDALLIHHFMNINOJVWP^_XSTMHIEJJHMMJDDA442::8886886EEBNNL@@>EEBTTQAA?LLIXXVIIIOOOEEETTVPPSVUZFEIBAH:9>88:???@@>JJH]][AA????JJMABFFGJHIMFGIXZ\MONILJMOLIIGTTQ^^\MMJTTQPPNNNLTTQSUTQTSNPOLNMILJILJQTS\^][\^UVXUVXVWZ^_b[\^[\^]^a\]__ac\]_^_babd^_c^_c_ac^_bijlhioeiq_dp^co€‡Ž•œ£@A8MNGOPLIIIDDF113:::;;9PSNAD?3644768:9NPO@B>OSJNOJLMHOPLLMHPQMFGBLMHAB>UUS[[XGHD?@;HIBZ[THIBJLGFFH327224BBELLLPPPAA???=??=??=HHFNOJPQM\]VUVONOHJLGPPNNNL;;9442663774GGEPPNBB@AA?QQOIIGEEBPPNSSPWWWIIIGGI??AFEI@?D=;B98=779??ADDDZZWaa^LLL@@BJJM9:>?@DDEHFGJOPSGHJGIHJMLJJHOPLZ[VUVQXZUVWSQSNVVTPSQX[ZWZXLNMHJIFHGJMLUWV\]_TUWQSUTUWZ[]WX[STVXZ\[\^XZ\[\^Z[]^_bQSUVWZ\]_bbbcce_afadlX\fX]hsy€}„‹GH?LMFTUPFFFQQT113111;;9MOJAD@/10/02468JML=?;JMHNOJIJFOPLMNIGHD?@;IJFEFAFFDUUSWXTPQMNOHWXQJLEQSNLLL99;,,/;;;UUUUUSNNL@@>@@>>>>EEBGGELMHVWSNOHGHABD?MMJPPNHHF886220997@@>SSPDDA==:NNLJJHFFDPPNTTQWWUJJJNNNHHJ@@B;:??>BIHM@@B??AMMMZZWZZWQQQ;;>GGI:;?;=@?@DBDGMNPHILGIHHJIMMJNNLUUSZZWVVTUUSPPNTTQQTSWZXVXWOQPHJIGIHGIHOQPXZ\QSUNOQVWZXZ\Z[]PQTWX[XZ\VWZXZ\WX[]^aPQTQSU]^a_acWX[TU[[^fSV^LOW_ej_ejLMDQSLNOJ@@@SSU>>@777;;9LNJFHE236347679LMO>@=MOLPPNIIGOOMEEBBB@AA?FFDDDAMMJVVTVWSFGBFG@VWPQSLVWSFFF447;;;777LLITTQHIEEFADDDAAAGGGIIGFFDTUPQSNMNIMMJUUSMMJPPN==:++)997??=TTQDDA>>;LLILLIIIGNNLPPN\\ZIIGUUULLLWWZMMOFEI87;668==?HHHQQO\\ZJJJMMOHHJ89=9:>@AEHIMIJMEFHADB?A@OOOQQQSSSVVVNNNQQQNNNPPPSUTLNMMONSUTNPOILJHJIMONWX[TUWJLNMNPTUWTUWIJMTUWTUWWX[TUWVWZUVXSTVJLNXZ\WX[OTVIMSPTZQU]OSXZ^aW\^VWNUVOMNIDDDOOQTTVHHH::8>@==?>*+-&(+67:@AD@BAEGFFFF>>>FFFFFFMMMPPPPPPMMJAA?QQOWXTHIEIJDNOHTUNPQMJJHGGGTTTFFDIIGVWSSTO>?:888668>>>AAA>>;HHFPPNSSPSSPMMJNNLQQOIIG774442??=VVTOOMEEBFFDUUSMMJIIGMMJXZUXXVWWULLLTTTLLN--0336113>>@HHHUUS\\ZOOOLLN??A67::;?=>AGHLDEGFGI=?>EGFLLLTTVLLNOOQLLNNNPGGIQQQSUTOQPQTSOQPWZXPSQOQPZ\[VWZUVXGHJLMOPQTXZ\FGIHILPQTQSUTUWWX[STVZ[]MNPPQTMQSPUWJNTBFLLOUVZ_TXZTUWWXOLMFHIE???DDFGGI>>>11/79878:)*-*+/237469468:=;DDD======AAADDD@@@@@@DDDEEBUUSVWS?@;@A:FG@VWP[\WQQO[[[SSPEEBNOJQSNOPI894AAA>>@>>@======JJHPPNJJHIIGMMJHHFNNLOOM@@>AA?BB@UUSVVTNNLHHFSSPIIGMMJJJHUVQSTOLLIQQONNNOOO;;>IIL88:;;>QQQOOM[[X\\\BBEDDF?@D?@D;=@>?BDEGDEG9;:;>=EEGPPSJJMGGIGGIJJMFFHLLNJMLMONQTSPSQSUTSUTUWVTVUOPSNOQEFHIJMIJMPQTBDFFGILMOPQTSTVTUWMNPVWZTUWOTUFMMPVXPTZEHNIMSTUXQTSQTSUVMPQJEFABBB??AEEGBBB886243236(),/0634:67:78:=?>FFH::=::=??AAAD::=::=AAATTQVVTWXTMNIJLEFG@NOHOPLTTQ^^\]][GHDMNIQSLEF?9:6IILGFJ??A::=999HHHMMJGGEGGEJJHGGENNLSSPGGE??=;;9OOMWWUTTQGGEIIGJJHNNLFFDQSNLMHMNILLINNLNNNFFF@@@GGIMMOUUUGGEXXVNNNAAD88:78;9:>?@D@AE:;>>?A?A@@BAEEGNNPLLNFFHEEGGGIEEGEEGFHGMONOQPSUTTVUQTSVXWOQPTUWNOQEFHEFHBDFMNPHILNOQHILJLNPQTQSUHILPQTWX[MQSAGIMSUQW\IMSMQTTUWTTQVVTJLEIJDHIE??=BBBQQQIII444-/1236+,0/03-/29:>;=??A@JJM447@@B@@B>>@::=::=>>@@@@UUS[\WGHD?@;BD?OPLWXTPPN\\Z\\ZLMHGHDLMHDE@==:LLNMMOAAD==?777AAAJJHLLIHHFBB@>>;@@>@@>BB@>>>999HHHPPPMMJFFDJJHFFDFFDLLIMNINOJJJHIIGMMJ[[[XXXUUULLNPPSQQQDDAUUSPPP99;44778;=>AIJNIJM9:=?@BDEGBDFBBEEEGFFHBBBBBBEEGFFHAADEGFNPONPOSUTPSQILJVXWVXWUVXOPSJLNJLNEFHJLNFGIFGIFGIHILLMOPQTHILMNPWX[GLM=BEJPSOUWJOQLPQPSQNPMTTQNOJOPLPQMGHDDE@GGEBBE87;:;A01778;013124468:;>>?AEEG779779AADIIL99;336::=HHHZZWUUSEEB>>;FFDLLI[[XPPNZZZ\\\PPNBB@MMJBB@BBBDFEILJ;>=FHG=?>8:9MONFHGLNM@B?9;8=?;?A>;>=78:348=>AGHJHJIILHLNIJMIHJGFHGHJINPOFHGFHGFHGLMO?@B:;>ABEIJMEGF?A>TVSOQP@AD89;/039:>FGIUWV=?>;=?:;>?@D=>AEFHSUTOQNEGD=?>@AD?@BLNMNPOPSQQTSQTSJMLNPOX[ZTUWPQTIJMNOQJLNGHJGHJIJMDFEGIHGIHMONFHGLNMVXWMNPINOHMNMQSLPQHMNINOMQPQTSPPNMMJLMHDE>;=8AA?>>@32911:/06;=@6796879;:9:=:;>>>@224779??A==?224//1668===IIGVVTNNL>>;EEBPPNTTQZZZXXX\\\IIIAAAGGGFFF@@@?A@BEDDFEBED:=;8:9JMLEGFILJ>@?362362:=;89;46923967=@AEDFEEGDGIEFHEEGFDFEJLNNOQDEGABEFGIQSUDEG9:=BDFABEDFE@B?OQNTVUIJMABE2379:>EFHVXWEGF;=?78;:;?>?BIJMTVSTVQJMHBEADEG?@DGHJHJILNMQTSMONHJILNMTVUWX[OPSIJMMNPPQTJLNEFHABEGIHHJINPOLNMJMLSUTTVUMONFJLEIJINOHMNEIJGLMINOLPQIIGQQOTUPFG@9:6??===?329,,6-/4?@D?@B243=?>;=?>?A?@D12667:78;-/2+,0126;=?>>>HHFUUSQQOAA?AA?JJHUUSUUUZZZWWWPPP@@@JJJEEEEEEADB@BAHJIADB9;:9;:HJIEGFMONDFE9;8796=?>9:=46912889??@D=?>;>:?A=BEAFHGILJGHJJLN?@B?@B?@BQSUNOQLMO>?AEFHILJ?A>NPMSUTHIL@AD:;?ABFGHJVXWSUT>?A78;89=469GHJQTPWZUOQMILHEFH>?BJLNHILFGIGHJEFHBDFFGILMONOQIJMGHJEFHJLNJLNHILEFHEGFFHGJMLEGFBEDMONQTSNPOHMNGLMLPQJOPBGHDHIGLMINOQQOUUSUVQGHA=>9BB@AAD98?//8+,2>?BEFH687ADB:;>:;>>?B126:;?:;?237014348:;>???MMJLLIDDA>>;FFDHHFQQOWWWUUUZZZPPPEEEIIINNNGGG@BA8:9=?>:=;7989;:FHGDFEHJIDFE=?;9;8DFE>?A469/0667=>?B>@?=?;FHDFHEFHGFHG>?AFGI?@BBDF;=?EFH;=?9:=78:?@B=?>=?>PSQLNM=>@67:67:ABFDEGJML\^]GHJ>?B89=:;?MNPPSOTVQOQMILHGHJABFHILGHJEFHEFH?@B?@BBDFFGIHILMNPNOQ?@BIJMJLNIJMEFHFHGNPOJMLFHGILJMONVXWLNMEIJDHIHMNGLM?DEAFGDHIFJLSSPWWUWXTPQJ=>9??=DDFA@GEEN12878;347798@BA@AD4687;>&*037=14:-17*-3*-3-/2:::NNLQQOIIG??=AA?GGELLINNNUUUWWWNNNAAAHHHQQQGGGEGF?A@9;:ADB8:99;:DFE@BAEGFBED@B?=?;GIH9:=126-/478>;=@ADB>@=BE@?A>:=;798>?A;=?67978:67989;78:3479:>:;?9:=>?AGHJPQTFGJ46989=?@DEFHEGF\^]LMO=>A12667:FGIQTPX[V^a\JMIHIL;=@?@D>?B?@D?@D;=@:;?@AEHIMGHJ?@BJLN9:=ABELMODEG=>@HJIOQPJMLFHGFHGEGFNPOHJIAFG@EFDHIAFG>BD;@ABGHGLMOOMUUSUVQOPI894886==?>=D88A/0689=6799;:ADB>?A12637=$(-,06(+1*-3(+1*-3014;;;LLINNLHHF@@>==:??=HHFJJJUUUTTTQQQ===GGGMMMIII@BA=?>9;:HJI?A@>@?DFEBEDADBBEDEGDGIFILJ;=?46912834:78;>@?>@=GIEEGDBEDADB>?A9:=12434767989;89;67:78>;=B89=89;DEGNOSDEJ12878;=>AABEDFE[]\PQTBDG9:>FGJMNPSUQWZU]_[PSOLMO?@D;=@:;??@D>?B78;9:>ABFIJNMNPGHJPQT@ADGHJIJMGHJGHJPSQOQPNPOEGFGIHEGFMONMONFJLDHIFJLDHI;@A;@ABGHEIJSSPUUSPQMGHA340997;;>218++4,-378;679364>@?>?A469-17&*2/2:,08%)1%)1*-6239PPPQQOBB@442==:??=;;9==:IIIOOOUUUSSS;;;AAAIIIDDD@BA=?>>@?JMLEGF?A@?A@?A@9;:?A@GIFLNJILJ;=?469128/060149;::=9FHDBEA=?>8:99:=67901334746878:78:46934:89?46967:HIMIJN?@F67=34889=?@BDFESUTPQTDEH>?BGHLIJMOQNSUPZ\WUWTOPS?@D9:@9:@>?E:;A78>89?=>D@AEABEABENOQEFHEFHFGIJLNLMOGIHGIHMONJMLGIHADBFHGHJIBGH?DE@EF=AB9>?;@ABGHBGHNNLQSNOPIFG@:;7::8779,+2%&,,-3469124687>?A;=?014),4#&/&*2"%-"%-#&,*-3348DFELLIFFD??=886DDALLIGGEBBBNNNPPNTTQ;;9IIG@@@>>>9;:@BAGIHPSQOQPEGFDFE?A@=?>BEDLNJQTPGIH9:=126-/467=237:=;=?;@B?=?;9;:78:89=67:01434812634834812622;33=12878;IJNNOSDEJ78>12889==>@ABESTVVWZJLNFGJNOSHILILHJMHQTOTVSMON;=?9:>67=:;A9:@12878>>?EABH>?B?@BHILABE89;?@BJLNIJMFHGJMLLNMQTSNPOADBFHGIJMDHI?DE?DE;@A7;=;@ABGH@EFPQMMNGOPISTMMNIBBB=;@43:)*0()/78;3474689:=78;/06**6%%1$$-%%/()/126236013>@?BED@BA9;:;>=ADBFHGLNMPPPHHFQSNQSNHIELMHHHFBBB78:@ADFHEMOLLNJJMIIJM@AD>?ADFEOQNNPMADB78:34:,,612812689;9;::=;89;78;78>14:14=03;/2=-1;69A26>03;009009/0678;GHJJLO@AG34:1289:@?@D=>AFGJVWZEFHEFH@@BLLNFFFIIGUUSUUSNNLGGGEFH89=34:67=11:88A66?88A?@DEFHHILBDF=>@=>@GHJEFHEFHBDFIJMNOQGHJGHJEFHHIL:;?=>A>?B:;?9:>9:>=>A:;?PQJIJDZ[TMNIDDA===76:218*+1,-3:;?236-/1348128((1))4%%2%%1&&0&(--/2468687?A@:=;798798?A@?A@BEDADB???GGGJLGOPI892>?:???;;>89=ABEFHENPLQTOGIFFGIFGJBDFABEGIHNPMJML=>@239,,634:67=9:>236?@B?@D;=B46;37?,0:+-:02?13@79F14?,08--922;017237:;>QSVFGM67=34:78>EFL=>DBDGNOSGHJ>?A??ALLNHHHFFFSSPWWUPQMEEBNOQ?@D34:239//866?11=>>G?@DDEGGHJ@AD:;>=>@DEGDEG>?A=>@HILNOQMNPFGIABEGHJDEH@AE;=@78;=>A=>A>?B=>AQSLGHAWXQOPLBB@III649107+,2128>?B013+,/126/06%%/&&2$$1%%1))2%&,*+/9:=>@?>@?9;:364243:=;BED>@?>@?GGIGGGNNLLMHAB>IIG;;;==?9:>>?A>@=DFASUP@B?;=?@AE@AD9:=:=;GIFNPO?@B017//834:89?=>A89;>?A89=34:34:26>+/9*,9/1>13@79F14?,0822>//8,-3348?@BOPT@AG23923967=DEJ;=BABFMNQHIL;=?JJMIILFFFHHHVVTTTQMNIHHFX[ZWX\89=67=34:66?11:88A=>A@AEABF:;?78;;=@?@DABF?@B>?AHILNOQMNPFGIABEGHJ?@D9:>67:469BDGEFIBDGDEHLMFQSLTUNNOJMMJ@@@327/-4()/128=>A)*,*+-/03,-3$$-%%1$$1&&2**3#$*&(+;=?BEDEGF679/02679679:;>ABE@ADDDFDDFNNLPPNOOMMMJJJMAAD>?BDEG>@=>@;NPL:=9124014@AD>?A:=;BEALNM=>@-/400967=23934812478:78;67=34:/2:-1;,/;+-:-0=68E26@03;11=11:,-3014FGISTWIJP67=-/467==>D9:@ABFQSVIJM=>@>>@@@BEEEFFFTTQVVTOPLFFDZ\[abdABF237/0612899B67=BDIEFIEFI=>A469:;?;=@@AE?@B=>@DEGHILGHJGHJEFHHILGHL=>A469126>?BBDG@AE?@DSTMIJDQSLVWSEEB@@@98=/-4()/128;=@+,/*+-)*-#$*$$-%%1##0$$0&&0&(-)*-BDFILJ236/03,-1348;=@67:78;34898===?GGGLLLAAA???336-,1+,0236AD@HJFTVQGIF124/03=>@>?AADBEGDBED89;,-3++412846;78;01378:89=89?78>,08(+6-0=02?+-:+-:+/9+/7--9,,6,-3469LMOLMPNOU:;A/0646;89?9:@@AEIJN@AD9:=AAD==?:::AAATTQ[[XLMHLLIZ\[TUWMNP=>A126/06*+19:@;=B;=B>?E46;67==>D?@F>?B;=?;=?BDFEFHIJMIJMHILFGIDEGEFH679124?@BHILHILDEG?@9@A:PQJUVQTTQFFF438(&-()/78>BDG/02)*,)*-#$*%%/##/""/$$0**3()/014GHJTUW89=/03+,0-/2/03014:;?237,+0;:?BBEHHHEEE@@B76:0/34699:=:=9?A=OQMLNJ:;>78;89;;=?>@?=?;>@?78:-/4,,646;46;469,-089;67:128-/4+/7),7,/;,/;*,9*,9*-8*-6--9,,6&(-9:>JLNJLOQSXLMS0172399:@46;BDGDEH>?A;=?HHJ99;888>>>MMJOOMIJFMNIPSOTVUUVXNOQ:;?014/0646;89?67=78>34:01789?;=B:;A9:>468=>@EFHGHJGHJEFHBDFDEGABE9:=89;=>@DEGEFH>?A:;4>?8PQJWXTMMJBBB327%$+*+1?@FJLO347,-0,-1)*0++4((3$$1**666?$%+126BDFSTV:;?-/4,-3+,2239-/4017)*00/698=HHJHHHEEE??A98=/-4:;?;=?8:79;7NPLJMI9:=67:89;@AD@BA9;88:9679/06--746;128126,-078:4699:@ABH+/7),7,/;(*7)+8)+8),7),4))4009+,278;BDFFGJFGM:;A9:@01723934:>?B@AE;=?:;>>>@::=>>>===IIGOOMSTOQSNLNJQTSNPOIJM469-/2126;=B:;A66?33=22;11:77@;;E;=B@AE9:=;=?@AD?@BDEGGHJIJMHJI=?>687798=?>ADBFHGADB>?8:;4IJDTUPIIGHHH:9>&%,+,2DEJQSV78:124237/0622;%%1""/**699B()/78;?@BQSU9:>+,2/06,-3,-39:@89?67=43::9>AADHHHBBB::=76:+*189=78:;>::=8QTOEGD-/1+,0236>?A>@?241364468017--7017,-3014/0223678;78>34:*-6*-8+-:$&3(*7(*7(+6(+3++7))2,-39:>GHJIJNOPVQSX@AG017*+146;;=@?@D89;89;??A==?777;;;FFDOOMTUPPQMLNJSUQLNMGHJ/03-/2+,0;=B??H66?22;33=33=22;33=67=78;4689:=9:=@ADEFHHILIJMDFE4763648:9@BA@BAFHGHJI \ No newline at end of file diff --git a/resources/binaries/libwebp-1.2.4-windows-x64/tools.md b/resources/binaries/libwebp-1.2.4-windows-x64/tools.md new file mode 100644 index 00000000..853af819 --- /dev/null +++ b/resources/binaries/libwebp-1.2.4-windows-x64/tools.md @@ -0,0 +1,512 @@ +# WebP tools + +## Encoding tool + +The examples/ directory contains tools for encoding (cwebp) and decoding (dwebp) +images. + +The easiest use should look like: + +```shell +cwebp input.png -q 80 -o output.webp +``` + +which will convert the input file to a WebP file using a quality factor of 80 on +a 0->100 scale (0 being the lowest quality, 100 being the best. Default value is +75). + +You might want to try the `-lossless` flag too, which will compress the source +(in RGBA format) without any loss. The `-q` quality parameter will in this case +control the amount of processing time spent trying to make the output file as +small as possible. + +A longer list of options is available using the `-longhelp` command line flag: + +```shell +> cwebp -longhelp +Usage: + cwebp [-preset <...>] [options] in_file [-o out_file] +``` + +If input size (-s) for an image is not specified, it is assumed to be a PNG, +JPEG, TIFF or WebP file. Note: Animated PNG and WebP files are not supported. + +Options: + +``` +-h / -help ............. short help +-H / -longhelp ......... long help +-q ............. quality factor (0:small..100:big), default=75 +-alpha_q ......... transparency-compression quality (0..100), + default=100 +-preset ....... preset setting, one of: + default, photo, picture, + drawing, icon, text + -preset must come first, as it overwrites other parameters +-z ............... activates lossless preset with given + level in [0:fast, ..., 9:slowest] + +-m ............... compression method (0=fast, 6=slowest), default=4 +-segments ........ number of segments to use (1..4), default=4 +-size ............ target size (in bytes) +-psnr .......... target PSNR (in dB. typically: 42) + +-s ......... input size (width x height) for YUV +-sns ............. spatial noise shaping (0:off, 100:max), default=50 +-f ............... filter strength (0=off..100), default=60 +-sharpness ....... filter sharpness (0:most .. 7:least sharp), default=0 +-strong ................ use strong filter instead of simple (default) +-nostrong .............. use simple filter instead of strong +-sharp_yuv ............. use sharper (and slower) RGB->YUV conversion +-partition_limit . limit quality to fit the 512k limit on + the first partition (0=no degradation ... 100=full) +-pass ............ analysis pass number (1..10) +-qrange .... specifies the permissible quality range + (default: 0 100) +-crop .. crop picture with the given rectangle +-resize ........ resize picture (*after* any cropping) +-mt .................... use multi-threading if available +-low_memory ............ reduce memory usage (slower encoding) +-map ............. print map of extra info +-print_psnr ............ prints averaged PSNR distortion +-print_ssim ............ prints averaged SSIM distortion +-print_lsim ............ prints local-similarity distortion +-d .......... dump the compressed output (PGM file) +-alpha_method .... transparency-compression method (0..1), default=1 +-alpha_filter . predictive filtering for alpha plane, + one of: none, fast (default) or best +-exact ................. preserve RGB values in transparent area, default=off +-blend_alpha ..... blend colors against background color + expressed as RGB values written in + hexadecimal, e.g. 0xc0e0d0 for red=0xc0 + green=0xe0 and blue=0xd0 +-noalpha ............... discard any transparency information +-lossless .............. encode image losslessly, default=off +-near_lossless ... use near-lossless image + preprocessing (0..100=off), default=100 +-hint ......... specify image characteristics hint, + one of: photo, picture or graph + +-metadata ..... comma separated list of metadata to + copy from the input to the output if present. + Valid values: all, none (default), exif, icc, xmp + +-short ................. condense printed message +-quiet ................. don't print anything +-version ............... print version number and exit +-noasm ................. disable all assembly optimizations +-v ..................... verbose, e.g. print encoding/decoding times +-progress .............. report encoding progress +``` + +Experimental Options: + +``` +-jpeg_like ............. roughly match expected JPEG size +-af .................... auto-adjust filter strength +-pre ............. pre-processing filter +``` + +The main options you might want to try in order to further tune the visual +quality are: + +-preset -sns -f -m + +Namely: + +* `preset` will set up a default encoding configuration targeting a particular + type of input. It should appear first in the list of options, so that + subsequent options can take effect on top of this preset. Default value is + 'default'. +* `sns` will progressively turn on (when going from 0 to 100) some additional + visual optimizations (like: segmentation map re-enforcement). This option + will balance the bit allocation differently. It tries to take bits from the + "easy" parts of the picture and use them in the "difficult" ones instead. + Usually, raising the sns value (at fixed -q value) leads to larger files, + but with better quality. Typical value is around '75'. +* `f` option directly links to the filtering strength used by the codec's + in-loop processing. The higher the value, the smoother the highly-compressed + area will look. This is particularly useful when aiming at very small files. + Typical values are around 20-30. Note that using the option + -strong/-nostrong will change the type of filtering. Use "-f 0" to turn + filtering off. +* `m` controls the trade-off between encoding speed and quality. Default is 4. + You can try -m 5 or -m 6 to explore more (time-consuming) encoding + possibilities. A lower value will result in faster encoding at the expense + of quality. + +## Decoding tool + +There is a decoding sample in examples/dwebp.c which will take a .webp file and +decode it to a PNG image file (amongst other formats). This is simply to +demonstrate the use of the API. You can verify the file test.webp decodes to +exactly the same as test_ref.ppm by using: + +```shell +cd examples +./dwebp test.webp -ppm -o test.ppm +diff test.ppm test_ref.ppm +``` + +The full list of options is available using -h: + +```shell +> dwebp -h +Usage: dwebp in_file [options] [-o out_file] +``` + +Decodes the WebP image file to PNG format [Default]. Note: Animated WebP files +are not supported. + +Use following options to convert into alternate image formats: + +``` +-pam ......... save the raw RGBA samples as a color PAM +-ppm ......... save the raw RGB samples as a color PPM +-bmp ......... save as uncompressed BMP format +-tiff ........ save as uncompressed TIFF format +-pgm ......... save the raw YUV samples as a grayscale PGM + file with IMC4 layout +-yuv ......... save the raw YUV samples in flat layout +``` + +Other options are: + +``` +-version ..... print version number and exit +-nofancy ..... don't use the fancy YUV420 upscaler +-nofilter .... disable in-loop filtering +-nodither .... disable dithering +-dither .. dithering strength (in 0..100) +-alpha_dither use alpha-plane dithering if needed +-mt .......... use multi-threading +-crop ... crop output with the given rectangle +-resize ......... resize output (*after* any cropping) +-flip ........ flip the output vertically +-alpha ....... only save the alpha plane +-incremental . use incremental decoding (useful for tests) +-h ........... this help message +-v ........... verbose (e.g. print encoding/decoding times) +-quiet ....... quiet mode, don't print anything +-noasm ....... disable all assembly optimizations +``` + +## WebP file analysis tool + +`webpinfo` can be used to print out the chunk level structure and bitstream +header information of WebP files. It can also check if the files are of valid +WebP format. + +Usage: + +```shell +webpinfo [options] in_files +``` + +Note: there could be multiple input files; options must come before input files. + +Options: + +``` +-version ........... Print version number and exit. +-quiet ............. Do not show chunk parsing information. +-diag .............. Show parsing error diagnosis. +-summary ........... Show chunk stats summary. +-bitstream_info .... Parse bitstream header. +``` + +## Visualization tool + +There's a little self-serve visualization tool called 'vwebp' under the +examples/ directory. It uses OpenGL to open a simple drawing window and show a +decoded WebP file. It's not yet integrated in the automake build system, but you +can try to manually compile it using the recommendations below. + +Usage: + +```shell +vwebp in_file [options] +``` + +Decodes the WebP image file and visualize it using OpenGL + +Options are: + +``` +-version ..... print version number and exit +-noicc ....... don't use the icc profile if present +-nofancy ..... don't use the fancy YUV420 upscaler +-nofilter .... disable in-loop filtering +-dither dithering strength (0..100), default=50 +-noalphadither disable alpha plane dithering +-usebgcolor .. display background color +-mt .......... use multi-threading +-info ........ print info +-h ........... this help message +``` + +Keyboard shortcuts: + +``` +'c' ................ toggle use of color profile +'b' ................ toggle background color display +'i' ................ overlay file information +'d' ................ disable blending & disposal (debug) +'q' / 'Q' / ESC .... quit +``` + +### Building + +Prerequisites: + +1. OpenGL & OpenGL Utility Toolkit (GLUT) + + Linux: `sudo apt-get install freeglut3-dev mesa-common-dev` + + Mac + Xcode: These libraries should be available in the OpenGL / GLUT + frameworks. + + Windows: http://freeglut.sourceforge.net/index.php#download + +2. (Optional) qcms (Quick Color Management System) + + 1. Download qcms from Mozilla / Chromium: + https://hg.mozilla.org/mozilla-central/file/0e7639e3bdfb/gfx/qcms + https://source.chromium.org/chromium/chromium/src/+/main:third_party/qcms/;drc=d4a2f8e1ed461d8fc05ed88d1ae2dc94c9773825 + 2. Build and archive the source files as libqcms.a / qcms.lib + 3. Update makefile.unix / Makefile.vc + 1. Define WEBP_HAVE_QCMS + 2. Update include / library paths to reference the qcms directory. + +Build using makefile.unix / Makefile.vc: + +```shell +$ make -f makefile.unix examples/vwebp +> nmake /f Makefile.vc CFG=release-static \ + ../obj/x64/release-static/bin/vwebp.exe +``` + +## Animation creation tool + +The utility `img2webp` can turn a sequence of input images (PNG, JPEG, ...) into +an animated WebP file. It offers fine control over duration, encoding modes, +etc. + +Usage: + +```shell +img2webp [file_options] [[frame_options] frame_file]... +``` + +File-level options (only used at the start of compression): + +``` +-min_size ............ minimize size +-loop .......... loop count (default: 0, = infinite loop) +-kmax .......... maximum number of frame between key-frames + (0=only keyframes) +-kmin .......... minimum number of frame between key-frames + (0=disable key-frames altogether) +-mixed ............... use mixed lossy/lossless automatic mode +-v ................... verbose mode +-h ................... this help +-version ............. print version number and exit +``` + +Per-frame options (only used for subsequent images input): + +``` +-d ............. frame duration in ms (default: 100) +-lossless ........... use lossless mode (default) +-lossy ... ........... use lossy mode +-q ........... quality +-m ............. method to use +``` + +example: `img2webp -loop 2 in0.png -lossy in1.jpg -d 80 in2.tiff -o out.webp` + +Note: if a single file name is passed as the argument, the arguments will be +tokenized from this file. The file name must not start with the character '-'. + +## Animated GIF conversion + +Animated GIF files can be converted to WebP files with animation using the +gif2webp utility available under examples/. The files can then be viewed using +vwebp. + +Usage: + +```shell +gif2webp [options] gif_file -o webp_file +``` + +Options: + +``` +-h / -help ............. this help +-lossy ................. encode image using lossy compression +-mixed ................. for each frame in the image, pick lossy + or lossless compression heuristically +-q ............. quality factor (0:small..100:big) +-m ............... compression method (0=fast, 6=slowest) +-min_size .............. minimize output size (default:off) + lossless compression by default; can be + combined with -q, -m, -lossy or -mixed + options +-kmin ............ min distance between key frames +-kmax ............ max distance between key frames +-f ............... filter strength (0=off..100) +-metadata ..... comma separated list of metadata to + copy from the input to the output if present + Valid values: all, none, icc, xmp (default) +-loop_compatibility .... use compatibility mode for Chrome + version prior to M62 (inclusive) +-mt .................... use multi-threading if available + +-version ............... print version number and exit +-v ..................... verbose +-quiet ................. don't print anything +``` + +### Building + +With the libgif development files installed, gif2webp can be built using +makefile.unix: + +```shell +$ make -f makefile.unix examples/gif2webp +``` + +or using autoconf: + +```shell +$ ./configure --enable-everything +$ make +``` + +## Comparison of animated images + +Test utility anim_diff under examples/ can be used to compare two animated +images (each can be GIF or WebP). + +Usage: + +```shell +anim_diff [options] +``` + +Options: + +``` +-dump_frames dump decoded frames in PAM format +-min_psnr ... minimum per-frame PSNR +-raw_comparison ..... if this flag is not used, RGB is + premultiplied before comparison +-max_diff ..... maximum allowed difference per channel + between corresponding pixels in subsequent + frames +-h .................. this help +-version ............ print version number and exit +``` + +### Building + +With the libgif development files installed, anim_diff can be built using +makefile.unix: + +```shell +$ make -f makefile.unix examples/anim_diff +``` + +or using autoconf: + +```shell +$ ./configure --enable-everything +$ make +``` + +## WebP Mux tool + +The examples/ directory contains a tool (webpmux) for manipulating WebP files. +The webpmux tool can be used to create an extended format WebP file and also to +extract or strip relevant data from such a file. + +A list of options is available using the -help command line flag: + +```shell +> webpmux -help +Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT + webpmux -set SET_OPTIONS INPUT -o OUTPUT + webpmux -duration DURATION_OPTIONS [-duration ...] + INPUT -o OUTPUT + webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT + webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT] + [-bgcolor BACKGROUND_COLOR] -o OUTPUT + webpmux -info INPUT + webpmux [-h|-help] + webpmux -version + webpmux argument_file_name + +GET_OPTIONS: + Extract relevant data: + icc get ICC profile + exif get EXIF metadata + xmp get XMP metadata + frame n get nth frame + +SET_OPTIONS: + Set color profile/metadata/parameters: + loop LOOP_COUNT set the loop count + bgcolor BACKGROUND_COLOR set the animation background color + icc file.icc set ICC profile + exif file.exif set EXIF metadata + xmp file.xmp set XMP metadata + where: 'file.icc' contains the ICC profile to be set, + 'file.exif' contains the EXIF metadata to be set + 'file.xmp' contains the XMP metadata to be set + +DURATION_OPTIONS: + Set duration of selected frames: + duration set duration for all frames + duration,frame set duration of a particular frame + duration,start,end set duration of frames in the + interval [start,end]) + where: 'duration' is the duration in milliseconds + 'start' is the start frame index + 'end' is the inclusive end frame index + The special 'end' value '0' means: last frame. + +STRIP_OPTIONS: + Strip color profile/metadata: + icc strip ICC profile + exif strip EXIF metadata + xmp strip XMP metadata + +FRAME_OPTIONS(i): + Create animation: + file_i +di[+xi+yi[+mi[bi]]] + where: 'file_i' is the i'th animation frame (WebP format), + 'di' is the pause duration before next frame, + 'xi','yi' specify the image offset for this frame, + 'mi' is the dispose method for this frame (0 or 1), + 'bi' is the blending method for this frame (+b or -b) + +LOOP_COUNT: + Number of times to repeat the animation. + Valid range is 0 to 65535 [Default: 0 (infinite)]. + +BACKGROUND_COLOR: + Background color of the canvas. + A,R,G,B + where: 'A', 'R', 'G' and 'B' are integers in the range 0 to 255 specifying + the Alpha, Red, Green and Blue component values respectively + [Default: 255,255,255,255] + +INPUT & OUTPUT are in WebP format. + +Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be +valid. + +Note: if a single file name is passed as the argument, the arguments will be +tokenized from this file. The file name must not start with the character '-'. +```