| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- <?xml version="1.0" encoding="utf-8"?>
- <?xml-stylesheet type="text/xsl" href="../Xsl/doc2html.xsl"?>
- <doc>
- <title>Supported Data Formats</title>
- <chapter>
- <title>Supported Data Formats</title>
- <par>Image data format is the internal memory representation of every image.
- Data formats are described by <ref>TImageFormat</ref> enumeration
- member of <ref>TImageData</ref> structure.
- Additional information about each of the data formats is stored in
- <ref>TImageFormatInfo</ref> structure.</par>
- <table>
- <title>Functions related to data formats (low level interface)</title>
- <row>
- <header>Function name</header>
- <header>Usage</header>
- </row>
- <row>
- <cell><ref>GetImageFormatInfo</ref></cell>
- <cell>Returns additional information about the given data format</cell>
- </row>
- <row>
- <cell><ref>GetPixelsSize</ref></cell>
- <cell>Returns number of bytes occupied by Width x Height area of pixels in the given data format
- (works for all data formats)</cell>
- </row>
- <row>
- <cell><ref>GetFormatName</ref></cell>
- <cell>Returns symbolic name of the given data format</cell>
- </row>
- <row>
- <cell><ref>ConvertImage</ref></cell>
- <cell>Converts images between different data formats </cell>
- </row>
- <row>
- <cell><ref>NewImage</ref></cell>
- <cell>Creates new image with the given data format</cell>
- </row>
- </table>
- <lcap>Data Format Categories</lcap>
- <par>Image data formats can be divided to these main categories: </par>
- <blist>
- <li><link url="#argb">ARGB Formats</link><br/>
- Each pixel consists of several color channels and
- optional alpha transparency channel.
- </li>
- <li><link url="#index">Indexed Formats</link><br/>
- Each pixel is index to the array of colors called the palette.
- </li>
- <li><link url="#gray">Grayscale Formats</link><br/>
- Pixels consist of intensity channel and optional alpha transparency channel.
- </li>
- <li><link url="#float">Floating-point ARGB Formats</link><br/>
- These formats are similar to ARGB formats but color values are stored
- as floating-point numbers.
- </li>
- <li><link url="#special">Special Formats</link><br/>
- Each special format requires special and unique conversion
- procedures. Compressed formats like DXTC belong to this category.
- </li>
- </blist>
- <mcap>Meaning of Data Format Symbolic Names</mcap>
- <par>
- Each data format has its symbolic name.
- These names are formed in the way which tells something about
- its internal structure. Symbolic names look like this:<br /><br />
- <center><icode>if[(channel1)(channel1sizebits)]..[(channeln)(channelnsizebits)][modifier1]..[modifiern]</icode></center>
- <br />
- For example <icode>ifA8R8G8B8</icode> shows that each image pixel
- contains four 8 bit sized channels.
- <icode>ifR32F</icode> format contains one 32 bit channel and <keyword>F</keyword>
- modifier indicates that this is floating-point format.
- All channels in the symbolic names are listed from left to right,
- most significant bit (MSB) to least significant bit (LSB).
- For example, <icode>ifA8R8G8B8</icode> is ordered from the MSB channel
- <keyword>A</keyword> (alpha), to the LSB channel <keyword>B</keyword> (blue).
- When traversing image data on little endian machines,
- the data is stored in memory from LSB to MSB, which means that the channel order in memory is
- from LSB (blue) to MSB (alpha).<br/>
- <note>Special data format names do not follow this naming convention.
- Their symbolic names refer for example to compression technology used
- (<icode>ifDXT5</icode> is data format of image compressed with DXT5).
- </note>
- </par>
- <table>
- <row>
- <th>Symbolic Name Fragment</th>
- <th>Info</th>
- </row>
- <row>
- <td><keyword>X</keyword></td>
- <td>Unused memory space</td>
- </row>
- <row>
- <td><keyword>R</keyword></td>
- <td>Red color channel</td>
- </row>
- <row>
- <td><keyword>G</keyword></td>
- <td>Green color channel</td>
- </row>
- <row>
- <td><keyword>B</keyword></td>
- <td>Blue color channel</td>
- </row>
- <row>
- <td><keyword>A</keyword></td>
- <td>Alpha transparency channel</td>
- </row>
- <row>
- <td><keyword>Index</keyword></td>
- <td>Index to palette</td>
- </row>
- <row>
- <td><keyword>Gray</keyword></td>
- <td>Grayscale intensity channel</td>
- </row>
- <row>
- <td><keyword>F</keyword></td>
- <td>Indicates that this format stores channel values as
- floating point numbers</td>
- </row>
- </table>
- <anchor name="argb"><mcap>ARGB Formats</mcap></anchor>
- <par>The following table lists all ARGB formats supported in the current
- version of Imaging library. Channel values are stored as unsigned
- integers.</par>
- <table>
- <row>
- <th>Symbolic Name</th>
- <th>Info</th>
- </row>
- <row>
- <td><icode>ifX5R1G1B1</icode></td>
- <td>8 bit format with one bit for each color channel. 5 bits are unused.</td>
- </row>
- <row>
- <td><icode>ifR3G3B2</icode></td>
- <td>8 bit format with 3 bits for read and green and 2 bits for blue channel.</td>
- </row>
- <row>
- <td><icode>ifR5G6B5</icode></td>
- <td>16 bit format with 5 bits for read and blue and 6 bits for green channel.</td>
- </row>
- <row>
- <td><icode>ifA1R5G5B5</icode></td>
- <td>16 bit format with 5 bits for each color and one bit for alpha.</td>
- </row>
- <row>
- <td><icode>ifA4R4G4B4</icode></td>
- <td>16 bit format with 4 bits for each color and alpha.</td>
- </row>
- <row>
- <td><icode>ifX1R5G5B5</icode></td>
- <td>16 bit format with 5 bits for each color and one unused bit.</td>
- </row>
- <row>
- <td><icode>ifX4R4G4B4</icode></td>
- <td>16 bit format with 4 bits for each color and 4 unused bits.</td>
- </row>
- <row>
- <td><icode>ifR8G8B8</icode></td>
- <td>24 bit format with 8 bits for each color.</td>
- </row>
- <row>
- <td><icode>ifA8R8G8B8</icode></td>
- <td>32 bit format with 8 bits for each color and alpha.</td>
- </row>
- <row>
- <td><icode>ifX8R8G8B8</icode></td>
- <td>32 bit format with 8 bits for each color and 8 unused bits.</td>
- </row>
- <row>
- <td><icode>ifR16G16B16</icode></td>
- <td>48 bit format with 16 bits for each color.</td>
- </row>
- <row>
- <td><icode>ifA16R16G16B16</icode></td>
- <td>64 bit format with 16 bits for each color and alpha.</td>
- </row>
- <row>
- <td><icode>ifB16G16R16</icode></td>
- <td>48 bit BGR format with 16 bits for each color.</td>
- </row>
- <row>
- <td><icode>ifA16B16G16R16</icode></td>
- <td>64 bit BGR format with 16 bits for each color and alpha.</td>
- </row>
- </table>
- <anchor name="index"><mcap>Indexed Formats</mcap></anchor>
- <par>The following table lists all indexed formats supported in the current
- version of Imaging library. Indexes are stored as unsigned
- integers. Palette is <ref>PPalette32</ref> member of <ref>TImageData</ref>
- structure. It is a pointer to array of 32 bit ARGB values in
- <icode>ifA8R8G8B8</icode> format.
- </par>
- <table>
- <row>
- <th>Symbolic Name</th>
- <th>Info</th>
- </row>
- <row>
- <td><icode>ifIndex8</icode></td>
- <td>8 bit format with 8 bits for index.</td>
- </row>
- </table>
- <anchor name="gray"><mcap>Grayscale Formats</mcap></anchor>
- <par>The following table lists all grayscale formats supported in the current
- version of Imaging library.
- Channels values are stored as unsigned integers.</par>
- <table>
- <row>
- <th>Symbolic Name</th>
- <th>Info</th>
- </row>
- <row>
- <td><icode>ifGray8</icode></td>
- <td>8 bit format with 8 bits for grayscale intensity.</td>
- </row>
- <row>
- <td><icode>ifA8Gray8</icode></td>
- <td>16 bit format with 8 bits for alpha transparency and
- 8 bits for grayscale intensity.</td>
- </row>
- <row>
- <td><icode>ifGray16</icode></td>
- <td>16 bit format with 16 bits for grayscale intensity.</td>
- </row>
- <row>
- <td><icode>ifGray32</icode></td>
- <td>32 bit format with 32 bits for grayscale intensity.</td>
- </row>
- <row>
- <td><icode>ifGray64</icode></td>
- <td>64 bit format with 64 bits for grayscale intensity.</td>
- </row>
- <row>
- <td><icode>ifA16Gray16</icode></td>
- <td>32 bit format with 16 bits for alpha transparency and
- 16 bits for grayscale intensity.</td>
- </row>
- </table>
- <anchor name="float"><mcap>Floating-point ARGB Formats</mcap></anchor>
- <par>The following table lists all floating-point formats supported in the current
- version of Imaging library.
- Channels values are stored as signed floating-point numbers.</par>
- <table>
- <row>
- <th>Symbolic Name</th>
- <th>Info</th>
- </row>
- <row>
- <td><icode>ifR32F</icode></td>
- <td>32 bit format with one red 32 bit IEEE-754 channel.</td>
- </row>
- <row>
- <td><icode>ifA32R32G32B32F</icode></td>
- <td>128 bit format with 32 bit IEEE-754 channel for each color and alpha.</td>
- </row>
- <row>
- <td><icode>ifA32B32G32R32F</icode></td>
- <td>128 bit BGR format with 32 bit IEEE-754 channel for each color and alpha.</td>
- </row>
- <row>
- <td><icode>ifR16F</icode></td>
- <td>16 bit format with one red 16 bit half-float (s1e5m10) channel.</td>
- </row>
- <row>
- <td><icode>ifA16R16G16B16F</icode></td>
- <td>64 bit format with 16 bit half-float (s1e5m10) channel for each color and alpha.</td>
- </row>
- <row>
- <td><icode>ifA16B16G16R16F</icode></td>
- <td>64 bit BGR format with 16 bit half-float (s1e5m10) channel for each color and alpha.</td>
- </row>
- </table>
- <anchor name="special"><mcap>Special Formats</mcap></anchor>
- <par>The following table lists all special formats supported in the current
- version of Imaging library.
- </par>
- <table>
- <row>
- <th>Symbolic Name</th>
- <th>Info</th>
- </row>
- <row>
- <td><icode>ifDXT1</icode></td>
- <td>Image in this format is compressed with DXT1 compression
- (15/16 bit interpolated color, zero or one bit alpha).</td>
- </row>
- <row>
- <td><icode>ifDXT3</icode></td>
- <td>Image in this format is compressed with DXT3 compression
- (16 bit interpolated color, 4 bit explicit alpha).</td>
- </row>
- <row>
- <td><icode>ifDXT5</icode></td>
- <td>Image in this format is compressed with DXT5 compression
- (16 bit interpolated color, 8 bit interpolated alpha).</td>
- </row>
- <row>
- <td><icode>ifBTC</icode></td>
- <td>Image in this format is compressed with BTC compression
- (block truncation coding, grayscale, 2bits per pixel).</td>
- </row>
- <row>
- <td><icode>ifATI1N</icode></td>
- <td>Image in this format is compressed using 3Dc+ compression
- (one channel, 4bits per pixel).</td>
- </row>
- <row>
- <td><icode>ifATI2N</icode></td>
- <td>Image in this format is compressed using original 3Dc compression
- (two channels, 8bits per pixel).</td>
- </row>
- </table>
- <note>There maybe some legal issues when using DXTC/S3TC compression
- (3Dc probably too as it is "subset" of DXT5) as S3 holds patent to this.</note>
- </chapter>
- </doc>
|