\section{byteimg2disk.c File Reference}
\label{byteimg2disk_8c}\index{byteimg2disk.c@{byteimg2disk.c}}
Writing single-byte images to external SADIE files. 

{\tt \#include $<$sadie.h$>$}\par
{\tt \#include \char`\"{}sadie\_\-byte.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf NEEDSWAP}\ 1\label{byteimg2disk_8c_a0}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int {\bf sad\_\-byte\_\-header\_\-write} ({\bf IMAGE\_\-BYTE} $\ast$buf, FILE $\ast$fp)
\begin{CompactList}\small\item\em Write a byte image header structure to a disk file (or equivalent). \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Writing single-byte images to external SADIE files. 

The IMG2DSK function in libsadie can write external data in SADIE format with the value of each pixel encoded in a single byte, but it cannot handle the similar internal representation, the {\bf IMAGE\_\-BYTE}{\rm (p.\,\pageref{structIMAGE__BYTE})} structure, so something more specialized is needed.

\begin{Desc}
\item[Author:]University of Arizona Digital Image Analysis Lab \end{Desc}
\begin{Desc}
\item[Date:]2004 \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf byteimg2disk.c}{\rm (p.\,\pageref{byteimg2disk_8c})},v 1.4 2004/08/06 22:47:11 mmunro Exp \end{Desc}
\end{Desc}


\subsection{Function Documentation}
\index{byteimg2disk.c@{byteimg2disk.c}!sad_byte_header_write@{sad\_\-byte\_\-header\_\-write}}
\index{sad_byte_header_write@{sad\_\-byte\_\-header\_\-write}!byteimg2disk.c@{byteimg2disk.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int sad\_\-byte\_\-header\_\-write ({\bf IMAGE\_\-BYTE} $\ast$ {\em buf}, FILE $\ast$ {\em fp})}\label{byteimg2disk_8c_a1}


Write a byte image header structure to a disk file (or equivalent). 

We play safe by writing each member of the structure independently, in case there are any alignment issues when trying to write the structure as a whole. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em $\ast$buf}]points at the buffer containing the image header. \item[{\em $\ast$fp}]file pointer to something already open for writing. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]An error code on failure, 0 on success. \end{Desc}
