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

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

?? rdppm.c

?? 這是在PCA下的基于IPP庫示例代碼例子,在網上下了IPP的庫之后,設置相關參數就可以編譯該代碼.
?? C
字號:
/* * rdppm.c * * Copyright (C) 1991-1997, 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 PPM/PGM format. * The extended 2-byte-per-sample raw PPM/PGM formats are supported. * The PBMPLUS library is NOT required to compile this software * (but it is highly useful as a set of PPM image manipulation programs). * * 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 PPM format). */#include "cdjpeg.h"   /* Common decls for cjpeg/djpeg applications */#ifdef PPM_SUPPORTED/* Portions of this code are based on the PBMPLUS library, which is:**** Copyright (C) 1988 by Jef Poskanzer.**** Permission to use, copy, modify, and distribute this software and its** documentation for any purpose and without fee is hereby granted, provided** that the above copyright notice appear in all copies and that both that** copyright notice and this permission notice appear in supporting** documentation.  This software is provided "as is" without express or** implied warranty.*//* 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)))/* * On most systems, reading individual bytes with getc() is drastically less * efficient than buffering a row at a time with fread().  On PCs, we must * allocate the buffer in near data space, because we are assuming small-data * memory model, wherein fread() can't reach far memory.  If you need to * process very wide images on a PC, you might have to compile in large-memory * model, or else replace fread() with a getc() loop --- which will be much * slower. *//* Private version of data source object */typedef struct {  struct cjpeg_source_struct pub; /* public fields */  U_CHAR *iobuffer;   /* non-FAR pointer to I/O buffer */  JSAMPROW pixrow;    /* FAR pointer to same */  size_t buffer_width;    /* width of I/O buffer */  JSAMPLE *rescale;   /* => maxval-remapping array, or NULL */} ppm_source_struct;typedef ppm_source_struct * ppm_source_ptr;LOCAL(int)pbm_getc (FILE * infile)/* Read next char, skipping over any comments *//* A comment/newline sequence is returned as a newline */{  register int ch;  ch = getc(infile);  if (ch == '#') {    do {      ch = getc(infile);    } while (ch != '\n' && ch != EOF);  }  return ch;}LOCAL(unsigned int)read_pbm_integer (j_compress_ptr cinfo, FILE * infile)/* Read an unsigned decimal integer from the PPM file *//* Swallows one trailing character after the integer *//* Note that on a 16-bit-int machine, only values up to 64k can be read. *//* This should not be a problem in practice. */{  register int ch;  register unsigned int val;  /* Skip any leading whitespace */  do {    ch = pbm_getc(infile);    if (ch == EOF)      ERREXIT(cinfo, JERR_INPUT_EOF);  } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');  if (ch < '0' || ch > '9')    ERREXIT(cinfo, JERR_PPM_NONNUMERIC);  val = ch - '0';  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {    val *= 10;    val += ch - '0';  }  return val;}/* * Read one row of pixels. * * We provide several different versions depending on input file format. * In all cases, input is scaled to the size of JSAMPLE. * * A really fast path is provided for reading byte/sample raw files with * maxval = MAXJSAMPLE, which is the normal case for 8-bit data. */METHODDEF(JDIMENSION)get_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading text-format PGM files with any maxval */{  ppm_source_ptr source = (ppm_source_ptr) sinfo;  FILE * infile = source->pub.input_file;  register JSAMPROW ptr;  register JSAMPLE *rescale = source->rescale;  JDIMENSION col;  ptr = source->pub.buffer[0];  for (col = cinfo->image_width; col > 0; col--) {    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];  }  return 1;}METHODDEF(JDIMENSION)get_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading text-format PPM files with any maxval */{  ppm_source_ptr source = (ppm_source_ptr) sinfo;  FILE * infile = source->pub.input_file;  register JSAMPROW ptr;  register JSAMPLE *rescale = source->rescale;  JDIMENSION col;  ptr = source->pub.buffer[0];  for (col = cinfo->image_width; col > 0; col--) {    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];  }  return 1;}METHODDEF(JDIMENSION)get_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading raw-byte-format PGM files with any maxval */{  ppm_source_ptr source = (ppm_source_ptr) sinfo;  register JSAMPROW ptr;  register U_CHAR * bufferptr;  register JSAMPLE *rescale = source->rescale;  JDIMENSION col;  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))    ERREXIT(cinfo, JERR_INPUT_EOF);  ptr = source->pub.buffer[0];  bufferptr = source->iobuffer;  for (col = cinfo->image_width; col > 0; col--) {    *ptr++ = rescale[UCH(*bufferptr++)];  }  return 1;}METHODDEF(JDIMENSION)get_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading raw-byte-format PPM files with any maxval */{  ppm_source_ptr source = (ppm_source_ptr) sinfo;  register JSAMPROW ptr;  register U_CHAR * bufferptr;  register JSAMPLE *rescale = source->rescale;  JDIMENSION col;  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))    ERREXIT(cinfo, JERR_INPUT_EOF);  ptr = source->pub.buffer[0];  bufferptr = source->iobuffer;  for (col = cinfo->image_width; col > 0; col--) {    *ptr++ = rescale[UCH(*bufferptr++)];    *ptr++ = rescale[UCH(*bufferptr++)];    *ptr++ = rescale[UCH(*bufferptr++)];  }  return 1;}METHODDEF(JDIMENSION)get_raw_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading raw-byte-format files with maxval = MAXJSAMPLE. * In this case we just read right into the JSAMPLE buffer! * Note that same code works for PPM and PGM files. */{  ppm_source_ptr source = (ppm_source_ptr) sinfo;  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))    ERREXIT(cinfo, JERR_INPUT_EOF);  return 1;}METHODDEF(JDIMENSION)get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading raw-word-format PGM files with any maxval */{  ppm_source_ptr source = (ppm_source_ptr) sinfo;  register JSAMPROW ptr;  register U_CHAR * bufferptr;  register JSAMPLE *rescale = source->rescale;  JDIMENSION col;  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))    ERREXIT(cinfo, JERR_INPUT_EOF);  ptr = source->pub.buffer[0];  bufferptr = source->iobuffer;  for (col = cinfo->image_width; col > 0; col--) {    register int temp;    temp  = UCH(*bufferptr++);    temp |= UCH(*bufferptr++) << 8;    *ptr++ = rescale[temp];  }  return 1;}METHODDEF(JDIMENSION)get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)/* This version is for reading raw-word-format PPM files with any maxval */{  ppm_source_ptr source = (ppm_source_ptr) sinfo;  register JSAMPROW ptr;  register U_CHAR * bufferptr;  register JSAMPLE *rescale = source->rescale;  JDIMENSION col;  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))    ERREXIT(cinfo, JERR_INPUT_EOF);  ptr = source->pub.buffer[0];  bufferptr = source->iobuffer;  for (col = cinfo->image_width; col > 0; col--) {    register int temp;    temp  = UCH(*bufferptr++);    temp |= UCH(*bufferptr++) << 8;    *ptr++ = rescale[temp];    temp  = UCH(*bufferptr++);    temp |= UCH(*bufferptr++) << 8;    *ptr++ = rescale[temp];    temp  = UCH(*bufferptr++);    temp |= UCH(*bufferptr++) << 8;    *ptr++ = rescale[temp];  }  return 1;}/* * Read the file header; return image size and component count. */METHODDEF(void)start_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  ppm_source_ptr source = (ppm_source_ptr) sinfo;  int c;  unsigned int w, h, maxval;  boolean need_iobuffer, use_raw_buffer, need_rescale;  if (getc(source->pub.input_file) != 'P')    ERREXIT(cinfo, JERR_PPM_NOT);  c = getc(source->pub.input_file); /* subformat discriminator character */  /* detect unsupported variants (ie, PBM) before trying to read header */  switch (c) {  case '2':     /* it's a text-format PGM file */  case '3':     /* it's a text-format PPM file */  case '5':     /* it's a raw-format PGM file */  case '6':     /* it's a raw-format PPM file */    break;  default:    ERREXIT(cinfo, JERR_PPM_NOT);    break;  }  /* fetch the remaining header info */  w = read_pbm_integer(cinfo, source->pub.input_file);  h = read_pbm_integer(cinfo, source->pub.input_file);  maxval = read_pbm_integer(cinfo, source->pub.input_file);  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */    ERREXIT(cinfo, JERR_PPM_NOT);  cinfo->data_precision = BITS_IN_JSAMPLE; /* we always rescale data to this */  cinfo->image_width = (JDIMENSION) w;  cinfo->image_height = (JDIMENSION) h;  /* initialize flags to most common settings */  need_iobuffer = TRUE;   /* do we need an I/O buffer? */  use_raw_buffer = FALSE; /* do we map input buffer onto I/O buffer? */  need_rescale = TRUE;    /* do we need a rescale array? */  switch (c) {  case '2':     /* it's a text-format PGM file */    cinfo->input_components = 1;    cinfo->in_color_space = JCS_GRAYSCALE;    TRACEMS2(cinfo, 1, JTRC_PGM_TEXT, w, h);    source->pub.get_pixel_rows = get_text_gray_row;    need_iobuffer = FALSE;    break;  case '3':     /* it's a text-format PPM file */    cinfo->input_components = 3;    cinfo->in_color_space = JCS_RGB;    TRACEMS2(cinfo, 1, JTRC_PPM_TEXT, w, h);    source->pub.get_pixel_rows = get_text_rgb_row;    need_iobuffer = FALSE;    break;  case '5':     /* it's a raw-format PGM file */    cinfo->input_components = 1;    cinfo->in_color_space = JCS_GRAYSCALE;    TRACEMS2(cinfo, 1, JTRC_PGM, w, h);    if (maxval > 255) {      source->pub.get_pixel_rows = get_word_gray_row;    } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {      source->pub.get_pixel_rows = get_raw_row;      use_raw_buffer = TRUE;      need_rescale = FALSE;    } else {      source->pub.get_pixel_rows = get_scaled_gray_row;    }    break;  case '6':     /* it's a raw-format PPM file */    cinfo->input_components = 3;    cinfo->in_color_space = JCS_RGB;    TRACEMS2(cinfo, 1, JTRC_PPM, w, h);    if (maxval > 255) {      source->pub.get_pixel_rows = get_word_rgb_row;    } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {      source->pub.get_pixel_rows = get_raw_row;      use_raw_buffer = TRUE;      need_rescale = FALSE;    } else {      source->pub.get_pixel_rows = get_scaled_rgb_row;    }    break;  }  /* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */  if (need_iobuffer) {    source->buffer_width = (size_t) w * cinfo->input_components *      ((maxval<=255) ? SIZEOF(U_CHAR) : (2*SIZEOF(U_CHAR)));    source->iobuffer = (U_CHAR *)      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,          source->buffer_width);  }  /* Create compressor input buffer. */  if (use_raw_buffer) {    /* For unscaled raw-input case, we can just map it onto the I/O buffer. */    /* Synthesize a JSAMPARRAY pointer structure */    /* Cast here implies near->far pointer conversion on PCs */    source->pixrow = (JSAMPROW) source->iobuffer;    source->pub.buffer = & source->pixrow;    source->pub.buffer_height = 1;  } else {    /* Need to translate anyway, so make a separate sample buffer. */    source->pub.buffer = (*cinfo->mem->alloc_sarray)      ((j_common_ptr) cinfo, JPOOL_IMAGE,       (JDIMENSION) w * cinfo->input_components, (JDIMENSION) 1);    source->pub.buffer_height = 1;  }  /* Compute the rescaling array if required. */  if (need_rescale) {    INT32 val, half_maxval;    /* On 16-bit-int machines we have to be careful of maxval = 65535 */    source->rescale = (JSAMPLE *)      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,          (size_t) (((long) maxval + 1L) * SIZEOF(JSAMPLE)));    half_maxval = maxval / 2;    for (val = 0; val <= (INT32) maxval; val++) {      /* The multiplication here must be done in 32 bits to avoid overflow */      source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval);    }  }}/* * Finish up at the end of the file. */METHODDEF(void)finish_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo){  /* no work */}/* * The module selection routine for PPM format input. */GLOBAL(cjpeg_source_ptr)jinit_read_ppm (j_compress_ptr cinfo){  ppm_source_ptr source;  /* Create module interface object */  source = (ppm_source_ptr)      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,          SIZEOF(ppm_source_struct));  /* Fill in method ptrs, except get_pixel_rows which start_input sets */  source->pub.start_input = start_input_ppm;  source->pub.finish_input = finish_input_ppm;  return (cjpeg_source_ptr) source;}#endif /* PPM_SUPPORTED */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
4438成人网| 国产人伦精品一区二区| 亚洲国产精品高清| 精品在线播放免费| 高潮精品一区videoshd| 26uuu亚洲| 久久99这里只有精品| 正在播放亚洲一区| 午夜激情久久久| 欧美精品1区2区3区| 亚洲一区二区三区爽爽爽爽爽| 91亚洲精品久久久蜜桃网站 | 亚洲成人动漫在线免费观看| 99精品国产一区二区三区不卡| 国产情人综合久久777777| 国内精品免费在线观看| 精品国产免费久久| 国产综合久久久久影院| 欧美成人一级视频| 激情综合网最新| 国产色爱av资源综合区| 成人在线视频一区| 中文字幕精品一区| 91在线国内视频| 国产精品久久久久久久久免费桃花| 国产精一品亚洲二区在线视频| 久久久影院官网| 国产69精品久久久久毛片| 中文字幕一区视频| 久久影院午夜片一区| 国产一区二区三区精品欧美日韩一区二区三区 | 玉米视频成人免费看| 色综合久久99| 一区二区三区鲁丝不卡| 欧美在线免费观看亚洲| 蜜臀av在线播放一区二区三区 | 国产乱人伦偷精品视频免下载 | 欧美一区二区精品久久911| 日韩成人免费看| 欧美成人aa大片| 国产成人精品在线看| 亚洲色图一区二区三区| 制服丝袜亚洲精品中文字幕| 久久99久久精品欧美| 欧美国产日本视频| 欧美日韩另类国产亚洲欧美一级| 免费在线观看成人| 国产精品乱码久久久久久| 91麻豆精品视频| 日本aⅴ精品一区二区三区| 中文字幕不卡三区| 在线不卡a资源高清| 成人一级片在线观看| 亚洲国产成人91porn| 久久日韩粉嫩一区二区三区 | 成人黄色国产精品网站大全在线免费观看 | 日韩手机在线导航| 99这里只有精品| 琪琪一区二区三区| 亚洲视频免费在线观看| 国产在线精品一区二区三区不卡 | 日韩一区二区高清| 欧美日韩国产综合久久| 成人久久18免费网站麻豆| 久久国产婷婷国产香蕉| 日韩中文字幕91| 亚洲一区在线观看免费| 一区二区三区在线观看动漫| 国产精品夫妻自拍| 欧美高清一级片在线观看| 26uuu欧美| 精品国产凹凸成av人导航| 欧美日韩三级一区二区| 欧美视频在线一区二区三区| 色狠狠av一区二区三区| 色噜噜夜夜夜综合网| 不卡电影免费在线播放一区| 丁香婷婷综合五月| 成人黄色小视频在线观看| 成人av网站在线| 菠萝蜜视频在线观看一区| 精品美女在线观看| 欧美一级久久久| 欧美大片顶级少妇| 欧美成人精品3d动漫h| 久久婷婷成人综合色| 国产欧美一区二区三区在线看蜜臀| 久久毛片高清国产| 中文字幕第一区| 亚洲美女区一区| 午夜欧美在线一二页| 蜜臀国产一区二区三区在线播放| 蜜桃视频在线观看一区| 国产精品影视天天线| 国产宾馆实践打屁股91| 99久久久免费精品国产一区二区 | 一区二区成人在线视频 | 青娱乐精品视频| 国产一区二区免费看| 懂色一区二区三区免费观看| 91污在线观看| 在线不卡一区二区| 久久久蜜臀国产一区二区| 国产精品网友自拍| 亚洲高清视频的网址| 久久99精品久久久久久| 成人精品视频网站| 精品视频资源站| 久久久国产精品不卡| 一区二区三区在线视频播放| 麻豆91免费看| 99久久精品免费看| 在线电影一区二区三区| 国产欧美综合色| 亚洲区小说区图片区qvod| 日韩国产欧美三级| 国产成人自拍网| 欧美三区免费完整视频在线观看| 精品免费视频.| 亚洲最新在线观看| 极品少妇xxxx精品少妇| 91啪亚洲精品| 欧美一区二区免费视频| 国产精品高潮久久久久无| 秋霞午夜鲁丝一区二区老狼| av中文字幕一区| 日韩欧美色综合网站| 亚洲欧美乱综合| 国产在线精品视频| 欧美日韩国产免费| 国产精品美女久久久久aⅴ| 首页国产欧美久久| 99久久国产综合精品女不卡| 日韩一区二区免费在线电影| 亚洲日穴在线视频| 国产不卡免费视频| 欧美一级欧美三级在线观看 | 亚洲 欧美综合在线网络| 国产白丝精品91爽爽久久| 777xxx欧美| 一区二区三区蜜桃网| 粉嫩aⅴ一区二区三区四区五区 | 午夜亚洲国产au精品一区二区| 国产成人午夜99999| 精品日韩成人av| 香蕉影视欧美成人| 日本电影欧美片| 中文字幕精品三区| 国产一区二区三区日韩| 日韩欧美一区二区视频| 亚洲国产一区二区a毛片| 色悠悠久久综合| 中文一区在线播放| 欧美一区二区免费| 性做久久久久久久免费看| 一本在线高清不卡dvd| 国产精品白丝在线| 成人黄色电影在线| 中文字幕制服丝袜一区二区三区| 国产成人av资源| 中文字幕第一区| 成人毛片在线观看| 中文字幕免费在线观看视频一区| 国产乱色国产精品免费视频| 欧美精品一区二区蜜臀亚洲| 久久97超碰色| 久久久久9999亚洲精品| 国产suv精品一区二区883| 欧美精品一区二区三区很污很色的 | 日韩经典中文字幕一区| 91精品国产综合久久久蜜臀粉嫩| 亚洲国产精品久久艾草纯爱| 欧美日韩小视频| 日韩中文字幕区一区有砖一区 | 91成人在线免费观看| 亚洲猫色日本管| 91国在线观看| 五月天亚洲婷婷| 欧美一级搡bbbb搡bbbb| 久久精品国产99国产| 26uuu另类欧美亚洲曰本| 国产精品一线二线三线精华| 国产精品免费网站在线观看| 91热门视频在线观看| 午夜精品久久久久久| 精品国精品国产| 成人免费av资源| 亚洲国产视频直播| 欧美第一区第二区| 国产91精品免费| 亚洲黄色录像片| 欧美一区二区三区四区视频| 国产美女娇喘av呻吟久久| 国产精品乱人伦中文| 欧美日韩卡一卡二| 国产一区二区三区香蕉| 亚洲天天做日日做天天谢日日欢| 欧美伊人久久久久久午夜久久久久| 日韩高清不卡一区二区三区| 精品国产乱子伦一区|