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.
Good, but the last points:
1. small inner cycles by `channel` it's also not a good practise
2. you calculate `j*channels+c` many many times.

So, I believe the final version can be
```
int len = w * cn;
for(int i=0;i < h; i++)
{
    float * patchXLinePtr = patchGradientX.ptr<float>(i);
    float * patchYLinePtr = patchGradientY.ptr<float>(i);
    const float * destinationXLinePtr = destinationGradientX.ptr<float>(i);
    const float * destinationYLinePtr = destinationGradientY.ptr<float>(i);
    const float * binaryMaskLinePtr = binaryMaskFloat.ptr<float>(i);

    for (int j=0; j < len; j++)
    {
        int maskIndex = j / cn;
        if(abs(patchXLinePtr[j] - patchYLinePtr[j]) >
                abs(destinationXLinePtr[j] - destinationYLinePtr[j]))
        {

            patchXLinePtr[j] *= binaryMaskLinePtr[maskIndex];
            patchYLinePtr[j] *= binaryMaskLinePtr[maskIndex];
        }
        else
        {
            patchXLinePtr[j] = destinationXLinePtr[j]
                * binaryMaskLinePtr[maskIndex];
            patchYLinePtr[j] = destinationYLinePtr[j]
                * binaryMaskLinePtr[maskIndex];
        }
    }
}
```