pyjsdl :: mask :: Mask :: Class Mask

Class Mask

object --+
         |
        Mask

pyjsdl.mask.Mask

Instance Methods
 
__init__(self, size)
Return a Mask object. The size argument is (width, height) of the mask. The mask is represented by a list of Bitset.
 
__str__(self)
str(x)
 
__repr__(self)
repr(x)
 
get_size(self)
Return width, height of mask.
 
get_at(self, pos)
Return bit setting for given pos.
 
set_at(self, pos, value=1)
Set bit for given pos. Optional value to set bit, eith 1 or 0, defaults to 1.
 
fill(self)
Fill mask.
 
clear(self)
Clear mask.
 
invert(self)
Invert bit value in mask.
 
count(self)
Return count of true bits in mask.
 
overlap(self, mask, offset)
Return True if mask at offset position overlap with this mask.
 
toString(self, bit=('1','0'))
Return string representation of mask. Optional bit argument specify bit character.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, size)
(Constructor)

 
Return a Mask object. The size argument is (width, height) of the mask. The mask is represented by a list of Bitset.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

 
str(x)
Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

 
repr(x)
Overrides: object.__repr__
(inherited documentation)