\hypertarget{a00248}{
\section{mln::image2d$<$ T $>$ Class Template Reference}
\label{dd/dd7/a00248}\index{mln::image2d@{mln::image2d}}
}


Basic 2D image class.  




{\ttfamily \#include $<$image2d.hh$>$}



Inherits image\_\-primary$<$ T, mln::box2d, image2d$<$ T $>$ $>$.

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef T \& \hyperlink{a00248_a25a9171e5aa9833954c69d863a240e78}{lvalue}
\begin{DoxyCompactList}\small\item\em Return type of read-\/write access. \item\end{DoxyCompactList}\item 
typedef const T \& \hyperlink{a00248_a14e2177d95bc9e8f60eb32e087106f13}{rvalue}
\begin{DoxyCompactList}\small\item\em Return type of read-\/only access. \item\end{DoxyCompactList}\item 
typedef \hyperlink{a00248}{image2d}$<$ tag::value\_\-$<$ T $>$ $>$ \hyperlink{a00248_adb5d5ae41d28bb582318f95dec370fde}{skeleton}
\begin{DoxyCompactList}\small\item\em Skeleton. \item\end{DoxyCompactList}\item 
typedef T \hyperlink{a00248_a93c3496ad37acedd34fdfacbc9895476}{value}
\begin{DoxyCompactList}\small\item\em \hyperlink{a00418}{Value} associated type. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
const \hyperlink{a00135}{box2d} \& \hyperlink{a00248_a62ec9a0c5d3c925dee36460dbbc28816}{bbox} () const 
\begin{DoxyCompactList}\small\item\em Give the bounding box domain. \item\end{DoxyCompactList}\item 
unsigned \hyperlink{a00248_ab16197b145e60593c3f35803fba52620}{border} () const 
\begin{DoxyCompactList}\small\item\em Give the border thickness. \item\end{DoxyCompactList}\item 
const T $\ast$ \hyperlink{a00248_a7f1160b5acb82ed221f475a32f779a36}{buffer} () const 
\begin{DoxyCompactList}\small\item\em Give a hook to the value buffer. \item\end{DoxyCompactList}\item 
T $\ast$ \hyperlink{a00248_a8fdc366bfa2126565e3a2ef86c0f09a8}{buffer} ()
\begin{DoxyCompactList}\small\item\em Give a hook to the value buffer. \item\end{DoxyCompactList}\item 
int \hyperlink{a00248_a174edca58a4df9854c7b7394a54d9b88}{delta\_\-index} (const \hyperlink{a00178}{dpoint2d} \&dp) const 
\begin{DoxyCompactList}\small\item\em Give the delta-\/index corresponding to the delta-\/point {\ttfamily dp}. \item\end{DoxyCompactList}\item 
const \hyperlink{a00135}{box2d} \& \hyperlink{a00248_a05ee26234739511c3b77f65ba3ba5c9f}{domain} () const 
\begin{DoxyCompactList}\small\item\em Give the definition domain. \item\end{DoxyCompactList}\item 
T \& \hyperlink{a00248_a04e7789e066ff8d0997d1986b0093129}{element} (unsigned i)
\begin{DoxyCompactList}\small\item\em Read-\/write access to the image value located at index {\ttfamily i}. \item\end{DoxyCompactList}\item 
const T \& \hyperlink{a00248_a5991d79fdf209e9d7b29fc0efe28cf03}{element} (unsigned i) const 
\begin{DoxyCompactList}\small\item\em Read-\/only access to the image value located at index {\ttfamily i}. \item\end{DoxyCompactList}\item 
bool \hyperlink{a00248_a70b260b50a6c95cd492e5ab13caeb8e7}{has} (const \hyperlink{a00330}{point2d} \&p) const 
\begin{DoxyCompactList}\small\item\em Test if {\ttfamily p} is valid. \item\end{DoxyCompactList}\item 
\hyperlink{a00248_a241c3bf0e05106980ac2e48193a2ee72}{image2d} (int nrows, int ncols, unsigned bdr=border::thickness)
\begin{DoxyCompactList}\small\item\em Constructor with the numbers of rows and columns and the border thickness. \item\end{DoxyCompactList}\item 
\hyperlink{a00248_a86c28138be4cca155a496af8fe50b66c}{image2d} ()
\begin{DoxyCompactList}\small\item\em Constructor without argument. \item\end{DoxyCompactList}\item 
\hyperlink{a00248_aebdfc4ae563390c06bd769eed1a4ff82}{image2d} (const \hyperlink{a00135}{box2d} \&b, unsigned bdr=border::thickness)
\begin{DoxyCompactList}\small\item\em Constructor with a box and the border thickness (default is 3). \item\end{DoxyCompactList}\item 
unsigned \hyperlink{a00248_a1e301eb26a593c25e6349ddde5d1400f}{ncols} () const 
\begin{DoxyCompactList}\small\item\em Give the number of columns. \item\end{DoxyCompactList}\item 
unsigned \hyperlink{a00248_a89ba12e0728355524678155076275b56}{nelements} () const 
\begin{DoxyCompactList}\small\item\em Give the number of elements (points including border ones). \item\end{DoxyCompactList}\item 
unsigned \hyperlink{a00248_a12cf1a9d5caccbc42ee6ea71cb13d764}{nrows} () const 
\begin{DoxyCompactList}\small\item\em Give the number of rows. \item\end{DoxyCompactList}\item 
const T \& \hyperlink{a00248_a3dde37a95018e4bc7812e38c6833d5e7}{operator()} (const \hyperlink{a00330}{point2d} \&p) const 
\begin{DoxyCompactList}\small\item\em Read-\/only access to the image value located at point {\ttfamily p}. \item\end{DoxyCompactList}\item 
T \& \hyperlink{a00248_abfa82e2e6e3f773e9473b9b33e1c77b3}{operator()} (const \hyperlink{a00330}{point2d} \&p)
\begin{DoxyCompactList}\small\item\em Read-\/write access to the image value located at point {\ttfamily p}. \item\end{DoxyCompactList}\item 
\hyperlink{a00330}{point2d} \hyperlink{a00248_ae3d4ba224cada46238ff62b68ec4f6c7}{point\_\-at\_\-index} (unsigned i) const 
\begin{DoxyCompactList}\small\item\em Give the point corresponding to the index {\ttfamily i}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename T$>$ class mln::image2d$<$ T $>$}

Basic 2D image class. The parameter {\ttfamily T} is the type of pixel values. This image class stores data in memory and has a virtual border with constant thickness around data. 

Definition at line 136 of file core/image/image2d.hh.



\subsection{Member Typedef Documentation}
\hypertarget{a00248_a25a9171e5aa9833954c69d863a240e78}{
\index{mln::image2d@{mln::image2d}!lvalue@{lvalue}}
\index{lvalue@{lvalue}!mln::image2d@{mln::image2d}}
\subsubsection[{lvalue}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T$>$ typedef T\& {\bf mln::image2d}$<$ T $>$::{\bf lvalue}}}
\label{dd/dd7/a00248_a25a9171e5aa9833954c69d863a240e78}


Return type of read-\/write access. 



Definition at line 148 of file core/image/image2d.hh.

\hypertarget{a00248_a14e2177d95bc9e8f60eb32e087106f13}{
\index{mln::image2d@{mln::image2d}!rvalue@{rvalue}}
\index{rvalue@{rvalue}!mln::image2d@{mln::image2d}}
\subsubsection[{rvalue}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T$>$ typedef const T\& {\bf mln::image2d}$<$ T $>$::{\bf rvalue}}}
\label{dd/dd7/a00248_a14e2177d95bc9e8f60eb32e087106f13}


Return type of read-\/only access. 



Definition at line 145 of file core/image/image2d.hh.

\hypertarget{a00248_adb5d5ae41d28bb582318f95dec370fde}{
\index{mln::image2d@{mln::image2d}!skeleton@{skeleton}}
\index{skeleton@{skeleton}!mln::image2d@{mln::image2d}}
\subsubsection[{skeleton}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T$>$ typedef {\bf image2d}$<$ tag::value\_\-$<$T$>$ $>$ {\bf mln::image2d}$<$ T $>$::{\bf skeleton}}}
\label{dd/dd7/a00248_adb5d5ae41d28bb582318f95dec370fde}


Skeleton. 



Definition at line 152 of file core/image/image2d.hh.

\hypertarget{a00248_a93c3496ad37acedd34fdfacbc9895476}{
\index{mln::image2d@{mln::image2d}!value@{value}}
\index{value@{value}!mln::image2d@{mln::image2d}}
\subsubsection[{value}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T$>$ typedef T {\bf mln::image2d}$<$ T $>$::{\bf value}}}
\label{dd/dd7/a00248_a93c3496ad37acedd34fdfacbc9895476}


\hyperlink{a00418}{Value} associated type. 



Definition at line 142 of file core/image/image2d.hh.



\subsection{Constructor \& Destructor Documentation}
\hypertarget{a00248_a86c28138be4cca155a496af8fe50b66c}{
\index{mln::image2d@{mln::image2d}!image2d@{image2d}}
\index{image2d@{image2d}!mln::image2d@{mln::image2d}}
\subsubsection[{image2d}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf mln::image2d}$<$ T $>$::{\bf image2d} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a86c28138be4cca155a496af8fe50b66c}


Constructor without argument. 



Definition at line 394 of file core/image/image2d.hh.

\hypertarget{a00248_a241c3bf0e05106980ac2e48193a2ee72}{
\index{mln::image2d@{mln::image2d}!image2d@{image2d}}
\index{image2d@{image2d}!mln::image2d@{mln::image2d}}
\subsubsection[{image2d}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf mln::image2d}$<$ T $>$::{\bf image2d} (
\begin{DoxyParamCaption}
\item[{int}]{ nrows, }
\item[{int}]{ ncols, }
\item[{unsigned}]{ bdr = {\ttfamily border::thickness}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a241c3bf0e05106980ac2e48193a2ee72}


Constructor with the numbers of rows and columns and the border thickness. 



Definition at line 400 of file core/image/image2d.hh.



References mln::make::box2d().

\hypertarget{a00248_aebdfc4ae563390c06bd769eed1a4ff82}{
\index{mln::image2d@{mln::image2d}!image2d@{image2d}}
\index{image2d@{image2d}!mln::image2d@{mln::image2d}}
\subsubsection[{image2d}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf mln::image2d}$<$ T $>$::{\bf image2d} (
\begin{DoxyParamCaption}
\item[{const {\bf box2d} \&}]{ b, }
\item[{unsigned}]{ bdr = {\ttfamily border::thickness}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_aebdfc4ae563390c06bd769eed1a4ff82}


Constructor with a box and the border thickness (default is 3). 



Definition at line 407 of file core/image/image2d.hh.



\subsection{Member Function Documentation}
\hypertarget{a00248_a62ec9a0c5d3c925dee36460dbbc28816}{
\index{mln::image2d@{mln::image2d}!bbox@{bbox}}
\index{bbox@{bbox}!mln::image2d@{mln::image2d}}
\subsubsection[{bbox}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ const {\bf box2d} \& {\bf mln::image2d}$<$ T $>$::bbox (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a62ec9a0c5d3c925dee36460dbbc28816}


Give the bounding box domain. 



Definition at line 433 of file core/image/image2d.hh.

\hypertarget{a00248_ab16197b145e60593c3f35803fba52620}{
\index{mln::image2d@{mln::image2d}!border@{border}}
\index{border@{border}!mln::image2d@{mln::image2d}}
\subsubsection[{border}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ unsigned {\bf mln::image2d}$<$ T $>$::border (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_ab16197b145e60593c3f35803fba52620}


Give the border thickness. 



Definition at line 520 of file core/image/image2d.hh.

\hypertarget{a00248_a7f1160b5acb82ed221f475a32f779a36}{
\index{mln::image2d@{mln::image2d}!buffer@{buffer}}
\index{buffer@{buffer}!mln::image2d@{mln::image2d}}
\subsubsection[{buffer}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ const T $\ast$ {\bf mln::image2d}$<$ T $>$::buffer (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a7f1160b5acb82ed221f475a32f779a36}


Give a hook to the value buffer. 



Definition at line 556 of file core/image/image2d.hh.

\hypertarget{a00248_a8fdc366bfa2126565e3a2ef86c0f09a8}{
\index{mln::image2d@{mln::image2d}!buffer@{buffer}}
\index{buffer@{buffer}!mln::image2d@{mln::image2d}}
\subsubsection[{buffer}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ T $\ast$ {\bf mln::image2d}$<$ T $>$::buffer (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a8fdc366bfa2126565e3a2ef86c0f09a8}


Give a hook to the value buffer. 



Definition at line 565 of file core/image/image2d.hh.

\hypertarget{a00248_a174edca58a4df9854c7b7394a54d9b88}{
\index{mln::image2d@{mln::image2d}!delta\_\-index@{delta\_\-index}}
\index{delta\_\-index@{delta\_\-index}!mln::image2d@{mln::image2d}}
\subsubsection[{delta\_\-index}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ int {\bf mln::image2d}$<$ T $>$::delta\_\-index (
\begin{DoxyParamCaption}
\item[{const {\bf dpoint2d} \&}]{ dp}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a174edca58a4df9854c7b7394a54d9b88}


Give the delta-\/index corresponding to the delta-\/point {\ttfamily dp}. 



Definition at line 574 of file core/image/image2d.hh.

\hypertarget{a00248_a05ee26234739511c3b77f65ba3ba5c9f}{
\index{mln::image2d@{mln::image2d}!domain@{domain}}
\index{domain@{domain}!mln::image2d@{mln::image2d}}
\subsubsection[{domain}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ const {\bf box2d} \& {\bf mln::image2d}$<$ T $>$::domain (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a05ee26234739511c3b77f65ba3ba5c9f}


Give the definition domain. 



Definition at line 424 of file core/image/image2d.hh.



Referenced by mln::morpho::line\_\-gradient(), mln::make\_\-debug\_\-graph\_\-image(), and mln::io::txt::save().

\hypertarget{a00248_a5991d79fdf209e9d7b29fc0efe28cf03}{
\index{mln::image2d@{mln::image2d}!element@{element}}
\index{element@{element}!mln::image2d@{mln::image2d}}
\subsubsection[{element}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ const T \& {\bf mln::image2d}$<$ T $>$::element (
\begin{DoxyParamCaption}
\item[{unsigned}]{ i}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a5991d79fdf209e9d7b29fc0efe28cf03}


Read-\/only access to the image value located at index {\ttfamily i}. 



Definition at line 538 of file core/image/image2d.hh.



References mln::image2d$<$ T $>$::nelements().

\hypertarget{a00248_a04e7789e066ff8d0997d1986b0093129}{
\index{mln::image2d@{mln::image2d}!element@{element}}
\index{element@{element}!mln::image2d@{mln::image2d}}
\subsubsection[{element}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ T \& {\bf mln::image2d}$<$ T $>$::element (
\begin{DoxyParamCaption}
\item[{unsigned}]{ i}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a04e7789e066ff8d0997d1986b0093129}


Read-\/write access to the image value located at index {\ttfamily i}. 



Definition at line 547 of file core/image/image2d.hh.



References mln::image2d$<$ T $>$::nelements().

\hypertarget{a00248_a70b260b50a6c95cd492e5ab13caeb8e7}{
\index{mln::image2d@{mln::image2d}!has@{has}}
\index{has@{has}!mln::image2d@{mln::image2d}}
\subsubsection[{has}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ bool {\bf mln::image2d}$<$ T $>$::has (
\begin{DoxyParamCaption}
\item[{const {\bf point2d} \&}]{ p}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a70b260b50a6c95cd492e5ab13caeb8e7}


Test if {\ttfamily p} is valid. 



Definition at line 451 of file core/image/image2d.hh.



Referenced by mln::image2d$<$ T $>$::operator()(), and mln::debug::put\_\-word().

\hypertarget{a00248_a1e301eb26a593c25e6349ddde5d1400f}{
\index{mln::image2d@{mln::image2d}!ncols@{ncols}}
\index{ncols@{ncols}!mln::image2d@{mln::image2d}}
\subsubsection[{ncols}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ unsigned {\bf mln::image2d}$<$ T $>$::ncols (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a1e301eb26a593c25e6349ddde5d1400f}


Give the number of columns. 



Definition at line 508 of file core/image/image2d.hh.

\hypertarget{a00248_a89ba12e0728355524678155076275b56}{
\index{mln::image2d@{mln::image2d}!nelements@{nelements}}
\index{nelements@{nelements}!mln::image2d@{mln::image2d}}
\subsubsection[{nelements}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ unsigned {\bf mln::image2d}$<$ T $>$::nelements (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a89ba12e0728355524678155076275b56}


Give the number of elements (points including border ones). 



Definition at line 529 of file core/image/image2d.hh.



Referenced by mln::image2d$<$ T $>$::element(), and mln::image2d$<$ T $>$::point\_\-at\_\-index().

\hypertarget{a00248_a12cf1a9d5caccbc42ee6ea71cb13d764}{
\index{mln::image2d@{mln::image2d}!nrows@{nrows}}
\index{nrows@{nrows}!mln::image2d@{mln::image2d}}
\subsubsection[{nrows}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ unsigned {\bf mln::image2d}$<$ T $>$::nrows (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a12cf1a9d5caccbc42ee6ea71cb13d764}


Give the number of rows. 



Definition at line 499 of file core/image/image2d.hh.

\hypertarget{a00248_abfa82e2e6e3f773e9473b9b33e1c77b3}{
\index{mln::image2d@{mln::image2d}!operator()@{operator()}}
\index{operator()@{operator()}!mln::image2d@{mln::image2d}}
\subsubsection[{operator()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ T \& {\bf mln::image2d}$<$ T $>$::operator() (
\begin{DoxyParamCaption}
\item[{const {\bf point2d} \&}]{ p}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_abfa82e2e6e3f773e9473b9b33e1c77b3}


Read-\/write access to the image value located at point {\ttfamily p}. 



Definition at line 469 of file core/image/image2d.hh.



References mln::image2d$<$ T $>$::has().

\hypertarget{a00248_a3dde37a95018e4bc7812e38c6833d5e7}{
\index{mln::image2d@{mln::image2d}!operator()@{operator()}}
\index{operator()@{operator()}!mln::image2d@{mln::image2d}}
\subsubsection[{operator()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ const T \& {\bf mln::image2d}$<$ T $>$::operator() (
\begin{DoxyParamCaption}
\item[{const {\bf point2d} \&}]{ p}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_a3dde37a95018e4bc7812e38c6833d5e7}


Read-\/only access to the image value located at point {\ttfamily p}. 



Definition at line 460 of file core/image/image2d.hh.



References mln::image2d$<$ T $>$::has().

\hypertarget{a00248_ae3d4ba224cada46238ff62b68ec4f6c7}{
\index{mln::image2d@{mln::image2d}!point\_\-at\_\-index@{point\_\-at\_\-index}}
\index{point\_\-at\_\-index@{point\_\-at\_\-index}!mln::image2d@{mln::image2d}}
\subsubsection[{point\_\-at\_\-index}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf point2d} {\bf mln::image2d}$<$ T $>$::point\_\-at\_\-index (
\begin{DoxyParamCaption}
\item[{unsigned}]{ i}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{dd/dd7/a00248_ae3d4ba224cada46238ff62b68ec4f6c7}


Give the point corresponding to the index {\ttfamily i}. 



Definition at line 584 of file core/image/image2d.hh.



References mln::image2d$<$ T $>$::nelements().

