\section{Distance\-Transform Class Reference}
\label{class_distance_transform}\index{DistanceTransform@{DistanceTransform}}
an abstract distance transform class  


{\tt \#include $<$Distance\-Transform.h$>$}

Inheritance diagram for Distance\-Transform::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=12cm]{class_distance_transform}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Distance\-Transform} (const int {\bf x\-Size}, const int {\bf y\-Size}, const bool unload=true)
\begin{CompactList}\small\item\em construct a distance transform object for an image of size (x\-Size,y\-Size). \item\end{CompactList}\item 
virtual void {\bf do\-Transform} (const unsigned char $\ast$const I)=0\label{class_distance_transform_720fbb5d558543a7a48c668315118b91}

\begin{CompactList}\small\item\em calculate the distance transform \item\end{CompactList}\item 
double {\bf get\-D} (const int x, const int y) const \label{class_distance_transform_52c5b8df7f8e2036ec1705ea16184d62}

\begin{CompactList}\small\item\em return the distance value assigned to a particular position \item\end{CompactList}\item 
virtual bool {\bf get\-P} (const int x, const int y, int \&px, int \&py) const 
\begin{CompactList}\small\item\em return the \char`\"{}parent\char`\"{} (border point) associated with this point \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Attributes}
\begin{CompactItemize}
\item 
static const int {\bf Int\-Infinity} = INT\_\-MAX / 2
\item 
static const double {\bf Float\-Infinity} = FLT\_\-MAX / 2.0
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
int {\bf sub} (const int x, const int y) const 
\item 
template$<$class T$>$ void {\bf init\-Immediate} (const unsigned char $\ast$const I, T $\ast$d, const T half\-Dx=0, const T half\-Dy=0)\label{class_distance_transform_199b31f10b0822cf29c7609087608b7c}

\begin{CompactList}\small\item\em init elements of the immediate interior (i.e., border points). \item\end{CompactList}\item 
template$<$class T$>$ void {\bf check} (T $\ast$d, const int center, const int X, const int Y, const T Delta)\label{class_distance_transform_0801c8f56462d005b589382fe4e8a01a}

\item 
virtual void {\bf border\-Check} (const unsigned char $\ast$const I)\label{class_distance_transform_422e351cfd8d06d30aa747f996db1a4a}

\item 
void {\bf clean\-Up} ()\label{class_distance_transform_a539a1c227a4e772930c4a9e6e9713fc}

\item 
void {\bf finish} (const unsigned char $\ast$const I, double $\ast$d)
\item 
void {\bf finish} (const unsigned char $\ast$const I, int $\ast$d, const int dx, const int dy)
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
int {\bf x\-Size}\label{class_distance_transform_b4e9c30d634146e98a7e73d7f1b5528c}

\begin{CompactList}\small\item\em integer size (width) in pixels \item\end{CompactList}\item 
int {\bf y\-Size}\label{class_distance_transform_7856ca4c107e88ecbccd9e0d1058ae8a}

\begin{CompactList}\small\item\em integer size (height) in pixels \item\end{CompactList}\item 
double $\ast$ {\bf d\-D}\label{class_distance_transform_67b52b6e2ba10c0400f3bdf222e5341b}

\begin{CompactList}\small\item\em result of distance transform (as doubles) \item\end{CompactList}\item 
int $\ast$ {\bf i\-D}\label{class_distance_transform_faee866aedc007ed999eb34c8990f8d1}

\begin{CompactList}\small\item\em the calculated distance transform (as ints) \item\end{CompactList}\end{CompactItemize}
\subsection*{Private Attributes}
\begin{CompactItemize}
\item 
int $\ast$ {\bf row\-Offsets}\label{class_distance_transform_7a3628054c5463df92e254bf03aef7aa}

\begin{CompactList}\small\item\em used to speed up 2d array indexing \item\end{CompactList}\item 
bool {\bf unload\-Flag}\label{class_distance_transform_8ea670d5ff48e4d860d92bbb34032069}

\begin{CompactList}\small\item\em convert ints to doubles (if necessary) \item\end{CompactList}\end{CompactItemize}
\subsection*{Classes}
\begin{CompactItemize}
\item 
class {\bf P}
\begin{CompactList}\small\item\em Distance\-Transform::P class. Simply a 2D point. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
an abstract distance transform class 



\subsection{Constructor \& Destructor Documentation}
\index{DistanceTransform@{Distance\-Transform}!DistanceTransform@{DistanceTransform}}
\index{DistanceTransform@{DistanceTransform}!DistanceTransform@{Distance\-Transform}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Distance\-Transform::Distance\-Transform (const int {\em x\-Size}, const int {\em y\-Size}, const bool {\em unload} = {\tt true})}\label{class_distance_transform_d25f63f1fde04a2f184843c0c87b9dba}


construct a distance transform object for an image of size (x\-Size,y\-Size). 

if 'unload' is true, transforms that use ratios of integers should convert their integer results to the actual double values (of the ratios). 

\subsection{Member Function Documentation}
\index{DistanceTransform@{Distance\-Transform}!finish@{finish}}
\index{finish@{finish}!DistanceTransform@{Distance\-Transform}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Distance\-Transform::finish (const unsigned char $\ast$const  {\em I}, int $\ast$ {\em d}, const int {\em dx}, const int {\em dy})\hspace{0.3cm}{\tt  [protected]}}\label{class_distance_transform_da02123f29eb20a3c3bcd541eaeb8692}


called to finish up after distance transform employing ints \index{DistanceTransform@{Distance\-Transform}!finish@{finish}}
\index{finish@{finish}!DistanceTransform@{Distance\-Transform}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Distance\-Transform::finish (const unsigned char $\ast$const  {\em I}, double $\ast$ {\em d})\hspace{0.3cm}{\tt  [protected]}}\label{class_distance_transform_0855e3e0c548af34c5941d06e98a8dfd}


called to finish up after distance transform employing doubles \index{DistanceTransform@{Distance\-Transform}!getP@{getP}}
\index{getP@{getP}!DistanceTransform@{Distance\-Transform}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool Distance\-Transform::get\-P (const int {\em x}, const int {\em y}, int \& {\em px}, int \& {\em py}) const\hspace{0.3cm}{\tt  [virtual]}}\label{class_distance_transform_96812fce6c340f8e08e9326a44f8e067}


return the \char`\"{}parent\char`\"{} (border point) associated with this point 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em x}]is the x location \item[{\em y}]is the y location \item[{\em px}]is the parent's x location to be returned \item[{\em py}]is the parent's y location to be returned \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the parent is know; otherwise false. \end{Desc}


Reimplemented in {\bf CSED} {\rm (p.\,\pageref{class_c_s_e_d_96812fce6c340f8e08e9326a44f8e067})}, {\bf Dead\-Reckoning} {\rm (p.\,\pageref{class_dead_reckoning_96812fce6c340f8e08e9326a44f8e067})}, {\bf Dijkstra\-Vectors} {\rm (p.\,\pageref{class_dijkstra_vectors_96812fce6c340f8e08e9326a44f8e067})}, {\bf Eight\-SED} {\rm (p.\,\pageref{class_eight_s_e_d_96812fce6c340f8e08e9326a44f8e067})}, {\bf errorfree\-CSED} {\rm (p.\,\pageref{classerrorfree_c_s_e_d_96812fce6c340f8e08e9326a44f8e067})}, {\bf Modified\-Dijkstra} {\rm (p.\,\pageref{class_modified_dijkstra_96812fce6c340f8e08e9326a44f8e067})}, {\bf Simple} {\rm (p.\,\pageref{class_simple_96812fce6c340f8e08e9326a44f8e067})}, and {\bf Simple\-List} {\rm (p.\,\pageref{class_simple_list_96812fce6c340f8e08e9326a44f8e067})}.\index{DistanceTransform@{Distance\-Transform}!sub@{sub}}
\index{sub@{sub}!DistanceTransform@{Distance\-Transform}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Distance\-Transform::sub (const int {\em x}, const int {\em y}) const\hspace{0.3cm}{\tt  [protected]}}\label{class_distance_transform_e3cb2363e0f09b2b81568e083cc4ff68}


given a point (x,y) in an image, this method returns the corresponding 1d subscript into the 1d image array 

\subsection{Member Data Documentation}
\index{DistanceTransform@{Distance\-Transform}!FloatInfinity@{FloatInfinity}}
\index{FloatInfinity@{FloatInfinity}!DistanceTransform@{Distance\-Transform}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const double {\bf Distance\-Transform::Float\-Infinity} = FLT\_\-MAX / 2.0\hspace{0.3cm}{\tt  [static]}}\label{class_distance_transform_5a4b376f18a7c6059f2196c892484fc3}


a double representing infinity (but one such that smaller values may still be added to it) \index{DistanceTransform@{Distance\-Transform}!IntInfinity@{IntInfinity}}
\index{IntInfinity@{IntInfinity}!DistanceTransform@{Distance\-Transform}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const int {\bf Distance\-Transform::Int\-Infinity} = INT\_\-MAX / 2\hspace{0.3cm}{\tt  [static]}}\label{class_distance_transform_b524b6bc9b083dcefbf6ae1003d7874d}


an integer representing infinity (but one such that smaller values may still be added to it) 

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
{\bf Distance\-Transform.h}\item 
{\bf Distance\-Transform.cpp}\end{CompactItemize}
