Code: Select all
Support for 12-bit-deep pixel data:
The JPEG standard allows either 8-bit or 12-bit data precision. (For color,
this means 8 or 12 bits per channel, of course.) If you need to work with
deeper than 8-bit data, you can compile the IJG code for 12-bit operation.
To do so:
1. In jmorecfg.h, define BITS_IN_JSAMPLE as 12 rather than 8.
2. In jconfig.h, undefine BMP_SUPPORTED, RLE_SUPPORTED, and TARGA_SUPPORTED,
because the code for those formats doesn't handle 12-bit data and won't
even compile. (The PPM code does work, as explained below. The GIF
code works too; it scales 8-bit GIF data to and from 12-bit depth
3. Compile. Don't expect "make test" to pass, since the supplied test
files are for 8-bit data.
Currently, 12-bit support does not work on 16-bit-int machines.
Note that a 12-bit version will not read 8-bit JPEG files, nor vice versa;
so you'll want to keep around a regular 8-bit compilation as well.
(Run-time selection of data depth, to allow a single copy that does both,
is possible but would probably slow things down considerably; it's very low
on our to-do list.)
Users browsing this forum: No registered users and 1 guest