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

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

?? rdbmp.c

?? 這是在PCA下的基于IPP庫示例代碼例子,在網上下了IPP的庫之后,設置相關參數就可以編譯該代碼.
?? C
字號:
/* * rdbmp.c * * Copyright (C) 1994-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file contains routines to read input images in Microsoft "BMP" * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors). * Currently, only 8-bit and 24-bit images are supported, not 1-bit or * 4-bit (feeding such low-depth images into JPEG would be silly anyway). * Also, we don't support RLE-compressed files. * * These routines may need modification for non-Unix environments or * specialized applications.  As they stand, they assume input from * an ordinary stdio stream.  They further assume that reading begins * at the start of the file; start_input may need work if the * user interface has already read some data (e.g., to determine that * the file is indeed BMP format). * * This code contributed by James Arthur Boucher. */#include "cdjpeg.h"   /* Common decls for cjpeg/djpeg applications */#ifdef BMP_SUPPORTED/* Macros to deal with unsigned chars as efficiently as compiler allows */#ifdef HAVE_UNSIGNED_CHARtypedef unsigned char U_CHAR;#define UCH(x)  ((int) (x))#else /* !HAVE_UNSIGNED_CHAR */#ifdef CHAR_IS_UNSIGNEDtypedef char U_CHAR;#define UCH(x)  ((int) (x))#elsetypedef char U_CHAR;#define UCH(x)  ((int) (x) & 0xFF)#endif#endif /* HAVE_UNSIGNED_CHAR */#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len)))/* Private version of data source object */typedef struct _bmp_source_struct * bmp_source_ptr;typedef struct _bmp_source_struct {  struct cjpeg_source_struct pub; /* public fields */  j_compress_ptr cinfo;   /* back link saves passing separate parm */  JSAMPARRAY colormap;    /* BMP colormap (converted to my format) */  jvirt_sarray_ptr whole_image; /* Needed to reverse row order */  JDIMENSION source_row;  /* Current source row number */  JDIMENSION row_width;   /* Physical width of scanlines in file */  int bits_per_pixel;   /* remembers 8- or 24-bit format */} bmp_source_struct;LOCAL(int)read_byte (bmp_source_ptr sinfo)/* Read next byte from BMP file */{  register FILE *infile = sinfo->pub.input_file;  register int c;  if ((c = getc(infile)) == EOF)    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);  return c;}LOCAL(void)read_colormap (bmp_source_ptr sinfo, int cmaplen, int mapentrysize)/* Read the colormap from a BMP file */{  int i;  switch (mapentrysize) {  case 3:    /* BGR format (occurs in OS/2 files) */    for (i = 0; i < cmaplen; i++) {      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);    }    break;  case 4:    /* BGR0 format (occurs in MS Windows files) */    for (i = 0; i < cmaplen; i++) {      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);      (void) read_byte(sinfo);    }    break;  default:    ERREXIT(sinfo->cinfo, JERR_BMP_BADCMAP);    break;  }}/* * Read one row of pixels. * The image has been read into the whole_image array, but is otherwise * unprocessed.  We must read it out in top-to-bottom row order, and if * it is an 8-bit image, we must expand colormapped pixels to 24bit format. */METHODDEF(JDIMENSION)get_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading 8-bit colormap indexes */{  bmp_source_ptr source = (bmp_source_ptr) sinfo;  register JSAMPARRAY colormap = source->colormap;  JSAMPARRAY image_ptr;  register int t;  register JSAMPROW inptr, outptr;  register JDIMENSION col;  /* Fetch next row from virtual array */  source->source_row--;  image_ptr = (*cinfo->mem->access_virt_sarray)    ((j_common_ptr) cinfo, source->whole_image,     source->source_row, (JDIMENSION) 1, FALSE);  /* Expand the colormap indexes to real data */  inptr = image_ptr[0];  outptr = source->pub.buffer[0];  for (col = cinfo->image_width; col > 0; col--) {    t = GETJSAMPLE(*inptr++);    *outptr++ = colormap[0][t]; /* can omit GETJSAMPLE() safely */    *outptr++ = colormap[1][t];    *outptr++ = colormap[2][t];  }  return 1;}METHODDEF(JDIMENSION)get_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading 24-bit pixels */{  bmp_source_ptr source = (bmp_source_ptr) sinfo;  JSAMPARRAY image_ptr;  register JSAMPROW inptr, outptr;  register JDIMENSION col;  /* Fetch next row from virtual array */  source->source_row--;  image_ptr = (*cinfo->mem->access_virt_sarray)    ((j_common_ptr) cinfo, source->whole_image,     source->source_row, (JDIMENSION) 1, FALSE);  /* Transfer data.  Note source values are in BGR order   * (even though Microsoft's own documents say the opposite).   */  inptr = image_ptr[0];  outptr = source->pub.buffer[0];  for (col = cinfo->image_width; col > 0; col--) {    outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */    outptr[1] = *inptr++;    outptr[0] = *inptr++;    outptr += 3;  }  return 1;}/* * This method loads the image into whole_image during the first call on * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call * get_8bit_row or get_24bit_row on subsequent calls. */METHODDEF(JDIMENSION)preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  bmp_source_ptr source = (bmp_source_ptr) sinfo;  register FILE *infile = source->pub.input_file;  register int c;  register JSAMPROW out_ptr;  JSAMPARRAY image_ptr;  JDIMENSION row, col;  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;  /* Read the data into a virtual array in input-file row order. */  for (row = 0; row < cinfo->image_height; row++) {    if (progress != NULL) {      progress->pub.pass_counter = (long) row;      progress->pub.pass_limit = (long) cinfo->image_height;      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);    }    image_ptr = (*cinfo->mem->access_virt_sarray)      ((j_common_ptr) cinfo, source->whole_image,       row, (JDIMENSION) 1, TRUE);    out_ptr = image_ptr[0];    for (col = source->row_width; col > 0; col--) {      /* inline copy of read_byte() for speed */      if ((c = getc(infile)) == EOF)  ERREXIT(cinfo, JERR_INPUT_EOF);      *out_ptr++ = (JSAMPLE) c;    }  }  if (progress != NULL)    progress->completed_extra_passes++;  /* Set up to read from the virtual array in top-to-bottom order */  switch (source->bits_per_pixel) {  case 8:    source->pub.get_pixel_rows = get_8bit_row;    break;  case 24:    source->pub.get_pixel_rows = get_24bit_row;    break;  default:    ERREXIT(cinfo, JERR_BMP_BADDEPTH);  }  source->source_row = cinfo->image_height;  /* And read the first row */  return (*source->pub.get_pixel_rows) (cinfo, sinfo);}/* * Read the file header; return image size and component count. */METHODDEF(void)start_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  bmp_source_ptr source = (bmp_source_ptr) sinfo;  U_CHAR bmpfileheader[14];  U_CHAR bmpinfoheader[64];#define GET_2B(array,offset)  ((unsigned int) UCH(array[offset]) + \             (((unsigned int) UCH(array[offset+1])) << 8))#define GET_4B(array,offset)  ((INT32) UCH(array[offset]) + \             (((INT32) UCH(array[offset+1])) << 8) + \             (((INT32) UCH(array[offset+2])) << 16) + \             (((INT32) UCH(array[offset+3])) << 24))  INT32 bfOffBits;  INT32 headerSize;  INT32 biWidth = 0;    /* initialize to avoid compiler warning */  INT32 biHeight = 0;  unsigned int biPlanes;  INT32 biCompression;  INT32 biXPelsPerMeter,biYPelsPerMeter;  INT32 biClrUsed = 0;  int mapentrysize = 0;   /* 0 indicates no colormap */  INT32 bPad;  JDIMENSION row_width;  /* Read and verify the bitmap file header */  if (! ReadOK(source->pub.input_file, bmpfileheader, 14))    ERREXIT(cinfo, JERR_INPUT_EOF);  if (GET_2B(bmpfileheader,0) != 0x4D42) /* 'BM' */    ERREXIT(cinfo, JERR_BMP_NOT);  bfOffBits = (INT32) GET_4B(bmpfileheader,10);  /* We ignore the remaining fileheader fields */  /* The infoheader might be 12 bytes (OS/2 1.x), 40 bytes (Windows),   * or 64 bytes (OS/2 2.x).  Check the first 4 bytes to find out which.   */  if (! ReadOK(source->pub.input_file, bmpinfoheader, 4))    ERREXIT(cinfo, JERR_INPUT_EOF);  headerSize = (INT32) GET_4B(bmpinfoheader,0);  if (headerSize < 12 || headerSize > 64)    ERREXIT(cinfo, JERR_BMP_BADHEADER);  if (! ReadOK(source->pub.input_file, bmpinfoheader+4, headerSize-4))    ERREXIT(cinfo, JERR_INPUT_EOF);  switch ((int) headerSize) {  case 12:    /* Decode OS/2 1.x header (Microsoft calls this a BITMAPCOREHEADER) */    biWidth = (INT32) GET_2B(bmpinfoheader,4);    biHeight = (INT32) GET_2B(bmpinfoheader,6);    biPlanes = GET_2B(bmpinfoheader,8);    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,10);    switch (source->bits_per_pixel) {    case 8:     /* colormapped image */      mapentrysize = 3;   /* OS/2 uses RGBTRIPLE colormap */      TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, (int) biWidth, (int) biHeight);      break;    case 24:      /* RGB image */      TRACEMS2(cinfo, 1, JTRC_BMP_OS2, (int) biWidth, (int) biHeight);      break;    default:      ERREXIT(cinfo, JERR_BMP_BADDEPTH);      break;    }    if (biPlanes != 1)      ERREXIT(cinfo, JERR_BMP_BADPLANES);    break;  case 40:  case 64:    /* Decode Windows 3.x header (Microsoft calls this a BITMAPINFOHEADER) */    /* or OS/2 2.x header, which has additional fields that we ignore */    biWidth = GET_4B(bmpinfoheader,4);    biHeight = GET_4B(bmpinfoheader,8);    biPlanes = GET_2B(bmpinfoheader,12);    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,14);    biCompression = GET_4B(bmpinfoheader,16);    biXPelsPerMeter = GET_4B(bmpinfoheader,24);    biYPelsPerMeter = GET_4B(bmpinfoheader,28);    biClrUsed = GET_4B(bmpinfoheader,32);    /* biSizeImage, biClrImportant fields are ignored */    switch (source->bits_per_pixel) {    case 8:     /* colormapped image */      mapentrysize = 4;   /* Windows uses RGBQUAD colormap */      TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, (int) biWidth, (int) biHeight);      break;    case 24:      /* RGB image */      TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight);      break;    default:      ERREXIT(cinfo, JERR_BMP_BADDEPTH);      break;    }    if (biPlanes != 1)      ERREXIT(cinfo, JERR_BMP_BADPLANES);    if (biCompression != 0)      ERREXIT(cinfo, JERR_BMP_COMPRESSED);    if (biXPelsPerMeter > 0 && biYPelsPerMeter > 0) {      /* Set JFIF density parameters from the BMP data */      cinfo->X_density = (UINT16) (biXPelsPerMeter/100); /* 100 cm per meter */      cinfo->Y_density = (UINT16) (biYPelsPerMeter/100);      cinfo->density_unit = 2;  /* dots/cm */    }    break;  default:    ERREXIT(cinfo, JERR_BMP_BADHEADER);    break;  }  /* Compute distance to bitmap data --- will adjust for colormap below */  bPad = bfOffBits - (headerSize + 14);  /* Read the colormap, if any */  if (mapentrysize > 0) {    if (biClrUsed <= 0)      biClrUsed = 256;    /* assume it's 256 */    else if (biClrUsed > 256)      ERREXIT(cinfo, JERR_BMP_BADCMAP);    /* Allocate space to store the colormap */    source->colormap = (*cinfo->mem->alloc_sarray)      ((j_common_ptr) cinfo, JPOOL_IMAGE,       (JDIMENSION) biClrUsed, (JDIMENSION) 3);    /* and read it from the file */    read_colormap(source, (int) biClrUsed, mapentrysize);    /* account for size of colormap */    bPad -= biClrUsed * mapentrysize;  }  /* Skip any remaining pad bytes */  if (bPad < 0)     /* incorrect bfOffBits value? */    ERREXIT(cinfo, JERR_BMP_BADHEADER);  while (--bPad >= 0) {    (void) read_byte(source);  }  /* Compute row width in file, including padding to 4-byte boundary */  if (source->bits_per_pixel == 24)    row_width = (JDIMENSION) (biWidth * 3);  else    row_width = (JDIMENSION) biWidth;  while ((row_width & 3) != 0) row_width++;  source->row_width = row_width;  /* Allocate space for inversion array, prepare for preload pass */  source->whole_image = (*cinfo->mem->request_virt_sarray)    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,     row_width, (JDIMENSION) biHeight, (JDIMENSION) 1);  source->pub.get_pixel_rows = preload_image;  if (cinfo->progress != NULL) {    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;    progress->total_extra_passes++; /* count file input as separate pass */  }  /* Allocate one-row buffer for returned data */  source->pub.buffer = (*cinfo->mem->alloc_sarray)    ((j_common_ptr) cinfo, JPOOL_IMAGE,     (JDIMENSION) (biWidth * 3), (JDIMENSION) 1);  source->pub.buffer_height = 1;  cinfo->in_color_space = JCS_RGB;  cinfo->input_components = 3;  cinfo->data_precision = 8;  cinfo->image_width = (JDIMENSION) biWidth;  cinfo->image_height = (JDIMENSION) biHeight;}/* * Finish up at the end of the file. */METHODDEF(void)finish_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  /* no work */}/* * The module selection routine for BMP format input. */GLOBAL(cjpeg_source_ptr)jinit_read_bmp (j_compress_ptr cinfo){  bmp_source_ptr source;  /* Create module interface object */  source = (bmp_source_ptr)      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,          SIZEOF(bmp_source_struct));  source->cinfo = cinfo;  /* make back link for subroutines */  /* Fill in method ptrs, except get_pixel_rows which start_input sets */  source->pub.start_input = start_input_bmp;  source->pub.finish_input = finish_input_bmp;  return (cjpeg_source_ptr) source;}#endif /* BMP_SUPPORTED */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色噜噜久久综合| 亚洲免费观看高清完整版在线| 欧美老肥妇做.爰bbww视频| 91麻豆精品视频| 成人做爰69片免费看网站| 国产成人自拍网| 粉嫩一区二区三区在线看| 国产成都精品91一区二区三| 高清不卡在线观看av| 处破女av一区二区| 91丨九色丨黑人外教| 色中色一区二区| 欧美性videosxxxxx| 91麻豆精品国产91久久久使用方法| 欧美色涩在线第一页| 日韩一区二区免费在线观看| 日韩一级黄色大片| 精品美女一区二区| 国产精品色一区二区三区| 亚洲日本免费电影| 亚洲福利一二三区| 麻豆精品一区二区综合av| 国内久久婷婷综合| 99久久婷婷国产综合精品电影 | 九九国产精品视频| 国产做a爰片久久毛片| 国产成人在线观看| 色综合中文字幕| 在线观看91av| 久久久亚洲精华液精华液精华液 | 免费观看91视频大全| 黑人巨大精品欧美一区| 波多野结衣欧美| 欧美日韩三级视频| 26uuu色噜噜精品一区| 国产精品久久久久毛片软件| 一区二区视频在线| 九九九久久久精品| aaa国产一区| 3751色影院一区二区三区| 久久久99精品免费观看不卡| 亚洲三级在线播放| 另类欧美日韩国产在线| 成人app下载| 67194成人在线观看| 国产欧美日韩三级| 天天色综合天天| 成人午夜电影久久影院| 欧美老肥妇做.爰bbww视频| 国产日韩欧美精品一区| 一本一道波多野结衣一区二区| 欧美日韩国产高清一区| 国产日韩欧美激情| 日本欧美加勒比视频| 国产成人av一区二区三区在线观看| 欧美在线不卡一区| 久久精品在线免费观看| 亚洲高清免费视频| 成人av综合一区| 日韩欧美在线影院| 亚洲一区二区av电影| 国产成人精品综合在线观看 | 中文字幕中文在线不卡住| 亚洲丶国产丶欧美一区二区三区| 国产黄色精品网站| 欧美一级日韩免费不卡| 夜夜精品视频一区二区| 国产传媒一区在线| 日韩欧美综合一区| 亚洲国产精品一区二区www在线| 国产aⅴ综合色| 日韩精品一区二区在线观看| 亚洲成人先锋电影| 91啦中文在线观看| 中文av一区二区| 国产在线精品一区在线观看麻豆| 欧美精品在欧美一区二区少妇| 综合av第一页| 成人免费av资源| 亚洲精品在线三区| 秋霞av亚洲一区二区三| 欧美日韩国产一级二级| 亚洲精品免费看| 成人黄色电影在线 | 天天操天天色综合| 色哟哟日韩精品| 国产精品九色蝌蚪自拍| 国产精品一级黄| 久久日一线二线三线suv| 欧美aaaaa成人免费观看视频| 欧美色视频一区| 亚洲一区二区三区免费视频| 色综合久久天天| 成人欧美一区二区三区黑人麻豆 | 99国产精品久久久久| 久久精品视频免费观看| 国产一区二区三区观看| 精品国偷自产国产一区| 美女网站色91| 精品国产sm最大网站免费看| 久久国产精品露脸对白| 精品福利av导航| 国产一区高清在线| 久久久久亚洲蜜桃| 懂色av一区二区三区免费看| 国产三级三级三级精品8ⅰ区| 韩国v欧美v亚洲v日本v| 久久精品日韩一区二区三区| 国产传媒久久文化传媒| 国产精品嫩草影院com| a亚洲天堂av| jvid福利写真一区二区三区| 国产精品免费av| 91麻豆高清视频| 午夜日韩在线观看| 91精品国产一区二区三区| 久久成人精品无人区| 久久久精品免费观看| 成人视屏免费看| 一区二区三区不卡视频| 69av一区二区三区| 国产一区二区三区精品视频| 国产亚洲1区2区3区| k8久久久一区二区三区| 亚洲综合av网| 日韩网站在线看片你懂的| 国产一区二区在线影院| 精品一区二区久久| 国产成人综合网| 日本一区二区三区四区在线视频| 成人av小说网| 亚洲一区二区三区中文字幕| 91精品国产综合久久蜜臀| 久久精品国产第一区二区三区| 2017欧美狠狠色| av在线不卡观看免费观看| 亚洲福中文字幕伊人影院| 欧美成人欧美edvon| www.亚洲精品| 亚洲午夜视频在线观看| 日韩欧美在线观看一区二区三区| 国产麻豆精品在线观看| 亚洲欧美日韩中文字幕一区二区三区| 91久久精品一区二区二区| 免费精品视频最新在线| 国产精品视频一二| 在线播放中文字幕一区| 国产精品一区在线观看你懂的| 亚洲婷婷综合久久一本伊一区| 制服.丝袜.亚洲.另类.中文 | 欧美日韩国产小视频在线观看| 老司机午夜精品99久久| 国产精品第13页| 在线电影欧美成精品| 国产成a人亚洲| 亚洲va国产天堂va久久en| 久久久久国产一区二区三区四区 | 久久久久88色偷偷免费| 日本久久电影网| 国产一区二区三区在线观看免费视频 | 99久久精品免费看国产| 天天色 色综合| 国产精品久久久爽爽爽麻豆色哟哟| 在线成人小视频| 成av人片一区二区| 麻豆视频一区二区| 亚洲精品成a人| 久久亚洲一区二区三区明星换脸| 91精品1区2区| 成人中文字幕合集| 日本成人中文字幕在线视频| 中文字幕中文字幕在线一区| 日韩久久久精品| 欧美日韩亚洲综合在线| av毛片久久久久**hd| 欧美日韩激情在线| 91麻豆.com| 国产精品一级在线| 六月丁香婷婷久久| 亚洲福利视频一区二区| 椎名由奈av一区二区三区| 国产亚洲欧洲997久久综合| 欧美一区二区在线免费播放 | 国产亚洲综合在线| 欧美一激情一区二区三区| 91蝌蚪porny| 成人妖精视频yjsp地址| 国产乱子伦一区二区三区国色天香| 性久久久久久久久久久久| 亚洲欧美日韩在线不卡| 中文字幕欧美一区| 国产蜜臀av在线一区二区三区| www国产成人免费观看视频 深夜成人网| 精品视频在线免费看| 欧洲在线/亚洲| 色综合久久88色综合天天6 | 日韩一区二区三区电影在线观看| 欧美三级蜜桃2在线观看| 色欧美日韩亚洲| 91国产视频在线观看|