Previous section To contents Next section

12.20 Image.TGA

DESCRIPTION

METHOD
Image.TGA.decode

SYNTAX
object decode(string data)

DESCRIPTION
Decodes a Targa image.

NOTE
Throws upon error in data.

METHOD
Image.TGA.encode

SYNTAX
string encode(object image)
string encode(object image,  mapping options)

DESCRIPTION
Encodes a Targa image.

The options argument may be a mapping containing zero or more encoding options:

normal options:
"alpha":image object
Use this image as alpha channel
(Note: Targa alpha channel is grey.
The values are calculated by (r+2g+b)/4.)

"raw":1 Do not RLE encode the image

METHOD
Image.TGA._decode

SYNTAX
object _decode(string data)

DESCRIPTION
Decodes a Targa image to a mapping. The mapping follows this format: ([ "image":img_object, "alpha":alpha_channel ])

NOTE
Throws upon error in data.

Previous section To contents Next section