Lu yunfeng wrote:
> Dear Pedro,
>
> My question is not the simple display of an image by DirectFB, I want to
> rotate the image by 90 degrees first , then to display it by DirectFB. I
> cannot find any APIs in DirectFB LIB which can support image rotation
> display.
>
> Regards,
> Yunfeng
>
You can use TextureTriangles() to do that.
The following code blits "src" surface to "dst" surface rotated by 90
degrees.
/* BEGIN CODE */
DFBVertex v[4];
/* [x,y] are the coordinates of the destination point. */
/* [width,height] is the size of the source surface. */
v[0].x = x;
v[0].y = y;
v[0].z = 0;
v[0].w = 1;
v[0].s = 1;
v[0].t = 0;
v[1].x = x+width;
v[1].y = y;
v[1].z = 0;
v[1].w = 1;
v[1].s = 1;
v[1].t = 1;
v[2].x = x+width;
v[2].y = y+height;
v[2].z = 0;
v[2].w = 1;
v[2].s = 0;
v[2].t = 1;
v[3].x = x;
v[3].y = y+height;
v[3].z = 0;
v[3].w = 1;
v[3].s = 0;
v[3].t = 0;
dst->TextureTriangles( dst, src, v, NULL, 4, DTTF_FAN );
/* END CODE */
However this only works if TextureTriangles() is accelerated, since
there is not software fallback.
--
Regards,
Claudio Ciccani
[EMAIL PROTECTED]
http://directfb.org
http://sf.net/projects/php-directfb
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev