# Documentation VISION (VAPI) : Configuration Interface

|  | Documentation VISION (VAPI) |  | Dernière mise à jour : 02/12/20
| IMAGE INTERFACE |

Summary
Interface prefix | Im
Number of functions | 7
Description | Set of functions to manage images files

Prototype | long cdecl ImGetInf(char* filename, void* ldv_img)
Parameters | filename: name of the image file ldv_img: pointer to a LDV_IMAGE structure
Return | LDV_STATUS
Description | Reads informatiuons from the file and fills in the LDV_IMAGE strucutre. Image is not loaded (see next function) but all image caracteristics such as width, height, number of planes, ... are fetched.
Comments | Call ImFree to free related resources
Version VAPI | 1.09 or more

Prototype | long cdecl ImLoad(void* ldv_img)
Parameters | ldv_img: pointer to LDV_IMAGE structure previously filled-in by ImGetInf
Return | LDV_STATUS
Description | Loads the image into memory
Comments | Image data is read during this call
Version VAPI | 1.09 or more

Prototype | void cdecl ImFree(void* ldv_img)
Parameters | ldv_img: pointer to LDV_IMAGE structure previously filled-in by ImGetInf
Return | None
Description | Frees resources allocated by ImGetInf and ImLoad
Comments | .
Version VAPI | 1.09 or more

Prototype | long cdecl ImSave(char* filename, void* ldv_img, char* save_options) ;
Parameters | filename: name of file to save image ldv_img: LDV_IMAGE structure defining image to save save_options: standard options, separated by '';',(option=<value>): fmt = <3 characters defining image format> quality=<quality 0...100> (JPEG) flipflop=<0 ou 2> (0: no flip-flop, 2: Y flip-flop) (TGA) compression=<none or lzw> (TIF) byteorder=<motorola or intel> (TIF)
Return | LDV_STATUS
Description | Saves an image residing in memory to a file
Comments | Example status = Vapi->ImSave( "h:\\test.tif", ldv_img, "fmt=TIF;compression=LZW;byteorder=motorola" ) ; Some options depend on the format; they may be ignored by the driver in charge of saving Check out opnsav.vcs script for an example on the options
Version VAPI | 1.09 or more

Prototype | long cdecl ImDither(long method, long param, void* ldv_img_in, void* ldv_img_out)

Parameters

method: dither method to use:

- 0: Auto, let VISION decide
- 1: monochrome mattrix
- 2: grey level
- 3: 216 colors
- 4: dual-tone

ldv_img_in: LDV_IMAGE structure usually provided by VISION
ldv_img_out: LDV_IMAGE structure holding dithered image

Return | LDV_STATUS
Description | Request VISION to dither an image using a method Output number of planes shall be stated in variable out->Raster.fd_nplanes (1,4,8,16 ou32)
Comments |
Version VAPI | 1.09 or more

Prototype | long cdecl ImGetStdData(void* ldv_img, char* query, char* out_data, long out_data_size) ;

Parameters

ldv_img: pointer to LDV_IMAGE structure previously filled-in by ImGetInf
query: string to request standard atribute which list follows:

- filename: filename passed to ImGetInf

out_data: string holding value of the requested attribute
out_data_size: size, in bytes, of out_data buffer

Return | LDV_STATUS
Description | Requests standard data on an image
Comments | See optimg.ldv source code
Version VAPI | 1.09 or more

Prototype | long cdecl ImComputeHistogram(void* ldv_img, HISTO *histo) ;
Parameters | ldv_img: LDV_IMAGE structure defining image to compute histograms histo: pointeur to a HISTO structure containing the result
Return | LDV_STATUS
Description | Requests VISION to compute histograms
Remarques | .histo->norm shall be initialized to tell VISION what is the maximal value for the highest repetition frequency See optimg.ldv source code
Version VAPI | 1.09 or more

|  | Documentation VISION (VAPI) |  |
| IMAGE INTERFACE |