JasPer  3.0.3
jasper.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2003 Michael David Adams.
3  * All rights reserved.
4  */
5 
6 /* __START_OF_JASPER_LICENSE__
7  *
8  * JasPer License Version 2.0
9  *
10  * Copyright (c) 2001-2006 Michael David Adams
11  * Copyright (c) 1999-2000 Image Power, Inc.
12  * Copyright (c) 1999-2000 The University of British Columbia
13  *
14  * All rights reserved.
15  *
16  * Permission is hereby granted, free of charge, to any person (the
17  * "User") obtaining a copy of this software and associated documentation
18  * files (the "Software"), to deal in the Software without restriction,
19  * including without limitation the rights to use, copy, modify, merge,
20  * publish, distribute, and/or sell copies of the Software, and to permit
21  * persons to whom the Software is furnished to do so, subject to the
22  * following conditions:
23  *
24  * 1. The above copyright notices and this permission notice (which
25  * includes the disclaimer below) shall be included in all copies or
26  * substantial portions of the Software.
27  *
28  * 2. The name of a copyright holder shall not be used to endorse or
29  * promote products derived from the Software without specific prior
30  * written permission.
31  *
32  * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
33  * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
34  * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
35  * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36  * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
37  * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
38  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
39  * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
40  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
41  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
42  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
43  * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
44  * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
45  * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
46  * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
47  * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
48  * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
49  * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
50  * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
51  * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
52  * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
53  * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
54  * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
55  * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
56  * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
57  * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
58  *
59  * __END_OF_JASPER_LICENSE__
60  */
61 
67 #ifndef JAS_JASPER_H
68 #define JAS_JASPER_H
69 
70 // IWYU pragma: begin_exports
71 
72 /* The configuration header file should be included first. */
73 #include <jasper/jas_config.h>
74 
75 #include <jasper/jas_types.h>
76 #include <jasper/jas_version.h>
77 
78 #include <jasper/jas_init.h>
79 #include <jasper/jas_cm.h>
80 #include <jasper/jas_icc.h>
81 #include <jasper/jas_fix.h>
82 #include <jasper/jas_debug.h>
83 #include <jasper/jas_getopt.h>
84 #include <jasper/jas_image.h>
85 #include <jasper/jas_math.h>
86 #include <jasper/jas_malloc.h>
87 #include <jasper/jas_seq.h>
88 #include <jasper/jas_stream.h>
89 #include <jasper/jas_string.h>
90 #include <jasper/jas_tmr.h>
91 #include <jasper/jas_tvp.h>
92 #include <jasper/jas_thread.h>
93 #include <jasper/jas_init.h>
94 #include <jasper/jas_log.h>
95 
96 #ifdef __cplusplus
97 extern "C" {
98 #endif
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 // IWYU pragma: end_exports
105 
106 #endif
jas_init.h
JasPer Initialization/Cleanup Code.
jas_image_delcmpt
void jas_image_delcmpt(jas_image_t *image, unsigned cmptno)
Delete a component from an image.
Definition: jas_image.c:932
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.
Definition: jas_init.c:425
JAS_OPT_HASARG
#define JAS_OPT_HASARG
Definition: jas_getopt.h:94
jas_optind
int jas_optind
The current option index.
Definition: jas_getopt.c:87
jas_log.h
JasPer Logging Functionality.
jas_malloc.h
JasPer Memory Allocator.
jas_cleanup
JAS_EXPORT void jas_cleanup()
Perform any clean up for the JasPer library.
Definition: jas_init.c:822
jas_std_allocator_init
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_stream_fdopen
jas_stream_t * jas_stream_fdopen(int fd, const char *mode)
Open a file descriptor as a stream.
Definition: jas_stream.c:521
jas_tmr_get
double jas_tmr_get(jas_tmr_t *tmr)
Get the elapsed time for a timer.
Definition: jas_tmr.c:143
jasper.h
JasPer Main Header.
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 n...
Definition: jas_init.c:445
jas_conf_clear
JAS_EXPORT void jas_conf_clear()
Configure the JasPer library with the default configuration settings.
Definition: jas_init.c:397
jas_cmprof_createfromclrspc
jas_cmprof_t * jas_cmprof_createfromclrspc(jas_clrspc_t clrspc)
Create a color-management profile from a color space.
Definition: jas_cm.c:169
jas_std_allocator_t
The standard library allocator (i.e., a wrapper for malloc and friends).
Definition: jas_malloc.h:143
jas_image_strtofmt
int jas_image_strtofmt(const char *name)
Get the ID for the image format with the specified name.
Definition: jas_image.c:835
jas_cleanup_library
JAS_EXPORT int jas_cleanup_library()
Perform clean up for the JasPer library.
Definition: jas_init.c:636
jas_cleanup_thread
JAS_EXPORT int jas_cleanup_thread()
Perform per-thread cleanup for the JasPer library.
Definition: jas_init.c:757
jas_tvp.h
Tag/Value Pair Parser.
jas_fix.h
JasPer Fixed-Point Number Class.
jas_get_total_mem_size
size_t jas_get_total_mem_size()
Get the total amount of memory available on the system.
Definition: jas_malloc.c:627
jas_cmxform_apply
int jas_cmxform_apply(const jas_cmxform_t *xform, const jas_cmpixmap_t *in, jas_cmpixmap_t *out)
Apply a transform to data.
Definition: jas_cm.c:540
jas_opt_t
Command line option type.
Definition: jas_getopt.h:104
jas_stream_t
I/O stream object.
Definition: jas_stream.h:206
jas_image_fmtfromname
int jas_image_fmtfromname(const char *name)
Guess the format of an image file based on its name.
Definition: jas_image.c:875
jas_set_max_mem_usage
void jas_set_max_mem_usage(size_t max_mem)
Set the maximum memory usage allowed by the allocator wrapper.
Definition: jas_malloc.c:355
jas_cmcmptfmt_t
Component format.
Definition: jas_cm.h:218
jas_image_fmtinfo_t::desc
char * desc
Definition: jas_image.h:335
jas_conf_set_debug_level
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_init
JAS_EXPORT int jas_init()
Configure and initialize the JasPer library using the default configuration settings.
Definition: jas_init.c:807
jas_tmr_t
Timer type.
jas_stream_fopen
jas_stream_t * jas_stream_fopen(const char *filename, const char *mode)
Open a file as a stream.
Definition: jas_stream.c:283
jas_cmprof_destroy
void jas_cmprof_destroy(jas_cmprof_t *prof)
Destroy a color-management profile.
Definition: jas_cm.c:381
jas_cmpixmap_t
Pixmap (i.e., multicomponent) format.
Definition: jas_cm.h:230
jas_image_cmprof
#define jas_image_cmprof(image)
Get the color management profile of an image.
Definition: jas_image.h:736
jas_seq.h
Sequence/Matrix Library.
jas_image_getnumfmts
JAS_EXPORT int jas_image_getnumfmts(void)
Get the number of image format table entries.
Definition: jas_image.c:730
jas_debug.h
JasPer Debugging-Related Functionality.
jas_tmr_start
void jas_tmr_start(jas_tmr_t *tmr)
Start a timer.
Definition: jas_tmr.c:135
jas_init_thread
JAS_EXPORT int jas_init_thread()
Perform per-thread initialization for the JasPer library.
Definition: jas_init.c:696
jas_image_getfmt
int jas_image_getfmt(jas_stream_t *in)
Get the format of image data in a stream.
Definition: jas_image.c:853
jas_stream_close
int jas_stream_close(jas_stream_t *stream)
Close a stream.
Definition: jas_stream.c:591
jas_icc.h
ICC Profile.
jas_version.h
JasPer Version.
jas_getopt
int jas_getopt(int argc, char **argv, const jas_opt_t *opts)
Get the next option.
Definition: jas_getopt.c:107
jas_image_numcmpts
#define jas_image_numcmpts(image)
Get the number of image components.
Definition: jas_image.h:414
jas_tmr.h
Timer Code.
jas_image_getfmtbyind
const JAS_EXPORT jas_image_fmtinfo_t * jas_image_getfmtbyind(int index)
Get a image format entry by its table index.
Definition: jas_image.c:722
jas_image_fmtinfo_t::enabled
int enabled
Definition: jas_image.h:332
jas_types.h
Primitive Types.
jas_thread.h
Threads.
jas_getopt.h
Command Line Option Parsing Code.
jas_stream.h
I/O Stream Class.
jas_image_encode
int jas_image_encode(jas_image_t *image, jas_stream_t *out, int fmt, const char *optstr)
Write an image to a stream in a specified format.
Definition: jas_image.c:469
jas_string.h
String Library.
jas_stream_flush
int jas_stream_flush(jas_stream_t *stream)
Flush any pending output to a stream.
Definition: jas_stream.c:973
jas_cm.h
JasPer Color Management.
jas_cmprof_t
Definition: jas_cm.h:329
jas_init_library
JAS_EXPORT int jas_init_library()
Initialize the JasPer library with the current configuration settings.
Definition: jas_init.c:475
jas_image_chclrspc
jas_image_t * jas_image_chclrspc(jas_image_t *image, const jas_cmprof_t *outprof, jas_cmxform_intent_t intent)
Change the color space for an image.
Definition: jas_image.c:1574
jas_image_t
Image class.
Definition: jas_image.h:215
jas_math.h
Math-Related Code.
jas_cmxform_create
jas_cmxform_t * jas_cmxform_create(const jas_cmprof_t *inprof, const jas_cmprof_t *outprof, const jas_cmprof_t *prfprof, jas_cmxform_op_t op, jas_cmxform_intent_t intent, jas_cmxform_optm_t optimize)
Create a transform from a CM profile.
Definition: jas_cm.c:425
jas_image_destroy
void jas_image_destroy(jas_image_t *image)
Deallocate any resources associated with an image.
Definition: jas_image.c:304
jas_optarg
const char * jas_optarg
The current option argument.
Definition: jas_getopt.c:89
jas_image_fmtinfo_t
Image format information.
Definition: jas_image.h:314
jas_image_setfmtenable
JAS_EXPORT int jas_image_setfmtenable(int index, int enabled)
Get the number of image format table entries.
Definition: jas_image.c:737
jas_image.h
JasPer Image Class.
jas_setdbglevel
JAS_EXPORT int jas_setdbglevel(int dbglevel)
Set the library debug level.
Definition: jas_debug.c:83
jas_tmr_stop
void jas_tmr_stop(jas_tmr_t *tmr)
Stop a timer.
Definition: jas_tmr.c:139
jas_image_fmtinfo_t::name
char * name
Definition: jas_image.h:320
jas_image_decode
jas_image_t * jas_image_decode(jas_stream_t *in, int fmt, const char *optstr)
Create an image from a stream in some specified format.
Definition: jas_image.c:420