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

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

?? lbm.c

?? miniucgui1.30版本的源碼
?? C
字號:
/*** $Id: lbm.c,v 1.7 2003/09/04 06:02:53 weiym Exp $** ** pcx.c: Low-level LBM/PBM bitmap file read/save routines.** ** Copyright (C) 2003 Feynman Software.** Copyright (C) 2000 ~ 2002 Wei Yongming.**** Some code comes from lbm.c of Allegro by Shawn Hargreaves.** ** Current maintainer:  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*//*         ______   ___    ___**        /\  _  \ /\_ \  /\_ \**        \ \ \L\ \\//\ \ \//\ \      __     __   _ __   ___**         \ \  __ \ \ \ \  \ \ \   /'__`\ /'_ `\/\`'__\/ __`\**          \ \ \/\ \ \_\ \_ \_\ \_/\  __//\ \L\ \ \ \//\ \L\ \**           \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/**            \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/**                                           /\____/**                                           \_/__/*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include "common.h"#include "gdi.h"#include "readbmp.h"#if 1 /* def _LBM_FILE_SUPPORT */static void bmpSetBitsInLine (int bpp, BYTE* bits, int pos, BYTE* value){    int offset, shift;    switch (bpp) {    case 1:        offset = pos / 8;        shift = 8 - (pos % 8);        bits [offset] |= (*value & 0x01) << shift;        break;    case 4:        offset = pos / 2;        shift = 4 - ((pos % 2) << 2);        bits [offset] |= (*value & 0x0F) << shift;        break;    case 8:        offset = pos;        bits [offset] |= *value;        break;    case 15:    case 16:        offset = pos * 2;        bits [offset] |= value [0];        bits [offset + 1] |= value [1];        break;    case 24:        offset = pos * 3;        bits [offset] |= value [0];        bits [offset + 1] |= value [1];        bits [offset + 2] |= value [2];        break;    case 32:        offset = pos * 4;        bits [offset] |= value [0];        bits [offset + 1] |= value [1];        bits [offset + 2] |= value [2];        bits [offset + 3] |= value [3];        break;    }}/* load_lbm: *  Loads IFF ILBM/PBM files with up to 8 bits per pixel, returning *  in a bitmap structure and storing the palette data in the specified *  palette (this should be an array of at least 256 RGB structures). */int load_lbm (MG_RWops* f, MYBITMAP* bmp, RGB *pal){   #define IFF_FORM     0x4D524F46     /* 'FORM' - IFF FORM structure  */   #define IFF_ILBM     0x4D424C49     /* 'ILBM' - interleaved bitmap  */   #define IFF_PBM      0x204D4250     /* 'PBM ' - new DP2e format     */   #define IFF_BMHD     0x44484D42     /* 'BMHD' - bitmap header       */   #define IFF_CMAP     0x50414D43     /* 'CMAP' - color map (palette) */   #define IFF_BODY     0x59444F42     /* 'BODY' - bitmap data         */   BYTE* bits;   int w, h, i, x, y, bpl, ppl, pbm_mode;   char ch, cmp_type, bit_plane, color_depth;   unsigned char uc, check_flags, bit_mask, *line_buf;   long id, len, l;   unsigned long size;   id = fp_igetl(f);              /* read file header    */   if (id != IFF_FORM) {            /* check for 'FORM' id */      return ERR_BMP_IMAGE_TYPE;   }   fp_igetl(f);                   /* skip FORM length    */   id = fp_igetl(f);              /* read id             */   /* check image type ('ILBM' or 'PBM ') */   if ((id != IFF_ILBM) && (id != IFF_PBM)) {      return ERR_BMP_IMAGE_TYPE;   }   pbm_mode = id == IFF_PBM;   id = fp_igetl(f);              /* read id               */   if (id != IFF_BMHD) {            /* check for header      */      return ERR_BMP_IMAGE_TYPE;   }   len = fp_mgetl(f);             /* read header length    */   if (len != 20) {                 /* check, if it is right */      return ERR_BMP_IMAGE_TYPE;   }   w = fp_mgetw(f);               /* read screen width  */   h = fp_mgetw(f);               /* read screen height */   fp_igetw(f);                   /* skip initial x position  */   fp_igetw(f);                   /* skip initial y position  */   color_depth = fp_getc(f);      /* get image depth   */   if (color_depth > 8) {      return ERR_BMP_NOT_SUPPORTED;   }   fp_getc(f);                    /* skip masking type */   cmp_type = fp_getc(f);         /* get compression type */   if ((cmp_type != 0) && (cmp_type != 1)) {      return ERR_BMP_NOT_SUPPORTED;   }   fp_getc(f);                    /* skip unused field        */   fp_igetw(f);                   /* skip transparent color   */   fp_getc(f);                    /* skip x aspect ratio      */   fp_getc(f);                    /* skip y aspect ratio      */   fp_igetw(f);                   /* skip default page width  */   fp_igetw(f);                   /* skip default page height */   check_flags = 0;   do {  /* We'll use cycle to skip possible junk      */         /*  chunks: ANNO, CAMG, GRAB, DEST, TEXT etc. */      id = fp_igetl(f);      switch(id) {         case IFF_CMAP:            memset(pal, 0, 256 * 3);            len = fp_mgetl(f) / 3;            for (i=0; i<len; i++) {               pal[i].r = fp_getc(f);               pal[i].g = fp_getc(f);               pal[i].b = fp_getc(f);            }            check_flags |= 1;       /* flag "palette read" */            break;         case IFF_BODY:            fp_igetl(f);          /* skip BODY size */            if (pbm_mode)               bpl = w;            else {               bpl = w >> 3;        /* calc bytes per line  */               if (w & 7)           /* for finish bits      */                  bpl++;            }            if (bpl & 1)            /* alignment            */               bpl++;            size = bpl * w * h;            if (!(bits = malloc (size))) {                return ERR_BMP_MEM;            }            memset (bits, 0, size);            bmp->bits = bits;            bmp->pitch = bpl;            bmp->size  = size;            line_buf = malloc (bpl);            if (!line_buf) {                return ERR_BMP_MEM;            }            if (pbm_mode) {               for (y = 0; y < h; y++) {                  if (cmp_type) {                     i = 0;                     while (i < bpl) {                        uc = fp_getc(f);                        if (uc < 128) {                           uc++;                           MGUI_RWread (f, &line_buf[i], 1, uc);                           i += uc;                        }                        else if (uc > 128) {                           uc = 257 - uc;                           ch = fp_getc(f);                           memset (&line_buf[i], ch, uc);                           i += uc;                        }                        /* 128 (0x80) means NOP - no operation  */                     }                  }                  else  /* pure theoretical situation */                     MGUI_RWread (f, line_buf, 1, bpl);                                    for (i = 0; i < bpl; i++)                    bmpSetBitsInLine (color_depth, bits, i, line_buf + i);                  bits += bpl;               }            }            else {               for (y = 0; y < h; y++) {                  for (bit_plane = 0; bit_plane < color_depth; bit_plane++) {                     if (cmp_type) {                        i = 0;                        while (i < bpl) {                           uc = fp_getc(f);                           if (uc < 128) {                              uc++;                              MGUI_RWread (f, &line_buf[i], 1, uc);                              i += uc;                           }                           else if (uc > 128) {                              uc = 257 - uc;                              ch = fp_getc(f);                              memset (&line_buf[i], ch, uc);                              i += uc;                           }                           /* 128 (0x80) means NOP - no operation  */                        }                     }                     else                        MGUI_RWread (f, line_buf, 1, bpl);                     bit_mask = 1 << bit_plane;                     ppl = bpl;     /* for all pixel blocks */                     if (w & 7)     /*  may be, except the  */                        ppl--;      /*  the last            */                     for (x = 0; x < ppl; x++) {                        if (line_buf[x] & 128)                           bmpSetBitsInLine (color_depth, bits, x * 8, &bit_mask);                        if (line_buf[x] & 64)                           bmpSetBitsInLine (color_depth, bits, x * 8 + 1, &bit_mask);                        if (line_buf[x] & 32)                           bmpSetBitsInLine (color_depth, bits, x * 8 + 2, &bit_mask);                        if (line_buf[x] & 16)                           bmpSetBitsInLine (color_depth, bits, x * 8 + 3, &bit_mask);                        if (line_buf[x] & 8)                           bmpSetBitsInLine (color_depth, bits, x * 8 + 4, &bit_mask);                        if (line_buf[x] & 4)                           bmpSetBitsInLine (color_depth, bits, x * 8 + 5, &bit_mask);                        if (line_buf[x] & 2)                           bmpSetBitsInLine (color_depth, bits, x * 8 + 6, &bit_mask);                        if (line_buf[x] & 1)                           bmpSetBitsInLine (color_depth, bits, x * 8 + 7, &bit_mask);                     }                     /* last pixel block */                     if (w & 7) {                        x = bpl - 1;                        /* no necessary to check if (w & 7) > 0 in */                        /* first condition, because (w & 7) != 0   */                        if (line_buf[x] & 128)                           bmpSetBitsInLine (color_depth, bits, x * 8, &bit_mask);                        if ((line_buf[x] & 64) && ((w & 7) > 1))                           bmpSetBitsInLine (color_depth, bits, x * 8 + 1, &bit_mask);                        if ((line_buf[x] & 32) && ((w & 7) > 2))                           bmpSetBitsInLine (color_depth, bits, x * 8 + 2, &bit_mask);                        if ((line_buf[x] & 16) && ((w & 7) > 3))                           bmpSetBitsInLine (color_depth, bits, x * 8 + 3, &bit_mask);                        if ((line_buf[x] & 8)  && ((w & 7) > 4))                           bmpSetBitsInLine (color_depth, bits, x * 8 + 4, &bit_mask);                        if ((line_buf[x] & 4)  && ((w & 7) > 5))                           bmpSetBitsInLine (color_depth, bits, x * 8 + 5, &bit_mask);                        if ((line_buf[x] & 2)  && ((w & 7) > 6))                           bmpSetBitsInLine (color_depth, bits, x * 8 + 6, &bit_mask);                        if ((line_buf[x] & 1)  && ((w & 7) > 7))                           bmpSetBitsInLine (color_depth, bits, x * 8 + 7, &bit_mask);                     }                  }                  bits += bpl;               }            }            free (line_buf);            check_flags |= 2;       /* flag "bitmap read" */            break;         default:                   /* skip useless chunks  */            len = fp_mgetl (f);            if (len & 1)               len++;            for (l=0; l < (len >> 1); l++)               fp_igetw (f);      }      /* Exit from loop if we are at the end of file, */      /* or if we loaded both bitmap and palette      */   } while ((check_flags != 3) && (!MGUI_RWeof (f)));   if (check_flags != 3) {      if (check_flags & 2)         return ERR_BMP_LOAD;   }       bmp->flags = MYBMP_FLOW_DOWN;    bmp->depth = color_depth;    bmp->w     = w;    bmp->h     = h;    bmp->frames = 1;   return ERR_BMP_OK;}BOOL check_lbm (MG_RWops* fp){   long id, len;   id = fp_igetl(fp);              /* read file header    */   if (id != IFF_FORM) {           /* check for 'FORM' id */      return FALSE;   }   fp_igetl(fp);                   /* skip FORM length    */   id = fp_igetl(fp);              /* read id             */   /* check image type ('ILBM' or 'PBM ') */   if ((id != IFF_ILBM) && (id != IFF_PBM)) {      return FALSE;   }   id = fp_igetl(fp);              /* read id               */   if (id != IFF_BMHD) {            /* check for header      */      return FALSE;   }   len = fp_mgetl(fp);             /* read header length    */   if (len != 20) {                 /* check, if it is right */      return FALSE;   }    return TRUE;}#endif /* _LBM_FILE_SUPPORT */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本va欧美va瓶| 欧美人动与zoxxxx乱| 欧美三级三级三级| 久久久99久久精品欧美| 亚洲一区二区三区自拍| 成人一区在线观看| 91精品国产综合久久福利| 日韩一区中文字幕| 国产高清不卡一区二区| 日韩一区二区视频在线观看| 亚洲黄色录像片| 成人看片黄a免费看在线| 日韩视频在线观看一区二区| 洋洋成人永久网站入口| 成人免费毛片嘿嘿连载视频| 精品免费99久久| 三级成人在线视频| 在线观看av不卡| 亚洲码国产岛国毛片在线| 国产99久久久久久免费看农村| 3d成人h动漫网站入口| 亚洲欧美日韩在线| 99久久777色| 日本一区二区三区国色天香| 激情欧美一区二区三区在线观看| 91精品国产综合久久久蜜臀粉嫩 | 成人av免费在线观看| 精品国产一区二区三区av性色 | 丁香网亚洲国际| 26uuu亚洲综合色欧美| 美日韩一级片在线观看| 欧美一区二区三区小说| 亚洲国产综合人成综合网站| 欧美偷拍一区二区| 亚洲成人手机在线| 欧美午夜精品电影| 亚洲第一福利视频在线| 欧美色大人视频| 五月婷婷欧美视频| 欧美精品 日韩| 青草av.久久免费一区| 91精品国产福利在线观看 | 日韩女优电影在线观看| 美女精品一区二区| 26uuu国产在线精品一区二区| 韩国成人精品a∨在线观看| 久久久久99精品一区| 风间由美一区二区av101| 国产精品你懂的在线欣赏| 97精品国产97久久久久久久久久久久| 136国产福利精品导航| 欧美色图在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅 | 国产一区二区三区电影在线观看| 精品成人私密视频| 成人性视频免费网站| 亚洲欧美日韩系列| 91精品综合久久久久久| 激情亚洲综合在线| 亚洲天堂免费在线观看视频| 欧美日韩国产片| 国产一区二区久久| 亚洲精品国产品国语在线app| 欧美人妖巨大在线| 国产精品1024| 一区二区成人在线视频| 精品91自产拍在线观看一区| 99国产精品一区| 日本人妖一区二区| 日韩毛片在线免费观看| 欧美一区二区黄色| 99久久精品久久久久久清纯| 五月天精品一区二区三区| 国产三级一区二区| 欧美巨大另类极品videosbest | 中文字幕亚洲视频| 欧美一级在线免费| 91猫先生在线| 国产在线视频一区二区三区| 亚洲小少妇裸体bbw| 国产丝袜欧美中文另类| 9191国产精品| 91福利小视频| 国产高清视频一区| 老司机精品视频导航| 夜夜精品视频一区二区 | 26uuu国产日韩综合| 一本一本大道香蕉久在线精品| 极品少妇一区二区| 亚洲国产精品精华液网站| 国产精品亲子伦对白| 日韩欧美综合一区| 在线观看不卡一区| 成人av资源网站| 国内精品国产成人国产三级粉色| 一区二区三区 在线观看视频| 久久亚洲影视婷婷| 精品粉嫩aⅴ一区二区三区四区| 欧美日韩一二三区| 在线观看成人小视频| 91香蕉视频mp4| 99久久精品久久久久久清纯| 国产福利一区二区| 国产在线播放一区| 精品在线播放免费| 蜜桃免费网站一区二区三区| 图片区小说区国产精品视频| 亚洲图片欧美一区| 日韩精品一区第一页| 一区二区不卡在线视频 午夜欧美不卡在 | 日韩免费高清av| 91麻豆精品91久久久久久清纯| 欧美视频一区二区| 欧美丝袜自拍制服另类| 欧美午夜宅男影院| 欧美日韩视频在线一区二区| 欧美日韩一区二区三区不卡| 欧美性大战久久久久久久蜜臀| 91亚洲精品久久久蜜桃网站| 色综合色狠狠综合色| 99在线精品视频| 一本色道久久综合亚洲aⅴ蜜桃 | 精品成人一区二区| 久久久精品国产免费观看同学| 久久影院视频免费| 国产日韩综合av| 国产精品久久久久久久浪潮网站| 国产精品午夜电影| 亚洲人成电影网站色mp4| 亚洲一区国产视频| 日韩国产一区二| 精品一区二区精品| 国产成人精品网址| 91麻豆.com| 欧美高清一级片在线| 久久影音资源网| 亚洲欧美日韩成人高清在线一区| 亚洲综合免费观看高清完整版在线 | 亚洲欧美一区二区三区孕妇| 亚洲自拍另类综合| 久久精品国产亚洲高清剧情介绍 | 国产一区二区调教| 国产成人av电影免费在线观看| 成人18视频在线播放| 欧美在线小视频| 欧美精品一区男女天堂| 亚洲私人黄色宅男| 免费在线观看日韩欧美| 大陆成人av片| 欧美精品高清视频| 国产精品色在线| 亚洲第一成年网| 国产不卡视频在线播放| 欧美日韩在线三区| 国产三级久久久| 丝袜亚洲另类丝袜在线| 国产成人亚洲综合a∨猫咪| 欧美吞精做爰啪啪高潮| 国产日韩欧美高清| 天天色综合天天| 成人午夜av电影| 日韩欧美国产小视频| 亚洲欧美福利一区二区| 久久99国产精品久久99| 91视频www| 久久精品一区二区三区不卡牛牛 | 国产精品一区二区久久不卡| 欧美日韩久久不卡| 国产精品国产三级国产普通话三级| 日韩vs国产vs欧美| 色婷婷av一区二区三区gif | 日韩片之四级片| 亚洲一区在线观看免费观看电影高清| 国产一区二区不卡| 欧美一区二区免费视频| 亚洲国产视频一区| 91同城在线观看| 欧美国产综合色视频| 国产在线精品免费av| 91麻豆精品国产综合久久久久久 | 久久99深爱久久99精品| 欧美色爱综合网| 亚洲嫩草精品久久| 成人福利视频网站| 国产日韩精品一区二区三区 | 秋霞午夜av一区二区三区| 91女人视频在线观看| 国产精品第13页| 国产电影精品久久禁18| 久久久精品中文字幕麻豆发布| 美国十次了思思久久精品导航| 制服丝袜国产精品| 午夜精品福利一区二区蜜股av | 久久久综合视频| 国产一区二区三区在线观看精品| 欧美xxxxxxxx| 美女国产一区二区| 欧美精品一区二区蜜臀亚洲| 国产一区二区三区在线观看免费 | 99精品视频一区|