You could write a set of helper/utility functions which wrap usage of the IDirectFBSurface interface's Lock and Unlock functions. Calling Lock provides a pointer to the surface's raw pixels. Unlock must be called when you're finished updating the surface. For optimal performance, I would try to find a good spot to call Lock once prior to all of the individual pixel gets/sets, and another spot to call Unlock afterwards. I would also pay close attention to where the surface memory resides (video or system) if a UMA (unified memory architecture)-style platform is not being used.
Good luck! Timothy ________________________________ > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of Francisco Sant'anna > Sent: Tuesday, September 11, 2007 11:08 AM > To: [email protected] > Subject: [directfb-dev] Get/Set pixel color > > Hello, > > I need to bind with DirectFB an existing library that supports functions to get and set single pixels in a canvas. > > The corresponding functions in DirectFB would be as follows: > GetPixelColor (IDirectFBSurface* thiz, int x, int y, u8* r, u8* g, u8* b, u8* a); > SetPixelColor ( IDirectFBSurface* thiz, int x, int y, u8 r, u8 g, u8 b, u8 a); > > I couldn't find a way to achieve this with the current API. > Are there any plans to support this? > Or maybe there's a workaround that I missed. > > Thank you, > Francisco _______________________________________________ directfb-dev mailing list [email protected] http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
