pcdtojpeg incorporates a separate PCD decoder library, which can easily be incorporated into other software that needs to decode PCD files.
The library is known as pcdDecode, and the entire library is contained in only a single C++ source file (pcdDecode.cpp) and its associated include file (pcdDecode.h).
pcdDecode is written to provide a PCD decoder library that is:
  1. Easy to use, with a clear API, and human readable messages.
  2. Suited to modern multi-core processors; so multithreaded where applicable.
  3. Multi-platform - OS X, Windows, *nix, little- or big-endian
  4. Minimum dependencies - pcdDecode will use pthreads if available, but is otherwise standalone (other than for normal C++ libraries).
  5. Correctly converts all forms of PCD files, including all classes of Huffman encoding (classes 1-4).
  6. Converts all PCD resolutions, including 64Base images.
  7. Correct and predictable color space handling (no blown highlights, no color casts); RGB data can be returned in a choice of well specified color spaces.
  8. Full support for "Kodak standard" bilinear interpolation of chroma.
  9. Extracts PCD file metadata information.
  10. Transparently recovers from many data errors.
  11. GPL licensed.
pcdDecode is also available is non-GPL version that adds AHD style interpolation; this offers lower image noise and better edge performance.
Compiling the software from source
Compiling: pcdDecode should compile without modification on most systems. It has been tested on OS X (XCode), MS Windows (Visual C++) and linux (GCC), on both big- and little-endian CPUs. The only thing to do is to define "mNoPThreads" if you don't have (or don't want) pthreads. This is done automagically for Visual C++, so you shouldn't have to do so. Here’s what you need know to use the pcdDecode library:
  1. 1.All of the documentation for individual API functions is in the pcdDecode.h file.
  2. 2.pcdtojpeg exercises most functions of pcdDecode, and thus forms an excellent tutorial for the various API functions.
  3. 3.pcdtojpeg was built under VC Express 2008 for Windows, and XCode 3.1 for the Mac. The respective project files are included.
  4. 4.Under Linux, G++ was used to compile pcdDecode - instructions are on the Installation page.
Using the pcdDecode Library