Re: BGR->RGB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



a fast way to try may be like:

/* bgrp 32 bit, blue, green, red, pad */

#define blue *(data+o)
#define red *(data+o+2)

swap_rb(*data) {

for (o=0;o<sizeof(*data);o=+4)

{

blue^=red;
red=^blue;
blue^=red;

}

This is pseudo code to demonstrate exor swapping. just converts the data and if the data size is cachable, it should run fast. for 24 bit it requires a new loop.

Hope it helps,

Cagdas





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux