latest version v1.9 - last update 10 Apr 2010 |
00001 /* 00002 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * This file is part of the LTI-Computer Vision Library (LTI-Lib) 00006 * 00007 * The LTI-Lib is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License (LGPL) 00009 * as published by the Free Software Foundation; either version 2.1 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * The LTI-Lib is distributed in the hope that it will be 00013 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 00014 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with the LTI-Lib; see the file LICENSE. If 00019 * not, write to the Free Software Foundation, Inc., 59 Temple Place - 00020 * Suite 330, Boston, MA 02111-1307, USA. 00021 */ 00022 00023 00024 /*---------------------------------------------------------------- 00025 * project ....: LTI Digital Image/Signal Processing Library 00026 * file .......: ltiGtkColorDialog.h 00027 * authors ....: Pablo Alvarado 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 21.4.2000 00030 * revisions ..: $Id: ltiGtkColorDialog.h,v 1.3 2006/02/08 12:56:18 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_GTK_COLOR_DIALOG_H_ 00034 #define _LTI_GTK_COLOR_DIALOG_H_ 00035 00036 #include "ltiConfig.h" 00037 00038 #ifdef HAVE_GTK 00039 00040 #include <gtk/gtk.h> 00041 #include <list> 00042 #include <string> 00043 #include "ltiTypes.h" 00044 #include "ltiRGBPixel.h" 00045 00046 namespace lti { 00047 00048 /** 00049 * allows to choose a color in the HSI or RGB color space 00050 */ 00051 class colorDialog : public object { 00052 public: 00053 /** 00054 * create the color dialog and specify the color to be edited 00055 */ 00056 colorDialog(); 00057 00058 /** 00059 * destructor 00060 */ 00061 virtual ~colorDialog(); 00062 00063 /** 00064 * show the dialog 00065 */ 00066 void show(); 00067 00068 /** 00069 * hide the dialog 00070 */ 00071 void hide(); 00072 00073 /** 00074 * specify the variable with the predifined color, and where the 00075 * user defined color will be left. 00076 */ 00077 void useColor(rgbPixel& pixel); 00078 00079 protected: 00080 rgbPixel color; 00081 rgbPixel* extColor; 00082 00083 GtkWidget *colorselectiondialog; 00084 GtkWidget *ok_button1; 00085 GtkWidget *cancel_button1; 00086 GtkWidget *help_button1; 00087 00088 static void colorChanged_callback(GtkColorSelection* widget, 00089 gpointer data); 00090 00091 void colorChanged_local(GtkColorSelection* widget); 00092 00093 static void ok_callback(GtkWidget *widget, 00094 gpointer data); 00095 void ok_local(GtkWidget *widget); 00096 00097 static void cancel_callback(GtkWidget *widget, 00098 gpointer data); 00099 void cancel_local(GtkWidget *widget); 00100 }; 00101 00102 } 00103 00104 #endif 00105 00106 #endif