[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-video
Subject:    Re: BGR->RGB
From:       Cagdas Ogut <cagdas () xs4all ! nl>
Date:       2002-11-26 19:56:58
[Download RAW message or body]

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



--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/video4linux-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic