亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品91一区二区| 日韩欧美在线影院| 日韩免费一区二区三区在线播放| 国产欧美综合色| 日韩成人精品视频| 色婷婷国产精品| 中文字幕第一区二区| 久久国产精品一区二区| 欧美欧美欧美欧美| 亚洲免费看黄网站| 成人免费黄色大片| 精品久久久久久亚洲综合网| 日产国产欧美视频一区精品| 欧美在线一区二区| 亚洲免费观看视频| av不卡一区二区三区| 国产人久久人人人人爽| 久久99精品久久只有精品| 欧美亚洲国产怡红院影院| 国产精品二三区| 成人在线一区二区三区| 国产女主播在线一区二区| 91丨九色丨黑人外教| 欧美大片一区二区三区| 午夜精品久久久久久久久| 色综合久久久久综合| 国产精品久久久久一区二区三区共| 精品一区二区影视| 欧美成人乱码一区二区三区| 另类小说色综合网站| 日韩视频免费观看高清完整版在线观看 | 亚洲成人一二三| 欧洲一区二区三区免费视频| 洋洋av久久久久久久一区| 色悠悠久久综合| 一区二区欧美国产| 欧美日本免费一区二区三区| 丝袜美腿高跟呻吟高潮一区| 欧美久久久一区| 免费精品视频最新在线| 日韩三级精品电影久久久 | 在线日韩国产精品| 国产精品白丝在线| 不卡视频一二三| 国产成人av资源| 国产精品美女久久久久久2018 | 国产亚洲精品aa| 成人永久aaa| 一区二区三区四区亚洲| 欧美挠脚心视频网站| 美国三级日本三级久久99| 精品毛片乱码1区2区3区 | 久久午夜色播影院免费高清| 国产高清视频一区| 亚洲三级小视频| 欧美性欧美巨大黑白大战| 日韩中文字幕亚洲一区二区va在线 | 一区二区三区四区不卡在线| 欧美中文字幕一区二区三区| 日本美女视频一区二区| 久久蜜桃一区二区| 在线观看一区二区精品视频| 美洲天堂一区二卡三卡四卡视频| 国产欧美中文在线| 欧美日韩一区二区三区四区五区| 久久99久久久久久久久久久| 中文字幕欧美国产| 在线成人免费观看| 成人短视频下载| 水野朝阳av一区二区三区| 国产欧美视频在线观看| 欧美精品一二三四| 成人毛片老司机大片| 日韩av一区二区在线影视| 日本一区二区三区免费乱视频| 91论坛在线播放| 国产最新精品免费| 亚洲a一区二区| 国产日韩高清在线| 欧美一级片在线观看| 99久久婷婷国产综合精品| 五月天视频一区| 亚洲日本免费电影| 精品福利一二区| 欧美日韩综合在线| av一区二区久久| 国产成人综合网站| 久久精品99国产精品| 亚洲永久精品大片| 国产精品国产自产拍高清av王其| 欧美sm极限捆绑bd| 欧美人体做爰大胆视频| 色欧美片视频在线观看| 99久久精品免费| 国产精品一区二区91| 麻豆极品一区二区三区| 亚洲午夜私人影院| 亚洲啪啪综合av一区二区三区| 26uuu另类欧美| 欧美va亚洲va国产综合| 日韩一区二区三区在线视频| 欧美日韩一区中文字幕| 色狠狠综合天天综合综合| 成人aa视频在线观看| 成人综合婷婷国产精品久久蜜臀| 国产在线精品一区二区夜色| 久久99精品久久久久婷婷| 免费成人美女在线观看.| 午夜亚洲福利老司机| 亚洲一区二区三区小说| 亚洲线精品一区二区三区八戒| 亚洲青青青在线视频| 亚洲丝袜制服诱惑| 亚洲欧美一区二区三区国产精品| 亚洲色欲色欲www在线观看| 亚洲色图丝袜美腿| 国产精品久久看| 亚洲欧美日韩国产综合| 中文字幕中文字幕一区| 亚洲精品中文在线| 亚洲一区二区偷拍精品| 亚洲国产精品久久久男人的天堂| 亚洲电影视频在线| 日本特黄久久久高潮| 美女高潮久久久| 国产馆精品极品| 欧美在线三级电影| 欧美午夜影院一区| 91精品久久久久久久91蜜桃| 制服丝袜日韩国产| 久久久www成人免费无遮挡大片| 久久精品一区二区三区不卡| 欧美激情综合五月色丁香小说| 国产精品污www在线观看| 国产精品久久久久久久久免费相片 | av在线不卡免费看| 在线视频欧美精品| 4hu四虎永久在线影院成人| 日韩免费观看2025年上映的电影| 精品国产乱码久久久久久免费| 国产欧美日韩另类一区| 自拍偷拍国产精品| 轻轻草成人在线| 不卡的av在线| 欧美日韩国产a| 欧美国产视频在线| 亚洲一二三级电影| 黄一区二区三区| 色诱视频网站一区| 日韩一区国产二区欧美三区| 亚洲国产高清不卡| 一区二区三区欧美视频| 成人免费视频播放| 欧美亚洲尤物久久| 久久色中文字幕| 亚洲福中文字幕伊人影院| 久久国产精品露脸对白| 99国产精品久久久久久久久久久| 欧美一级免费大片| 中文字幕一区二区5566日韩| 日韩精品一二三| 99久久综合色| 2021中文字幕一区亚洲| 亚洲专区一二三| 成人午夜在线播放| 日韩一区二区在线播放| 亚洲欧美日韩在线| 国产麻豆精品在线观看| 91精品国产色综合久久| 一区二区三区在线观看国产| 国产精品性做久久久久久| 欧美三级视频在线播放| 中文字幕在线观看不卡视频| 精品一区二区三区免费| 欧美日韩国产欧美日美国产精品| 国产精品区一区二区三区| 精品亚洲国产成人av制服丝袜 | 日本精品免费观看高清观看| 久久综合狠狠综合久久综合88 | 91老师国产黑色丝袜在线| 久久久久久99精品| 久草在线在线精品观看| 91麻豆精品国产无毒不卡在线观看 | 国产欧美综合在线观看第十页| 日韩高清一级片| 在线观看91av| 亚洲五码中文字幕| 91激情在线视频| 国产精品不卡一区| 成人v精品蜜桃久久一区| 欧美国产禁国产网站cc| 韩国三级在线一区| 久久人人爽人人爽| 狠狠色伊人亚洲综合成人| 欧美一区二区三区四区在线观看| 日本视频一区二区三区| 欧美一区二区三区在线观看视频| 亚洲国产精品影院| 欧美日韩一二三区| 丝袜美腿成人在线|