Commit 69855407 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

moved image codecs' headers to the respective subdirectories; allow the user to use system zlib.

parent 0e0929af
add_subdirectory(zlib)
if(NOT ZLIB_FOUND)
add_subdirectory(zlib)
endif()
if(WITH_JASPER AND NOT JASPER_FOUND)
add_subdirectory(libjasper)
endif()
......
/*
* Copyright (c) 2002-2003 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* Color Management
*
* $Id: jas_cm.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_CM_H
#define JAS_CM_H
#include <jasper/jas_config.h>
#include <jasper/jas_icc.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef int jas_clrspc_t;
/* transform operations */
#define JAS_CMXFORM_OP_FWD 0
#define JAS_CMXFORM_OP_REV 1
#define JAS_CMXFORM_OP_PROOF 2
#define JAS_CMXFORM_OP_GAMUT 3
/* rendering intents */
#define JAS_CMXFORM_INTENT_PER 0
#define JAS_CMXFORM_INTENT_RELCLR 1
#define JAS_CMXFORM_INTENT_ABSCLR 2
#define JAS_CMXFORM_INTENT_SAT 3
#define JAS_CMXFORM_NUMINTENTS 4
#define JAS_CMXFORM_OPTM_SPEED 0
#define JAS_CMXFORM_OPTM_SIZE 1
#define JAS_CMXFORM_OPTM_ACC 2
#define jas_clrspc_create(fam, mbr) (((fam) << 8) | (mbr))
#define jas_clrspc_fam(clrspc) ((clrspc) >> 8)
#define jas_clrspc_mbr(clrspc) ((clrspc) & 0xff)
#define jas_clrspc_isgeneric(clrspc) (!jas_clrspc_mbr(clrspc))
#define jas_clrspc_isunknown(clrspc) ((clrspc) & JAS_CLRSPC_UNKNOWNMASK)
#define JAS_CLRSPC_UNKNOWNMASK 0x4000
/* color space families */
#define JAS_CLRSPC_FAM_UNKNOWN 0
#define JAS_CLRSPC_FAM_XYZ 1
#define JAS_CLRSPC_FAM_LAB 2
#define JAS_CLRSPC_FAM_GRAY 3
#define JAS_CLRSPC_FAM_RGB 4
#define JAS_CLRSPC_FAM_YCBCR 5
/* specific color spaces */
#define JAS_CLRSPC_UNKNOWN JAS_CLRSPC_UNKNOWNMASK
#define JAS_CLRSPC_CIEXYZ jas_clrspc_create(JAS_CLRSPC_FAM_XYZ, 1)
#define JAS_CLRSPC_CIELAB jas_clrspc_create(JAS_CLRSPC_FAM_LAB, 1)
#define JAS_CLRSPC_SGRAY jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 1)
#define JAS_CLRSPC_SRGB jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 1)
#define JAS_CLRSPC_SYCBCR jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 1)
/* generic color spaces */
#define JAS_CLRSPC_GENRGB jas_clrspc_create(JAS_CLRSPC_FAM_RGB, 0)
#define JAS_CLRSPC_GENGRAY jas_clrspc_create(JAS_CLRSPC_FAM_GRAY, 0)
#define JAS_CLRSPC_GENYCBCR jas_clrspc_create(JAS_CLRSPC_FAM_YCBCR, 0)
#define JAS_CLRSPC_CHANIND_YCBCR_Y 0
#define JAS_CLRSPC_CHANIND_YCBCR_CB 1
#define JAS_CLRSPC_CHANIND_YCBCR_CR 2
#define JAS_CLRSPC_CHANIND_RGB_R 0
#define JAS_CLRSPC_CHANIND_RGB_G 1
#define JAS_CLRSPC_CHANIND_RGB_B 2
#define JAS_CLRSPC_CHANIND_GRAY_Y 0
typedef double jas_cmreal_t;
struct jas_cmpxform_s;
typedef struct {
long *buf;
int prec;
int sgnd;
int width;
int height;
} jas_cmcmptfmt_t;
typedef struct {
int numcmpts;
jas_cmcmptfmt_t *cmptfmts;
} jas_cmpixmap_t;
typedef struct {
void (*destroy)(struct jas_cmpxform_s *pxform);
int (*apply)(struct jas_cmpxform_s *pxform, jas_cmreal_t *in, jas_cmreal_t *out, int cnt);
void (*dump)(struct jas_cmpxform_s *pxform);
} jas_cmpxformops_t;
typedef struct {
jas_cmreal_t *data;
int size;
} jas_cmshapmatlut_t;
typedef struct {
int mono;
int order;
int useluts;
int usemat;
jas_cmshapmatlut_t luts[3];
jas_cmreal_t mat[3][4];
} jas_cmshapmat_t;
typedef struct {
int order;
} jas_cmshaplut_t;
typedef struct {
int inclrspc;
int outclrspc;
} jas_cmclrspcconv_t;
#define jas_align_t double
typedef struct jas_cmpxform_s {
int refcnt;
jas_cmpxformops_t *ops;
int numinchans;
int numoutchans;
union {
jas_align_t dummy;
jas_cmshapmat_t shapmat;
jas_cmshaplut_t shaplut;
jas_cmclrspcconv_t clrspcconv;
} data;
} jas_cmpxform_t;
typedef struct {
int numpxforms;
int maxpxforms;
jas_cmpxform_t **pxforms;
} jas_cmpxformseq_t;
typedef struct {
int numinchans;
int numoutchans;
jas_cmpxformseq_t *pxformseq;
} jas_cmxform_t;
#define JAS_CMPROF_TYPE_DEV 1
#define JAS_CMPROF_TYPE_CLRSPC 2
#define JAS_CMPROF_NUMPXFORMSEQS 13
typedef struct {
int clrspc;
int numchans;
int refclrspc;
int numrefchans;
jas_iccprof_t *iccprof;
jas_cmpxformseq_t *pxformseqs[JAS_CMPROF_NUMPXFORMSEQS];
} jas_cmprof_t;
/* Create a profile. */
/* Destroy a profile. */
void jas_cmprof_destroy(jas_cmprof_t *prof);
#if 0
typedef int_fast32_t jas_cmattrname_t;
typedef int_fast32_t jas_cmattrval_t;
typedef int_fast32_t jas_cmattrtype_t;
/* Load a profile. */
int jas_cmprof_load(jas_cmprof_t *prof, jas_stream_t *in, int fmt);
/* Save a profile. */
int jas_cmprof_save(jas_cmprof_t *prof, jas_stream_t *out, int fmt);
/* Set an attribute of a profile. */
int jas_cm_prof_setattr(jas_cm_prof_t *prof, jas_cm_attrname_t name, void *val);
/* Get an attribute of a profile. */
void *jas_cm_prof_getattr(jas_cm_prof_t *prof, jas_cm_attrname_t name);
#endif
jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof,
jas_cmprof_t *proofprof, int op, int intent, int optimize);
void jas_cmxform_destroy(jas_cmxform_t *xform);
/* Apply a transform to data. */
int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in,
jas_cmpixmap_t *out);
int jas_cxform_optimize(jas_cmxform_t *xform, int optimize);
int jas_clrspc_numchans(int clrspc);
jas_cmprof_t *jas_cmprof_createfromiccprof(jas_iccprof_t *iccprof);
jas_cmprof_t *jas_cmprof_createfromclrspc(int clrspc);
jas_iccprof_t *jas_iccprof_createfromcmprof(jas_cmprof_t *prof);
#define jas_cmprof_clrspc(prof) ((prof)->clrspc)
jas_cmprof_t *jas_cmprof_copy(jas_cmprof_t *prof);
#ifdef __cplusplus
}
#endif
#endif
/* src/libjasper/include/jasper/jas_config.h. Generated by configure. */
/* src/libjasper/include/jasper/jas_config.h.in. Generated from configure.ac by autoheader. */
/* Avoid problems due to multiple inclusion. */
#ifndef JAS_CONFIG_H
#define JAS_CONFIG_H
/* This preprocessor symbol identifies the version of JasPer. */
#define JAS_VERSION "1.900.1"
/* If configure is being used, this symbol will be defined automatically
at this point in the configuration header file. */
/* The preprocessor symbol JAS_WIN_MSVC_BUILD should not be defined
unless the JasPer software is being built under Microsoft Windows
using Microsoft Visual C. */
#if !defined(JAS_WIN_MSVC_BUILD)
/* A configure-based build is being used. */
/* Extra debugging support */
/* #undef DEBUG */
/* Debugging memory allocator */
/* #undef DEBUG_MEMALLOC */
/* Debugging overflow detection */
/* #undef DEBUG_OVERFLOW */
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `getrusage' function. */
#define HAVE_GETRUSAGE 1
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
/* #undef HAVE_IO_H */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdbool.h> header file. */
#define HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Have variable length arrays */
#define HAVE_VLA 1
/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1
/* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */
/* JasPer configure */
#define JAS_CONFIGURE 1
/* JasPer version */
#define JAS_VERSION "1.900.1"
/* Name of package */
#define PACKAGE "jasper"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME "jasper"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "jasper 1.900.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "jasper"
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.900.1"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.900.1"
/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `long long' if <sys/types.h> does not define. */
#define longlong long long
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef ssize_t */
/* Define to `unsigned char' if <sys/types.h> does not define. */
#define uchar unsigned char
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef uint */
/* Define to `unsigned long' if <sys/types.h> does not define. */
/* #undef ulong */
/* Define to `unsigned long long' if <sys/types.h> does not define. */
#define ulonglong unsigned long long
/* Define to `unsigned short' if <sys/types.h> does not define. */
/* #undef ushort */
#else
/* A configure-based build is not being used. */
#include <jasper/jas_config2.h>
#endif
#endif
/* src/libjasper/include/jasper/jas_config.h.in. Generated from configure.ac by autoheader. */
/* Avoid problems due to multiple inclusion. */
#ifndef JAS_CONFIG_H
#define JAS_CONFIG_H
/* This preprocessor symbol identifies the version of JasPer. */
#undef JAS_VERSION
/* If configure is being used, this symbol will be defined automatically
at this point in the configuration header file. */
/* The preprocessor symbol JAS_WIN_MSVC_BUILD should not be defined
unless the JasPer software is being built under Microsoft Windows
using Microsoft Visual C. */
#if !defined(JAS_WIN_MSVC_BUILD)
/* A configure-based build is being used. */
/* Extra debugging support */
#undef DEBUG
/* Debugging memory allocator */
#undef DEBUG_MEMALLOC
/* Debugging overflow detection */
#undef DEBUG_OVERFLOW
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `getrusage' function. */
#undef HAVE_GETRUSAGE
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <io.h> header file. */
#undef HAVE_IO_H
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdbool.h> header file. */
#undef HAVE_STDBOOL_H
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Have variable length arrays */
#undef HAVE_VLA
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H
/* JasPer configure */
#undef JAS_CONFIGURE
/* JasPer version */
#undef JAS_VERSION
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `long long' if <sys/types.h> does not define. */
#undef longlong
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Define to `int' if <sys/types.h> does not define. */
#undef ssize_t
/* Define to `unsigned char' if <sys/types.h> does not define. */
#undef uchar
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef uint
/* Define to `unsigned long' if <sys/types.h> does not define. */
#undef ulong
/* Define to `unsigned long long' if <sys/types.h> does not define. */
#undef ulonglong
/* Define to `unsigned short' if <sys/types.h> does not define. */
#undef ushort
#else
/* A configure-based build is not being used. */
#include <jasper/jas_config2.h>
#endif
#endif
/*
* Copyright (c) 2002-2003 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
#ifndef JAS_CONFIG2_H
#define JAS_CONFIG2_H
/*
* Configuration for Microsoft Windows and Microsoft Visual C.
*
* We are not using a configure-based build.
* Try to compensate for this here, by specifying the preprocessor symbols
* normally defined by configure.
*/
#define uchar unsigned char
#define ushort unsigned short
#define uint unsigned int
#define ulong unsigned long
#define longlong long long
#define ulonglong unsigned long long
/*#define ssize_t int*/
#define HAVE_FCNTL_H 1
#define HAVE_LIMITS_H 1
#define HAVE_IO_H 1
#define HAVE_WINDOWS_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STDDEF_H 1
#define EXCLUDE_JPG_SUPPORT 1
#define EXCLUDE_MIF_SUPPORT 1
#define EXCLUDE_PNM_SUPPORT 1
#define EXCLUDE_PNM_SUPPORT 1
#define EXCLUDE_RAS_SUPPORT 1
#define EXCLUDE_BMP_SUPPORT 1
#define EXCLUDE_PGX_SUPPORT 1
#endif
/*
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* Debugging-Related Code
*
* $Id: jas_debug.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_DEBUG_H
#define JAS_DEBUG_H
/******************************************************************************\
* Includes.
\******************************************************************************/
#include <stdio.h>
#include <jasper/jas_config.h>
#include "jasper/jas_types.h"
#include "jasper/jas_debug.h"
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************\
* Macros and functions.
\******************************************************************************/
/* Output debugging information to standard error provided that the debug
level is set sufficiently high. */
#if defined(DEBUG)
#define JAS_DBGLOG(n, x) \
((jas_getdbglevel() >= (n)) ? (jas_eprintf x) : 0)
#else
#define JAS_DBGLOG(n, x)
#endif
/* Get the library debug level. */
int jas_getdbglevel(void);
/* Set the library debug level. */
int jas_setdbglevel(int dbglevel);
/* Perform formatted output to standard error. */
int jas_eprintf(const char *fmt, ...);
/* Dump memory to a stream. */
int jas_memdump(FILE *out, void *data, size_t len);
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* Command Line Option Parsing Code
*
* $Id: jas_getopt.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_GETOPT_H
#define JAS_GETOPT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <jasper/jas_config.h>
/******************************************************************************\
* Constants.
\******************************************************************************/
#define JAS_GETOPT_EOF (-1)
#define JAS_GETOPT_ERR '?'
/* option flags. */
#define JAS_OPT_HASARG 0x01 /* option has argument */
/******************************************************************************\
* Types.
\******************************************************************************/
/* Command line option type. */
typedef struct {
int id;
/* The unique identifier for this option. */
char *name;
/* The name of this option. */
int flags;
/* option flags. */
} jas_opt_t;
/******************************************************************************\
* External data.
\******************************************************************************/
/* The current option index. */
extern int jas_optind;
/* The current option argument. */
extern char *jas_optarg;
/* The debug level. */
extern int jas_opterr;
/******************************************************************************\
* Prototypes.
\******************************************************************************/
/* Get the next option. */
int jas_getopt(int argc, char **argv, jas_opt_t *opts);
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
#ifndef JAS_INIT_H
#define JAS_INIT_H
#include <jasper/jas_config.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************\
* Functions.
\******************************************************************************/
int jas_init(void);
void jas_cleanup(void);
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* Memory Allocator
*
* $Id: jas_malloc.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_MALLOC_H
#define JAS_MALLOC_H
/******************************************************************************\
* Includes.
\******************************************************************************/
#include <jasper/jas_config.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************\
* Hack follows...
\******************************************************************************/
#if defined(DEBUG_MEMALLOC)
/* This is somewhat of a hack, but it's a useful hack. :-) */
/* Use my own custom memory allocator for debugging. */
#include "../../../../local/src/memalloc.h"
#define jas_malloc MEMALLOC
#define jas_free MEMFREE
#define jas_realloc MEMREALLOC
#define jas_calloc MEMCALLOC
#endif
/******************************************************************************\
* Functions.
\******************************************************************************/
#if !defined(DEBUG_MEMALLOC)
/* Allocate memory. */
void *jas_malloc(size_t size);
/* Free memory. */
void jas_free(void *ptr);
/* Resize a block of allocated memory. */
void *jas_realloc(void *ptr, size_t size);
/* Allocate a block of memory and initialize the contents to zero. */
void *jas_calloc(size_t nmemb, size_t size);
#endif
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* Math-Related Code
*
* $Id: jas_math.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_MATH_H
#define JAS_MATH_H
/******************************************************************************\
* Includes
\******************************************************************************/
#include <jasper/jas_config.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************\
* Macros
\******************************************************************************/
/* Compute the absolute value. */
#define JAS_ABS(x) \
(((x) >= 0) ? (x) : (-(x)))
/* Compute the minimum of two values. */
#define JAS_MIN(x, y) \
(((x) < (y)) ? (x) : (y))
/* Compute the maximum of two values. */
#define JAS_MAX(x, y) \
(((x) > (y)) ? (x) : (y))
/* Compute the remainder from division (where division is defined such
that the remainder is always nonnegative). */
#define JAS_MOD(x, y) \
(((x) < 0) ? (((-x) % (y)) ? ((y) - ((-(x)) % (y))) : (0)) : ((x) % (y)))
/* Compute the integer with the specified number of least significant bits
set to one. */
#define JAS_ONES(n) \
((1 << (n)) - 1)
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* String Library
*
* $Id: jas_string.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_STRING_H
#define JAS_STRING_H
/******************************************************************************\
* Includes.
\******************************************************************************/
#include <jasper/jas_config.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************\
* Functions.
\******************************************************************************/
/* Copy a string (a la strdup). */
char *jas_strdup(const char *);
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2004 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
#ifndef JAS_TMR_H
#define JAS_TMR_H
#include<time.h>
#include <jasper/jas_config.h>
#if defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if defined(HAVE_GETTIMEOFDAY)
typedef struct {
struct timeval start;
struct timeval stop;
} jas_tmr_t;
#elif defined(HAVE_GETRUSAGE)
typedef struct {
struct rusage start;
struct rusage stop;
} jas_tmr_t;
#else
typedef int jas_tmr_t;
#endif
void jas_tmr_start(jas_tmr_t *tmr);
void jas_tmr_stop(jas_tmr_t *tmr);
double jas_tmr_get(jas_tmr_t *tmr);
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2001-2002 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* Tag/Value Parser
*
* $Id: jas_tvp.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_TVP_H
#define JAS_TVP_H
/******************************************************************************\
* Includes.
\******************************************************************************/
#include <jasper/jas_config.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************\
* Types.
\******************************************************************************/
/* Tag information type. */
typedef struct {
int id;
/* The ID for the tag. */
char *name;
/* The name of the tag. */
} jas_taginfo_t;
/* Tag-value parser type. */
typedef struct {
char *buf;
/* The parsing buffer. */
char *tag;
/* The current tag name. */
char *val;
/* The current value. */
char *pos;
/* The current position in the parsing buffer. */
} jas_tvparser_t;
/******************************************************************************\
* Tag information functions.
\******************************************************************************/
/* Lookup a tag by name. */
jas_taginfo_t *jas_taginfos_lookup(jas_taginfo_t *taginfos, const char *name);
/* This function returns a pointer to the specified taginfo object if it
exists (i.e., the pointer is nonnull); otherwise, a pointer to a dummy
object is returned. This is useful in some situations to avoid checking
for a null pointer. */
jas_taginfo_t *jas_taginfo_nonull(jas_taginfo_t *taginfo);
/******************************************************************************\
* Tag-value parser functions.
\******************************************************************************/
/* Create a tag-value parser for the specified string. */
jas_tvparser_t *jas_tvparser_create(const char *s);
/* Destroy a tag-value parser. */
void jas_tvparser_destroy(jas_tvparser_t *tvparser);
/* Get the next tag-value pair. */
int jas_tvparser_next(jas_tvparser_t *tvparser);
/* Get the tag name for the current tag-value pair. */
char *jas_tvparser_gettag(jas_tvparser_t *tvparser);
/* Get the value for the current tag-value pair. */
char *jas_tvparser_getval(jas_tvparser_t *tvparser);
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2003 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* Primitive Types
*
* $Id: jas_types.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_TYPES_H
#define JAS_TYPES_H
#include <jasper/jas_config.h>
#if !defined(JAS_CONFIGURE)
#if defined(WIN32) || defined(HAVE_WINDOWS_H)
/*
We are dealing with Microsoft Windows and most likely Microsoft
Visual C (MSVC). (Heaven help us.) Sadly, MSVC does not correctly
define some of the standard types specified in ISO/IEC 9899:1999.
In particular, it does not define the "long long" and "unsigned long
long" types. So, we work around this problem by using the "INT64"
and "UINT64" types that are defined in the header file "windows.h".
*/
#include <windows.h>
#undef longlong
#define longlong INT64
#undef ulonglong
#define ulonglong UINT64
#endif
#endif
#if defined(HAVE_STDLIB_H)
#undef false
#undef true
#include <stdlib.h>
#endif
#if defined(HAVE_STDDEF_H)
#include <stddef.h>
#endif
#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
#ifndef __cplusplus
#if defined(HAVE_STDBOOL_H)
/*
* The C language implementation does correctly provide the standard header
* file "stdbool.h".
*/
#include <stdbool.h>
#else
/*
* The C language implementation does not provide the standard header file
* "stdbool.h" as required by ISO/IEC 9899:1999. Try to compensate for this
* braindamage below.
*/
#if !defined(bool)
#define bool int
#endif
#if !defined(true)
#define true 1
#endif
#if !defined(false)
#define false 0
#endif
#endif
#endif
#if defined(HAVE_STDINT_H)
/*
* The C language implementation does correctly provide the standard header
* file "stdint.h".
*/
#include <stdint.h>
#else
/*
* The C language implementation does not provide the standard header file
* "stdint.h" as required by ISO/IEC 9899:1999. Try to compensate for this
* braindamage below.
*/
#include <limits.h>
/**********/
#if !defined(INT_FAST8_MIN)
typedef signed char int_fast8_t;
#define INT_FAST8_MIN (-127)
#define INT_FAST8_MAX 128
#endif
/**********/
#if !defined(UINT_FAST8_MAX)
typedef unsigned char uint_fast8_t;
#define UINT_FAST8_MAX 255
#endif
/**********/
#if !defined(INT_FAST16_MIN)
typedef short int_fast16_t;
#define INT_FAST16_MIN SHRT_MIN
#define INT_FAST16_MAX SHRT_MAX
#endif
/**********/
#if !defined(UINT_FAST16_MAX)
typedef unsigned short uint_fast16_t;
#define UINT_FAST16_MAX USHRT_MAX
#endif
/**********/
#if !defined(INT_FAST32_MIN)
typedef int int_fast32_t;
#define INT_FAST32_MIN INT_MIN
#define INT_FAST32_MAX INT_MAX
#endif
/**********/
#if !defined(UINT_FAST32_MAX)
typedef unsigned int uint_fast32_t;
#define UINT_FAST32_MAX UINT_MAX
#endif
/**********/
#if !defined(INT_FAST64_MIN)
typedef longlong int_fast64_t;
#define INT_FAST64_MIN LLONG_MIN
#define INT_FAST64_MAX LLONG_MAX
#endif
/**********/
#if !defined(UINT_FAST64_MAX)
typedef ulonglong uint_fast64_t;
#define UINT_FAST64_MAX ULLONG_MAX
#endif
/**********/
#endif
/* Hopefully, these macro definitions will fix more problems than they cause. */
#if !defined(uchar)
#define uchar unsigned char
#endif
#if !defined(ushort)
#define ushort unsigned short
#endif
#if !defined(uint)
#define uint unsigned int
#endif
#if !defined(ulong)
#define ulong unsigned long
#endif
#if !defined(longlong)
#define longlong long long
#endif
#if !defined(ulonglong)
#define ulonglong unsigned long long
#endif
/* The below macro is intended to be used for type casts. By using this
macro, type casts can be easily located in the source code with
tools like "grep". */
#define JAS_CAST(t, e) \
((t) (e))
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 1999-2000 Image Power, Inc. and the University of
* British Columbia.
* Copyright (c) 2001-2003 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
/*
* $Id: jas_version.h,v 1.2 2008-05-26 09:41:51 vp153 Exp $
*/
#ifndef JAS_VERSION_H
#define JAS_VERSION_H
#include <jasper/jas_config.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************\
* Constants and types.
\******************************************************************************/
#if !defined(JAS_VERSION)
/* The version information below should match that specified in
the "configure.in" file! */
#define JAS_VERSION "unknown"
#endif
#define JAS_COPYRIGHT \
"Copyright (c) 2001-2006 Michael David Adams.\n" \
"Copyright (c) 1999-2000 Image Power, Inc. and the University of\n" \
" British Columbia.\n" \
"All rights reserved.\n"
#define JAS_NOTES \
"For more information about this software, please visit the following\n" \
"web sites/pages:\n" \
" http://www.ece.uvic.ca/~mdadams/jasper\n" \
" http://www.jpeg.org/software\n" \
"To be added to the (moderated) JasPer software announcements\n" \
"mailing list, send an email to:\n" \
" jasper-announce-subscribe@yahoogroups.com\n" \
"To be added to the (unmoderated) JasPer software discussion\n" \
"mailing list, send an email to:\n" \
" jasper-discussion-subscribe@yahoogroups.com\n" \
"Please send any bug reports to:\n" \
" mdadams@ieee.org\n"
/******************************************************************************\
* Functions.
\******************************************************************************/
const char *jas_getversion(void);
/* Get the version information for the JasPer library. */
/* Note: Since libjasper can be built as a shared library, the version
returned by this function may not necessarily correspond to JAS_VERSION. */
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2001-2003 Michael David Adams.
* All rights reserved.
*/
/* __START_OF_JASPER_LICENSE__
*
* JasPer License Version 2.0
*
* Copyright (c) 2001-2006 Michael David Adams
* Copyright (c) 1999-2000 Image Power, Inc.
* Copyright (c) 1999-2000 The University of British Columbia
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person (the
* "User") obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. The above copyright notices and this permission notice (which
* includes the disclaimer below) shall be included in all copies or
* substantial portions of the Software.
*
* 2. The name of a copyright holder shall not be used to endorse or
* promote products derived from the Software without specific prior
* written permission.
*
* THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
* LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
* THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
* "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
* PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
* THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
* EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
* BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
* PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
* GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
* ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
* IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
* SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
* AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
* SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
* THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
* PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
* RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
* EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
*
* __END_OF_JASPER_LICENSE__
*/
#ifndef JAS_JASPER_H
#define JAS_JASPER_H
#include <jasper/jas_config.h>
#include <jasper/jas_types.h>
#include <jasper/jas_version.h>
#include <jasper/jas_init.h>
#include <jasper/jas_cm.h>
#include <jasper/jas_icc.h>
#include <jasper/jas_fix.h>
#include <jasper/jas_debug.h>
#include <jasper/jas_getopt.h>
#include <jasper/jas_image.h>
#include <jasper/jas_icc.h>
#include <jasper/jas_math.h>
#include <jasper/jas_malloc.h>
#include <jasper/jas_seq.h>
#include <jasper/jas_stream.h>
#include <jasper/jas_string.h>
#include <jasper/jas_tmr.h>
#include <jasper/jas_tvp.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
......@@ -8,15 +8,12 @@ project(libjasper)
add_definitions(-DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT)
# List of C++ files:
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# The .cpp files:
file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h)
file(GLOB lib_ext_hdrs ../include/jasper/*.h)
file(GLOB lib_ext_hdrs jasper/*.h)
# ----------------------------------------------------------------------------------
# Define the library target:
......
......@@ -6,15 +6,11 @@ project(libjpeg)
# List of C++ files:
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# The .cpp files:
file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h)
set(lib_ext_hdrs "../include/jconfig.h" "../include/jmorecfg.h" "../include/jpeglib.h")
# ----------------------------------------------------------------------------------
# Define the library target:
......@@ -22,7 +18,7 @@ set(lib_ext_hdrs "../include/jconfig.h" "../include/jmorecfg.h" "../include/jpeg
set(the_target "libjpeg")
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs})
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
......
......@@ -6,14 +6,10 @@ project(libpng)
# List of C++ files:
include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h)
set(lib_ext_hdrs "../include/png.h" "../include/pngconf.h")
# ----------------------------------------------------------------------------------
# Define the library target:
......
......@@ -6,10 +6,7 @@ project(libtiff)
# List of C++ files:
include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_definitions(-DHAVE_STRING_H=1)
......@@ -76,8 +73,6 @@ endif(WIN32)
file(GLOB lib_hdrs *.h*)
set(lib_ext_hdrs "../include/tiff.h" "../include/tiffio.h" "../include/tiffvers.h" "../include/tiffconf.h")
set(the_target "libtiff")
if(MSVC)
......@@ -91,7 +86,7 @@ if(UNIX)
endif()
endif()
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs})
set_target_properties(${the_target}
PROPERTIES
......
......@@ -6,18 +6,14 @@ PROJECT(zlib)
# List of C++ files:
include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h)
set(lib_ext_hdrs "../include/zlib.h" "../include/zconf.h")
set(the_target "zlib")
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
add_library(${the_target} STATIC ${lib_srcs} ${lib_hdrs})
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
......
......@@ -456,6 +456,7 @@ if(UNIX)
endif()
if(NOT OPENCV_BUILD_3RDPARTY_LIBS)
include(FindZLIB)
if(WITH_PNG)
include(FindPNG)
if(PNG_FOUND)
......@@ -1342,7 +1343,13 @@ else()
endif()
message(STATUS "")
message(STATUS " Image I/O: ")
message(STATUS " Media I/O: ")
if(ZLIB_FOUND)
message(STATUS " ZLib: ${ZLIB_FOUND}")
else()
message(STATUS " ZLib: build")
endif()
if(NOT WITH_JPEG OR JPEG_FOUND)
message(STATUS " JPEG: ${JPEG_FOUND}")
else()
......
......@@ -44,7 +44,7 @@ FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY
IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
SET(OPENEXR_FOUND TRUE)
SET(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR")
SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} zlib CACHE STRING "The libraries needed to use OpenEXR")
SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR")
ENDIF ()
IF(OPENEXR_FOUND)
......
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/include")
set(deps zlib)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCUDE_DIR})
set(deps ${ZLIB_LIBRARIES})
else()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/zlib")
set(deps zlib)
endif()
define_opencv_module(core ${deps})
......@@ -5,41 +5,67 @@
# ----------------------------------------------------------------------------
project(opencv_highgui)
set(GRFMT_LIBS)
if(WITH_PNG OR WITH_TIFF OR WITH_OPENEXR)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${ZLIB_LIBRARIES})
else()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/zlib")
set(GRFMT_LIBS ${GRFMT_LIBS} zlib)
endif()
endif()
if(WITH_JPEG)
add_definitions(-DHAVE_JPEG)
if(NOT JPEG_FOUND)
set(use_3rdparty TRUE)
if(JPEG_FOUND)
include_directories(${JPEG_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${JPEG_LIBRARIES})
else()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/libjpeg")
set(GRFMT_LIBS ${GRFMT_LIBS} libjpeg)
endif()
endif()
if(WITH_PNG)
add_definitions(-DHAVE_PNG)
if(NOT PNG_FOUND)
set(use_3rdparty TRUE)
if(PNG_FOUND)
add_definitions(${PNG_DEFINITIONS})
include_directories(${PNG_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${PNG_LIBRARIES})
else()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/libpng")
set(GRFMT_LIBS ${GRFMT_LIBS} libpng)
endif()
endif()
if(WITH_TIFF)
add_definitions(-DHAVE_TIFF)
if(NOT TIFF_FOUND)
set(use_3rdparty TRUE)
if(TIFF_FOUND)
include_directories(${TIFF_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${TIFF_LIBRARIES})
else()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/libtiff")
set(GRFMT_LIBS ${GRFMT_LIBS} libtiff)
endif()
endif()
if(WITH_JASPER)
add_definitions(-DHAVE_JASPER)
if(NOT JASPER_FOUND)
set(use_3rdparty TRUE)
if(JPEG_FOUND)
include_directories(${JASPER_INCLUDE_DIR})
set(GRFMT_LIBS ${GRFMT_LIBS} ${JASPER_LIBRARIES})
else()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/libjasper")
set(GRFMT_LIBS ${GRFMT_LIBS} libjasper)
endif()
endif()
if(WITH_OPENEXR AND OPENEXR_FOUND)
add_definitions(-DHAVE_OPENEXR)
include_directories(${OPENEXR_INCLUDE_PATHS})
endif()
if(use_3rdparty)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/include")
set(GRFMT_LIBS ${GRFMT_LIBS} ${OPENEXR_LIBRARIES})
endif()
if(MSVC)
......@@ -146,20 +172,6 @@ if(UNIX)
endif()
endif()
if(JPEG_FOUND)
include_directories(${JPEG_INCLUDE_DIR})
endif()
if(PNG_FOUND)
add_definitions(${PNG_DEFINITIONS})
include_directories(${PNG_INCLUDE_DIR})
endif()
if(TIFF_FOUND)
include_directories(${TIFF_INCLUDE_DIR})
endif()
if(JASPER_FOUND)
include_directories(${JASPER_INCLUDE_DIR})
endif()
foreach(P ${HIGHGUI_INCLUDE_DIRS})
include_directories(${P})
endforeach()
......@@ -275,25 +287,30 @@ add_dependencies(${the_target} opencv_core opencv_imgproc)
if(WITH_JASPER AND NOT JASPER_FOUND)
add_dependencies(${the_target} libjasper)
#target_link_libraries(${the_target} libjasper)
endif()
if(WITH_JPEG AND NOT JPEG_FOUND)
add_dependencies(${the_target} libjpeg)
#target_link_libraries(${the_target} libjpeg)
endif()
if(WITH_PNG AND NOT PNG_FOUND)
add_dependencies(${the_target} libpng zlib)
#target_link_libraries(${the_target} libpng zlib)
add_dependencies(${the_target} libpng)
endif()
if(WITH_TIFF AND NOT TIFF_FOUND)
add_dependencies(${the_target} libtiff)
#target_link_libraries(${the_target} libtiff)
endif()
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} opencv_core opencv_imgproc zlib ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JASPER_LIBRARIES} ${HIGHGUI_LIBRARIES} ${OPENEXR_LIBRARIES})
if(NOT ZLIB_FOUND)
add_dependencies(${the_target} zlib)
endif()
#message(STATUS "GRFMT: ${GRFMT_LIBS}")
#message(STATUS "HIGHGUI_LIBS: ${HIGHGUI_LIBRARIES}")
#message(STATUS "OPENCV_LIBS: ${OPENCV_LINKER_LIBS}")
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} opencv_core
opencv_imgproc ${GRFMT_LIBS} ${HIGHGUI_LIBRARIES})
if( OPENNI_LIBRARY )
target_link_libraries(${the_target} ${OPENNI_LIBRARY})
endif()
......@@ -318,4 +335,4 @@ install(TARGETS ${the_target}
install(FILES ${highgui_ext_hdrs}
DESTINATION include/opencv2/highgui
COMPONENT main)
\ No newline at end of file
COMPONENT main)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment