JasPer: Configuration, Initialization, and Shutdown

JasPer 4.2.9 |

Loading...
Searching...
No Matches
Configuration, Initialization, and Shutdown

Configuration, Initialization, and Shutdown. More...

## Typedefs
typedef void * | jas_context_t
| An opaque handle type used to represent a JasPer library context.

## Functions
JAS_EXPORT void | jas_conf_clear (void)
| Configure the JasPer library with the default configuration settings.
JAS_EXPORT void | jas_conf_set_multithread (int multithread)
| Set the multithreading flag for the library.
JAS_EXPORT void | jas_conf_set_allocator (jas_allocator_t *allocator)
| Set the memory allocator to be used by the library.
JAS_EXPORT void | jas_conf_set_debug_level (int debug_level)
| Set the initial debug level for the library.
JAS_EXPORT void | jas_conf_set_max_mem_usage (size_t max_mem)
| Set the maximum amount of memory that can be used by the library (assuming the allocator wrapper is not disabled).
JAS_EXPORT void | jas_conf_set_dec_default_max_samples (size_t max_samples)
| Set the default value for the maximum number of samples that is allowed in an image to be decoded.
JAS_EXPORT void | jas_conf_set_vlogmsgf (jas_vlogmsgf_t *func)
| Set the function used by the library to output error, warning, and informational messages.
JAS_EXPORT int | jas_init_library (void)
| Initialize the JasPer library with the current configuration settings.
JAS_EXPORT int | jas_cleanup_library (void)
| Perform clean up for the JasPer library.
JAS_EXPORT int | jas_init_thread (void)
| Perform per-thread initialization for the JasPer library.
JAS_EXPORT int | jas_cleanup_thread (void)
| Perform per-thread cleanup for the JasPer library.
JAS_EXPORT int | jas_init (void)
| Configure and initialize the JasPer library using the default configuration settings.
JAS_EXPORT void | jas_cleanup (void)
| Perform any clean up for the JasPer library.
JAS_EXPORT jas_context_t | jas_context_create (void)
| Create a context.
JAS_EXPORT void | jas_context_destroy (jas_context_t context)
| Destroy a context.
JAS_EXPORT jas_context_t | jas_get_default_context (void)
| Get the current context for the calling thread.
JAS_EXPORT jas_context_t | jas_get_context (void)
| Get the current context for the calling thread.
JAS_EXPORT void | jas_set_context (jas_context_t context)
| Set the current context for the calling thread.
JAS_EXPORT void | jas_set_debug_level (int debug_level)
| Set the debug level for a particular context.
static int | jas_get_debug_level (void)
| Get the debug level for a particular context.
JAS_EXPORT void | jas_set_dec_default_max_samples (size_t max_samples)
| Set the default maximum number of samples that a decoder is permitted to process.
static size_t | jas_get_dec_default_max_samples (void)
| Get the default maximum number of samples that a decoder is permitted to process.
JAS_EXPORT void | jas_set_vlogmsgf (jas_vlogmsgf_t *func)
| Set the function to be used for log messages.
static jas_vlogmsgf_t * | jas_get_vlogmsgf (void)
| Get the function to be used for log messages.

## Detailed Description

Configuration, Initialization, and Shutdown.

General information can be found here.

## Typedef Documentation

## ◆ jas_context_t

typedef void* jas_context_t

An opaque handle type used to represent a JasPer library context.

## Function Documentation

## ◆ jas_cleanup()

JAS_EXPORT void jas_cleanup | ( | void |  | ) |

Perform any clean up for the JasPer library.

This function performs any clean up for the JasPer library.

Warning
  Configuration, initialization, and cleanup of the library must be performed on the same thread.

Deprecated
  This function is deprecated.

## ◆ jas_cleanup_library()

JAS_EXPORT int jas_cleanup_library | ( | void |  | ) |

Perform clean up for the JasPer library.

At the point when this function is called, all threads that have called jas_init_thread() must have called jas_cleanup_thread().

Returns
  If the operation is successful, zero is returned. Otherwise, a nonzero value is returned.

## ◆ jas_cleanup_thread()

JAS_EXPORT int jas_cleanup_thread | ( | void |  | ) |

Perform per-thread cleanup for the JasPer library.

## ◆ jas_conf_clear()

JAS_EXPORT void jas_conf_clear | ( | void |  | ) |

Configure the JasPer library with the default configuration settings.

This function configures the JasPer library with the default configuration settings. These settings may be change via the `jas_conf_*` family of function prior to invoking jas_init_library().

Warning
  Configuration, initialization, and cleanup of the library must be performed on the same thread.

## ◆ jas_conf_set_allocator()

JAS_EXPORT void jas_conf_set_allocator | ( | jas_allocator_t * | allocator | ) |

Set the memory allocator to be used by the library.

The object referenced by `allocator` must have a live at least until jas_cleanup() is invoked. How the memory in which `*allocator` reside is allocated is the responsibility of the caller.

## ◆ jas_conf_set_debug_level()

JAS_EXPORT void jas_conf_set_debug_level | ( | int | debug_level | ) |

Set the initial debug level for the library.

## ◆ jas_conf_set_dec_default_max_samples()

JAS_EXPORT void jas_conf_set_dec_default_max_samples | ( | size_t | max_samples | ) |

Set the default value for the maximum number of samples that is allowed in an image to be decoded.

## ◆ jas_conf_set_max_mem_usage()

JAS_EXPORT void jas_conf_set_max_mem_usage | ( | size_t | max_mem | ) |

Set the maximum amount of memory that can be used by the library (assuming the allocator wrapper is not disabled).

Warning
  It is strongly recommended that the memory usage limit not be set to an excessively large value, as this poses security risks (e.g., decoding a malicious image file could exhaust all virtual memory and effectively crash the system).

## ◆ jas_conf_set_multithread()

JAS_EXPORT void jas_conf_set_multithread | ( | int | multithread | ) |

Set the multithreading flag for the library.

## ◆ jas_conf_set_vlogmsgf()

JAS_EXPORT void jas_conf_set_vlogmsgf | ( | jas_vlogmsgf_t * | func | ) |

Set the function used by the library to output error, warning, and informational messages.

## ◆ jas_context_create()

JAS_EXPORT jas_context_t jas_context_create | ( | void |  | ) |

Create a context.

## ◆ jas_context_destroy()

JAS_EXPORT void jas_context_destroy | ( | jas_context_t | context | ) |

Destroy a context.

The context being destroyed must not be the current context.

## ◆ jas_get_context()

JAS_EXPORT jas_context_t jas_get_context | ( | void |  | ) |

Get the current context for the calling thread.

## ◆ jas_get_debug_level()

int jas_get_debug_level | ( | void |  | ) |
| inlinestatic

Get the debug level for a particular context.

## ◆ jas_get_dec_default_max_samples()

size_t jas_get_dec_default_max_samples | ( | void |  | ) |
| inlinestatic

Get the default maximum number of samples that a decoder is permitted to process.

## ◆ jas_get_default_context()

JAS_EXPORT jas_context_t jas_get_default_context | ( | void |  | ) |

Get the current context for the calling thread.

## ◆ jas_get_vlogmsgf()

jas_vlogmsgf_t * jas_get_vlogmsgf | ( | void |  | ) |
| inlinestatic

Get the function to be used for log messages.

## ◆ jas_init()

JAS_EXPORT int jas_init | ( | void |  | ) |

Configure and initialize the JasPer library using the default configuration settings.

The jas_init() function initializes the JasPer library. The library must be initialized before most code in the library can be used.

The jas_init() function exists only for reasons of backward compatibility with earlier versions of the library. It is recommended that this function not be used. Instead, the jas_conf_clear() and jas_init_library() functions should be used to configure and initialize the library.

Returns
  If the library is successfully initialized, zero is returned; otherwise, a nonzero value is returned.

Warning
  Configuration, initialization, and cleanup of the library must be performed on the same thread.

Deprecated
  This function is deprecated.

## ◆ jas_init_library()

JAS_EXPORT int jas_init_library | ( | void |  | ) |

Initialize the JasPer library with the current configuration settings.

The library must be configured by invoking the jas_conf_clear() function prior to calling jas_init_library().

Returns
  If the initialization of the library is successful, zero is returned; otherwise, a nonzero value is returned.

Warning
  The jas_init_library() function does NOT synchronize with the jas_conf_clear() function. Configuration, initialization, and cleanup of the library must be performed on the same thread.

## ◆ jas_init_thread()

JAS_EXPORT int jas_init_thread | ( | void |  | ) |

Perform per-thread initialization for the JasPer library.

The library must be initialized by invoking the jas_init_library() function prior to calling jas_init_thread().

Warning
  The jas_init_thread() function can only be invoked in a single thread unless the run-time configuration has enabled multithreading via jas_set_multithread().

## ◆ jas_set_context()

JAS_EXPORT void jas_set_context | ( | jas_context_t | context | ) |

Set the current context for the calling thread.

## ◆ jas_set_debug_level()

JAS_EXPORT void jas_set_debug_level | ( | int | debug_level | ) |

Set the debug level for a particular context.

## ◆ jas_set_dec_default_max_samples()

JAS_EXPORT void jas_set_dec_default_max_samples | ( | size_t | max_samples | ) |

Set the default maximum number of samples that a decoder is permitted to process.

## ◆ jas_set_vlogmsgf()

JAS_EXPORT void jas_set_vlogmsgf | ( | jas_vlogmsgf_t * | func | ) |

Set the function to be used for log messages.