How can I do replace the following manual logic by http://programming.sirrida.de/perm_fn.html#bit_permute_step ?
unsigned int ConvertRGBAToBGRA(unsigned int v) {
unsigned char r = (v)& 0xFF;
unsigned char g = (v >> 8) & 0xFF;
unsigned char b = (v >> 16) & 0xFF;
unsigned char a = (v >> 24) & 0xFF;
return (a << 24) | (r << 16) | (g << 8) | b;
};
Is there a better way to do the above using http://programming.sirrida.de/perm_fn.html#bit_permute_step ?