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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? example.c

?? DigitalImageProcessing_base_on_Matlab 基于Matlab的數(shù)字圖像處理
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
 * example.c
 *
 * This file illustrates how to use the IJG code as a subroutine library
 * to read or write JPEG image files.  You should look at this code in
 * conjunction with the documentation file libjpeg.doc.
 *
 * This code will not do anything useful as-is, but it may be helpful as a
 * skeleton for constructing routines that call the JPEG library.  
 *
 * We present these routines in the same coding style used in the JPEG code
 * (ANSI function definitions, etc); but you are of course free to code your
 * routines in a different style if you prefer.
 */

#include <stdio.h>

/*
 * Include file for users of JPEG library.
 * You will need to have included system headers that define at least
 * the typedefs FILE and size_t before you can include jpeglib.h.
 * (stdio.h is sufficient on ANSI-conforming systems.)
 * You may also wish to include "jerror.h".
 */

#include "jpeglib.h"

/*
 * <setjmp.h> is used for the optional error recovery mechanism shown in
 * the second part of the example.
 */

#include <setjmp.h>



/******************** JPEG COMPRESSION SAMPLE INTERFACE *******************/

/* This half of the example shows how to feed data into the JPEG compressor.
 * We present a minimal version that does not worry about refinements such
 * as error recovery (the JPEG code will just exit() if it gets an error).
 */


/*
 * IMAGE DATA FORMATS:
 *
 * The standard input image format is a rectangular array of pixels, with
 * each pixel having the same number of "component" values (color channels).
 * Each pixel row is an array of JSAMPLEs (which typically are unsigned chars).
 * If you are working with color data, then the color values for each pixel
 * must be adjacent in the row; for example, R,G,B,R,G,B,R,G,B,... for 24-bit
 * RGB color.
 *
 * For this example, we'll assume that this data structure matches the way
 * our application has stored the image in memory, so we can just pass a
 * pointer to our image buffer.  In particular, let's say that the image is
 * RGB color and is described by:
 */

extern JSAMPLE * image_buffer;	/* Points to large array of R,G,B-order data */
extern int image_height;	/* Number of rows in image */
extern int image_width;		/* Number of columns in image */


/*
 * Sample routine for JPEG compression.  We assume that the target file name
 * and a compression quality factor are passed in.
 */

GLOBAL(void)
write_JPEG_file (char * filename, int quality)
{
  /* This struct contains the JPEG compression parameters and pointers to
   * working space (which is allocated as needed by the JPEG library).
   * It is possible to have several such structures, representing multiple
   * compression/decompression processes, in existence at once.  We refer
   * to any one struct (and its associated working data) as a "JPEG object".
   */
  struct jpeg_compress_struct cinfo;
  /* This struct represents a JPEG error handler.  It is declared separately
   * because applications often want to supply a specialized error handler
   * (see the second half of this file for an example).  But here we just
   * take the easy way out and use the standard error handler, which will
   * print a message on stderr and call exit() if compression fails.
   * Note that this struct must live as long as the main JPEG parameter
   * struct, to avoid dangling-pointer problems.
   */
  struct jpeg_error_mgr jerr;
  /* More stuff */
  FILE * outfile;		/* target file */
  JSAMPROW row_pointer[1];	/* pointer to JSAMPLE row[s] */
  int row_stride;		/* physical row width in image buffer */

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

  /* We have to set up the error handler first, in case the initialization
   * step fails.  (Unlikely, but it could happen if you are out of memory.)
   * This routine fills in the contents of struct jerr, and returns jerr's
   * address which we place into the link field in cinfo.
   */
  cinfo.err = jpeg_std_error(&jerr);
  /* Now we can initialize the JPEG compression object. */
  jpeg_create_compress(&cinfo);

  /* Step 2: specify data destination (eg, a file) */
  /* Note: steps 2 and 3 can be done in either order. */

  /* Here we use the library-supplied code to send compressed data to a
   * stdio stream.  You can also write your own code to do something else.
   * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
   * requires it in order to write binary files.
   */
  if ((outfile = fopen(filename, "wb")) == NULL) {
    fprintf(stderr, "can't open %s\n", filename);
    exit(1);
  }
  jpeg_stdio_dest(&cinfo, outfile);

  /* Step 3: set parameters for compression */

  /* First we supply a description of the input image.
   * Four fields of the cinfo struct must be filled in:
   */
  cinfo.image_width = image_width; 	/* image width and height, in pixels */
  cinfo.image_height = image_height;
  cinfo.input_components = 3;		/* # of color components per pixel */
  cinfo.in_color_space = JCS_RGB; 	/* colorspace of input image */
  /* Now use the library's routine to set default compression parameters.
   * (You must set at least cinfo.in_color_space before calling this,
   * since the defaults depend on the source color space.)
   */
  jpeg_set_defaults(&cinfo);
  /* Now you can set any non-default parameters you wish to.
   * Here we just illustrate the use of quality (quantization table) scaling:
   */
  jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);

  /* Step 4: Start compressor */

  /* TRUE ensures that we will write a complete interchange-JPEG file.
   * Pass TRUE unless you are very sure of what you're doing.
   */
  jpeg_start_compress(&cinfo, TRUE);

  /* Step 5: while (scan lines remain to be written) */
  /*           jpeg_write_scanlines(...); */

  /* Here we use the library's state variable cinfo.next_scanline as the
   * loop counter, so that we don't have to keep track ourselves.
   * To keep things simple, we pass one scanline per call; you can pass
   * more if you wish, though.
   */
  row_stride = image_width * 3;	/* JSAMPLEs per row in image_buffer */

  while (cinfo.next_scanline < cinfo.image_height) {
    /* jpeg_write_scanlines expects an array of pointers to scanlines.
     * Here the array is only one element long, but you could pass
     * more than one scanline at a time if that's more convenient.
     */
    row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
    (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
  }

  /* Step 6: Finish compression */

  jpeg_finish_compress(&cinfo);
  /* After finish_compress, we can close the output file. */
  fclose(outfile);

  /* Step 7: release JPEG compression object */

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

  /* And we're done! */
}


/*
 * SOME FINE POINTS:
 *
 * In the above loop, we ignored the return value of jpeg_write_scanlines,
 * which is the number of scanlines actually written.  We could get away
 * with this because we were only relying on the value of cinfo.next_scanline,
 * which will be incremented correctly.  If you maintain additional loop
 * variables then you should be careful to increment them properly.
 * Actually, for output to a stdio stream you needn't worry, because
 * then jpeg_write_scanlines will write all the lines passed (or else exit
 * with a fatal error).  Partial writes can only occur if you use a data
 * destination module that can demand suspension of the compressor.
 * (If you don't know what that's for, you don't need it.)
 *
 * If the compressor requires full-image buffers (for entropy-coding
 * optimization or a multi-scan JPEG file), it will create temporary
 * files for anything that doesn't fit within the maximum-memory setting.
 * (Note that temp files are NOT needed if you use the default parameters.)
 * 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.
 *
 * Scanlines MUST be supplied in top-to-bottom order if you want your JPEG
 * files to be compatible with everyone else's.  If you cannot readily read
 * your data in that order, you'll need an intermediate array to hold the
 * image.  See rdtarga.c or rdbmp.c for examples of handling bottom-to-top
 * source data using the JPEG code's internal virtual-array mechanisms.
 */



/******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/

/* This half of the example shows how to read data from the JPEG decompressor.
 * It's a bit more refined than the above, in that we show:
 *   (a) how to modify the JPEG library's standard error-reporting behavior;
 *   (b) how to allocate workspace using the library's memory manager.
 *
 * Just to make this example a little different from the first one, we'll

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区中文字幕电影 | 精品无人码麻豆乱码1区2区 | 94-欧美-setu| 成人免费视频app| 国产成人鲁色资源国产91色综| 国产一区不卡在线| 国产福利精品导航| 成人app在线观看| 99久久久精品| 日本道色综合久久| 欧美亚洲国产一区在线观看网站 | 亚洲视频一区在线| 亚洲激情自拍偷拍| 亚洲成年人影院| 美女脱光内衣内裤视频久久网站 | 91精品国产综合久久小美女| 3d动漫精品啪啪1区2区免费 | 天使萌一区二区三区免费观看| 日韩电影一区二区三区四区| 久久精品国产第一区二区三区| 久久机这里只有精品| 国产精品1区二区.| 99精品视频在线免费观看| 欧美性xxxxxx少妇| 欧美一区二区福利在线| 国产午夜精品一区二区三区嫩草 | 亚洲人成网站影音先锋播放| 亚洲欧美日韩中文字幕一区二区三区| 亚洲已满18点击进入久久| 日韩精品欧美成人高清一区二区| 另类欧美日韩国产在线| 粉嫩av亚洲一区二区图片| 在线观看三级视频欧美| 91精品福利在线一区二区三区| 久久久国际精品| 亚洲色图.com| 奇米影视在线99精品| 丁香亚洲综合激情啪啪综合| 欧美中文字幕不卡| 久久中文娱乐网| 亚洲免费在线看| 久久精品久久99精品久久| 国产白丝网站精品污在线入口| 欧美午夜不卡视频| 久久综合久久综合九色| 亚洲欧美日韩在线不卡| 激情久久久久久久久久久久久久久久| av在线这里只有精品| 欧美精选一区二区| 国产精品久久夜| 青娱乐精品视频在线| www.亚洲免费av| 日韩一级在线观看| 一区二区高清免费观看影视大全 | 粉嫩在线一区二区三区视频| 欧美日韩一区视频| 国产精品久久久久天堂| 另类小说视频一区二区| 在线免费视频一区二区| 午夜久久电影网| 97精品久久久久中文字幕| 日韩视频123| 亚洲成人在线网站| 99re成人精品视频| 久久综合九色综合欧美亚洲| 天天免费综合色| 91片在线免费观看| 久久精品夜色噜噜亚洲aⅴ| 日韩精品一二三区| 91福利在线导航| 中文字幕在线一区二区三区| 九一久久久久久| 7777精品伊人久久久大香线蕉超级流畅 | 91污在线观看| 久久久久久电影| 免费精品视频最新在线| 色综合网站在线| 国产精品视频九色porn| 国产揄拍国内精品对白| 91精品国产综合久久精品| 亚洲欧美激情视频在线观看一区二区三区 | 亚洲一级二级在线| 91日韩精品一区| 中文字幕在线一区免费| 国产二区国产一区在线观看| 91精品国产色综合久久久蜜香臀| 亚洲一区在线观看网站| 91久久精品一区二区| 国产精品情趣视频| 福利电影一区二区三区| 久久精品人人做人人综合| 激情久久久久久久久久久久久久久久| 欧美一区二区高清| 美女www一区二区| 91精品国产综合久久精品app| 亚洲国产精品综合小说图片区| 欧美在线你懂的| 亚洲国产视频一区| 欧美日产国产精品| 午夜精品一区二区三区三上悠亚 | 精品成人一区二区三区| 黑人精品欧美一区二区蜜桃| 日韩网站在线看片你懂的| 美美哒免费高清在线观看视频一区二区 | 欧美成人精品福利| 久久se精品一区精品二区| 欧美sm美女调教| 国内偷窥港台综合视频在线播放| 日韩视频免费观看高清完整版 | 亚洲男人电影天堂| 色婷婷一区二区三区四区| 亚洲精品乱码久久久久久黑人 | 91精品国产一区二区人妖| 麻豆成人久久精品二区三区小说| 日韩欧美电影在线| 韩国精品主播一区二区在线观看 | 亚洲免费视频成人| 欧美日韩精品一区二区天天拍小说 | 亚洲另类春色校园小说| 欧美三级午夜理伦三级中视频| 亚洲成av人**亚洲成av**| 日韩午夜激情视频| 国产福利一区二区三区视频在线| 中文字幕在线播放不卡一区| 色av成人天堂桃色av| 天堂在线亚洲视频| 免费观看一级特黄欧美大片| 欧美一级欧美一级在线播放| 韩国在线一区二区| 国产精品国产自产拍在线| 欧美在线观看你懂的| 久久成人18免费观看| 国产欧美在线观看一区| 色久综合一二码| 蜜臀精品一区二区三区在线观看| 久久久久99精品国产片| 91免费观看视频| 日韩成人免费看| 国产精品美日韩| 欧美日韩在线播放| 国产成人无遮挡在线视频| 伊人色综合久久天天| 日韩免费看的电影| 成人av网站免费观看| 日本不卡一二三区黄网| 国产精品久久国产精麻豆99网站| 欧美视频在线一区二区三区| 国产麻豆成人精品| 亚洲综合成人在线视频| 久久久久久久久久久久电影| 色琪琪一区二区三区亚洲区| 精品一区二区日韩| av在线综合网| 麻豆成人91精品二区三区| 中文字幕亚洲区| 91精品国产aⅴ一区二区| av电影一区二区| 奇米一区二区三区av| 亚洲欧美另类在线| 久久亚洲免费视频| 在线精品视频一区二区| 国产盗摄一区二区三区| 视频一区视频二区中文字幕| 国产欧美精品一区二区色综合 | 国产成+人+日韩+欧美+亚洲| 亚洲aaa精品| 亚洲日本免费电影| 久久免费电影网| 欧美一区二区性放荡片| 欧洲亚洲精品在线| 国产成人亚洲精品青草天美| 日韩不卡在线观看日韩不卡视频| 中文字幕一区二区视频| 精品处破学生在线二十三| 欧美绝品在线观看成人午夜影视| av激情成人网| 国产成人免费在线视频| 蜜臀va亚洲va欧美va天堂| 亚洲成a人片综合在线| 亚洲欧美日韩国产成人精品影院| 国产色一区二区| 日韩免费视频一区| 337p亚洲精品色噜噜狠狠| 色老汉一区二区三区| 波多野结衣91| 国产v综合v亚洲欧| 激情五月播播久久久精品| 三级欧美在线一区| 午夜激情一区二区| 亚洲mv大片欧洲mv大片精品| 中文字幕永久在线不卡| 国产精品免费观看视频| 国产日韩av一区| 久久精品网站免费观看| 久久亚洲免费视频| 2014亚洲片线观看视频免费| 精品久久久久久无| 日韩亚洲欧美一区二区三区| 欧美一区永久视频免费观看| 91麻豆精品91久久久久久清纯|