⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 DELPHI版的JPEG文件解码源程序
💻 TXT
📖 第 1 页 / 共 2 页
字号:
                can use extended and expanded memory as well as temporary
                files.
jmemsys.pas     A skeleton with all the declaration you need to create a
                working system-dependent JPEG memory manager on unusual
                systems.

Exactly one of the system-dependent units should be used in jmemmgr.pas.

jmemdosa.pas    BASM 80x86 assembly code support for jmemdos.pas; used only
                in MS-DOS-specific configurations of the JPEG library.


Applications using the library should use jmorecfg, jerror, jpeglib, and
include jconfig.inc.

CJPEG/DJPEG/JPEGTRAN

Pascal source code files:

cderror.pas     Additional error and trace message codes for cjpeg/djpeg.
                Not used, Those errors have been added to jdeferr.
cjpeg.pas       Main program for cjpeg.
djpeg.pas       Main program for djpeg.
jpegtran.pas    Main program for jpegtran.
cdjpeg.pas      Utility routines used by all three programs.
rdcolmap.pas    Code to read a colormap file for djpeg's "-map" switch.
rdswitch.pas    Code to process some of cjpeg's more complex switches.
                Also used by jpegtran.
transupp.pas    Support code for jpegtran: lossless image manipulations.

fcache.pas
rdswitch.pas    Code to process some of cjpeg's more complex switches.
                Also used by jpegtran.

Image file writer modules for djpeg:

wrbmp.pas       BMP file output.
wrppm.pas	PPM/PGM file output.
wrtarga.pas     Targa file output.

Image file reader modules for cjpeg:

rdbmp.pas       BMP file input.
rdppm.pas       PPM/PGM file input.
rdtarga.pas     Targa file input. - NOT READY YET

This program does not depend on the JPEG library

rdjpgcom.pas	Stand-alone rdjpgcom application.


Translation
===========

TP is unit-centric, exported type definitions and routines are declared
in the "interface" part of the unit, "make" files are not needed.
Macros are not supported, they were either copied as needed or translated
to Pascal routines (procedure). The procedures will be replaced by code in
later releases.
Conditional defines that indicate whether to include various optional
functions are defined in the file JCONFIG.INC. This file is included first
in all source files.

The base type definitions are in the unit JMORECFG.PAS. The error handling
macros have been converted to procedures in JERROR.PAS. The error codes are
in JDEFERR.PAS. jpegint.h and jpeglib.h were merged into one large unit
JPEGLIB.PAS containing type definitions with global scope.

The translation of the header file is the most sophisticated work, a good
understanding of the syntax is required. Once the header files are done,
the translation turns into a lot of editing work. Each C source file was
converted to a unit by editing the syntax (separate variable definition
and usage, define labels, group variable definitions, expanding macros, etc).

The IJG source labels routines GLOBAL, METHODDEF and LOCAL. All globals
routines are in the interface section of the units. The "far" directive is
used for methods (METHODDEF).

Some C  ->  Pascal  examples.

* "{"  -> "begin"    "->"  ->  "^."        " = "  -> " := "  "<<"  -> " shl "
  "}"  -> "end;"     "!="  ->  "<>"        " == " -> " = "   ">>"  -> " shr "
  "/*" -> "{"      routine ->  function    "0x"   -> "$"
  "*/" -> "}"      (void)      procedure   "NULL" -> "NIL"

* structs are records, Unions are variable records, pointers are always far,
  the operators && and || (and/or) have not the same priority in both
  languages, so parenthesis are important. The Pascal "case" doesn't have the
  falltrough option of the C "switch" statement, my work around is to split
  one "switch" statement into many case statements.
* The pointer type in C is not readily interchangeable. It is used to address
  an array (Pascal pointer to an array) or in pointer arithmetic a pointer to
  a single element. I've used the Inc() statement with type casting to
  translate pointer arithmetic most of the time.

  C example:
    typedef JSAMPLE* JSAMPROW;  /* ptr to one image row of pixel samples. */

  Pascal
  type
    JSAMPLE_PTR = ^JSAMPLE;     { ptr to a single pixel sample. }
    jTSample = 0..(MaxInt div SIZEOF(JSAMPLE))-1;
    JSAMPLE_ARRAY = Array[jTSample] of JSAMPLE;  {far}
    JSAMPROW = ^JSAMPLE_ARRAY;  { ptr to one image row of pixel samples. }

  The following code

    JSAMPROW buffer0, buffer1;  /* ptr to a JSAMPLE buffer. */

    ...

    buffer1 = buffer0 + i;

  can be translated to

  var
    buffer0, buffer1 : JSAMPROW;

  ...

    buffer1 := buffer0;
    Inc(JSAMPLE_PTR(buffer1), i);

  or

    buffer1 := JSAMPROW(@ buffer0^[i]);

  Declaring the variables as JSAMPLE_PTR may reduce type casting in some
  places. I use help pointers to handle negative array offsets.

While translating the type of function parameter from C to Pascal, one can
often use "var", "const", or "array of" parameters instead of pointers.

While translating for(;;)-loops with more than one induction variable to
Pascal "for to/downto do"-loops, the extra induction variables have to be
manually updated at the end of the loop and before "continue"-statements.


Legal issues
============

Copyright (C) 1996,1998 by Jacques Nomssi Nzali

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the author be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.


Archive Locations:
==================

[1] Thomas G. Lane, JPEG FAQ

      in comp.graphics.misc and related newsgroups

[2] Wallace, Gregory K.: The JPEG Still Picture Compression Standard

      ftp.uu.net, graphics/jpeg/wallace.ps.Z

[3] The Independent JPEG Group C library for JPEG encoding and decoding,
    rev 6b.

      ftp://ftp.uu.net/graphics/jpeg/

      or SimTel in msdos/graphics/

[4] JPEG implementation, written by the PVRG group at Stanford,
      ftp havefun.stanford.edu:/pub/jpeg/JPEGv1.2.tar.Z.

[5] PASJPEG.ZIP at NView ftp site

      ftp://druckfix.physik.tu-chemnitz.de/pub/nv/
      http://www.tu-chemnitz.de/~nomssi/pub/pasjpeg.zip

[6] The PasJPEG home page with links

      http://www.tu-chemnitz.de/~nomssi/pasjpeg.html
_____________________________________________________________________________

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -