mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
1999 lines
131 KiB
ReStructuredText
1999 lines
131 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_Image:
|
||
|
||
Image
|
||
=====
|
||
|
||
**Успадковує:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
Тип зображення.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Опис
|
||
--------
|
||
|
||
Native image datatype. Contains image data which can be converted to an :ref:`ImageTexture<class_ImageTexture>` and provides commonly used *image processing* methods. The maximum width and height for an **Image** are :ref:`MAX_WIDTH<class_Image_constant_MAX_WIDTH>` and :ref:`MAX_HEIGHT<class_Image_constant_MAX_HEIGHT>`.
|
||
|
||
An **Image** cannot be assigned to a texture property of an object directly (such as :ref:`Sprite2D.texture<class_Sprite2D_property_texture>`), and has to be converted manually to an :ref:`ImageTexture<class_ImageTexture>` first.
|
||
|
||
\ **Note:** Methods that modify the image data cannot be used on VRAM-compressed images. Use :ref:`decompress()<class_Image_method_decompress>` to convert the image to an uncompressed format first.
|
||
|
||
\ **Note:** The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images may fail to import.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Посібники
|
||
------------------
|
||
|
||
- :doc:`Імпорт зображень <../tutorials/assets_pipeline/importing_images>`
|
||
|
||
- :doc:`Завантаження та збереження файлів під час виконання <../tutorials/io/runtime_file_loading_and_saving>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Властивості
|
||
----------------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------+----------------------------------------+------------------------------------------------------------------------------------------------+
|
||
| :ref:`Dictionary<class_Dictionary>` | :ref:`data<class_Image_property_data>` | ``{ "data": PackedByteArray(), "format": "Lum8", "height": 0, "mipmaps": false, "width": 0 }`` |
|
||
+-------------------------------------+----------------------------------------+------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Методи
|
||
------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`adjust_bcs<class_Image_method_adjust_bcs>`\ (\ brightness\: :ref:`float<class_float>`, contrast\: :ref:`float<class_float>`, saturation\: :ref:`float<class_float>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`blend_rect<class_Image_method_blend_rect>`\ (\ src\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`blend_rect_mask<class_Image_method_blend_rect_mask>`\ (\ src\: :ref:`Image<class_Image>`, mask\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`blit_rect<class_Image_method_blit_rect>`\ (\ src\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`blit_rect_mask<class_Image_method_blit_rect_mask>`\ (\ src\: :ref:`Image<class_Image>`, mask\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`bump_map_to_normal_map<class_Image_method_bump_map_to_normal_map>`\ (\ bump_scale\: :ref:`float<class_float>` = 1.0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear_mipmaps<class_Image_method_clear_mipmaps>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`compress<class_Image_method_compress>`\ (\ mode\: :ref:`CompressMode<enum_Image_CompressMode>`, source\: :ref:`CompressSource<enum_Image_CompressSource>` = 0, astc_format\: :ref:`ASTCFormat<enum_Image_ASTCFormat>` = 0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`compress_from_channels<class_Image_method_compress_from_channels>`\ (\ mode\: :ref:`CompressMode<enum_Image_CompressMode>`, channels\: :ref:`UsedChannels<enum_Image_UsedChannels>`, astc_format\: :ref:`ASTCFormat<enum_Image_ASTCFormat>` = 0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Dictionary<class_Dictionary>` | :ref:`compute_image_metrics<class_Image_method_compute_image_metrics>`\ (\ compared_image\: :ref:`Image<class_Image>`, use_luma\: :ref:`bool<class_bool>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`convert<class_Image_method_convert>`\ (\ format\: :ref:`Format<enum_Image_Format>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`copy_from<class_Image_method_copy_from>`\ (\ src\: :ref:`Image<class_Image>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`create<class_Image_method_create>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`\ ) |static| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`create_empty<class_Image_method_create_empty>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`\ ) |static| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`create_from_data<class_Image_method_create_from_data>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |static| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`crop<class_Image_method_crop>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`decompress<class_Image_method_decompress>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`AlphaMode<enum_Image_AlphaMode>` | :ref:`detect_alpha<class_Image_method_detect_alpha>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`UsedChannels<enum_Image_UsedChannels>` | :ref:`detect_used_channels<class_Image_method_detect_used_channels>`\ (\ source\: :ref:`CompressSource<enum_Image_CompressSource>` = 0\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`fill<class_Image_method_fill>`\ (\ color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`fill_rect<class_Image_method_fill_rect>`\ (\ rect\: :ref:`Rect2i<class_Rect2i>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`fix_alpha_edges<class_Image_method_fix_alpha_edges>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`flip_x<class_Image_method_flip_x>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`flip_y<class_Image_method_flip_y>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`generate_mipmaps<class_Image_method_generate_mipmaps>`\ (\ renormalize\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`get_data<class_Image_method_get_data>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_data_size<class_Image_method_get_data_size>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Format<enum_Image_Format>` | :ref:`get_format<class_Image_method_get_format>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_height<class_Image_method_get_height>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_mipmap_count<class_Image_method_get_mipmap_count>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_mipmap_offset<class_Image_method_get_mipmap_offset>`\ (\ mipmap\: :ref:`int<class_int>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_pixel<class_Image_method_get_pixel>`\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_pixelv<class_Image_method_get_pixelv>`\ (\ point\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`get_region<class_Image_method_get_region>`\ (\ region\: :ref:`Rect2i<class_Rect2i>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_size<class_Image_method_get_size>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Rect2i<class_Rect2i>` | :ref:`get_used_rect<class_Image_method_get_used_rect>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_width<class_Image_method_get_width>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_mipmaps<class_Image_method_has_mipmaps>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_compressed<class_Image_method_is_compressed>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_empty<class_Image_method_is_empty>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_invisible<class_Image_method_is_invisible>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`linear_to_srgb<class_Image_method_linear_to_srgb>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load<class_Image_method_load>`\ (\ path\: :ref:`String<class_String>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_bmp_from_buffer<class_Image_method_load_bmp_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_dds_from_buffer<class_Image_method_load_dds_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_exr_from_buffer<class_Image_method_load_exr_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`load_from_file<class_Image_method_load_from_file>`\ (\ path\: :ref:`String<class_String>`\ ) |static| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_jpg_from_buffer<class_Image_method_load_jpg_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_ktx_from_buffer<class_Image_method_load_ktx_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_png_from_buffer<class_Image_method_load_png_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_svg_from_buffer<class_Image_method_load_svg_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`, scale\: :ref:`float<class_float>` = 1.0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_svg_from_string<class_Image_method_load_svg_from_string>`\ (\ svg_str\: :ref:`String<class_String>`, scale\: :ref:`float<class_float>` = 1.0\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_tga_from_buffer<class_Image_method_load_tga_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_webp_from_buffer<class_Image_method_load_webp_from_buffer>`\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`normal_map_to_xy<class_Image_method_normal_map_to_xy>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`premultiply_alpha<class_Image_method_premultiply_alpha>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`resize<class_Image_method_resize>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, interpolation\: :ref:`Interpolation<enum_Image_Interpolation>` = 1\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`resize_to_po2<class_Image_method_resize_to_po2>`\ (\ square\: :ref:`bool<class_bool>` = false, interpolation\: :ref:`Interpolation<enum_Image_Interpolation>` = 1\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Image<class_Image>` | :ref:`rgbe_to_srgb<class_Image_method_rgbe_to_srgb>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rotate_90<class_Image_method_rotate_90>`\ (\ direction\: :ref:`ClockDirection<enum_@GlobalScope_ClockDirection>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`rotate_180<class_Image_method_rotate_180>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_dds<class_Image_method_save_dds>`\ (\ path\: :ref:`String<class_String>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_dds_to_buffer<class_Image_method_save_dds_to_buffer>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_exr<class_Image_method_save_exr>`\ (\ path\: :ref:`String<class_String>`, grayscale\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_exr_to_buffer<class_Image_method_save_exr_to_buffer>`\ (\ grayscale\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_jpg<class_Image_method_save_jpg>`\ (\ path\: :ref:`String<class_String>`, quality\: :ref:`float<class_float>` = 0.75\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_jpg_to_buffer<class_Image_method_save_jpg_to_buffer>`\ (\ quality\: :ref:`float<class_float>` = 0.75\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_png<class_Image_method_save_png>`\ (\ path\: :ref:`String<class_String>`\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_png_to_buffer<class_Image_method_save_png_to_buffer>`\ (\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_webp<class_Image_method_save_webp>`\ (\ path\: :ref:`String<class_String>`, lossy\: :ref:`bool<class_bool>` = false, quality\: :ref:`float<class_float>` = 0.75\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`save_webp_to_buffer<class_Image_method_save_webp_to_buffer>`\ (\ lossy\: :ref:`bool<class_bool>` = false, quality\: :ref:`float<class_float>` = 0.75\ ) |const| |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_data<class_Image_method_set_data>`\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_pixel<class_Image_method_set_pixel>`\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_pixelv<class_Image_method_set_pixelv>`\ (\ point\: :ref:`Vector2i<class_Vector2i>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`shrink_x2<class_Image_method_shrink_x2>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`srgb_to_linear<class_Image_method_srgb_to_linear>`\ (\ ) |
|
||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Переліки
|
||
----------------
|
||
|
||
.. _enum_Image_Format:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Format**: :ref:`🔗<enum_Image_Format>`
|
||
|
||
.. _class_Image_constant_FORMAT_L8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_L8** = ``0``
|
||
|
||
Формат тексту з односторонньою шириною 8-біту, що представляє просвіт.
|
||
|
||
.. _class_Image_constant_FORMAT_LA8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_LA8** = ``1``
|
||
|
||
OpenGL формат текстури з двома значеннями, luminance і alpha кожен, що зберігається з 8 біт.
|
||
|
||
.. _class_Image_constant_FORMAT_R8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_R8** = ``2``
|
||
|
||
OpenGL формат текстури ``RED`` з одним компонентом і трохи глибиною 8.
|
||
|
||
.. _class_Image_constant_FORMAT_RG8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RG8** = ``3``
|
||
|
||
Формат текстури OpenGL ``RG`` з двома компонентами і трохи глибиною 8 для кожного.
|
||
|
||
.. _class_Image_constant_FORMAT_RGB8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGB8** = ``4``
|
||
|
||
OpenGL texture format ``RGB`` with three components, each with a bitdepth of 8.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBA8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBA8** = ``5``
|
||
|
||
OpenGL texture format ``RGBA`` with four components, each with a bitdepth of 8.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBA4444:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBA4444** = ``6``
|
||
|
||
OpenGL формат текстури ``RGBA`` з чотирма компонентами, кожен з трохи глибиною 4.
|
||
|
||
.. _class_Image_constant_FORMAT_RGB565:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGB565** = ``7``
|
||
|
||
Формат текстури OpenGL ``RGB`` з трьома компонентами. Червоні і сині мають трохи глибиною 5, а зелений має трохи глибиною 6.
|
||
|
||
.. _class_Image_constant_FORMAT_RF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RF** = ``8``
|
||
|
||
Формат текстури OpenGL ``GL_R32F``, де є один компонент, 32-bit, плаваючі точки значення.
|
||
|
||
.. _class_Image_constant_FORMAT_RGF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGF** = ``9``
|
||
|
||
Формат текстури OpenGL ``GL_RG32F`` де є два компоненти, кожен 32-bit плаваючі значення точки.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBF** = ``10``
|
||
|
||
Формат текстури OpenGL ``GL_RGB32F`` де є три компоненти, кожен 32-bit плаваючі значення точки.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBAF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBAF** = ``11``
|
||
|
||
Формат текстури OpenGL ``GL_RGBA32F`` де є чотири компоненти, кожен 32-bit плаваючі значення точки.
|
||
|
||
.. _class_Image_constant_FORMAT_RH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RH** = ``12``
|
||
|
||
Формат текстури OpenGL ``GL_R16F`` де є один компонент, 16-bit "half-precision" плавно-точкове значення.
|
||
|
||
.. _class_Image_constant_FORMAT_RGH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGH** = ``13``
|
||
|
||
Формат текстури OpenGL ``GL_RG16F`` де є два компоненти, кожен 16-bit "half-precision" плавно-точкове значення.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBH** = ``14``
|
||
|
||
Формат текстури OpenGL ``GL_RGB16F`` де є три компоненти, кожен 16-bit "half-precision" плавно-точкове значення.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBAH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBAH** = ``15``
|
||
|
||
Формат текстури OpenGL ``GL_RGBA16F`` де є чотири компоненти, кожен 16-bit "half-precision" плаваюча точка значення.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBE9995:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBE9995** = ``16``
|
||
|
||
Особливий формат OpenGL текстури, де три компоненти кольору мають 9 біт точності і всі три діляться один 5-бітний експонент.
|
||
|
||
.. _class_Image_constant_FORMAT_DXT1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_DXT1** = ``17``
|
||
|
||
The `S3TC <https://en.wikipedia.org/wiki/S3_Texture_Compression>`__ texture format that uses Block Compression 1, and is the smallest variation of S3TC, only providing 1 bit of alpha and color data being premultiplied with alpha.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_DXT3:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_DXT3** = ``18``
|
||
|
||
The `S3TC <https://en.wikipedia.org/wiki/S3_Texture_Compression>`__ texture format that uses Block Compression 2, and color data is interpreted as not having been premultiplied by alpha. Well suited for images with sharp alpha transitions between translucent and opaque areas.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_DXT5:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_DXT5** = ``19``
|
||
|
||
The `S3TC <https://en.wikipedia.org/wiki/S3_Texture_Compression>`__ texture format also known as Block Compression 3 or BC3 that contains 64 bits of alpha channel data followed by 64 bits of DXT1-encoded color data. Color data is not premultiplied by alpha, same as DXT3. DXT5 generally produces superior results for transparent gradients compared to DXT3.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_RGTC_R:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGTC_R** = ``20``
|
||
|
||
Формат Текстури, який використовує `Red Green Texture Compression <https://www.khronos.org/opengl/wiki/Red_Green_Texture_Compression>`__, нормалізуючи дані каналу за допомогою алгоритму стиснення, який використовує DXT5 для альфа-каналу.
|
||
|
||
.. _class_Image_constant_FORMAT_RGTC_RG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGTC_RG** = ``21``
|
||
|
||
Формат Текстури, який використовує `Red Green Texture Compression <https://www.khronos.org/opengl/wiki/Red_Green_Texture_Compression>`__, нормалізує дані червоної та зеленої каналу за допомогою алгоритму стиснення, який DXT5 використовує для альфа-каналу.
|
||
|
||
.. _class_Image_constant_FORMAT_BPTC_RGBA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_BPTC_RGBA** = ``22``
|
||
|
||
Texture format that uses `BPTC <https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression>`__ compression with unsigned normalized RGBA components.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_BPTC_RGBF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_BPTC_RGBF** = ``23``
|
||
|
||
Формат тексту, який використовує `BPTC <https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression>`__ стиснення з підписаними компонентами RGB.
|
||
|
||
.. _class_Image_constant_FORMAT_BPTC_RGBFU:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_BPTC_RGBFU** = ``24``
|
||
|
||
Формат Текстури, який використовує `BPTC <https://www.khronos.org/opengl/wiki/BPTC_Texture_Compression>`__ стиснення з не позначеними компонентами RGB.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC** = ``25``
|
||
|
||
`Ericsson Texture Compression format 1 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC1>`__, також згадується як "ETC1", так і є частиною графіки OpenGL ES. Цей формат не може зберігати альфа-канал.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_R11:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_R11** = ``26``
|
||
|
||
`Ericsson Texture Compression формат 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``R11_EAC`` варіант), який забезпечує один канал не позначених даних.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_R11S:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_R11S** = ``27``
|
||
|
||
`Ericsson Texture Compression формат 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``SIGNED_R11_EAC`` варіант), який забезпечує один канал підписаних даних.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RG11:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RG11** = ``28``
|
||
|
||
`Ericsson Texture Compression формат 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RG11_EAC`` варіант), який забезпечує два канали не позначених даних.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RG11S:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RG11S** = ``29``
|
||
|
||
`Ericsson Texture Compression формат 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``SIGNED_RG11_EAC`` варіант), який надає два канали підписаних даних.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RGB8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RGB8** = ``30``
|
||
|
||
`Ericsson Texture Compression format 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RGB8`` variant), which is a follow-up of ETC1 and compresses RGB888 data.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RGBA8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RGBA8** = ``31``
|
||
|
||
`Ericsson Texture Compression format 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RGBA8``\ variant), which compresses RGBA8888 data with full alpha support.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RGB8A1:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RGB8A1** = ``32``
|
||
|
||
`Ericsson Texture Compression format 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RGB8_PUNCHTHROUGH_ALPHA1`` variant), which compresses RGBA data to make alpha either fully transparent or fully opaque.
|
||
|
||
\ **Note:** When creating an :ref:`ImageTexture<class_ImageTexture>`, a nonlinear sRGB to linear encoding conversion is performed.
|
||
|
||
.. _class_Image_constant_FORMAT_ETC2_RA_AS_RG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ETC2_RA_AS_RG** = ``33``
|
||
|
||
`Ericsson Texture Compression формат 2 <https://en.wikipedia.org/wiki/Ericsson_Texture_Compression#ETC2_and_EAC>`__ (``RGBA8``), який компресує дані та інтерпретує його як два канали (червоний та зелений). Дивись також :ref:`FORMAT_ETC2_RGBA8<class_Image_constant_FORMAT_ETC2_RGBA8>`.
|
||
|
||
.. _class_Image_constant_FORMAT_DXT5_RA_AS_RG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_DXT5_RA_AS_RG** = ``34``
|
||
|
||
`S3TC <https://en.wikipedia.org/wiki/S3_Texture_Compression>`__ фактурний формат також відомий як Block Compression 3 або BC3, який компресує дані та інтерпретує його як два канали (червоний і зелений). Дивитися також :ref:`FORMAT_DXT5<class_Image_constant_FORMAT_DXT5>`.
|
||
|
||
.. _class_Image_constant_FORMAT_ASTC_4x4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ASTC_4x4** = ``35``
|
||
|
||
` Адаптивна кальмарована текстура стиснення <https://en.wikipedia.org/wiki/configive_scalable_texture_compression>`__. Це реалізує режим 4×4 (висока якість).
|
||
|
||
.. _class_Image_constant_FORMAT_ASTC_4x4_HDR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ASTC_4x4_HDR** = ``36``
|
||
|
||
Same format as :ref:`FORMAT_ASTC_4x4<class_Image_constant_FORMAT_ASTC_4x4>`, але з натяком, щоб дати GPU знати його використовується для HDR.
|
||
|
||
.. _class_Image_constant_FORMAT_ASTC_8x8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ASTC_8x8** = ``37``
|
||
|
||
` Адаптивна кальмарована текстура стиснення <https://en.wikipedia.org/wiki/configive_scalable_texture_compression>`__. Це реалізує режим 8×8 (нижча якість).
|
||
|
||
.. _class_Image_constant_FORMAT_ASTC_8x8_HDR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_ASTC_8x8_HDR** = ``38``
|
||
|
||
Same format as :ref:`FORMAT_ASTC_8x8<class_Image_constant_FORMAT_ASTC_8x8>`, але з натяком, щоб дати GPU знати його використовується для HDR.
|
||
|
||
.. _class_Image_constant_FORMAT_R16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_R16** = ``39``
|
||
|
||
OpenGL texture format ``GL_R16`` where there's one component, a 16-bit unsigned normalized integer value. Since the value is normalized, each component is clamped between ``0.0`` and ``1.0`` (inclusive).
|
||
|
||
\ **Note:** Due to limited hardware support, it is mainly recommended to be used on desktop or console devices. It may be unsupported on mobile or web, and will consequently be converted to :ref:`FORMAT_RF<class_Image_constant_FORMAT_RF>`.
|
||
|
||
.. _class_Image_constant_FORMAT_RG16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RG16** = ``40``
|
||
|
||
OpenGL texture format ``GL_RG16`` where there are two components, each a 16-bit unsigned normalized integer value. Since the value is normalized, each component is clamped between ``0.0`` and ``1.0`` (inclusive).
|
||
|
||
\ **Note:** Due to limited hardware support, it is mainly recommended to be used on desktop or console devices. It may be unsupported on mobile or web, and will consequently be converted to :ref:`FORMAT_RGF<class_Image_constant_FORMAT_RGF>`.
|
||
|
||
.. _class_Image_constant_FORMAT_RGB16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGB16** = ``41``
|
||
|
||
OpenGL texture format ``GL_RGB16`` where there are three components, each a 16-bit unsigned normalized integer value. Since the value is normalized, each component is clamped between ``0.0`` and ``1.0`` (inclusive).
|
||
|
||
\ **Note:** Due to limited hardware support, it is mainly recommended to be used on desktop or console devices. It may be unsupported on mobile or web, and will consequently be converted to :ref:`FORMAT_RGBF<class_Image_constant_FORMAT_RGBF>`.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBA16:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBA16** = ``42``
|
||
|
||
OpenGL texture format ``GL_RGBA16`` where there are four components, each a 16-bit unsigned normalized integer value. Since the value is normalized, each component is clamped between ``0.0`` and ``1.0`` (inclusive).
|
||
|
||
\ **Note:** Due to limited hardware support, it is mainly recommended to be used on desktop or console devices. It may be unsupported on mobile or web, and will consequently be converted to :ref:`FORMAT_RGBAF<class_Image_constant_FORMAT_RGBAF>`.
|
||
|
||
.. _class_Image_constant_FORMAT_R16I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_R16I** = ``43``
|
||
|
||
OpenGL texture format ``GL_R16UI`` where there's one component, a 16-bit unsigned integer value. Each component is clamped between ``0`` and ``65535`` (inclusive).
|
||
|
||
\ **Note:** When used in a shader, the texture requires usage of ``usampler`` samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
|
||
|
||
\ **Note:** When sampling using :ref:`get_pixel()<class_Image_method_get_pixel>`, returned :ref:`Color<class_Color>`\ s have to be divided by ``65535`` to get the correct color value.
|
||
|
||
.. _class_Image_constant_FORMAT_RG16I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RG16I** = ``44``
|
||
|
||
OpenGL texture format ``GL_RG16UI`` where there are two components, each a 16-bit unsigned integer value. Each component is clamped between ``0`` and ``65535`` (inclusive).
|
||
|
||
\ **Note:** When used in a shader, the texture requires usage of ``usampler`` samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
|
||
|
||
\ **Note:** When sampling using :ref:`get_pixel()<class_Image_method_get_pixel>`, returned :ref:`Color<class_Color>`\ s have to be divided by ``65535`` to get the correct color value.
|
||
|
||
.. _class_Image_constant_FORMAT_RGB16I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGB16I** = ``45``
|
||
|
||
OpenGL texture format ``GL_RGB16UI`` where there are three components, each a 16-bit unsigned integer value. Each component is clamped between ``0`` and ``65535`` (inclusive).
|
||
|
||
\ **Note:** When used in a shader, the texture requires usage of ``usampler`` samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
|
||
|
||
\ **Note:** When sampling using :ref:`get_pixel()<class_Image_method_get_pixel>`, returned :ref:`Color<class_Color>`\ s have to be divided by ``65535`` to get the correct color value.
|
||
|
||
.. _class_Image_constant_FORMAT_RGBA16I:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_RGBA16I** = ``46``
|
||
|
||
OpenGL texture format ``GL_RGBA16UI`` where there are four components, each a 16-bit unsigned integer value. Each component is clamped between ``0`` and ``65535`` (inclusive).
|
||
|
||
\ **Note:** When used in a shader, the texture requires usage of ``usampler`` samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
|
||
|
||
\ **Note:** When sampling using :ref:`get_pixel()<class_Image_method_get_pixel>`, returned :ref:`Color<class_Color>`\ s have to be divided by ``65535`` to get the correct color value.
|
||
|
||
.. _class_Image_constant_FORMAT_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Format<enum_Image_Format>` **FORMAT_MAX** = ``47``
|
||
|
||
Представляємо розмір :ref:`Format<enum_Image_Format>` enum.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_Interpolation:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Interpolation**: :ref:`🔗<enum_Image_Interpolation>`
|
||
|
||
.. _class_Image_constant_INTERPOLATE_NEAREST:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_NEAREST** = ``0``
|
||
|
||
Виконує міжпольацію найближчих сусідів. Якщо зображення негабаритне, він буде піксельним.
|
||
|
||
.. _class_Image_constant_INTERPOLATE_BILINEAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_BILINEAR** = ``1``
|
||
|
||
Виконує дволінійну інтерполяція. Якщо образ негабаритний, він буде розмитим. Цей режим швидше, ніж :ref:`INTERPOLATE_CUBIC<class_Image_constant_INTERPOLATE_CUBIC>`, але це призводить до меншої якості.
|
||
|
||
.. _class_Image_constant_INTERPOLATE_CUBIC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_CUBIC** = ``2``
|
||
|
||
Виконує кубічне міжполування. Якщо образ негабаритний, він буде розмитим. Цей режим часто дає кращі результати у порівнянні з :ref:`INTERPOLATE_BILINEAR<class_Image_constant_INTERPOLATE_BILINEAR>`, за вартістю повільніше.
|
||
|
||
.. _class_Image_constant_INTERPOLATE_TRILINEAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_TRILINEAR** = ``3``
|
||
|
||
Виконує дволінійну окремо на двох найбільш костюмованих рівнях mipmap, після чого лінійно між ними.
|
||
|
||
Це повільніше, ніж :ref:`INTERPOLATE_BILINEAR<class_Image_constant_INTERPOLATE_BILINEAR>`, але виробляє більш якісні результати з набагато меншою кількістю ілюзуючих артефактів.
|
||
|
||
Якщо зображення не має mipmaps, вони будуть створюватися і використовуватися внутрішньо, але не буде створюватися на отриманому зображенні.
|
||
|
||
\ **Примітка:** Якщо ви плануєте масштабувати декілька копій оригінального зображення, краще викликати :ref:`генер_mipmaps()<class_Image_method_генер_mipmaps>`, щоб уникнути переробної потужності у генеруванні їх знову і знову.
|
||
|
||
З іншого боку, якщо зображення вже має mipmaps, вони будуть використані, і новий набір буде створений для отриманого зображення.
|
||
|
||
.. _class_Image_constant_INTERPOLATE_LANCZOS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Interpolation<enum_Image_Interpolation>` **INTERPOLATE_LANCZOS** = ``4``
|
||
|
||
Виконує інтерполяції Ланчосу. Це найшвидший режим редагування зображень, але він зазвичай дає найкращі результати, особливо коли знижує зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_AlphaMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **AlphaMode**: :ref:`🔗<enum_Image_AlphaMode>`
|
||
|
||
.. _class_Image_constant_ALPHA_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`AlphaMode<enum_Image_AlphaMode>` **ALPHA_NONE** = ``0``
|
||
|
||
Image is fully opaque. It does not store alpha data.
|
||
|
||
.. _class_Image_constant_ALPHA_BIT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`AlphaMode<enum_Image_AlphaMode>` **ALPHA_BIT** = ``1``
|
||
|
||
Image stores either fully opaque or fully transparent pixels. Also known as punchthrough alpha.
|
||
|
||
.. _class_Image_constant_ALPHA_BLEND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`AlphaMode<enum_Image_AlphaMode>` **ALPHA_BLEND** = ``2``
|
||
|
||
Image stores alpha data with values varying between ``0.0`` and ``1.0``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_CompressMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **CompressMode**: :ref:`🔗<enum_Image_CompressMode>`
|
||
|
||
.. _class_Image_constant_COMPRESS_S3TC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_S3TC** = ``0``
|
||
|
||
Використовуйте стиснення S3TC.
|
||
|
||
.. _class_Image_constant_COMPRESS_ETC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_ETC** = ``1``
|
||
|
||
Використовуйте стиснення ETC.
|
||
|
||
.. _class_Image_constant_COMPRESS_ETC2:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_ETC2** = ``2``
|
||
|
||
Використовуйте стиснення ETC2.
|
||
|
||
.. _class_Image_constant_COMPRESS_BPTC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_BPTC** = ``3``
|
||
|
||
Використовуйте стиснення BPTC.
|
||
|
||
.. _class_Image_constant_COMPRESS_ASTC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_ASTC** = ``4``
|
||
|
||
Використовуйте стиснення ASTC.
|
||
|
||
.. _class_Image_constant_COMPRESS_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressMode<enum_Image_CompressMode>` **COMPRESS_MAX** = ``5``
|
||
|
||
Представляємо розмір :ref:`CompressMode<enum_Image_CompressMode>` enum.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_UsedChannels:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **UsedChannels**: :ref:`🔗<enum_Image_UsedChannels>`
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_L:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_L** = ``0``
|
||
|
||
Тільки зображення використовується один канал для блиску (сірий масштаб).
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_LA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_LA** = ``1``
|
||
|
||
Зображення використовує два канали для luminance і alpha, відповідно.
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_R:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_R** = ``2``
|
||
|
||
Зображення використовується тільки в червоному каналі.
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_RG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_RG** = ``3``
|
||
|
||
Зображення використовує два канали для червоного і зеленого.
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_RGB:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_RGB** = ``4``
|
||
|
||
Зображення використовує три канали для червоного, зеленого та синього кольору.
|
||
|
||
.. _class_Image_constant_USED_CHANNELS_RGBA:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **USED_CHANNELS_RGBA** = ``5``
|
||
|
||
Зображення використовує чотири канали для червоного, зеленого, синього та альфа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_CompressSource:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **CompressSource**: :ref:`🔗<enum_Image_CompressSource>`
|
||
|
||
.. _class_Image_constant_COMPRESS_SOURCE_GENERIC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressSource<enum_Image_CompressSource>` **COMPRESS_SOURCE_GENERIC** = ``0``
|
||
|
||
Основна текстура (збереження) є регулярною текстурою. За замовчуванням для всіх текстур.
|
||
|
||
.. _class_Image_constant_COMPRESS_SOURCE_SRGB:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressSource<enum_Image_CompressSource>` **COMPRESS_SOURCE_SRGB** = ``1``
|
||
|
||
Source texture (before compression) uses nonlinear sRGB encoding.
|
||
|
||
.. _class_Image_constant_COMPRESS_SOURCE_NORMAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`CompressSource<enum_Image_CompressSource>` **COMPRESS_SOURCE_NORMAL** = ``2``
|
||
|
||
Основна текстура (збереження) є нормальною текстурою (наприклад, її можна стискати на два канали).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Image_ASTCFormat:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ASTCFormat**: :ref:`🔗<enum_Image_ASTCFormat>`
|
||
|
||
.. _class_Image_constant_ASTC_FORMAT_4x4:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ASTCFormat<enum_Image_ASTCFormat>` **ASTC_FORMAT_4x4** = ``0``
|
||
|
||
Знайте, щоб вказати, що якість 4 × 4 формат стиснення ASTC слід використовувати.
|
||
|
||
.. _class_Image_constant_ASTC_FORMAT_8x8:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ASTCFormat<enum_Image_ASTCFormat>` **ASTC_FORMAT_8x8** = ``1``
|
||
|
||
Знайте, щоб вказати, що низька якість 8 × 8 формат стиснення ASTC слід використовувати.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Константи
|
||
------------------
|
||
|
||
.. _class_Image_constant_MAX_WIDTH:
|
||
|
||
.. rst-class:: classref-constant
|
||
|
||
**MAX_WIDTH** = ``16777216`` :ref:`🔗<class_Image_constant_MAX_WIDTH>`
|
||
|
||
Максимальна ширина дозволена для ресурсів **Image**.
|
||
|
||
.. _class_Image_constant_MAX_HEIGHT:
|
||
|
||
.. rst-class:: classref-constant
|
||
|
||
**MAX_HEIGHT** = ``16777216`` :ref:`🔗<class_Image_constant_MAX_HEIGHT>`
|
||
|
||
Максимальна висота дозволена для ресурсів **Image**.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описи властивостей
|
||
------------------------------------
|
||
|
||
.. _class_Image_property_data:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Dictionary<class_Dictionary>` **data** = ``{ "data": PackedByteArray(), "format": "Lum8", "height": 0, "mipmaps": false, "width": 0 }`` :ref:`🔗<class_Image_property_data>`
|
||
|
||
Увімкніть всі дані кольору зображення в заданому форматі. Дивитися :ref:`Format<enum_Image_Format>` постійні.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описи методів
|
||
--------------------------
|
||
|
||
.. _class_Image_method_adjust_bcs:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **adjust_bcs**\ (\ brightness\: :ref:`float<class_float>`, contrast\: :ref:`float<class_float>`, saturation\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Image_method_adjust_bcs>`
|
||
|
||
Налаштовує параметри ``brightness``, ``contrast`` та ``saturation`` цього зображення на задані значення. Не працює, якщо зображення стиснуте (див. :ref:`is_compressed()<class_Image_method_is_compressed>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_blend_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **blend_rect**\ (\ src\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Image_method_blend_rect>`
|
||
|
||
Alpha-blends ``src_rect`` з ``src`` зображення до цього зображення на координатах ``dst``, закріплений відповідно до обох сторін зображення. Цей образ і ``src`` зображення **must** мають однаковий формат. ``src_rect`` з непозитивним розміром обробляється як порожній.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_blend_rect_mask:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **blend_rect_mask**\ (\ src\: :ref:`Image<class_Image>`, mask\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Image_method_blend_rect_mask>`
|
||
|
||
Alpha-blends ``src_rect`` з ``src`` зображення до цього зображення за допомогою ``Mask`` зображення на координатах ``dst``, кліппед відповідно до обох сторін зображення. Альфа-канали потрібні як для ``src``, так і ``Mask``. ``dst`` пікселів і ``src`` пікселів будуть змішані, якщо відповідне значення aльфа-пікселя не 0. Цей образ і ``src`` зображення **must** мають однаковий формат. ``src`` зображення і ``Mask`` зображення **must** мають однаковий розмір (ширина і висота), але вони можуть мати різні формати. ``src_rect`` з непозитивним розміром обробляється як порожній.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_blit_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **blit_rect**\ (\ src\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Image_method_blit_rect>`
|
||
|
||
Копіює ``src_rect`` із зображення ``src`` у це зображення за координатами ``dst``, обрізаючи відповідно до обох меж зображення. Це зображення та зображення ``src`` **повинні** мати однаковий формат. ``src_rect`` із неподатним розміром розглядається як порожній.
|
||
|
||
\ **Примітка:** Дані альфа-каналу в ``src`` перезапишуть відповідні дані на цьому зображенні в цільовій позиції. Для змішування альфа-каналів замість цього використовуйте :ref:`blend_rect()<class_Image_method_blend_rect>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_blit_rect_mask:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **blit_rect_mask**\ (\ src\: :ref:`Image<class_Image>`, mask\: :ref:`Image<class_Image>`, src_rect\: :ref:`Rect2i<class_Rect2i>`, dst\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Image_method_blit_rect_mask>`
|
||
|
||
Blits ``src_rect`` область з ``src`` зображення до цього зображення на координатах, надані ``dst``, закріплений відповідно до обох сторін зображення. ``src`` піксель копіюється на ``dst``, якщо відповідна ``Mask`` значення альфа-пікселя не 0. Цей образ і ``src`` зображення **must** мають однаковий формат. ``src`` зображення і ``Mask`` зображення **must** мають однаковий розмір (ширина і висота), але вони можуть мати різні формати. ``src_rect`` з непозитивним розміром обробляється як порожній.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_bump_map_to_normal_map:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **bump_map_to_normal_map**\ (\ bump_scale\: :ref:`float<class_float>` = 1.0\ ) :ref:`🔗<class_Image_method_bump_map_to_normal_map>`
|
||
|
||
Перетворює bump карту в нормальну карту. Карта bump забезпечує вихід висоти на піксель, при цьому нормальна карта забезпечує нормальний напрямок на піксель.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_clear_mipmaps:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear_mipmaps**\ (\ ) :ref:`🔗<class_Image_method_clear_mipmaps>`
|
||
|
||
Видаліть мапи зображень.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_compress:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **compress**\ (\ mode\: :ref:`CompressMode<enum_Image_CompressMode>`, source\: :ref:`CompressSource<enum_Image_CompressSource>` = 0, astc_format\: :ref:`ASTCFormat<enum_Image_ASTCFormat>` = 0\ ) :ref:`🔗<class_Image_method_compress>`
|
||
|
||
Compresses the image with a VRAM-compressed format to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available.
|
||
|
||
The ``source`` parameter helps to pick the best compression method for DXT and ETC2 formats. It is ignored for ASTC compression.
|
||
|
||
The ``astc_format`` parameter is only taken into account when using ASTC compression; it is ignored for all other formats.
|
||
|
||
\ **Note:** :ref:`compress()<class_Image_method_compress>` is only supported in editor builds. When run in an exported project, this method always returns :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_compress_from_channels:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **compress_from_channels**\ (\ mode\: :ref:`CompressMode<enum_Image_CompressMode>`, channels\: :ref:`UsedChannels<enum_Image_UsedChannels>`, astc_format\: :ref:`ASTCFormat<enum_Image_ASTCFormat>` = 0\ ) :ref:`🔗<class_Image_method_compress_from_channels>`
|
||
|
||
Compresses the image with a VRAM-compressed format to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available.
|
||
|
||
This is an alternative to :ref:`compress()<class_Image_method_compress>` that lets the user supply the channels used in order for the compressor to pick the best DXT and ETC2 formats. For other formats (non DXT or ETC2), this argument is ignored.
|
||
|
||
The ``astc_format`` parameter is only taken into account when using ASTC compression; it is ignored for all other formats.
|
||
|
||
\ **Note:** :ref:`compress_from_channels()<class_Image_method_compress_from_channels>` is only supported in editor builds. When run in an exported project, this method always returns :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_compute_image_metrics:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Dictionary<class_Dictionary>` **compute_image_metrics**\ (\ compared_image\: :ref:`Image<class_Image>`, use_luma\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Image_method_compute_image_metrics>`
|
||
|
||
Compute image metrics on the current image and the compared image. This can be used to calculate the similarity between two images.
|
||
|
||
The dictionary contains ``max``, ``mean``, ``mean_squared``, ``root_mean_squared`` and ``peak_snr``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_convert:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **convert**\ (\ format\: :ref:`Format<enum_Image_Format>`\ ) :ref:`🔗<class_Image_method_convert>`
|
||
|
||
Конвертує формат цього зображення у вказаний ``format``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_copy_from:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **copy_from**\ (\ src\: :ref:`Image<class_Image>`\ ) :ref:`🔗<class_Image_method_copy_from>`
|
||
|
||
Копії ``src`` зображення на це зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_create:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **create**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`\ ) |static| :ref:`🔗<class_Image_method_create>`
|
||
|
||
**Застаріло:** Use :ref:`create_empty()<class_Image_method_create_empty>`.
|
||
|
||
Creates an empty image of the given size and format. If ``use_mipmaps`` is ``true``, generates mipmaps for this image (see :ref:`generate_mipmaps()<class_Image_method_generate_mipmaps>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_create_empty:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **create_empty**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`\ ) |static| :ref:`🔗<class_Image_method_create_empty>`
|
||
|
||
Creates an empty image of the given size and format. If ``use_mipmaps`` is ``true``, generates mipmaps for this image (see :ref:`generate_mipmaps()<class_Image_method_generate_mipmaps>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_create_from_data:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **create_from_data**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |static| :ref:`🔗<class_Image_method_create_from_data>`
|
||
|
||
Створює нове зображення заданого розміру та формату. Заповнює зображення заданими необробленими даними. Якщо ``use_mipmaps`` має значення ``true``, завантажує mipmapy для цього зображення з ``data``. Див. :ref:`generate_mipmaps()<class_Image_method_generate_mipmaps>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_crop:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **crop**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Image_method_crop>`
|
||
|
||
Обрізає зображення до заданих значень ``width`` та ``height``. Якщо заданий розмір більший за поточний розмір, додаткова область заповнюється чорними пікселями.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_decompress:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **decompress**\ (\ ) :ref:`🔗<class_Image_method_decompress>`
|
||
|
||
Decompresses the image if it is VRAM-compressed in a supported format. This increases memory utilization, but allows modifying the image. Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` if the format is supported, otherwise :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>`. All VRAM-compressed formats supported by Godot can be decompressed with this method, except :ref:`FORMAT_ETC2_R11S<class_Image_constant_FORMAT_ETC2_R11S>`, :ref:`FORMAT_ETC2_RG11S<class_Image_constant_FORMAT_ETC2_RG11S>`, and :ref:`FORMAT_ETC2_RGB8A1<class_Image_constant_FORMAT_ETC2_RGB8A1>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_detect_alpha:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`AlphaMode<enum_Image_AlphaMode>` **detect_alpha**\ (\ ) |const| :ref:`🔗<class_Image_method_detect_alpha>`
|
||
|
||
Повернення :ref:`ALPHA_BLEND<class_Image_constant_ALPHA_BLEND>` якщо зображення має дані для значень альфа. Повернення :ref:`ALPHA_BIT<class_Image_constant_ALPHA_BIT>` якщо всі значення альфа зберігаються в одному біті. Повернення :ref:`ALPHA_NONE<class_Image_constant_ALPHA_NONE>` якщо не знайдено даних для значень альфа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_detect_used_channels:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`UsedChannels<enum_Image_UsedChannels>` **detect_used_channels**\ (\ source\: :ref:`CompressSource<enum_Image_CompressSource>` = 0\ ) |const| :ref:`🔗<class_Image_method_detect_used_channels>`
|
||
|
||
Повертає колірні канали, що використовуються цим зображенням. Якщо зображення стиснуте, необхідно вказати оригінальний ``source``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_fill:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **fill**\ (\ color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Image_method_fill>`
|
||
|
||
Заповнює зображення за допомогою ``color``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_fill_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **fill_rect**\ (\ rect\: :ref:`Rect2i<class_Rect2i>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Image_method_fill_rect>`
|
||
|
||
Заповнює ``ct`` з ``color``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_fix_alpha_edges:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **fix_alpha_edges**\ (\ ) :ref:`🔗<class_Image_method_fix_alpha_edges>`
|
||
|
||
Blends з низьким альфа-пікселем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_flip_x:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **flip_x**\ (\ ) :ref:`🔗<class_Image_method_flip_x>`
|
||
|
||
Затискає зображення горизонтально.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_flip_y:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **flip_y**\ (\ ) :ref:`🔗<class_Image_method_flip_y>`
|
||
|
||
Затискає зображення вертикально.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_generate_mipmaps:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **generate_mipmaps**\ (\ renormalize\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_Image_method_generate_mipmaps>`
|
||
|
||
Генерація міток для зображення. Mipmaps - це заготовлені копії нижньої роздільної здатності зображення, які автоматично використовуються, якщо зображення потрібно масштабувати при наведенні. Вони допомагають поліпшити якість зображення і продуктивність при рендерингу. Цей метод повертає помилку, якщо зображення стискається, у користувацькому форматі, або якщо ширина зображення / вага зображення ``0``. Включення ``renormalize`` при генеруванні mipmaps для нормальної текстури карти переконайтеся, що всі отримані значення вектора нормалізуються.
|
||
|
||
Можна перевірити, чи має зображення mipmaps, зателефонувавши :ref:`has_mipmaps()<class_Image_method_has_mipmaps>` або :ref:`get_mipmap_count()<class_Image_method_get_mipmap_count>`. Дзвінки :ref:`генерувати_mipmaps()<class_Image_method_генерувати_mipmaps>` на зображення, яке вже має mipmaps, замінить існуючі mipmaps у зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_data:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **get_data**\ (\ ) |const| :ref:`🔗<class_Image_method_get_data>`
|
||
|
||
Повертає копію даних зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_data_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_data_size**\ (\ ) |const| :ref:`🔗<class_Image_method_get_data_size>`
|
||
|
||
Повертає розмір (в байтах) сировини.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_format:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Format<enum_Image_Format>` **get_format**\ (\ ) |const| :ref:`🔗<class_Image_method_get_format>`
|
||
|
||
Повертає формат цього зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_height:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_height**\ (\ ) |const| :ref:`🔗<class_Image_method_get_height>`
|
||
|
||
Повертає висоту зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_mipmap_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_mipmap_count**\ (\ ) |const| :ref:`🔗<class_Image_method_get_mipmap_count>`
|
||
|
||
Повертає кількість рівнів mipmap або 0, якщо зображення не має mipmaps. Найбільший основний рівень зображення не підраховується як рівень mipmap за цим методом, так що якщо ви хочете включити його можна додати до цього підрахунку 1.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_mipmap_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_mipmap_offset**\ (\ mipmap\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Image_method_get_mipmap_offset>`
|
||
|
||
Повертає зміщення, де MIP-карта зображення з індексом ``mipmap`` зберігається у словнику :ref:`data<class_Image_property_data>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_pixel:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_pixel**\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Image_method_get_pixel>`
|
||
|
||
Повертає колір пікселя в точці ``(x, y)``.
|
||
|
||
Це те саме, що й метод `` method get_pixelv``, але з двома цілочисельними аргументами замість аргументу :ref:`Vector2i<class_Vector2i>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_pixelv:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_pixelv**\ (\ point\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`🔗<class_Image_method_get_pixelv>`
|
||
|
||
Повертає колір пікселя в точці ``point``.
|
||
|
||
Це те саме, що й метод :ref:`get_pixel()<class_Image_method_get_pixel>`, але з аргументом :ref:`Vector2i<class_Vector2i>` замість двох цілочисельних аргументів.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_region:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **get_region**\ (\ region\: :ref:`Rect2i<class_Rect2i>`\ ) |const| :ref:`🔗<class_Image_method_get_region>`
|
||
|
||
Повертає нову **Image**, яка є копіям цієї **Image** області, зазначеної ``region``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **get_size**\ (\ ) |const| :ref:`🔗<class_Image_method_get_size>`
|
||
|
||
Повертає розмір зображення (ширина і висота).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_used_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Rect2i<class_Rect2i>` **get_used_rect**\ (\ ) |const| :ref:`🔗<class_Image_method_get_used_rect>`
|
||
|
||
Повертає :ref:`Rect2i<class_Rect2i>`, закриваючи видиму частину зображення, враховуючи кожен піксель з ненульним альфа-каналом.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_get_width:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_width**\ (\ ) |const| :ref:`🔗<class_Image_method_get_width>`
|
||
|
||
Повертаємо ширину зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_has_mipmaps:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_mipmaps**\ (\ ) |const| :ref:`🔗<class_Image_method_has_mipmaps>`
|
||
|
||
``true``, якщо зображення створювало mipmaps.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_is_compressed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_compressed**\ (\ ) |const| :ref:`🔗<class_Image_method_is_compressed>`
|
||
|
||
Повертає ``true``, якщо зображення стискається.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_is_empty:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_empty**\ (\ ) |const| :ref:`🔗<class_Image_method_is_empty>`
|
||
|
||
Повернення ``true`` якщо зображення не має даних.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_is_invisible:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_invisible**\ (\ ) |const| :ref:`🔗<class_Image_method_is_invisible>`
|
||
|
||
Повертає ``true``, якщо всі пікселі зображень мають альфа значення 0. Повертає ``false``, якщо будь-який піксель має значення альфа вище 0.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_linear_to_srgb:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **linear_to_srgb**\ (\ ) :ref:`🔗<class_Image_method_linear_to_srgb>`
|
||
|
||
Converts the entire image from linear encoding to nonlinear sRGB encoding by using a lookup table. Only works on images with :ref:`FORMAT_RGB8<class_Image_constant_FORMAT_RGB8>` or :ref:`FORMAT_RGBA8<class_Image_constant_FORMAT_RGBA8>` formats.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_Image_method_load>`
|
||
|
||
Навантаження зображення з файлу ``path``. Див. `Підтримані формати зображень <../tutorials/assets_pipeline/importing_images.html#supported-image-formats>`__ для списку підтриманих форматів зображень та обмежень.
|
||
|
||
\ **Попередження:** Цей метод повинен бути використаний тільки в редакторі або в випадках, коли вам потрібно завантажити зовнішні зображення в режимі run-time, такі як зображення, розміщені на каталозі ``user://``, і не може працювати в експортованих проектах.
|
||
|
||
Дивитися також :ref:`ImageTexture<class_ImageTexture>` опис для прикладів використання.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_bmp_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_bmp_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_bmp_from_buffer>`
|
||
|
||
Завантаження зображення з бінарного вмісту BMP файл.
|
||
|
||
\ **Примітка:** Модуль Godot BMP не підтримує 16-біт на піксельні зображення. Тільки 1-bit, 4-bit, 8-bit, 24-bit і 32-bit на піксельні зображення підтримуються.
|
||
|
||
\ **Примітка:** Цей метод доступний тільки в двигунах з модулем BMP. За замовчуванням модуль BMP ввімкнено, але він може бути вимкнений при створенні часу за допомогою параметра ``module_bmp_enabled=no`` Параметри SCons.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_dds_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_dds_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_dds_from_buffer>`
|
||
|
||
Завантажує зображення з бінарного вмісту DDS-файлу.
|
||
|
||
\ **Примітка:** Цей метод доступний лише у збірках рушія з увімкненим модулем DDS. За замовчуванням модуль DDS увімкнено, але його можна вимкнути під час збірки за допомогою опції SCons ``module_dds_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_exr_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_exr_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_exr_from_buffer>`
|
||
|
||
Loads an image from the binary contents of an OpenEXR file.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_from_file:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **load_from_file**\ (\ path\: :ref:`String<class_String>`\ ) |static| :ref:`🔗<class_Image_method_load_from_file>`
|
||
|
||
Створення нових **Image** і завантаження даних з вказаного файлу.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_jpg_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_jpg_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_jpg_from_buffer>`
|
||
|
||
Завантажує зображення з бінарного вмісту файлу JPEG.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_ktx_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_ktx_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_ktx_from_buffer>`
|
||
|
||
Навантаження зображення з бінарного вмісту `KTX <https://github.com/KhronosGroup/KTX-Software>`__ файл. На відміну від більшості форматів зображень, KTX може зберігати VRAM-компресовані дані та рельєфні карти.
|
||
|
||
\ **Примітка:** Godot's libktx виконання тільки підтримує 2D зображення. Не підтримуються кубикові карти, фактурні масиви та де-набивання.
|
||
|
||
\ **Примітка:** Цей метод доступний тільки в двигунах з модулем KTX. За замовчуванням, модуль KTX включений, але він може бути вимкнений при створенні часу за допомогою параметра ``module_ktx_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_png_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_png_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_png_from_buffer>`
|
||
|
||
Завантаження зображення з бінарного вмісту PNG файлу.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_svg_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_svg_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`, scale\: :ref:`float<class_float>` = 1.0\ ) :ref:`🔗<class_Image_method_load_svg_from_buffer>`
|
||
|
||
Завантаження зображення з бінарного вмісту UTF-8 **uncompressed** SVG файл (**.**.
|
||
|
||
\ **Примітка:** Посуд при використанні стиснених SVG файлів (наприклад, **.z**, вони повинні бути ``decompressed`` перед завантаженням.
|
||
|
||
\ **Примітка:** Цей метод доступний тільки в двигунах з вбудованим модулем SVG. За замовчуванням модуль SVG ввімкнено, але він може бути вимкнений в режимі збирання за допомогою параметра ``module_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_svg_from_string:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_svg_from_string**\ (\ svg_str\: :ref:`String<class_String>`, scale\: :ref:`float<class_float>` = 1.0\ ) :ref:`🔗<class_Image_method_load_svg_from_string>`
|
||
|
||
Навантаження зображення з стрункого вмісту SVG файлу (**. **).
|
||
|
||
\ **Примітка:** Цей метод доступний тільки в двигунах з вбудованим модулем SVG. За замовчуванням модуль SVG ввімкнено, але він може бути вимкнений при створенні часу за допомогою параметра ``module__enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_tga_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_tga_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_tga_from_buffer>`
|
||
|
||
Завантаження зображення з бінарного вмісту TGA файла.
|
||
|
||
\ **Примітка:** Цей метод доступний тільки в двигунах з вбудованим модулем TGA. За замовчуванням, модуль TGA включений, але він може бути вимкнений при створенні часу за допомогою параметра ``module_tga_enabled=no``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_load_webp_from_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **load_webp_from_buffer**\ (\ buffer\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_load_webp_from_buffer>`
|
||
|
||
Завантаження зображення з бінарного вмісту файлу WebP.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_normal_map_to_xy:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **normal_map_to_xy**\ (\ ) :ref:`🔗<class_Image_method_normal_map_to_xy>`
|
||
|
||
Конвертує дані зображення, щоб відобразити координати на 3D-карті. Це використовується при нормальній карті. Нормальна карта може додавати багато деталей до поверхні 3D без збільшення кількості полігонів.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_premultiply_alpha:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **premultiply_alpha**\ (\ ) :ref:`🔗<class_Image_method_premultiply_alpha>`
|
||
|
||
Багатошарові значення кольорів з значеннями альфа. Отримані значення кольору для пікселя ``(color * alpha)/256``. Дивись також :ref:`CanvasItemMaterial.blend_mode<class_CanvasItemMaterial_property_blend_mode>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_resize:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **resize**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, interpolation\: :ref:`Interpolation<enum_Image_Interpolation>` = 1\ ) :ref:`🔗<class_Image_method_resize>`
|
||
|
||
Змінює розмір зображення до заданих значень ``width`` та ``height``. Нові пікселі обчислюються за допомогою режиму ``interpolation``, визначеного за допомогою констант :ref:`Interpolation<enum_Image_Interpolation>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_resize_to_po2:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **resize_to_po2**\ (\ square\: :ref:`bool<class_bool>` = false, interpolation\: :ref:`Interpolation<enum_Image_Interpolation>` = 1\ ) :ref:`🔗<class_Image_method_resize_to_po2>`
|
||
|
||
Змінює розмір зображення до найближчого степеня 2 для ширини та висоти. Якщо ``square`` має значення ``true``, встановлює однакові значення ширини та висоти. Нові пікселі обчислюються за допомогою режиму ``interpolation``, визначеного за допомогою констант :ref:`Interpolation<enum_Image_Interpolation>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_rgbe_to_srgb:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Image<class_Image>` **rgbe_to_srgb**\ (\ ) :ref:`🔗<class_Image_method_rgbe_to_srgb>`
|
||
|
||
Converts a standard linear RGBE (Red Green Blue Exponent) image to an image that uses nonlinear sRGB encoding.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_rotate_90:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rotate_90**\ (\ direction\: :ref:`ClockDirection<enum_@GlobalScope_ClockDirection>`\ ) :ref:`🔗<class_Image_method_rotate_90>`
|
||
|
||
Обертує зображення в зазначеному ``direction`` ``90`` градусів. Ширина і висота зображення повинні бути більшими, ніж ``1``. Якщо ширина і висота не рівність, зображення буде негабаритним.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_rotate_180:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **rotate_180**\ (\ ) :ref:`🔗<class_Image_method_rotate_180>`
|
||
|
||
Обертає зображення ``180`` градусів. Ширина і висота зображення повинні бути більшими, ніж ``1``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_dds:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_dds**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Image_method_save_dds>`
|
||
|
||
Зберігає зображення як файл DDS (DirectDraw Surface) у ``path``. DDS – це формат контейнера, який може зберігати текстури в різних форматах стиснення, таких як DXT1, DXT5 або BC7. Ця функція поверне :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>`, якщо Godot було скомпільовано без модуля DDS.
|
||
|
||
\ **Примітка:** Модуль DDS може бути вимкнено в певних збірках, що означає, що :ref:`save_dds()<class_Image_method_save_dds>` поверне :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>`, коли його буде викликано з експортованого проекту.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_dds_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_dds_to_buffer**\ (\ ) |const| :ref:`🔗<class_Image_method_save_dds_to_buffer>`
|
||
|
||
Зберігає зображення як файл DDS (DirectDraw Surface) у байтовому масиві. DDS – це контейнерний формат, який може зберігати текстури в різних форматах стиснення, таких як DXT1, DXT5 або BC7. Ця функція поверне порожній байтовий масив, якщо Godot було скомпільовано без модуля DDS.
|
||
|
||
\ **Примітка:** Модуль DDS може бути вимкнено в певних збірках, що означає, що :ref:`save_dds_to_buffer()<class_Image_method_save_dds_to_buffer>` поверне порожній байтовий масив, коли його буде викликано з експортованого проекту.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_exr:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_exr**\ (\ path\: :ref:`String<class_String>`, grayscale\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Image_method_save_exr>`
|
||
|
||
Saves the image as an EXR file to ``path``. If ``grayscale`` is ``true`` and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return :ref:`@GlobalScope.ERR_UNAVAILABLE<class_@GlobalScope_constant_ERR_UNAVAILABLE>` if Godot was compiled without the TinyEXR module.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_exr_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_exr_to_buffer**\ (\ grayscale\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Image_method_save_exr_to_buffer>`
|
||
|
||
Saves the image as an EXR file to a byte array. If ``grayscale`` is ``true`` and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return an empty byte array if Godot was compiled without the TinyEXR module.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_jpg:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_jpg**\ (\ path\: :ref:`String<class_String>`, quality\: :ref:`float<class_float>` = 0.75\ ) |const| :ref:`🔗<class_Image_method_save_jpg>`
|
||
|
||
Заощаджує зображення як файл JPEG до ``пам'ятний шлях`` з вказаною ``quality`` між ``0.01`` і ``1.0`` (включаючи). Вища ``quality`` значення призводить до кращого виходу на вартість більших розмірів файлів. ``0.75`` і ``0.90``. Навіть за якістю ``1.00``, стиснення JPEG залишається втратою.
|
||
|
||
\ **Note:** JPEG не зберігає альфа-канал. Якщо **Image** містить альфа-канал, зображення все ще буде збережено, але отриманий файл JPEG не містить альфа-каналу.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_jpg_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_jpg_to_buffer**\ (\ quality\: :ref:`float<class_float>` = 0.75\ ) |const| :ref:`🔗<class_Image_method_save_jpg_to_buffer>`
|
||
|
||
Заощаджує зображення як файл JPEG до байтного масиву з вказаною ``quality`` ``0.01`` та ``1.0`` (включаючи). Найвища ``quality`` значення призводить до кращого виходу на вартість більшого розміру масиву байтів (а отже, використання пам'яті). ``0.75`` і ``0.90``. Навіть за якістю ``1.00``, стиснення JPEG залишається втратою.
|
||
|
||
\ **Note:** JPEG не зберігає альфа-канал. Якщо **Image** містить альфа-канал, зображення все ще буде збережено, але отриманий байтовий масив не містить альфа-каналу.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_png:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_png**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Image_method_save_png>`
|
||
|
||
Заощаджує зображення як файл PNG у файл ``path``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_png_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_png_to_buffer**\ (\ ) |const| :ref:`🔗<class_Image_method_save_png_to_buffer>`
|
||
|
||
Заощаджує зображення як файл PNG на байтовий масив.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_webp:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Error<enum_@GlobalScope_Error>` **save_webp**\ (\ path\: :ref:`String<class_String>`, lossy\: :ref:`bool<class_bool>` = false, quality\: :ref:`float<class_float>` = 0.75\ ) |const| :ref:`🔗<class_Image_method_save_webp>`
|
||
|
||
Зберігає зображення як файл WebP (Web Picture) у файл за адресою ``path``. За замовчуванням він збереже без втрат. Якщо ``lossy`` має значення ``true``, зображення буде збережено з втратами, використовуючи налаштування ``quality`` від ``0.0`` до ``1.0`` (включно). WebP без втрат забезпечує більш ефективне стиснення, ніж PNG.
|
||
|
||
\ **Примітка: ** Формат WebP обмежений розміром 16383×16383 пікселів, у той час як у PNG можна зберігати більші зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_save_webp_to_buffer:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedByteArray<class_PackedByteArray>` **save_webp_to_buffer**\ (\ lossy\: :ref:`bool<class_bool>` = false, quality\: :ref:`float<class_float>` = 0.75\ ) |const| :ref:`🔗<class_Image_method_save_webp_to_buffer>`
|
||
|
||
Зберігає зображення як файл WebP (Web Picture) у байтовому масиві. За замовчуванням він збереже без втрат. Якщо ``lossy`` має значення ``true``, зображення буде збережено з втратами, використовуючи налаштування ``quality`` від ``0.0`` до ``1.0`` (включно). WebP без втрат забезпечує більш ефективне стиснення, ніж PNG.
|
||
|
||
\ **Примітка: ** Формат WebP обмежений розміром 16383×16383 пікселів, у той час як у PNG можна зберігати більші зображення.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_set_data:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_data**\ (\ width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, use_mipmaps\: :ref:`bool<class_bool>`, format\: :ref:`Format<enum_Image_Format>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) :ref:`🔗<class_Image_method_set_data>`
|
||
|
||
Перезаписи даних існуючого **Image**. Нестатичний еквівалент :ref:`create_from_data()<class_Image_method_create_from_data>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_set_pixel:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_pixel**\ (\ x\: :ref:`int<class_int>`, y\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Image_method_set_pixel>`
|
||
|
||
Sets the :ref:`Color<class_Color>` of the pixel at ``(x, y)`` to ``color``.
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var img_width = 10
|
||
var img_height = 5
|
||
var img = Image.create(img_width, img_height, false, Image.FORMAT_RGBA8)
|
||
|
||
img.set_pixel(1, 2, Color.RED) # Sets the color at (1, 2) to red.
|
||
|
||
.. code-tab:: csharp
|
||
|
||
int imgWidth = 10;
|
||
int imgHeight = 5;
|
||
var img = Image.Create(imgWidth, imgHeight, false, Image.Format.Rgba8);
|
||
|
||
img.SetPixel(1, 2, Colors.Red); // Sets the color at (1, 2) to red.
|
||
|
||
|
||
|
||
This is the same as :ref:`set_pixelv()<class_Image_method_set_pixelv>`, but with a two integer arguments instead of a :ref:`Vector2i<class_Vector2i>` argument.
|
||
|
||
\ **Note:** Depending on the image's format, the color set here may be clamped or lose precision. Do not assume the color returned by :ref:`get_pixel()<class_Image_method_get_pixel>` to be identical to the one set here; any comparisons will likely need to use an approximation like :ref:`Color.is_equal_approx()<class_Color_method_is_equal_approx>`.
|
||
|
||
\ **Note:** On grayscale image formats, only the red channel of ``color`` is used (and alpha if relevant). The green and blue channels are ignored.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_set_pixelv:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_pixelv**\ (\ point\: :ref:`Vector2i<class_Vector2i>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Image_method_set_pixelv>`
|
||
|
||
Sets the :ref:`Color<class_Color>` of the pixel at ``point`` to ``color``.
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
var img_width = 10
|
||
var img_height = 5
|
||
var img = Image.create(img_width, img_height, false, Image.FORMAT_RGBA8)
|
||
|
||
img.set_pixelv(Vector2i(1, 2), Color.RED) # Sets the color at (1, 2) to red.
|
||
|
||
.. code-tab:: csharp
|
||
|
||
int imgWidth = 10;
|
||
int imgHeight = 5;
|
||
var img = Image.Create(imgWidth, imgHeight, false, Image.Format.Rgba8);
|
||
|
||
img.SetPixelv(new Vector2I(1, 2), Colors.Red); // Sets the color at (1, 2) to red.
|
||
|
||
|
||
|
||
This is the same as :ref:`set_pixel()<class_Image_method_set_pixel>`, but with a :ref:`Vector2i<class_Vector2i>` argument instead of two integer arguments.
|
||
|
||
\ **Note:** Depending on the image's format, the color set here may be clamped or lose precision. Do not assume the color returned by :ref:`get_pixelv()<class_Image_method_get_pixelv>` to be identical to the one set here; any comparisons will likely need to use an approximation like :ref:`Color.is_equal_approx()<class_Color_method_is_equal_approx>`.
|
||
|
||
\ **Note:** On grayscale image formats, only the red channel of ``color`` is used (and alpha if relevant). The green and blue channels are ignored.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_shrink_x2:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **shrink_x2**\ (\ ) :ref:`🔗<class_Image_method_shrink_x2>`
|
||
|
||
Подрібнює зображення фактором 2 на кожну вісь (це розділяє кількість пікселів на 4).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Image_method_srgb_to_linear:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **srgb_to_linear**\ (\ ) :ref:`🔗<class_Image_method_srgb_to_linear>`
|
||
|
||
Converts the raw data from nonlinear sRGB encoding to linear encoding using a lookup table. Only works on images with :ref:`FORMAT_RGB8<class_Image_constant_FORMAT_RGB8>` or :ref:`FORMAT_RGBA8<class_Image_constant_FORMAT_RGBA8>` formats.
|
||
|
||
\ **Note:** The 8-bit formats required by this method are not suitable for storing linearly encoded values; a significant amount of color information will be lost in darker values. To maintain image quality, this method should not be used.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Зазвичай, цей метод перевизначається користувачем, щоб він мав вплив.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Цей метод не має побічних ефектів. Не змінює ніяку змінну екземпляра об'єкта.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Цей метод приймає будь-яке число аргументів після описаних тут.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Цей метод використовується для побудови типів.)`
|
||
.. |static| replace:: :abbr:`static (Цей метод не потребує екземпляра для виклику, його можна викликати безпосередньо за допомогою назви класу.)`
|
||
.. |operator| replace:: :abbr:`operator (Цей метод описує дійсний оператор для взаємодії з цим типом як з лівим операндом.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Це значення є цілим числом, складеним у вигляді бітової маски з наступних прапорів.)`
|
||
.. |void| replace:: :abbr:`void (Значення не повертається.)`
|