Python Script Engine  8.1
GL Studio Editor Python Script API
TexturePaletteEntry Class Reference

Public Types

enum  ImageCompression {
  IMAGE_COMPRESSION_RAW,
  IMAGE_COMPRESSION_LZ77,
  IMAGE_COMPRESSION_JPEG
}
 

Public Member Functions

String __repr__ (void)
 
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.

1 # Python:
2 texturePalette = document.GetTexturePalette() # Retrieving the document's texture palette
3 texture = texturePalette.GetTexturePaletteEntry( 0 ) # Getting a texture from the texture palette
4 if texture: # True if the texture exists
5  pass
6 texturePalette.RemoveTexture( texture )
7 if texture: # False, since the texture was removed from the document's texture palette
8  pass

Member Enumeration Documentation

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

String TexturePaletteEntry::__repr__ ( void  )

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

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()
String TexturePaletteEntry::GetFilename ( )

Get the filename associated with this entry.

Returns
the filename associated with this entry
Precondition
!isNULL()
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()
int TexturePaletteEntry::GetGeneratedImageHeight ( )

Get the generated height of the image.

Returns
the generated height of the image
Precondition
!isNULL()
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()
int TexturePaletteEntry::GetGeneratedImageWidth ( )

Get the generated width of the image.

Returns
the generated width of the image
Precondition
!isNULL()
ImageCompression TexturePaletteEntry::GetImageCompression ( )

Get the image compresssion mode.

Returns
image compression mode
Precondition
!isNULL()
int TexturePaletteEntry::GetJPEGImageQuality ( )

Get the JPEG image quality.

Returns
int image quality
Precondition
!isNULL()
int TexturePaletteEntry::GetSourceImageHeight ( )

Get the height of the source image.

Returns
the height of the source image
Precondition
!isNULL()
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()
int TexturePaletteEntry::GetSourceImageWidth ( )

Get the width of the source image.

Returns
the width of the source image
Precondition
!isNULL()
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
bool TexturePaletteEntry::IsGenerateAsInlineData ( )

Get the generate as inline data mode.

Returns
true to generate as inline data
Precondition
!isNULL()
bool TexturePaletteEntry::IsInvertAlphaTransparency ( )

Get the invert alpha transparency mode.

Returns
true to invert alpha transparency
Precondition
!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
bool TexturePaletteEntry::IsUseHardwareCompression ( )

Get the use hardware compression mode.

Returns
true to use hardware compression
Precondition
!isNULL()
void TexturePaletteEntry::Reload ( )

Reload the texture for this entry.

Precondition
!isNULL()
void TexturePaletteEntry::Replace ( String  filename)

Replace the texture for this entry.

Parameters
filenamefile path and name of texture to use as replacement (can be relative or absolute)
Precondition
!isNULL(), file exists
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
void TexturePaletteEntry::SetFilename ( String  name)

Set the filename of the TexturePaletteEntry.

Parameters
namethe new filename of the entry
Precondition
!isNULL()
void TexturePaletteEntry::SetGenerateAsInlineData ( bool  generateAsInlineData)

Set the generate as inline data mode.

Parameters
generateAsInlineDatatrue to generate as inline data
Precondition
!isNULL()
void TexturePaletteEntry::SetImageCompression ( ImageCompression  imageCompression)

Set the image compresssion mode.

Parameters
imageCompressionimage 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()
void TexturePaletteEntry::SetInvertAlphaTransparency ( bool  invertAlphaTransparency)

Set the invert alpha transparency mode.

Parameters
invertAlphaTransparencytrue to invert alpha transparency
Precondition
!isNULL()
void TexturePaletteEntry::SetJPEGImageQuality ( int  imageQuality)

Set the JPEG image quality.

Parameters
imageQualityimage quality
Precondition
!isNULL()
void TexturePaletteEntry::SetUseHardwareCompression ( bool  useHardwareCompression)

Set the use hardware compression mode.

Parameters
useHardwareCompressiontrue to use hardware compression
Precondition
!isNULL()

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