Home Products Download Order Contacts

comp.graphics.algorithms

Subject: Re: Help with blit bug!



Kaba wrote:
> *( reinterpret_cast( dst ) ) =
> ( ( *( reinterpret_cast( src ) ) & RGB565_32_A128 ) >> 1 )


It just so happens that I am fading in from black so *dst == 0. I tried
your suggestion I tested again with *dst = ( ( *src & RGB565_32_A128 )
>> 1 ) and got the exact same result as before, which makes sense since
*dst is always zero. Good suggestion, it does simplify things.

I also tested the code with an DWORD pointer and I get the same results...

uint32 *dst = reinterpret_cast( dstBitData + ( y * dstPitch ) +
( x << 1 ) );
uint32 *src = reinterpret_cast( srcBitData + ( srcY * srcPitch
) + ( srcX << 1 ) );

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

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

while( col-- )
*dst++ = ( ( *dst & RGB565_32_A128 ) >> 1 ) + ( ( *src++ &
RGB565_32_A128 ) >> 1 );

dst += dstPad;
src += srcPad;
}

I rewrote the code the code to do one pixel at a time and it works
perfectly, although slower.

uint16 *dst = reinterpret_cast( dstBitData + ( y * dstPitch ) +
( x << 1 ) );
uint32 *src = reinterpret_cast( srcBitData + ( srcY * srcPitch
) + ( srcX << 1 ) );

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

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

while( col-- )
*dst++ = ( ( *dst & RGB565_16_A128 ) >> 1 ) + ( ( *src++ &
RGB565_16_A128 ) >> 1 );

dst += dstPad;
src += srcPad;
}

Reply


View All Messages in comp.graphics.algorithms

path:
Help with blit bug! =>Re: Help with blit bug! =>

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

Copyright 2006 WatermarkFactory.com. All Rights Reserved.