Since it seems that you plan on implementing code from the clone brush to create a “dirty brush” feature, I thought it appropriate to bring up another thread where I mention a feature that might work well using code from the clone brush engine:
The idea for the feature mentioned in this thread is to be able to load a brush with a gradient of two or more colors on a brush to make shading easier and to enable certain painting techniques used to in natural media. Although @Rami demonstrates a method of painting gradients using the clone brush, it doesn’t quite achieve the affect I’m aiming for since the clone brush still shifts its area of selection constantly while painting.