|  | VISION Documentation (VAPI) |  | Last update: 07/04/18
Download documentation | V A P I |

1. Presentation

VAPI (VISION's Application Programmer Interface) is a part of VISION designed to help you develop LDVs. You must have guessed that internally, VISION uses numerous functions to handle images (bit-planes conversions <--> TOS/VDI indexes, rasters handling,...) as well as user interface functions (e.g., progress windows).
The aim of VAPI is make available to LDVs these functions reserved, until now, to the internal operations of VISION. There are two interests for an LDV:

- Its author spares the time to develop again an existing function
- The LDV is lighter

Of course, VISION has numerous functions (more or less easy and elegant...), a choice must then be made on which ones to export. Furthermore, VISION could also export its data such as the catalog, the image Browser, etc...
Since it still takes a lot of time to design and make all this, I will first ensure that VISION exports first a few "basic" functions, then, if success increases, more will follow.

2. Development kit

The VAPI development kit is identical to the LDV one. You will find it here.

3. Use

Using VAPI from an LDV is very simple: when VISION call the GetLDVCapabilities function, it returns a pointer on a structure of the type VAPI. Without going into details, this stucture contains the following information:

- A header of the type VAPI_HEADER
- A list of "loose" functions. These functions are in fact put together in groups (also called interfaces). Each group is terminated by an unused memory area, which purpose is to host new functions from the same group. If new groups are created, they will go at the end of the structure, to garanty ascending compatibility.

Now, to use a function from VAPI, it's very simple; imagine you want to initialise the destination image raster passed as a parameter in the Run function, with the colour white (in bit-plane or True Color); you just have to insert the following line:

Vapi->RaImgWhite( &out->Raster ) ;

This only suppose you maintained the VAPI pointer provided by VISION through GetLDVCapabilities (done automatically by the skeleton).

The list of all functions defined by the VAPI interface is available here. Sorry, but all the interfaces and the function names are in English! (Translator's note: this remark is obviously for French readers).

4. Available interfaces

Interfaces are grouping function having a common interest. Here is the list (which I hope is not complete) of the current interfaces:

Progress Interface | Raster Interface | Configuration Interface | INI Interface
MEM Interface | Logging Interface |  |

|  | VISION Documentation (VAPI) |  | Last update: 07/04/18
Download documentation | V A P I |