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