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

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

?? example.c

?? DigitalImageProcessing_base_on_Matlab 基于Matlab的數字圖像處理
?? C
?? 第 1 頁 / 共 2 頁
字號:
 * assume that we do not intend to put the whole image into an in-memory
 * buffer, but to send it line-by-line someplace else.  We need a one-
 * scanline-high JSAMPLE array as a work buffer, and we will let the JPEG
 * memory manager allocate it for us.  This approach is actually quite useful
 * because we don't need to remember to deallocate the buffer separately: it
 * will go away automatically when the JPEG object is cleaned up.
 */


/*
 * ERROR HANDLING:
 *
 * The JPEG library's standard error handler (jerror.c) is divided into
 * several "methods" which you can override individually.  This lets you
 * adjust the behavior without duplicating a lot of code, which you might
 * have to update with each future release.
 *
 * Our example here shows how to override the "error_exit" method so that
 * control is returned to the library's caller when a fatal error occurs,
 * rather than calling exit() as the standard error_exit method does.
 *
 * We use C's setjmp/longjmp facility to return control.  This means that the
 * routine which calls the JPEG library must first execute a setjmp() call to
 * establish the return point.  We want the replacement error_exit to do a
 * longjmp().  But we need to make the setjmp buffer accessible to the
 * error_exit routine.  To do this, we make a private extension of the
 * standard JPEG error handler object.  (If we were using C++, we'd say we
 * were making a subclass of the regular error handler.)
 *
 * Here's the extended error handler struct:
 */

struct my_error_mgr {
  struct jpeg_error_mgr pub;	/* "public" fields */

  jmp_buf setjmp_buffer;	/* for return to caller */
};

typedef struct my_error_mgr * my_error_ptr;

/*
 * Here's the routine that will replace the standard error_exit method:
 */

METHODDEF(void)
my_error_exit (j_common_ptr cinfo)
{
  /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
  my_error_ptr myerr = (my_error_ptr) cinfo->err;

  /* Always display the message. */
  /* We could postpone this until after returning, if we chose. */
  (*cinfo->err->output_message) (cinfo);

  /* Return control to the setjmp point */
  longjmp(myerr->setjmp_buffer, 1);
}


/*
 * Sample routine for JPEG decompression.  We assume that the source file name
 * is passed in.  We want to return 1 on success, 0 on error.
 */


GLOBAL(int)
read_JPEG_file (char * filename)
{
  /* This struct contains the JPEG decompression parameters and pointers to
   * working space (which is allocated as needed by the JPEG library).
   */
  struct jpeg_decompress_struct cinfo;
  /* We use our private extension JPEG error handler.
   * Note that this struct must live as long as the main JPEG parameter
   * struct, to avoid dangling-pointer problems.
   */
  struct my_error_mgr jerr;
  /* More stuff */
  FILE * infile;		/* source file */
  JSAMPARRAY buffer;		/* Output row buffer */
  int row_stride;		/* physical row width in output buffer */

  /* In this example we want to open the input file before doing anything else,
   * so that the setjmp() error recovery below can assume the file is open.
   * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
   * requires it in order to read binary files.
   */

  if ((infile = fopen(filename, "rb")) == NULL) {
    fprintf(stderr, "can't open %s\n", filename);
    return 0;
  }

  /* Step 1: allocate and initialize JPEG decompression object */

  /* We set up the normal JPEG error routines, then override error_exit. */
  cinfo.err = jpeg_std_error(&jerr.pub);
  jerr.pub.error_exit = my_error_exit;
  /* Establish the setjmp return context for my_error_exit to use. */
  if (setjmp(jerr.setjmp_buffer)) {
    /* If we get here, the JPEG code has signaled an error.
     * We need to clean up the JPEG object, close the input file, and return.
     */
    jpeg_destroy_decompress(&cinfo);
    fclose(infile);
    return 0;
  }
  /* Now we can initialize the JPEG decompression object. */
  jpeg_create_decompress(&cinfo);

  /* Step 2: specify data source (eg, a file) */

  jpeg_stdio_src(&cinfo, infile);

  /* Step 3: read file parameters with jpeg_read_header() */

  (void) jpeg_read_header(&cinfo, TRUE);
  /* We can ignore the return value from jpeg_read_header since
   *   (a) suspension is not possible with the stdio data source, and
   *   (b) we passed TRUE to reject a tables-only JPEG file as an error.
   * See libjpeg.doc for more info.
   */

  /* Step 4: set parameters for decompression */

  /* In this example, we don't need to change any of the defaults set by
   * jpeg_read_header(), so we do nothing here.
   */

  /* Step 5: Start decompressor */

  (void) jpeg_start_decompress(&cinfo);
  /* We can ignore the return value since suspension is not possible
   * with the stdio data source.
   */

  /* We may need to do some setup of our own at this point before reading
   * the data.  After jpeg_start_decompress() we have the correct scaled
   * output image dimensions available, as well as the output colormap
   * if we asked for color quantization.
   * In this example, we need to make an output work buffer of the right size.
   */ 
  /* JSAMPLEs per row in output buffer */
  row_stride = cinfo.output_width * cinfo.output_components;
  /* Make a one-row-high sample array that will go away when done with image */
  buffer = (*cinfo.mem->alloc_sarray)
		((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);

  /* Step 6: while (scan lines remain to be read) */
  /*           jpeg_read_scanlines(...); */

  /* Here we use the library's state variable cinfo.output_scanline as the
   * loop counter, so that we don't have to keep track ourselves.
   */
  while (cinfo.output_scanline < cinfo.output_height) {
    /* jpeg_read_scanlines expects an array of pointers to scanlines.
     * Here the array is only one element long, but you could ask for
     * more than one scanline at a time if that's more convenient.
     */
    (void) jpeg_read_scanlines(&cinfo, buffer, 1);
    /* Assume put_scanline_someplace wants a pointer and sample count. */
    put_scanline_someplace(buffer[0], row_stride);
  }

  /* Step 7: Finish decompression */

  (void) jpeg_finish_decompress(&cinfo);
  /* We can ignore the return value since suspension is not possible
   * with the stdio data source.
   */

  /* Step 8: Release JPEG decompression object */

  /* This is an important step since it will release a good deal of memory. */
  jpeg_destroy_decompress(&cinfo);

  /* After finish_decompress, we can close the input file.
   * Here we postpone it until after no more JPEG errors are possible,
   * so as to simplify the setjmp error logic above.  (Actually, I don't
   * think that jpeg_destroy can do an error exit, but why assume anything...)
   */
  fclose(infile);

  /* At this point you may want to check to see whether any corrupt-data
   * warnings occurred (test whether jerr.pub.num_warnings is nonzero).
   */

  /* And we're done! */
  return 1;
}


/*
 * SOME FINE POINTS:
 *
 * In the above code, we ignored the return value of jpeg_read_scanlines,
 * which is the number of scanlines actually read.  We could get away with
 * this because we asked for only one line at a time and we weren't using
 * a suspending data source.  See libjpeg.doc for more info.
 *
 * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();
 * we should have done it beforehand to ensure that the space would be
 * counted against the JPEG max_memory setting.  In some systems the above
 * code would risk an out-of-memory error.  However, in general we don't
 * know the output image dimensions before jpeg_start_decompress(), unless we
 * call jpeg_calc_output_dimensions().  See libjpeg.doc for more about this.
 *
 * Scanlines are returned in the same order as they appear in the JPEG file,
 * which is standardly top-to-bottom.  If you must emit data bottom-to-top,
 * you can use one of the virtual arrays provided by the JPEG memory manager
 * to invert the data.  See wrbmp.c for an example.
 *
 * As with compression, some operating modes may require temporary files.
 * On some systems you may need to set up a signal handler to ensure that
 * temporary files are deleted if the program is interrupted.  See libjpeg.doc.
 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
17c精品麻豆一区二区免费| 老司机精品视频一区二区三区| 亚洲女同女同女同女同女同69| 亚洲a一区二区| 国产主播一区二区| 欧美日韩精品二区第二页| 国产女主播一区| 日本中文字幕一区二区视频| 91色九色蝌蚪| 中文字幕第一页久久| 经典三级视频一区| 欧美精品乱人伦久久久久久| 亚洲女人****多毛耸耸8| 国产大陆a不卡| 精品日韩在线一区| 首页国产欧美久久| 欧美色综合久久| 亚洲欧洲国产日韩| 成人久久18免费网站麻豆| 日韩欧美一区二区免费| 日本中文字幕不卡| 91精品国产色综合久久不卡蜜臀| 亚洲综合激情小说| 一本色道a无线码一区v| 国产精品成人一区二区艾草| 国产一区999| 精品国产三级a在线观看| 日韩不卡一二三区| 91精品国产黑色紧身裤美女| 午夜精品福利一区二区三区av| 91啦中文在线观看| 亚洲黄色尤物视频| 色婷婷综合久久久| 亚洲午夜精品久久久久久久久| www.欧美.com| 亚洲美女视频一区| 日本乱人伦aⅴ精品| 亚洲激情图片小说视频| 欧美亚洲国产怡红院影院| 亚洲综合清纯丝袜自拍| 欧美精品 日韩| 免费不卡在线观看| 日韩精品一区二区在线| 国产精品一区二区在线看| 国产亚洲成av人在线观看导航| 国产麻豆一精品一av一免费| 久久久久久久久久久黄色| 国产成人综合亚洲网站| 国产精品久久久久婷婷二区次 | 一区二区三区在线观看动漫| 色综合久久久久久久久久久| 亚洲综合视频在线| 日韩欧美一级片| 成人免费高清在线观看| 亚洲精品国产视频| 91精品欧美久久久久久动漫| 久草中文综合在线| 国产精品国产三级国产有无不卡| 91香蕉视频污在线| 亚洲成人av免费| 国产欧美日韩另类一区| 在线观看一区二区视频| 久久激情五月激情| 国产精品免费免费| 精品视频在线视频| 国产高清不卡一区二区| 一区二区三区在线视频观看 | 韩国女主播一区二区三区| 国产精品嫩草影院com| 欧美日韩高清一区| 国产精品一品视频| 亚洲自拍偷拍麻豆| 国产色爱av资源综合区| 欧美三级一区二区| 高清不卡在线观看av| 亚洲愉拍自拍另类高清精品| 精品少妇一区二区| 欧美日韩综合在线免费观看| 国产最新精品免费| 婷婷综合另类小说色区| 中文字幕日韩一区| 欧美电视剧免费全集观看| 99国产精品视频免费观看| 免费成人在线观看| 一区二区三区资源| 国产精品国产三级国产专播品爱网 | 777午夜精品视频在线播放| 粉嫩蜜臀av国产精品网站| 日精品一区二区| 亚洲精品视频在线| 国产欧美一区二区精品性色 | 色婷婷av一区二区三区软件| 国内精品不卡在线| 日本欧美一区二区三区| 亚洲欧美日韩国产综合| 国产精品妹子av| 精品免费99久久| 91精品国产色综合久久不卡蜜臀| 在线观看亚洲精品| 99国产精品久| 成人动漫视频在线| 国产精品99久久久久久宅男| 久久超碰97中文字幕| 图片区小说区国产精品视频 | 亚洲欧洲综合另类在线| 久久品道一品道久久精品| 日韩欧美激情一区| 在线播放欧美女士性生活| 欧美色图一区二区三区| 日本韩国欧美在线| 日本福利一区二区| 色欧美日韩亚洲| 色av成人天堂桃色av| 色婷婷亚洲一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃| 99久久夜色精品国产网站| av在线综合网| 93久久精品日日躁夜夜躁欧美| 成人av片在线观看| 成人av网站免费| 91碰在线视频| 欧美综合在线视频| 欧美老女人第四色| 欧美一级免费观看| 日韩欧美综合一区| 精品国精品国产尤物美女| 精品欧美一区二区三区精品久久| 日韩欧美久久久| 国产香蕉久久精品综合网| 欧美国产丝袜视频| 亚洲免费观看高清完整版在线| 亚洲人成伊人成综合网小说| 一区二区三区在线不卡| 天天av天天翘天天综合网色鬼国产| 天天综合色天天综合| 久久国产精品99久久久久久老狼| 激情av综合网| 91在线无精精品入口| 欧美亚洲综合在线| 日韩欧美资源站| 国产精品丝袜在线| 亚洲风情在线资源站| 久久电影国产免费久久电影| 国产999精品久久久久久绿帽| aaa欧美日韩| 欧美人与禽zozo性伦| 精品国产在天天线2019| 国产精品二三区| 日韩经典中文字幕一区| 国产馆精品极品| 欧美三级乱人伦电影| 久久久噜噜噜久久人人看| 一区av在线播放| 久久av中文字幕片| 99国内精品久久| 日韩欧美的一区| 亚洲人一二三区| 老司机精品视频在线| 99这里只有精品| 日韩欧美一区二区久久婷婷| 亚洲人成亚洲人成在线观看图片 | 亚洲一区二区三区小说| 麻豆国产精品视频| 色999日韩国产欧美一区二区| 日韩美女在线视频 | 激情五月婷婷综合| 在线亚洲一区二区| 欧美激情在线观看视频免费| 丝袜美腿亚洲一区二区图片| 国产99久久久国产精品潘金网站| 欧美精品xxxxbbbb| 成人欧美一区二区三区黑人麻豆| 免费在线观看一区| 日本高清免费不卡视频| 国产精品久久综合| 国模大尺度一区二区三区| 欧美日韩国产不卡| 亚洲精品国久久99热| 国产高清无密码一区二区三区| 欧美一区二区在线免费播放| 夜夜精品视频一区二区| 成人一级视频在线观看| 精品av久久707| 日本不卡一二三| 欧美三片在线视频观看| 一区二区在线免费| 99久久99久久免费精品蜜臀| 久久久综合精品| 久久99精品久久久久久动态图| 欧美理论片在线| 亚洲成av人影院在线观看网| 欧美性猛片aaaaaaa做受| 自拍偷拍欧美精品| 99re视频精品| 综合精品久久久| 欧美在线观看视频一区二区| 亚洲综合精品久久| 精品视频999| 日韩av电影免费观看高清完整版在线观看 | 日韩午夜中文字幕|