I have a need to mirror a byte’s value around the centre of 128. So, example outputs of this function include:
In 0 Out 255
In 255 Out 0
In 128 Out 128
In 127 Out 129
In 30 Out 225
In 225 Out 30
I’m driving myself nuts with this, I’m sure I’ll kick myself when I read the answers.
Cheers
There is no obvious rule that matches your example output.
The first two and the last result could be explained by
255-n, which might be a normal interpretation of ‘mirroring’ a byte. But 128->128 would have to be256-n, and 127->1 is seemingly inexplicable.