Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

AndroidÔ­Éú(Native)C¿ª·¢Ö®¶þ framebufferƪ


Èç¶ÔAndroidÔ­Éú(Natvie)C¿ª·¢»¹ÈκÎÒÉÎÊ£¬Çë²ÎÔÄhttp://emck.avaw.com/?p=205
ËäÈ»ÏÖÔÚÄÜͨ¹ý½»²æ»·¾³±àÒë³ÌÐò£¬²¢pushµ½AndroidÉÏÖ´ÐУ¬µ«ÄÇÖ»ÊÇconsolę³ÌÐò£¬ÊDz»ÊÇÓÐЩµ¥µ÷ÄØ£¿ÏÂÃæ¾ÍÒª¿´ÈçºÎͨ¹ýLinuxµÄ framebuffer ¼¼ÊõÔÚAndroidÉÏ»­Í¼ÐΣ¬¹ØÓÚLinuxµÄframebuffer¼¼Êõ£¬ÕâÀï¾Í²»ÔÙÏêϸ½²½âÁË£¬Çë´ó¼Ògoogleһϡ£
²Ù×÷framebufferµÄÖ÷Òª²½ÖèÈçÏ£º
1¡¢´ò¿ªÒ»¸ö¿ÉÓõÄFrameBufferÉ豸£»
2¡¢Í¨¹ýmmapµ÷ÓðÑÏÔ¿¨µÄÎïÀíÄÚ´æ¿Õ¼äÓ³Éäµ½Óû§¿Õ¼ä£»
3¡¢¸ü¸ÄÄÚ´æ¿Õ¼äÀïµÄÏñËØÊý¾Ý²¢ÏÔʾ£»
4¡¢Í˳öʱ¹Ø±ÕframebufferÉ豸¡£
ÏÂÃæµÄÕâ¸öÀý×Ó¼òµ¥µØÓÃframebuffer»­ÁËÒ»¸ö½¥±äµÄ½ø¶ÈÌõ£¬´úÂë framebuf.c ÈçÏ£º
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
inline static unsigned short int make16color(unsigned char r, unsigned char g, unsigned char b)
{
return (
(((r >> 3) & 31) << 11) |
(((g >> 2) & 63) << 5)  |
((b >> 3) & 31)        );
}
int main() {
int fbfd = 0;
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
long int screensize = 0;
char *fbp = 0;
int x = 0, y = 0;
int guage_height = 20, step = 10;
long int location = 0;
// Open the file for reading and writing
fbfd = open(”/dev/graphics/fb0″, O_RDWR);
if (!fbfd) {
printf(”Error: cannot open framebuffer device.\n”);
exit(1);
}
printf(”The framebuffer device was opened successfully.\n”);
// Get fixed screen information
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) {
printf(”Error reading fixed information.\n”);
exit(2);
}
// Get variable screen information
if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo)) {
printf(”Error reading variable information.\n”);
exit(3);
}
printf(”sizeof(unsigned short) = %d\n”, sizeof(unsigned short));
printf(”%dx%d, %dbpp\n”, vinfo.xres, vinfo.yres, vinfo.bits_per_pixel );
printf(”xoffset:%d, yoffset:%d, line_length


Ïà¹ØÎĵµ£º

¡¶CÓïÑÔÉî¶ÈÆÊÎö¡·Ñ§Ï°±Ê¼ÇÈý

1.10.3£¬voidÖ¸Õë
¡¾¹æÔò 1-35¡¿Ç§ÍòСÐÄÓÖСÐÄʹÓÃvoidÖ¸ÕëÀàÐÍ¡£
°´ÕÕ ANSI(American National Standards Institute)±ê×¼£¬²»ÄÜ¶Ô voidÖ¸Õë½øÐÐËã·¨²Ù×÷£¬¼´ÏÂÁвÙ×÷¶¼ÊDz»ºÏ·¨µÄ£º
void * pvoid;
pvoid++; //ANSI£º´íÎó
pvoid += 1; //ANSI£º´íÎó
ANSI ±ê×¼Ö®ËùÒÔÕâÑùÈ϶¨£¬ÊÇÒòΪËü¼á³Ö£º½øÐÐËã·¨²Ù×÷µÄÖ¸Õë±ØÐëÊ ......

C£«£«ÈçºÎµ÷ÓÃdelphiÖÆ×÷µÄdll


Ò»¡¢¸ÅÊö¼°Ê¾Àý´úÂë
DelphiÖаüÀ¨Ðí¶àÒѾ­·â×°ºÃµÄÀ༰¿Ø¼þ£¬ÆäÖеķǿÉÊÓ»¯¿Ø¼þ¿âÒÔ¹¦ÄÜ·½Ê½»®·Ö¿É´¦ÀíÖî¶àÓ¦ÓÃÐèÇó¡£ÈôʹÓÃC£«£«ÊµÏÖϵͳʱ¶ÔijЩ¹¦Äܼòµ¥µ÷ÓÃdelphiÖÐÏֳɵĿâʱ¼´¿É¡£Òò´Ë½«delphiÖеĿâÒÔDLLÐÎʽ·â×°ºÃÖ®ºóÈçºÎ½«·½·¨µ¼³ö¿É¹©C£«£«µ÷ÓÃÊDZ¾ÎļǼµÄÖØµã¡£C£«£«µ÷Óõķ½Ê½ÓжàÖÖ£¬ÔÚÕâÀïÖ»ÌÖÂÛÒ»ÖÖ¾² ......

¡¶CºÍÖ¸Õë¡·±Ê¼Ç1

1.scanf¸ñʽ·û        p9
ld    long
lf    double
2.Èý×Öĸ´Ê        p22
    ΪÁ˱íÊ¾Ò»Ð©ÌØÊâµÄ×Ö·û£¬ÔÚÀÏʽµÄ»úÆ÷¼üÅÌÖпÉÄÜûÓеÄ×Ö·û£¬ÌرðÔ¼¶¨ÁËÒ»ÖÖÈý×Öĸ´Ê£¬Èý×Öĸ´Ê¶¼ÒÔ??¿ªÊ¼£¬ÈçÏ£º
??( &nb ......

yichiµÄc´úÂëÊéд¹æ·¶

//yichiµÄc´úÂë±àд¹æ·¶£º091216
//Ò»¡¢³£Á¿£º
//  ËùÓк궨Ò塢ö¾Ù³£ÊýºÍconst±äÁ¿È«²¿ÓÉ´óд×Öĸ¹¹³É£¬´ÊÓë´ÊÖ®¼äÓÃÏ»®Ïß·Ö¿ª£¬ÀýÈç#define GPS_WORK_STATUS 0x30
//¶þ¡¢±äÁ¿£º
//  ¾Ö²¿±äÁ¿È«²¿ÓÉСд×Öĸ¹¹³É£¬´ÊÓë´ÊÖ®¼äÓÃÏ»®Ïß·Ö¿ª£¬ÀýÈçuint8 ack_delay_time[4];È«¾Ö±äÁ¿Óë¾Ö²¿±äÁ¿ ......

ÓÃc±àдÇóÐÅÏ¢ÂÛÖи÷ÖÖìØºÍÐÅÏ¢Á¿µÄ³ÌÐò

#include<stdio.h>
#include<math.h>
#define u 20
int i,j,n,m;
float Ix[u],I[u][u],H_X,H_Y,H_XY,I_XY,H_XpY,Pypx[u][u],Px[u],H_YpX,Py[u],Pxpy[u][u],Pxy[u][u];
/*¶¨ÒåµÄIx[]=I(x[i])×ÔÐÅÏ¢£»I[][]=I(x[i];y[j])»¥ÐÅÏ¢£»H_X=H(X)ƽ¾ù×ÔÐÅÏ¢£»H_XY=H(XY)ÁªºÏìØ;
I_XY=I(X;Y)ƽ¾ù»¥ÐÅÏ¢£»H_XpY=H(X|Y ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ