The TWAIN Forum

www.twainforum.org
It is currently Thu May 23, 2013 11:11 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Feb 25, 2012 3:53 am 
Offline

Joined: Wed Feb 22, 2012 11:47 am
Posts: 8
Image received by memory transfer mode has red color replaced with blue and vice versa. I tried to invert them using macro
Code:
#define RGB2BGR(color) (color & 0xFF000000) | ((color & 0xFF0000) >> 16) | (color & 0x00FF00) | ((color & 0x0000FF) << 16)

but the image wasn't correct. Did anyone had similar problem? How to invert colors?

-----------------------------------

If this could help to somebody, in Twacker source code is a function named FlipBitMap. I didn't know that native and memory mode have different colors order.


Top
 Profile  
 
PostPosted: Sat Mar 10, 2012 1:20 am 
Offline

Joined: Sat Mar 10, 2012 12:03 am
Posts: 2
Hi,

In memory mode data transfer actually the pixel format coming from DS is BGR, so in the application you need to flip the R and B of every pixel to make it RGB.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group