ImageTexture

Inherits: Texture < Resource < Reference < Object

Category: Core

Brief Description

A Texture based on an Image.

Member Functions

void create ( int width, int height, int format, int flags=7 )
void create_from_image ( Image image, int flags=7 )
void fix_alpha_edges ( )
Image get_data ( ) const
int get_format ( ) const
float get_lossy_storage_quality ( ) const
int get_storage ( ) const
void load ( String path )
void normal_to_xy ( )
void premultiply_alpha ( )
void set_data ( Image image )
void set_lossy_storage_quality ( float quality )
void set_size_override ( Vector2 size )
void set_storage ( int mode )
void shrink_x2_and_keep_size ( )

Numeric Constants

  • STORAGE_RAW = 0Image data is stored raw and unaltered.
  • STORAGE_COMPRESS_LOSSY = 1Image data is compressed with a lossy algorithm. You can set the storage quality with set_lossy_storage_quality.
  • STORAGE_COMPRESS_LOSSLESS = 2Image data is compressed with a lossless algorithm.

Description

A Texture based on an Image. Can be created from an Image.

Member Function Description

  • void create ( int width, int height, int format, int flags=7 )

Create a new ImageTexture with “width” and “height”.

“format” one of Image.FORMAT_*.

“flags” one or more of Texture.FLAG_*.

  • void create_from_image ( Image image, int flags=7 )

Create a new ImageTexture from an Image with “flags” from Texture.FLAG_*.

  • void fix_alpha_edges ( )
  • Image get_data ( ) const

Return the Image of this ImageTexture.

  • int get_format ( ) const

Return the format of the ImageTexture, one of Image.FORMAT_*.

  • float get_lossy_storage_quality ( ) const

Return the storage quality for ImageTexture.STORAGE_COMPRESS_LOSSY.

  • int get_storage ( ) const

Return the storage type. One of ImageTexture.STORAGE_*.

Load an ImageTexure.

  • void normal_to_xy ( )
  • void premultiply_alpha ( )
  • void set_data ( Image image )

Set the Image of this ImageTexture.

  • void set_lossy_storage_quality ( float quality )

Set the storage quality in case of ImageTexture.STORAGE_COMPRESS_LOSSY.

  • void set_size_override ( Vector2 size )
  • void set_storage ( int mode )

Set the storage type. One of ImageTexture.STORAGE_*.

  • void shrink_x2_and_keep_size ( )