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
Ïà¹ØÎĵµ£º
1.10.3£¬voidÖ¸Õë
¡¾¹æÔò 1-35¡¿Ç§ÍòСÐÄÓÖСÐÄʹÓÃvoidÖ¸ÕëÀàÐÍ¡£
°´ÕÕ ANSI(American National Standards Institute)±ê×¼£¬²»ÄÜ¶Ô voidÖ¸Õë½øÐÐËã·¨²Ù×÷£¬¼´ÏÂÁвÙ×÷¶¼ÊDz»ºÏ·¨µÄ£º
void * pvoid;
pvoid++; //ANSI£º´íÎó
pvoid += 1; //ANSI£º´íÎó
ANSI ±ê×¼Ö®ËùÒÔÕâÑùÈ϶¨£¬ÊÇÒòΪËü¼á³Ö£º½øÐÐËã·¨²Ù×÷µÄÖ¸Õë±ØÐëÊ ......
Ò»¡¢¸ÅÊö¼°Ê¾Àý´úÂë
DelphiÖаüÀ¨Ðí¶àÒѾ·â×°ºÃµÄÀ༰¿Ø¼þ£¬ÆäÖеķǿÉÊÓ»¯¿Ø¼þ¿âÒÔ¹¦ÄÜ·½Ê½»®·Ö¿É´¦ÀíÖî¶àÓ¦ÓÃÐèÇó¡£ÈôʹÓÃC£«£«ÊµÏÖϵͳʱ¶ÔijЩ¹¦Äܼòµ¥µ÷ÓÃdelphiÖÐÏֳɵĿâʱ¼´¿É¡£Òò´Ë½«delphiÖеĿâÒÔDLLÐÎʽ·â×°ºÃÖ®ºóÈçºÎ½«·½·¨µ¼³ö¿É¹©C£«£«µ÷ÓÃÊDZ¾ÎļǼµÄÖØµã¡£C£«£«µ÷Óõķ½Ê½ÓжàÖÖ£¬ÔÚÕâÀïÖ»ÌÖÂÛÒ»ÖÖ¾² ......
Visual C++ÖеÄCÔËÐÐʱ¿âdzÎö(lib dll)
Ò»¡¢ÀúÊ·
¡¡¡¡CÔËÐÐʱ¿â¾ÍÊÇC run-time library£¬µ®ÉúÓÚ20ÊÀ¼Í70Äê´ú£¬ÊÇC¶ø·ÇC++ÓïÑÔÊÀ½çµÄ¸ÅÄC³ÌÐòÔËÐÐʱÐèÒªÕâЩ¿âÖеĺ¯Êý¡£
¡¡¡¡CÓïÑÔÊÇËùνµÄ“СÄں˔ÓïÑÔ£¬¾ÍÆäÓïÑÔ±¾ÉíÀ´ËµºÜС£¨²»¶àµÄ¹Ø¼ü×Ö£¬³ÌÐòÁ÷³Ì¿ØÖÆ£¬Êý¾ÝÀàÐ͵ȣ©¡£ËùÒÔ£¬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 ......
ÔÚѧϰ£¼Linux³ÌÐòÉè¼Æ£¾µÚ8ÕÂMySQLÊý¾Ý¿â8.3½Ú£º
ʹÓÃCÓïÑÔ·ÃÎÊMySQL·ÃÎÊÊý¾Ý¿âʱ³¢ÊÔ°ÑSQLÊý¾Ý»»³ÉÁËÖÐÎÄ£¬µ«ÊÇÔÚÔËÐÐʾÀý³ÌÐòʱÖÕ¶ËÊä³öÈ´ÂÒÂ룬MySQL C ÓïÑÔÁ¬½ÓĬÈÏ×Ö·û¼¯ÊÇlatin1
²éÁËÏÂAPIÕÒµ½ÈçϺ¯Êý¿É½â¾öÖÐÎÄÂÒÂëÎÊÌâ¡£
int
mysql_set_character_set(
MYSQL *
mysql,
char
*
csname)
ÃèÊö
¸Ãº¯ÊýÓ ......