| Python Script Engine 8.3 GL Studio Editor Python Script API

Public Types | Public Member Functions | List of all members
TexturePaletteEntry Class Reference

## Public Types
enum | ImageCompression { IMAGE_COMPRESSION_RAW , IMAGE_COMPRESSION_LZ77 , IMAGE_COMPRESSION_JPEG }

## Public Member Functions
String | __repr__ ()
bool | isNULL ()
String | GetFilename ()
void | SetFilename (String name)
int | GetSourceImageWidth ()
int | GetSourceImageHeight ()
int | GetSourceImageMemorySize ()
int | GetGeneratedImageWidth ()
int | GetGeneratedImageHeight ()
int | GetGeneratedImageMemorySize ()
int | GetGeneratedImageDiskSize ()
void | Reload ()
void | Replace (String filename)
void | SetInvertAlphaTransparency (bool invertAlphaTransparency)
bool | IsInvertAlphaTransparency ()
void | SetGenerateAsInlineData (bool generateAsInlineData)
bool | IsGenerateAsInlineData ()
void | SetUseHardwareCompression (bool useHardwareCompression)
bool | IsUseHardwareCompression ()
void | SetImageCompression (ImageCompression imageCompression)
ImageCompression | GetImageCompression ()
void | SetJPEGImageQuality (int imageQuality)
int | GetJPEGImageQuality ()
void | SetDownsize (int downsize)
int | GetDownsize ()
int | GetTextureIndex ()

## Detailed Description

Python engine extension for the TexturePaletteEntry editor object.

If the TexturePaletteEntry instance is null, or has been deleted from the document's TexturePalette , it will return 'False' in comparison checks.

# Python:
texturePalette = document.GetTexturePalette() # Retrieving the document's texture palette
texture = texturePalette.GetTexturePaletteEntry( 0 ) # Getting a texture from the texture palette
if texture: # True if the texture exists
pass
texturePalette.RemoveTexture( texture )
if texture: # False, since the texture was removed from the document's texture palette
pass

## Member Enumeration Documentation

## ◆ ImageCompression

enum TexturePaletteEntry::ImageCompression

Image compression.

Enumerator
IMAGE_COMPRESSION_RAW | Image data is not compressed.
IMAGE_COMPRESSION_LZ77 | Image data is compressed with LZ77 (Z-Lib)
IMAGE_COMPRESSION_JPEG | Image data is compressed with lossy JPEG.

## Member Function Documentation

## ◆ __repr__()

String TexturePaletteEntry::__repr__ | ( |  | ) |

repr function (python function to return a string representation of the object)

## ◆ GetDownsize()

int TexturePaletteEntry::GetDownsize | ( |  | ) |

Get the downsize factor.

Returns
  downsize (>0 and a power of 2) if 1 then no downsizing else image width and height are divided by downsize (i.e. downsize 2 gives an image half the width and height)

Precondition
  !isNULL()

## ◆ GetFilename()

String TexturePaletteEntry::GetFilename | ( |  | ) |

Get the filename associated with this entry.

Returns
  the filename associated with this entry

Precondition
  !isNULL()

## ◆ GetGeneratedImageDiskSize()

int TexturePaletteEntry::GetGeneratedImageDiskSize | ( |  | ) |

Get the size in bytes on disk of the generated image.

Returns
  the size in bytes on disk of the generated image

Precondition
  !isNULL()

## ◆ GetGeneratedImageHeight()

int TexturePaletteEntry::GetGeneratedImageHeight | ( |  | ) |

Get the generated height of the image.

Returns
  the generated height of the image

Precondition
  !isNULL()

## ◆ GetGeneratedImageMemorySize()

int TexturePaletteEntry::GetGeneratedImageMemorySize | ( |  | ) |

Get the memory size in bytes of the generated image.

Returns
  the memory size in bytes of the generated image

Precondition
  !isNULL()

## ◆ GetGeneratedImageWidth()

int TexturePaletteEntry::GetGeneratedImageWidth | ( |  | ) |

Get the generated width of the image.

Returns
  the generated width of the image

Precondition
  !isNULL()

## ◆ GetImageCompression()

ImageCompression TexturePaletteEntry::GetImageCompression | ( |  | ) |

Get the image compresssion mode.

Returns
  image compression mode

Precondition
  !isNULL()

## ◆ GetJPEGImageQuality()

int TexturePaletteEntry::GetJPEGImageQuality | ( |  | ) |

Get the JPEG image quality.

Returns
  int image quality

Precondition
  !isNULL()

## ◆ GetSourceImageHeight()

int TexturePaletteEntry::GetSourceImageHeight | ( |  | ) |

Get the height of the source image.

Returns
  the height of the source image

Precondition
  !isNULL()

## ◆ GetSourceImageMemorySize()

int TexturePaletteEntry::GetSourceImageMemorySize | ( |  | ) |

Get the memory size in bytes of the source image.

Returns
  the memory size in bytes of the source image

Precondition
  !isNULL()

## ◆ GetSourceImageWidth()

int TexturePaletteEntry::GetSourceImageWidth | ( |  | ) |

Get the width of the source image.

Returns
  the width of the source image

Precondition
  !isNULL()

## ◆ GetTextureIndex()

int TexturePaletteEntry::GetTextureIndex | ( |  | ) |

Get the index of this texture entry in the texture palette.

Returns
  the texture entry's palette index (zero based) or -1 if the entry could not be found in the texture palette

## ◆ IsGenerateAsInlineData()

bool TexturePaletteEntry::IsGenerateAsInlineData | ( |  | ) |

Get the generate as inline data mode.

Returns
  true to generate as inline data

Precondition
  !isNULL()

## ◆ IsInvertAlphaTransparency()

bool TexturePaletteEntry::IsInvertAlphaTransparency | ( |  | ) |

Get the invert alpha transparency mode.

Returns
  true to invert alpha transparency

Precondition
  !isNULL()

## ◆ isNULL()

bool TexturePaletteEntry::isNULL | ( |  | ) |

Determine if wrapped texture palette entry does not exist.

Returns
  True if this object represents a NULL texture palette

Deprecated:
  Refer to the Truth Value Checking page

## ◆ IsUseHardwareCompression()

bool TexturePaletteEntry::IsUseHardwareCompression | ( |  | ) |

Get the use hardware compression mode.

Returns
  true to use hardware compression

Precondition
  !isNULL()

## ◆ Reload()

void TexturePaletteEntry::Reload | ( |  | ) |

Reload the texture for this entry.

Precondition
  !isNULL()

## ◆ Replace()

void TexturePaletteEntry::Replace | ( | String | filename | ) |

Replace the texture for this entry.

Parameters

  filename | file path and name of texture to use as replacement (can be relative or absolute)

Precondition
  !isNULL(), file exists

## ◆ SetDownsize()

void TexturePaletteEntry::SetDownsize | ( | int | downsize | ) |

Set the downsize factor (NOTE: the downsizing will be clamped to its logical maximum)

Parameters

  downsize | (must be >0 and a power of 2) if 1 then no downsizing else image width and height are divided by downsize (i.e. downsize 2 gives an image half the width and height)

Precondition
  !isNULL(), downsize must be >0 and a power of 2

## ◆ SetFilename()

void TexturePaletteEntry::SetFilename | ( | String | name | ) |

Set the filename of the TexturePaletteEntry.

Parameters

  name | the new filename of the entry

Precondition
  !isNULL()

## ◆ SetGenerateAsInlineData()

void TexturePaletteEntry::SetGenerateAsInlineData | ( | bool | generateAsInlineData | ) |

Set the generate as inline data mode.

Parameters

  generateAsInlineData | true to generate as inline data

Precondition
  !isNULL()

## ◆ SetImageCompression()

void TexturePaletteEntry::SetImageCompression | ( | ImageCompression | imageCompression | ) |

Set the image compresssion mode.

Parameters

  imageCompression | image compression mode NOTE: mode will be set to IMAGE_COMPRESSION_LZ77 if IMAGE_COMPRESSION_JPEG is selected but image is too small for JPEG compression

Precondition
  !isNULL()

## ◆ SetInvertAlphaTransparency()

void TexturePaletteEntry::SetInvertAlphaTransparency | ( | bool | invertAlphaTransparency | ) |

Set the invert alpha transparency mode.

Parameters

  invertAlphaTransparency | true to invert alpha transparency

Precondition
  !isNULL()

## ◆ SetJPEGImageQuality()

void TexturePaletteEntry::SetJPEGImageQuality | ( | int | imageQuality | ) |

Set the JPEG image quality.

Parameters

  imageQuality | image quality

Precondition
  !isNULL()

## ◆ SetUseHardwareCompression()

void TexturePaletteEntry::SetUseHardwareCompression | ( | bool | useHardwareCompression | ) |

Set the use hardware compression mode.

Parameters

  useHardwareCompression | true to use hardware compression

Precondition
  !isNULL()

The documentation for this class was generated from the following file:

- TexturePaletteEntry.i