1 /** \file
2  * \brief Initialize the RAW Format Driver
3  * Header for internal use only.
4  *
5  * See Copyright Notice in im_lib.d
6  */
7 
8 module im.format_raw;
9 
10 extern (C) @safe nothrow:
11 
12 /** \defgroup raw RAW - RAW File
13  *
14  * \par
15  * The file must be open/created with the functions \ref imFileOpenRaw and \ref imFileNewRaw.
16  *
17  * \section Description
18  *
19  * \par
20  * Internal Implementation.
21  * \par
22  * Supports RAW binary images. This is an unstructured and uncompressed binary data.
23  * It is NOT a Camera RAW file generated in many professional digital cameras. \n
24  * You must know image parameters a priori and must set the IM_INT attributes "Width", "Height", "ColorMode", "DataType"
25  * before the imFileReadImageInfo/imFileWriteImageInfo functions.
26  * \par
27  * The data must be in binary form, but can start in an arbitrary offset from the begining of the file, use attribute "StartOffset".
28  * The default is at 0 offset.
29  * \par
30  * Integer sign and double precision can be converted using attribute "SwitchType". \n
31  * The conversions will be BYTE<->CHAR, USHORT<->SHORT, INT<->UINT, FLOAT<->DOUBLE.
32  * \par
33  * Byte Order can be Little Endian (Intel=1) or Big Endian (Motorola=0), use the attribute "ByteOrder", the default is the current CPU.
34  * \par
35  * The lines can be aligned to a BYTE (1), WORD (2) or DWORD (4) boundaries, ue attribute "Padding" with the respective value.
36  * \par
37  * If the compression is ASCII the data is stored in textual format, instead of binary.
38  * In this case SwitchType and ByteOrder are ignored, and Padding should be 0.
39  * \par
40  * When reading, if data type is BYTE, color space is RGB and data is packed, then the attribute "RGB16" is consulted.
41  * It can has values "555" or "565" indicating a packed 16 bits RGB pixel is stored with the given bit distribution for R, G and B.
42  * \par
43  * See \ref im_raw.h
44  *
45  * \section Features
46  *
47 \verbatim
48     Data Types: <all>
49     Color Spaces: all, except MAP.
50     Compressions:
51       NONE - no compression [default]
52       ASCII (textual data)
53     Can have more than one image, depends on "StartOffset" attribute.
54     Can have an alpha channel.
55     Components can be packed or not.
56     Lines arranged from top down to bottom or bottom up to top.
57 
58     Attributes:
59       Width, Height, ColorMode, DataType IM_INT (1)
60       ImageCount[1], StartOffset[0], SwitchType[FALSE], ByteOrder[IM_LITTLEENDIAN], Padding[0]  IM_INT (1)
61 
62     Comments:
63       In fact ASCII is an expansion, not a compression, because the file will be larger than binary data.
64 \endverbatim
65  * \ingroup format */
66 struct imFormat;
67 
68 imFormat* imFormatInitRAW();
69 
70 void imFormatFinishRAW();
71