To summarise, here is what happens between VISION and an LDV:
0. Init (done a single time at the first user call using LDVs). VISION loads the GetLDVCapabilities function of each LDV, calls the function and memorizes the capabilities of each LDV to limit future hard drive accesses, then launches each LDV
1. VISION loads the LDV
2. VISION calls the PreRun function
3. VISION calls the Run (or Preview) function
4. VISION unloads the LDV
Prototype | LDV_INFOS * cdecl GetLDVCapabilities(VAPI *vapi) |
Parameters | [IN] vapi: pointer on the VAPI interface provided by VISION. This pointer must be memorized for future use. |
Return | A pointer on the structure LDV_INFOS stored in the LDV (the skeleton declares the LdvInfos variable of the type LDV_INFOS) |
Responsibilities | This function is completely written in the
skeleton. The works to be done is to fill the structure of the
type |
Prototype | LDV_STATUS cdecl PreRun(LDV_IMAGE *in, LDV_PARAMS *params, LDV_IMAGE *out) |
Parameters | [IN] in: pointer on
the structure LDV_IMAGE
describing the image of VISION [IN / OUT] params: pointeur on a structure LDV_PARAMS indicating the area to modify |
Return | A success or error code |
Responsibilities | Must mention to VISION
the memory to allocate and the part to be saved by the UNDO
function:
By default:
|
Prototype | LDV_STATUS cdecl Run(LDV_IMAGE *in, LDV_PARAMS *params, LDV_IMAGE *out) |
Parameters | [IN] in: pointer on the
structure LDV_IMAGE
describing the source image of
VISION [IN] params: pointer on a structure LDV_PARAMS indicating the area to modify [OUT] out: pointer of the destination image , allocate by VISION with a previous call to PreRun |
Return | A success or error code |
Responsibilities / Comments | Must do the operation forecasted for
the LDV. VISION choses automatically the most adapted format while trying to minimise the memory, taking into account the format(s) handled by the LDV (knowing the most economical is LDVF_SPECFORMAT) The LDV can modify another area than the one given in the fields x1, y1, x2 and y2 of params if it was mentionned previously by the PreRun function NEVER allocate in the LDV memory for VISION, because it will be freed as soon as VISION will unload the LDV (even if you do not do it explicitely, the compiler of the system will do it). On the other hand, nothing prevents you from allocating memory for internal usage related to this function, but do not forget to free it! |
Prototype | LDV_STATUS cdecl Preview(LDV_IMAGE *in, LDV_PARAMS *params, LDV_IMAGE *out) |
Parameters | Identical to those of the function Run |
Return | A success or error code |
Responsibilities / Comments | This function is identical to the function Run, but it operates on smaller images (112 x 112 on average). If the function Run is fast enough to display the result in less than 1 second, the Preview function should simply call it. Otherwise, it is possible to do some approximations or pre-computation to be back below a second. |
The INI file associated to an LDV has two purposes:
LDVs are multi-lingual, i.e., if a language has been defined in preferences, VISION is able to use this information also for the LDVs, provided the information is available. The .LDV and the associated .INI are located in the LDV directory of VISION. For instance, the file INVERT.INI is associated to the file INVERT.LDV. In the LDV folder, the more standard LDVs must be found, i.e., in English. If, for instance, you have defined "Français" in the preferences of VISION, you just have to create the directory "Français" in the folder LDV, and to include the file INVERT.INI translated in French in this directory, for VISION to seek this file instead of the one included directly in the LDV directory.
In the [Informations] section, VISION expects the following entries:
Name of entry | Size | Description |
ShortName | Max. 15 characters | Short name of the module appearing in the list of modules to select |
LongName | Max. 31 characters | Name appearing when details are required on this LDV |
Description | Max. 79 characters | Complete description of the module on 3 lines |
VISION allows to enter up to 4
parameters in an LDV. These parameters are entered using GEM sliders that
appear or not according to the number of input parameters of the LDV.
For VISION to accept to display a parameter,
a section named [ParameterN] (1 <= N <= 4)
must be created with the following entries:
Name of entry | Description |
Name | Name of this parameter (max. 15 characters). If the name is not given, this parameter will not appear |
Type | 0: 16 bits integer(-32768 --> +32767) 1: float (not handled currently) |
MinValue | Minimum allowed value for this parameter |
DefautValue | Default value given in VISION GUI |
MaxValue | Maximum allowed value for this parameter |