Getting 24Bpp rather than 32Bpp bitmap
Posted: 26 September 2010 05:23 AM   [ Ignore ]
New Member
Rank
Total Posts:  1
Joined  2010-09-23

As in the topic - is it possible to obtain 24Bpp bitmap from CLEye SDK? Any suggestions how to convert it in efficient way? Now i’m converting it in this way:

Bitmap bitmap32 = new Bitmap(wh4PixelFormat.Format32bppRgb_map);
Image<Bgrbyteimage24 = new Image<Bgrbyte>(bitmap32); 

but is is very slow method.

Profile
 
 
Posted: 29 September 2010 08:07 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

Converting from RGB32 to RGB24 is not that complex. You can use variety of methods including MMX/SSE optimized code or even run it on the GPU. Effectively you just need to copy source (RGB32) image data into another buffer (RGB24) and skip alpha component.
It is essentially like this:

for (int i=0i<width*heighti++)
{
    
*dest++ = *source++;
    *
dest++ = *source++;
    *
dest++ = *source++;
                      
source++;
Profile
 
 
 
 


RSS 2.0     Atom Feed