Go to the documentation of this file.
71 #include <jasper/jas_config.h>
88 #if defined(JAS_FOR_INTERNAL_USE_ONLY)
110 size_t image_numfmts;
114 size_t dec_default_max_samples;
385 int jas_get_debug_level_internal(
void);
389 size_t jas_get_dec_default_max_samples_internal(
void);
395 #if defined(JAS_FOR_INTERNAL_USE_ONLY)
396 #if defined(JAS_HAVE_THREAD_LOCAL)
397 extern _Thread_local jas_ctx_t *jas_cur_ctx;
401 jas_ctx_t *jas_get_ctx_internal(
void);
404 static inline jas_ctx_t *jas_get_ctx(
void)
406 #if defined(JAS_HAVE_THREAD_LOCAL)
407 return jas_cur_ctx ? jas_cur_ctx : jas_get_ctx_internal();
409 return JAS_CAST(jas_ctx_t *, jas_get_ctx_internal());
431 #if defined(JAS_FOR_INTERNAL_USE_ONLY)
432 jas_ctx_t *ctx = jas_get_ctx();
433 return ctx->debug_level;
435 return jas_get_debug_level_internal();
458 #if defined(JAS_FOR_INTERNAL_USE_ONLY)
459 jas_ctx_t *ctx = jas_get_ctx();
460 return ctx->dec_default_max_samples;
462 return jas_get_dec_default_max_samples_internal();
484 #if defined(JAS_FOR_INTERNAL_USE_ONLY)
485 jas_ctx_t *ctx = jas_get_ctx();
486 return ctx->vlogmsgf;
488 return jas_get_vlogmsgf_internal();
JasPer Initialization/Cleanup Code.
JAS_EXPORT void jas_context_destroy(jas_context_t context)
Destroy a context.
Definition: jas_init.c:902
JAS_EXPORT void jas_conf_set_allocator(jas_allocator_t *allocator)
Set the memory allocator to be used by the library.
Definition: jas_init.c:425
JasPer Logging Functionality.
JAS_EXPORT void jas_cleanup()
Perform any clean up for the JasPer library.
Definition: jas_init.c:822
JAS_EXPORT void jas_std_allocator_init(jas_std_allocator_t *allocator)
Initialize a memory allocator that uses malloc and related functions for managing memory.
Definition: jas_malloc.c:262
JAS_EXPORT jas_context_t jas_get_context()
Get the current context for the calling thread.
Definition: jas_init.c:927
JAS_EXPORT void jas_conf_set_dec_default_max_samples(size_t n)
Set the default value for the maximum number of samples that is allowed in an image to be decoded.
Definition: jas_init.c:452
JAS_EXPORT void jas_allocator_cleanup(jas_allocator_t *allocator)
Clean up an allocator that is no longer needed.
Definition: jas_malloc.c:244
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 n...
Definition: jas_init.c:445
JAS_EXPORT void jas_conf_clear()
Configure the JasPer library with the default configuration settings.
Definition: jas_init.c:397
const char * desc
Definition: jas_init.c:97
static size_t jas_get_dec_default_max_samples(void)
Get the default maximum number of samples that a decoder is permitted to process.
Definition: jas_init.h:456
JAS_EXPORT void jas_conf_set_multithread(int multithread)
Set the multithreading flag for the library.
Definition: jas_init.c:419
JAS_EXPORT int jas_cleanup_library()
Perform clean up for the JasPer library.
Definition: jas_init.c:636
const char * name
Definition: jas_init.c:92
JAS_EXPORT int jas_cleanup_thread()
Perform per-thread cleanup for the JasPer library.
Definition: jas_init.c:757
JAS_EXPORT int jas_eprintf(const char *fmt,...)
Print formatted text for the standard error stream (i.e., stderr).
Definition: jas_debug.c:96
size_t jas_get_total_mem_size()
Get the total amount of memory available on the system.
Definition: jas_malloc.c:627
void * jas_context_t
An opaque handle type used to represent a JasPer library context.
Definition: jas_init.h:123
static int jas_get_debug_level(void)
Get the debug level for a particular context.
Definition: jas_init.h:429
JAS_EXPORT void jas_conf_set_debug_level(int debug_level)
Set the initial debug level for the library.
Definition: jas_init.c:439
JAS_EXPORT int jas_init()
Configure and initialize the JasPer library using the default configuration settings.
Definition: jas_init.c:807
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.
Definition: jas_init.c:1016
JAS_EXPORT void jas_set_vlogmsgf(jas_vlogmsgf_t *func)
Set the function to be used for log messages.
JAS_EXPORT void jas_set_context(jas_context_t context)
Set the current context for the calling thread.
Definition: jas_init.c:939
JAS_EXPORT void * jas_malloc(size_t size)
Allocate memory.
Definition: jas_malloc.c:136
#define JAS_IMAGE_MAXFMTS
The maximum number of image data formats supported.
Definition: jas_image.h:293
static jas_vlogmsgf_t * jas_get_vlogmsgf(void)
Get the function to be used for log messages.
Definition: jas_init.h:482
JasPer Debugging-Related Functionality.
JAS_EXPORT int jas_init_thread()
Perform per-thread initialization for the JasPer library.
Definition: jas_init.c:696
Image format-dependent operations.
Definition: jas_image.h:298
JAS_EXPORT int jas_vlogmsgf_stderr(jas_logtype_t type, const char *fmt, va_list ap)
Output a log message to standard error.
Definition: jas_debug.c:181
JAS_EXPORT void jas_free(void *ptr)
Free memory.
Definition: jas_malloc.c:186
const char * exts
Definition: jas_init.c:102
JAS_EXPORT void jas_set_debug_level(int debug_level)
Set the debug level for a particular context.
Definition: jas_init.c:1002
#define JAS_UNUSED(x)
Indicate that a variable may be unused (in order to avoid a compiler warning).
Definition: jas_compiler.h:145
const jas_image_fmtops_t ops
Definition: jas_init.c:107
JAS_EXPORT int jas_init_library()
Initialize the JasPer library with the current configuration settings.
Definition: jas_init.c:475
Entry in image format table.
Definition: jas_init.c:87
int() jas_vlogmsgf_t(jas_logtype_t, const char *, va_list)
Type used for formatted message logging function.
Definition: jas_log.h:117
Image format information.
Definition: jas_image.h:314
JAS_EXPORT jas_context_t jas_context_create()
Create a context.
Definition: jas_init.c:885
Type used for the log type.
A memory allocator.
Definition: jas_malloc.h:101
JAS_EXPORT jas_context_t jas_get_default_context()
Get the current context for the calling thread.
Definition: jas_init.c:933
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 void jas_deprecated(const char *fmt,...)
Warn about the use of deprecated functionality.
Definition: jas_debug.c:266
int enabled
Definition: jas_init.c:112