Package libavg :: Module avg :: Class Bitmap

Class Bitmap


Class representing a rectangular set of pixels. Bitmaps can be obtained from any RasterNode. For nodes of type Image, the current bitmap can be set as well.

Instance Methods
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
getAvg(...)
 
getFormat()
Returns the layout of the pixels in the bitmap.
string
getName()
 
getPixels()
Returns the raw pixel data in the bitmap as a python string.
 
getSize()
Returns the size of the image in pixels.
 
getStdDev(...)
 
save(filename)
Writes the image to a file.
 
setPixels(pixels)
Changes the raw pixel data in the bitmap.
bmp
subtract(otherbitmap)

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

getFormat()

 

Returns the layout of the pixels in the bitmap. Possible return values are B5G6R5, B8G8R8, B8G8R8A8, B8G8R8X8, A8B8G8R8, X8B8G8R8, R5G6B5, R8G8B8, R8G8B8A8, R8G8B8X8, A8R8G8B8, X8R8G8B8, I8 and YCbCr422.

getPixels()

 

Returns the raw pixel data in the bitmap as a python string. This method can be used to interface to the python imaging library PIL (http://www.pythonware.com/products/pil/).

save(filename)

 

Writes the image to a file. File format is determined using the extension. Any file format specified by ImageMagick (http://www.imagemagick.org) can be used.

setPixels(pixels)

 

Changes the raw pixel data in the bitmap. Doesn't change dimensions or pixel format. Can be used to interface to the python imaging library PIL (http://www.pythonware.com/products/pil/).

Parameters:
  • pixels - Image data as a python string.