Home | Trees | Index | Help |
|
---|
|
object --+ | _EGObject --+ | object --+ | | | AutoGenId --+ | Image
|
|||
__init__(self,
**kargs)
Image constructor. |
|||
__get_gtk_pixbuf__(self) | |||
__del__(self) | |||
save(self,
filename,
format=None,
**options)
Save image to a file. |
|||
get_formats(self)
Get supported image format information. |
|||
get_writable_formats(self)
Get formats that support saving/writing. |
|||
load_file(self,
filename)
Load image from file given its filename. |
|||
load_data(self,
data,
width,
height,
depth=24,
has_alpha=None,
rowstride=None)
Load image from raw data. |
|||
get_data(self)
Return raw data and information about this image. |
|||
get_width(self) | |||
get_height(self) | |||
get_size(self)
Return a tuple ( width, heigt ) |
|||
get_rowstride(self)
Row stride is the allocated size of a row. |
|||
get_n_channels(self)
Number of channels. |
|||
get_bits_per_pixel(self)
Bits per pixel |
|||
get_depth(self)
Bits per pixel |
|||
has_alpha(self)
If it has an alpha channel |
|||
Inherited from Inherited from |
|
|||
__get_by_id__(klass, id) | |||
Inherited from |
|
|||
_id2obj_ | |||
Inherited from Inherited from |
|
Image constructor. Images can be constructed in 2 ways using keyword arguments:
|
|
|
|
Save image to a file. If format is not specified, it will be guessed from filename. Format may be an extension or a mime type, see get_writable_formats().
|
|
|
Load image from file given its filename. filename may be a string or a tuple/list with path elements, this helps your program to stay portable across different platforms.
>>> i = Image()
>>> i.load_file( 'img.png' )
>>> i.load_file( ( 'test', 'img.png' ) )
|
Load image from raw data. If no value is provided as has_alpha, then it's set to
>>> i = Image()
>>> i.load_data( my_data1, 800, 600, depth=32, has_alpha=False )
>>> i.load_data( my_data2, 400, 300, depth=24 )
|
|
|
|
|
Row stride is the allocated size of a row. Generally, rowstride is the number of elements in a row multiplied by the size of each element (bits per pixel). But there are cases that there is more space left, a padding, to align it to some boundary, so you may get different value for row stride. |
|
|
|
|
|
_id2obj_
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 3.0alpha2 on Fri Jul 28 16:22:27 2006 | http://epydoc.sf.net |