\section{KPixmap\-Region\-Selector\-Widget Class Reference}
\label{classKPixmapRegionSelectorWidget}\index{KPixmapRegionSelectorWidget@{KPixmapRegionSelectorWidget}}
KPixmap\-Region\-Selector\-Widget is a widget that shows a picture and provides the user with a friendly way to select a rectangular subregion of the pixmap.  


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

Inheritance diagram for KPixmap\-Region\-Selector\-Widget:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=95pt]{classKPixmapRegionSelectorWidget__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KPixmap\-Region\-Selector\-Widget:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=264pt]{classKPixmapRegionSelectorWidget__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf rotate\-Clockwise} ()
\item 
void {\bf rotate\-Counterclockwise} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KPixmap\-Region\-Selector\-Widget} ({\bf QWidget} $\ast$parent=0L, const char $\ast$name=0L)
\item 
{\bf $\sim$KPixmap\-Region\-Selector\-Widget} ()
\item 
void {\bf set\-Pixmap} (const {\bf QPixmap} \&pixmap)
\item 
{\bf QPixmap} {\bf pixmap} () const 
\item 
void {\bf set\-Selected\-Region} (const {\bf QRect} \&{\bf rect})
\item 
{\bf QRect} {\bf selected\-Region} () const 
\item 
{\bf QRect} {\bf unzoomed\-Selected\-Region} () const 
\item 
void {\bf reset\-Selection} ()
\item 
{\bf QImage} {\bf selected\-Image} () const 
\item 
void {\bf set\-Selection\-Aspect\-Ratio} (int {\bf width}, int {\bf height})
\item 
void {\bf set\-Free\-Selection\-Aspect\-Ratio} ()
\item 
void {\bf set\-Maximum\-Widget\-Size} (int {\bf width}, int {\bf height})
\item 
void {\bf rotate} ({\bf KImage\-Effect::Rotate\-Direction} direction)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf KPopup\-Menu} $\ast$ {\bf create\-Popup\-Menu} ()
\end{CompactItemize}


\subsection{Detailed Description}
KPixmap\-Region\-Selector\-Widget is a widget that shows a picture and provides the user with a friendly way to select a rectangular subregion of the pixmap. 

NOTE: There are two copies of this .h and the .cpp file, with subtle differences. One copy is in kdelibs/kdeui, and the other copy is in kdepim/libkdepim This is because kdepim has to remain backwards compatible. Any changes to either file should be made to the other.

\begin{Desc}
\item[Author:]Antonio Larrosa $<${\tt larrosa@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Since:]3.4 \end{Desc}




Definition at line 44 of file kpixmapregionselectorwidget.h.

\subsection{Constructor \& Destructor Documentation}
\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!KPixmapRegionSelectorWidget@{KPixmapRegionSelectorWidget}}
\index{KPixmapRegionSelectorWidget@{KPixmapRegionSelectorWidget}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPixmap\-Region\-Selector\-Widget::KPixmap\-Region\-Selector\-Widget ({\bf QWidget} $\ast$ {\em parent} = {\tt 0L}, const char $\ast$ {\em name} = {\tt 0L})}\label{classKPixmapRegionSelectorWidget_a0}


Constructor for a KPixmap\-Region\-Selector\-Widget. 



Definition at line 40 of file kpixmapregionselectorwidget.cpp.\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!~KPixmapRegionSelectorWidget@{$\sim$KPixmapRegionSelectorWidget}}
\index{~KPixmapRegionSelectorWidget@{$\sim$KPixmapRegionSelectorWidget}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPixmap\-Region\-Selector\-Widget::$\sim${\bf KPixmap\-Region\-Selector\-Widget} ()}\label{classKPixmapRegionSelectorWidget_a1}


Destructor for a KPixmap\-Region\-Selector\-Widget. 



Definition at line 63 of file kpixmapregionselectorwidget.cpp.

\subsection{Member Function Documentation}
\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!setPixmap@{setPixmap}}
\index{setPixmap@{setPixmap}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::set\-Pixmap (const {\bf QPixmap} \& {\em pixmap})}\label{classKPixmapRegionSelectorWidget_a2}


Sets the pixmap which will be shown for the user to select a region from. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pixmap}]The pixmap. Must be non-null. \end{description}
\end{Desc}


Definition at line 67 of file kpixmapregionselectorwidget.cpp.

References QPixmap::is\-Null(), pixmap(), reset\-Selection(), and QLabel::set\-Pixmap().

Referenced by KPixmap\-Region\-Selector\-Dialog::get\-Selected\-Image(), and KPixmap\-Region\-Selector\-Dialog::get\-Selected\-Region().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!pixmap@{pixmap}}
\index{pixmap@{pixmap}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KPixmap\-Region\-Selector\-Widget::pixmap () const\hspace{0.3cm}{\tt  [inline]}}\label{classKPixmapRegionSelectorWidget_a3}


\begin{Desc}
\item[Returns:]the original whole pixmap that we're using in this widget as the pixmap the user is selecting a region from. \end{Desc}


Definition at line 69 of file kpixmapregionselectorwidget.h.

Referenced by set\-Pixmap().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!setSelectedRegion@{setSelectedRegion}}
\index{setSelectedRegion@{setSelectedRegion}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::set\-Selected\-Region (const {\bf QRect} \& {\em rect})}\label{classKPixmapRegionSelectorWidget_a4}


Sets the selected region to be {\tt rect} (in zoomed pixmap coordinates). 



Definition at line 87 of file kpixmapregionselectorwidget.cpp.

References reset\-Selection(), and unzoomed\-Selected\-Region().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!selectedRegion@{selectedRegion}}
\index{selectedRegion@{selectedRegion}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QRect} KPixmap\-Region\-Selector\-Widget::selected\-Region () const}\label{classKPixmapRegionSelectorWidget_a5}


Returns the selected region ( in zoomed pixmap coordinates ). 



Definition at line 82 of file kpixmapregionselectorwidget.cpp.\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!unzoomedSelectedRegion@{unzoomedSelectedRegion}}
\index{unzoomedSelectedRegion@{unzoomedSelectedRegion}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QRect} KPixmap\-Region\-Selector\-Widget::unzoomed\-Selected\-Region () const}\label{classKPixmapRegionSelectorWidget_a6}


Returns the selected region ( in unzoomed, original pixmap coordinates ). 



Definition at line 388 of file kpixmapregionselectorwidget.cpp.

References QRect::height(), QRect::width(), QRect::x(), and QRect::y().

Referenced by KPixmap\-Region\-Selector\-Dialog::get\-Selected\-Region(), selected\-Image(), and set\-Selected\-Region().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!resetSelection@{resetSelection}}
\index{resetSelection@{resetSelection}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::reset\-Selection ()}\label{classKPixmapRegionSelectorWidget_a7}


Resets the selection to use the whole image. 



Definition at line 76 of file kpixmapregionselectorwidget.cpp.

References QPixmap::rect().

Referenced by rotate(), set\-Pixmap(), and set\-Selected\-Region().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!selectedImage@{selectedImage}}
\index{selectedImage@{selectedImage}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QImage} KPixmap\-Region\-Selector\-Widget::selected\-Image () const}\label{classKPixmapRegionSelectorWidget_a8}


\begin{Desc}
\item[Returns:]a {\bf QImage} object with just the region the user selected from the image \end{Desc}


Definition at line 396 of file kpixmapregionselectorwidget.cpp.

References QPixmap::convert\-To\-Image(), QImage::copy(), and unzoomed\-Selected\-Region().

Referenced by KPixmap\-Region\-Selector\-Dialog::get\-Selected\-Image().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!setSelectionAspectRatio@{setSelectionAspectRatio}}
\index{setSelectionAspectRatio@{setSelectionAspectRatio}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::set\-Selection\-Aspect\-Ratio (int {\em width}, int {\em height})}\label{classKPixmapRegionSelectorWidget_a9}


Sets the aspect ration that the selected subimage should have. 

The way to select it, is specifying an example valid {\tt width} and {\tt height}. \begin{Desc}
\item[See also:]{\bf set\-Free\-Selection\-Aspect\-Ratio()}{\rm (p.\,\pageref{classKPixmapRegionSelectorWidget_a10})} \end{Desc}


Definition at line 402 of file kpixmapregionselectorwidget.cpp.

Referenced by KPixmap\-Region\-Selector\-Dialog::get\-Selected\-Image(), and KPixmap\-Region\-Selector\-Dialog::get\-Selected\-Region().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!setFreeSelectionAspectRatio@{setFreeSelectionAspectRatio}}
\index{setFreeSelectionAspectRatio@{setFreeSelectionAspectRatio}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::set\-Free\-Selection\-Aspect\-Ratio ()}\label{classKPixmapRegionSelectorWidget_a10}


Allows the user to do a selection which has any aspect ratio. 

This is the default. \begin{Desc}
\item[See also:]{\bf set\-Selection\-Aspect\-Ratio()}{\rm (p.\,\pageref{classKPixmapRegionSelectorWidget_a9})} \end{Desc}


Definition at line 407 of file kpixmapregionselectorwidget.cpp.\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!setMaximumWidgetSize@{setMaximumWidgetSize}}
\index{setMaximumWidgetSize@{setMaximumWidgetSize}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::set\-Maximum\-Widget\-Size (int {\em width}, int {\em height})}\label{classKPixmapRegionSelectorWidget_a11}


Sets the maximum size for the widget. 

If the image is larger than this (either horizontally or vertically), it's scaled to adjust to the maximum size (preserving the aspect ratio) 

Definition at line 412 of file kpixmapregionselectorwidget.cpp.

References QPixmap::convert\-From\-Image(), QPixmap::convert\-To\-Image(), QRect::height(), QPixmap::height(), QPixmap::is\-Null(), QRect::is\-Valid(), QPixmap::rect(), QWidget::resize(), QImage::smooth\-Scale(), QRect::width(), QPixmap::width(), QRect::x(), and QRect::y().

Referenced by KPixmap\-Region\-Selector\-Dialog::get\-Selected\-Image(), and KPixmap\-Region\-Selector\-Dialog::get\-Selected\-Region().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!rotate@{rotate}}
\index{rotate@{rotate}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::rotate ({\bf KImage\-Effect::Rotate\-Direction} {\em direction})}\label{classKPixmapRegionSelectorWidget_a12}


Rotates the image as specified by the {\tt direction} parameter, also tries to rotate the selected region so that it doesn't change, as long as the forced aspect ratio setting is respected, in other case, the selected region is resetted. 



Definition at line 160 of file kpixmapregionselectorwidget.cpp.

References QPixmap::convert\-From\-Image(), QPixmap::convert\-To\-Image(), QRect::height(), QPixmap::height(), reset\-Selection(), KImage\-Effect::rotate(), QRect::set\-Rect(), QRect::width(), QPixmap::width(), QRect::x(), and QRect::y().

Referenced by rotate\-Clockwise(), and rotate\-Counterclockwise().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!rotateClockwise@{rotateClockwise}}
\index{rotateClockwise@{rotateClockwise}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::rotate\-Clockwise ()\hspace{0.3cm}{\tt  [slot]}}\label{classKPixmapRegionSelectorWidget_i0}


Rotates the current image 90\^{A}186 clockwise. 



Definition at line 199 of file kpixmapregionselectorwidget.cpp.

References rotate().

Referenced by create\-Popup\-Menu().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!rotateCounterclockwise@{rotateCounterclockwise}}
\index{rotateCounterclockwise@{rotateCounterclockwise}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPixmap\-Region\-Selector\-Widget::rotate\-Counterclockwise ()\hspace{0.3cm}{\tt  [slot]}}\label{classKPixmapRegionSelectorWidget_i1}


Rotates the current image 90\^{A}186 counterclockwise. 



Definition at line 204 of file kpixmapregionselectorwidget.cpp.

References rotate().

Referenced by create\-Popup\-Menu().\index{KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}!createPopupMenu@{createPopupMenu}}
\index{createPopupMenu@{createPopupMenu}!KPixmapRegionSelectorWidget@{KPixmap\-Region\-Selector\-Widget}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPopup\-Menu} $\ast$ KPixmap\-Region\-Selector\-Widget::create\-Popup\-Menu ()\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKPixmapRegionSelectorWidget_b0}


Creates a {\bf KPopup\-Menu}{\rm (p.\,\pageref{classKPopupMenu})} with the menu that appears when clicking with the right button on the label. 



Definition at line 138 of file kpixmapregionselectorwidget.cpp.

References KPopup\-Menu::insert\-Title(), rotate\-Clockwise(), and rotate\-Counterclockwise().

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