Bonus Brush

Bonus Brush Module

This file contains a widget class that allows the user to design their own brush.

Usage:

To use this module, import it and instantiate is as you wish:

from Paint4Brains.GUI.BonusBrush import BonusBrush

brush = BonusBrush()

It then has to be made visible using:

brush.setVisible(True)
class Paint4Brains.GUI.BonusBrush.BonusBrush

BonusBrush class for Paint4Brains.

This class contains the implementation of a series of methods that allow the user to design a brush.

change_kernel(new_kernel)

Changes the kernel being used to design the bonus brush

This is basically a helper function to switch between erasing and drawing.

disappear()

Makes the bonus_brush designing window invisible.

Some checks are made to ensure that the new brush is within the expected values.

new_matrix_size()

Allows the user to change the size of the new brush

Depending on the new value in the text box (n), the kernel size is set to nxn

set_pen()

Set the kernel being used to design the bonus brush to a pen (positive pixel)

set_rub()

Set the kernel being used to design the bonus brush to a rubber (negative pixel)