:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ImageFormatLoaderExtension.xml. .. _class_ImageFormatLoaderExtension: ImageFormatLoaderExtension ========================== **Inherits:** :ref:`ImageFormatLoader` **<** :ref:`RefCounted` **<** :ref:`Object` Base class for creating :ref:`ImageFormatLoader` extensions (adding support for extra image formats). .. rst-class:: classref-introduction-group Description ----------- 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 :ref:`add_format_loader()` to register that loader during the initialization phase. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`_get_recognized_extensions`\ (\ ) |virtual| |const| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`_load_image`\ (\ image\: :ref:`Image`, fileaccess\: :ref:`FileAccess`, flags\: |bitfield|\[:ref:`LoaderFlags`\], scale\: :ref:`float`\ ) |virtual| | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_format_loader`\ (\ ) | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_format_loader`\ (\ ) | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ImageFormatLoaderExtension_private_method__get_recognized_extensions: .. rst-class:: classref-method :ref:`PackedStringArray` **_get_recognized_extensions**\ (\ ) |virtual| |const| :ref:`🔗` Returns the list of file extensions for this image format. Files with the given extensions will be treated as image file and loaded using this class. .. rst-class:: classref-item-separator ---- .. _class_ImageFormatLoaderExtension_private_method__load_image: .. rst-class:: classref-method :ref:`Error` **_load_image**\ (\ image\: :ref:`Image`, fileaccess\: :ref:`FileAccess`, flags\: |bitfield|\[:ref:`LoaderFlags`\], scale\: :ref:`float`\ ) |virtual| :ref:`🔗` Loads the content of ``fileaccess`` into the provided ``image``. .. rst-class:: classref-item-separator ---- .. _class_ImageFormatLoaderExtension_method_add_format_loader: .. rst-class:: classref-method |void| **add_format_loader**\ (\ ) :ref:`🔗` Add this format loader to the engine, allowing it to recognize the file extensions returned by :ref:`_get_recognized_extensions()`. .. rst-class:: classref-item-separator ---- .. _class_ImageFormatLoaderExtension_method_remove_format_loader: .. rst-class:: classref-method |void| **remove_format_loader**\ (\ ) :ref:`🔗` Remove this format loader from the engine. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`