Home Products Download Order Contacts

comp.graphics.algorithms

Subject: Help with blit bug!





I have written a 16bit 565 50% blend blit for an embedded device but
it's got a bug I am having trouble with. I am trying to process two
pixels at once but the pixels seem to blit in a swapped order on the
device. Is there something wrong with this code or is it a device issue
where I would have to swap the pixels before blitting? In that case
would I be better offer processing a pixel at time?

uint8 *dst = dstBitData + ( dstY * dstPitch ) + ( dstX << 1 );
uint8 *src = srcBitData + ( srcY * srcPitch ) + ( srcX << 1 );

dstPad = dstPitch - ( dstWidth << 1 );
srcPad = srcPitch - ( dstWidth << 1 );
dstWidth >>= 1;

while( dstHeight-- )
{
register int32 col( dstWidth );

while( col-- )
{
*( reinterpret_cast( dst ) ) =
( ( *( reinterpret_cast( dst ) ) & RGB565_32_A128
) >> 1 ) + ( ( *( reinterpret_cast( src ) ) & RGB565_32_A128 )
>> 1 );
dst += 4;
src += 4;
}

dst += dstPad;
src += srcPad;
}

Reply


View All Messages in comp.graphics.algorithms

path:


Replies:
Re: Help with blit bug!
Re: Help with blit bug!

Copyright 2006 WatermarkFactory.com. All Rights Reserved.