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

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

?? example.c

?? 一款最完整的工業組態軟源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品自拍偷拍| 日本一区二区成人在线| 亚洲精品免费看| 亚洲精品国产精品乱码不99| 亚洲色图在线看| 亚洲一区av在线| 日韩高清在线观看| 国产精品一区二区在线观看不卡| 国产一区二区不卡在线| 91在线视频播放地址| 欧美日韩免费一区二区三区 | 久久久国产精品麻豆 | 亚洲自拍偷拍九九九| 婷婷久久综合九色综合绿巨人| 免费人成黄页网站在线一区二区 | 日韩视频123| 亚洲欧洲av另类| 日本va欧美va欧美va精品| 国产传媒一区在线| 欧美日韩视频专区在线播放| 久久丝袜美腿综合| 亚洲高清在线精品| av在线不卡免费看| 欧美二区乱c少妇| 国产精品久久久一区麻豆最新章节| 五月婷婷久久综合| 成人激情视频网站| 精品sm在线观看| 偷窥少妇高潮呻吟av久久免费| 国产成人精品综合在线观看| 欧美日韩免费视频| 日韩美女视频一区二区| 国产一区不卡精品| 精品国产制服丝袜高跟| 午夜成人免费电影| 欧美在线免费观看视频| 1000部国产精品成人观看| 国产精品综合一区二区| 日韩午夜av电影| 强制捆绑调教一区二区| 欧美影视一区二区三区| 亚洲日本va午夜在线电影| 99热在这里有精品免费| 国产免费成人在线视频| 美女精品自拍一二三四| 欧美一区二区精品在线| 蜜臀久久久久久久| 日韩午夜在线影院| 国产一区二区三区在线观看精品| 91精品国产入口| 免费高清在线视频一区·| 日韩视频在线一区二区| 美女一区二区在线观看| 久久综合色一综合色88| 国产成人免费视频精品含羞草妖精| 久久奇米777| 不卡电影免费在线播放一区| 亚洲品质自拍视频网站| 欧美丝袜丝交足nylons| 奇米影视在线99精品| 日韩免费一区二区| 成人午夜激情片| 亚洲一区二区三区爽爽爽爽爽| 欧美伦理视频网站| 国内精品视频666| 亚洲欧洲韩国日本视频| 91精品国产综合久久香蕉的特点| 国内偷窥港台综合视频在线播放| 中文字幕免费不卡| 欧美福利一区二区| 国产成人8x视频一区二区| 一区二区三区在线免费| 日韩免费高清视频| 色欲综合视频天天天| 久久丁香综合五月国产三级网站| 国产精品国产自产拍在线| 成人在线视频一区二区| 欧美在线不卡一区| 最新不卡av在线| 99精品视频一区二区三区| 久久精品国产网站| 亚洲国产精品久久久久秋霞影院| 久久精品亚洲精品国产欧美kt∨ | 欧美性猛交一区二区三区精品| 蜜臀国产一区二区三区在线播放 | 国产伦精品一区二区三区免费| 一区二区三区资源| 国产精品日产欧美久久久久| 欧美一区二区在线视频| 91视频免费看| 国产91高潮流白浆在线麻豆| 精品一区二区久久久| 蜜桃av一区二区三区| 偷偷要91色婷婷| 亚洲成人av在线电影| 成人免费在线视频| 日韩美女久久久| 亚洲男人天堂av网| 欧美激情综合网| 欧美国产精品v| 国产人伦精品一区二区| 欧美精品一区二区三区视频| 欧美一区二区在线播放| 日韩免费观看2025年上映的电影| 欧美一级精品大片| 欧美大度的电影原声| 久久久久久一二三区| 久久综合av免费| 中文字幕一区二区视频| 亚洲欧美一区二区视频| 伊人色综合久久天天人手人婷| 亚洲成人精品在线观看| 日韩av二区在线播放| 韩国欧美国产一区| 岛国一区二区在线观看| 欧美视频你懂的| 91精品欧美久久久久久动漫| 久久女同互慰一区二区三区| 国产人成亚洲第一网站在线播放| 亚洲男同性视频| 麻豆国产精品一区二区三区 | 成人美女视频在线观看18| 色呦呦网站一区| 精品国产污网站| 亚洲欧美日韩系列| 久久不见久久见免费视频7| 成人黄动漫网站免费app| 欧美精品vⅰdeose4hd| 久久精品一区二区三区av| 一区二区三区在线观看网站| 久久国产精品99久久久久久老狼| 成人av在线一区二区| 日韩一区二区三免费高清| 亚洲欧美日韩成人高清在线一区| 日韩二区在线观看| 97久久精品人人爽人人爽蜜臀| 欧美一区二区大片| 亚洲日穴在线视频| 国产成人综合精品三级| 日韩一本二本av| 午夜av一区二区| 欧美色精品天天在线观看视频| 国产午夜亚洲精品不卡| 久久精品理论片| 欧美喷水一区二区| 亚洲欧美经典视频| 91麻豆国产福利在线观看| 国产欧美视频一区二区| 久久国产三级精品| 精品免费国产二区三区| 日韩va欧美va亚洲va久久| 欧美日韩国产在线播放网站| 亚洲精品第1页| 在线日韩一区二区| 亚洲免费观看在线观看| 欧美影院午夜播放| 亚洲不卡av一区二区三区| 在线播放日韩导航| 青青草原综合久久大伊人精品| 欧美日韩在线播放一区| 亚洲电影中文字幕在线观看| 欧美自拍丝袜亚洲| 午夜精品久久久久久| 日韩欧美精品在线视频| 国产一区二区三区最好精华液| 久久免费美女视频| 丁香天五香天堂综合| 中文字幕制服丝袜成人av| 色婷婷激情综合| 丝袜亚洲另类欧美综合| 精品精品国产高清一毛片一天堂| 国产一区二区三区精品视频| 亚洲色图都市小说| 91麻豆精品国产综合久久久久久| 美洲天堂一区二卡三卡四卡视频| 久久综合久色欧美综合狠狠| www.亚洲色图.com| 日韩av不卡在线观看| 337p粉嫩大胆色噜噜噜噜亚洲| 国产成人在线视频免费播放| 亚洲精品视频免费看| 欧美一区二区在线看| 成人免费视频一区二区| 亚洲成a人片综合在线| 国产亚洲精久久久久久| 欧美男同性恋视频网站| 福利电影一区二区三区| 婷婷成人激情在线网| 国产精品国产精品国产专区不片| 91精品国产综合久久福利| 97精品久久久午夜一区二区三区| 日韩**一区毛片| 尤物在线观看一区| 国产亚洲一区二区三区四区| 4438成人网| 欧美日韩国产在线观看| 91高清在线观看| 99国产精品久| 成人av免费在线观看| 国产一区二区在线看|