USING THE IJG JPEG LIBRARY
Copyright (C) 1994-2009, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file.
This file describes how to use the IJG JPEG library within an application
program. Read it if you want to write a program that uses the library.
The file example.c provides heavily commented skeleton code for calling the
JPEG library. Also see jpeglib.h (the include file to be used by application
programs) for full details about data structures and function parameter lists.
The library source code, of course, is the ultimate reference.
Note that there have been *major* changes from the application interface
presented by IJG version 4 and earlier versions. The old design had several
inherent limitations, and it had accumulated a lot of cruft as we added
features while trying to minimize application-interface changes. We have
sacrificed backward compatibility in the version 5 rewrite, but we think the
improvements justify this.
TABLE OF CONTENTS
-----------------
Overview:
Functions provided by the library
Outline of typical usage
Basic library usage:
Data formats
Compression details
Decompression details
Mechanics of usage: include files, linking, etc
Advanced features:
Compression parameter selection
Decompression parameter selection
Special color spaces
Error handling
Compressed data handling (source and destination managers)
I/O suspension
Progressive JPEG support
Buffered-image mode
Abbreviated datastreams and multiple images
Special markers
Raw (downsampled) image data
Really raw data: DCT coefficients
Progress monitoring
Memory management
Memory usage
Library compile-time options
Portability considerations
Notes for MS-DOS implementors
You should read at least the overview and basic usage sections before trying
to program with the library. The sections on advanced features can be read
if and when you need them.
OVERVIEW
========
Functions provided by the library
---------------------------------
The IJG JPEG library provides C code to read and write JPEG-compressed image
files. The surrounding application program receives or supplies image data a
scanline at a time, using a straightforward uncompressed image format. All
details of color conversion and other preprocessing/postprocessing can be
handled by the library.
The library includes a substantial amount of code that is not covered by the
JPEG standard but is necessary for typical applications of JPEG. These
functions preprocess the image before JPEG compression or postprocess it after
decompression. They include colorspace conversion, downsampling/upsampling,
and color quantization. The application indirectly selects use of this code
by specifying the format in which it wishes to supply or receive image data.
For example, if colormapped output is requested, then the decompression
library automatically invokes color quantization.
A wide range of quality vs. speed tradeoffs are possible in JPEG processing,
and even more so in decompression postprocessing. The decompression library
provides multiple implementations that cover most of the useful tradeoffs,
ranging from very-high-quality down to fast-preview operation. On the
compression side we have generally not provided low-quality choices, since
compression is normally less time-critical. It should be understood that the
low-quality modes may not meet the JPEG standard's accuracy requirements;
nonetheless, they are useful for viewers.
A word about functions *not* provided by the library. We handle a subset of
the ISO JPEG standard; most baseline, extended-sequential, and progressive
JPEG processes are supported. (Our subset includes all features now in common
use.) Unsupported ISO options include:
* Hierarchical storage
* Lossless JPEG
* DNL marker
* Nonintegral subsampling ratios
We support both 8- and 12-bit data precision, but this is a compile-time
choice rather than a run-time choice; hence it is difficult to use both
precisions in a single application.
By itself, the library handles only interchange JPEG datastreams --- in
particular the widely used JFIF file format. The library can be used by
surrounding code to process interchange or abbreviated JPEG datastreams that
are embedded in more complex file formats. (For example, this library is
used by the free LIBTIFF library to support JPEG compression in TIFF.)
Outline of typical usage
------------------------
The rough outline of a JPEG compression operation is:
Allocate and initialize a JPEG compression object
Specify the destination for the compressed data (eg, a file)
Set parameters for compression, including image size & colorspace
jpeg_start_compress(...);
while (scan lines remain to be written)
jpeg_write_scanlines(...);
jpeg_finish_compress(...);
Release the JPEG compression object
A JPEG compression object holds parameters and working state for the JPEG
library. We make creation/destruction of the object separate from starting
or finishing compression of an image; the same object can be re-used for a
series of image compression operations. This makes it easy to re-use the
same parameter settings for a sequence of images. Re-use of a JPEG object
also has important implications for processing abbreviated JPEG datastreams,
as discussed later.
The image data to be compressed is supplied to jpeg_write_scanlines() from
in-memory buffers. If the application is doing file-to-file compression,
reading image data from the source file is the application's responsibility.
The library emits compressed data by calling a "data destination manager",
which typically will write the data into a file; but the application can
provide its own destination manager to do something else.
Similarly, the rough outline of a JPEG decompression operation is:
Allocate and initialize a JPEG decompression object
Specify the source of the compressed data (eg, a file)
Call jpeg_read_header() to obtain image info
Set parameters for decompression
jpeg_start_decompress(...);
while (scan lines remain to be read)
jpeg_read_scanlines(...);
jpeg_finish_decompress(...);
Release the JPEG decompression object
This is comparable to the compression outline except that reading the
datastream header is a separate step. This is helpful because information
about the image's size, colorspace, etc is available when the application
selects decompression parameters. For example, the application can choose an
output scaling ratio that will fit the image into the available screen size.
The decompression library obtains compressed data by calling a data source
manager, which typically will read the data from a file; but other behaviors
can be obtained with a custom source manager. Decompressed data is delivered
into in-memory buffers passed to jpeg_read_scanlines().
It is possible to abort an incomplete compression or decompression operation
by calling jpeg_abort(); or, if you do not need to retain the JPEG object,
simply release it by calling jpeg_destroy().
JPEG compression and decompression objects are two separate struct types.
However, they share some common fields, and certain routines such as
jpeg_destroy() can work on either type of object.
The JPEG library has no static variables: all state is in the compression
or decompression object. Therefore it is possible to process multiple
compression and decompression operations concurrently, using multiple JPEG
objects.
Both compression and decompression can be done in an incremental memory-to-
memory fashion, if suitable source/destination managers are used. See the
section on "I/O suspension" for more details.
BASIC LIBRARY USAGE
===================
Data formats
------------
Before diving into procedural details, it is helpful to understand the
image data format that the JPEG library expects or returns.
The standard input image format is a rectangular array
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
开源 pdf 阅读器 android 版本源码。SVN下来的项目无法直接跑,我处理了一下,可直接用eclipse加载。供参考吧! 网址:http://code.google.com/p/vudroid/ 功能:pdf阅读、双指放缩 性能:加载很慢、慢也就罢了,拖动后又会重新加载@_@ 结论:最基本的可用,但如果想改造为产品,需要很大的优化工作
资源推荐
资源详情
资源评论
收起资源包目录
vudroid android pdf 阅读器源码 (2000个子文件)
cjpeg.1 11KB
jpegtran.1 9KB
djpeg.1 7KB
wrjpgcom.1 3KB
rdjpgcom.1 2KB
ansi2knr.1 1KB
78-EUC-H 15KB
78-EUC-V 3KB
78-H 14KB
78-RKSJ-H 15KB
78-RKSJ-V 3KB
78-V 3KB
78ms-RKSJ-H 16KB
78ms-RKSJ-V 4KB
83pv-RKSJ-H 7KB
90ms-RKSJ-H 6KB
90ms-RKSJ-V 4KB
90msp-RKSJ-H 6KB
90msp-RKSJ-V 4KB
90pv-RKSJ-H 8KB
90pv-RKSJ-V 4KB
configure.ac 17KB
configure.ac 11KB
Add-H 15KB
Add-RKSJ-H 15KB
Add-RKSJ-V 4KB
Add-V 4KB
Adobe-CNS1-0 4KB
Adobe-CNS1-1 4KB
Adobe-CNS1-2 4KB
Adobe-CNS1-3 4KB
Adobe-CNS1-4 4KB
Adobe-CNS1-5 4KB
Adobe-CNS1-6 4KB
Adobe-CNS1-UCS2 259KB
Adobe-GB1-0 3KB
Adobe-GB1-1 3KB
Adobe-GB1-2 4KB
Adobe-GB1-3 4KB
Adobe-GB1-4 5KB
Adobe-GB1-5 5KB
Adobe-GB1-UCS2 226KB
Adobe-Japan1-0 3KB
Adobe-Japan1-1 3KB
Adobe-Japan1-2 3KB
Adobe-Japan1-3 3KB
Adobe-Japan1-4 4KB
Adobe-Japan1-5 4KB
Adobe-Japan1-6 4KB
Adobe-Japan1-UCS2 277KB
Adobe-Japan2-0 3KB
Adobe-Korea1-0 3KB
Adobe-Korea1-1 4KB
Adobe-Korea1-2 4KB
Adobe-Korea1-UCS2 143KB
Makefile.am 5KB
makefile.ansi 12KB
INSTALL.ANY 6KB
resources.ap_ 45KB
MainBrowserActivity.apk 1.34MB
jmemdosa.asm 8KB
deflinejoiner.awk 4KB
B5-H 7KB
B5-V 3KB
B5pc-H 7KB
B5pc-V 3KB
makefile.bcc 14KB
jconfig.bcc 1KB
testimg.bmp 34KB
font_cjk.c 14.88MB
cmap_tounicode.c 3.08MB
cmap_gb.c 2.39MB
cmap_cns.c 2.2MB
cmap_japan.c 1.96MB
font_mono.c 1.19MB
cmap_korea.c 1.15MB
font_serif.c 1.04MB
font_sans.c 822KB
font_misc.c 512KB
ttinterp.c 251KB
jidctint.c 178KB
jfdctint.c 155KB
pdf_fontagl.c 130KB
ftobjs.c 120KB
ftraster.c 115KB
ttcmap.c 104KB
cffgload.c 87KB
bdflib.c 69KB
t1load.c 68KB
aflatin2.c 68KB
ttgload.c 67KB
aflatin.c 65KB
pshalgo.c 60KB
ftgrays.c 58KB
transupp.c 55KB
ttgxvar.c 55KB
gxvcommn.c 54KB
ttsbit.c 53KB
ftstroke.c 52KB
t1decode.c 48KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- wangqi10534037152015-09-30资源写的很全面,类似于基于一个基本的android文件管理器的写法,里面嵌入了打开pdf文档的方式,加载插件,读取pdf文件展现出来,很值得参考和学习。
- F-daemon2016-03-17价值1000块
- jayhong5952014-05-12这个资源听说很强大,但是为什么我的Mr.Zipper打不开呢? 其他PDFViewer也有参考这个资源的一些内容,看来这个资源真的很赞啊!
- admainer2014-08-22刚好满足需求,貌似很强大的样子,研究下先
土豆湿
- 粉丝: 95
- 资源: 66
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功