.dcx file format: GraphViz block diagram (.dot) source

DCX is a simple extension of PCX image format allowing to bundle many PCX images (typically, pages of a document) in one file. It saw some limited use in DOS-era fax software, but was largely superseded with multi-page TIFFs and PDFs since then.

File extension

dcx

KS implementation details

License: CC0-1.0

References

This page hosts a formal specification of .dcx file format using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

GraphViz block diagram source

pcx_dcx.dot

digraph {
	rankdir=LR;
	node [shape=plaintext];
	subgraph cluster__pcx_dcx {
		label="PcxDcx";
		graph[style=dotted];

		pcx_dcx__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
			<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
			<TR><TD PORT="magic_pos">0</TD><TD PORT="magic_size">4</TD><TD></TD><TD PORT="magic_type">magic</TD></TR>
			<TR><TD PORT="files_pos">4</TD><TD PORT="files_size">4</TD><TD>PcxOffset</TD><TD PORT="files_type">files</TD></TR>
			<TR><TD COLSPAN="4" PORT="files__repeat">repeat until _.ofs_body == 0</TD></TR>
		</TABLE>>];
		subgraph cluster__pcx_offset {
			label="PcxDcx::PcxOffset";
			graph[style=dotted];

			pcx_offset__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="ofs_body_pos">0</TD><TD PORT="ofs_body_size">4</TD><TD>u4le</TD><TD PORT="ofs_body_type">ofs_body</TD></TR>
			</TABLE>>];
			pcx_offset__inst__body [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
				<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
				<TR><TD PORT="body_pos">ofs_body</TD><TD PORT="body_size">128</TD><TD>Pcx</TD><TD PORT="body_type">body</TD></TR>
			</TABLE>>];
		}
	}
	pcx_dcx__seq:files_type -> pcx_offset__seq [style=bold];
	pcx_offset__seq:ofs_body_type -> pcx_dcx__seq:files__repeat [color="#404040"];
	pcx_offset__seq:ofs_body_type -> pcx_offset__inst__body:body_pos [color="#404040"];
	pcx_offset__inst__body:body_type -> pcx__seq [style=bold];
}