M
Mickey
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<uint32*>( dst ) ) =
dst += 4;
src += 4;
}
dst += dstPad;
src += srcPad;
}
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<uint32*>( dst ) ) =
dst += 4;
src += 4;
}
dst += dstPad;
src += srcPad;
}