\doxysection{config\+\_\+reader.\+Config\+Reader Class Reference}
\hypertarget{classconfig__reader_1_1_config_reader}{}\label{classconfig__reader_1_1_config_reader}\index{config\_reader.ConfigReader@{config\_reader.ConfigReader}}


A configuration file reader for INI-\/format files.  


\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classconfig__reader_1_1_config_reader_a70e0896df493418bcd5141f2993782b8}{\+\_\+\+\_\+init\+\_\+\+\_\+}} (self, str config\+\_\+path)
\begin{DoxyCompactList}\small\item\em Constructor for Config\+Reader. \end{DoxyCompactList}\item 
float \mbox{\hyperlink{classconfig__reader_1_1_config_reader_a6e217468c739d2eda8817c877120faee}{get\+\_\+linear\+\_\+parameter}} (self)
\begin{DoxyCompactList}\small\item\em Retrieves the linear parameter value. \end{DoxyCompactList}\item 
str \mbox{\hyperlink{classconfig__reader_1_1_config_reader_aa4e4c572ed961e775087dea2b6fe5a7d}{get\+\_\+image\+\_\+path}} (self)
\begin{DoxyCompactList}\small\item\em Retrieves the image path. \end{DoxyCompactList}\item 
str \mbox{\hyperlink{classconfig__reader_1_1_config_reader_a20251c6138f3074d009da3f4d1f5bec1}{get\+\_\+overlap}} (self)
\begin{DoxyCompactList}\small\item\em Retrieves the overlap value. \end{DoxyCompactList}\item 
str \mbox{\hyperlink{classconfig__reader_1_1_config_reader_ab310f31cd285ea1e3c547f787e14a06b}{get\+\_\+blend\+\_\+mode}} (self)
\begin{DoxyCompactList}\small\item\em Retrieves the blend mode. \end{DoxyCompactList}\item 
None \mbox{\hyperlink{classconfig__reader_1_1_config_reader_a495934bcec3171c12a637c16ccd14158}{save\+\_\+config}} (self)
\begin{DoxyCompactList}\small\item\em Saves the current configuration back to the file. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classconfig__reader_1_1_config_reader_a78404eeb66fe3332701caab02205ee5b}\label{classconfig__reader_1_1_config_reader_a78404eeb66fe3332701caab02205ee5b} 
{\bfseries file\+\_\+path}
\begin{DoxyCompactList}\small\item\em Path object representing the configuration file location. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
str \mbox{\hyperlink{classconfig__reader_1_1_config_reader_add11a5de02494c63cb77404bb93a61d1}{\+\_\+get}} (self, str section, str key, Any fallback=None)
\begin{DoxyCompactList}\small\item\em Internal helper method to safely retrieve configuration values. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classconfig__reader_1_1_config_reader_a732dbc9a6947d8af64764466bc9a3aae}\label{classconfig__reader_1_1_config_reader_a732dbc9a6947d8af64764466bc9a3aae} 
{\bfseries \+\_\+parser}
\begin{DoxyCompactList}\small\item\em Internal Config\+Parser instance for reading INI files. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A configuration file reader for INI-\/format files. 

This class provides a convenient interface for reading configuration parameters from INI files. It uses Python\textquotesingle{}s configparser module internally and provides type-\/safe accessor methods for different parameter types. The class is particularly designed for managing image processing configurations including linear parameters, image paths, overlap values, and blend modes.

The configuration file is expected to have a \textquotesingle{}Parameters\textquotesingle{} section with keys such as \textquotesingle{}linear\+\_\+parameter\textquotesingle{}, \textquotesingle{}image\+\_\+path\textquotesingle{}, \textquotesingle{}overlap\textquotesingle{}, and \textquotesingle{}blend\+\_\+mode\textquotesingle{}.

\begin{DoxyNote}{Note}
All getter methods provide default fallback values if the configuration keys are missing. 
\end{DoxyNote}


\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classconfig__reader_1_1_config_reader_a70e0896df493418bcd5141f2993782b8}\label{classconfig__reader_1_1_config_reader_a70e0896df493418bcd5141f2993782b8} 
\index{config\_reader.ConfigReader@{config\_reader.ConfigReader}!\_\_init\_\_@{\_\_init\_\_}}
\index{\_\_init\_\_@{\_\_init\_\_}!config\_reader.ConfigReader@{config\_reader.ConfigReader}}
\doxysubsubsection{\texorpdfstring{\_\_init\_\_()}{\_\_init\_\_()}}
{\footnotesize\ttfamily config\+\_\+reader.\+Config\+Reader.\+\_\+\+\_\+init\+\_\+\+\_\+ (\begin{DoxyParamCaption}\item[{}]{self,  }\item[{str}]{config\+\_\+path }\end{DoxyParamCaption})}



Constructor for Config\+Reader. 


\begin{DoxyParams}{Parameters}
{\em config\+\_\+path} & Path to the configuration file (string) \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em File\+Not\+Found\+Error} & if the configuration file doesn\textquotesingle{}t exist\\
\hline
\end{DoxyExceptions}
Initializes the Config\+Reader by loading the specified INI file. The file path is converted to a Path object for robust file handling. The configuration is immediately read into memory using configparser.

Example usage\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{reader\ =\ ConfigReader(\textcolor{stringliteral}{'/path/to/config.ini'})}

\end{DoxyCode}
 

\doxysubsection{Member Function Documentation}
\Hypertarget{classconfig__reader_1_1_config_reader_add11a5de02494c63cb77404bb93a61d1}\label{classconfig__reader_1_1_config_reader_add11a5de02494c63cb77404bb93a61d1} 
\index{config\_reader.ConfigReader@{config\_reader.ConfigReader}!\_get@{\_get}}
\index{\_get@{\_get}!config\_reader.ConfigReader@{config\_reader.ConfigReader}}
\doxysubsubsection{\texorpdfstring{\_get()}{\_get()}}
{\footnotesize\ttfamily  str config\+\_\+reader.\+Config\+Reader.\+\_\+get (\begin{DoxyParamCaption}\item[{}]{self,  }\item[{str}]{section,  }\item[{str}]{key,  }\item[{Any }]{fallback = {\ttfamily None} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}



Internal helper method to safely retrieve configuration values. 


\begin{DoxyParams}{Parameters}
{\em section} & The section name in the INI file \\
\hline
{\em key} & The key name within the section \\
\hline
{\em fallback} & Default value to return if section or key doesn\textquotesingle{}t exist \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Configuration value as a string, or fallback value
\end{DoxyReturn}
This method abstracts the error handling for missing sections or keys in the configuration file. It catches No\+Section\+Error and No\+Option\+Error exceptions and returns the fallback value instead. \Hypertarget{classconfig__reader_1_1_config_reader_ab310f31cd285ea1e3c547f787e14a06b}\label{classconfig__reader_1_1_config_reader_ab310f31cd285ea1e3c547f787e14a06b} 
\index{config\_reader.ConfigReader@{config\_reader.ConfigReader}!get\_blend\_mode@{get\_blend\_mode}}
\index{get\_blend\_mode@{get\_blend\_mode}!config\_reader.ConfigReader@{config\_reader.ConfigReader}}
\doxysubsubsection{\texorpdfstring{get\_blend\_mode()}{get\_blend\_mode()}}
{\footnotesize\ttfamily  str config\+\_\+reader.\+Config\+Reader.\+get\+\_\+blend\+\_\+mode (\begin{DoxyParamCaption}\item[{}]{self }\end{DoxyParamCaption})}



Retrieves the blend mode. 

\begin{DoxyReturn}{Returns}
Blend mode as a string
\end{DoxyReturn}
Reads the \textquotesingle{}blend\+\_\+mode\textquotesingle{} key from the \textquotesingle{}Parameters\textquotesingle{} section. Returns \textquotesingle{}linear\textquotesingle{} as the default value if the key doesn\textquotesingle{}t exist. Common blend modes might include \textquotesingle{}linear\textquotesingle{}, \textquotesingle{}average\textquotesingle{}, \textquotesingle{}max\textquotesingle{}, etc. \Hypertarget{classconfig__reader_1_1_config_reader_aa4e4c572ed961e775087dea2b6fe5a7d}\label{classconfig__reader_1_1_config_reader_aa4e4c572ed961e775087dea2b6fe5a7d} 
\index{config\_reader.ConfigReader@{config\_reader.ConfigReader}!get\_image\_path@{get\_image\_path}}
\index{get\_image\_path@{get\_image\_path}!config\_reader.ConfigReader@{config\_reader.ConfigReader}}
\doxysubsubsection{\texorpdfstring{get\_image\_path()}{get\_image\_path()}}
{\footnotesize\ttfamily  str config\+\_\+reader.\+Config\+Reader.\+get\+\_\+image\+\_\+path (\begin{DoxyParamCaption}\item[{}]{self }\end{DoxyParamCaption})}



Retrieves the image path. 

\begin{DoxyReturn}{Returns}
Image path as a string
\end{DoxyReturn}
Reads the \textquotesingle{}image\+\_\+path\textquotesingle{} key from the \textquotesingle{}Parameters\textquotesingle{} section. Returns an empty string if the key doesn\textquotesingle{}t exist. \Hypertarget{classconfig__reader_1_1_config_reader_a6e217468c739d2eda8817c877120faee}\label{classconfig__reader_1_1_config_reader_a6e217468c739d2eda8817c877120faee} 
\index{config\_reader.ConfigReader@{config\_reader.ConfigReader}!get\_linear\_parameter@{get\_linear\_parameter}}
\index{get\_linear\_parameter@{get\_linear\_parameter}!config\_reader.ConfigReader@{config\_reader.ConfigReader}}
\doxysubsubsection{\texorpdfstring{get\_linear\_parameter()}{get\_linear\_parameter()}}
{\footnotesize\ttfamily  float config\+\_\+reader.\+Config\+Reader.\+get\+\_\+linear\+\_\+parameter (\begin{DoxyParamCaption}\item[{}]{self }\end{DoxyParamCaption})}



Retrieves the linear parameter value. 

\begin{DoxyReturn}{Returns}
Linear parameter as a float
\end{DoxyReturn}
Reads the \textquotesingle{}linear\+\_\+parameter\textquotesingle{} key from the \textquotesingle{}Parameters\textquotesingle{} section. If the key doesn\textquotesingle{}t exist, returns 0.\+0 as the default value. The returned value is guaranteed to be a float type.

Example\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{linear\_val\ =\ reader.get\_linear\_parameter()}
\DoxyCodeLine{print(f\textcolor{stringliteral}{"{}Linear\ parameter:\ \{linear\_val\}"{}})}

\end{DoxyCode}
 \Hypertarget{classconfig__reader_1_1_config_reader_a20251c6138f3074d009da3f4d1f5bec1}\label{classconfig__reader_1_1_config_reader_a20251c6138f3074d009da3f4d1f5bec1} 
\index{config\_reader.ConfigReader@{config\_reader.ConfigReader}!get\_overlap@{get\_overlap}}
\index{get\_overlap@{get\_overlap}!config\_reader.ConfigReader@{config\_reader.ConfigReader}}
\doxysubsubsection{\texorpdfstring{get\_overlap()}{get\_overlap()}}
{\footnotesize\ttfamily  str config\+\_\+reader.\+Config\+Reader.\+get\+\_\+overlap (\begin{DoxyParamCaption}\item[{}]{self }\end{DoxyParamCaption})}



Retrieves the overlap value. 

\begin{DoxyReturn}{Returns}
Overlap value as a string
\end{DoxyReturn}
Reads the \textquotesingle{}overlap\textquotesingle{} key from the \textquotesingle{}Parameters\textquotesingle{} section. Returns \textquotesingle{}0\textquotesingle{} as the default value if the key doesn\textquotesingle{}t exist. \Hypertarget{classconfig__reader_1_1_config_reader_a495934bcec3171c12a637c16ccd14158}\label{classconfig__reader_1_1_config_reader_a495934bcec3171c12a637c16ccd14158} 
\index{config\_reader.ConfigReader@{config\_reader.ConfigReader}!save\_config@{save\_config}}
\index{save\_config@{save\_config}!config\_reader.ConfigReader@{config\_reader.ConfigReader}}
\doxysubsubsection{\texorpdfstring{save\_config()}{save\_config()}}
{\footnotesize\ttfamily  None config\+\_\+reader.\+Config\+Reader.\+save\+\_\+config (\begin{DoxyParamCaption}\item[{}]{self }\end{DoxyParamCaption})}



Saves the current configuration back to the file. 

\begin{DoxyReturn}{Returns}
None
\end{DoxyReturn}
Writes the current state of the configuration parser back to the original file. This is useful if the configuration has been modified programmatically and needs to be persisted.

\begin{DoxyWarning}{Warning}
This will overwrite the existing configuration file. 
\end{DoxyWarning}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Doxygen\+\_\+\+Final/\mbox{\hyperlink{config__reader_8py}{config\+\_\+reader.\+py}}\end{DoxyCompactItemize}
