Refactoring of seamless cloning

This pull request brings several improvement to the seamless cloning routine in the photo module.

First, a number of unnecessary allocations have been removed, lowering the overall memory footprint of the methods.

Secondly, a number of method were re-written in order to improve the overall performances, resulting in a significant speed-up (at least x2)

Finally, a number of cosmetic improvements are brought in order to better comply with the coding guidelines.

Please note that this PR also contains the bug fix already proposed in PR #3283, but not merged yet.
Sorry you misunderstood.
If operator= performs a deep copy, I don't care about the constness of src, dest and mask, since the corresponding InputArray will never be modified.
On the other hand, if operator= performs a shallow copy, I want to enforce the fact that src, dest and mask come from InputArray, and mark them as const to reflect that.

So, when you say that const is unnecessary, is it because of operator= performing a deep copy(in which I will change this to something else, because it's not the behaviour i desire.