Hermes 1.2 API: Initialisation of the Library

Next Previous Contents

## 1. Initialisation of the Library

Hermes has to be fully initialised before any conversion routines can be called. Otherwise error codes will be returned. All initialisation routines are reference counted, so feel free to call them repeatedly, they will only be initialised once (or if you closed it down and open it again).

## 1.1 int Hermes_Init()

Hermes_Init will initialise Hermes and return a non-zero status code on success. In detail, this is what happens:

- Check reference count. If non-zero, return success immediately.
- If assembler support is compiled in, run the processor detection routine. Hold your breath.
- Call the Converter Factory to initialise all converters with the fastest possible configuration.
- Initialise clearing routines using the Clearing Factory.
- Initialise dithering matrices.
- Increase reference count, return success.

## 1.2 int Hermes_Done()

Hermes_Done will decrease the reference count of HERMES and if it goes down to zero, it will deinitialise the library. That means it will get rid of all the converter routines, etc.

If the reference count ever falls below zero, this routine will return an error because you've done something wrong.

Next Previous Contents