From e8fc6bfeb53801447de25c12ba7536f574d121f4 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 8 Jul 2022 15:01:02 +0200 Subject: [Core] Make ImageFormatLoader extensible. --- doc/classes/ImageFormatLoader.xml | 19 ++++++++++++++ doc/classes/ImageFormatLoaderExtension.xml | 42 ++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 doc/classes/ImageFormatLoader.xml create mode 100644 doc/classes/ImageFormatLoaderExtension.xml (limited to 'doc/classes') diff --git a/doc/classes/ImageFormatLoader.xml b/doc/classes/ImageFormatLoader.xml new file mode 100644 index 0000000000..c6b1ec922a --- /dev/null +++ b/doc/classes/ImageFormatLoader.xml @@ -0,0 +1,19 @@ + + + + Base class to add support for specific image formats. + + + The engine supports multiple image formats out of the box (PNG, SVG, JPEG, WebP to name a few), but you can choose to implement support for additional image formats by extending [ImageFormatLoaderExtension]. + + + + + + + + + + + + diff --git a/doc/classes/ImageFormatLoaderExtension.xml b/doc/classes/ImageFormatLoaderExtension.xml new file mode 100644 index 0000000000..b2a7ebc60f --- /dev/null +++ b/doc/classes/ImageFormatLoaderExtension.xml @@ -0,0 +1,42 @@ + + + + Base class for creating [ImageFormatLoader] extensions (adding support for extra image formats). + + + The engine supports multiple image formats out of the box (PNG, SVG, JPEG, WebP to name a few), but you can choose to implement support for additional image formats by extending this class. + Be sure to respect the documented return types and values. You should create an instance of it, and call [method add_format_loader] to register that loader during the initializaiton phase. + + + + + + + + Returns the list of file extensions for this image format. Files with the given extentions will be treated as image file and loaded using this class. + + + + + + + + + + Loads the content of [param fileaccess] into the provided [param image]. + + + + + + Add this format loader to the engine, allowing it to recognize the file extensions returned by [method _get_recognized_extensions]. + + + + + + Remove this format loader from the engine. + + + + -- cgit v1.2.3