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

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

?? libjpeg.txt

?? 基于周立功EasyArm2200的LPC2292平臺驅動ili9325TFT屏控制器
?? TXT
?? 第 1 頁 / 共 5 頁
字號:
A JPEG compression object is a "struct jpeg_compress_struct".  (It also has
a bunch of subsidiary structures which are allocated via malloc(), but the
application doesn't control those directly.)  This struct can be just a local
variable in the calling routine, if a single routine is going to execute the
whole JPEG compression sequence.  Otherwise it can be static or allocated
from malloc().

You will also need a structure representing a JPEG error handler.  The part
of this that the library cares about is a "struct jpeg_error_mgr".  If you
are providing your own error handler, you'll typically want to embed the
jpeg_error_mgr struct in a larger structure; this is discussed later under
"Error handling".  For now we'll assume you are just using the default error
handler.  The default error handler will print JPEG error/warning messages
on stderr, and it will call exit() if a fatal error occurs.

You must initialize the error handler structure, store a pointer to it into
the JPEG object's "err" field, and then call jpeg_create_compress() to
initialize the rest of the JPEG object.

Typical code for this step, if you are using the default error handler, is

	struct jpeg_compress_struct cinfo;
	struct jpeg_error_mgr jerr;
	...
	cinfo.err = jpeg_std_error(&jerr);
	jpeg_create_compress(&cinfo);

jpeg_create_compress allocates a small amount of memory, so it could fail
if you are out of memory.  In that case it will exit via the error handler;
that's why the error handler must be initialized first.


2. Specify the destination for the compressed data (eg, a file).

As previously mentioned, the JPEG library delivers compressed data to a
"data destination" module.  The library includes one data destination
module which knows how to write to a stdio stream.  You can use your own
destination module if you want to do something else, as discussed later.

If you use the standard destination module, you must open the target stdio
stream beforehand.  Typical code for this step looks like:

	FILE * outfile;
	...
	if ((outfile = fopen(filename, "wb")) == NULL) {
	    fprintf(stderr, "can't open %s\n", filename);
	    exit(1);
	}
	jpeg_stdio_dest(&cinfo, outfile);

where the last line invokes the standard destination module.

WARNING: it is critical that the binary compressed data be delivered to the
output file unchanged.  On non-Unix systems the stdio library may perform
newline translation or otherwise corrupt binary data.  To suppress this
behavior, you may need to use a "b" option to fopen (as shown above), or use
setmode() or another routine to put the stdio stream in binary mode.  See
cjpeg.c and djpeg.c for code that has been found to work on many systems.

You can select the data destination after setting other parameters (step 3),
if that's more convenient.  You may not change the destination between
calling jpeg_start_compress() and jpeg_finish_compress().


3. Set parameters for compression, including image size & colorspace.

You must supply information about the source image by setting the following
fields in the JPEG object (cinfo structure):

	image_width		Width of image, in pixels
	image_height		Height of image, in pixels
	input_components	Number of color channels (samples per pixel)
	in_color_space		Color space of source image

The image dimensions are, hopefully, obvious.  JPEG supports image dimensions
of 1 to 64K pixels in either direction.  The input color space is typically
RGB or grayscale, and input_components is 3 or 1 accordingly.  (See "Special
color spaces", later, for more info.)  The in_color_space field must be
assigned one of the J_COLOR_SPACE enum constants, typically JCS_RGB or
JCS_GRAYSCALE.

JPEG has a large number of compression parameters that determine how the
image is encoded.  Most applications don't need or want to know about all
these parameters.  You can set all the parameters to reasonable defaults by
calling jpeg_set_defaults(); then, if there are particular values you want
to change, you can do so after that.  The "Compression parameter selection"
section tells about all the parameters.

You must set in_color_space correctly before calling jpeg_set_defaults(),
because the defaults depend on the source image colorspace.  However the
other three source image parameters need not be valid until you call
jpeg_start_compress().  There's no harm in calling jpeg_set_defaults() more
than once, if that happens to be convenient.

Typical code for a 24-bit RGB source image is

	cinfo.image_width = Width; 	/* image width and height, in pixels */
	cinfo.image_height = Height;
	cinfo.input_components = 3;	/* # of color components per pixel */
	cinfo.in_color_space = JCS_RGB; /* colorspace of input image */

	jpeg_set_defaults(&cinfo);
	/* Make optional parameter settings here */


4. jpeg_start_compress(...);

After you have established the data destination and set all the necessary
source image info and other parameters, call jpeg_start_compress() to begin
a compression cycle.  This will initialize internal state, allocate working
storage, and emit the first few bytes of the JPEG datastream header.

Typical code:

	jpeg_start_compress(&cinfo, TRUE);

The "TRUE" parameter ensures that a complete JPEG interchange datastream
will be written.  This is appropriate in most cases.  If you think you might
want to use an abbreviated datastream, read the section on abbreviated
datastreams, below.

Once you have called jpeg_start_compress(), you may not alter any JPEG
parameters or other fields of the JPEG object until you have completed
the compression cycle.


5. while (scan lines remain to be written)
	jpeg_write_scanlines(...);

Now write all the required image data by calling jpeg_write_scanlines()
one or more times.  You can pass one or more scanlines in each call, up
to the total image height.  In most applications it is convenient to pass
just one or a few scanlines at a time.  The expected format for the passed
data is discussed under "Data formats", above.

Image data should be written in top-to-bottom scanline order.  The JPEG spec
contains some weasel wording about how top and bottom are application-defined
terms (a curious interpretation of the English language...) but if you want
your files to be compatible with everyone else's, you WILL use top-to-bottom
order.  If the source data must be read in bottom-to-top order, you can use
the JPEG library's virtual array mechanism to invert the data efficiently.
Examples of this can be found in the sample application cjpeg.

The library maintains a count of the number of scanlines written so far
in the next_scanline field of the JPEG object.  Usually you can just use
this variable as the loop counter, so that the loop test looks like
"while (cinfo.next_scanline < cinfo.image_height)".

Code for this step depends heavily on the way that you store the source data.
example.c shows the following code for the case of a full-size 2-D source
array containing 3-byte RGB pixels:

	JSAMPROW row_pointer[1];	/* pointer to a single row */
	int row_stride;			/* physical row width in buffer */

	row_stride = image_width * 3;	/* JSAMPLEs per row in image_buffer */

	while (cinfo.next_scanline < cinfo.image_height) {
	    row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
	    jpeg_write_scanlines(&cinfo, row_pointer, 1);
	}

jpeg_write_scanlines() returns the number of scanlines actually written.
This will normally be equal to the number passed in, so you can usually
ignore the return value.  It is different in just two cases:
  * If you try to write more scanlines than the declared image height,
    the additional scanlines are ignored.
  * If you use a suspending data destination manager, output buffer overrun
    will cause the compressor to return before accepting all the passed lines.
    This feature is discussed under "I/O suspension", below.  The normal
    stdio destination manager will NOT cause this to happen.
In any case, the return value is the same as the change in the value of
next_scanline.


6. jpeg_finish_compress(...);

After all the image data has been written, call jpeg_finish_compress() to
complete the compression cycle.  This step is ESSENTIAL to ensure that the
last bufferload of data is written to the data destination.
jpeg_finish_compress() also releases working memory associated with the JPEG
object.

Typical code:

	jpeg_finish_compress(&cinfo);

If using the stdio destination manager, don't forget to close the output
stdio stream (if necessary) afterwards.

If you have requested a multi-pass operating mode, such as Huffman code
optimization, jpeg_finish_compress() will perform the additional passes using
data buffered by the first pass.  In this case jpeg_finish_compress() may take
quite a while to complete.  With the default compression parameters, this will
not happen.

It is an error to call jpeg_finish_compress() before writing the necessary
total number of scanlines.  If you wish to abort compression, call
jpeg_abort() as discussed below.

After completing a compression cycle, you may dispose of the JPEG object
as discussed next, or you may use it to compress another image.  In that case
return to step 2, 3, or 4 as appropriate.  If you do not change the
destination manager, the new datastream will be written to the same target.
If you do not change any JPEG parameters, the new datastream will be written
with the same parameters as before.  Note that you can change the input image
dimensions freely between cycles, but if you change the input colorspace, you
should call jpeg_set_defaults() to adjust for the new colorspace; and then
you'll need to repeat all of step 3.


7. Release the JPEG compression object.

When you are done with a JPEG compression object, destroy it by calling
jpeg_destroy_compress().  This will free all subsidiary memory (regardless of
the previous state of the object).  Or you can call jpeg_destroy(), which
works for either compression or decompression objects --- this may be more
convenient if you are sharing code between compression and decompression
cases.  (Actually, these routines are equivalent except for the declared type
of the passed pointer.  To avoid gripes from ANSI C compilers, jpeg_destroy()
should be passed a j_common_ptr.)

If you allocated the jpeg_compress_struct structure from malloc(), freeing
it is your responsibility --- jpeg_destroy() won't.  Ditto for the error
handler structure.

Typical code:

	jpeg_destroy_compress(&cinfo);


8. Aborting.

If you decide to abort a compression cycle before finishing, you can clean up
in either of two ways:

* If you don't need the JPEG object any more, just call
  jpeg_destroy_compress() or jpeg_destroy() to release memory.  This is
  legitimate at any point after calling jpeg_create_compress() --- in fact,
  it's safe even if jpeg_create_compress() fails.

* If you want to re-use the JPEG object, call jpeg_abort_compress(), or call
  jpeg_abort() which works on both compression and decompression objects.
  This will return the object to an idle state, releasing any working memory.
  jpeg_abort() is allowed at any time after successful object creation.

Note that cleaning up the data destination, if required, is your
responsibility; neither of these routines will call term_destination().
(See "Compressed data handling", below, for more about that.)

jpeg_destroy() and jpeg_abort() are the only safe calls to make on a JPEG
object that has reported an error by calling error_exit (see "Error handling"
for more info).  The internal state of such an object is likely to be out of
whack.  Either of these two routines will return the object to a known state.


Decompression details
---------------------

Here we revisit the JPEG decompression outline given in the overview.

1. Allocate and initialize a JPEG decompression object.

This is just like initialization for compression, as discussed above,
except that the object is a "struct jpeg_decompress_struct" and you
call jpeg_create_decompress().  Error handling is exactly the same.

Typical code:

	struct jpeg_decompress_struct cinfo;
	struct jpeg_error_mgr jerr;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一二三区精品| 99久久亚洲一区二区三区青草| 精品综合免费视频观看| 国产精一区二区三区| 91婷婷韩国欧美一区二区| 欧美精品久久一区二区三区| 久久久久久99久久久精品网站| 亚洲欧美一区二区三区久本道91 | 欧美日韩极品在线观看一区| 精品99999| 亚洲一区在线视频| 国产麻豆视频一区二区| 日本高清不卡在线观看| 精品国产伦一区二区三区免费| 亚洲欧美日韩国产综合| 美女www一区二区| 91毛片在线观看| 精品久久人人做人人爰| 亚洲一区二区中文在线| 国产iv一区二区三区| 欧美人牲a欧美精品| 亚洲国产精品传媒在线观看| 日韩av中文字幕一区二区| 北岛玲一区二区三区四区| 欧美男男青年gay1069videost| 国产日韩影视精品| 免费视频最近日韩| 日本高清无吗v一区| 精品久久免费看| 视频一区中文字幕国产| aaa欧美大片| 久久无码av三级| 日本色综合中文字幕| 91黄色在线观看| 国产精品毛片无遮挡高清| 久久超碰97人人做人人爱| 欧美日韩美少妇| 亚洲欧美偷拍卡通变态| 国产成人亚洲精品狼色在线| 日韩美女视频一区二区在线观看| 亚洲韩国一区二区三区| 91老司机福利 在线| 国产农村妇女毛片精品久久麻豆 | 精品不卡在线视频| 日韩国产一区二| 欧美在线999| 自拍偷拍欧美精品| 成人毛片视频在线观看| 精品久久久久久久久久久久久久久久久| 亚洲国产综合91精品麻豆| 91麻豆免费看| 中文字幕综合网| 99精品视频在线观看| 国产精品美日韩| 丁香六月综合激情| 久久久精品国产免费观看同学| 另类小说一区二区三区| 欧美精品高清视频| 无码av中文一区二区三区桃花岛| 91高清视频在线| 一区二区三区精品在线观看| 91精品福利在线| 一区二区三区四区亚洲| 色婷婷亚洲综合| 亚洲欧美一区二区不卡| 在线欧美日韩国产| 亚洲一区二区三区四区在线| 欧美影院一区二区三区| 亚洲午夜av在线| 欧美精品第一页| 热久久国产精品| 日韩精品一区二区在线| 韩日欧美一区二区三区| 久久尤物电影视频在线观看| 国产一区二区三区久久久| 国产视频一区在线播放| 福利一区二区在线观看| 国产精品嫩草99a| 91在线视频在线| 亚洲成人自拍偷拍| 欧美一区二区三区影视| 国产中文字幕一区| 国产亚洲短视频| 91香蕉视频黄| 亚洲第一激情av| 欧美一区二区成人| 国产一区二区电影| 中文字幕一区av| 欧美网站大全在线观看| 人人超碰91尤物精品国产| 2023国产精品| 不卡av在线免费观看| 亚洲尤物视频在线| 日韩一区二区视频在线观看| 国产精品一区二区在线观看网站| 国产精品传媒入口麻豆| 在线观看av一区| 免费成人在线视频观看| 欧美精品一区二区三区高清aⅴ| 国产suv一区二区三区88区| 亚洲精品第一国产综合野| 日韩一区二区三区四区 | 国产欧美综合在线| 色综合天天综合在线视频| 午夜视频在线观看一区| 久久久精品蜜桃| 在线国产亚洲欧美| 韩国av一区二区三区四区| 成人欧美一区二区三区视频网页| 欧美日韩久久久一区| 国产精品亚洲一区二区三区在线 | 欧美手机在线视频| 精品无码三级在线观看视频| 中文字幕在线不卡| 日韩一区二区电影| 成人小视频在线| 午夜电影一区二区三区| 久久精品无码一区二区三区| 在线日韩一区二区| 国产精品69久久久久水密桃| 亚洲高清免费观看高清完整版在线观看| 精品免费视频.| 色偷偷久久人人79超碰人人澡| 欧美aaaaa成人免费观看视频| 中文字幕一区二区三区在线不卡| 欧美一区二区三区在线电影| 91视视频在线观看入口直接观看www | 国产高清一区日本| 午夜精品一区在线观看| 欧美国产精品中文字幕| 91精品啪在线观看国产60岁| 成人丝袜视频网| 肉色丝袜一区二区| 一区二区中文视频| 欧美精品一区视频| 欧美在线影院一区二区| 国产成人在线色| 琪琪久久久久日韩精品| 亚洲欧美乱综合| 日本一区二区三区在线观看| 欧美一区在线视频| 色综合久久88色综合天天免费| 激情综合色丁香一区二区| 亚洲一区二区三区视频在线播放| 中文字幕精品一区二区精品绿巨人| 欧美二区在线观看| 一本久久a久久精品亚洲| 国产成人免费9x9x人网站视频| 人妖欧美一区二区| 亚洲一区二区三区不卡国产欧美 | 色综合久久88色综合天天免费| 国产乱一区二区| 卡一卡二国产精品| 亚洲成人免费视频| 中文字幕综合网| 国产精品国产三级国产专播品爱网 | 亚洲一二三区在线观看| 国产精品国产三级国产a| 久久久午夜电影| 精品国产一二三区| 日韩西西人体444www| 欧美日韩一区二区三区四区| 91论坛在线播放| 99久久婷婷国产综合精品| 国产成a人无v码亚洲福利| 经典三级视频一区| 狠狠色综合色综合网络| 日本v片在线高清不卡在线观看| 亚洲国产欧美在线| 亚洲一二三级电影| 亚洲成人福利片| 亚洲超碰97人人做人人爱| 亚洲二区在线观看| 亚洲成a人在线观看| 亚洲综合激情小说| 亚洲一区二区黄色| 亚洲国产日韩精品| 亚洲国产你懂的| 亚洲一区视频在线观看视频| 亚洲国产一区二区三区| 亚洲午夜久久久久久久久久久| 亚洲一区二区欧美| 天天色综合天天| 蜜臀久久99精品久久久久宅男| 美国十次了思思久久精品导航| 麻豆一区二区三| 黄色成人免费在线| 国产 日韩 欧美大片| 成人sese在线| 91麻豆免费视频| 欧美视频日韩视频| 欧美电影一区二区| 日韩亚洲欧美综合| 久久一区二区三区国产精品| 久久精品夜色噜噜亚洲a∨| 亚洲国产成人在线| 亚洲欧美日韩国产手机在线| 亚洲二区视频在线| 九色porny丨国产精品| 国产成人av在线影院|