Class IMAGE[in Image file support]

Main SDL IMAGE encapsulation class.

class IMAGE

more...

Summary

GetError()Gets image related error
Load()Loads an image file based on filename extension
SetError()Sets image related error string
isBMP()Checks if an image is in BMP format.
isGIF()Checks if an image is in GIF format.
isJPG()Checks if an image is in JPG format.
isLBM()Checks if an image is in LBM format.
isPCX()Checks if an image is in PCX format.
isPNG()Checks if an image is in PCX format.
isPNM()Checks if an image is in PNM format.
isTIF()Checks if an image is in TIF format.
isXCF()Checks if an image is in XCF format.
isXPM()Checks if an image is in XPM format.

Detailed description

Main SDL IMAGE encapsulation class.

This class is the namespace for IMAGE functions of the SDL module. It contains the extensions provided by Falcon on the sdlimage module.

Methods

GetError()

Gets image related error

IMAGE.GetError( )

Returns:Returns a string containing a humam readble version or the reason for the last error that occured

The current active image error is returned

Load()

Loads an image file based on filename extension

IMAGE.Load( file, [type] )

fileThe name of the file to be loaded, or a Falcon Stream instance pointing at the beginning of the image data.
type A string representing the type of image in the file stream.
Returns: A new instance of SDLSurface.
Raises:
SDLErrorif the file could not be interpreted as an image.

Load file for use as an image in a new surface. This actually uses the file extension as the type string. This can load all supported image files, provided that the extension is correctly representing the file type.

When a stream is given as file parameter, the type parameter is taken as the format type of the image in the incoming stream. It is just an hint, some common format doesn't require necessarily it.

Currently, the only format which is not automatically recognized is "TGA"; however, providing the hint will result in less guessing and may be necessary if the underlying stream doesn't support seek (i.e. a network stream or the standard input).

Here is a list of the currently recognized strings (case is not important):

SetError()

Sets image related error string

IMAGE.SetError( )

Returns:Returns a string containing a humam readble version or the reason for the last error that occured

This function sets the error string which may be fetched with img_GetError (or sdl_GetError). The function accepts a string not longer than 1024 chars in length.

isBMP()

Checks if an image is in BMP format.

IMAGE.isBMP( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a BMP image.

It may be useful to reset the stream to the current position after calling this function.

isGIF()

Checks if an image is in GIF format.

IMAGE.isGIF( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a GIF image.

It may be useful to reset the stream to the current position after calling this function.

isJPG()

Checks if an image is in JPG format.

IMAGE.isJPG( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a JPG image.

It may be useful to reset the stream to the current position after calling this function.

isLBM()

Checks if an image is in LBM format.

IMAGE.isLBM( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a LBM image.

It may be useful to reset the stream to the current position after calling this function.

isPCX()

Checks if an image is in PCX format.

IMAGE.isPCX( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a PCX image.

It may be useful to reset the stream to the current position after calling this function.

isPNG()

Checks if an image is in PCX format.

IMAGE.isPNG( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a PCX image.

It may be useful to reset the stream to the current position after calling this function.

isPNM()

Checks if an image is in PNM format.

IMAGE.isPNM( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a PNM image.

It may be useful to reset the stream to the current position after calling this function.

isTIF()

Checks if an image is in TIF format.

IMAGE.isTIF( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a TIF image.

It may be useful to reset the stream to the current position after calling this function.

isXCF()

Checks if an image is in XCF format.

IMAGE.isXCF( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a XCF image.

It may be useful to reset the stream to the current position after calling this function.

isXPM()

Checks if an image is in XPM format.

IMAGE.isXPM( file )

filea Falcon Stream instance pointing at the beginning of the image data.
Returns:True if the stream is stroing a XPM image.

It may be useful to reset the stream to the current position after calling this function.


Made with faldoc 2.0.0