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

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

?? jpeg.htm

?? C++builder學習資料C++builder
?? HTM
?? 第 1 頁 / 共 2 頁
字號:


<HTML>

<HEAD>

   <TITLE> Compiling the IJG JPEG library with BC55</TITLE>

   <META NAME="Author" CONTENT="Harold Howe">

</HEAD>

<BODY>



<CENTER>

<TABLE  BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="640">

<TR>



<TD>









<H2>

Compiling the IJG JPEG library with BC55

</H2>



<P>

The Independent JPEG Group (IJG) provides a free and open source code library for

compressing and decompressing JPEG images. The library is written in C, and is

designed to be portable between many compilers and platforms.

</P>

<P>

The IJG library is designed to be compiled from the command line with make. The

library includes several makefiles for various compilers and platforms, although

it does not provide a makefile for BC55, the free C++ command line compiler

from Borland. The purpose of this article is to provide a makefile that will

work with BC55, to list what changes have to be made in order to compile the

JPEG source code, and to provide an example program that shows how to link with

the JPEG library once you have compiled it.

</P>

<P>

Before you get started with the IJG JPEG library, you need to download the 

source. You can download the IJG library from <a HREF="download/jpegsr6.zip">here.</a> 

Extract the contents of the zip file to a convenient location, such as <TT>c:\jpeg</TT>. 

</P> 

 

<P> 

<TABLE WIDTH="75%"> 

<TR> 

<TD VALIGN="top"> 

<IMG SRC="images/exclamation.gif" ALT="Note" BORDER=0 HSPACE="0" ALIGN="top" width="32" height="48"> 

</TD> 

<TD valign="top"> 

<b>Note:</b> 

<hr size = 1> 

<P> 

If you use C++Builder, and if you use the pascal based VCL, then I suggest that you rely on the <TT>TJPEGImage</TT> class to handle 

JPEG images in your programs. It is easier to use than working with the JPEG library directly. <TT>TJPEGImage</TT> is actually a wrapper 

for the free IJG JPEG library. See the faq on <a HREF="faq89.htm">JPEG images</a> for an example of how to use 

<TT>TJPEGImage</TT>. 

</P> 

<P> 

On the other hand, you should use the IJG JPEG library if you are using the free 

command line compiler from Borland instead of using C++Builder. You might also 

want to use the IJG library if you are writing a pure C/C++ app, or if you need 

the added flexibility that the IJG library affords. 

</P> 

<hr size = 1> 

</TD> 

</TR> 

</TABLE> 

<UL> 

<LI><A HREF="#introduction"  >Introduction to the IJG library</A> 

<LI><A HREF="#makefile"      >The JPEG library makefile</A> 

<LI><A HREF="#code"          >Changing the IJG source code so it will compile with BC55</A> 

<LI><A HREF="#build"         >Compiling the JPEG library</A> 

<LI><A HREF="#example"       >Using the compiled JPEG library in a project</A> 

<LI><A HREF="#notes"         >Notes</A> 

<LI><A HREF="#downloads"     >Downloads</A> 

</UL> 

<BR> 

<H3> 

<A NAME="introduction">Introduction to the IJG library</A> 

</H3> 

<P> 

When you unzip the JPEG library, you should see a host of C files, header files, sample makefiles, and some DOC files. Before you attempt 

to use the library, you should browse through the DOC files, especially <TT>libjpeg.doc</TT>. These DOC files explain how the JPEG library 

is structured, and how you perform a compression or decompression step. I am not going to cover how the library works, 

because the DOC files already explain that, and they explain it better than I could. Instead, I am going to discuss how to compile the 

library, and specifically, how to compile the library with BC55. For more information on JPEG compression principles, visit the following 

FAQs and websites: 

</P> 

<UL> 

<LI><A HREF="http://www.faqs.org/faqs/jpeg-faq/">JPEG FAQ</A> 

<LI><A HREF="http://www.faqs.org/faqs/compression-faq/">comp.compression FAQ</A> 

<LI><A HREF="http://www.ijg.org/">IJG website</A> 

<LI><A HREF="http://www.borland.com/bcppbuilder/freecompiler/">Download the free BC55 compiler</A> 

</UL> 

<BR> 

<H3> 

<A NAME="makefile">The JPEG library makefile</A> 

</H3> 

<P> 

The JPEG library contains makefiles for several compilers and platforms. The makefiles are named using the format <TT>makefile.XXX</TT> 

where XXX is the platform that you are targeting. Some of the names include <TT>makefile.ansi</TT>, <TT>makefile.unix</TT>, 

<TT>makefile.vc</TT>, and <TT>makefile.bcc</TT>. Two of the more interesting ones are <TT>makefile.ansi</TT> and <TT>makefile.bcc</TT>. 

<TT>makefile.bcc</TT> works with older versions of Borland C++ for DOS and OS/2. Despite the fact that the makefile is for an older 

version of Borland C++, it still serves as a good starting ground for BC55. <TT>makefile.ansi</TT> is a generic makefile that serves as a 

good starting point for almost any platform. 

</P> 

<P> 

Using the older <TT>makefile.bcc</TT> as a starting point, I have created a makefile called <TT>makefile.bc55</TT> that works with the 

free BC55 C++ compiler from Borland. You can download the makefile <a HREF="download/bc55jpeg.zip">here</a>.

</P>

<P>

The makefile for the JPEG library does several things. It compiles the JPEG source code into a library called <TT>libjpeg.lib</TT> (or

<TT>libjpeg.a</TT> depending on your OS and compiler). The makefile also compiles a compression example and a decompression example.

These examples link with the JPEG library that was built from the source. Lastly, the makefile also contains targets for cleaning up

intermediate files and for running the example programs.

</P>

<P>

Let's take a quick look at some of these targets in the makefile:

</P>

<PRE>

all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe wrjpgcom.exe rdjpgcom.exe

libjpeg.lib: $(LIBOBJECTS)

cjpeg.exe: $(COBJECTS) $(JPEGLIB)

djpeg.exe: $(DOBJECTS) $(JPEGLIB)

jpegtran.exe: $(TROBJECTS) $(JPEGLIB)

rdjpgcom.exe: rdjpgcom.c

wrjpgcom.exe: wrjpgcom.c

jconfig.h: jconfig.doc jconfig.bc55

clean:

test: cjpeg.exe djpeg.exe jpegtran.exe

</pre>

<P>

The <TT>all</TT> target specifies what happens by default when you do a make. The default targets are the JPEG static library

(<TT>libjpeg.lib</TT>), the compression and decompression examples (<TT>cjpeg.exe</TT> and <TT>djpeg.exe</TT>), and the utility programs.

The <TT>clean</TT> target deletes intermediate files, such as OBJs, and the <TT>test</TT> target exercises <TT>cjpeg.exe</TT> and

<TT>djpeg.exe</TT>.

</p>

<P>

<TABLE WIDTH="75%">

<TR>

<TD VALIGN="top">

<IMG SRC="images/exclamation.gif" ALT="Note" BORDER=0 HSPACE="0" ALIGN="top" width="32" height="48">

</TD>

<TD valign="top">

<b>Note:</b>

<hr size = 1>

Beware that the clean target also deletes the LIB file and the sample EXEs. If you only want the clean

target to delete OBJs, then you will need to edit the makefile.

<hr size = 1>

</TD>

</TR>

</TABLE>



<P>

The <TT>jconfig.h</TT> target is an interesting item. <TT>jconfig.h</TT> is an important header file for the JPEG library. It determines

various platform specific issues. This header file helps the JPEG library achieve its cross platform status. To support various

platforms, the JPEG library provides several versions of <TT>jconfig.h</TT> (<TT>jconfig.mac</TT>, <TT>jconfig.vc</TT>,

<TT>jconfig.bcc</TT>, etc). The makefile actually determines which configuration to use by copying the correct <TT>jconfig.xxx</TT> file

to <TT>jconfig.h</TT>. In order to support BC55, we have to supply a BC55 friendly version of <TT>jconfig.h</TT>. We'll look at this in

the next step.

</p>

<P>

That's all I'm going to say about the JPEG library makefile for BC55. You may want to sift through the makefile that I provide, 

<a HREF="download/bc55jpeg.zip">makefile.bc55</a>, to learn more about how it works. 

</P> 

<BR> 

<H3> 

<A NAME="code">Changing the IJG source code so it will compile with BC55</A> 

</H3> 

For the most part, the JPEG source compiles fine with BC55. However, you do need to change two header files in order to compile the 

library cleanly. The two files are <TT>jpeglib.h</TT>, and <TT>jmorecfg.h</TT>. You also need to provide a BC55 friendly version of 

<TT>jconfig.h</TT>. You can download the modified files <a HREF="download/bc55jpeg.zip">here</a> 

(along with the makefile). 

<P> 

The changes to <TT>jpeglib.h</TT> and <TT>jmorecfg.h</TT> are listed below. If you don't understand what these changes are doing, don't 

worry about it. As long as you use the modified <a HREF="download/bc55jpeg.zip">header files</a> from my FTP site, 

you will be fine. 

</P> 

<pre>

<font color="navy">/******************* Changes to jpeglib.h **************************/</font>

<font color="green">#ifndef JPEGLIB_H</font>

<font color="green">#define JPEGLIB_H</font>



<font color="navy">/* HJH modification: added extern &quot;C&quot; { when __cplusplus detected */</font>

<font color="green">#ifdef __cplusplus</font>

<b>extern</b> <font color="blue">&quot;C&quot;</font> <b>{</b>

<font color="green">#endif</font>



<b>...</b>



<font color="navy">/* near bottom of the file */</font>

<font color="navy">/* HJH modification: add closing } for extern &quot;C&quot; {  */</font>

<font color="green">#ifdef __cplusplus</font>

<b>}</b>

<font color="green">#endif</font>



<font color="green">#endif <font color="navy">/* JPEGLIB_H */</font></font>





<font color="navy">/******************* Changes to jmorecfg.h **************************/</font>

<font color="navy">/* jmorecfg.h line 160 */</font>

<font color="navy">/* X11/xmd.h correctly defines INT32 */</font>

<font color="navy">/* HJH modification: jmorecfg.h already contained a test for XMD_H and xmd.h

   My change adds a test for _BASETSD_H_ because the windows header file

   basestd.h already defines INT32 */</font>

<font color="green">#if !defined(XMD_H) &amp;&amp; !defined(_BASETSD_H_)</font>

<b>typedef</b> <b>long</b> INT32<b>;</b>

<font color="green">#endif</font>



<font color="navy">/* jmorecfg.h line 220 */</font>

<font color="navy">/* HJH modification: several of the windows header files already define FAR

   because of this, the code below was changed so that it only tinkers with

   the FAR define if FAR is still undefined */</font>

<font color="green">#ifndef FAR</font>

  <font color="green">#ifdef NEED_FAR_POINTERS</font>

  <font color="green">#define FAR  far</font>

  <font color="green">#else</font>

  <font color="green">#define FAR</font>

  <font color="green">#endif</font>

<font color="green">#endif</font>

</pre> 

<P> 

The first change was to <TT>jpeglib.h</TT>. This is the main header file that client programs include in order 

to use the library. The change is to add an <TT>extern "C"</TT> wrapper around the entire header file. The reason for doing this is 

that the JPEG library is written in C, but you may want to use the library from a C++ file. Without the <TT>extern "C"</TT>, you might 

see unresolved external linker errors when trying to make JPEG calls from a C++ file. 

</P> 

<P> 

The second change is to <TT>jmorecfg.h</TT>. This header file plays a crucial role in making the JPEG library cross platform. I had to 

make two changes to <TT>jmorecfg.h</TT>, and both were because the Windows header files from Microsoft already declare a type or a define 

that <TT>jmorecfg.h</TT> also defines. My modifications prevent <TT>jmorecfg.h</TT> from clashing with the Microsoft headers. 

</P> 

<P> 

The last file that you have to modify is <TT>jconfig.h</TT>. Actually, you don't modify <TT>jconfig.h</TT>, rather, you provide a BC55 

compatible version of <TT>jconfig.h</TT> called <TT>jconfig.bc55</TT>. To create a BC55 compatible version of <TT>jconfig.h</TT>, I 

started with <TT>jconfig.bcc</TT>, which is tailored with Borland C++ for DOS in mind. This file works as is, except for the 

following addition that I had to make: 

</P> 

<pre>

<font color="navy">/* HJH Note: Here is one key addition that I had to make. The jpeg library uses

 *           a type called boolean. It defines boolean here. However, RPCNDR.H

 *           yet another Microsoft header, also defines boolean. The ifndef

 *           ensures that we don't attempt to redefine boolean if rpcndr.h has

 *           already defined it. Note that we use unsigned char instead of int

 *           like jmorecfg.h does, because we want to match what's in the SDK

 *           header. See jconfig.vc for more info, it does the same thing. */</font>

<font color="green">#ifndef __RPCNDR_H__		<font color="navy">/* don't conflict if rpcndr.h already read */</font></font>

<b>typedef</b> <b>unsigned</b> <b>char</b> boolean<b>;</b>

<font color="green">#endif</font>

<font color="green">#define HAVE_BOOLEAN		<font color="navy">/* prevent jmorecfg.h from redefining it */</font></font>

</pre> 

<P> 

The JPEG library defines and uses a type called <TT>boolean</TT>. The <TT>typedef</TT> occurs in <TT>jmorecfg.h</TT>. Unfortunately, one 

of the Microsoft headers, <TT>rpcndr.h</TT>,  also defines the <TT>boolean</TT> type. Furthermore, the Microsoft headers define 

<TT>boolean</TT> differently than the JPEG library defines it. My solution was to make sure that we define <TT>boolean</TT> the same way 

that the Microsoft header does, and we only define it if the Microsoft header has not already done so. Next, we define the 

<TT>HAVE_BOOLEAN</TT> constant, which tells <TT>jmorecfg.h</TT> not to define the <TT>boolean</TT> type. 

</P> 

<P> 

<TABLE WIDTH="75%"> 

<TR> 

<TD VALIGN="top"> 

<IMG SRC="images/exclamation.gif" ALT="Note" BORDER=0 HSPACE="0" ALIGN="top" width="32" height="48"> 

</TD> 

<TD valign="top"> 

<b>Note:</b> 

<hr size = 1> 

<P> 

I discovered this issue regarding <TT>rpcndr.h</TT> and <TT>boolean</TT> from the configuration file for Microsoft Visual C++, 

<TT>jconfig.vc</TT>. MSVC and Borland C++ provide essentially the same set of Microsoft SDK header files. Users of MSVC suffer from the 

same <TT>typedef</TT> clashes that Borland C++ users suffer from. 

</P> 

<hr size = 1> 

</TD> 

</TR> 

</TABLE> 

 

<P> 

Those are the only source code changes that have to be made in order to compile the JPEG library. Its nice to see that we don't have to 

muck around in the C files in order to get the library to compile. Although it is disheartening when you consider that most of our 

changes were to work around type clashes with the Microsoft header files. 

</P> 

<BR> 

<H3> 

<A NAME="build">Compiling the JPEG library</A> 

</H3> 

<P> 

To compile the JPEG library, simply download <a HREF="download/bc55jpeg.zip"><TT>makefile.bc55</TT></a> and the 

changes to the JPEG header files, unzip them over the existing files from the JPEG library, and run <TT>make.exe</TT> from the command 

line. Make sure that you pass it the BC55 compatible makefile, <TT>makefile.bc55</TT>. 

</P> 

<PRE>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区四区| 欧美精品免费视频| 久久99精品久久久| 日日摸夜夜添夜夜添精品视频| 亚洲午夜免费福利视频| 亚洲午夜羞羞片| 午夜视黄欧洲亚洲| 日韩国产一二三区| 日韩精品亚洲专区| 久久国产成人午夜av影院| 经典三级一区二区| 成人黄色网址在线观看| 91视频国产资源| 欧美日韩视频第一区| 日韩一区二区在线看| 久久青草欧美一区二区三区| 欧美高清在线一区二区| 亚洲日本免费电影| 亚洲国产精品尤物yw在线观看| 亚洲国产精品尤物yw在线观看| 美女在线一区二区| 国产传媒一区在线| 色综合久久66| 91精品国产综合久久久久久漫画 | 日韩欧美视频一区| 久久综合一区二区| 亚洲日本丝袜连裤袜办公室| 午夜精品123| 国产东北露脸精品视频| 在线日韩国产精品| 亚洲精品在线电影| 一区二区三区欧美| 国产激情一区二区三区四区| 欧亚洲嫩模精品一区三区| 欧美一区午夜精品| 亚洲欧洲三级电影| 另类人妖一区二区av| www.性欧美| 日韩一区二区免费在线电影| 国产精品成人免费| 九九精品一区二区| 欧美亚洲国产一卡| 久久久久青草大香线综合精品| 一区二区三区欧美日韩| 国产精品1区2区3区在线观看| 欧美三级电影精品| 欧美高清在线精品一区| 免播放器亚洲一区| 欧美日韩一区二区三区在线看| 欧美国产一区二区| 日韩va亚洲va欧美va久久| 91麻豆精品秘密| 久久综合成人精品亚洲另类欧美| 亚洲国产精品一区二区久久| 成人av在线网| 久久综合久久99| 日韩成人dvd| 欧美影院精品一区| 中文字幕在线不卡| 国产剧情av麻豆香蕉精品| 69av一区二区三区| 亚洲成人动漫一区| 欧美影院一区二区三区| 亚洲欧美另类在线| 成人免费观看男女羞羞视频| 2020国产精品久久精品美国| 久久国产精品99精品国产| 6080午夜不卡| 天天色综合天天| 欧美调教femdomvk| 亚洲自拍偷拍欧美| 欧美色图12p| 午夜欧美视频在线观看| 欧美三级视频在线播放| 亚洲国产视频直播| 欧美久久久一区| 日本vs亚洲vs韩国一区三区| 日韩视频免费观看高清完整版在线观看| 亚洲一区二区三区四区在线观看| 色老综合老女人久久久| 亚洲精品成人精品456| 日本精品免费观看高清观看| 亚洲综合小说图片| 欧美日韩日本视频| 久久精工是国产品牌吗| 久久影院视频免费| www.欧美日韩| 亚洲精品免费电影| 91精品国产手机| 国产在线一区观看| 欧美国产乱子伦| 欧美在线999| 日韩电影在线观看电影| 久久影院午夜片一区| 91视视频在线观看入口直接观看www| 亚洲女同一区二区| 精品视频免费在线| 国产真实精品久久二三区| 国产精品久久毛片| 欧美精品一二三| 国产精品77777| 一区二区三区在线视频免费 | 午夜欧美一区二区三区在线播放| 欧美一区国产二区| 国产成人在线视频网站| 亚洲国产日韩综合久久精品| 日韩精品一区二区三区中文不卡| 国产精品1区2区| 亚洲成av人**亚洲成av**| 久久久99精品久久| 欧美日韩综合不卡| 国产成人免费视频网站 | 欧美激情艳妇裸体舞| 欧美性猛交xxxxxxxx| 久久超级碰视频| 亚洲综合图片区| 日本一区二区三区在线观看| 欧美日韩日日夜夜| 99re热这里只有精品免费视频| 日韩va亚洲va欧美va久久| 亚洲人成影院在线观看| 精品国产成人在线影院| 欧美丝袜丝nylons| 粉嫩高潮美女一区二区三区| 蜜桃视频一区二区| 亚洲综合在线免费观看| 国产精品视频观看| 欧美α欧美αv大片| 欧美体内she精视频| 成人动漫一区二区在线| 精品一区二区三区蜜桃| 亚洲国产精品一区二区久久恐怖片| 国产精品拍天天在线| 久久久久久一二三区| 日韩三级电影网址| 91精品一区二区三区久久久久久 | 欧美激情中文字幕| 精品国产乱码久久久久久图片| 精品视频色一区| 日本韩国一区二区三区| 一本到不卡精品视频在线观看| 高清不卡一二三区| 福利一区二区在线| 国产成人精品亚洲777人妖| 国产综合久久久久久鬼色| 九九久久精品视频| 另类中文字幕网| 经典三级在线一区| 国产九色精品成人porny | 欧美日韩日日夜夜| 欧美日韩在线亚洲一区蜜芽| 色www精品视频在线观看| 成人一区二区三区视频在线观看| 国产成人精品综合在线观看 | 欧美人与禽zozo性伦| 欧美日韩精品一区二区三区蜜桃| 欧美亚洲一区二区在线| 91福利国产精品| 欧美久久久影院| 精品成人佐山爱一区二区| 2021国产精品久久精品| 日本一区二区视频在线| 中文字幕亚洲在| 一区二区三区不卡视频在线观看 | 97久久精品人人爽人人爽蜜臀| 成人黄色免费短视频| 91极品美女在线| 欧美视频完全免费看| 日韩欧美一区二区视频| 亚洲精品一区二区精华| 中文字幕在线免费不卡| 亚洲午夜久久久| 老司机免费视频一区二区| 国产一区二区三区观看| 日韩午夜三级在线| 久久久久国产一区二区三区四区 | 国产精品一区不卡| 91蜜桃视频在线| 欧美喷水一区二区| 久久久精品影视| 亚洲一区二区在线视频| 日本成人在线电影网| 岛国av在线一区| 欧美老女人在线| 国产精品久久久久久久久免费桃花 | 日韩欧美久久久| 中文字幕中文字幕一区二区| 图片区小说区国产精品视频| 韩国v欧美v日本v亚洲v| 欧美做爰猛烈大尺度电影无法无天| 日韩欧美一级在线播放| 亚洲视频资源在线| 麻豆久久一区二区| 91蜜桃婷婷狠狠久久综合9色| 日韩美女一区二区三区四区| 自拍偷拍亚洲激情| 国产制服丝袜一区| 51久久夜色精品国产麻豆| 中文字幕亚洲一区二区av在线| 极品少妇xxxx精品少妇|