00001 #include <stdio.h>
00002 #include <gtk/gtk.h>
00003 #include <glade/glade.h>
00004 #include "vapiGtkInterface.h"
00005 #include "vapi.h"
00006 #include "vapiTypes.h"
00007 #include "vapiMacro.h"
00008 #include "vapiOperationList.h"
00009 #include "vapiOperationOptions.h"
00010 #include "vapiGtkCalibrateCamera.h"
00011 #include "vapiCameraCalibrate.h"
00012
00013 vapi3Options *
00014 vapiCalibrateCameraGetColourAOptions (vOperationList * OperationList,
00015 GladeXML * xml)
00016 {
00017 vEffect *tempOperation;
00018 vapi3Options *Options = vapi3OptionsInit ();
00019 GtkWidget *HueMin, *HueMax;
00020 GtkWidget *SatMin, *SatMax;
00021 GtkWidget *ValueMin, *ValueMax;
00022 GtkWidget *ErodeTimes, *DilateTimes;
00023
00024
00025
00026
00027
00028 HueMin = glade_xml_get_widget (xml, "scCalibrateAHueMin");
00029 HueMax = glade_xml_get_widget (xml, "scCalibrateAHueMax");
00030 SatMin = glade_xml_get_widget (xml, "scCalibrateASaturationMin");
00031 SatMax = glade_xml_get_widget (xml, "scCalibrateASaturationMax");
00032 ValueMin = glade_xml_get_widget (xml, "scCalibrateAValueMin");
00033 ValueMax = glade_xml_get_widget (xml, "scCalibrateAValueMax");
00034 ErodeTimes = glade_xml_get_widget (xml, "spinCalibrateATimesErode");
00035 DilateTimes = glade_xml_get_widget (xml, "spinCalibrateATimesDilate");
00036
00037
00038
00039 tempOperation =
00040 vapiOperationListSelectOperation (OperationList,
00041 "Filtro de Cor");
00042 Options->Option0 = vapiOperationOptionsInit (tempOperation);
00043 Options->Option0->floats[0] =
00044 gtk_range_get_value ((GtkRange *) HueMin);
00045 Options->Option0->floats[1] =
00046 gtk_range_get_value ((GtkRange *) HueMax);
00047 Options->Option0->floats[2] =
00048 gtk_range_get_value ((GtkRange *) SatMin);
00049 Options->Option0->floats[3] =
00050 gtk_range_get_value ((GtkRange *) SatMax);
00051 Options->Option0->floats[4] =
00052 gtk_range_get_value ((GtkRange *) ValueMin);
00053 Options->Option0->floats[5] =
00054 gtk_range_get_value ((GtkRange *) ValueMax);
00055
00056
00057
00058
00059
00060 tempOperation =
00061 vapiOperationListSelectOperation (OperationList, "Erode");
00062 Options->Option1 = vapiOperationOptionsInit (tempOperation);
00063 ((vEffectOptions *) Options->Option1->CustomOptions)->times =
00064 gtk_spin_button_get_value_as_int ((GtkSpinButton *)
00065 ErodeTimes);
00066
00067
00068
00069
00070
00071 tempOperation =
00072 vapiOperationListSelectOperation (OperationList, "Dilate");
00073 Options->Option2 = vapiOperationOptionsInit (tempOperation);
00074 ((vEffectOptions *) Options->Option2->CustomOptions)->times =
00075 gtk_spin_button_get_value_as_int ((GtkSpinButton *)
00076 DilateTimes);
00077
00078 return Options;
00079
00080 }
00081
00082 vapi3Options *
00083 vapiCalibrateCameraGetColourBOptions (vOperationList * OperationList,
00084 GladeXML * xml)
00085 {
00086 vEffect *tempOperation;
00087 vapi3Options *Options = vapi3OptionsInit ();
00088 GtkWidget *HueMin, *HueMax;
00089 GtkWidget *SatMin, *SatMax;
00090 GtkWidget *ValueMin, *ValueMax;
00091 GtkWidget *ErodeTimes, *DilateTimes;
00092
00093
00094
00095
00096
00097 HueMin = glade_xml_get_widget (xml, "scCalibrateBHueMin");
00098 HueMax = glade_xml_get_widget (xml, "scCalibrateBHueMax");
00099 SatMin = glade_xml_get_widget (xml, "scCalibrateBSaturationMin");
00100 SatMax = glade_xml_get_widget (xml, "scCalibrateBSaturationMax");
00101 ValueMin = glade_xml_get_widget (xml, "scCalibrateBValueMin");
00102 ValueMax = glade_xml_get_widget (xml, "scCalibrateBValueMax");
00103 ErodeTimes = glade_xml_get_widget (xml, "spinCalibrateBTimesErode");
00104 DilateTimes = glade_xml_get_widget (xml, "spinCalibrateBTimesDilate");
00105
00106
00107
00108 tempOperation =
00109 vapiOperationListSelectOperation (OperationList,
00110 "Filtro de Cor");
00111 Options->Option0 = vapiOperationOptionsInit (tempOperation);
00112 Options->Option0->floats[0] =
00113 gtk_range_get_value ((GtkRange *) HueMin);
00114 Options->Option0->floats[1] =
00115 gtk_range_get_value ((GtkRange *) HueMax);
00116 Options->Option0->floats[2] =
00117 gtk_range_get_value ((GtkRange *) SatMin);
00118 Options->Option0->floats[3] =
00119 gtk_range_get_value ((GtkRange *) SatMax);
00120 Options->Option0->floats[4] =
00121 gtk_range_get_value ((GtkRange *) ValueMin);
00122 Options->Option0->floats[5] =
00123 gtk_range_get_value ((GtkRange *) ValueMax);
00124
00125
00126
00127
00128
00129 tempOperation =
00130 vapiOperationListSelectOperation (OperationList, "Erode");
00131 Options->Option1 = vapiOperationOptionsInit (tempOperation);
00132 ((vEffectOptions *) Options->Option1->CustomOptions)->times =
00133 gtk_spin_button_get_value_as_int ((GtkSpinButton *)
00134 ErodeTimes);
00135
00136
00137
00138
00139
00140 tempOperation =
00141 vapiOperationListSelectOperation (OperationList, "Dilate");
00142 Options->Option2 = vapiOperationOptionsInit (tempOperation);
00143 ((vEffectOptions *) Options->Option2->CustomOptions)->times =
00144 gtk_spin_button_get_value_as_int ((GtkSpinButton *)
00145 DilateTimes);
00146
00147 return Options;
00148
00149 }