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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? fblin-4.c

?? 嵌入式系統(tǒng)圖形用戶界面編程
?? C
字號:
/*** $Id: fblin-4.c,v 1.5 2003/11/22 11:49:29 weiym Exp $** ** fblin-4.c: Frame buffer 4 bpp Linear Video Driver for MiniGUI**  This driver is suitable for the most significant bit being left.** ** Copyright (C) 2003 Feynman Software.** ** 2003/07/10: Create by Wei Yongming.*//*** 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 <stdio.h>#include <stdlib.h>#include <string.h>#include "native.h"#include "fb.h"#ifdef _FBLIN4L_SUPPORT#define SHIFT(x) ((x&1)?0:4)static unsigned char pixmask [] = {0xf0, 0x0f};static unsigned char pixnotmask [] = {0x0f, 0xf0};static inline gal_uint8* get_pixel_address (PSD psd, int x, int y){    return (gal_uint8 *) psd->addr + y*psd->linelen + (x >> 1);}static inline void xsetpixel_in_byte (int x, gal_pixel c, gal_uint8 *byte){    *byte = (*byte & (pixnotmask[x&1])) | ((c << SHIFT(x))^(*byte & pixmask[x&1]));}static inline void setpixel_in_byte (int x, gal_pixel c, gal_uint8 *byte){    *byte = (*byte & (pixnotmask[x&1])) | (c << SHIFT(x));}static inline gal_pixel getpixel_in_byte (int x, const gal_uint8 *byte){    gal_uint8 tmp = *byte;    tmp = tmp & pixmask [x&1];    return (tmp >> SHIFT(x));}static int fblin4_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 fblin4_drawpixel (PSD psd, int x, int y, gal_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 fblin4_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 fblin4_drawhline (PSD psd, int x, int y, int w, gal_pixel c){    gal_uint8 *addr;    gal_uint8 cc;    c = c & 0x0f;    cc = c | (c << 4);    addr = get_pixel_address (psd, x, y);    if (psd->gr_mode == MODE_XOR) {        if (x & 1) {            xsetpixel_in_byte (1, c, addr);            addr++;            w--;        }        while (w > 1) {            *addr++ ^= cc ;            w -= 2;        }        if (w > 0)             xsetpixel_in_byte (0, c, addr);    } else {        if (x & 1) {            setpixel_in_byte (1, c, addr);            addr++;            w--;        }        while (w > 1) {            *addr++ = cc ;            w -= 2;        }        if (w > 0)             setpixel_in_byte (0, c, addr);    }}static void fblin4_drawvline (PSD psd, int x, int y, int h, gal_pixel c){    gal_uint8* addr;    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 fblin4_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&1)) s_line++;        }        src += psd->linelen;        dst += d_pitch;    }}/* do clip */static void fblin4_putbox (PSD psd, int x, int y, int w, int h, void *buf){    int i;    const 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, *s_line & 0x0F, d_line);            s_line ++; i ++;            if (!(i&1)) d_line++;        }        dst += psd->linelen;        src += s_pitch;    }}static void fblin4_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 = cxx & 0x0f;    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 = *s_line & 0x0f;            if (spix != cxx)                setpixel_in_byte (i, spix, d_line);            s_line++; i++;            if (!(i&1)) d_line ++;        }        dst += psd->linelen;        src += s_pitch;    }}static unsigned char right_side_mask [] = {0xff, 0x0f};static unsigned char left_side_mask [] = {0x00, 0xf0};static unsigned char right_ban_mask [] = {0x00, 0x0f};static unsigned char left_ban_mask [] = {0x00, 0xf0};static void fblin4_copyline_lr (gal_uint8 *src, int x1, gal_uint8 *dst, int x2, int w){    int s_head = x1 & 1;    int d_head = x2 & 1;    if (s_head == d_head) {        if (d_head) {            *dst = (*src & right_side_mask [d_head]) | (*dst & left_side_mask [d_head]);            src ++; dst ++; w--;        }        while (w > 1) {            *dst++ = *src++;            w -= 2;        }        if (w) {            *dst = (*src & left_side_mask [w]) | (*dst & (right_side_mask [w]));        }    }    else if (d_head > s_head) {        gal_uint8 sl_half = *src >> 4;        gal_uint8 sr_half;        gal_uint8 sb_new;        *dst = (sl_half & right_side_mask [d_head]) | (*dst & left_side_mask [d_head]);        dst++;        w--;        sr_half = *src & right_ban_mask [1];        while (w > 1) {            src++;            sl_half = *src >> 4;            sb_new = sl_half | (sr_half << 4);            sr_half = *src & right_ban_mask [1];            *dst = sb_new;            dst++;             w -= 2;        }        if (w) {            sr_half = *src & right_ban_mask [1];            src++;            sl_half = *src >> 4;            sb_new = sl_half | (sr_half << 4);            *dst = (sb_new & left_side_mask [w]) | (*dst & right_side_mask[w]);        }    }    else /* s_head > d_head */    {        gal_uint8 sl_half;        gal_uint8 sr_half;        gal_uint8 sb_new;        while (w > 1) {            sl_half = *src << 4;            sr_half = *(++src) & (left_ban_mask [1]);            sb_new = sl_half | (sr_half >> 4);            *dst = sb_new;            dst++;             w -= 2;        }        if (w) {            sl_half = *src << 4;            sr_half = *(++src) & (left_ban_mask [1]);            sb_new = sl_half | (sr_half >> 4);            *dst = (sb_new & left_side_mask [w]) | (*dst & right_side_mask[w]);        }    }}static void fblin4_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 >> 1);            gal_uint8 *tmp = malloc (w >> 1);            src= psd->addr + y1 * linelen + (x1 >> 1);            dst= psd->addr + y2 * linelen + (x2 >> 1);            while (h) {                fblin4_copyline_lr (src, x1, tmp, 0, w);                fblin4_copyline_lr (tmp, 0, dst, x2, w);                src += linelen;                dst += linelen;                h--;            }            free (tmp);        }        else {            src= psd->addr + y1 * linelen + (x1 >> 1);            dst= psd->addr + y2 * linelen + (x2 >> 1);            while (h) {                fblin4_copyline_lr (src, x1, dst, x2, w);                src += linelen;                dst += linelen;            }        }    }    else if (y1 < y2 && y1 + h >= y2) {        y1 += (h-1);        y2 += (h-1);        src = psd->addr + y1 * linelen + (x1 >> 1);        dst = psd->addr + y2 * linelen + (x2 >> 1);        while (h) {            fblin4_copyline_lr (src, x1, dst, x2, w);            src -= linelen;            dst -= linelen;            h--;        }    }    else {        src= psd->addr + y1 * linelen + (x1 >> 1);        dst= psd->addr + y2 * linelen + (x2 >> 1);        while (h) {            fblin4_copyline_lr (src, x1, dst, x2, w);            src += linelen;            dst += linelen;            h--;        }    }}/* blit, no clipping */static void fblin4_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) {        fblin4_copyline_lr (src, srcx, dst, dstx, w);        src += srcpsd->linelen;        dst += dstpsd->linelen;        h--;    }}SUBDRIVER fblinear_4 = {    fblin4_init,    fblin4_drawpixel,    fblin4_readpixel,    fblin4_drawhline,    fblin4_drawvline,    fblin4_blit,    fblin4_putbox,    fblin4_getbox,    fblin4_putboxmask,    fblin4_copybox};#endif /* _FBLIN4L_SUPPORT */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产色综合久久久蜜香臀| 久久综合狠狠综合| 精品亚洲国产成人av制服丝袜| 中文字幕av资源一区| 欧美精品乱码久久久久久按摩| 国产精品66部| 美洲天堂一区二卡三卡四卡视频| 中文一区一区三区高中清不卡| 91精品国产乱码久久蜜臀| 99国产精品久久久久| 国产一区二区在线观看视频| 亚洲成人综合在线| 国产精品国产成人国产三级| 2020日本不卡一区二区视频| 欧美一区二区三区在线观看 | 精品乱码亚洲一区二区不卡| 色噜噜狠狠一区二区三区果冻| 国产精品一区二区久久不卡| 日韩和欧美一区二区| 一个色妞综合视频在线观看| 亚洲国产精品国自产拍av| 久久众筹精品私拍模特| 欧美一区二区三区色| 欧美日韩色一区| 在线观看一区二区视频| 97久久超碰国产精品| 成人黄色综合网站| 风间由美性色一区二区三区| 国产综合色精品一区二区三区| 男男成人高潮片免费网站| 亚洲大片一区二区三区| 亚洲成人一区在线| 婷婷综合久久一区二区三区| 亚洲一级电影视频| 亚洲高清免费视频| 亚洲国产欧美另类丝袜| 亚洲国产一区二区三区| 亚洲成a人片在线观看中文| 亚洲国产视频一区| 午夜影院久久久| 日韩1区2区3区| 蜜臀久久久99精品久久久久久| 日韩中文字幕一区二区三区| 日韩中文字幕1| 免费看精品久久片| 国产美女娇喘av呻吟久久| 国产精选一区二区三区| 国产v综合v亚洲欧| av亚洲产国偷v产偷v自拍| 91偷拍与自偷拍精品| 色香蕉久久蜜桃| 欧美日韩精品一区二区| 欧美一区二区黄| 2017欧美狠狠色| 国产精品久久久久久久久快鸭 | 99视频热这里只有精品免费| 91免费国产在线观看| 色综合激情五月| 欧美日韩大陆一区二区| 欧美一区二区人人喊爽| 国产亚洲一区二区在线观看| 亚洲同性同志一二三专区| 亚洲大片精品永久免费| 国产在线不卡一卡二卡三卡四卡| 成人激情校园春色| 欧美视频日韩视频| 精品国产乱码久久久久久图片| 久久久.com| 一区2区3区在线看| 欧美96一区二区免费视频| 大美女一区二区三区| 欧美在线免费视屏| 精品电影一区二区| 日韩毛片视频在线看| 日韩电影在线免费看| 国产成人在线免费观看| 在线精品亚洲一区二区不卡| 日韩欧美美女一区二区三区| 中文字幕日韩欧美一区二区三区| 一区二区三区四区视频精品免费| 奇米影视一区二区三区小说| 成人激情免费视频| 日韩精品在线一区| 亚洲男女毛片无遮挡| 麻豆成人av在线| 99久久精品免费看国产| 日韩欧美你懂的| 一区二区三区波多野结衣在线观看 | 一本色道**综合亚洲精品蜜桃冫 | 欧美日韩一区二区三区免费看| 精品毛片乱码1区2区3区| 1区2区3区精品视频| 蜜桃久久精品一区二区| 色婷婷激情久久| 久久九九99视频| 日韩黄色一级片| 在线观看不卡一区| 欧美国产禁国产网站cc| 麻豆国产欧美日韩综合精品二区| 色乱码一区二区三区88| 国产精品无人区| 国内精品久久久久影院色| 欧美精品在线视频| 亚洲色图欧美激情| 成人免费毛片app| 久久综合九色综合97婷婷女人| 亚洲小说春色综合另类电影| 成人黄色小视频| 久久丝袜美腿综合| 麻豆国产欧美一区二区三区| 欧美视频一区二区三区在线观看 | 久久精品亚洲乱码伦伦中文| 奇米四色…亚洲| 欧美久久一区二区| 亚洲一区二区在线播放相泽| 91女神在线视频| 国产精品乱码久久久久久| 国产自产v一区二区三区c| 日韩女优毛片在线| 青青青伊人色综合久久| 欧美一区二区三区的| 日韩精品免费专区| 欧美卡1卡2卡| 五月婷婷色综合| 欧美久久久久久久久久| 婷婷六月综合网| 在线成人av网站| 日韩精品乱码av一区二区| 在线成人免费观看| 蜜臀久久久99精品久久久久久| 欧美一区二区人人喊爽| 日本sm残虐另类| 欧美电视剧在线观看完整版| 免费高清在线视频一区·| 日韩一区国产二区欧美三区| 青青草原综合久久大伊人精品优势| 正在播放一区二区| 美女久久久精品| 精品sm捆绑视频| 国产iv一区二区三区| 中文字幕的久久| 91麻豆国产福利在线观看| 亚洲精品第一国产综合野| 日本韩国欧美一区二区三区| 亚洲在线一区二区三区| 欧美美女喷水视频| 国产中文字幕一区| 欧美国产一区二区| 91影视在线播放| 亚洲午夜久久久久久久久久久| 欧美性做爰猛烈叫床潮| 日韩极品在线观看| 久久青草欧美一区二区三区| 本田岬高潮一区二区三区| 亚洲人成亚洲人成在线观看图片| 欧美亚日韩国产aⅴ精品中极品| 午夜激情一区二区| 精品国产乱码久久久久久图片 | 国产一区二区不卡老阿姨| 国产精品网友自拍| 色综合天天狠狠| 美国十次综合导航| 日本一区二区三区免费乱视频| 99久久99久久久精品齐齐| 午夜精品免费在线| 国产亚洲精久久久久久| 在线影视一区二区三区| 蜜桃一区二区三区在线观看| 中文字幕av资源一区| 欧美日韩高清在线| 粉嫩一区二区三区在线看| 一片黄亚洲嫩模| 国产亚洲欧美一区在线观看| 色婷婷av久久久久久久| 九九九精品视频| 亚洲精品成a人| 久久综合狠狠综合久久激情| 91福利视频网站| 激情文学综合丁香| 亚洲综合视频在线观看| 亚洲精品一区二区三区精华液| 99re8在线精品视频免费播放| 日韩国产欧美一区二区三区| 国产欧美一区二区三区沐欲 | 欧美日本免费一区二区三区| 国产成人在线视频网站| 日韩国产精品大片| 国产精品久久99| 欧美v国产在线一区二区三区| 91国产福利在线| 成人夜色视频网站在线观看| 日韩精品欧美成人高清一区二区| 亚洲人快播电影网| 久久久99久久| 日韩美女天天操| 欧美人妇做爰xxxⅹ性高电影 | 99久久精品久久久久久清纯| 裸体歌舞表演一区二区| 亚洲图片欧美视频| 中文字幕制服丝袜一区二区三区|