Thu, 9 December, 2010 21:24:54
Re: [directfb-users] how to access pixels...
From: Chris Bore <chris_b...@yahoo.co.uk> ...View Contact 
To: Ra vI <ravi...@gmail.com> 
 
________________________________

Look in df_fire.c example for the following code:


ret = surface->Lock( surface, DSLF_WRITE,
                     &surface_data, &surface_pitch );
if (ret) {
     DirectFBError( "IDirectFBSurface::Lock() failed", ret );
     exit_application( 6 );
}

/* Add skip offset. */
surface_data += surface_pitch * fire->skip;

/* Write fire data to the surface. */
for (i = 0; i < fire->height; i++) {
     /* Copy one line to the surface. */
     memcpy( surface_data, fire->data + i * fire->width, fire->width );

     /* Increase surface data pointer to the next line. */
     surface_data += surface_pitch;
}

/* Unlock the surface's data. */


ret = surface->Unlock( surface
 );

You need to understand the Surface data pointer, the pitch, and the PixelFormat.


 Chris==================================
Chris Bore
Training Director
BORES Signal Processing
www.bores.com





________________________________
From: Ra vI <ravi...@gmail.com>
To: directfb-users@directfb.org
Sent: Thu, 9 December, 2010 13:04:38
Subject: [directfb-users] how to access pixels

Hello  All,

I'm new to directfb, i have a function to implement that returns a pointer to 
an 
array of pixels representing the
pixels in the specified row of the surface columns from x (inclusive) to x + w
(exclusive), Can anyone help me on how to access the pixels in directfb.

-- 
Regards

Ravi Swami
EnMedia Software Technologies
Ph +91-974-264-3747
_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to