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

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

?? fblin2.c

?? 該源碼是miniGUI的全部代碼
?? C
字號:
/*** $Id: fblin2.c,v 1.7 2003/09/04 02:57:09 weiym Exp $** ** fblin2.c: Frame buffer 2 bpp Linear Video Driver for MiniGUI**  This driver is suitable for the most significant bit being right.**** Copyright (C) 2003 Feynman Software.** Copyright (C) 2001, 2002 Wei Yongming** ** 2001/02/08 created 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 <stdlib.h>#include <string.h>#include <linux/fb.h>#include "native.h"#include "fb.h"#ifdef _FBLIN2R_SUPPORT#define SHIFT(x) ((x & 3) << 1)static unsigned char pixmask [] = {0x03, 0x0c, 0x30, 0xc0};static unsigned char pixnotmask [] = {0xfc, 0xf3, 0xcf, 0x3f};#define normalize_pixel(c) (c & 0x03)static inline gal_uint8* get_pixel_address(PSD psd, int x, int y){    return (gal_uint8 *) psd->addr + y*psd->linelen + (x >> 2);}static inline void xsetpixel_in_byte(int x, gal_pixel c, gal_uint8 *byte){    *byte = (*byte & (pixnotmask [x&3])) | ((c << SHIFT(x)) ^ (*byte & pixmask[x&3]) );}static inline void setpixel_in_byte(int x, gal_pixel c, gal_uint8 *byte){    *byte = (*byte & (pixnotmask [x&3])) | (c << SHIFT(x));}static inline gal_pixel getpixel_in_byte(int x, const gal_uint8 *byte){    gal_uint8 tmp = *byte;    tmp = tmp & pixmask[x&3];    return (tmp >> SHIFT(x));}static int fblin2_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 fblin2_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 fblin2_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 fblin2_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 << 2);    cc = cc | (cc << 4);        addr = get_pixel_address (psd, x, y);    if (psd->gr_mode == MODE_XOR) {        if (x & 3) {            for(i = x&3; i&3 && w > 0; i++) {                xsetpixel_in_byte (i, c, addr);                w--;            }            addr++;        }                while (w > 3) {            *addr++ ^= cc ;            w -= 4;        }                if (w > 0) {            for (i = 0; i < w; i++)                xsetpixel_in_byte (i, c, addr);        }            } else {        if (x & 3) {            for (i= x & 3; i & 3 && w > 0; i++) {                setpixel_in_byte (i, c, addr);                w--;            }            addr++;        }                while (w > 3) {            *addr++ = cc ;            w -= 4;        }                if (w > 0) {            for (i = 0; i < w; i++)                setpixel_in_byte (i, c, addr);        }    }}static void fblin2_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 fblin2_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&3)) s_line++;        }        src += psd->linelen;        dst += d_pitch;    }}/*do clip*/static void fblin2_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, normalize_pixel (*s_line), d_line);            s_line ++; i ++;            if (!(i&3)) d_line++;        }        dst += psd->linelen;        src += s_pitch;    }}static void fblin2_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&3)) d_line ++;        }        dst += psd->linelen;        src += s_pitch;    }}static unsigned char right_side_mask [] = {0xff,0xfc,0xf0,0xc0};static unsigned char left_side_mask [] = {0x00,0x03,0x0f,0x3f};static unsigned char right_ban_mask [] = {0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff};static unsigned char left_ban_mask [] = {0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff};/* copyline - left to right */static void fblin2_copyline_lr (gal_uint8 *src, int x1, gal_uint8 *dst, int x2, int w){    int s_head = x1 & 3;    int d_head = x2 & 3;    if (s_head == d_head) {        if (d_head) {            if (d_head + w > 4) {                *dst = (*src & right_side_mask [d_head]) | (*dst & left_side_mask [d_head]);                src ++; dst ++;                w -= 4 - d_head;            }            else {                gal_uint8 mask = left_ban_mask [w] << d_head;                *dst = (*src & mask) | (*dst & ~mask);                return;            }        }        while (w > 3) {            *dst++ = *src++;            w -= 4;        }        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) << 1;        gal_uint8 sl_half = *src << shift;        gal_uint8 sr_half;        gal_uint8 sb_new;        if (d_head + w > 4) {            *dst = (sl_half & right_side_mask [d_head]) | (*dst & left_side_mask [d_head]);            dst++;            w -= 4 - 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 > 3) {            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 -= 4;        }        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) << 1;        gal_uint8 sl_half = *src >> shift;        gal_uint8 sr_half;        gal_uint8 sb_new;        if (s_head + w > 4) {            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 > 4) {                *dst = (sb_new & right_side_mask [d_head]) | (*dst & left_side_mask [d_head]);                dst++; src++;                w -= 4 - d_head;            }            else {                gal_uint8 mask = left_ban_mask [w] << d_head;                *dst = (sb_new & mask) | (*dst & ~mask);                return;            }        }        while (w > 3) {            sl_half = *src >> shift;            sr_half = *(++src) & (left_ban_mask [shift]);            sb_new = sl_half | (sr_half << (8 - shift));            *dst = sb_new;            dst++;             w -= 4;        }        if (w) {            sl_half = *src >> shift;            if (w > ((8 - shift) >> 1)) {                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 fblin2_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 >> 2);            src= psd->addr + y1 * linelen + (x1 >> 3);            dst= psd->addr + y2 * linelen + (x2 >> 3);            while (h) {                fblin2_copyline_lr (src, x1, tmp, 0, w);                fblin2_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) {                fblin2_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);        src= psd->addr + y1 * linelen + (x1 >> 3);        dst= psd->addr + y2 * linelen + (x2 >> 3);        while (h) {            fblin2_copyline_lr (src, x1, 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) {            fblin2_copyline_lr (src, x1, dst, x2, w);            src += linelen;            dst += linelen;            h--;        }    }}/* Bitblt, not do clip */static void fblin2_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) {        fblin2_copyline_lr (src, srcx, dst, dstx, w);        src += srcpsd->linelen;        dst += dstpsd->linelen;        h--;    }}SUBDRIVER fblinear2 = {    fblin2_init,    fblin2_drawpixel,    fblin2_readpixel,    fblin2_drawhline,    fblin2_drawvline,    fblin2_blit,    fblin2_putbox,    fblin2_getbox,    fblin2_putboxmask,    fblin2_copybox};#endif /* _FBLIN2R_SUPPORT */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲精品一区二区三区不卡| 日韩一区二区三区视频在线观看| 精品国产3级a| 欧美精品粉嫩高潮一区二区| 日韩精品一区二区三区四区| 一区二区在线免费观看| 国产福利精品一区二区| 欧美一a一片一级一片| 国产精品午夜春色av| 美腿丝袜在线亚洲一区| 在线观看欧美日本| 最新国产成人在线观看| 国产精品一区二区三区四区| 欧美精品在线观看播放| 亚洲尤物在线视频观看| 色婷婷久久综合| 国产精品久久久久久久久免费樱桃| 日韩二区三区四区| 91豆麻精品91久久久久久| 中文字幕在线视频一区| 国产99久久久国产精品潘金| 久久亚洲一级片| 精品一二三四区| 日韩欧美成人午夜| 久久精品国产一区二区| 日韩欧美自拍偷拍| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美日韩极品在线观看一区| 亚洲成人精品在线观看| 欧洲在线/亚洲| 亚洲午夜精品17c| 欧美日韩中文另类| 亚洲国产成人高清精品| 8v天堂国产在线一区二区| 午夜av电影一区| 91精品国产高清一区二区三区蜜臀| 亚洲五码中文字幕| 欧美视频一区二区| 青娱乐精品视频| 日韩一区二区在线免费观看| 麻豆国产精品视频| 久久久久久亚洲综合影院红桃| 国产福利一区二区三区视频在线 | 精品国产乱码久久久久久蜜臀| 日韩有码一区二区三区| 日韩一区二区在线看| 国产高清在线精品| 亚洲视频每日更新| 欧美日韩精品一区二区三区蜜桃 | 日韩免费性生活视频播放| 久久99国产精品免费网站| 久久网站热最新地址| 成人av在线资源| 亚洲伊人伊色伊影伊综合网| 在线不卡欧美精品一区二区三区| 美女视频黄a大片欧美| 国产日韩成人精品| 欧美综合一区二区三区| 奇米一区二区三区| 国产精品萝li| 欧美高清精品3d| 国产夫妻精品视频| 亚洲视频中文字幕| 欧美顶级少妇做爰| 成人动漫视频在线| 日韩和欧美一区二区| 欧美韩国日本综合| 欧美理论电影在线| 成人激情黄色小说| 麻豆精品在线看| 亚洲精品高清视频在线观看| 91精品国模一区二区三区| 风间由美一区二区三区在线观看 | 美女www一区二区| 国产精品初高中害羞小美女文| 色婷婷久久久亚洲一区二区三区| 麻豆精品一区二区| 亚洲综合无码一区二区| 久久久久久97三级| 制服丝袜国产精品| 色哟哟欧美精品| 成人在线一区二区三区| 日韩激情在线观看| 亚洲精品水蜜桃| 中文成人综合网| 日韩精品一区二区三区在线播放 | 91在线porny国产在线看| 蜜桃视频在线观看一区| 亚洲一二三四在线| 国产精品久久久久久久久免费桃花 | 成人污视频在线观看| 日本不卡中文字幕| 一区二区在线免费观看| 最新高清无码专区| 国产亚洲一二三区| 精品美女一区二区三区| 欧美三级电影一区| 在线视频欧美区| 波多野结衣在线一区| 国产在线精品一区二区夜色 | 床上的激情91.| 久久99热99| 免费观看在线色综合| 午夜视频一区在线观看| 亚洲国产精品久久艾草纯爱| 伊人色综合久久天天| 综合久久国产九一剧情麻豆| 国产欧美日韩三区| 国产欧美va欧美不卡在线| 久久久五月婷婷| 久久亚洲免费视频| 久久无码av三级| 国产日产欧美精品一区二区三区| 精品人伦一区二区色婷婷| 欧美mv和日韩mv的网站| 欧美成va人片在线观看| 久久综合色天天久久综合图片| 精品三级在线看| 久久九九99视频| 国产精品美女久久久久aⅴ国产馆| 中文字幕的久久| 中文字幕日韩av资源站| 亚洲视频综合在线| 亚洲一区二区四区蜜桃| 亚洲国产日日夜夜| 婷婷开心激情综合| 精品在线播放免费| 夫妻av一区二区| 在线观看一区二区精品视频| 欧美日韩激情在线| 欧美刺激午夜性久久久久久久| 欧美成人一区二区三区| 国产午夜精品在线观看| 国产精品免费视频网站| 亚洲婷婷在线视频| 亚洲综合久久久久| 午夜亚洲国产au精品一区二区| 日本成人在线视频网站| 国产精品亚洲视频| 一本到不卡免费一区二区| 3751色影院一区二区三区| 久久中文字幕电影| 午夜欧美在线一二页| 久久精品国产精品青草| 成人性色生活片| 欧美日韩精品福利| 国产欧美一区二区精品婷婷| 一区二区在线观看av| 美洲天堂一区二卡三卡四卡视频| 春色校园综合激情亚洲| 在线不卡一区二区| 欧美经典一区二区三区| 亚洲高清在线精品| 国产高清成人在线| 欧美久久婷婷综合色| 国产精品网曝门| 美女网站在线免费欧美精品| 91麻豆免费在线观看| 精品国产免费久久| 一区二区三区在线观看国产| 极品少妇一区二区| 欧美午夜精品一区二区蜜桃 | 欧美成人在线直播| 亚洲女同一区二区| 韩国精品主播一区二区在线观看| 在线中文字幕一区二区| 国产欧美日韩另类一区| 日本中文字幕一区| 91国产成人在线| 欧美极品xxx| 蜜桃av一区二区在线观看| 一本色道久久加勒比精品| 国产欧美视频在线观看| 久久精品国产秦先生| 欧美日韩夫妻久久| 亚洲女同ⅹxx女同tv| 成人福利视频网站| 国产日产欧美一区| 国产剧情一区二区三区| 欧美一区三区四区| 亚洲成a人片在线不卡一二三区| 国产98色在线|日韩| 欧美精品一区二区三区在线播放 | 欧美日韩国产123区| 自拍偷在线精品自拍偷无码专区| 久久综合综合久久综合| 欧美肥妇bbw| 午夜在线电影亚洲一区| 欧美日韩中文国产| 亚洲高清免费观看高清完整版在线观看 | 国产拍欧美日韩视频二区| 久久国产夜色精品鲁鲁99| 国产日韩欧美精品电影三级在线 | 久久综合国产精品| 久久精品国产网站| 日韩欧美国产三级| 国内精品伊人久久久久av影院| 日韩午夜三级在线| 精品一区二区在线播放| 日韩精品一区二区三区四区 |