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

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

?? rdtarga.c

?? 這是在PCA下的基于IPP庫示例代碼例子,在網上下了IPP的庫之后,設置相關參數就可以編譯該代碼.
?? C
字號:
/* * rdtarga.c * * Copyright (C) 1991-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 Targa format. * * 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 Targa format). * * Based on code contributed by Lee Daniel Crocker. */#include "cdjpeg.h"   /* Common decls for cjpeg/djpeg applications */#ifdef TARGA_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 _tga_source_struct * tga_source_ptr;typedef struct _tga_source_struct {  struct cjpeg_source_struct pub; /* public fields */  j_compress_ptr cinfo;   /* back link saves passing separate parm */  JSAMPARRAY colormap;    /* Targa colormap (converted to my format) */  jvirt_sarray_ptr whole_image; /* Needed if funny input row order */  JDIMENSION current_row; /* Current logical row number to read */  /* Pointer to routine to extract next Targa pixel from input file */  JMETHOD(void, read_pixel, (tga_source_ptr sinfo));  /* Result of read_pixel is delivered here: */  U_CHAR tga_pixel[4];  int pixel_size;   /* Bytes per Targa pixel (1 to 4) */  /* State info for reading RLE-coded pixels; both counts must be init to 0 */  int block_count;    /* # of pixels remaining in RLE block */  int dup_pixel_count;    /* # of times to duplicate previous pixel */  /* This saves the correct pixel-row-expansion method for preload_image */  JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,               cjpeg_source_ptr sinfo));} tga_source_struct;/* For expanding 5-bit pixel values to 8-bit with best rounding */static const UINT8 c5to8bits[32] = {    0,   8,  16,  25,  33,  41,  49,  58,   66,  74,  82,  90,  99, 107, 115, 123,  132, 140, 148, 156, 165, 173, 181, 189,  197, 206, 214, 222, 230, 239, 247, 255};LOCAL(int)read_byte (tga_source_ptr sinfo)/* Read next byte from Targa 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 (tga_source_ptr sinfo, int cmaplen, int mapentrysize)/* Read the colormap from a Targa file */{  int i;  /* Presently only handles 24-bit BGR format */  if (mapentrysize != 24)    ERREXIT(sinfo->cinfo, JERR_TGA_BADCMAP);  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);  }}/* * read_pixel methods: get a single pixel from Targa file into tga_pixel[] */METHODDEF(void)read_non_rle_pixel (tga_source_ptr sinfo)/* Read one Targa pixel from the input file; no RLE expansion */{  register FILE *infile = sinfo->pub.input_file;  register int i;  for (i = 0; i < sinfo->pixel_size; i++) {    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);  }}METHODDEF(void)read_rle_pixel (tga_source_ptr sinfo)/* Read one Targa pixel from the input file, expanding RLE data as needed */{  register FILE *infile = sinfo->pub.input_file;  register int i;  /* Duplicate previously read pixel? */  if (sinfo->dup_pixel_count > 0) {    sinfo->dup_pixel_count--;    return;  }  /* Time to read RLE block header? */  if (--sinfo->block_count < 0) { /* decrement pixels remaining in block */    i = read_byte(sinfo);    if (i & 0x80) {   /* Start of duplicate-pixel block? */      sinfo->dup_pixel_count = i & 0x7F; /* number of dups after this one */      sinfo->block_count = 0; /* then read new block header */    } else {      sinfo->block_count = i & 0x7F; /* number of pixels after this one */    }  }  /* Read next pixel */  for (i = 0; i < sinfo->pixel_size; i++) {    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);  }}/* * Read one row of pixels. * * We provide several different versions depending on input file format. */METHODDEF(JDIMENSION)get_8bit_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading 8-bit grayscale pixels */{  tga_source_ptr source = (tga_source_ptr) sinfo;  register JSAMPROW ptr;  register JDIMENSION col;  ptr = source->pub.buffer[0];  for (col = cinfo->image_width; col > 0; col--) {    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);  }  return 1;}METHODDEF(JDIMENSION)get_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading 8-bit colormap indexes */{  tga_source_ptr source = (tga_source_ptr) sinfo;  register int t;  register JSAMPROW ptr;  register JDIMENSION col;  register JSAMPARRAY colormap = source->colormap;  ptr = source->pub.buffer[0];  for (col = cinfo->image_width; col > 0; col--) {    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */    t = UCH(source->tga_pixel[0]);    *ptr++ = colormap[0][t];    *ptr++ = colormap[1][t];    *ptr++ = colormap[2][t];  }  return 1;}METHODDEF(JDIMENSION)get_16bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading 16-bit pixels */{  tga_source_ptr source = (tga_source_ptr) sinfo;  register int t;  register JSAMPROW ptr;  register JDIMENSION col;  ptr = source->pub.buffer[0];  for (col = cinfo->image_width; col > 0; col--) {    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */    t = UCH(source->tga_pixel[0]);    t += UCH(source->tga_pixel[1]) << 8;    /* We expand 5 bit data to 8 bit sample width.     * The format of the 16-bit (LSB first) input word is     *     xRRRRRGGGGGBBBBB     */    ptr[2] = (JSAMPLE) c5to8bits[t & 0x1F];    t >>= 5;    ptr[1] = (JSAMPLE) c5to8bits[t & 0x1F];    t >>= 5;    ptr[0] = (JSAMPLE) c5to8bits[t & 0x1F];    ptr += 3;  }  return 1;}METHODDEF(JDIMENSION)get_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading 24-bit pixels */{  tga_source_ptr source = (tga_source_ptr) sinfo;  register JSAMPROW ptr;  register JDIMENSION col;  ptr = source->pub.buffer[0];  for (col = cinfo->image_width; col > 0; col--) {    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[2]); /* change BGR to RGB order */    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[1]);    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);  }  return 1;}/* * Targa also defines a 32-bit pixel format with order B,G,R,A. * We presently ignore the attribute byte, so the code for reading * these pixels is identical to the 24-bit routine above. * This works because the actual pixel length is only known to read_pixel. */#define get_32bit_row  get_24bit_row/* * This method is for re-reading the input data in standard top-down * row order.  The entire image has already been read into whole_image * with proper conversion of pixel format, but it's in a funny row order. */METHODDEF(JDIMENSION)get_memory_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  tga_source_ptr source = (tga_source_ptr) sinfo;  JDIMENSION source_row;  /* Compute row of source that maps to current_row of normal order */  /* For now, assume image is bottom-up and not interlaced. */  /* NEEDS WORK to support interlaced images! */  source_row = cinfo->image_height - source->current_row - 1;  /* Fetch that row from virtual array */  source->pub.buffer = (*cinfo->mem->access_virt_sarray)    ((j_common_ptr) cinfo, source->whole_image,     source_row, (JDIMENSION) 1, FALSE);  source->current_row++;  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_memory_row on subsequent calls. */METHODDEF(JDIMENSION)preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  tga_source_ptr source = (tga_source_ptr) sinfo;  JDIMENSION row;  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);    }    source->pub.buffer = (*cinfo->mem->access_virt_sarray)      ((j_common_ptr) cinfo, source->whole_image, row, (JDIMENSION) 1, TRUE);    (*source->get_pixel_rows) (cinfo, sinfo);  }  if (progress != NULL)    progress->completed_extra_passes++;  /* Set up to read from the virtual array in unscrambled order */  source->pub.get_pixel_rows = get_memory_row;  source->current_row = 0;  /* And read the first row */  return get_memory_row(cinfo, sinfo);}/* * Read the file header; return image size and component count. */METHODDEF(void)start_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  tga_source_ptr source = (tga_source_ptr) sinfo;  U_CHAR targaheader[18];  int idlen, cmaptype, subtype, flags, interlace_type, components;  unsigned int width, height, maplen;  boolean is_bottom_up;#define GET_2B(offset)  ((unsigned int) UCH(targaheader[offset]) + \       (((unsigned int) UCH(targaheader[offset+1])) << 8))  if (! ReadOK(source->pub.input_file, targaheader, 18))    ERREXIT(cinfo, JERR_INPUT_EOF);  /* Pretend "15-bit" pixels are 16-bit --- we ignore attribute bit anyway */  if (targaheader[16] == 15)    targaheader[16] = 16;  idlen = UCH(targaheader[0]);  cmaptype = UCH(targaheader[1]);  subtype = UCH(targaheader[2]);  maplen = GET_2B(5);  width = GET_2B(12);  height = GET_2B(14);  source->pixel_size = UCH(targaheader[16]) >> 3;  flags = UCH(targaheader[17]); /* Image Descriptor byte */  is_bottom_up = ((flags & 0x20) == 0); /* bit 5 set => top-down */  interlace_type = flags >> 6;  /* bits 6/7 are interlace code */  if (cmaptype > 1 ||   /* cmaptype must be 0 or 1 */      source->pixel_size < 1 || source->pixel_size > 4 ||      (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */      interlace_type != 0)  /* currently don't allow interlaced image */    ERREXIT(cinfo, JERR_TGA_BADPARMS);  if (subtype > 8) {    /* It's an RLE-coded file */    source->read_pixel = read_rle_pixel;    source->block_count = source->dup_pixel_count = 0;    subtype -= 8;  } else {    /* Non-RLE file */    source->read_pixel = read_non_rle_pixel;  }  /* Now should have subtype 1, 2, or 3 */  components = 3;   /* until proven different */  cinfo->in_color_space = JCS_RGB;  switch (subtype) {  case 1:     /* Colormapped image */    if (source->pixel_size == 1 && cmaptype == 1)      source->get_pixel_rows = get_8bit_row;    else      ERREXIT(cinfo, JERR_TGA_BADPARMS);    TRACEMS2(cinfo, 1, JTRC_TGA_MAPPED, width, height);    break;  case 2:     /* RGB image */    switch (source->pixel_size) {    case 2:      source->get_pixel_rows = get_16bit_row;      break;    case 3:      source->get_pixel_rows = get_24bit_row;      break;    case 4:      source->get_pixel_rows = get_32bit_row;      break;    default:      ERREXIT(cinfo, JERR_TGA_BADPARMS);      break;    }    TRACEMS2(cinfo, 1, JTRC_TGA, width, height);    break;  case 3:     /* Grayscale image */    components = 1;    cinfo->in_color_space = JCS_GRAYSCALE;    if (source->pixel_size == 1)      source->get_pixel_rows = get_8bit_gray_row;    else      ERREXIT(cinfo, JERR_TGA_BADPARMS);    TRACEMS2(cinfo, 1, JTRC_TGA_GRAY, width, height);    break;  default:    ERREXIT(cinfo, JERR_TGA_BADPARMS);    break;  }  if (is_bottom_up) {    /* Create a virtual array to buffer the upside-down image. */    source->whole_image = (*cinfo->mem->request_virt_sarray)      ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,       (JDIMENSION) width * components, (JDIMENSION) height, (JDIMENSION) 1);    if (cinfo->progress != NULL) {      cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;      progress->total_extra_passes++; /* count file input as separate pass */    }    /* source->pub.buffer will point to the virtual array. */    source->pub.buffer_height = 1; /* in case anyone looks at it */    source->pub.get_pixel_rows = preload_image;  } else {    /* Don't need a virtual array, but do need a one-row input buffer. */    source->whole_image = NULL;    source->pub.buffer = (*cinfo->mem->alloc_sarray)      ((j_common_ptr) cinfo, JPOOL_IMAGE,       (JDIMENSION) width * components, (JDIMENSION) 1);    source->pub.buffer_height = 1;    source->pub.get_pixel_rows = source->get_pixel_rows;  }  while (idlen--)   /* Throw away ID field */    (void) read_byte(source);  if (maplen > 0) {    if (maplen > 256 || GET_2B(3) != 0)      ERREXIT(cinfo, JERR_TGA_BADCMAP);    /* Allocate space to store the colormap */    source->colormap = (*cinfo->mem->alloc_sarray)      ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3);    /* and read it from the file */    read_colormap(source, (int) maplen, UCH(targaheader[7]));  } else {    if (cmaptype)   /* but you promised a cmap! */      ERREXIT(cinfo, JERR_TGA_BADPARMS);    source->colormap = NULL;  }  cinfo->input_components = components;  cinfo->data_precision = 8;  cinfo->image_width = width;  cinfo->image_height = height;}/* * Finish up at the end of the file. */METHODDEF(void)finish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  /* no work */}/* * The module selection routine for Targa format input. */GLOBAL(cjpeg_source_ptr)jinit_read_targa (j_compress_ptr cinfo){  tga_source_ptr source;  /* Create module interface object */  source = (tga_source_ptr)      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,          SIZEOF(tga_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_tga;  source->pub.finish_input = finish_input_tga;  return (cjpeg_source_ptr) source;}#endif /* TARGA_SUPPORTED */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆成人免费电影| 中文字幕一区二区不卡| 色丁香久综合在线久综合在线观看| 国产一本一道久久香蕉| 国产又黄又大久久| 成人动漫视频在线| 成人app在线观看| 色国产综合视频| 欧美日韩日日夜夜| 欧美一区二区三区啪啪| 欧美电视剧免费全集观看| 欧美成人一区二区三区| 久久精品视频在线看| 久久久久久久网| 中文字幕一区二区三区在线播放| 国产精品毛片无遮挡高清| 亚洲美女区一区| 日韩中文字幕区一区有砖一区| 琪琪久久久久日韩精品| 国产一区二区三区在线观看精品 | 日韩国产成人精品| 免费观看成人av| 国产91综合网| 欧洲国产伦久久久久久久| 欧美一区二区三区白人| 久久久久亚洲综合| 亚洲成人精品在线观看| 久99久精品视频免费观看| 成人成人成人在线视频| 制服丝袜激情欧洲亚洲| 欧美经典一区二区三区| 亚洲精品午夜久久久| 蜜臀av亚洲一区中文字幕| 成人三级伦理片| 91麻豆精品国产91久久久| 国产欧美一区二区在线观看| 亚洲一区日韩精品中文字幕| 国产高清视频一区| 精品视频一区二区三区免费| 久久久久97国产精华液好用吗| 亚洲免费在线视频| 国产精品一区专区| 欧美日韩在线播| 亚洲三级免费电影| 国产麻豆9l精品三级站| 欧美日韩不卡一区| 亚洲区小说区图片区qvod| 国内成人精品2018免费看| 51精品国自产在线| 一区二区三区中文在线观看| 国产成人亚洲综合色影视| 欧美肥妇bbw| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美aaaaaa午夜精品| 欧美性受极品xxxx喷水| 国产精品乱子久久久久| 精品一区二区免费在线观看| 欧洲精品一区二区| 一区二区三区四区在线免费观看| 国产精品77777竹菊影视小说| 欧美一区二区三区啪啪| 天堂va蜜桃一区二区三区| 色又黄又爽网站www久久| 国产精品久久久久毛片软件| 久久成人羞羞网站| 4438亚洲最大| 免费在线看成人av| 777久久久精品| 亚洲精品国产a久久久久久 | 亚洲女同一区二区| 成人免费黄色在线| 欧美激情综合五月色丁香小说| 精品一区二区综合| 精品电影一区二区| 精品在线你懂的| 久久女同精品一区二区| 精品一区在线看| 久久久精品黄色| 国产99精品国产| 成人免费一区二区三区视频| 99精品黄色片免费大全| 亚洲欧美日本韩国| 欧美在线看片a免费观看| 亚洲国产日韩a在线播放| 欧美日韩一卡二卡三卡| 日韩经典一区二区| 精品美女被调教视频大全网站| 裸体一区二区三区| xvideos.蜜桃一区二区| 国产白丝网站精品污在线入口| 国产精品卡一卡二| 色欧美片视频在线观看在线视频| 亚洲综合激情网| 日韩一区二区视频| 成人一区二区三区视频在线观看| 中文字幕日本乱码精品影院| 欧美在线不卡视频| 久久激情五月激情| 国产欧美日产一区| 91日韩精品一区| 日韩电影免费一区| 中文字幕一区日韩精品欧美| 欧美日韩黄色一区二区| 激情综合色播激情啊| 亚洲三级电影网站| 欧美一级片在线看| 成人av在线网| 奇米四色…亚洲| 亚洲日韩欧美一区二区在线| 日韩小视频在线观看专区| 岛国精品在线观看| 日欧美一区二区| 国产精品传媒入口麻豆| 91精品一区二区三区在线观看| 国产 欧美在线| 午夜欧美视频在线观看 | 欧美亚洲图片小说| 国精品**一区二区三区在线蜜桃| 亚洲婷婷综合色高清在线| 日韩美女主播在线视频一区二区三区| 成人免费黄色在线| 久草热8精品视频在线观看| 夜夜精品浪潮av一区二区三区| 精品999久久久| 91美女片黄在线观看| 国产一本一道久久香蕉| 日本亚洲三级在线| 亚洲欧美另类久久久精品2019| 精品国产伦理网| 制服丝袜av成人在线看| 在线观看不卡一区| 成人app下载| 国产成人免费视频网站高清观看视频 | 中文字幕一区二区三区在线不卡 | 国产91清纯白嫩初高中在线观看| 五月天激情综合网| 亚洲视频1区2区| 国产精品传媒视频| 国产日韩精品久久久| 日韩免费高清视频| 欧美mv和日韩mv国产网站| 欧美精品乱码久久久久久按摩 | 激情文学综合插| 裸体歌舞表演一区二区| 蜜桃视频在线观看一区| 午夜精品影院在线观看| 亚洲国产精品一区二区久久恐怖片 | 97精品超碰一区二区三区| 国产91丝袜在线播放九色| 国产麻豆一精品一av一免费| 国产在线一区观看| 国产麻豆精品视频| 国产成人av影院| 成人午夜激情在线| av网站一区二区三区| 91在线一区二区| 欧美在线影院一区二区| 欧美性受xxxx| 884aa四虎影成人精品一区| 日韩欧美www| 国产日本一区二区| 亚洲天堂网中文字| 亚洲成a人v欧美综合天堂下载| 日韩专区一卡二卡| 精品在线观看免费| 成人性色生活片| 色激情天天射综合网| 欧美一区二区三区四区五区| 欧美tickle裸体挠脚心vk| 久久婷婷色综合| 国产精品毛片久久久久久久| 亚洲美女少妇撒尿| 日韩福利电影在线观看| 国产麻豆精品视频| 一本大道久久a久久综合| 欧美三级韩国三级日本一级| 日韩一区二区在线免费观看| 国产日韩欧美综合在线| 亚洲精品久久久久久国产精华液| 日韩精品乱码免费| 国产激情一区二区三区四区| 色一情一乱一乱一91av| 日韩三级免费观看| 亚洲欧美一区二区视频| 日本一道高清亚洲日美韩| 国产成人午夜高潮毛片| 欧美日韩国产中文| 久久久久成人黄色影片| 亚洲成人黄色小说| 国产成人av一区| 日本高清不卡aⅴ免费网站| 日韩精品在线看片z| 国产精品第一页第二页第三页| 日韩精品一区第一页| 成人黄色一级视频| 久久综合狠狠综合久久综合88| 亚洲人成小说网站色在线| 日本va欧美va欧美va精品| 国产成人精品1024| 日韩欧美一区二区免费|