Notes on the JPEG Library
=========================
This JPEG module is derived from work of the IJG (see below),
and may be copyied and redistributed according to the
conditions under LEGAL ISSUES in ReadMe.txt.
The code has been modified in a variety of ways;
some code (GUI_JPEG.c) has been added to as "glue" to make it
work with emWin.
The original text of this file is below; some things stated may no
longer be correct for the code that ships with emWin.
However, we decided to leave it here because it explains the basic
concepts and structure of JPEG code.
Segger Microcontroller Systeme GmbH, June 2003
====================================================================
USING THE IJG JPEG LIBRARY
Copyright (C) 1994-1998, Thomas G. Lane.
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
* Arithmetic entropy coding (unsupported for legal reasons)
* 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 relea
没有合适的资源?快使用搜索试试~ 我知道了~
STM32F103单片机开发例程-ucos+ucgui控制 LED代码(2.4寸、2.8寸、3.2寸芯片ILI9325横竖屏)
共1836个文件
c:1564个
h:222个
s:18个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 177 浏览量
2024-03-18
21:48:27
上传
评论
收藏 3.64MB RAR 举报
温馨提示
1、嵌入式物联网单片机项目开发实战。例程经过精心编写,简单好用。 2、代码使用KEIL 标准库开发,当前在STM32F103运行,如果是STM32F103其他型号芯片,依然适用,请自行更改KEIL芯片型号以及FLASH容量即可。 3、软件下载时,请注意keil选择项是jlink还是stlink。 4、技术v:349014857; 5、如果接入其他传感器,请查看发布的其他资料。 6、单片机与模块的接线,在代码当中均有定义,请自行对照。 7、若硬件差异,请根据自身情况适当调整代码,程序仅供参考。
资源推荐
资源详情
资源评论
收起资源包目录
STM32F103单片机开发例程-ucos+ucgui控制 LED代码(2.4寸、2.8寸、3.2寸芯片ILI9325横竖屏) (1836个子文件)
os_cpu_a._ia 145B
os_cpu_a._ia 145B
os_cpu_a.asm 7KB
os_cpu_a.asm 7KB
重置KEIL编译.bat 440B
重置KEIL编译.bat 440B
testimg.bmp 34KB
testimg.bmp 34KB
LCDLin.c 162KB
LCDLin.c 162KB
stm32f10x_tim.c 107KB
stm32f10x_tim.c 107KB
LCDLin32.c 96KB
LCDLin32.c 96KB
FD60x80.c 93KB
FD60x80.c 93KB
F32B_1.c 91KB
F32B_1.c 91KB
F32B_ASCII.c 89KB
F32B_ASCII.c 89KB
F32_1.c 87KB
F32_1.c 87KB
os_core.c 86KB
os_core.c 86KB
FD80.c 85KB
FD80.c 85KB
F32_ASCII.c 83KB
F32_ASCII.c 83KB
F16_HK.c 82KB
F16_HK.c 82KB
FComic24B_1.c 66KB
FComic24B_1.c 66KB
FComic24B_ASCII.c 63KB
FComic24B_ASCII.c 63KB
MULTIEDIT.c 63KB
MULTIEDIT.c 63KB
stm32f10x_flash.c 61KB
stm32f10x_flash.c 61KB
F24B_1.c 61KB
F24B_1.c 61KB
F24_1.c 60KB
F24_1.c 60KB
F24B_ASCII.c 60KB
F24B_ASCII.c 60KB
F24_ASCII.c 59KB
F24_ASCII.c 59KB
FD48x64.c 58KB
FD48x64.c 58KB
WM.c 57KB
WM.c 57KB
os_task.c 56KB
os_task.c 56KB
os_flag.c 55KB
os_flag.c 55KB
F8x16.c 54KB
F8x16.c 54KB
FD64.c 54KB
FD64.c 54KB
stm32f10x_rcc.c 50KB
stm32f10x_rcc.c 50KB
F16_1.c 49KB
F16_1.c 49KB
jquant2.c 49KB
jquant2.c 49KB
FComic18B_ASCII.c 47KB
FComic18B_ASCII.c 47KB
stm32f10x_adc.c 46KB
stm32f10x_adc.c 46KB
FComic18B_1.c 46KB
FComic18B_1.c 46KB
stm32f10x_i2c.c 45KB
stm32f10x_i2c.c 45KB
stm32f10x_can.c 44KB
stm32f10x_can.c 44KB
os_tmr.c 44KB
os_tmr.c 44KB
MENU.c 43KB
MENU.c 43KB
os_q.c 42KB
os_q.c 42KB
jdmarker.c 41KB
jdmarker.c 41KB
jmemmgr.c 41KB
jmemmgr.c 41KB
FD36x48.c 38KB
FD36x48.c 38KB
F16B_1.c 38KB
F16B_1.c 38KB
F16B_ASCII.c 38KB
F16B_ASCII.c 38KB
stm32f10x_usart.c 37KB
stm32f10x_usart.c 37KB
os_mutex.c 37KB
os_mutex.c 37KB
F16_ASCII.c 37KB
F16_ASCII.c 37KB
FD48.c 36KB
FD48.c 36KB
LISTBOX.c 36KB
LISTBOX.c 36KB
共 1836 条
- 1
- 2
- 3
- 4
- 5
- 6
- 19
资源评论
物联技术666
- 粉丝: 2825
- 资源: 839
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功