Referência ao ficheiro src/vapiOperationOptions.h

This file stores some low level functions to handle operation's custom options. Mais...

#include "vapiTypes.h"
#include "vapiOptions.h"
#include "vapiOperation.h"
#include "vapiImages.h"

Diagrama de dependências de inclusão para vapiOperationOptions.h:

Este grafo mostra quais são os ficheiros que incluem directamente ou indirectamente este ficheiro:

Ir para o código fonte deste ficheiro.

Funções

void vapiCheckOptOriginal (vImages *Images, vOptions *Options)
 Check if the Original is set to true. This is a custom option, only in use by operations. This checks if the original is set to true and makes the operation use the original image if so.
vOptionsvapiOperationOptionsInit (vEffect *Operation)
 Initiates an Custom Options structure.
vOptionsvapiOptionsCopy (vEffect *Operation, vOptions *Options)
 Creates a copy of supplied Operation's options data structure.
IplImage * vapiOptionsGetTemplate (vOptions *Options)
 fetches the template from the options data. This function is used to access the options data and avoid errors.
void vEffectOptionsFree (vOptions *Options, vOptionsSettings *OptionsSettings)
 Frees the custom options used by the operation. This function is used from inside the free options general function.
void vOperationOptionsFree (vOptions *Options, vEffect *Operation)
 Frees a complete Options data structure, including the custom operation options' data.
void vOptionsFreeTemplate (vOptions *options)
 Frees a template form the Options data structure.


Descrição detalhada

This file stores some low level functions to handle operation's custom options.

Definido no ficheiro vapiOperationOptions.h.


Documentação das funções

void vapiCheckOptOriginal ( vImages Images,
vOptions Options 
)

Check if the Original is set to true. This is a custom option, only in use by operations. This checks if the original is set to true and makes the operation use the original image if so.

Parâmetros:
Images The image's handler
Options The options Data structure.

Definido na linha 44 do ficheiro vapiOperationOptions.c.

Referências _vOptions::CustomOptions, vapiOriginal2Actual() e vImagesFreeActual().

Referenciado por vapiApplyOperation() e vapiLaplace().

00045 {
00046         if (((vEffectOptions *) Options->CustomOptions)->original)
00047         {
00048                 vImagesFreeActual (Images);
00049                 vapiOriginal2Actual (Images);
00050         }
00051 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

vOptions* vapiOperationOptionsInit ( vEffect Operation  ) 

Initiates an Custom Options structure.

Parâmetros:
Operation so that the function can read the options settings and create the data struture has defined.
Retorna:
an options sata structure.

Definido na linha 11 do ficheiro vapiOperationOptions.c.

Referências _vOptions::CustomOptions, _vOptionsSettings::CustomOptionsSettings, _vEffectSettings::NeedOfAuxImage, NeedRegion, NeedTemplate, _vEffect::OptionsSettings, _vEffectOptions::original, _vEffectOptions::Template, _vEffectOptions::times, vapiOptionsInit() e vFALSE.

Referenciado por vapiCalibrateCameraCreateMacro(), vapiCalibrateCameraGetColourAOptions(), vapiCalibrateCameraGetColourBOptions(), vapiGtkMacroAppendItem(), vapiGtkMacroInsertItem(), vapiGtkMacroUpdateItemOptions(), vapiGtkOperationApply(), vapiGtkOperationShowOptions(), vapiMacroFromXML() e vapiOptionsCopy().

00012 {
00013         vOptions *Options;
00014         vEffectOptions *CustomOptions;
00015         vEffectSettings *OperationSettings;
00016 
00017         /*
00018          * Pequena verificação de segurança.
00019          */
00020         if (Operation == NULL)
00021         {
00022                 return NULL;
00023         }
00024         CustomOptions =
00025                 malloc (sizeof (vEffectOptions));
00026         OperationSettings =
00027                 Operation->OptionsSettings->CustomOptionsSettings;
00028         Options = vapiOptionsInit (Operation->OptionsSettings);
00029         Options->CustomOptions = CustomOptions;
00030 
00031         CustomOptions->original = vFALSE;
00032         CustomOptions->times = 1;
00033 
00034         if (OperationSettings->NeedOfAuxImage == NeedTemplate
00035             || OperationSettings->NeedOfAuxImage == NeedRegion)
00036         {
00037                 CustomOptions->Template = NULL;
00038         }
00039 
00040         return Options;
00041 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

vOptions* vapiOptionsCopy ( vEffect Operation,
vOptions Options 
)

Creates a copy of supplied Operation's options data structure.

Retorna:
a new Options data structure.

Definido na linha 82 do ficheiro vapiOperationOptions.c.

Referências _vOptions::booleans, _vOptionsSettings::booleansNumber, _vChar::ch, _vOptions::chars, _vOptionsSettings::charsNumber, _vOptions::choices, _vOptionsSettings::chooseNumber, _vOptions::floats, _vOptionsSettings::floatsNumber, _vOptions::ints, _vOptionsSettings::intsNumber, NeedRegion, NeedTemplate, _vEffect::OptionsSettings, vapiOperationOptionsInit() e vapiReturnStringPointer().

00083 {
00084         vOptions *Options2;
00085         int i;
00086 
00087         Options2 = vapiOperationOptionsInit (Operation);
00088 
00089         /*
00090          * Pequena verificação de segurança.
00091          */
00092         if (Operation == NULL)
00093         {
00094                 return NULL;
00095         }
00096         ((vEffectOptions *) Options2)->original =
00097                 ((vEffectOptions *) Options)->original;
00098         ((vEffectOptions *) Options2)->times =
00099                 ((vEffectOptions *) Options)->times;
00100 
00101         /*
00102          * Definição e alocação de espaço de acordo com as necessidades da operação.
00103          */
00104         if (Operation->OptionsSettings->floatsNumber)
00105         {
00106                 for (i = 0; i < Operation->OptionsSettings->floatsNumber; i++)
00107                 {
00108                         Options2->floats[i] = Options2->floats[i];
00109                 }
00110         }
00111         if (Operation->OptionsSettings->intsNumber)
00112         {
00113 
00114                 for (i = 0; i < Operation->OptionsSettings->intsNumber; i++)
00115                 {
00116                         Options2->ints[i] = Options->ints[i];
00117                 }
00118         }
00119 
00120         if (Operation->OptionsSettings->charsNumber)
00121         {
00122                 for (i = 0; i < Operation->OptionsSettings->charsNumber; i++)
00123                 {
00124                         Options2->chars[i].ch =
00125                                 vapiReturnStringPointer (Options->chars[i].
00126                                                          ch);
00127                 }
00128         }
00129         if (Operation->OptionsSettings->chooseNumber)
00130         {
00131 
00132                 for (i = 0; i < Operation->OptionsSettings->chooseNumber; i++)
00133                 {
00134                         Options2->choices[i] = Options->choices[i];
00135                 }
00136         }
00137         if (Operation->OptionsSettings->booleansNumber)
00138         {
00139 
00140                 for (i = 0; i < Operation->OptionsSettings->booleansNumber;
00141                      i++)
00142                 {
00143                         Options2->booleans[i] = Options->booleans[i];
00144                 }
00145         }
00146         if (((vEffectSettings *) Operation->OptionsSettings->
00147              CustomOptionsSettings)->NeedOfAuxImage == NeedTemplate
00148             || ((vEffectSettings *) Operation->OptionsSettings->
00149                 CustomOptionsSettings)->NeedOfAuxImage == NeedRegion)
00150         {
00151                 ((vEffectOptions *) Options2)->Template =
00152                         ((vEffectOptions *) Options)->Template;
00153         }
00154 
00155         return Options2;
00156 
00157 }

Grafo de chamadas desta função:

IplImage* vapiOptionsGetTemplate ( vOptions Options  ) 

fetches the template from the options data. This function is used to access the options data and avoid errors.

Retorna:
the IplImage pointer for the template.

Definido na linha 167 do ficheiro vapiOperationOptions.c.

Referências _vOptions::CustomOptions e _vEffectOptions::Template.

Referenciado por vapiTemplateMatch().

00168 {
00169         vEffectOptions * OperationOptions = Options->CustomOptions;
00170         
00171         return OperationOptions->Template;
00172 }

Here is the caller graph for this function:

void vEffectOptionsFree ( vOptions Options,
vOptionsSettings OptionsSettings 
)

Frees the custom options used by the operation. This function is used from inside the free options general function.

Definido na linha 54 do ficheiro vapiOperationOptions.c.

Referências _vOptions::CustomOptions, _vOptionsSettings::CustomOptionsSettings, _vEffectSettings::NeedOfAuxImage, NoNeed e vOptionsFreeTemplate().

Referenciado por vOperationOptionsFree().

00055 {
00056         vEffectSettings *OperationSettings =
00057                 OptionsSettings->CustomOptionsSettings;
00058 
00059         if (OperationSettings->NeedOfAuxImage != NoNeed)
00060         {
00061                 vOptionsFreeTemplate (Options);
00062         }
00063         free (Options->CustomOptions);
00064 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vOperationOptionsFree ( vOptions Options,
vEffect Operation 
)

Frees a complete Options data structure, including the custom operation options' data.

Definido na linha 160 do ficheiro vapiOperationOptions.c.

Referências _vEffect::OptionsSettings, vEffectOptionsFree() e vOptionsFree().

Referenciado por vapiGtkMacroUpdateItemOptions(), vapiGtkOperationApply(), vapiGtkOperationShowOptions() e vMacroItemFree().

00161 {
00162         vOptionsFree (Options, Operation->OptionsSettings,
00163                       &vEffectOptionsFree);
00164 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vOptionsFreeTemplate ( vOptions options  ) 

Frees a template form the Options data structure.

Definido na linha 67 do ficheiro vapiOperationOptions.c.

Referências _vOptions::CustomOptions.

Referenciado por vEffectOptionsFree().

00068 {
00069         if (!
00070             (((vEffectOptions *) options->CustomOptions)->Template ==
00071              NULL))
00072         {
00073                 cvReleaseImage (&
00074                                 ((vEffectOptions *) options->
00075                                  CustomOptions)->Template);
00076 
00077         }
00078 }

Here is the caller graph for this function:


Gerado em Tue Jul 24 10:39:04 2007 para Vapi por  doxygen 1.5.1