What does the Scalar& mean? I know if & comes before, it means its "the adress of". Here its used after a type in a casting operation, does the & mean anything or should i take it to be just part of the Scalar name? (doesnt sound likely :/)
I went over this but for what I understood a reference starts with a &, doesn't end with it. So this looks more like a casting operation on borderValue to the Scalar& type, not a creation of a reference value. So I'm still not sure what the & does to Scalar..
this looks more like a casting operation on borderValue to the Scalar& type
Correct. Scalar& names type reference to Scalar. I do not know why they used unsafe C-cast, but your code will be valid only if borderValue has type of Scalar, or derived from it.