class_imagetexture.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_ImageTexture:
  4. ImageTexture
  5. ============
  6. **Inherits:** :ref:`Texture<class_texture>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. A :ref:`Texture<class_texture>` based on an :ref:`Image<class_image>`.
  11. Member Functions
  12. ----------------
  13. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`create<class_ImageTexture_create>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` format, :ref:`int<class_int>` flags=7 **)** |
  15. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`create_from_image<class_ImageTexture_create_from_image>` **(** :ref:`Image<class_image>` image, :ref:`int<class_int>` flags=7 **)** |
  17. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`fix_alpha_edges<class_ImageTexture_fix_alpha_edges>` **(** **)** |
  19. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`Image<class_image>` | :ref:`get_data<class_ImageTexture_get_data>` **(** **)** const |
  21. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`get_format<class_ImageTexture_get_format>` **(** **)** const |
  23. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`get_lossy_storage_quality<class_ImageTexture_get_lossy_storage_quality>` **(** **)** const |
  25. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`get_storage<class_ImageTexture_get_storage>` **(** **)** const |
  27. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`load<class_ImageTexture_load>` **(** :ref:`String<class_string>` path **)** |
  29. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`normal_to_xy<class_ImageTexture_normal_to_xy>` **(** **)** |
  31. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`premultiply_alpha<class_ImageTexture_premultiply_alpha>` **(** **)** |
  33. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_data<class_ImageTexture_set_data>` **(** :ref:`Image<class_image>` image **)** |
  35. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_lossy_storage_quality<class_ImageTexture_set_lossy_storage_quality>` **(** :ref:`float<class_float>` quality **)** |
  37. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_size_override<class_ImageTexture_set_size_override>` **(** :ref:`Vector2<class_vector2>` size **)** |
  39. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_storage<class_ImageTexture_set_storage>` **(** :ref:`int<class_int>` mode **)** |
  41. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`shrink_x2_and_keep_size<class_ImageTexture_shrink_x2_and_keep_size>` **(** **)** |
  43. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. Numeric Constants
  45. -----------------
  46. - **STORAGE_RAW** = **0** --- :ref:`Image<class_image>` data is stored raw and unaltered.
  47. - **STORAGE_COMPRESS_LOSSY** = **1** --- :ref:`Image<class_image>` data is compressed with a lossy algorithm. You can set the storage quality with :ref:`set_lossy_storage_quality<class_ImageTexture_set_lossy_storage_quality>`.
  48. - **STORAGE_COMPRESS_LOSSLESS** = **2** --- :ref:`Image<class_image>` data is compressed with a lossless algorithm.
  49. Description
  50. -----------
  51. A :ref:`Texture<class_texture>` based on an :ref:`Image<class_image>`. Can be created from an :ref:`Image<class_image>`.
  52. Member Function Description
  53. ---------------------------
  54. .. _class_ImageTexture_create:
  55. - void **create** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` format, :ref:`int<class_int>` flags=7 **)**
  56. Create a new :ref:`ImageTexture<class_imagetexture>` with "width" and "height".
  57. "format" one of :ref:`Image<class_image>`.FORMAT\_\*.
  58. "flags" one or more of :ref:`Texture<class_texture>`.FLAG\_\*.
  59. .. _class_ImageTexture_create_from_image:
  60. - void **create_from_image** **(** :ref:`Image<class_image>` image, :ref:`int<class_int>` flags=7 **)**
  61. Create a new :ref:`ImageTexture<class_imagetexture>` from an :ref:`Image<class_image>` with "flags" from :ref:`Texture<class_texture>`.FLAG\_\*.
  62. .. _class_ImageTexture_fix_alpha_edges:
  63. - void **fix_alpha_edges** **(** **)**
  64. .. _class_ImageTexture_get_data:
  65. - :ref:`Image<class_image>` **get_data** **(** **)** const
  66. Return the :ref:`Image<class_image>` of this :ref:`ImageTexture<class_imagetexture>`.
  67. .. _class_ImageTexture_get_format:
  68. - :ref:`int<class_int>` **get_format** **(** **)** const
  69. Return the format of the :ref:`ImageTexture<class_imagetexture>`, one of :ref:`Image<class_image>`.FORMAT\_\*.
  70. .. _class_ImageTexture_get_lossy_storage_quality:
  71. - :ref:`float<class_float>` **get_lossy_storage_quality** **(** **)** const
  72. Return the storage quality for :ref:`ImageTexture<class_imagetexture>`.STORAGE_COMPRESS_LOSSY.
  73. .. _class_ImageTexture_get_storage:
  74. - :ref:`int<class_int>` **get_storage** **(** **)** const
  75. Return the storage type. One of :ref:`ImageTexture<class_imagetexture>`.STORAGE\_\*.
  76. .. _class_ImageTexture_load:
  77. - void **load** **(** :ref:`String<class_string>` path **)**
  78. Load an ImageTexure.
  79. .. _class_ImageTexture_normal_to_xy:
  80. - void **normal_to_xy** **(** **)**
  81. .. _class_ImageTexture_premultiply_alpha:
  82. - void **premultiply_alpha** **(** **)**
  83. .. _class_ImageTexture_set_data:
  84. - void **set_data** **(** :ref:`Image<class_image>` image **)**
  85. Set the :ref:`Image<class_image>` of this :ref:`ImageTexture<class_imagetexture>`.
  86. .. _class_ImageTexture_set_lossy_storage_quality:
  87. - void **set_lossy_storage_quality** **(** :ref:`float<class_float>` quality **)**
  88. Set the storage quality in case of :ref:`ImageTexture<class_imagetexture>`.STORAGE_COMPRESS_LOSSY.
  89. .. _class_ImageTexture_set_size_override:
  90. - void **set_size_override** **(** :ref:`Vector2<class_vector2>` size **)**
  91. .. _class_ImageTexture_set_storage:
  92. - void **set_storage** **(** :ref:`int<class_int>` mode **)**
  93. Set the storage type. One of :ref:`ImageTexture<class_imagetexture>`.STORAGE\_\*.
  94. .. _class_ImageTexture_shrink_x2_and_keep_size:
  95. - void **shrink_x2_and_keep_size** **(** **)**