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

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

?? fblin-1.c

?? 該源碼是miniGUI的全部代碼
?? C
字號:
/*** $Id: fblin-1.c,v 1.3 2003/09/04 02:57:09 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 <linux/fb.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);            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--;            }        }        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 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一级黄| 最新高清无码专区| 日本不卡免费在线视频| 91精品国产高清一区二区三区 | 2020国产精品| 国产一区二区91| 久久久三级国产网站| 国产精品1024| 亚洲国产精品99久久久久久久久| 国产一区二区三区综合| 国产网站一区二区三区| av电影一区二区| 一区二区三区丝袜| 欧美久久免费观看| 精品亚洲免费视频| 国产欧美精品国产国产专区| 91社区在线播放| 亚洲精品成a人| 欧美猛男gaygay网站| 狠狠色丁香婷婷综合久久片| 中文字幕成人av| 在线观看日韩精品| 日韩电影在线一区二区三区| 精品久久久久久久一区二区蜜臀| 国产不卡高清在线观看视频| 综合中文字幕亚洲| 337p亚洲精品色噜噜狠狠| 国模一区二区三区白浆| 最新国产精品久久精品| 精品视频免费在线| 国产在线一区二区综合免费视频| 国产精品国产精品国产专区不片| 欧美性一二三区| 国产精品亚洲综合一区在线观看| 自拍视频在线观看一区二区| 欧美一区二区精品| 99久久精品99国产精品| 老司机午夜精品99久久| 国产精品传媒视频| 欧美一二三四区在线| 99久久久久久99| 欧美bbbbb| 亚洲视频1区2区| 欧美成人a视频| 91蜜桃网址入口| 久久精品国产精品亚洲精品| 亚洲日本va午夜在线影院| 日韩精品一区二区三区蜜臀 | 国产欧美一区在线| 在线观看91av| 91捆绑美女网站| 国产在线精品一区二区不卡了| 亚洲精品第一国产综合野| 亚洲精品在线观| 51午夜精品国产| 99久久99久久精品国产片果冻| 蜜臀91精品一区二区三区 | 日本电影欧美片| 国产aⅴ综合色| 蜜桃精品视频在线观看| 亚洲一本大道在线| 亚洲美女少妇撒尿| 国产精品久久久久久久久免费相片 | 国产精品伦理在线| 欧美精品一区二区三区一线天视频| 在线亚洲精品福利网址导航| 成人深夜福利app| 国产精品一区二区在线观看网站| 丝袜美腿亚洲一区二区图片| 亚洲一区二区三区在线看| 国产精品久久久久一区| 久久久国产午夜精品| 日韩欧美你懂的| 欧美精选午夜久久久乱码6080| 日本高清不卡aⅴ免费网站| 91丨九色丨尤物| av电影在线观看完整版一区二区| 成人一道本在线| 国产成人精品影院| 成人久久视频在线观看| 成人做爰69片免费看网站| 国产成人精品三级| 国产一区二区三区不卡在线观看 | 另类小说视频一区二区| 麻豆成人综合网| 久久成人羞羞网站| 经典三级在线一区| 国模一区二区三区白浆| 国产成人在线视频免费播放| 成人精品国产福利| av高清不卡在线| 色综合网站在线| 色婷婷国产精品| 欧美午夜精品理论片a级按摩| 日本韩国视频一区二区| 在线看国产一区| 欧美老年两性高潮| 一区二区三区在线免费播放| 精品国产伦一区二区三区观看方式| 国产成人丝袜美腿| 蜜桃av噜噜一区| 久久国产免费看| 国产一区二区视频在线播放| 国产91丝袜在线18| 99久久国产综合精品女不卡| 欧美羞羞免费网站| 91精品国产综合久久国产大片| 日韩一区二区三区四区五区六区 | 国产91综合网| av一区二区三区| 在线视频一区二区三区| 欧美一级日韩不卡播放免费| 精品国产一二三| 中文字幕亚洲一区二区va在线| 亚洲一区二区三区四区在线免费观看| 午夜视频在线观看一区二区三区| 欧美bbbbb| 国产69精品一区二区亚洲孕妇 | 久久丁香综合五月国产三级网站| 国产不卡视频在线观看| 在线观看日韩国产| 欧美成人a∨高清免费观看| 国产精品你懂的在线欣赏| 亚洲国产精品一区二区www在线 | 亚洲大片一区二区三区| 老司机精品视频导航| www.激情成人| 欧美一二区视频| 亚洲婷婷综合色高清在线| 男人的天堂久久精品| 波多野结衣中文一区| 777奇米四色成人影色区| 国产亚洲精久久久久久| 午夜久久久影院| 成人午夜视频福利| 91精品国产福利| 日韩久久一区二区| 国产在线视视频有精品| 欧美日韩高清不卡| 国产精品久久久久毛片软件| 久久91精品国产91久久小草 | 欧美亚洲日本国产| 亚洲国产精品成人久久综合一区| 亚洲成av人影院| 97久久超碰国产精品| 精品久久人人做人人爰| 亚洲综合免费观看高清在线观看 | 成人18精品视频| 日韩一区二区在线看片| 亚洲黄色av一区| 国产91丝袜在线播放0| 欧美一区二区三区日韩视频| 亚洲国产综合在线| 91小视频免费观看| 日本一区二区三区四区 | 亚洲国产视频一区| eeuss鲁一区二区三区| 久久色成人在线| 日韩国产欧美在线视频| 欧美在线不卡一区| 国产精品三级久久久久三级| 久99久精品视频免费观看| 制服丝袜中文字幕亚洲| 一区二区三区在线免费视频| av一区二区久久| 国产精品日日摸夜夜摸av| 国产乱对白刺激视频不卡| 日韩欧美自拍偷拍| 免费人成精品欧美精品| 91精品国产色综合久久ai换脸 | 日本一区二区三区高清不卡 | 日韩av电影免费观看高清完整版 | av在线不卡网| 亚洲国产精品黑人久久久| 国产91精品一区二区| 欧美极品aⅴ影院| 成人午夜激情在线| 国产精品免费久久| 91日韩精品一区| 亚洲美女在线一区| 欧美三级日本三级少妇99| 亚洲一区二区精品久久av| 欧美日韩亚洲不卡| 日韩国产欧美一区二区三区| 欧美一区二区三区视频在线观看| 日韩极品在线观看| 欧美成人一区二区三区在线观看| 久久99精品国产麻豆婷婷洗澡| www亚洲一区| 不卡的电影网站| 亚洲综合在线视频| 欧美一级夜夜爽| 国产一区二区精品在线观看| 国产亚洲欧美中文| 97精品超碰一区二区三区| 亚洲一区二区三区视频在线| 日韩一区二区免费在线观看| 国产一区中文字幕| 亚洲精品国产成人久久av盗摄| 欧美人与禽zozo性伦|