\section{KImage\-IO Class Reference}
\label{classKImageIO}\index{KImageIO@{KImageIO}}
Interface to the {\bf KDE} Image IO plugin architecture.  


{\tt \#include $<$kimageio.h$>$}

\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Mode} \{ {\bf Reading}, 
{\bf Writing}
 \}
\begin{CompactList}\small\item\em Possible image file access modes. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf register\-Formats} ()
\begin{CompactList}\small\item\em Registers all KImage\-IO supported formats. \item\end{CompactList}\item 
bool {\bf can\-Write} (const  {\bf QString} \&type)
\begin{CompactList}\small\item\em Checks if a special type is supported for writing. \item\end{CompactList}\item 
bool {\bf can\-Read} (const  {\bf QString} \&type)
\begin{CompactList}\small\item\em Checks if a special type is supported for reading. \item\end{CompactList}\item 
{\bf QString\-List} {\bf types} ({\bf Mode} mode=Writing)
\begin{CompactList}\small\item\em Returns a list of all KImage\-IO supported formats. \item\end{CompactList}\item 
{\bf QString} {\bf pattern} ({\bf Mode} mode=Reading)
\begin{CompactList}\small\item\em Returns a list of patterns of all KImage\-IO supported formats. \item\end{CompactList}\item 
{\bf QString} {\bf suffix} (const  {\bf QString} \&type)
\begin{CompactList}\small\item\em Returns the suffix of an image type. \item\end{CompactList}\item 
{\bf QString} {\bf type\-For\-Mime} (const  {\bf QString} \&mime\-Type)
\begin{CompactList}\small\item\em Returns the type of a MIME type. \item\end{CompactList}\item 
{\bf QString} {\bf type} (const  {\bf QString} \&filename)
\begin{CompactList}\small\item\em Returns the type of given filename. \item\end{CompactList}\item 
{\bf QString\-List} {\bf mime\-Types} ({\bf Mode} \_\-mode=Writing)
\begin{CompactList}\small\item\em Returns a list of MIME types for all KImage\-IO supported formats. \item\end{CompactList}\item 
bool {\bf is\-Supported} (const  {\bf QString} \&\_\-mime\-Type, {\bf Mode} \_\-mode=Writing)
\begin{CompactList}\small\item\em Test to see whether a MIME type is supported to reading/writing. \item\end{CompactList}\item 
{\bf QString} {\bf mime\-Type} (const  {\bf QString} \&\_\-filename)
\begin{CompactList}\small\item\em Returns the MIME type of {\tt \_\-filename}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Interface to the {\bf KDE} Image IO plugin architecture. 

This library allows {\bf KDE} applications to read and write images in a variety of formats, transparently via the {\bf QImage} and {\bf QPixmap} load and save methods.

The image processing backends are written as image handlers compatible with the {\bf QImage\-IO} handler format. The backends are loaded on demand when a particular format is requested. Each format can be identified by a unique type id string.

{\bf  Formats}

{\bf  Currently supported formats include: \begin{itemize}
\item JPEG  \item XV   \item EPS   \item NETPBM  \item PNG  $<$write, only with newer libraries$>$ \item TIFF  \item KRL \end{itemize}
}

{\bf {\bf  Usage}}

{\bf {\bf  Simply call the {\bf KImage\-IO::register\-Formats}{\rm (p.\,\pageref{classKImageIO_e0})}() static method declared in kimgageio.h.}}

{\bf {\bf  }}

{\bf {\bf {\bf  Example}}}

{\bf {\bf {\bf  \small\begin{alltt}
	#include$<$qpixmap.h$>$
 	#include$<$kimgio.h$>$\end{alltt}\normalsize 
}}}

{\bf {\bf {\bf \small\begin{alltt}	int main( int argc, char **argv )
	\{
		....
		{\bf KImageIO::registerFormats()}{\rm (p.\,\pageref{classKImageIO_e0})};\end{alltt}\normalsize 
}}}

{\bf {\bf {\bf \small\begin{alltt}		...	// start main program
	\}
 \end{alltt}\normalsize 
}}}

{\bf {\bf {\bf  \begin{Desc}
\item[See also:]KImage\-IO, {\bf QPixmap}, {\bf QImage}, {\bf QImage\-IO} \end{Desc}
\begin{Desc}
\item[Author:]Sirtaj Singh Kang \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kimageio.h}{\rm (p.\,\pageref{kimageio_8h})},v 1.9 2002/09/28 14:41:42 tjansen Exp \end{Desc}
\end{Desc}
}}}



Definition at line 62 of file kimageio.h.

\subsection{Member Enumeration Documentation}
\index{KImageIO@{KImage\-IO}!Mode@{Mode}}
\index{Mode@{Mode}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KImage\-IO::Mode}}\label{classKImageIO_w2}


Possible image file access modes. 

Used in various KImage\-IO static function. 

Definition at line 70 of file kimageio.h.

\subsection{Member Function Documentation}
\index{KImageIO@{KImage\-IO}!registerFormats@{registerFormats}}
\index{registerFormats@{registerFormats}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KImage\-IO::register\-Formats ()\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e0}


Registers all KImage\-IO supported formats. 



Definition at line 378 of file kimageio.cpp.\index{KImageIO@{KImage\-IO}!canWrite@{canWrite}}
\index{canWrite@{canWrite}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KImage\-IO::can\-Write (const {\bf QString} \& {\em type})\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e1}


Checks if a special type is supported for writing. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the}]type id of the image type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the image format can be written \end{Desc}


Definition at line 392 of file kimageio.cpp.

References QValue\-List::Const\-Iterator().\index{KImageIO@{KImage\-IO}!canRead@{canRead}}
\index{canRead@{canRead}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KImage\-IO::can\-Read (const {\bf QString} \& {\em type})\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e2}


Checks if a special type is supported for reading. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the}]type id of the image type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the image format can be read \end{Desc}


Definition at line 411 of file kimageio.cpp.

References QValue\-List::Const\-Iterator().\index{KImageIO@{KImage\-IO}!types@{types}}
\index{types@{types}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KImage\-IO::types ({\bf Mode} {\em mode} = Writing)\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e3}


Returns a list of all KImage\-IO supported formats. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}]Tells whether to retrieve modes that can be read or written. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a list of the type ids \end{Desc}


Definition at line 430 of file kimageio.cpp.

References QValue\-List::Const\-Iterator(), and types().

Referenced by types().\index{KImageIO@{KImage\-IO}!pattern@{pattern}}
\index{pattern@{pattern}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KImage\-IO::pattern ({\bf Mode} {\em mode} = Reading)\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e4}


Returns a list of patterns of all KImage\-IO supported formats. 

These patterns can be passed to {\bf KFile\-Dialog::get\-Open\-File\-Name}{\rm (p.\,\pageref{classKFileDialog_e0})}() or {\bf KFile\-Dialog::get\-Save\-File\-Name}{\rm (p.\,\pageref{classKFileDialog_e4})}(), for example.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}]Tells whether to retrieve modes that can be read or written. \end{description}
\end{Desc}


Definition at line 384 of file kimageio.cpp.\index{KImageIO@{KImage\-IO}!suffix@{suffix}}
\index{suffix@{suffix}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KImage\-IO::suffix (const {\bf QString} \& {\em type})\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e5}


Returns the suffix of an image type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]the type id of the file format \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the suffix of the file format or QString::null if it does not exist \end{Desc}


Definition at line 450 of file kimageio.cpp.

References QValue\-List::Const\-Iterator().

Referenced by type().\index{KImageIO@{KImage\-IO}!typeForMime@{typeForMime}}
\index{typeForMime@{typeForMime}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KImage\-IO::type\-For\-Mime (const {\bf QString} \& {\em mime\-Type})\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e6}


Returns the type of a MIME type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mime\-Type}]the MIME type to search \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]type id of the MIME type or QString::null if the MIME type is not supported \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 469 of file kimageio.cpp.

References QValue\-List::Const\-Iterator().\index{KImageIO@{KImage\-IO}!type@{type}}
\index{type@{type}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KImage\-IO::type (const {\bf QString} \& {\em filename})\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e7}


Returns the type of given filename. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filename}]the filename to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]if the file name's suffix is known the type id of the file type, otherwise QString::null \end{Desc}


Definition at line 488 of file kimageio.cpp.

References QValue\-List::Const\-Iterator(), QString::find\-Rev(), QString::mid(), and suffix().\index{KImageIO@{KImage\-IO}!mimeTypes@{mimeTypes}}
\index{mimeTypes@{mimeTypes}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KImage\-IO::mime\-Types ({\bf Mode} {\em \_\-mode} = Writing)\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e8}


Returns a list of MIME types for all KImage\-IO supported formats. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}]Tells whether to retrieve modes that can be read or written. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a list if MIME types of the supported formats \end{Desc}


Definition at line 511 of file kimageio.cpp.

References QValue\-List::Const\-Iterator().

Referenced by KFile\-Dialog::get\-Image\-Open\-URL().\index{KImageIO@{KImage\-IO}!isSupported@{isSupported}}
\index{isSupported@{isSupported}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KImage\-IO::is\-Supported (const {\bf QString} \& {\em \_\-mime\-Type}, {\bf Mode} {\em \_\-mode} = Writing)\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e9}


Test to see whether a MIME type is supported to reading/writing. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-mime\-Type}]the MIME type to check \item[{\em \_\-mode}]Tells whether to check for reading or writing capabilities \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the type is supported \end{Desc}


Definition at line 533 of file kimageio.cpp.

References QValue\-List::Const\-Iterator().\index{KImageIO@{KImage\-IO}!mimeType@{mimeType}}
\index{mimeType@{mimeType}!KImageIO@{KImage\-IO}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KImage\-IO::mime\-Type (const {\bf QString} \& {\em \_\-filename})\hspace{0.3cm}{\tt  [static]}}\label{classKImageIO_e10}


Returns the MIME type of {\tt \_\-filename}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-filename}]the filename to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the MIME type of the file, or QString::null \end{Desc}


Definition at line 556 of file kimageio.cpp.

References KMime\-Type::find\-By\-URL().

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