亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fblin-1.c

?? 嵌入式系統圖形用戶界面編程
?? C
字號:
/*** $Id: fblin-1.c,v 1.5 2003/11/22 11:49:29 weiym Exp $** ** fblin-1.c: Frame buffer 1 bpp linear video driver for MiniGUI**  This driver is suitable for the most significant bit being left.**** Copyright (C) 2003 Feynman Software.**** Create date: 2003/07/10*//*** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include <stdlib.h>#include <string.h>#include "native.h"#include "fb.h"#ifdef _FBLIN1L_SUPPORT#define SHIFT(x) (7 - (x & 7))static unsigned char pixmask [] = {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};static unsigned char pixnotmask [] = {0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};#define normalize_pixel(c) ((c&1)?1:0)static inline gal_uint8* get_pixel_address (PSD psd, int x, int y){    return (gal_uint8 *) psd->addr + y*psd->linelen + (x >> 3);}static inline void xsetpixel_in_byte (int x, gal_pixel c, gal_uint8 *byte){    *byte = (*byte & (pixnotmask[x&7])) | ((c << SHIFT(x))^(*byte & pixmask[x&7]));}static inline void setpixel_in_byte (int x, gal_pixel c, gal_uint8 *byte){    *byte = (*byte & (pixnotmask[x&7])) | (c << SHIFT(x));}static inline gal_pixel getpixel_in_byte (int x, const gal_uint8 *byte){    gal_uint8 tmp = *byte;    tmp = tmp & pixmask[x&7];    return (tmp >> SHIFT(x));}static int fblin1_init (PSD psd){    if (!psd->size) {        psd->size = psd->yres * psd->linelen;        return 1;    }    return 1;}/* Set pixel at x, y, to gal_pixel c */static void fblin1_drawpixel (PSD psd, int x, int y, gal_pixel c){    c = normalize_pixel (c);    if (psd->gr_mode == MODE_XOR)        xsetpixel_in_byte (x, c, get_pixel_address (psd, x, y));    else        setpixel_in_byte (x, c, get_pixel_address (psd, x, y));}/* Read pixel at x, y */static gal_pixel fblin1_readpixel (PSD psd, int x, int y){    return getpixel_in_byte (x, get_pixel_address (psd, x, y));}/* Draw horizontal line from x1,y to x2,y including final point */static void fblin1_drawhline (PSD psd, int x, int y, int w, gal_pixel c){    gal_uint8 *addr;    int cc, i;    c = normalize_pixel (c);    cc = c  | (c << 1);    cc = cc | (cc << 2);    cc = cc | (cc << 4);        addr = get_pixel_address (psd, x, y);    if (psd->gr_mode == MODE_XOR) {        if (x & 7) {            for (i = x & 7; i & 7 && w > 0; i++) {                xsetpixel_in_byte (i, c, addr);                w--;            }            addr++;        }                while (w > 7) {            *addr++ ^= cc;            w -= 8;        }                if (w > 0) {            for (i = 0; i < w; i++)                xsetpixel_in_byte (i, c, addr);        }            } else {        if (x&7) {            for (i = x & 7; i & 7 && w > 0; i++) {                setpixel_in_byte (i, c, addr);                w--;            }            addr++;        }                while (w > 7) {            *addr++ = cc;            w -= 8;        }                if (w > 0) {            for (i = 0; i < w; i++)                setpixel_in_byte (i, c, addr);        }    }}static void fblin1_drawvline (PSD psd, int x, int y, int h, gal_pixel c){    gal_uint8 *addr;    c = normalize_pixel (c);    addr = get_pixel_address(psd, x, y);        if (psd->gr_mode == MODE_XOR) {        while (h--) {            xsetpixel_in_byte (x, c, addr);            addr += psd->linelen;        }    }    else {        while (h--) {            setpixel_in_byte (x, c, addr);            addr += psd->linelen;        }    }}/* clip to screen */static void fblin1_getbox (PSD psd, int x, int y, int w, int h, void* buf){    int i;    gal_uint8 *dst = (gal_uint8*) buf;    const gal_uint8 *src;    int d_pitch = w;    if (y < 0) {        h += y;        dst -= y * d_pitch;        y = 0;    }    if (x < 0) {        w += x;        dst -= x;        x = 0;    }    if (y + h - 1 >= psd->yres)         h = psd->yres - y ;    if (x + w - 1 >= psd->xres)         w = psd->xres - x ;        if (w <= 0 || h <= 0) return;    w += x;    src = get_pixel_address (psd, x, y);    while (h--) {        const gal_uint8 *s_line = src;        gal_uint8 *d_line = dst;        i = x;        while (i < w) {            *d_line = getpixel_in_byte (i, s_line);            d_line++; i++;            if (!(i&7)) s_line++;        }        src += psd->linelen;        dst += d_pitch;    }}/* do clip */static void fblin1_putbox (PSD psd, int x, int y, int w, int h, void *buf){    int i;    gal_uint8 *src = (gal_uint8*) buf;    gal_uint8 *dst;    int s_pitch = w;    if (psd->doclip) {        if (y < psd->clipminy) {            h -= psd->clipminy - y;            src += (psd->clipminy - y) * s_pitch;            y = psd->clipminy;        }        if (x < psd->clipminx) {            w -= psd->clipminx - x;            src += psd->clipminx - x;            x = psd->clipminx;        }        if (y + h - 1 >= psd->clipmaxy)            h = psd->clipmaxy- y;        if (x + w - 1 >= psd->clipmaxx)            w = psd->clipmaxx- x;    }    else {        if ( y < 0 ) {            h += y;            src += -y * s_pitch;            y = 0;        }        if ( x < 0 ) {            w += x;            src += -x;            x = 0;        }        if ( y + h  -1 >= psd->yres)            h = psd->yres - y;        if ( x + w  -1 >= psd->xres)            w = psd->xres - x;    }    if (w <= 0 || h <= 0) return;    w += x;    dst = get_pixel_address (psd, x, y);    while (h--) {        const gal_uint8 *s_line = src;        gal_uint8 *d_line = dst;        i = x;        while (i < w) {            setpixel_in_byte (i, normalize_pixel (*s_line), d_line);            s_line ++; i ++;            if (!(i&7)) d_line++;        }        dst += psd->linelen;        src += s_pitch;    }}/* do clip */static void fblin1_putboxmask (PSD psd, int x, int y, int w, int h, void *buf, gal_pixel cxx){    int i;    gal_uint8 *src = (gal_uint8*) buf;    gal_uint8 *dst;    int s_pitch =  w ;    if (psd->doclip) {            if (y < psd->clipminy) {            h -= psd->clipminy - y;            src += (psd->clipminy - y) * s_pitch;            y = psd->clipminy;        }        if (x < psd->clipminx) {            w -= psd->clipminx - x;            src += psd->clipminx - x;            x = psd->clipminx;        }                if (y + h - 1 >= psd->clipmaxy)             h =  psd->clipmaxy- y;        if (x + w - 1 >= psd->clipmaxx)             w =  psd->clipmaxx- x;    }    else {        if ( y < 0 ) {            h += y;            src += -y * s_pitch;            y = 0;        }        if ( x < 0 ) {            w += x;            src += -x;            x = 0;        }                if ( y + h  -1 >= psd->yres)             h = psd->yres - y ;        if ( x + w  -1 >= psd->xres)             w = psd->xres - x ;    }    if (w <= 0 || h <= 0) return;    cxx = normalize_pixel (cxx);    w += x;    dst = get_pixel_address (psd, x, y);    while (h--) {        gal_uint8 *s_line = src;        gal_uint8 *d_line = dst;        i = x;        while (i < w) {            gal_uint8 spix = normalize_pixel (*s_line);            if (spix != cxx)                setpixel_in_byte (i, spix, d_line);            s_line++; i++;            if (!(i&7)) d_line ++;        }        dst += psd->linelen;        src += s_pitch;    }}static unsigned char right_side_mask [] = {0xff,0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00};static unsigned char left_side_mask [] = {0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff};static unsigned char right_ban_mask [] = {0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff};static unsigned char left_ban_mask [] = {0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff};/* copy line from left to right */static void fblin1_copyline_lr (gal_uint8 *src, int x1, gal_uint8 *dst, int x2, int w){    int s_head = x1 & 7;    int d_head = x2 & 7;    if (s_head == d_head) {        if (d_head) {            if (d_head + w > 8) {                *dst = (*src & right_side_mask [d_head]) | (*dst & left_side_mask [d_head]);                src ++; dst ++;                w -= 8 - d_head;            }            else {                gal_uint8 mask = left_ban_mask [w] >> d_head;                *dst = (*src & mask) | (*dst & ~mask);                return;            }        }        while (w > 7) {            *dst++ = *src++;            w -= 8;        }        if (w) {            *dst = (*src & left_side_mask [w]) | (*dst & (right_side_mask [w]));        }    }    else if (d_head > s_head) {        int shift = d_head - s_head;        gal_uint8 sl_half = *src >> shift;        gal_uint8 sr_half;        gal_uint8 sb_new;        if (d_head + w > 8) {            *dst = (sl_half & right_side_mask [d_head]) | (*dst & left_side_mask [d_head]);            dst++;            w -= 8 - d_head;        }        else {            gal_uint8 mask = left_ban_mask [w] >> d_head;            *dst = (sl_half & mask) | (*dst & ~mask);            return;        }        sr_half = *src & right_ban_mask [shift];        while (w > 7) {            src++;            sl_half = *src >> shift;            sb_new = sl_half | (sr_half << (8 - shift));            sr_half = *src & right_ban_mask [shift];            *dst = sb_new;            dst++;             w -= 8;        }        if (w) {            sr_half = *src & right_ban_mask [shift];            if (w > shift) {                src++;                sl_half = *src >> shift;                sb_new = sl_half | (sr_half << (8 - shift));            }            else                sb_new = (sr_half << (8 - shift));            *dst = (sb_new & left_side_mask [w]) | (*dst & right_side_mask[w]);        }    }    else /* s_head > d_head */    {        int shift = s_head - d_head;        gal_uint8 sl_half = *src << shift;        gal_uint8 sr_half;        gal_uint8 sb_new;        if (s_head + w > 8) {            sr_half = *(src + 1) & (left_ban_mask [shift]);            sb_new = sl_half | (sr_half >> (8 - shift));        }        else            sb_new = sl_half;        if (d_head) {            if (d_head + w > 8) {                *dst = (sb_new & right_side_mask [d_head]) | (*dst & left_side_mask [d_head]);                dst++; src++;                w -= 8 - d_head;            }            else {                gal_uint8 mask = left_ban_mask [w] >> d_head;                *dst = (sb_new & mask) | (*dst & ~mask);                return;            }        }        while (w > 7) {            sl_half = *src << shift;            sr_half = *(++src) & (left_ban_mask [shift]);            sb_new = sl_half | (sr_half >> (8 - shift));            *dst = sb_new;            dst++;             w -= 8;        }        if (w) {            sl_half = *src << shift;            if (w > shift) {                sr_half = *(++src) & (left_ban_mask [shift]);                sb_new = sl_half | (sr_half >> (8 - shift));            }            else                sb_new = sl_half;            *dst = (sb_new & left_side_mask [w]) | (*dst & right_side_mask[w]);        }    }}static void fblin1_copybox (PSD psd, int x1, int y1, int w, int h, int x2, int y2){    register gal_uint8 *src, *dst;    register int linelen = psd->linelen;    if (y1 == y2) {        if (x1 < x2 && x1+w > x2) {            //gal_uint8 *tmp = alloca (w >> 3);            //FIXME            gal_uint8 *tmp = malloc (w >> 3);            src= psd->addr + y1 * linelen + (x1 >> 3);            dst= psd->addr + y2 * linelen + (x2 >> 3);            while (h) {                fblin1_copyline_lr (src, x1, tmp, 0, w);                fblin1_copyline_lr (tmp, 0, dst, x2, w);                src += linelen;                dst += linelen;                h--;            }            free (tmp);        }        else {            src= psd->addr + y1 * linelen + (x1 >> 3);            dst= psd->addr + y2 * linelen + (x2 >> 3);            while (h) {                fblin1_copyline_lr (src, x1, dst, x2, w);                src += linelen;                dst += linelen;                h--;            }        }    }    else if (y1 < y2 && y1 + h >= y2) {        y1 += (h-1);        y2 += (h-1);        printf ("x1: %d, x2: %d, s_head: %d, d_head: %d\n", x1, x2, x1 & 7, x2 & 7);        src= psd->addr + y1 * psd->linelen + (x1 >> 3);        dst= psd->addr + y2 * psd->linelen + (x2 >> 3);        while (h) {            fblin1_copyline_lr (src, x1, dst, x2, w);            src -= linelen;            dst -= linelen;            h--;        }    }    else {        src= psd->addr + y1 * psd->linelen + (x1 >> 3);        dst= psd->addr + y2 * psd->linelen + (x2 >> 3);        printf ("x1: %d, x2: %d, s_head: %d, d_head: %d\n", x1, x2, x1 & 7, x2 & 7);        while (h) {            fblin1_copyline_lr (src, x1, dst, x2, w);            src += linelen;            dst += linelen;            h--;        }    }}/* blit, no clipping */static void fblin1_blit (PSD dstpsd, int dstx, int dsty, int w, int h,    PSD srcpsd, int srcx, int srcy){    gal_uint8* dst;    gal_uint8* src;    dst = get_pixel_address (dstpsd, dstx, dsty);    src = get_pixel_address (srcpsd, srcx, srcy);    while (h) {        fblin1_copyline_lr (src, srcx, dst, dstx, w);        src += srcpsd->linelen;        dst += dstpsd->linelen;        h--;    }}SUBDRIVER fblinear_1 = {    fblin1_init,    fblin1_drawpixel,    fblin1_readpixel,    fblin1_drawhline,    fblin1_drawvline,    fblin1_blit,    fblin1_putbox,    fblin1_getbox,    fblin1_putboxmask,    fblin1_copybox};#endif /* _FBLIN1L_SUPPORT */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品在线观看入口| 欧美日韩视频在线观看一区二区三区| 亚洲综合在线免费观看| 国产精品卡一卡二卡三| 国产精品久久久久久久久免费丝袜| 久久色中文字幕| 国产婷婷色一区二区三区| 久久久www免费人成精品| 国产亚洲精久久久久久| 国产日韩精品视频一区| 国产精品乱码一区二三区小蝌蚪| 国产精品系列在线| 一区二区三区成人| 日本成人在线看| 久久99久久精品欧美| 国产美女精品一区二区三区| 成人自拍视频在线| 日本精品视频一区二区三区| 91.com视频| 国产午夜三级一区二区三| 国产区在线观看成人精品| 国产精品九色蝌蚪自拍| 亚洲综合久久久| 久久激情综合网| 成人精品国产福利| 欧美亚洲综合另类| 精品少妇一区二区三区视频免付费| 欧美哺乳videos| 亚洲日本va午夜在线影院| 亚洲国产美国国产综合一区二区| 欧美a一区二区| 成人免费视频一区二区| 在线观看视频一区二区欧美日韩| 精品免费日韩av| 亚洲女人****多毛耸耸8| 国产精品自拍三区| 99久久免费国产| 欧美不卡视频一区| 亚洲尤物视频在线| 国产成人自拍在线| 日韩一区二区免费高清| 国产精品久久久久影院亚瑟 | 国产色婷婷亚洲99精品小说| 亚洲欧洲www| 久久国产精品无码网站| 91久久精品国产91性色tv| 久久久精品2019中文字幕之3| 一区二区日韩av| 风间由美一区二区三区在线观看| 欧美日韩国产天堂| 国产精品福利一区| 国产在线精品免费av| 4hu四虎永久在线影院成人| 亚洲女人小视频在线观看| 国产风韵犹存在线视精品| 日韩一级成人av| 亚洲一区二区三区三| 97久久超碰国产精品电影| 亚洲精品在线网站| 麻豆久久一区二区| 日韩亚洲国产中文字幕欧美| 亚洲国产精品一区二区www| 日本久久一区二区| 亚洲欧洲99久久| 丁香另类激情小说| 国产午夜三级一区二区三| 国产在线精品一区二区| 日韩免费高清电影| 美女视频一区二区| 91精品国产入口| 日本v片在线高清不卡在线观看| 91麻豆视频网站| 亚洲欧美欧美一区二区三区| 91天堂素人约啪| 亚洲视频一区在线| 91麻豆成人久久精品二区三区| 欧美国产日韩亚洲一区| jlzzjlzz亚洲日本少妇| 国产精品激情偷乱一区二区∴| 成人激情小说乱人伦| 国产精品久久久久久久午夜片| 国产精品一区二区不卡| 中文字幕第一区二区| 9i在线看片成人免费| 曰韩精品一区二区| 91精品国产综合久久精品麻豆| 天天亚洲美女在线视频| 精品福利在线导航| 国产成人av电影在线播放| ㊣最新国产の精品bt伙计久久| 91在线免费播放| 午夜欧美在线一二页| 欧美一区二区三区视频在线| 国产一区二区在线电影| 国产精品久久久久天堂| 欧美日韩亚洲综合在线 | 国产专区综合网| 久久久一区二区| 日本韩国欧美三级| 日本va欧美va欧美va精品| 精品国产99国产精品| 99精品欧美一区| 免费日韩伦理电影| 国产精品久久久久9999吃药| 欧美日韩日日摸| 成人午夜精品一区二区三区| 亚洲一区二区三区不卡国产欧美| 欧美tk—视频vk| 色94色欧美sute亚洲13| 久久99精品一区二区三区| 亚洲桃色在线一区| 日韩欧美中文字幕制服| 91丝袜国产在线播放| 美国毛片一区二区| 亚洲精品免费在线| 精品国产乱码久久久久久久| 91视视频在线观看入口直接观看www | 福利一区福利二区| 亚洲午夜久久久| 国产欧美一区二区精品仙草咪| 欧美三级视频在线播放| 高清国产一区二区| 日韩激情视频在线观看| 亚洲人成网站精品片在线观看| 欧美成人精品二区三区99精品| 在线观看一区日韩| eeuss影院一区二区三区| 国产主播一区二区三区| 日韩高清不卡一区| 亚洲国产婷婷综合在线精品| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲综合成人网| 国产精品日日摸夜夜摸av| 日韩欧美一级精品久久| 精品视频一区二区三区免费| 91蜜桃免费观看视频| 成人免费毛片片v| 国产寡妇亲子伦一区二区| 激情欧美一区二区| 久久精品99久久久| 日日夜夜免费精品| 亚洲va欧美va国产va天堂影院| 亚洲人妖av一区二区| 国产精品久久夜| 亚洲色图制服诱惑| 日韩美女啊v在线免费观看| 国产日本欧洲亚洲| 国产欧美精品日韩区二区麻豆天美| 26uuuu精品一区二区| 久久久99精品久久| 国产欧美精品一区二区三区四区 | 亚洲视频一区二区免费在线观看| 精品免费日韩av| 久久久久久久久久久久电影| 久久免费偷拍视频| 久久久久久影视| 国产精品久久久久婷婷| 成人免费在线视频| 亚洲在线免费播放| 五月天亚洲婷婷| 蜜桃视频在线观看一区二区| 日韩电影在线一区二区三区| 日本麻豆一区二区三区视频| 狠狠网亚洲精品| 成年人国产精品| 欧洲av在线精品| 精品少妇一区二区三区在线视频 | 成人sese在线| 色拍拍在线精品视频8848| 日本丶国产丶欧美色综合| 欧美三级电影网站| 欧美不卡一区二区三区四区| 欧美韩日一区二区三区四区| 亚洲情趣在线观看| 日本中文字幕一区二区视频| 国产一区二区免费看| 91美女视频网站| 日韩美女一区二区三区四区| 国产精品久久夜| 婷婷国产v国产偷v亚洲高清| 国产综合久久久久久鬼色 | 久久精品国内一区二区三区| 国产成人亚洲精品狼色在线| 色悠悠久久综合| xnxx国产精品| 亚洲一线二线三线久久久| 九色porny丨国产精品| 91看片淫黄大片一级在线观看| 56国语精品自产拍在线观看| 国产精品三级电影| 麻豆精品一区二区综合av| 色哟哟国产精品| 久久这里只有精品6| 亚洲一区二区三区四区不卡| 国产成人综合自拍| 欧美疯狂性受xxxxx喷水图片| 国产精品久久久久久亚洲伦| 麻豆精品蜜桃视频网站| 色88888久久久久久影院野外| 久久亚洲综合av|