2007/4/13, Chris Cran <[EMAIL PROTECTED]>:
> Hello everybody !
>
> I have installed directFB on my embedded card IMX21.
>
> I can run my programs with directFB, but I have to
> problems.
>
>
> 1. The first is a problem with the colours.
>
> You know that, with directFB, colours are coded with 4
> Bytes : R,G,B,A (R=Red, G=Green, B=blue,
> A=Alphachannel).
>
> But on my IMX, this code is badly interpreted: the
> first byte represents the Green, the second and the
> third the blue, the fourth the red. (G,B1,B2,R)
>
> So, if I select the colour Red for my background,
> (R=FF, G=00, B=00, A=00) it will be paint in green
> (G=FF, B1=00, B2=00, R=00).
Hmm, I had problems with twisted bytes
- PowerPC ( Big Endian ) + Silicon Motion ( Little Endian )
I resolved the problems via replacing methods to access to the memory.
e.g
static void Sacc_OP_Aop_PFI(toK)( GenefxState *gfxs )
{
int l = gfxs->length;
GenefxAccumulator *S = gfxs->Sacc;
u16 *D = gfxs->Aop[0];
u16 Dkey = gfxs->Dkey;
while (l--) {
if (!(S->RGB.a & 0xF000) && MASK_RGB( LOAD_U16_VO(D) ) == Dkey)
STORE_U16_VO( D , PIXEL( *S ) );
S++;
D++;
}
}
My functions ( LOAD_U16_VO() and STORE_U16_VO() ) swop bytes of "u16"
into right order.
Otherwise colors is wrong :
e g RGB16
------------
RRRRR GGG || GGG BBBBB - right colors
GGGBB BBB || RRR RRGGG - garbage
The most of DirectFB's programs work properly both normal and twisted
bytes systems.
My patch to the release 1.0.0 you can take here:
ftp://ftp.varma-el.com/bin/directfb/directfb_mixed_endian.tar.gz
I advise you try to change the functions according to your system. (
lib/direct/util.h )
Perhaps, you should change the providers of image too...
NOTE !!!! config.h must contain #define REVERSE_BYTES 1
Good luck
--
Best Regards
Nikita Egorov
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_______________________________________________
directfb-users mailing list
[EMAIL PROTECTED]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users