cpl-6.6.1/0000755000460300003120000000000012553662442007305 500000000000000cpl-6.6.1/m4/0000755000460300003120000000000012553662421007622 500000000000000cpl-6.6.1/m4/ltsugar.m40000644000460300003120000001044012553662317011470 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) cpl-6.6.1/m4/omp.m40000644000460300003120000001100212112640627010564 00000000000000# NOTE: # The macros in this file were taken from c.m4 which is shipped with # Autoconf. Newer version of Autoconf provide these macros to check for # OpenMP support. For preparing CPL releases it would be sufficient to use # a recent Autotools installation, however the nightly build system, is still # using an Autotools installation which is too old, and there is no plan for # upgrading it yet, hence the macros have been copied and the renamed so that # there are no name clashes in case a new version of Autoconf is used. # # However the symbols produced by these macros are kept identical to the # official macro versions, so that removing this file will have (almost) no # impact when the Autotools installation of the nightly build system will # be upgraded. # # In addition, the command line option to disable OpenMP support has been # remove, so that the macro just reports the results, which can be used # by a calling custom macro. # # _CPL_LANG_OPENMP # --------------- # Expands to some language dependent source code for testing the presence of # OpenMP. AC_DEFUN([_CPL_LANG_OPENMP], [AC_LANG_SOURCE([_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])]) # _CPL_LANG_OPENMP(C) # ------------------ # This tries to see if linking properly resolves omp_get_num_threads() object. # It also checks that the #pragma omp threadprivate directive is supported, # since some combinations of compiler/OS do not support it (e.g. gcc/OSX). m4_define([_CPL_LANG_OPENMP(C)], [ #ifndef _OPENMP choke me #endif #include int var; #pragma omp threadprivate(var) int main () { return omp_get_num_threads (); } ]) # _CPL_LANG_OPENMP(C++) # -------------------- m4_copy([_CPL_LANG_OPENMP(C)], [_CPL_LANG_OPENMP(C++)]) # _CPL_LANG_OPENMP(Fortran 77) # --------------------------- m4_define([_CPL_LANG_OPENMP(Fortran 77)], [ program main implicit none !$ integer tid tid = 42 call omp_set_num_threads(2) end ]) # _CPL_LANG_OPENMP(Fortran) # ------------------------- m4_copy([_CPL_LANG_OPENMP(Fortran 77)], [_CPL_LANG_OPENMP(Fortran)]) # CPL_OPENMP # ---------- # Check which options need to be passed to the C compiler to support OpenMP. # Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS variable to these # options. # The options are necessary at compile time (so the #pragmas are understood) # and at link time (so the appropriate library is linked with). # This macro takes care to not produce redundant options if $CC $CFLAGS already # supports OpenMP. It also is careful to not pass options to compilers that # misinterpret them; for example, most compilers accept "-openmp" and create # an output file called 'penmp' rather than activating OpenMP support. AC_DEFUN([CPL_OPENMP], [ OPENMP_[]_AC_LANG_PREFIX[]FLAGS= dnl AC_ARG_ENABLE([openmp], dnl [AS_HELP_STRING([--disable-openmp], [do not use OpenMP])]) dnl if test "$enable_openmp" != no; then AC_CACHE_CHECK([for the compiler option to support OpenMP], [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp], [AC_LINK_IFELSE([_CPL_LANG_OPENMP], [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'], [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported' dnl Try these flags: dnl GCC >= 4.2 -fopenmp dnl SunPRO C -xopenmp dnl Intel C -openmp dnl SGI C, PGI C -mp dnl Tru64 Compaq C -omp dnl IBM C (AIX, Linux) -qsmp=omp dnl Cray CCE -homp dnl NEC SX -Popenmp dnl Lahey Fortran (Linux) --openmp dnl If in this loop a compiler is passed an option that it doesn't dnl understand or that it misinterprets, the AC_LINK_IFELSE test dnl will fail (since we know that it failed without the option), dnl therefore the loop will continue searching for an option, and dnl no output file called 'penmp' or 'mp' is created. for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \ -Popenmp --openmp; do ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option" AC_LINK_IFELSE([_CPL_LANG_OPENMP], [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp=$ac_option]) _AC_LANG_PREFIX[]FLAGS=$ac_save_[]_AC_LANG_PREFIX[]FLAGS if test "$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp" != unsupported; then break fi done])]) case $ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp in #( "none needed" | unsupported) ;; #( *) OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp ;; esac dnl fi AC_SUBST([OPENMP_]_AC_LANG_PREFIX[FLAGS]) ]) cpl-6.6.1/m4/ltoptions.m40000644000460300003120000003426212553662317012052 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) cpl-6.6.1/m4/eso.m40000644000460300003120000006703012231463661010576 00000000000000# ESO_PROG_CC_FLAG(FLAG, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) #----------------------------------------------------------------- AC_DEFUN([ESO_PROG_CC_FLAG], [ AC_REQUIRE([AC_PROG_CC]) flag=`echo $1 | sed 'y%.=/+-%___p_%'` AC_CACHE_CHECK([whether $CC supports -$1], [eso_cv_prog_cc_$flag], [ eval "eso_cv_prog_cc_$flag=no" AC_LANG_PUSH(C) echo 'int main() { return 0; }' >conftest.$ac_ext try_compile="`$CC -$1 -c conftest.$ac_ext 2>&1`" if test -z "$try_compile"; then try_link="`$CC -$1 -o conftest$ac_exeext \ conftest.$ac_ext 2>&1`" if test -z "$try_link"; then eval "eso_cv_prog_cc_$flag=yes" fi fi rm -f conftest* AC_LANG_POP(C) ]) if eval "test \"`echo '$eso_cv_prog_cc_'$flag`\" = yes"; then : $2 else : $3 fi ]) # ESO_PROG_CC_ATTRIBUTE(VARIANT1, [VARIANT2], [CODE], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) #---------------------------------------------------------------------------------------------- AC_DEFUN([ESO_PROG_CC_ATTRIBUTE], [ AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))], AS_TR_SH([eso_cv_prog_cc_attribute_$1]), [ eso_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS" AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])], [eval "AS_TR_SH([eso_cv_prog_cc_attribute_$1])='yes'"], [eval "AS_TR_SH([eso_cv_prog_cc_attribute_$1])='no'"]) CFLAGS="$eso_save_CFLAGS" ]) if eval "test x\$AS_TR_SH([eso_cv_prog_cc_attribute_$1]) = xyes"; then : $4 else : $5 fi ]) # ESO_PROG_CC_ATTRIBUTE_VISIBILITY(ARG, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) #-------------------------------------------------------------------------------- AC_DEFUN([ESO_PROG_CC_ATTRIBUTE_VISIBILITY], [ ESO_PROG_CC_ATTRIBUTE([visibility_$1], [visibility("$1")], [void __attribute__((visibility("$1"))) $1_function() { }], [$2], [$3]) ]) # ESO_ENABLE_DEBUG(debug=no) #--------------------------- AC_DEFUN([ESO_ENABLE_DEBUG], [ AC_REQUIRE([AC_PROG_CC]) AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [creates debugging code [[default=$1]]]), eso_enable_debug=$enableval, eso_enable_debug=$1) AC_CACHE_CHECK([whether debugging code should be created], eso_cv_enable_debug, eso_cv_enable_debug=$eso_enable_debug) if test x"$eso_cv_enable_debug" = xyes; then eso_clean_CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]//g' \ -e 's/-g[[0-9]]//g' \ -e 's/-g[[a-z,A-Z]]* / /g' \ -e 's/-[[Og]]//g'`" ESO_PROG_CC_FLAG([g3], [CFLAGS="$CFLAGS -g3"]) if test x"$eso_cv_prog_cc_g3" = xyes; then CFLAGS="-g3" else if test x"$ac_cv_prog_cc_g" = xyes; then CFLAGS="-g" else CFLAGS="" fi fi ESO_PROG_CC_FLAG([ggdb], [CFLAGS="$CFLAGS -ggdb"]) ESO_PROG_CC_FLAG([O0], [CFLAGS="$CFLAGS -O0"]) ESO_PROG_CC_FLAG([rdynamic], [CFLAGS="$CFLAGS -rdynamic"]) ESO_PROG_CC_FLAG([Wall], [CFLAGS="$CFLAGS -Wall"]) ESO_PROG_CC_FLAG([W], [CFLAGS="$CFLAGS -W"]) CFLAGS="$CFLAGS $eso_clean_CFLAGS" ESO_DEBUG_FLAGS="-DESO_ENABLE_DEBUG" else ESO_DEBUG_FLAGS="-DNDEBUG" fi AC_SUBST(ESO_DEBUG_FLAGS) ]) # ESO_ENABLE_STRICT(strict=no) #----------------------------- AC_DEFUN([ESO_ENABLE_STRICT], [ AC_REQUIRE([AC_PROG_EGREP]) AC_REQUIRE([AC_PROG_CC]) AC_ARG_ENABLE(strict, AC_HELP_STRING([--enable-strict], [compiles with strict compiler options (may not work!) [[default=$1]]]), eso_enable_strict=$enableval, eso_enable_strict=$1) AC_CACHE_CHECK([whether strict compiler options should be used], eso_cv_enable_strict, eso_cv_enable_strict=$eso_enable_strict) if test x"$eso_cv_enable_strict" = xyes; then eso_enable_strict_std_set=no if test -n "$CFLAGS"; then echo $CFLAGS | $EGREP '(\-std=|-ansi)' >/dev/null 2>&1 if test x"$?" = x0; then eso_enable_strict_std_set=yes fi fi if test x"$eso_enable_strict_std_set" = xno; then ESO_PROG_CC_FLAG([std=c99], [CFLAGS="$CFLAGS -std=c99"]) fi ESO_PROG_CC_FLAG([pedantic], [CFLAGS="$CFLAGS -pedantic"]) fi ]) # ESO_ENABLE_PROFILE(profile=no) #----------------------------- AC_DEFUN([ESO_ENABLE_PROFILE], [ AC_REQUIRE([AC_PROG_CC]) AC_ARG_ENABLE(profile, AC_HELP_STRING([--enable-profile], [compiles with compiler options necessary for profiling (may not work!) [[default=$1]]]), eso_enable_profile=$enableval, eso_enable_profile=$1) AC_CACHE_CHECK([whether profiling compiler options should be used], eso_cv_enable_profile, eso_cv_enable_profile=$eso_enable_profile) if test x"$eso_cv_enable_profile" = xyes; then ESO_PROG_CC_FLAG([pg], [CFLAGS="$CFLAGS -pg"]) ESO_PROG_CC_FLAG([g], [CFLAGS="$CFLAGS -g"]) ESO_PROG_CC_FLAG([static-libgcc], [CFLAGS="$CFLAGS -static-libgcc"]) AC_ENABLE_SHARED(no) AC_ENABLE_STATIC(yes) fi ]) # ESO_CHECK_DOCTOOLS #------------------- AC_DEFUN([ESO_CHECK_DOCTOOLS], [ AC_ARG_VAR([DOXYGEN], [doxygen command]) AC_PATH_PROG([DOXYGEN], [doxygen]) AC_ARG_VAR([LATEX], [latex command]) AC_PATH_PROG([LATEX], [latex]) if test -z "${DOXYGEN}"; then DOXYGEN=":" fi if test -z "${LATEX}"; then LATEX=":" fi ]) # ESO_PROG_AR #------------ # Checks if ar is in the path AC_DEFUN([ESO_PROG_AR], [ AC_CHECK_PROG(AR, ar, ar, NONE) if test x"$AR" = xNONE; then AC_MSG_ERROR([Cannot find \'ar\']) fi ]) # ESO_PROG_PKGCONFIG #------------------- # Checks if pkg-config is in the path AC_DEFUN([ESO_PROG_PKGCONFIG], [ AC_ARG_VAR([PKGCONFIG], [pkg-config command]) AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config]) ]) # ESO_CHECK_EXTRA_LIBS #--------------------- # Check for non-standard headers and libraries AC_DEFUN([ESO_CHECK_EXTRA_LIBS], [ AC_ARG_WITH(extra-includes, AC_HELP_STRING([--with-extra-includes=DIR], [adds non standard include paths]), eso_with_extra_includes=$withval, eso_with_extra_includes=NONE) AC_ARG_WITH(extra-libs, AC_HELP_STRING([--with-extra-libs=DIR], [adds non standard library paths]), eso_with_extra_libs=$withval, eso_with_extra_libs=NONE) AC_MSG_CHECKING([for extra includes]) AC_CACHE_VAL([eso_cv_with_extra_includes], [ eso_cv_with_extra_includes=$eso_with_extra_includes ]) if test x"$eso_cv_with_extra_includes" != xNONE; then eso_save_IFS=$IFS IFS=':' for dir in $eso_cv_with_extra_includes; do EXTRA_INCLUDES="$EXTRA_INCLUDES -I$dir" done IFS=$eso_save_IFS AC_MSG_RESULT(added) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING([for extra libs]) AC_CACHE_VAL([eso_cv_with_extra_libs], [ eso_cv_with_extra_libs=$eso_with_extra_libs ]) if test x"$eso_cv_with_extra_libs" != xNONE; then eso_save_IFS=$IFS IFS=':' for dir in $eso_cv_with_extra_libs; do EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$dir" done IFS=$eso_save_IFS AC_MSG_RESULT(added) else AC_MSG_RESULT(no) fi ]) # ESO_CHECK_THREADS_POSIX #------------------------ # Check whether the POSIX threads are available. The cached result is # set to 'yes' if either the compiler supports the '-pthread' flag, or linking # with the POSIX thread library works, and the header file defining the POSIX # threads symbols is present. If POSIX threads are not supported, the # result is set to 'no'. Whether the compiler supports POSIX threads, # or whether the library, and the header are available is stored in cache # variables. AC_DEFUN([ESO_CHECK_THREADS_POSIX], [ AC_REQUIRE([AC_PROG_CC]) ESO_PROG_CC_FLAG([pthread], [], []) AC_CHECK_LIB([pthread], [pthread_create], [eso_threads_have_libpthread=yes], [eso_threads_have_libpthread=no]) AC_CHECK_HEADER([pthread.h], [eso_threads_have_pthread_h=yes], [eso_threads_have_pthread_h=no]) if test x"$eso_threads_have_pthread_h" != xyes; then eso_threads_posix=no else if test x"$eso_threads_have_libpthread" != xyes && \ test x"$eso_cv_prog_cc_pthread" != xyes; then eso_threads_posix=no else eso_threads_posix=yes fi fi # Setup the POSIX thread symbols if test x"$eso_threads_have_pthread_h" = xyes; then AC_DEFINE([HAVE_PTHREAD_H], [1], [Define to 1 if you have .]) fi if test x"$eso_threads_posix" = xyes; then if test x"$eso_cv_prog_cc_pthread" = xyes; then PTHREAD_CFLAGS="-pthread" else PTHREAD_CFLAGS="" fi if test x"$eso_threads_have_libpthread" = xyes; then LIBPTHREAD="-lpthread" else LIBPTHREAD="" fi fi AC_CACHE_VAL(eso_cv_threads_posix_header, eso_cv_threads_posix_header=$eso_threads_have_pthread_h) AC_CACHE_VAL(eso_cv_threads_posix_lib, eso_cv_threads_posix_lib=$eso_threads_have_libpthread) AC_CACHE_VAL(eso_cv_threads_posix_flags, eso_cv_threads_posix_flags=$eso_cv_prog_cc_pthread) AC_CACHE_VAL(eso_cv_threads_posix, eso_cv_threads_posix=$eso_threads_posix) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(LIBPTHREAD) ]) # ESO_CHECK_FUNC(FUNCTION, INCLUDES, SYMBOL) #------------------------------------------- # Checks whether a function is available and declared. AC_DEFUN([ESO_CHECK_FUNC], [ AC_LANG_PUSH(C) AC_CHECK_DECL($1, [], [], [$2]) eso_save_CFLAGS="$CFLAGS" if test x"$GCC" = xyes; then CFLAGS="$CFLAGS -pedantic-errors" fi AC_CHECK_FUNC($1) CFLAGS="$eso_save_CFLAGS" AC_LANG_POP(C) if test x"$ac_cv_have_decl_$1" = xyes && test x"$ac_cv_func_$1" = xyes; then AC_DEFINE($3) fi ]) # ESO_FUNC_VSNPRINTF_C99 #----------------------- # Check whether vsnprintf() has C99 semantics. AC_DEFUN([ESO_FUNC_VSNPRINTF_C99], [ AH_TEMPLATE([HAVE_VSNPRINTF_C99], [Define if you have the C99 `vsnprintf' function.]) AC_CACHE_CHECK([whether vsnprintf has C99 semantics], [eso_cv_func_vsnprintf_c99], [ AC_LANG_PUSH(C) eso_cppflags_save="$CPPFLAGS" eso_cflags_save="$CFLAGS" eso_ldflags_save="$LDFLAGS" eso_libs_save="$LIBS" if test x$GCC = xyes; then CFLAGS="$CFLAGS -pedantic-errors" CPPFLAGS="$CPPFLAGS $CFLAGS" fi AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #include #include #include int doit(char * s, ...) { char buffer[32]; va_list args; int q, r; va_start(args, s); q = vsnprintf(NULL, 0, s, args); r = vsnprintf(buffer, 5, s, args); va_end(args); if (q != 7 || r != 7) exit(1); exit(0); } ]], [[ doit((char*)"1234567"); exit(1); ]]) ], [eso_cv_func_vsnprintf_c99=yes], [eso_cv_func_vsnprintf_c99=no], [eso_cv_func_vsnprintf_c99=no]) CPPFLAGS="$eso_cppflags_save" CFLAGS="$eso_cflags_save" LDFLAGS="$eso_ldflags_save" LIBS="$eso_libs_save" AC_LANG_POP(C) ]) # Note that the default is to be pessimistic in the case of cross compilation. # If you know that the target has a C99 vsnprintf(), you can get around this # by setting eso_func_vsnprintf_c99 to yes, as described in the Autoconf # manual. if test x$eso_cv_func_vsnprintf_c99 = xyes; then AC_DEFINE(HAVE_VSNPRINTF_C99) fi ]) # ESO_CHECK_PRINTF_FORMATS #------------------------- # Checks for printf() format peculiarities. AC_DEFUN([ESO_CHECK_PRINTF_FORMATS], [ # Check if string format for NULL is `(null)' AH_TEMPLATE([HAVE_PRINTF_STR_FMT_NULL], [Define if printf outputs `(null)' when printing NULL using `%s']) AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #include #include ]], [[ char s[128]; sprintf(s, "%s", NULL); return strncmp(s, "(null)", 6) ? 1 : 0; ]]) ], [eso_have_printf_str_format_null=yes], [eso_have_printf_str_format_null=no], [eso_have_printf_str_format_null=no]) if test x$eso_have_printf_str_format_null = xyes; then AC_DEFINE(HAVE_PRINTF_STR_FMT_NULL) fi # Check if pointer format for NULL is `(nil)' AH_TEMPLATE([HAVE_PRINTF_PTR_FMT_NIL], [Define if printf outputs `(nil)' when printing NULL using `%p']) AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #include #include ]], [[ char s[128]; sprintf(s, "%p", NULL); return strncmp(s, "(nil)", 5) ? 1 : 0; ]]) ], [eso_have_printf_ptr_format_nil=yes], [eso_have_printf_ptr_format_nil=no], [eso_have_printf_ptr_format_nil=no]) if test x$eso_have_printf_ptr_format_nil = xyes; then AC_DEFINE(HAVE_PRINTF_PTR_FMT_NIL) fi # Check if output for `%p' is the same as `%#x' AH_TEMPLATE([HAVE_PRINTF_PTR_FMT_ALTERNATE], [Define if printf format `%p' produces the same output as `%#x' or `%#lx']) AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #include #include ]], [[ char s1[128], s2[128]; sprintf(s1, "%p", s1); sprintf(s2, "%#x", s1); return strncmp(s1, s2, 3) ? 1 : 0; ]]) ], [eso_have_printf_ptr_format_alternate=yes], [eso_have_printf_ptr_format_alternate=no], [eso_have_printf_ptr_format_alternate=no]) if test x$eso_have_printf_ptr_format_alternate = xyes; then AC_DEFINE(HAVE_PRINTF_PTR_FMT_ALTERNATE) fi # Check if pointers are treated as signed AH_TEMPLATE([HAVE_PRINTF_PTR_FMT_SIGNED], [Define if printf treats pointers as signed when using a sign flag]) AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #include ]], [[ char s[128]; sprintf(s, "%+p", s); return s[0] == '+' ? 0 : 1; ]]) ], [eso_have_printf_ptr_format_signed=yes], [eso_have_printf_ptr_format_signed=no], [eso_have_printf_ptr_format_signed=no]) if test x$eso_have_printf_ptr_format_signed = xyes; then AC_DEFINE(HAVE_PRINTF_PTR_FMT_SIGNED) fi # Check if default precision for conversion specifier `g' is 1 (as # required by ISO C) or 6. AH_TEMPLATE([HAVE_PRINTF_FLT_FMT_G_STD], [Define if printf default precision for format `g' is 1 (ISO C standard) or 6]) AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #include ]], [[ char s1[128], s2[128]; int n1, n2; sprintf(s1, "%g%n", 1.123456, &n1); sprintf(s2, "%.1g%n", 1.123456, &n2); return n1 > n2 ? 1 : 0; ]]) ], [eso_have_printf_flt_format_g_std=yes], [eso_have_printf_flt_format_g_std=no], [eso_have_printf_flt_format_g_std=no]) if test x$eso_have_printf_flt_format_g_std = xyes; then AC_DEFINE(HAVE_PRINTF_FLT_FMT_G_STD) fi ]) # ESO_FUNC_VSNPRINTF #------------------- # Checks for vsnprintf and snprintf declaration and function. AC_DEFUN([ESO_FUNC_VSNPRINTF], [ eso_compile_snprintf=no AH_TEMPLATE([HAVE_VSNPRINTF], [Define if you have the `vsnprintf' function]) ESO_CHECK_FUNC(vsnprintf, [ #include #include ], HAVE_VSNPRINTF) if test x$ac_cv_func_vsnprintf = xyes && test x$ac_cv_have_decl_vsnprintf = xyes; then ESO_FUNC_VSNPRINTF_C99 if test x$eso_cv_func_vsnprintf_c99 != xyes; then eso_compile_snprintf=yes fi else eso_compile_snprintf=yes fi if test x$eso_compile_snprintf = xyes; then if test -n "$LIBTOOL"; then SNPRINTF=snprintf.lo else SNPRINTF=snprintf.$ac_objext fi fi AC_SUBST(SNPRINTF) # The symbols defined by the following macro are only needed to setup the # vsnprintf() replacement. May be useless if the vsnprintf implementation # changes. ESO_CHECK_PRINTF_FORMATS AH_TEMPLATE([HAVE_SNPRINTF], [Define if you have the `snprintf' function]) ESO_CHECK_FUNC(snprintf, [#include ], HAVE_SNPRINTF) ]) # ESO_FUNC_VASPRINTF #------------------- # Checks for vasprintf and asprintf declaration and function. AC_DEFUN([ESO_FUNC_VASPRINTF], [ AH_TEMPLATE([HAVE_VASPRINTF], [Define if you have the `vasprintf' function]) ESO_CHECK_FUNC(vasprintf, [ #include #include ], HAVE_VASPRINTF) AH_TEMPLATE([HAVE_ASPRINTF], [Define if you have the `asprintf' function]) ESO_CHECK_FUNC(asprintf, [ #include ], HAVE_ASPRINTF) ]) # ESO_FUNC_FPATHCONF #------------------- # Checks for fpathconf declaration and function. AC_DEFUN([ESO_FUNC_FPATHCONF], [ AH_TEMPLATE([HAVE_FPATHCONF], [Define if you have the `fpathconf' function]) ESO_CHECK_FUNC(fpathconf, [#include ], HAVE_FPATHCONF) # If we have fpathconf we should also have pathconf, but who knows. AH_TEMPLATE([HAVE_PATHCONF], [Define if you have the `pathconf' function]) ESO_CHECK_FUNC(pathconf, [#include ], HAVE_PATHCONF) ]) # ESO_FUNC_SYSCONF #----------------- # Checks for sysconf declaration and function. AC_DEFUN([ESO_FUNC_SYSCONF], [ AH_TEMPLATE([HAVE_SYSCONF], [Define if you have the `sysconf' function]) ESO_CHECK_FUNC(sysconf, [#include ], HAVE_SYSCONF) ]) # ESO_FUNC_GETOPT #---------------- # Checks for GNU getopt_long declaration and function. AC_DEFUN([ESO_FUNC_GETOPT], [ AH_TEMPLATE([HAVE_GETOPT_LONG], [Define if you have the `getopt_long' function]) ESO_CHECK_FUNC(getopt_long, [#include ], HAVE_GETOPT_LONG) if test x"$ac_cv_func_getopt_long" = xno || test x"$eso_cv_have_decl_getopt_long" = xno; then if test -n "$LIBTOOL"; then GETOPT="getopt.lo getopt1.lo" else GETOPT="getopt.$ac_objext getopt1.$ac_objext" fi fi AC_SUBST(GETOPT) ]) # ESO_FUNC_GETPWUID #------------------ # Checks for getpwuid declaration and function. AC_DEFUN([ESO_FUNC_GETPWUID], [ AH_TEMPLATE([HAVE_GETPWUID], [Define if you have the `getpwuid' function]) ESO_CHECK_FUNC(getpwuid, [#include ], HAVE_GETPWUID) ]) # ESO_FUNC_GETUID #---------------- AC_DEFUN([ESO_FUNC_GETUID], [ AH_TEMPLATE([HAVE_GETUID], [Define if you have the `getuid' function]) ESO_CHECK_FUNC(getuid, [#include ], HAVE_GETUID) ]) # ESO_FUNC_LSTAT #--------------- AC_DEFUN([ESO_FUNC_LSTAT], [ AH_TEMPLATE([HAVE_LSTAT], [Define if you have the `lstat' function]) ESO_CHECK_FUNC(lstat, [#include ], HAVE_LSTAT) ]) # ESO_FUNC_STRDUP #---------------- AC_DEFUN([ESO_FUNC_STRDUP], [ AH_TEMPLATE([HAVE_STRDUP], [Define if you have the `strdup' function]) ESO_CHECK_FUNC(strdup, [#include ], HAVE_STRDUP) AH_BOTTOM([ #ifndef HAVE_STRDUP # define strdup cx_strdup #endif ]) ]) # ESO_FUNC_STPCPY #---------------- AC_DEFUN([ESO_FUNC_STPCPY], [ AH_TEMPLATE([HAVE_STPCPY], [Define if you have the `stpcpy' function]) ESO_CHECK_FUNC(stpcpy, [#include ], HAVE_STPCPY) ]) # ESO_FUNC_SYMLINK #----------------- AC_DEFUN([ESO_FUNC_SYMLINK], [ AH_TEMPLATE([HAVE_SYMLINK], [Define if you have the `symlink' function]) ESO_CHECK_FUNC(symlink, [#include ], HAVE_SYMLINK) ]) # ESO_FUNC_WORDEXP #----------------- AC_DEFUN([ESO_FUNC_WORDEXP], [ AH_TEMPLATE([HAVE_WORDEXP], [Define if you have the `wordexp' function]) ESO_CHECK_FUNC(wordexp, [#include ], HAVE_WORDEXP) ]) # ESO_FUNC_GETTIMEOFDAY #---------------------- AC_DEFUN([ESO_FUNC_GETTIMEOFDAY], [ AH_TEMPLATE([HAVE_GETTIMEOFDAY], [Define if you have the `gettimeofday' function]) ESO_CHECK_FUNC(gettimeofday, [ #include #include ], HAVE_GETTIMEOFDAY) ]) # ESO_FUNC_VA_COPY(symbol) #------------------------- # Check for an implementation of va_copy(). The argument which must be # given is the preprocessor symbol that is defined to be either va_copy # or __va_copy depending on the available function, provided that an # implementation of va_copy is available at all. AC_DEFUN([ESO_FUNC_VA_COPY], [ # Check for all three va_copy possibilities, so we get # all results in config.log for bug reports. # Check for availability of va_copy(). This is ISO C. Available with # gcc since version 3.0. AC_CACHE_CHECK([for an implementation of va_copy()], [eso_cv_have_va_copy], [ AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #ifdef HAVE_STDARG_H #include #endif void f(int i, ...) { va_list args1, args2; va_start (args1, i); va_copy (args2, args1); if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) exit (1); va_end (args1); va_end (args2); } ]], [[ f(0, 42); ]]) ], [eso_cv_have_va_copy=yes], [eso_cv_have_va_copy=no], [eso_cv_have_va_copy=no]) ]) # Check for availability of __va_copy(). Some compilers provide # this. Available with gcc since version 2.8.1. AC_CACHE_CHECK([for an implementation of __va_copy()], [eso_cv_have__va_copy], [ AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #ifdef HAVE_STDARG_H #include #endif void f(int i, ...) { va_list args1, args2; va_start (args1, i); __va_copy (args2, args1); if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) exit (1); va_end (args1); va_end (args2); } ]], [[ f(0, 42); ]]) ], [eso_cv_have__va_copy=yes], [eso_cv_have__va_copy=no], [eso_cv_have__va_copy=no]) ]) AH_TEMPLATE([HAVE_VA_COPY], [Define if you have an implementation of `va_copy()'.]) AH_TEMPLATE([HAVE___VA_COPY], [Define if you have an implementation of `__va_copy()'.]) if test "x$eso_cv_have_va_copy" = "xyes"; then eso_func_va_copy=va_copy AC_DEFINE(HAVE_VA_COPY) else if test "x$eso_cv_have__va_copy" = "xyes"; then eso_func_va_copy=__va_copy AC_DEFINE(HAVE___VA_COPY) fi fi AH_TEMPLATE([HAVE_VA_COPY_STYLE_FUNCTION], [Define if you have an implementation of a `va_copy()' style function.]) AH_TEMPLATE([$1], [A `va_copy()' style function]) if test -n "$eso_func_va_copy"; then AC_DEFINE_UNQUOTED([$1], $eso_func_va_copy) AC_DEFINE(HAVE_VA_COPY_STYLE_FUNCTION) fi # Check whether va_lists can be copied by value AC_CACHE_CHECK([whether va_lists can be copied by value], [eso_cv_have_va_value_copy], [ AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #ifdef HAVE_STDARG_H #include #endif void f(int i, ...) { va_list args1, args2; va_start (args1, i); args2 = args1; if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) exit (1); va_end (args1); va_end (args2); } ]], [[ f(0, 42); ]]) ], [eso_cv_have_va_value_copy=yes], [eso_cv_have_va_value_copy=no], [eso_cv_have_va_value_copy=no]) ]) AH_TEMPLATE([HAVE_VA_LIST_COPY_BY_VALUE], [Define if `va_lists' can be copied by value]) if test "x$eso_cv_have_va_value_copy" = "xyes"; then AC_DEFINE(HAVE_VA_LIST_COPY_BY_VALUE) fi ]) # ESO_FUNC_REALLOC_SANITY #------------------------- # Check whether realloc(NULL,) works. AC_DEFUN([ESO_FUNC_REALLOC_SANITY], [ AC_CACHE_CHECK([whether realloc(NULL,) works], [eso_cv_have_sane_realloc], [ AC_RUN_IFELSE( [ AC_LANG_PROGRAM( [[ #include ]], [[ return realloc (0, sizeof (int)) == 0; ]]) ], [eso_cv_have_sane_realloc=yes], [eso_cv_have_sane_realloc=no], [eso_cv_have_sane_realloc=no]) ]) AH_TEMPLATE([HAVE_WORKING_REALLOC], [Define if realloc(NULL,) works]) if test x$eso_cv_have_sane_realloc = xyes; then AC_DEFINE(HAVE_WORKING_REALLOC) fi ]) # ESO_FIND_FILE(file, directories, variable) #------------------------------------------ # Search for file in directories. Set variable to the first location # where file was found, if file is not found at all variable is set to NO. AC_DEFUN([ESO_FIND_FILE], [ $3=no for i in $2; do for j in $1; do echo "configure: __oline__: $i/$j" >&AC_FD_CC if test -r "$i/$j"; then echo "taking that" >&AC_FD_CC $3=$i break 2 fi done done ]) # ESO_SET_LIBRARY_VERSION([CURRENT], [REVISION], [AGE]) #------------------------------------------------------ # Sets the libtool versioning symbols LT_CURRENT, LT_REVISION, LT_AGE. AC_DEFUN([ESO_SET_LIBRARY_VERSION], [ if test -z "$1"; then LT_CURRENT=0 else LT_CURRENT="$1" fi if test -z "$2"; then LT_REVISION=0 else LT_REVISION="$2" fi if test -z "$3"; then LT_AGE=0 else LT_AGE="$3" fi AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) ]) cpl-6.6.1/m4/purify.m40000644000460300003120000000121212111147377011314 00000000000000# ESO_PROG_PURIFY #---------------- # Checks for the availability of purify AC_DEFUN([ESO_PROG_PURIFY], [ AC_ARG_VAR([PURIFY], [Purify command]) AC_ARG_ENABLE(purify, AC_HELP_STRING([--disable-purify], [disables the check for the Purify installation]), enable_purify=$enableval, enable_purify=yes) if test x"$enable_purify" = xyes ; then AC_PATH_PROG([PURIFY], [purify]) if test -z "${PURIFY}"; then enable_purify=no PURIFY=":" fi fi AM_CONDITIONAL([USE_PURIFY], [test "x$enable_purify" = "xyes"]) ]) cpl-6.6.1/m4/ltdl.m40000644000460300003120000007251612553662317010762 00000000000000# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- # # Copyright (C) 1999-2008, 2011-2015 Free Software Foundation, Inc. # Written by Thomas Tanner, 1999 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 20 LTDL_INIT # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) # ------------------------------------------ # DIRECTORY contains the libltdl sources. It is okay to call this # function multiple times, as long as the same DIRECTORY is always given. AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ])# LT_CONFIG_LTDL_DIR # We break this out into a separate macro, so that we can call it safely # internally without being caught accidentally by the sed scan in libtoolize. m4_defun([_LT_CONFIG_LTDL_DIR], [dnl remove trailing slashes m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) m4_case(_LTDL_DIR, [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply '.' m4_if(_ARG_DIR, [.], [], [m4_define([_LTDL_DIR], _ARG_DIR) _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], [m4_if(_ARG_DIR, _LTDL_DIR, [], [m4_fatal([multiple libltdl directories: ']_LTDL_DIR[', ']_ARG_DIR['])])]) m4_popdef([_ARG_DIR]) ])# _LT_CONFIG_LTDL_DIR # Initialise: m4_define([_LTDL_DIR], []) # _LT_BUILD_PREFIX # ---------------- # If Autoconf is new enough, expand to '$(top_build_prefix)', otherwise # to '$(top_builddir)/'. m4_define([_LT_BUILD_PREFIX], [m4_ifdef([AC_AUTOCONF_VERSION], [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], [$(top_build_prefix)], [$(top_builddir)/])], [$(top_build_prefix)])], [$(top_builddir)/])[]dnl ]) # LTDL_CONVENIENCE # ---------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with # '$(top_build_prefix)' if available, otherwise with '$(top_builddir)/', # and LTDLINCL will be prefixed with '$(top_srcdir)/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_build_prefix, top_builddir, and top_srcdir appropriately # in your Makefiles. AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_CONVENIENCE # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) # _LTDL_CONVENIENCE # ----------------- # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). m4_defun([_LTDL_CONVENIENCE], [case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL=$LTDLINCL AC_SUBST([INCLTDL]) ])# _LTDL_CONVENIENCE # LTDL_INSTALLABLE # ---------------- # sets LIBLTDL to the link flags for the libltdl installable library # and LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl # is not found, LIBLTDL will be prefixed with '$(top_build_prefix)' if # available, otherwise with '$(top_builddir)/', and LTDLINCL will be # prefixed with '$(top_srcdir)/' (note the single quotes!). If your # package is not flat and you're not using automake, define top_build_prefix, # top_builddir, and top_srcdir appropriately in your Makefiles. # In the future, this macro may have to be called after LT_INIT. AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_INSTALLABLE # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) # _LTDL_INSTALLABLE # ----------------- # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). m4_defun([_LTDL_INSTALLABLE], [if test -f "$prefix/lib/libltdl.la"; then lt_save_LDFLAGS=$LDFLAGS LDFLAGS="-L$prefix/lib $LDFLAGS" AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) LDFLAGS=$lt_save_LDFLAGS if test yes = "${lt_lib_ltdl-no}"; then if test yes != "$enable_ltdl_install"; then # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install AC_MSG_WARN([not overwriting libltdl at $prefix, force with '--enable-ltdl-install']) enable_ltdl_install=no fi elif test no = "$enable_ltdl_install"; then AC_MSG_WARN([libltdl not installed, but installation disabled]) fi fi # If configure.ac declared an installable ltdl, and the user didn't override # with --disable-ltdl-install, we will install the shipped libltdl. case $enable_ltdl_install in no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; *) enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" ;; esac AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL=$LTDLINCL AC_SUBST([INCLTDL]) ])# LTDL_INSTALLABLE # _LTDL_MODE_DISPATCH # ------------------- m4_define([_LTDL_MODE_DISPATCH], [dnl If _LTDL_DIR is '.', then we are configuring libltdl itself: m4_if(_LTDL_DIR, [], [], dnl if _LTDL_MODE was not set already, the default value is 'subproject': [m4_case(m4_default(_LTDL_MODE, [subproject]), [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) _LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir])], [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir; lt_libobj_prefix=$lt_ltdl_dir/])], [recursive], [], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl dnl Be careful not to expand twice: m4_define([$0], []) ])# _LTDL_MODE_DISPATCH # _LT_LIBOBJ(MODULE_NAME) # ----------------------- # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead # of into LIBOBJS. AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ])# _LT_LIBOBJS # LTDL_INIT([OPTIONS]) # -------------------- # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. If the shipped ltdl sources are not in a # subdirectory named libltdl, the directory name must be given by # LT_CONFIG_LTDL_DIR. AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test yes != "$with_included_ltdl"; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: '$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: '$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR(['--with-ltdl-include' and '--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL=-I$with_ltdl_include ;; esac INCLTDL=$LTDLINCL # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ])# LTDL_INIT # Old names: AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIB_LTDL], []) dnl AC_DEFUN([AC_WITH_LTDL], []) dnl AC_DEFUN([LT_WITH_LTDL], []) # _LTDL_SETUP # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. This is a public # interface mainly for the benefit of libltdl's own configure.ac, most # other users should call LTDL_INIT instead. AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([LT_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's|^[[ ]]*||;s|[[ :]].*$||'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ])# _LTDL_SETUP # _LT_ENABLE_INSTALL # ------------------ m4_define([_LT_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) case ,$enable_ltdl_install,$enable_ltdl_convenience in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac m4_ifdef([AM_CONDITIONAL], [AM_CONDITIONAL(INSTALL_LTDL, test no != "${enable_ltdl_install-no}") AM_CONDITIONAL(CONVENIENCE_LTDL, test no != "${enable_ltdl_convenience-no}")]) ])# _LT_ENABLE_INSTALL # LT_SYS_DLOPEN_DEPLIBS # --------------------- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this 'case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; bitrig*) lt_cv_sys_dlopen_deplibs=yes ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say 'no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to 'yes'. Without it, it would be 'no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say 'yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test yes != "$lt_cv_sys_dlopen_deplibs"; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# LT_SYS_DLOPEN_DEPLIBS # Old name: AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) # LT_SYS_MODULE_EXT # ----------------- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi if test -n "$shared_archive_member_spec"; then m4_pattern_allow([LT_SHARED_LIB_MEMBER])dnl AC_DEFINE_UNQUOTED([LT_SHARED_LIB_MEMBER], ["($shared_archive_member_spec.o)"], [Define to the shared archive member specification, say "(shr.o)".]) fi ])# LT_SYS_MODULE_EXT # Old name: AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) # LT_SYS_MODULE_PATH # ------------------ AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var=$shlibpath_var]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ])# LT_SYS_MODULE_PATH # Old name: AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) # LT_SYS_DLSEARCH_PATH # -------------------- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path=$dir else sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ])# LT_SYS_DLSEARCH_PATH # Old name: AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) # _LT_CHECK_DLPREOPEN # ------------------- m4_defun([_LT_CHECK_DLPREOPEN], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test yes = "$libltdl_cv_preloaded_symbols"; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# _LT_CHECK_DLPREOPEN # LT_LIB_DLLOAD # ------------- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required"; then LIBADD_DLOPEN=-ldl fi libltdl_cv_lib_dl_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" then lt_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS=$lt_save_LIBS fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD=-ldld])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) LIBS=$lt_dlload_save_LIBS AC_LANG_POP ])# LT_LIB_DLLOAD # Old name: AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLLIB], []) # LT_SYS_SYMBOL_USCORE # -------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ])# LT_SYS_SYMBOL_USCORE # Old name: AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) # LT_FUNC_DLSYM_USCORE # -------------------- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([_LT_COMPILER_PIC])dnl for lt_prog_compiler_wl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl for lt_cv_sys_symbol_underscore AC_REQUIRE([LT_SYS_MODULE_EXT])dnl for libltdl_cv_shlibext if test yes = "$lt_cv_sys_symbol_underscore"; then if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown dlsym_uscore_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" libname=conftmod # stay within 8.3 filename limits! cat >$libname.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; }] _LT_EOF # ltfn_module_cmds module_cmds # Execute tilde-delimited MODULE_CMDS with environment primed for # $module_cmds or $archive_cmds type content. ltfn_module_cmds () {( # subshell avoids polluting parent global environment module_cmds_save_ifs=$IFS; IFS='~' for cmd in @S|@1; do IFS=$module_cmds_save_ifs libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. major=; versuffix=; verstring=; deplibs= ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= eval $cmd done IFS=$module_cmds_save_ifs )} # Compile a loadable module using libtool macro expansion results. $CC $pic_flag -c $libname.$ac_ext ltfn_module_cmds "${module_cmds:-$archive_cmds}" # Try to fetch fnord with dlsym(). libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 cat >conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifndef RTLD_GLOBAL # ifdef DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # else # define RTLD_GLOBAL 0 # endif #endif #ifndef RTLD_NOW # ifdef DL_NOW # define RTLD_NOW DL_NOW # else # define RTLD_NOW 0 # endif #endif int main () { void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); int status = $libltdl_dlunknown; if (handle) { if (dlsym (handle, "fnord")) status = $libltdl_dlnouscore; else { if (dlsym (handle, "_fnord")) status = $libltdl_dluscore; else puts (dlerror ()); } dlclose (handle); } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null libltdl_status=$? case x$libltdl_status in x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; x*) libltdl_cv_need_uscore=unknown ;; esac fi rm -rf conftest* $libname* LIBS=$dlsym_uscore_save_LIBS ]) fi fi if test yes = "$libltdl_cv_need_uscore"; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# LT_FUNC_DLSYM_USCORE # Old name: AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) cpl-6.6.1/m4/libtool.m40000644000460300003120000112507312553662317011465 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS cpl-6.6.1/m4/ltargz.m40000644000460300003120000000501112553662317011310 00000000000000# Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004-2007, 2011-2015 Free Software Foundation, Inc. # Written by Gary V. Vaughan # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 1 ltargz.m4 AC_DEFUN([LT_FUNC_ARGZ], [ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for 'error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) LT_ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [LT_ARGZ_H=lt__argz.h; AC_LIBOBJ([lt__argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$LT_ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test yes = "$lt_cv_sys_argz_works"], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [LT_ARGZ_H=lt__argz.h AC_LIBOBJ([lt__argz])])]) AC_SUBST([LT_ARGZ_H]) ]) cpl-6.6.1/m4/ltversion.m40000644000460300003120000000127312553662317012040 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) cpl-6.6.1/m4/cpl.m40000644000460300003120000013075012553176310010565 00000000000000# CPL_CHECK_CFITSIO(version) #--------------------------- # Checks for the cfitsio library and header files. AC_DEFUN([CPL_CHECK_CFITSIO], [ AC_REQUIRE([AC_SYS_LARGEFILE]) AC_REQUIRE([ESO_CHECK_THREADS_POSIX]) cpl_cfitsio_check_version="$1" cpl_cfitsio_check_header="fitsio.h" cpl_cfitsio_check_lib="libcfitsio.a" cpl_cfitsio_incdirs="" cpl_cfitsio_libdirs="" cpl_cfitsio_includes="" cpl_cfitsio_libraries="" AC_ARG_WITH(cfitsio, AC_HELP_STRING([--with-cfitsio], [location where cfitsio is installed]), [ cpl_with_cfitsio=$withval ]) AC_ARG_WITH(cfitsio-includes, AC_HELP_STRING([--with-cfitsio-includes], [location of the cfitsio header files]), cpl_with_cfitsio_includes=$withval) AC_ARG_WITH(cfitsio-libs, AC_HELP_STRING([--with-cfitsio-libs], [location of the cfitsio library]), cpl_with_cfitsio_libs=$withval) AC_ARG_ENABLE(cfitsio-test, AC_HELP_STRING([--disable-cfitsio-test], [disables checks for the cfitsio library and headers]), cpl_enable_cfitsio_test=$enableval, cpl_enable_cfitsio_test=yes) # We need libpthread for the following tests if test -z "$LIBPTHREAD"; then AC_MSG_ERROR([POSIX thread library was not found on your system! Please check!]) fi AC_MSG_CHECKING([for cfitsio]) if test "x$cpl_enable_cfitsio_test" = xyes; then # Check for the cfitsio includes if test -z "$cpl_with_cfitsio_includes"; then if test -z "$cpl_with_cfitsio"; then # Try some known system locations cpl_cfitsio_incdirs="/opt/cfitsio/include" cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include/libcfitsio0" cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include/cfitsio" cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/local/include" cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include/libcfitsio0" cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include/cfitsio" cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs /usr/include" test -n "$CFITSIODIR" && \ cpl_cfitsio_incdirs="$CFITSIODIR/include/libcfitsio0 \ $CFITSIODIR/include/cfitsio \ $CFITSIODIR/include \ $cpl_cfitsio_incdirs" test -n "$CPLDIR" && \ cpl_cfitsio_incdirs="$CPLDIR/include/libcfitsio0 \ $CPLDIR/include/cfitsio \ $CPLDIR/include \ $cpl_cfitsio_incdirs" else cpl_cfitsio_incdirs="$cpl_with_cfitsio/include/libcfitsio0" cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs $cpl_with_cfitsio/include/cfitsio" cpl_cfitsio_incdirs="$cpl_cfitsio_incdirs $cpl_with_cfitsio/include" fi else cpl_cfitsio_incdirs="$cpl_with_cfitsio_includes" fi ESO_FIND_FILE($cpl_cfitsio_check_header, $cpl_cfitsio_incdirs, cpl_cfitsio_includes) # Check for the cfitsio library if test -z "$cpl_with_cfitsio_libs"; then if test -z "$cpl_with_cfitsio"; then # Try some known system locations cpl_cfitsio_libdirs="/opt/cfitsio/lib" cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib64" cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib" cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/local/lib32" cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib64" cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib" cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs /usr/lib32" test -n "$CFITSIODIR" && \ cpl_cfitsio_libdirs="$CFITSIODIR/lib64 $CFITSIODIR/lib \ $CFITSIODIR/lib32 $cpl_cfitsio_libdirs" test -n "$CPLDIR" && \ cpl_cfitsio_libdirs="$CPLDIR/lib64 $CPLDIR/lib $CPLDIR/lib32 \ $cpl_cfitsio_libdirs" else cpl_cfitsio_libdirs="$cpl_with_cfitsio/lib64" cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs $cpl_with_cfitsio/lib" cpl_cfitsio_libdirs="$cpl_cfitsio_libdirs $cpl_with_cfitsio/lib32" fi else cpl_cfitsio_libdirs="$cpl_with_cfitsio_libs" fi ESO_FIND_FILE($cpl_cfitsio_check_lib, $cpl_cfitsio_libdirs, cpl_cfitsio_libraries) if test x"$cpl_cfitsio_includes" = xno || \ test x"$cpl_cfitsio_libraries" = xno; then cpl_cfitsio_notfound="" if test x"$cpl_cfitsio_includes" = xno; then if test x"$cpl_cfitsio_libraries" = xno; then cpl_cfitsio_notfound="(headers and libraries)" else cpl_cfitsio_notfound="(headers)" fi else cpl_cfitsio_notfound="(libraries)" fi AC_MSG_ERROR([cfitsio $cpl_cfitsio_notfound was not found on your system. Please check!]) else AC_MSG_RESULT([libraries $cpl_cfitsio_libraries, headers $cpl_cfitsio_includes]) fi # Set up the symbols # Add '-lz' to the static library symbol, as distributors apparently # remove the libz code from the cfitsio sources. CFITSIO_INCLUDES="-I$cpl_cfitsio_includes" CFITSIO_LDFLAGS="-L$cpl_cfitsio_libraries" LIBCFITSIO="-lcfitsio" LIBCFITSIO_STATIC="$cpl_cfitsio_libraries/$cpl_cfitsio_check_lib" # Do not add redundant libraries echo $LIBS | grep -q -e '-lm' || LIBS="-lm $LIBS" # Check whether cfitsio can be used AC_MSG_CHECKING([whether cfitsio can be used]) AC_LANG_PUSH(C) cpl_cfitsio_cflags_save="$CFLAGS" cpl_cfitsio_ldflags_save="$LDFLAGS" cpl_cfitsio_libs_save="$LIBS" CFLAGS="$CFITSIO_INCLUDES $CFLAGS" LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS" LIBS="$LIBCFITSIO_STATIC $LIBPTHREAD -lm" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[ #include ]], [ float v; fits_get_version(&v); ])], [cpl_cfitsio_is_usable="yes"], [cpl_cfitsio_is_usable="no"]) AC_MSG_RESULT([$cpl_cfitsio_is_usable]) AC_LANG_POP(C) CFLAGS="$cpl_cfitsio_cflags_save" LDFLAGS="$cpl_cfitsio_ldflags_save" LIBS="$cpl_cfitsio_libs_save" if test x"$cpl_cfitsio_is_usable" = xno; then AC_MSG_ERROR([Linking with cfitsio failed! Please check architecture!]) fi # Check cfitsio version AC_MSG_CHECKING([for a cfitsio version >= $cpl_cfitsio_check_version]) AC_LANG_PUSH(C) cpl_cfitsio_cflags_save="$CFLAGS" cpl_cfitsio_ldflags_save="$LDFLAGS" cpl_cfitsio_libs_save="$LIBS" CFLAGS="$CFITSIO_INCLUDES $CFLAGS" AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include #include ]], [ int vlib = 0; int vmin = (int)(1000. * $cpl_cfitsio_check_version + 0.5); float v = CFITSIO_VERSION; vlib = (int)(v * 1000 + 0.5); FILE* f = fopen("conftest.out", "w"); fprintf(f, "%5.3f\n", v); fclose(f); if (vlib < vmin) { return 1; } return 0; ])], [ cpl_cfitsio_version="`cat conftest.out`"; rm -f conftest.out ], [ cpl_cfitsio_version="no"; cpl_cfitsio_version_found="`cat conftest.out`"; rm -f conftest.out ]) AC_MSG_RESULT([$cpl_cfitsio_version]) AC_LANG_POP(C) CFLAGS="$cpl_cfitsio_cflags_save" LDFLAGS="$cpl_cfitsio_ldflags_save" LIBS="$cpl_cfitsio_libs_save" if test x"$cpl_cfitsio_version" = xno; then AC_MSG_ERROR([Installed cfitsio ($cpl_cfitsio_version_found) is too old. Please update to version $cpl_cfitsio_check_version or newer.]) fi # Check whether cfitsio has large file support AC_LANG_PUSH(C) cpl_cfitsio_cflags_save="$CFLAGS" cpl_cfitsio_ldflags_save="$LDFLAGS" cpl_cfitsio_libs_save="$LIBS" CFLAGS="$CFITSIO_INCLUDES $CFLAGS" LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS" LIBS="$LIBCFITSIO_STATIC -lm $LIBPTHREAD" AC_MSG_CHECKING([whether cfitsio provides fits_hdu_getoff()]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[ #include ]], [ fitsfile f; int sts; fits_get_hduoff(&f, NULL, NULL, NULL, &sts); ])], [cpl_cfitsio_have_fits_get_hduoff="yes"], [cpl_cfitsio_have_fits_get_hduoff="no"]) AC_MSG_RESULT([$cpl_cfitsio_have_fits_get_hduoff]) AC_MSG_CHECKING([whether cfitsio provides fits_get_hduaddrll()]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[ #include ]], [ fitsfile f; int sts; fits_get_hduaddrll(&f, NULL, NULL, NULL, &sts); ])], [cpl_cfitsio_have_fits_get_hduaddrll="yes"], [cpl_cfitsio_have_fits_get_hduaddrll="no"]) AC_MSG_RESULT([$cpl_cfitsio_have_fits_get_hduaddrll]) AC_LANG_POP(C) CFLAGS="$cpl_cfitsio_cflags_save" LDFLAGS="$cpl_cfitsio_ldflags_save" LIBS="$cpl_cfitsio_libs_save" # Check whether cfitsio is thread-safe AC_MSG_CHECKING([whether cfitsio was compiled with thread support]) AC_LANG_PUSH(C) cpl_cfitsio_cflags_save="$CFLAGS" cpl_cfitsio_ldflags_save="$LDFLAGS" cpl_cfitsio_libs_save="$LIBS" CFLAGS="$CFITSIO_INCLUDES $CFLAGS" LDFLAGS="$CFITSIO_LDFLAGS $LDFLAGS" LIBS="$LIBCFITSIO_STATIC -lm" AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include ]], [ if (fits_is_reentrant() == 0) { return 1; } return 0; ])], [cpl_cfitsio_is_thread_safe=yes], [cpl_cfitsio_is_thread_safe=no]) AC_MSG_RESULT([$cpl_cfitsio_is_thread_safe]) AC_LANG_POP(C) CFLAGS="$cpl_cfitsio_cflags_save" LDFLAGS="$cpl_cfitsio_ldflags_save" LIBS="$cpl_cfitsio_libs_save" # Set compiler flags and libraries if test x"$cpl_cfitsio_have_fits_get_hduoff" = xyes || \ test x"$cpl_cfitsio_have_fits_get_hduaddrll" = xyes; then if test x"$cpl_cfitsio_have_fits_get_hduoff"; then AC_DEFINE([HAVE_FITS_GET_HDUOFF], [1], [Define if you have the `fits_get_hduoff' function]) else AC_DEFINE([HAVE_FITS_GET_HDUADDRLL], [1], [Define if you have the `fits_get_hduaddrll' function]) fi fi else AC_MSG_RESULT([disabled]) AC_MSG_WARN([cfitsio checks have been disabled! This package may not build!]) CFITSIO_INCLUDES="" CFITSIO_LDFLAGS="" LIBCFITSIO="" cpl_cfitsio_is_thread_safe="undefined" fi AC_CACHE_VAL(cpl_cv_cfitsio_is_thread_safe, cpl_cv_cfitsio_is_thread_safe=$cpl_cfitsio_is_thread_safe) AC_SUBST(CFITSIO_INCLUDES) AC_SUBST(CFITSIO_LDFLAGS) AC_SUBST(LIBCFITSIO) ]) # CPL_CHECK_CEXT(incdirs=[], libdirs=[]) #--------------------------------------- # Checks for the C extension library and header files. AC_DEFUN([CPL_CHECK_CEXT], [ AC_MSG_CHECKING([for libcext]) cpl_cext_check_header="cxtypes.h" cpl_cext_check_lib="libcext.a" cpl_cext_incdirs="" cpl_cext_libdirs="" cpl_cext_includes="" cpl_cext_libraries="" # Initialize directory search paths with the arguments provided if test -n "$1"; then cpl_cext_incdirs="$1" fi if test -n "$2"; then cpl_cext_libdirs="$2" fi AC_ARG_WITH(cext, AC_HELP_STRING([--with-cext], [location where libcext is installed]), [ cpl_with_cext=$withval ]) AC_ARG_WITH(cext-includes, AC_HELP_STRING([--with-cext-includes], [location of the libcext header files]), cpl_with_cext_includes=$withval) AC_ARG_WITH(cext-libs, AC_HELP_STRING([--with-cext-libs], [location of the libcext library]), cpl_with_cext_libs=$withval) AC_ARG_ENABLE(cext-test, AC_HELP_STRING([--disable-cext-test], [disables checks for the libcext library and headers]), cpl_enable_cext_test=$enableval, cpl_enable_cext_test=yes) if test "x$cpl_enable_cext_test" = xyes; then # Check for the libcext includes if test -z "$cpl_with_cext_includes"; then if test -z "$cpl_with_cext"; then if test -z "$cpl_cext_incdirs"; then # Try some known system locations cpl_cext_incdirs="/opt/cext/include" cpl_cext_incdirs="$cpl_cext_incdirs /usr/local/include/cext" cpl_cext_incdirs="$cpl_cext_incdirs /usr/local/include" cpl_cext_incdirs="$cpl_cext_incdirs /usr/include/cext" cpl_cext_incdirs="$cpl_cext_incdirs /usr/include" test -n "$CPLDIR" && \ cpl_cext_incdirs="$CPLDIR/include/cext \ $CPLDIR/include \ $cpl_cext_incdirs" fi else cpl_cext_incdirs="$cpl_with_cext/include/cext" cpl_cext_incdirs="$cpl_cext_incdirs $cpl_with_cext/include" fi else cpl_cext_incdirs="$cpl_with_cext_includes" fi ESO_FIND_FILE($cpl_cext_check_header, $cpl_cext_incdirs, cpl_cext_includes) # Check for the libcext library if test -z "$cpl_with_cext_libs"; then if test -z "$cpl_with_cext"; then if test -z "$cpl_cext_libdirs"; then # Try some known system locations cpl_cext_libdirs="/opt/cext/lib" cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib64" cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib" cpl_cext_libdirs="$cpl_cext_libdirs /usr/local/lib32" cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib64" cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib" cpl_cext_libdirs="$cpl_cext_libdirs /usr/lib32" test -n "$CPLDIR" && \ cpl_cext_libdirs="$CPLDIR/lib64 \ $CPLDIR/lib \ $CPLDIR/lib32 \ $cpl_cext_libdirs" fi else cpl_cext_libdirs="$cpl_with_cext/lib64" cpl_cext_libdirs="$cpl_cext_libdirs $cpl_with_cext/lib" cpl_cext_libdirs="$cpl_cext_libdirs $cpl_with_cext/lib32" fi else cpl_cext_libdirs="$cpl_with_cext_libs" fi ESO_FIND_FILE($cpl_cext_check_lib, $cpl_cext_libdirs, cpl_cext_libraries) if test x"$cpl_cext_includes" = xno || \ test x"$cpl_cext_libraries" = xno; then cpl_cext_notfound="" if test x"$cpl_cext_includes" = xno; then if test x"$cpl_cext_libraries" = xno; then cpl_cext_notfound="(headers and libraries)" else cpl_cext_notfound="(headers)" fi else cpl_cext_notfound="(libraries)" fi AC_MSG_ERROR([libcext $cpl_cext_notfound was not found on your system. Please check!]) else AC_MSG_RESULT([libraries $cpl_cext_libraries, headers $cpl_cext_includes]) fi # Set up the symbols CX_INCLUDES="-I$cpl_cext_includes" CX_LDFLAGS="-L$cpl_cext_libraries" LIBCEXT="-lcext" AC_MSG_CHECKING([whether libcext can be used]) AC_LANG_PUSH(C) cpl_cext_cflags_save="$CFLAGS" cpl_cext_ldflags_save="$LDFLAGS" cpl_cext_libs_save="$LIBS" CFLAGS="$CX_INCLUDES $CFLAGS" LDFLAGS="$CX_LDFLAGS $LDFLAGS" LIBS="$LIBCEXT" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[ #include ]], [ cx_program_set_name("MyProgram"); ])], [cpl_cext_is_usable="yes"], [cpl_cext_is_usable="no"]) AC_MSG_RESULT([$cpl_cext_is_usable]) AC_LANG_POP(C) CFLAGS="$cpl_cext_cflags_save" LDFLAGS="$cpl_cext_ldflags_save" LIBS="$cpl_cext_libs_save" if test x"$cpl_cext_is_usable" = xno; then AC_MSG_ERROR([Linking with libcext failed! Please check architecture!]) fi else AC_MSG_RESULT([disabled]) AC_MSG_WARN([libcext checks have been disabled! This package may not build!]) CX_INCLUDES="" CX_LDFLAGS="" LIBCEXT="" fi AC_SUBST(CX_INCLUDES) AC_SUBST(CX_LDFLAGS) AC_SUBST(LIBCEXT) ]) # CPL_CHECK_WCS(version) #----------------------- # Checks for the wcs library and header files. AC_DEFUN([CPL_CHECK_WCS], [ AC_MSG_CHECKING([for libwcs]) cpl_wcs_check_version="$1" cpl_wcs_check_header="wcslib.h" cpl_wcs_check_lib="libwcs.a" cpl_wcs_includes="" cpl_wcs_libraries="" AC_ARG_WITH(wcs, AC_HELP_STRING([--with-wcs], [location where wcs is installed]), [ cpl_with_wcs=$withval ]) AC_ARG_WITH(wcs-includes, AC_HELP_STRING([--with-wcs-includes], [location of the libwcs header files]), cpl_with_wcs_includes=$withval) AC_ARG_WITH(wcs-libs, AC_HELP_STRING([--with-wcs-libs], [location of the libwcs library]), cpl_with_wcs_libs=$withval) # Check for the wcs includes if test -z "$cpl_with_wcs_includes"; then if test -z "$cpl_with_wcs"; then # Try some known system locations cpl_wcs_incdirs="/opt/wcslib/include/wcslib" cpl_wcs_incdirs="$cpl_wcs_incdirs /usr/local/include/wcslib" cpl_wcs_incdirs="$cpl_wcs_incdirs /usr/local/include" cpl_wcs_incdirs="$cpl_wcs_incdirs /usr/include/wcslib" cpl_wcs_incdirs="$cpl_wcs_incdirs /usr/include" test -n "$WCSDIR" && \ cpl_wcs_incdirs="$WCSDIR/include/wcslib \ $cpl_wcs_incdirs" else cpl_wcs_incdirs="$cpl_with_wcs/include/wcslib" fi else cpl_wcs_incdirs="$cpl_with_wcs_includes" fi ESO_FIND_FILE($cpl_wcs_check_header, $cpl_wcs_incdirs, cpl_wcs_includes) # Check for the wcs library if test -z "$cpl_with_wcs_libs"; then if test -z "$cpl_with_wcs"; then # Try some known system locations cpl_wcs_libdirs="/opt/wcslib/lib64" cpl_wcs_libdirs="$cpl_wcs_libdirs /opt/wcslib/lib" cpl_wcs_libdirs="$cpl_wcs_libdirs /opt/wcslib/lib32" cpl_wcs_libdirs="$cpl_wcs_libdirs /usr/local/lib64" cpl_wcs_libdirs="$cpl_wcs_libdirs /usr/local/lib" cpl_wcs_libdirs="$cpl_wcs_libdirs /usr/local/lib32" cpl_wcs_libdirs="$cpl_wcs_libdirs /usr/lib64" cpl_wcs_libdirs="$cpl_wcs_libdirs /usr/lib" cpl_wcs_libdirs="$cpl_wcs_libdirs /usr/lib32" test -n "$WCSDIR" && \ cpl_wcs_libdirs="$WCSDIR/lib64 \ $WCSDIR/lib \ $WCSDIR/lib32 \ $cpl_wcs_libdirs" else cpl_wcs_libdirs="$cpl_with_wcs/lib64" cpl_wcs_libdirs="$cpl_wcs_libdirs $cpl_with_wcs/lib" cpl_wcs_libdirs="$cpl_wcs_libdirs $cpl_with_wcs/lib32" fi else cpl_wcs_libdirs="$cpl_with_wcs_libs" fi ESO_FIND_FILE($cpl_wcs_check_lib, $cpl_wcs_libdirs, cpl_wcs_libraries) if test x"$cpl_wcs_includes" = xno || \ test x"$cpl_wcs_libraries" = xno; then cpl_wcs_notfound="" if test x"$cpl_wcs_includes" = xno; then if test x"$cpl_wcs_libraries" = xno; then cpl_wcs_notfound="(headers and libraries)" else cpl_wcs_notfound="(headers)" fi else cpl_wcs_notfound="(libraries)" fi AC_MSG_WARN([libwcs $cpl_wcs_notfound was not found on your system. WCS support will be disabled!]) else AC_MSG_RESULT([libraries $cpl_wcs_libraries, headers $cpl_wcs_includes]) # Setup the symbols WCS_INCLUDES="-I$cpl_wcs_includes" WCS_LDFLAGS="-L$cpl_wcs_libraries" LIBWCS="-lwcs -lm" LIBWCS_STATIC="$cpl_wcs_libraries/$cpl_wcs_check_lib -lm" # Check wcs library version AC_MSG_CHECKING([for a libwcs version >= $cpl_wcs_check_version]) AC_LANG_PUSH(C) cpl_wcs_cflags_save="$CFLAGS" cpl_wcs_ldflags_save="$LDFLAGS" cpl_wcs_libs_save="$LIBS" CFLAGS="$WCS_INCLUDES $CFLAGS" LDFLAGS="$WCS_LDFLAGS $LDFLAGS" LIBS="$LIBWCS_STATIC" AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include #include #define stringify(v) stringify_arg(v) #define stringify_arg(v) #v ]], [ char vmin[[]] = "$cpl_wcs_check_version"; char vlib[[]] = stringify(WCSLIB_VERSION); int min_major = 0; int min_minor = 0; int min_micro = 0; int lib_major = 0; int lib_minor = 0; int lib_micro = 0; sscanf(vmin, "%d.%d.%d", &min_major, &min_minor, &min_micro); sscanf(vlib, "%d.%d.%d", &lib_major, &lib_minor, &lib_micro); FILE* f = fopen("conftest.out", "w"); fprintf(f, "%s\n", vlib); fclose(f); if (lib_major < min_major) { return 1; } else { if (lib_major == min_major) { if (lib_minor < min_minor) { return 1; } else { if (lib_minor == min_minor) { if (lib_micro < min_micro) { return 1; } } } } } return 0; ])], [ cpl_wcs_version="`cat conftest.out`"; rm -f conftest.out ], [ cpl_wcs_version="no"; cpl_wcs_version_found="`cat conftest.out`"; rm -f conftest.out ]) AC_MSG_RESULT([$cpl_wcs_version]) AC_LANG_POP(C) CFLAGS="$cpl_wcs_cflags_save" LDFLAGS="$cpl_wcs_ldflags_save" LIBS="$cpl_wcs_libs_save" if test x"$cpl_wcs_version" = xno; then AC_MSG_WARN([Installed libwcs ($cpl_wcs_version_found) is too old. WCS support will not be available!]) WCS_INCLUDES="" WCS_LDFLAGS="" LIBWCS="" else AC_DEFINE_UNQUOTED(CPL_WCS_INSTALLED, 1, [Defined if WCS is available]) fi AC_SUBST(WCS_INCLUDES) AC_SUBST(WCS_LDFLAGS) AC_SUBST(LIBWCS) fi ]) # CPL_CHECK_FFTW(version) #------------------------ # Checks for the FFTW library and header files. AC_DEFUN([CPL_CHECK_FFTW], [ cpl_fftw_check_version="$1" cpl_fftw_check_header="fftw3.h" cpl_fftw_check_lib="libfftw3.a" cpl_fftwf_check_lib="libfftw3f.a" cpl_fftw_includes="" cpl_fftw_libraries="" cpl_fftwf_libraries="" AC_ARG_WITH(fftw, AC_HELP_STRING([--with-fftw], [location where fftw is installed]), [ cpl_with_fftw=$withval ]) AC_ARG_WITH(fftw-includes, AC_HELP_STRING([--with-fftw-includes], [location of the fftw header files]), cpl_with_fftw_includes=$withval) AC_ARG_WITH(fftw-libs, AC_HELP_STRING([--with-fftw-libs], [location of the fftw libraries]), cpl_with_fftw_libs=$withval) AC_MSG_CHECKING([for fftw (normal-precision)]) # Check for the fftw includes if test -z "$cpl_with_fftw_includes"; then if test -z "$cpl_with_fftw"; then # Try some known system locations cpl_fftw_incdirs="/opt/fftw/include" cpl_fftw_incdirs="$cpl_fftw_incdirs /usr/local/include" cpl_fftw_incdirs="$cpl_fftw_incdirs /usr/include" test -n "$FFTWDIR" && \ cpl_fftw_incdirs="$FFTWDIR/include \ $cpl_fftw_incdirs" else cpl_fftw_incdirs="$cpl_with_fftw/include" fi else cpl_fftw_incdirs="$cpl_with_fftw_includes" fi ESO_FIND_FILE($cpl_fftw_check_header, $cpl_fftw_incdirs, cpl_fftw_includes) # Check for normal-precision fftw library if test -z "$cpl_with_fftw_libs"; then if test -z "$cpl_with_fftw"; then # Try some known system locations cpl_fftw_libdirs="/opt/fftw/lib64" cpl_fftw_libdirs="$cpl_fftw_libdirs /opt/fftw/lib" cpl_fftw_libdirs="$cpl_fftw_libdirs /opt/fftw/lib32" cpl_fftw_libdirs="$cpl_fftw_libdirs /usr/local/lib64" cpl_fftw_libdirs="$cpl_fftw_libdirs /usr/local/lib" cpl_fftw_libdirs="$cpl_fftw_libdirs /usr/local/lib32" cpl_fftw_libdirs="$cpl_fftw_libdirs /usr/lib64" cpl_fftw_libdirs="$cpl_fftw_libdirs /usr/lib" cpl_fftw_libdirs="$cpl_fftw_libdirs /usr/lib32" test -n "$FFTWDIR" && \ cpl_fftw_libdirs="$FFTWDIR/lib64 \ $FFTWDIR/lib \ $FFTWDIR/lib32 \ $cpl_fftw_libdirs" else cpl_fftw_libdirs="$cpl_with_fftw/lib64" cpl_fftw_libdirs="$cpl_fftw_libdirs $cpl_with_fftw/lib" cpl_fftw_libdirs="$cpl_fftw_libdirs $cpl_with_fftw/lib32" fi else cpl_fftw_libdirs="$cpl_with_fftw_libs" fi ESO_FIND_FILE($cpl_fftw_check_lib, $cpl_fftw_libdirs, cpl_fftw_libraries) if test x"$cpl_fftw_includes" = xno || \ test x"$cpl_fftw_libraries" = xno; then cpl_fftw_notfound="" if test x"$cpl_fftw_includes" = xno; then if test x"$cpl_fftw_libraries" = xno; then cpl_fftw_notfound="(headers and libraries)" else cpl_fftw_notfound="(headers)" fi else cpl_fftw_notfound="(libraries)" fi AC_MSG_RESULT([no]) AC_MSG_WARN([fftw (normal-precision) $cpl_fftw_notfound was not found on your system.]) else AC_MSG_RESULT([libraries $cpl_fftw_libraries, headers $cpl_fftw_includes]) # Set up the symbols FFTW_INCLUDES="-I$cpl_fftw_includes" FFTW_LDFLAGS="-L$cpl_fftw_libraries" LIBFFTW="-lfftw3 -lm" LIBFFTW_STATIC="$cpl_fftw_libraries/$cpl_fftw_check_lib -lm" # Check fftw (normal-precision) library version AC_MSG_CHECKING([for a fftw (normal-precision) version >= $cpl_fftw_check_version]) AC_LANG_PUSH(C) cpl_fftw_cflags_save="$CFLAGS" cpl_fftw_ldflags_save="$LDFLAGS" cpl_fftw_libs_save="$LIBS" CFLAGS="$FFTW_INCLUDES $CFLAGS" LDFLAGS="$FFTW_LDFLAGS $LDFLAGS" LIBS="$LIBFFTW_STATIC" AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include #include #include #include ]], [ char vmin[[]] = "$cpl_fftw_check_version"; char *vstr = strdup(fftw_version); char *vlib = vstr; char *suffix = NULL; int min_major = 0; int min_minor = 0; int min_micro = 0; int lib_major = 0; int lib_minor = 0; int lib_micro = 0; vlib = strchr(vstr, '-') + 1; suffix = strrchr(vlib, '-'); if (suffix) { *suffix = '\0'; } sscanf(vmin, "%d.%d.%d", &min_major, &min_minor, &min_micro); sscanf(vlib, "%d.%d.%d", &lib_major, &lib_minor, &lib_micro); FILE* f = fopen("conftest.out", "w"); fprintf(f, "%s\n", vlib); fclose(f); free(vstr); if (lib_major < min_major) { return 1; } else { if (lib_major == min_major) { if (lib_minor < min_minor) { return 1; } else { if (lib_minor == min_minor) { if (lib_micro < min_micro) { return 1; } } } } } return 0; ])], [ cpl_fftw_version="`cat conftest.out`"; rm -f conftest.out ], [ cpl_fftw_version="no"; cpl_fftw_version_found="`cat conftest.out`"; rm -f conftest.out ]) AC_MSG_RESULT([$cpl_fftw_version]) AC_LANG_POP(C) CFLAGS="$cpl_fftw_cflags_save" LDFLAGS="$cpl_fftw_ldflags_save" LIBS="$cpl_fftw_libs_save" if test x"$cpl_fftw_version" = xno; then AC_MSG_WARN([Installed normal-precision fftw ($cpl_fftw_version_found) is too old]) FFTW_INCLUDES="" FFTW_LDFLAGS="" LIBFFTW="" else AC_DEFINE_UNQUOTED(CPL_FFTW_INSTALLED, 1, [Defined if FFTW (normal-precision) is available]) fi AC_SUBST(FFTW_INCLUDES) AC_SUBST(FFTW_LDFLAGS) AC_SUBST(LIBFFTW) fi # Check for single-precision fftw AC_MSG_CHECKING([for fftw (single-precision)]) ESO_FIND_FILE($cpl_fftwf_check_lib, $cpl_fftw_libdirs, cpl_fftwf_libraries) if test x"$cpl_fftw_includes" = xno || \ test x"$cpl_fftwf_libraries" = xno; then cpl_fftw_notfound="" if test x"$cpl_fftw_includes" = xno; then if test x"$cpl_fftwf_libraries" = xno; then cpl_fftw_notfound="(headers and libraries)" else cpl_fftw_notfound="(headers)" fi else cpl_fftw_notfound="(libraries)" fi AC_MSG_RESULT([no]) AC_MSG_WARN([fftw (single-precision) $cpl_fftw_notfound was not found on your system.]) else AC_MSG_RESULT([libraries $cpl_fftwf_libraries, headers $cpl_fftw_includes]) # Set up the symbols FFTWF_INCLUDES="-I$cpl_fftw_includes" FFTWF_LDFLAGS="-L$cpl_fftwf_libraries" LIBFFTWF="-lfftw3f -lm" LIBFFTWF_STATIC="$cpl_fftwf_libraries/$cpl_fftwf_check_lib -lm" # Check fftw (single-precision) library version AC_MSG_CHECKING([for a fftw (single-precision) version >= $cpl_fftw_check_version]) AC_LANG_PUSH(C) cpl_fftw_cflags_save="$CFLAGS" cpl_fftw_ldflags_save="$LDFLAGS" cpl_fftw_libs_save="$LIBS" CFLAGS="$FFTWF_INCLUDES $CFLAGS" LDFLAGS="$FFTWF_LDFLAGS $LDFLAGS" LIBS="$LIBFFTWF" AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include #include #include #include ]], [ char vmin[[]] = "$cpl_fftw_check_version"; char *vstr = strdup(fftwf_version); char *vlib = vstr; char *suffix = NULL; int min_major = 0; int min_minor = 0; int min_micro = 0; int lib_major = 0; int lib_minor = 0; int lib_micro = 0; vlib = strchr(vstr, '-') + 1; suffix = strrchr(vlib, '-'); if (suffix) { *suffix = '\0'; } sscanf(vmin, "%d.%d.%d", &min_major, &min_minor, &min_micro); sscanf(vlib, "%d.%d.%d", &lib_major, &lib_minor, &lib_micro); FILE* f = fopen("conftest.out", "w"); fprintf(f, "%s\n", vlib); fclose(f); free(vstr); if (lib_major < min_major) { return 1; } else { if (lib_major == min_major) { if (lib_minor < min_minor) { return 1; } else { if (lib_minor == min_minor) { if (lib_micro < min_micro) { return 1; } } } } } return 0; ])], [ cpl_fftwf_version="`cat conftest.out`"; rm -f conftest.out ], [ cpl_fftwf_version="no"; cpl_fftwf_version_found="`cat conftest.out`"; rm -f conftest.out ]) AC_MSG_RESULT([$cpl_fftwf_version]) AC_LANG_POP(C) CFLAGS="$cpl_fftw_cflags_save" LDFLAGS="$cpl_fftw_ldflags_save" LIBS="$cpl_fftw_libs_save" if test x"$cpl_fftwf_version" = xno; then AC_MSG_WARN([Installed single-precision fftw ($cpl_fftw_version_found) is too old!]) FFTWF_INCLUDES="" FFTWF_LDFLAGS="" LIBFFTWF="" else AC_DEFINE_UNQUOTED(CPL_FFTWF_INSTALLED, 1, [Defined if FFTW (single-precision) is available]) fi AC_SUBST(FFTWF_INCLUDES) AC_SUBST(FFTWF_LDFLAGS) AC_SUBST(LIBFFTWF) fi ]) # # CPL_CREATE_SYMBOLS(build=[]) #----------------------------- # Sets the Makefile symbols for the CPL libraries. If an argument is # provided the symbols are setup for building CPL, if no argument is # given (default) the symbols are set for using the libraries # for external package development. AC_DEFUN([CPL_CREATE_SYMBOLS], [ if test -z "$1"; then LIBCPLCORE='-lcplcore' LIBCPLDRS='-lcpldrs' LIBCPLUI='-lcplui' LIBCPLDFS='-lcpldfs' else LIBCPLCORE='$(top_builddir)/cplcore/libcplcore.la' LIBCPLDRS='$(top_builddir)/cpldrs/libcpldrs.la' LIBCPLUI='$(top_builddir)/cplui/libcplui.la' LIBCPLDFS='$(top_builddir)/cpldfs/libcpldfs.la' fi AC_SUBST(LIBCPLCORE) AC_SUBST(LIBCPLDRS) AC_SUBST(LIBCPLUI) AC_SUBST(LIBCPLDFS) ]) # CPL_CHECK_LIBS #--------------- # Checks for the CPL libraries and header files. AC_DEFUN([CPL_CHECK_LIBS], [ AC_MSG_CHECKING([for CPL]) cpl_check_cpl_header="cpl.h" cpl_check_cpl_lib="libcplcore.a" cpl_incdirs="" cpl_libdirs="" cpl_includes="" cpl_libraries="" AC_ARG_WITH(cpl, AC_HELP_STRING([--with-cpl], [location where CPL is installed]), [ cpl_with_cpl=$withval ]) AC_ARG_WITH(cpl-includes, AC_HELP_STRING([--with-cpl-includes], [location of the CPL header files]), cpl_with_cpl_includes=$withval) AC_ARG_WITH(cpl-libs, AC_HELP_STRING([--with-cpl-libs], [location of the CPL library]), cpl_with_cpl_libs=$withval) AC_ARG_ENABLE(cpl-test, AC_HELP_STRING([--disable-cpl-test], [disables checks for the CPL library and headers]), cpl_enable_cpl_test=$enableval, cpl_enable_cpl_test=yes) if test "x$cpl_enable_cpl_test" = xyes; then # Check for the CPL includes if test -z "$cpl_with_cpl_includes"; then if test -z "$cpl_with_cpl"; then # Try some known system locations cpl_incdirs="/opt/cpl/include" cpl_incdirs="$cpl_incdirs /usr/local/include" cpl_incdirs="$cpl_incdirs /usr/include" test -n "$CPLDIR" && \ cpl_incdirs="$CPLDIR/include \ $cpl_incdirs" else cpl_incdirs="$cpl_with_cpl/include" fi else cpl_incdirs="$cpl_with_cpl_includes" fi ESO_FIND_FILE($cpl_check_cpl_header, $cpl_incdirs, cpl_includes) # Check for the CPL libraries if test -z "$cpl_with_cpl_libs"; then if test -z "$cpl_with_cpl"; then # Try some known system locations cpl_libdirs="/opt/cpl/lib" cpl_libdirs="$cpl_libdirs /usr/local/lib64" cpl_libdirs="$cpl_libdirs /usr/local/lib" cpl_libdirs="$cpl_libdirs /usr/local/lib32" cpl_libdirs="$cpl_libdirs /usr/lib64" cpl_libdirs="$cpl_libdirs /usr/lib" cpl_libdirs="$cpl_libdirs /usr/lib32" test -n "$CPLDIR" && \ cpl_libdirs="$CPLDIR/lib64 $CPLDIR/lib $CPLDIR/lib32 \ $cpl_libdirs" else cpl_libdirs="$cpl_with_cpl/lib64" cpl_libdirs="$cpl_libdirs $cpl_with_cpl/lib" cpl_libdirs="$cpl_libdirs $cpl_with_cpl/lib32" fi else cpl_libdirs="$cpl_with_cpl_libs" fi ESO_FIND_FILE($cpl_check_cpl_lib, $cpl_libdirs, cpl_libraries) if test x"$cpl_includes" = xno || test x"$cpl_libraries" = xno; then cpl_notfound="" if test x"$cpl_includes" = xno; then if test x"$cpl_libraries" = xno; then cpl_notfound="(headers and libraries)" else cpl_notfound="(headers)" fi else cpl_notfound="(libraries)" fi AC_MSG_ERROR([CPL $cpl_notfound was not found on your system. Please check!]) else AC_MSG_RESULT([libraries $cpl_libraries, headers $cpl_includes]) fi # The libcext headers are required. By default it part of the # CPL installation and it is assumed that the cext headers are # present in the same location as the CPL headers CPL_CHECK_CEXT($cpl_includes, $cpl_libraries) # Set up the symbols CPL_INCLUDES="-I$cpl_includes $CX_INCLUDES $CFITSIO_INCLUDES" CPL_LDFLAGS="-L$cpl_libraries $CX_LDFLAGS $CFITSIO_LDFLAGS" CPL_CREATE_SYMBOLS AC_MSG_CHECKING([whether CPL can be used]) AC_LANG_PUSH(C) cpl_cflags_save="$CFLAGS" cpl_ldflags_save="$LDFLAGS" cpl_libs_save="$LIBS" CFLAGS="$CPL_INCLUDES $CFLAGS" LDFLAGS="$CPL_LDFLAGS $LDFLAGS" LIBS="$LIBCPLCORE $LIBCEXT $LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[ #include ]], [ cpl_init(CPL_INIT_DEFAULT); ])], [cpl_is_usable="yes"], [cpl_is_usable="no"]) AC_MSG_RESULT([$cpl_is_usable]) AC_LANG_POP(C) CFLAGS="$cpl_cflags_save" LDFLAGS="$cpl_ldflags_save" LIBS="$cpl_libs_save" if test x"$cpl_is_usable" = xno; then AC_MSG_ERROR([Linking with CPL failed! Please check architecture!]) fi else AC_MSG_RESULT([disabled]) AC_MSG_WARN([CPL checks have been disabled! This package may not build!]) CPL_INCLUDES="" CPL_LDFLAGS="" LIBCPLCORE="" LIBCPLDRS="" LIBCPLUI="" LIBCPLDFS="" fi AC_SUBST(CPL_INCLUDES) AC_SUBST(CPL_LDFLAGS) AC_SUBST(LIBCPLCORE) AC_SUBST(LIBCPLDRS) AC_SUBST(LIBCPLUI) AC_SUBST(LIBCPLDFS) ]) cpl-6.6.1/m4/lt~obsolete.m40000644000460300003120000001377412553662320012370 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) cpl-6.6.1/ChangeLog0000644000460300003120000031044212553652673011010 000000000000002015-07-22 rpalsa * cplcore/cpl_propertylist.c: cpl_propertylist_dump(): Fix format conversion specifier. 2015-07-20 rpalsa * m4/cpl.m4: CPL_CHECK_WCS(): Also add extra wcslib directory component to path taken from WCSDIR. * cpldrs/cpl_fft.c: cpl_fft_image_(): Add suggested parentheses. * m4/cpl.m4: CPL_CHECK_CFITSIO(), CPL_CHECK_WCS(), CPL_CHECK_FFTW(): Remove locally created file conftest.out after tests are finished. * m4/cpl.m4: CPL_CHECK_WCS(): Add extra wcslib directory component to path given by with-wcs option. * m4/cpl.m4: CPL_CHECK_WCS(): Remove extra wcslib directory component. * ChangeLog: Updated for release 6.6.1 * .: Update libcext externals revision 2015-06-26 rpalsa * .: Update libcext externals revision * cplcore/cpl_table.c: cpl_table_dump(): Use correct accessor when getting values from a CPL_TYPE_LONG_LONG columns. cpl_table_extract_selected(): Add missing cases for CPL_TYPE_LONG_LONG, and complex columns. _cpl_table_write_column(): Fix incorrect bitwise and replaced with logical and (PIPE-5824). _cpl_table_write_column_array(): Fix and document possible null pointer dereference (PIPE-5823). 2015-05-22 rpalsa * cplcore/cpl_column.c: cpl_column_set_(): Fix wrong error code return in case the argument checks fail. 2015-05-07 rpalsa * cplcore/cpl_table.c: _cpl_table_save_legacy(): Fix possible buffer overrun. cpl_table_overload_window(): Add (redundant) error check after calling cpl_io_fits_open_diskfile(). * cplcore/cpl_mpfit.c: _cpl_mp_fdjac2(): Fix wrong type in call of sizeof. 2015-04-27 rpalsa * libltdl, m4: Updated svn:ignore 2015-03-06 rpalsa * configure.ac: Update package and library for 6.6.1 * cplcore/cpl_table.c: cpl_table_save(): Add CPL_IO_APPEND mode related documentation. * Doxyfile.in: Updated. Set COMPACT_LATEX to NO in order to use documentclass book instead of article. 2015-03-04 rpalsa * configure.ac: Package version updated. * .: Update libcext externals revision. 2015-03-03 rpalsa * cpldfs/cpl_multiframe.c, cplui/cpl_frameset.c: Reference documentation updated. * cplcore/tests/cpl_table-test.c: cpl_table-test.c: Revert unintended commit. * ., cplcore/tests/cpl_table-test.c: Update libcext externals revision. * BUGS, ChangeLog, ChangeLog-0, ChangeLog-1, Makefile.am, README: Updated for release of CPL 6.6. * cplcore/cpl_propertylist.c: _cpl_propertylist_fill_from_fits(): Fix string value trimming in the case the value is an empty string. * cpldfs/cpl_multiframe.c: _cpl_fits_format_card(), _cpl_fits_parse_keyname(): Adapted to changed names of cx_string member functions. 2015-03-03 llundin * NEWS: News: PIPE-5254 * NEWS: News: PIPE-5498 2015-03-02 llundin * NEWS: News: PIPE-5650 2015-02-20 rpalsa * cplcore/tests/cpl_table-test.c: Fix comment: Remove part of CPL_IO_APPEND test disclaimer. * cplcore/cpl_table.c: _cpl_table_save_append(), _cpl_table_write_column_array(): Fixes applied to null value handling after testing. 2015-02-18 rpalsa * NEWS: Initial update for release of CPL 6.6 2015-02-17 rpalsa * cplcore/tests/cpl_table-test.c: Add simple CPL_IO_APPEND test case, and comment out the previous one expecting an unsupported mode error. * cplcore/cpl_table.c: _cpl_table_save_append(), _cpl_table_write_column_array(): Fixing string array column issues found during initial debugging. 2015-02-16 rpalsa * m4/cpl.m4: Restore previous file name extension used for searching for libraries. 2015-02-13 rpalsa * configure.ac: Package version updated. * m4/cpl.m4: Change file name extension for searched libraries from .a to .so * cplcore/cpl_table.c, cplcore/tests/cpl_table-test.c: Implemented CPL_IO_APPEND I/O mode for tables. 2015-02-07 rpalsa * cplcore/cpl_propertylist.c: cpl_propertylist_copy_property_regexp(): Update documentation. 2015-02-06 rpalsa * cpldfs/cpl_multiframe.c: Removed string utilities local implementation. Moved to libcext. * .: Update libcext external revision. * configure.ac: Fixed library version. 2015-01-28 rpalsa * cplcore/cpl_image_iqe.c, cplcore/cpl_mpfit.c, cplcore/cpl_mpfit.h: Consistently add cpl prefix to functions, for namespace protection (PIPE-5551). 2015-01-02 cgarcia * ., configure.ac: New branch for CPL 6.6 2014-12-18 llundin * cpl_imagelist_median_collapse(): Apply patch from JTaylor (PIPE-5384) 2014-12-16 llundin * Make sure to include complex.h in time * Make sure to include complex.h in time * cpl_image_get_data_*(): Improve error message on type mismatch * cpl_image_hypot(): Update bad pixel map (PIPE-5650) * cpl_mask_{and,or,xor}_(): Shortcut when called with identical buffers (PIPE-5649) * cpl_fft_aligned(): omp critical (in still inactive code) * cpl_mask_{and,or,xor}(): Optimize a call with same mask twice 2014-12-11 llundin * Undo previous commit (not faster): For each transform create two plans, FFTW_DESTROY_INPUT and FFTW_PRESERVE_INPUT * For each transform create two plans, FFTW_DESTROY_INPUT and FFTW_PRESERVE_INPUT * Align c2r code with r2c. Improve comments * cpl_fft_aligned(): Reminder to use fftw_alignment_of() once we have 3.3.4 * ce doxygen + comments 2014-12-06 rpalsa * Integrate changes from CPL 6.5 release branch (revision 166757:167280) 2014-12-02 aszostak * Changing behaviour of cpl_test_assert to use exit() rather than just return. (PIPE-4664) This also fixes a large number of cppcheck errors and double logging from pipeline unit tests, when using cpl_test_assert in sub-routines. 2014-11-26 aszostak * Adding code to prevent core dumps in the cpl_test_init-test code where they are expected, due to calling abort(). Also fixing exit code when the test must be skipped. 2014-10-31 llundin * cpl_tools_get_median_*(): Avoid signed integer overflow by generally improving the precision (see cpl_tools_get_mean()) (PIPE-5472) 2014-10-30 llundin * 6.4: cpl_gaussian_eval_2d() added 2014-10-24 aszostak * Adding regression test to find uninitialised memory errors in combination with valgrind for cpl_image_divide_create(). (PIPE-5498) 2014-10-22 llundin * cpl_image_divide_create(): Assign zero when dividing with zero (PIPE-5498) 2014-10-02 llundin * rm redundant inclusion of complex.h * Fix inclusion of complex.h (see PIPE-5452) (bis) * Fix inclusion of complex.h (see PIPE-5452) 2014-10-01 rpalsa * Integrate changes from CPL-6_5-BRANCH (revision 165945). * Integrate changes from CPL-6_5-BRANCH (revisions 163168:165731). 2014-09-05 llundin * cpl_imagelist_collapse_median_create(): Apply patch from JTaylor to improve L1 cache access pattern (PIPE-5384) * cpl_image_new_from_accepted(): Apply performance-patch from JTaylor (PIPE-5382) 2014-07-22 llundin * cpl_stats_new_from_image_window(): Ensure expression reuse in variancesum (PIPE-5337) * cpl_tools_get_variancesum*(): Ensure expression reuse (PIPE-5337) 2014-07-11 llundin * cpl_dfs_save_propertylist(), cpl_dfs_save_imagelist(): Fix typo 2014-07-10 llundin * cpl_matrix_solve_normal(): fix unit test failure on mips64el (free memory) (PIPE-5283) 2014-07-03 llundin * cpl_matrix_solve_normal(): Improve comment on previous commit 2014-07-02 llundin * cpl_matrix_solve_normal(): (Probably) fix unit test failure on mips64el (PIPE-5283) 2014-06-27 rpalsa * Integrate fixes from CPL 6.4 branch (revisions 159799:161872) 2014-06-26 aszostak * Fixing compiler warnings (PIPE-4739). 2014-06-25 aszostak * Adding unit test to check median calculation (PIPE-4739). 2014-06-06 llundin * getTimeISO8601(): Preserve errno from before call to strftime() (PIPE-5254) * CPL_MAX(), CPL_MIN(): Add extra, redundant parentheses to avoid static-checker warnings from e.g. cppcheck (PIPE-5252) 2014-06-03 llundin * cpl_filter_median_even(): Binary and replaces modulo * cpl_filter_median_even(): Use memcpy() * cpl_image_filter(), cpl_image_filter_mask(): In-place filtering is not supported (PIPE-5198) * cpl_image_filter_mask(): Use mean of two central values for even-sized median - draft (PIPE-5198) 2014-05-22 rpalsa * Integrate change 161532 from CPL 6.4 release branch. 2014-04-30 cgarcia * Remove *dump.txt files when cleaning * Remove *.log files when cleaning 2014-04-22 rpalsa * Integrate fixes from CPL 6.4 branch (revision 159839) 2014-04-17 rpalsa * Integrate fixes from CPL 6.4 branch (revision 155879) * Block revisions 159771 from being merged into the trunk * Integrate fixes from CPL 6.4 branch (revisions 158101:r159770) * Block revisions 157515 from being merged into the trunk * Integrate fixes from CPL 6.4 branch (revisions 157026:157503) * Block revisions 157037 from being merged into the trunk * Integrate fixes from CPL 6.4 branch (revisions 156915:156944) * Integrate fixes from CPL 6.4 branch (revisions 156164:156906) * Integrate fixes from CPL 6.4 branch (revision 156163) * Block revisions 156164 from being merged into the trunk * Integrate fixes from CPL 6.4 branch (revisions 156128:156146) * Block revisions 155775 from being merged into the trunk * Block revisions 155269 from being merged into the trunk * Block revisions 155254 from being merged into the trunk * Block revisions 155246 from being merged into the trunk * Block revisions 154781 and 154782 from being merged into the trunk * Block revision 154779 from being merged into the trunk 2014-04-02 llundin * cpl_wcs_test_5115(): Added for PIPE-5115 2014-04-01 llundin * cpl_mask_filter(): Support CPL_BORDER_NOP also with CPL_FILTER_OPENING/CLOSING. Fix doxygen typos * Break long lines 2014-03-17 llundin * cpl_fft_aligned(): Update doxygen 2014-02-17 llundin * cpl_table_get_column_unit(): Fix error propagation on NULL return (PIPE-4996) 2014-02-13 llundin * cpl_dfs_setup_product_header(): Do not copy CHECKSUM and DATASUM (PIPE-4980) 2014-01-24 cgarcia * svn ci -m "Block revision r156036 from being merged back into the source" 2014-01-24 rpalsa * Integrate fixes from CPL 6.4 release branch. 2014-01-24 llundin * cpl_photom_fill_blackbody(): rm cpl_func, cpl_ensure_code() in loop. Header clean-up 2014-01-24 cgarcia * changed complex to _Complex in headers 2014-01-24 llundin * Use C99 functions log1p(), expm1() (patch from JTaylor using a patched version of coccinelle) 2014-01-20 rpalsa * Integrate fixes from CPL 6.4 release branch. * Block revision 155874 from being merged into the trunk. * Block revision 155871 from being merged into the trunk. * Integrate fixes from CPL 6.4 release branch. 2014-01-13 llundin * cpl_polynomial_add(), cpl_polynomial_subtract(), cpl_polynomial_multiply_scalar(): cpl_polynomial_delete_coeff() replaces cpl_polynomial_set_coeff() 2013-12-17 rpalsa * Integrate fixes from CPL 6.4 release branch. 2013-12-16 llundin * CPL_MIN()/CPL_MAX(): Drop __typeof__ (PIPE-4787) (bis) * CPL_MIN()/CPL_MAX(): Drop __typeof__ (PIPE-4787) 2013-12-16 rpalsa * Integrate changes from CPL 6.4 release branch. 2013-12-16 llundin * cpl_image_fill_window(): Added * cpl_image_fill_window(): Added (PIPE-4842) * cpl_polynomial_fit(): Improve doxygen 2013-12-13 llundin * CPL_MIN()/CPL_MAX(): Drop __typeof__ (PIPE-4787) 2013-12-12 llundin * cpl_gaussian_eval_2d(): New name, improved error handling and doxygen * cpl_gaussian_fit_image_eval(): Added * cpl_apertures_extract_mask(): Fix doxygen typo 2013-12-09 llundin * doxygen typo 2013-12-05 cgarcia * Added CPL_BEGIN_DECLS and CPL_END_DECLS 2013-12-05 llundin * CPL 6.4: note news already in 6.3 2013-12-03 llundin * cpl_errorstate_dump(), cpl_errorstate_dump_one(): Improve doxygen of NULL-dumper 2013-12-02 llundin * cpl_errorstate_dump(): With a NULL-iterator do not report on CPL_ERROR_LOST_HISTORY (PIPE-4838) * cpl_fit_lvmq_(): Avoid infite loop on recovery from CPL error (PIPE-4837) * cpl_fit_lvmq_(): Recover correctly from CPL error (PIPE-4837) * Start: What's new in CPL 6.4 * Copy edit * cpl_image_fft(): Improve doxygen (power-of-two sized image) * cpl_image_bpm_reject_value_test(): Added 2013-11-27 llundin * cpl_flux_get_noise_ring(): Handle error from cpl_image_get_stdev_window(), doxygen, const correctness. cpl_flux_get_noise_window(): Doxygen, const correctness 2013-11-22 llundin * cpl_polynomial_fit_1d(): rm old, invalid assert() (PIPE-4829) 2013-11-21 rpalsa * cpl_table_get_column_name(): Marked as deprecated (PIPE-4474) * cpl_column_delete_but_arrays(), cpl_column_delete_but_strings(): Fix potential dereferencing of a NULL pointer (PIPE-4663). * cpl_parameterlist_find_context_const(): Apply patch to fix potential segmentation fault (PIPE-4661) Test case added. 2013-11-21 llundin * cpl_matrix_extract_{row,column}(): Apply patch from Artur to avoid NULL-dereference (PIPE-4793) * cpl_matrix_extract_{row,column}(): Add unit tests on error (PIPE-4793) * Fix comment * Revert use of memmove() back to memcpy() as in the original code. Use restrict + CPL_ATTR_NONNULL * MD5Final(): Fix strict-aliasing violation (PIPE-3854) * cpl_image_get_interpolated(): intptr_t replaces cpl_size for efficiency on32-bit * CPL_MIN(), CPL_MAX(): __typeof__ replaces typeof (which also works with --std=c99) (PIPE-4787) 2013-11-21 rpalsa * Fix potential buffer overflow in cpl_msg (PIPE-4658) 2013-11-21 llundin * CPL_MIN(), CPL_MAX(): Use __GNUC__ instead of AC_C_TYPEOF since the conditional compilation is also needed by the CPL-based application (JIRA PIPE-4787) 2013-11-20 rpalsa * Nuke unwanted directory from revision control, finally. * Remove property svn:ignore from untracked directory 2013-11-20 llundin * + CPL_INTERNAL * CPL_MIN(), CPL_MAX(): Added using typeof (JIRA PIPE-4787) 2013-11-18 llundin * cpl_polynomial_fit_2d(): rm unneeded cast * Suppress -Wcast-qual from cpl_*_wrap(). Uncomment assert() * Suppress -Wcast-qual from cpl_*_wrap() * Use const on cast for _mm_load*_p{s,d}() * Suppress -Wcast-qual * CPL_DIAG_PRAGMA_PUSH_IGN(), CPL_DIAG_PRAGMA_PUSH_ERR(), CPL_DIAG_PRAGMA_POP, CPL_STRINGIFY(): Export * CPL_FITSIO_READ_PIX_E, CPL_FITSIO_CREATE_IMG_E, CPL_FITSIO_WRITE_PIX_E: Internal, for error msg * cpl_fits_read_pixll(), cpl_fits_read_pix(), cpl_fits_create_imgll(), cpl_fits_create_img(), cpl_fits_write_pixll(), cpl_fits_write_pix(): Added to limit CFITSIO const-correctness warning to one module * cpl_mask_load_(): Move const-correctness warning to cpl_cfitsio module * Internal cpl_cfitsio module added 2013-11-12 llundin * do_bench: Added for cpl_image_bitwise_test() * Ensure SSE2 and register size match * cpl_mask_{and,or,xor}_scalar): Use all 64-bits of mask, support odd number of words. cpl_image_{and,or,xor}_scalar(): Pass 64-bit scalar. cpl_image_bitwise_test(): Test odd number of pixels * cpl_mask_xor_scalar(): Pass 64-bit scalar also on 32-bit systems 2013-11-06 llundin * cpl_image_bitwise_test(): Test output * cpl_image_{and,or,xor}{,_scalar}(), cpl_image_not(): Add const modifier to internal cast * cpl_image_not(): Added * cpl_image_bitwise_test(): Test error handling (and,or,xor) 2013-11-05 llundin * cpl_mask_{andor,xor}_scalar(): Fix cast to word-size (bis) * cpl_mask_{andor,xor}_scalar(): Fix cast to word-size * cpl_image_{and,or,xor}{,_scalar}(), cpl_bitmask: Added (PIPE-4576) * cpl_bitmask: typedef uint64_t. cpl_mask_{and,or,xor}_scalar(): Replaces cpl_mask_{and,or,xor}_int(), uses cpl_bitmask * cpl_mask_{and,or,xor}_int(): Added, replaces cpl_mask_not_() * cpl_mask_not_(): Added. cpl_mask_not(): Call cpl_mask_not_() * cpl_mask_{and,or,xor}{,_}(): Added * cpl_mask_binary.h: Define internal bit-wise functions * cpl_mask_and(): Working prototype using SSE2 (coded as in cpl_image_basic) 2013-11-04 llundin * Added libcext as an external 2013-10-22 rpalsa * Updated to the latest version. 2013-10-22 llundin * cpl_image_add(0 etc: Set CPL_ERROR_INCOMPATIBLE_INPUT on incompatible input. cpl_image_add_create() etc: Expand on error msgs * cpl_image_add() etc: Expand on error message 2013-10-21 llundin * cpl_dfs_setup_product_header(): Handle missing filename in frame (PIPE-4778) 2013-10-16 llundin * cpl_fits_find_extension(): Avoid reading uninitialized array (possible e.g. in case of CFITSIO bug?), reported by coverity 2013-10-14 llundin * cpl_image_set_bpm(): Added. cpl_image_unset_bpm(): Wraps around cpl_image_set_bpm() * cpl_mask_count_window(): Unroll twice to halve multiplication and shifting * cpl_mask_count_bench(): Added. cpl_mask_count_window(): Added benchmarking comment * cpl_error_ensure(): CPL errors are unlikely * cpl_mask_count_window(): Use multiplication to count one word at a time (using idea from JTaylor) 2013-10-09 llundin * cpl_imagelist_collapse_median_create(): Fix incorrect handling of bad pixels (PIPE-4753) 2013-10-08 llundin * cpl_fft_image_test_correlate(): auto-correlate 2013-10-07 llundin * cpl_fft_image_test_correlate(): Use cpl_fft_imagelist() + CPL_FFT_NOSCALE. Copy-edit doxygen * cpl_fft_image_test_correlate(): Added 2013-09-05 llundin * cpl_matrix_product_normal(): Added w. export pending review (PIPE-4697). cpl_matrix_product(): ce * cpl_matrix_product(): Reduce block-size from 64 to 48 so blocks fit on smaller caches (Raise base on unit test) 2013-09-03 llundin * cpl_matrix_product(): Reduce block-size from 64 to 48 so blocks fit on smaller caches 2013-09-02 llundin * cpl_matrix_product_create(): Apply blocking-patch from JTaylor 2013-08-28 llundin * Additional tests with ARCFILE + EQUINOX 2013-08-28 rpalsa * Frame set iterators put back into place. * Use AM_CPPFLAGS for all flags set within the Makefile, instead of CPPFLAGS. CPPFLAGS has been removed. 2013-08-26 rpalsa * cpl_table_save(): Add long long to int conversion for nval array when dealing with integer column data. 2013-07-25 llundin * cpl_image_hypot_test(): Added (PIPE-4478) 2013-07-24 llundin * cpl_image_hypot_*(): Explicit cast of hypot/f * cpl_image_hypot(): Added (PIPE-4478) 2013-07-22 llundin * MD5Final(): Fix the widely noticed sizeof bug in the "In case it's sensitive" memset(). (PIPE-4656) 2013-07-11 llundin * cpl_image_power(): Fix typo (PIPE-4578). cpl_image_power_test(): Strengthen test a bit * cpl_image_power_test(): Test w. negative powers. cpl_image_power(): Handle powers -1/2 and -1/3 with sqrt() and cbrt() (PIPE-4578) * cpl_test_imagelist_abs_macro(): Correct type of variable "failures" 2013-07-04 llundin * cpl_test_get_walltime(): Prefer clock_gettime() w. nanosecond resolution over gettimeofday() 2013-06-26 llundin * cpl_image_save(): Add doxygen regarding NAXIS=3 2013-06-20 llundin * cpl_image_reject_value(): Add missing @ingroup 2013-06-19 llundin * cpl_vector_sort(): revert rev. 1.167 due to performance 2013-05-31 llundin * cpl_fits_set_mode(): fix doxygen typo 2013-05-28 llundin * cpl_tools_get_median_*(): Improve doxygen 2013-05-27 llundin * cpl_tools_get_0th_*(): Added as static. cpl_tools_get_median_*(): Use cpl_tools_get_0th_*() (PIPE-4541). cpl_tools_quickselection_*(), cpl_tools_get_kth_(): Copy edit doxygen 2013-05-21 rpalsa * _cpl_propertylist_to_fitsfile(): Merge in changes from CPL 6 branch: Remove cast from keyword names as recent cfitsio uses the proper prototype. This is not yet true for the comment argument when the minimum required cfitsio version is used. 2013-05-13 rpalsa * Call macro AC_CONFIG_MACRO_DIR() to properly configure the m4 macros directory. * EXTRA_DIST: Added cpl.css 2013-05-10 llundin * Reformat long lines 2013-05-08 cgarcia * Avoid cpl_size overflow (PIPE-4404) 2013-04-29 llundin * Undo previois edit (fails on (some) 32-bit systems) 2013-04-26 llundin * Avoid cpl_func. Include cpl_array_impl.h first to verify self-consistency * cpl_array_set_column(): Fix const-correctness issue and update doxygen * Fix warnings caused by unneeded cast for cpl_strdup + cpl_array_duplicate. Avoid cpl_func. Include cpl_column.h first to verify self-consistency * cpl_wcs_fitsstr2plist(): CFITSIO cast no longer needed * cpl_init(): rm unneeded cast * cpl_dfs_find_md5sum(): Update doxygen. cpl_dfs_update_product_header_(): CFITSIO cast no longer needed * cpl_mask_dump_window(): Fix overflow optimization warning. cpl_mask_load_(): Comment on CFITSIO warning, explicit cast * cpl_error_test_ensure(): rm unreachable code * SIZEOF_SIZE_T replaces sizeof(cpl_size) * cpl_imagelist_save_compression_bench(): Doxygen typos * Use CPL_SIZE_FORMAT (bis) * cpl_test_init_macro(): strrchr() replaces deprecated rindex(). cpl_test_array_abs_macro(), cpl_test_image_abs_macro(), cpl_test_image_rel_macro(), cpl_test_imagelist_abs_macro(): On failure do not use dump when messaging is off 2013-04-23 llundin * Unit tests of cpl_table_fill_invalid_int() for PIPE-4505 * Verify success of calls to cpl_table_{set,fill}*() * Verify success of cpl_table_save() calls 2013-04-16 llundin * cpl_imagelist_save_compression_bench(): openmp reduction on tsum * cpl_image_divide(): Avoid unnecessary mask creation (PIPE-4481, DFS07441) * cpl_image_divide(): Keep any bpm also in case no zero-division occurs (PIPE-4481) 2013-04-12 llundin * Comment regarding warning due to missing CFITSIO const modifiers * cpl_image_save_(): Fix const-warning 2013-04-11 llundin * cpl_table_find_column_, cpl_table_find_column_type(): rm unneeded error code params 2013-04-10 llundin * cpl_table_find_column_(), cpl_table_find_column_type(): Add static and use to avoid code duplication * cpl_table_find_column(), cpl_table_append_column(), strmatch(): The functions assume non-NULL input, so declare them with CPL_ATTR_NONNULL 2013-04-09 llundin * Update comments regarding CFITSIO-cast that discards const modifiers * cpl_table_{get,set}*(): Follow suggestion from Ralf to simplify error message on NULL pointer input (PIPE-4473) 2013-04-08 llundin * cpl_fit_imagelist_polynomial_window_test(): Test both a high-order overdetermined system and a maximum-order non-overdetermined system. Allow failure of the latter on 32-bit systems * cpl_table_get_column_name(): Fix compiler warning, Use @deprecated instead of @note (see PIPE-4474) * cpl_table_{get,set}*(): Add details to CPL error message (PIPE-4473) (bis) * cpl_table_{get,set}*(): Add details to CPL error message (PIPE-4473) * Fix memory error in previous test 2013-04-04 llundin * Add tests * cpl_test_image_rel_macro(): Improve message * cpl_test_image_rel(): Added w. unit test (PIPE-4467) * Update FSF address 2013-04-03 llundin * cpl_image_get(), cpl_image_get_complex(): Inline BPM calls (PIPE-4469), fix doxygen, support all pixel types in complex function 2013-03-25 cgarcia * Updated address of FSF * Changed address of FSF * Updated FSF address * Updated the FSF address 2013-03-20 llundin * Fix unused-var warning on absent FFTW 2013-03-14 llundin * cpl_tools_get_mean_*(), cpl_tools_get_variancesum_*(), cpl_tools_quickselection_*(), cpl_tools_sort_*(): Use size_t for indexing (PIPE-4403) 2013-03-13 llundin * CPL_ATTR_REALLOC(): rm __attribute__ malloc (PIPE-4422) 2013-03-01 llundin * cpl_error_set_message(): Call cpl_error_set_message_one_macro() when variadic macros are unavailable (PIPE-3851) (DFS11646) * cpl_image_load_(): assert nx == naxes[0] for non-windowed read * cpl_image_load_(): Use fits_read_img() when possible (PIPE-4406) (bis: support also pnum > 0) * cpl_image_load_(): Use fits_read_img() when possible (PIPE-4406) 2013-02-28 llundin * cpl_tools_quickselection(): Use size_t instead of cpl_size (thanks to JTaylor for patch) (PIPE-4403) (bis) * cpl_tools_quickselection(): Use size_t instead of cpl_size (thanks to JTaylor for patch) (PIPE-4403) 2013-02-26 cgarcia * Use sqrt(DBL_EPSILON) as the criteria to check whether two chi_sq are the same * Make more robust comparison of the chi square to avoid precission issues. Fixes PIPE-3580. 2013-02-26 llundin * cpl_image_complex_mult(), cpl_image_complex_mult_d(): Added comments from JTaylor 2013-02-25 rpalsa * Package and library version updated. * Package version updated. * Put back check for threadprivate pragma, which was lost when updating to the new version from autoconf. * Restore previous version of install-doxygen-generic. The dependency is already in place if maintainer-mode is enabled, which is required for building the documentation. 2013-02-22 llundin * CPL_FILTER_LINEAR et al: improve doxygen * cpl_image_save_(): Explicitly disallow compression that is not supported by CFITSIO 2013-02-22 rpalsa * Dependency added to target install-doxygen-generic 2013-02-21 cgarcia * Removed an old documentation sentence * Fixed doxygen documentation. 2013-02-21 llundin * cpl_image_save_compression_test(): Test both flat and random image * cpl_image_save_compression_test(): Include Julians explanation for the CFTISIO-compression failures 2013-02-21 rpalsa * More 6.3 features added. * Updated for 6.3 2013-02-21 llundin * cpl_image_save_compression_test(): Disable tests after failure and NULL-image 2013-02-20 llundin * cpl_image_save_(): CPL_INTERNAL 2013-02-20 rpalsa * Use doxygen targets for creating API docs. * Retire html.am and replace it with doxygen.am to avoid name clash warnings. API docs are now created by 'make doxygen'. * Updated. * Replace call to CHECK_PURIFY by ESO_PROG_PURIFY which follows the naming scheme for autotools macros. * Synchronized with libcext. Modernized version, not screwing up the configure output. * Replace conditional PURIFY with USE_PURIFY. Reserve the name PURIFY for use as environment variable. * Synchronize html target rules with libcext. * CPL_OPENMP(): Take out symbol _AC_CC, which is not supported by our prehistoric test machine installations. 2013-02-20 llundin * cpl_test_memory_is_empty(): Fix invalid definition and deprecate (PIPE-4382 opened by ASzostak) 2013-02-19 rpalsa * Package version updated. * Replaced with latest version from autoconf 1.13, to avoid autoconf warnings about missing AC_LANG_SOURCE calls. * CPL_CHECK_CFITSIO(): Simplified, hopefully. * Remove unused symbols "all_includes" and "all_ldflags". In calls to AC_COMPILE_IFELSE, AC_LINK_IFELSE and AC_RUN_IFELSE: Encapsulate source code in AC_LANG_PROGRAM or AC_LANG_SOURCE, and make sure it is properly quoted. * Remove an empty line. * Replace deprecated symbol INCLUDES with AM_CPPFLAGS. Do not use CPPFLAGS or LDFLAGS since they are reserved for the user, but use AM_CPPFLAGS and AM_LDFLAGS instead. 2013-02-15 rpalsa * Package version updated. * Define macros CPL_INTERNAL and CPL_EXPORT. * Replace CX_GNUC_INTERNAL with CPL_INTERNAL 2013-02-14 llundin * cpl_image_save(): Make sure to create HDU with NAXIS2, disallow CPL_IO_APPEND 2013-02-13 rpalsa * Package version updated. 2013-02-12 llundin * cpl_image_save_(): Added. cpl_image_save(): Support CPL_IO_APPEND (via cpl_image_save_()) 2013-02-12 rpalsa * cpl_propertylist_save(): Use simplified check of IO flags. 2013-02-12 llundin * CPL_IO_MAX: Redefine to be useful. cpl_{image,imagelist,mask}_save(): Use CPL_IO_MAX. cpl_vector_save(): Simplify mode check 2013-02-11 rpalsa * cpl_propertylist_save(): Apply patch for redefinition of CPL_IO_MAX. 2013-02-11 llundin * cpl_test_eq_error() w. CPL_ERROR_NONE replaces cpl_test_zero(). Use cpl_test_fits() + cpl_fits_count_extensions() * cpl_mask_save(): Update doxygen on compression * cpl_imagelist_save(): Disallow CPL_IO_APPEND w. compression (using fits_is_compressed_image()) * cpl_mask_save(): DFS11066 add possibility to compress fits data (Working Draft) (PIPE-3616) * cpl_{vector,mask}_save(): Disallow compression * cpl_imagelist_save(): Clean-up error handling for CPL_IO_APPEND mode 2013-02-11 rpalsa * cpl_frameset_get_position(), cpl_frameset_get_position_const(): Fixed index of by one when doing the validity checkin the given index. * Added test for cpl_parameter_duplicate(). * cpl_parameter_duplicate(): Function added. 2013-02-11 llundin * cpl_imagelist_save_compression_test(): CPL_IO_APPEND tests * cpl_imagelist_save(): Move CPL_IO_COMPRESSION_LOSSY code to proper place * cpl_imagelist_save_compression_test(): Added. Header + ifdef clean-up * rm unneeded remove(). header clean-up. remove() after testing. static 2013-02-08 llundin * cpl_imagelist_save(): DFS11066 add possibility to compress fits data (Working Draft) (PIPE-3616) * cpl_image_save(): Enable + test lossy compression w. ifdef CPL_IO_COMPRESSION_LOSSY * cpl_image_save(): DFS11066 add possibility to compress fits data (Working Draft) (PIPE-3616) 2013-02-08 rpalsa * cpl_msg_stop(): Close message streams only if they differ from the system's standard streams. 2013-02-05 llundin * cpl_vector_sum(): Added w. unit-tests (PIPE-4353) 2013-02-04 llundin * cpl_vector_sum(): Added w. unit-tests (PIPE-4353) 2013-02-01 rpalsa * CPL_PATH_JAVA(): Rename variable cpl_notfound to cpl_java_notfound, to fix problem with incomplete error messages. 2013-01-30 rpalsa * Apply patch to only handle messages from the master thread. Workaround to avoid crashing Gasgano. * Add call to AC_SYS_LARGEFILE * CPL_CHECK_CFITSIO(): Remove large file support related preprocessor flags. Rely on AC_SYS_LARGEFILE instead. 2013-01-29 rpalsa * Ignore file test-driver * Ignore default build directory BUILD. Subdirectories build, debug, etc. are note ignored any longer. 2013-01-28 cgarcia * Added threadid api 2013-01-25 rpalsa * Replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS. * Updated to the latest version. * More tests of 64bit integer columns added. 2013-01-24 cgarcia * Removed comma at end of enum to avoid compiler warning 2013-01-24 rpalsa * Frameset iterators: Temporarily disabled for 6.3a1 release. 2013-01-23 rpalsa * cpl_frameset_get_first(),cpl_frameset_get_first_const(),cpl_frameset_get_next(),cpl_frameset_get_next_const(): Deprecation temporarily reverted. Frameset iterators: Temporarily disabled for 6.3a1 release. * First few tests of 64bit integer columns added. * Add support for 64bit integer columns. * Package version updated. 2013-01-21 llundin * cpl_imagelist_cast(): Added w. unit tests (PIPE-3830) (bis: forgot one const modifier) 2013-01-17 rpalsa * Typo fixed in doxygen documentation. 2013-01-17 llundin * cpl_imagelist_cast(): Added w. unit tests (PIPE-3830) 2013-01-16 llundin * iqefit(): Fix copy-paste error (PIPE-4335) w. unit test 2013-01-15 rpalsa * cpl_frameset_iterator_advance(): Set iterator to the end of the frame set if it would go beyonfd the frame set boundaries. cpl_frameset_iterator_get(), cpl_frameset_iterator_get_const(): Return NULL if the iterator points to the end of the frame set. 2013-01-14 rpalsa * cpl_frameset_iterator_get_position(), cpl_frameset_iterator_get_position_const(): Removed and added again as cpl_frameset_get_position() and cpl_frameset_get_position_const(), taking a frame set instead of an iterator. 2013-01-10 rpalsa * Add function cpl_frameset_join() and cpl_frameset_sort(). The functions cpl_frameset_get_first(), cpl_frameset_get_first_const(), cpl_frameset_get_next(), cpl_frameset_get_next_const() are deprecated and scheduled for removal. Add iterator support for frame sets. * Add type definition for frame comparison functions. * Style sheet converted to a addon version for use with HTML_EXTRA_STYLESHEET. Use style sheet when generating the html documentation. Redefine the @error directive to use the same formatting as the standard doxygen exceptions section. 2013-01-07 llundin * cpl_wcs_test_propertylist(): Added * cpl_wcs_new_from_propertylist(): Improve doxygen * Allow for test of NAXIS == 0 * cpl_wcs_new_from_propertylist(): Relax handling of NAXIS == 0 back to previous 2012-12-21 rpalsa * Put back the required, new versions of the third-party libraries. 2012-12-20 rpalsa * Temporary revert to previous 3rd party libraries until the test environment has been upgraded. 2012-12-19 rpalsa * Package and library version updated. Required third-party library versions updated. 2012-12-18 llundin * cpl_wcs_new_from_propertylist(): Handle NAXIS == 0, avoid repeated calls to cpl_sprintf() 2012-12-17 cgarcia * Checks whether the OpenMP implementation supports #pragma omp threadprivate directive. 2012-12-17 llundin * cpl_image_filter_test(): Raise tol on new cross-tesing, rv previous * cpl_image_filter_test(): Raise tol on new cross-tesing 2012-12-14 llundin * cpl_wcs_new_from_propertylist(): Use string literal for format to avoid strncpy(), Use cpl_sprintf() to avoid snprintf(), reduce var scope * Version 6.3 started * CPL_FILTER_LINEAR et al: improve doxygen 2012-12-14 cgarcia * Add an API to deactivate/activate the thread id display in the messages. By default the terminal messages have the thread id display off. 2012-12-14 llundin * cpl_image_filter_test(): More cross-testing * cpl_image_filter_test(): Prep for comparison of cpl_image_filter_mask() / cpl_image_filter(). ce 2012-12-13 cgarcia * Fixed documentation of cpl_imagelist_set: a cpl_image can be deallocated by the client if cpl_imagelist_unset is called first. Fixes DFS12445. 2012-12-13 rpalsa * cpl_frameset_get_frame_const(): Add CPL_ERROR_ILLEGAL_INPUT to the table of possible error states. * cpl_parameter_new_enum(), cpl_parameter_new_range(), cpl_parameter_new_value(): add va_end() calls to error branches. * Add test to check parameter lookup in case of invalid parameter tags. 2012-12-13 llundin * Improve doxygen of filter modes * cpl_image_filter_mask(): Doxygen ce 2012-12-13 rpalsa * cpl_parameterlist_find_tag_const(): Fix potential NULL pointer exception 2012-12-13 llundin * cpl_image_filter(): Support Scaling filters CPL_FILTER_LINEAR_SCALE, CPL_FILTER_MORPHO_SCALE (DFS12363) * cpl_image_flip_{double,float,int}(): Added static. cpl_image_turn(), cpl_image_flip(): Simplify using cpl_image_flip_*() and improve documentation 2012-12-12 llundin * cpl_vector_fill_alpha_kernel(): Improve doxumentation, avoid implicit cast. cpl_vector_fill_kernel_profile(): Avoid implicit cast, division by zero on length-1 profile. ce * cpl_vector_fill_alpha_kernel(): Multiply with sinc(x) (DFS12443) 2012-12-10 llundin * cpl_io_fits_open_diskfile(): Fix comment typo * cpl_image_reject_value(): Draft implementation 2012-12-07 llundin * cpl_image_reject_value(): Stub (DFS12257) 2012-12-05 llundin * cpl_imagelist_collapse_median_create(): Use temporary vairable imself and cast explicitly 2012-12-04 llundin * cpl_image_filter_mask(): rm (as yet) unused code (found by aszostak using coverity) * cpl_mask_filter(): Disable as yet unused code for CPL_BORDER_CROP (found by aszostak using coverity) * Use EVP_DigestUpdate() etc from OpenSSL when available * CPL_CHECK_FFTW(): Fix copy-paste error in comment 2012-11-28 llundin * cpl_image_filter_mask(), cpl_filter_median_slow_*(): Support CPL_FILTER_MEDIAN + CPL_BORDER_CROP w. bad pixels (DFS12426) (bis) * cpl_image_filter_mask(), cpl_filter_median_slow_*(): Support CPL_FILTER_MEDIAN + CPL_BORDER_CROP w. bad pixels (DFS12426) 2012-11-19 llundin * cpl_vector_fill_polynomial_fit_residual(): Improve doxygen (on request from Peter Weilbacher) 2012-11-16 llundin * Use CPL_SIZE_FORMAT * Use CPL_SIZE_FORMAT 2012-11-15 llundin * cpl_xmemory_init_alloc(), cpl_xmemory_resize(): Use %zu format for size_t * cpl_xmemory_malloc_count(), cpl_xmemory_calloc_count(), cpl_xmemory_realloc_count(), cpl_xmemory_realloc(), cpl_xmemory_status(): Use %zu format for size_t * sizeof(size_t) replaces sizeof(int) * cpl_table_dump_structure(): Fix llvm format %d warnings 2012-11-14 llundin * cpl_ppm_match_points(): Use CPL_PPM_DEBUG for conditional compilation of debug statements, avoid unused assignments * Fix llvm format %d warnings 2012-11-09 rpalsa * Package and library version updated. * Added fixes for cpl_propertylist module. 2012-11-09 llundin * cpl_image_multiply(): SSE2/3 * Update for 6.2 2012-11-08 llundin * CPL_FILTER_LINEAR, CPL_FILTER_MORPHO: Improve the doxygen regarding normalisation (DFS12360) 2012-11-07 llundin * cpl_image_get_fwhm(): Fix bug on smoothing, add unit tests (DFS12346) 2012-11-05 rpalsa * Obsolete macro call AM_C_PROTOTYPES removed. * struc _cpl_recipe_: Doxygen link fixed in documentation 2012-10-31 llundin * cpl_test_init_macro(): Support log file on source file with multiple-character extension and drop any directory from log filename - using slightly modified patch and unit test code from aszostak 2012-10-30 llundin * cpl_test_init_macro(): Roll back to 1.116 due to failure of make distcheck for visirp 2012-10-30 rpalsa * CPL_SET_PATH(): Fixed incomplete expansion of configdir. 2012-10-29 llundin * cpl_flux_get_noise_window(): Document rand() usage (DFS12296) * cpl_test_init_macro(): Handle log file from source without extension in a dir with a dot * cpl_msg_set_log_level(): cpl_error_set_message_() replaces cpl_error_set_() on failed fopen() * cpl_test_init_macro(): Support log file on source file with multiple-character extension 2012-10-26 rpalsa * Remove some more macros that doxygen cannot handle by defining them as empty. 2012-10-12 rpalsa * Comments form the team incorporated 2012-10-10 llundin * cpl_io_fits_reuse_fptr(): Extend critical section, since it is cheap and just to be sure 2012-10-09 rpalsa * Mostly rewritten. 2012-10-08 llundin * cpl_image_multiply(): Use sse[23] also on double complex w. unit tests 2012-10-01 llundin * CPL_MATH_STD_MAD: Added w. doxygen 2012-09-13 llundin * cpl_image_multiply(): Use new, static cpl_image_multiply_fcomplex_sse_() (DFS11748) 2012-09-07 llundin * main(): Use ifdef for constant initialization * Initialize and comment spurious counter * cpl_test_abs() replaces cpl_test_eq() for floating point tests * cpl_vector_load(): Comment about unreachable code * cpl_tools_get_cputime(): rm (causes clang warning). cpl_msg_progress(): cpl_test_get_cputime() replaces cpl_tools_get_cputime() * cpl_matrix_dump(): Fix format width error (DFS12112) 2012-09-05 llundin * rm unreachable break statement (as reported by clang after successful compilation) * perl -pli -e 's/(\*t\wp) ([\+\-\*\/])= (\*fc[df]p)\b/$1 = $1 $2 $3/ || s/\*(t\wp)\+\+ ([\+\-\*\/])= \*(fc[df]p)\+\+/$1\[to_length\] = $1\[to_length\] $2 $3\[to_length\]/ and s#\s*$# /* Support clang */#' cplcore/cpl_column.c (DFS12106) * rm unreachable break statement * *cpl_column_unwrap(): rm unused call to cpl_column_get_type(), reduce variable declaration scope 2012-08-29 llundin * CPL_WCS_REGEXP: Added (DFS12095) 2012-08-27 llundin * Add cpl_vector_get_median unit test for 4 elements case: Rewrite using cpl_test_rel() * Fix doxygen intro (DFS12092) * cpl_test_get_failed(): Improve doxygen code example 2012-08-23 cgarcia * Fixed documentation * Fixed DFS12809 in the compuation of median for even number of elements. * Add cpl_vector_get_median unit test for 4 elements case. 2012-08-23 llundin * cpl_test_get_tested(), cpl_test_get_failed(): Added w. uni tests 2012-08-17 rpalsa * cpl_test_property_dump(): Support for CPL_TYPE_LONG_LONG properties added. * _cpl_propertylist_insert(): Add missing support for CPL_TYPE_LONG_LONG properties. * cpl_dfs_paf_dump(): support for CPL_TYPE_LONG_LONG properties added. * System wide installation prefix changed to standard location. 2012-08-07 llundin * cpl_fits_count_extensions(): Use proper CPL error codes 2012-07-31 llundin * cpl_image_get_mad_window(): Improve doxygen on MAD as stdev estimator * cpl_polynomial_fit(): Fix implicit cast warning 2012-07-30 llundin * CPL_STATS_MAD, cpl_stats_get_mad(), cpl_image_get_mad(), cpl_image_get_mad_window(): Added w. unit tests * cpl_stats_get_median_dev(), cpl_image_get_median_dev_window(), cpl_image_get_median_dev() and CPL_STATS_MEDIAN_DEV: Improve doxygen (DFS12008) * cpl_fits_set_mode(): CPL_FITS_RESTART_CACHING + external access documented * cpl_io_fits_close_file(): Simplify logic * cpl_dfs_update_product_header_(), cpl_is_fits(): Guard fits_movabs_hdu() with CPL_IO_FITS_REWIND * cpl_io_fits_open_diskfile(): fits_movabs_hdu() guarded by CPL_IO_FITS_REWIND. cpl_io_fits_close_file(): Drop flushing of r/o, flush w/o clearbuf * Use cpl_fits_set_mode(CPL_FITS_RESTART_CACHING) on dirty CPL FITS cache 2012-06-20 llundin * cpl_polynomial_fit(): if + cpl_error_set_message_() replaces cpl_ensure_code() (fix variable in error msg) * cpl_polynomial_fit(): if + cpl_error_set_message_() replaces cpl_ensure_code() (except for NULL-check) * cpl_polynomial_fit(): if + cpl_error_set_message_() replaces cpl_ensure_code() (mostly) 2012-06-18 llundin * cpl_image_power_create(): cpl_image_power replaces cpl_image_exponent in doxygen (DFS11887) 2012-06-15 llundin * cpl_fit_image_gaussian(): Reduce scopy, improve types of sigma-1st-guess code * cpl_fit_image_gaussian(): Check bpm of error map, if present (DFS11883) 2012-06-13 llundin * cpl_imagelist_collapse_minmax_create(): Support bad pixel maps (DFS11856) (bis) * cpl_fit_image_gaussian_test_local(): Always active * @addtogroup cpl_image * bigauss(): Simplify error cases * cpl_fit_lvmq_(): Bail out on NaN from get_chisq() (DFS11865) * bigauss(), bigauss_derivative(): Return 0 on error, use errno (DFS11865). cpl_fit_image_gaussian(): Avoid image duplication, const sizes, rm dead code 2012-06-12 llundin * cpl_fit_image_gaussian_test_local(): Added * cpl_imagelist_collapse_minmax_create(): Support bad pixel maps (DFS11856) * cpl_image_multiply_fcomplex_sse_(): Disable per default (DFS11748) (bis) * cpl_imagelist_collapse_median_create_tests(): Fix incorrect error code check 2012-06-11 llundin * cpl_imagelist_collapse_median_create(): Take into account any input BPM * cpl_image_multiply_fcomplex_sse_(): Disable per default (DFS11748) * Avoid NULL-derefence on failed test (found by cppcheck) 2012-06-04 llundin * cpl_image_multiply(): Use new version of cpl_image_multiply_fcomplex_sse_() (DFS11748) 2012-05-29 llundin * cpl_table_and_selected(): Fix clang warning (-Wparentheses-equality) 2012-05-25 llundin * default_log_message_handler(): Use parameter ptr to avoid compiler warning 2012-05-24 llundin * cpl_table_test_rest(): Initialize prior to _power tests * cpl_test_abs_complex_macro(): Fix wrong imaginary part in message (DFS11796) 2012-05-23 llundin * cpl_table_test_20: Move test code here from cpl_table_test_main(). Add checks on null-flag to all relevant, existing tests * cpl_table_test_21(), cpl_table_test_22(): Add checks on null-flag to all relevant, existing tests * Add checks on CPL error (none) and null-flag to existing tests * cpl_table_test_21(), cpl_table_test_22(): Move test code here from cpl_table_test_main() * cpl_table_test_main(), cpl_table_test_rest(): Split tests. Allow compilation (but not testing...) with complex functions undefined 2012-05-22 llundin * rm unused header files. Create test-files within name-space. Always run large-file test code (default on small size). rm some dead code, unused vars. Revive some dead code. cpl_test_fits() on created files. Move some tests to separate functions. Avoid //-comments. Activate cpl_table_dump on debug+info 2012-05-21 llundin * cpl_fit_image_gaussian_tests(): Call check_gauss_success() only on success or with info/debug-level 2012-05-21 rpalsa * Package and library version updated. * API documentation issue fixed. 2012-05-21 llundin * Work around doxygen attribute-bug, rm unused CPL-includes, mv CPL class defines * Doxygen group cpl_image replaces obsolete cpl_image_filter * CPL_POLYNOMIAL_CMP: mv to define section (no doxygen) * Improve doxygen title 2012-05-11 llundin * setCplMessaging(): Propagate error (DFS11603) (Use cpl_error_set_where(), rm cpl_error_impl.h) * Raise tol on C2C transform * cpl_fft_image(): Update doxygen (cpl_fft_imagelist()) * cpl_fft_imagelist_test_image(): Added * cpl_io_fits_end(): const error, stringify * cpl_fits_set_mode(): CPL_FITS_RESTART_CACHING does not reallocate the fitslist * cpl_dfs_update_product_header(): Use cpl_io_fits_close_tid(), not cpl_io_fits_close() * cpl_io_fits_unset_tid(): Replaces cpl_io_fits_close_one(), can close for all threads * cpl_fits_mode_test(): Limit testing when CPL_IO_FITS_MAX_OPEN == 0 (bis) * cpl_fits_mode_test(): Limit testing when CPL_IO_FITS_MAX_OPEN == 0 * cpl_fist_set_mode(): Support CPL_FITS_RESTART_CACHING | CPL_FITS_ONE * cpl_io_fits_close_one(): Added. cpl_io_fits_free(): Use cpl_error_set_fits() on error. cpl_io_fits_close(): Doxygen * cpl_io_fits_unset_one(): renamed from cpl_io_fits_unset_oldest(), simplify * setCplMessaging(): Propagate error (DFS11603) (include cpl_error_impl.h) 2012-05-10 llundin * Header clean-up. cpl_fits_mode_test(): Added * cpl_fits_set_mode(): Disallow zero input * cpl_fits_set_mode(): Note on concurrency * cpl_io_fits_init(), cpl_io_fits_end(): OpenMP critical replaces single. cpl_nfitsfiles: Use atomic directive (DFS11744) * cpl_fft_image_(): is_last replaces iexec/nexec 2012-05-10 rpalsa * Package and library version updated. 2012-05-10 llundin * rm math.h: No math done in this wrapper module * cpl_fft_image_(): Set FFTW rigor level here to avoid code duplication and allow non-FFTW-build, declare w. non-NULL attribute. cpl_fft_aligned(): Build only w. FFTW. cpl_fft_image_{float,double}(): Declare w. non-NULL attribute 2012-05-09 llundin * Raise tol for in-place C2C * cpl_fft_image_(): Avoid memcpy() on aligned image buffer (backward C2C, all modes done) * cpl_fft_image_(): Avoid memcpy() on aligned image buffer (forward C2C only) * cpl_fft_image_(): Avoid memcpy() on aligned image buffer (R2C + C2R only) * DFS11736, 11737 * cpl_plot_columns(), cpl_plot_vectors(): NULL-options not supported (DFS11737) * cpl_fft_image_(): Always use in+out temp-buffers * Raise tol on in-place, CPL_FFT_FIND_MEASURE replaces CPL_FFT_FIND_PATIENT * cpl_fft_image_{float,double}(): rv fix flops in r.1.14 * CPL_TYPE_COMPLEX: Fix doxygen bug (DFS11736) * cpl_fft_image{,list}(): Call cpl_fft_image_ w. NULL plan for no plan-reuse, improve comments * cpl_fft_image_{float,double}(): rm dead assignment * CPL_FFT_FIND_MEASURE, CPL_FFT_FIND_PATIENT, CPL_FFT_FIND_EXHAUSTIVE: Added w. unit test 2012-05-08 llundin * cpl_fft_image_{float,double}(): Try FFTW_WISDOM_ONLY prior to FFTW_ESTIMATE * cpl_io_fits_find_fptr(): Pass stat struct or NULL instead of boolean + sometimes undefined stat members (scan-build report) * cpl_fft_image_test_one(): Benchmarks, messaging, tols, openmp * cpl_fft_image_{float,double}(): Fix flops, doxygen * Use cpl_tools_add_flops() * cpl_fft_image_test_one(): Raise tol for in-place forward fft - float 2012-05-07 llundin * cpl_fft_imagelist(): Support (sub-optimally) a mix of shared and non-shared planes * cpl_fft_image_(), cpl_fft_imagelist(): Reuse plan + buffer * cpl_fft_image_{float,double}(): pplan, pbuf * cpl_fft_image_test_one(): Call with 1 and several planes * cpl_fft_image_test_one(): Test via cpl_test_imagelist_abs() 2012-05-04 llundin * cpl_fft_image_test_one(): cpl_fft_imagelist() replaces cpl_fft_image() * Raise tol for in-place forward fft 2012-05-03 llundin * cpl_image_move(): Support complex pixels (DFS11723) * cpl_image_power(): cbrt() cannot fail (DFS11722) * Check for cbrt() (DFS11722) * cpl_image_power(): Handle special case of 1/3 with cbrt() (DFS11722) * cpl_fft_image(): Doxument in-place support * New tests: 1D + in-place 2012-05-02 llundin * Several news for 6.1 * cpl_error_set_message_one(): replaces cpl_error_set_one_message() * cpl_io_fits_test_many(): Test opening of too many files * cpl_io_fits_init(): Fix debug-message, void declaration. cpl_io_fits_find_fptr(): Fix long lines, debug-messages * cpl_fits_set_mode(), cpl_fits_get_mode(): Added. cpl_init(): cpl_fits_set_mode() replaces cpl_io_fits*(). cpl_io_fits_init(): Redeclare to boolean * cpl_io_fits_free(): Fix incorrect nonnull __attribute__ * Support build w. CPL_IO_FITS_MAX_OPEN = 0 * CPL_IO_FITS_MAX_OPEN: Limit to NMAXFILES, set to zero in absence of stat(). cpl_io_fits_reuse_fptr(): Added. cpl_io_fits_unset_fptr(): Always unset. cpl_io_fits_find_fptr(): Caller calls stat(). cpl_io_fits_open_diskfile(): Avoid unset + set in case of read-reuse of writer. cpl_maxfitsfiles: rm 2012-04-30 llundin * cpl_io_fits_unset_fptr(): Guard against IO-mode off, notid replaces mtid. cpl_io_fits_find_fptr(): tid, notid replaces mtid, no IO-mode guard * cpl_io_fits_unset_fptr(): Match writer read-reuse without unset * cpl_fitsfile_t.writing: Protect against repeated reader reuse of writer * cpl_io_fits_create_file(): Comment ce * cpl_nfitsfiles: Count open files, avoid race-condition * cpl_io_fits_set(): rm mtid parameter. cpl_io_fits_find_fptr(): Use cpl_nfitsfiles only for msgs. cpl_fitsfile_t.tid: rm negative values * #include 2012-04-27 llundin * cpl_io_fits_unset_oldest(), cpl_io_fits_free(): Added with unit test * cx_list replaces C-array 2012-04-26 llundin * CPL_IO_FITS_MAX_OPEN: Limit default to NMAXFILES of CFITSIO * Debugging per default disabled * Disable doxygen. cpl_io_fits_close_file(): rm optional ffchdu() call * Work around doxygen limitation (DFS10280) * cpl_imagelist_empty(): Fix doxygen typo 2012-04-18 rpalsa * Quick fix for system services getting disabled by -std=c99. To be reviewed! * cpl_table_dump(): type corrected in declaration of row, field_size and label_len. * cpl_array_dump(): type corrected in declaration of field_size and label_len. 2012-04-05 llundin * cpl_error_set_wcs(), cpl_error_set_regex(), cpl_error_set_fits(): Use doxygen @internal (DFS11648) * cpl_error_set_message(): Improve doxygen (DFS11646). Use @hideinitializer for several macros. cpl_error_set_message_one_macro(): Added (DFS11646). cpl_error_set_message_macro_(): nonnull attribute * CPL_IO_MODE: Update doxygen, comments * Reuse READWRITE for reading from r. 1.47. cpl_io_fits_open_diskfile(): Break long lines, improve comments. cpl_io_fits_find_fptr(): Break long lines. cpl_io_fits_unset_fptr(): Improve comments, doxygen * cpl_mask_save(): Improve comment * Need to close FITS file due to non CPL access (DFS11019) * cpl_io_fits_close(): Replaces cpl_io_fits_close_all() * cpl_dfs_update_product_header_(), cpl_is_fits(): Call fits_movabs_hdu(1) (DFS11019) * cpl_vector_load(): Improve doxygen, fits_movabs_hdu(1) * _load/_save: Improve comments 2012-04-04 llundin * cpl_imagelist_unwrap(): Export instead of static * cpl_apertures_extract_mask(): Added (DFS11638). cpl_apertures_extract_sigma(): Wrap around cpl_apertures_extract_mask() * cpl_apertures_new_from_image(): Handle complex input (DFS11639) * cpl_stats_new_from_image_window(): Use size_t to fix performance problem (DFS11249), rm redundant check on input window * rv previous commit * Draft: Reuse READWRITE for reading, breaks cpl_dfs-test due to wrong md5sum * Unique content in all HDUs * cpl_io_fits_unset_fptr(): Match r/o to be unset for any thread id. cpl_io_fits_find_fptr(): Boolean param for matching tid. Various doxygen/comments improvements 2012-04-03 llundin * rv previous change to cpl_io_fits_close_file(), improve its comments * cpl_init(): Update doxygen for CPL_IO_MODE (DFS11019) * const correctness, CPL_ATTR_NONNULL, comments * cpl_io_fits_find_fptr(), cpl_io_fits_unset_fptr(): Rewrite to simplify, support mix of read/write * "ESO QC MYCHAR" replaces "QC MYCHAR", cpl_io_fits_close_all() prior to remove() * reduce scope of i 2012-04-02 llundin * Test with multiple files * Activate cpl_io_fits-test (DFS11019) * cpl_io_fits_find_fptr(): writer boolean. cpl_io_fits_unset_fptr(): replaces cpl_io_fits_remove_fptr() * Improved debugging * cpl_io_fits_close_file(): rv dropped flush of read-only files in previous commit 2012-03-30 llundin * Support create-append-read * Add re-creation test, verify, also FITS header * Improved debugging messages * cpl_io_fits_remove_fptr(): Define tid also w/o OpenMP 2012-03-29 llundin * Add multi-threaded read test * cpl_io_fits_close_all(): Used by cpl_dfs_update_product_header(), rm non-static and use single directive 2012-03-28 llundin * rv to r1.32 w. single array, use thead-id + written boolean, some threaded testing * Clean-up of previous edit. Needs to support non-concurrent multi-threaded writing * include config.h * setCplMessaging(): Propagate error (DFS11603) * cpl_column_set_depth(), cpl_column_insert_segment(): return cpl_error_set_where(fid) replaces return cpl_error_set_code() (DFS11603) * cpl_flux_get_noise_window(), cpl_plot_*(): Fix inccorect CPL error propagation (DFS11603) 2012-03-27 llundin * Use both a thread-private and a thread-shared state for each open file. Draft: No multi-threaded testing yet 2012-03-26 llundin * typo in comment 2012-03-22 llundin * cpl_fft_image_test_one(): Raise tol for R2C test (report from Ole Streicher) 2012-03-21 llundin * Raise tol for cpl_image_fft() based on report from Ole Streicher 2012-03-20 rpalsa * Fix documentation for type code CPL_TYPE_LONG_LONG. 2012-03-19 llundin * @internal added to new static functions * cpl_init(): Document CPL_IO_MODE * cpl_fft_image_test_one(): Raise tol for R2C test (bis) 2012-03-19 rpalsa * Removed "Alpha Release" from section title. * cpl_wcs_platesol(): Documentation updated. Added description of the expected layout of the input maxtrices. 2012-03-19 llundin * cpl_image_dump_window(): rv size_t due to format string 2012-03-16 llundin * cpl_image_{add,subtract,multiply,divide}_scalar(): Explicit cast outside of loop * Compute loop iterations explicitly to help vectorization * Index with size_t (DFS11249) * Index with size_t (DFS11249), reduce var-scope * cpl_image_wrap_(): Internal, non-static. cpl_image_labelise_mask_create(): malloc() replaces calloc(), avoid call on no data * Index with size_t (DFS11249) * cpl_fft_image_test_one(): Raise tol for R2C test * cpl_image_power(): Apply handling of sqrt() correctly (DFS3222) * cpl_image_multiply_fcomplex_sse3_(): Fix missing return, size_t replaces int, explicit cast, attribute non-null, doxygen 2012-03-15 llundin * cpl_mask_threshold_image(): Support bpm in image input (DFS11530) * cpl_apertures_extract_sigma(): Improve doxygen 2012-03-14 rpalsa * Package version updated. 2012-03-13 llundin * cpl_error_set_() replaces cpl_error_set() 2012-03-13 rpalsa * cpl_propertylist_get_long(), cpl_propertylist_get_long_long(), cpl_propertylist_get_double(), cpl_propertylist_get_double_complex(): Documentation updated. 2012-03-13 llundin * cpl_image_fill_re_im(): Test in-place * cpl_image{,list}_{add,subtract,multiply,divide}{,_create}(): Support a complex and a non-complex operand (DFS11524) * cpl_test_image_abs_macro(): Support complex + non-complex image * cpl_image_fill_re_im(), cpl_image_fill_abs_arg(): Replace cpl_image_fill_real(), cpl_image_fill_imag(), cpl_image_fill_mod(), cpl_image_fill_phase() 2012-03-12 llundin * cpl_image_fill_real(),cpl_image_fill_imag(),cpl_image_fill_mod(),cpl_image_fill_phase(): Added. cpl_image_conjugate(): Optimize (DFS11249) * cpl_image_conjugate(): Update doxygen * cpl_image_conjugate(): Added w. unit tests (DFS10983) * cpl_fft_image_test(): Only w. FFTW installed (DFS11516) * rv changes for DFS3510 * Clean-up of header includes * rv changes for DFS3510 * (cpl_fft_image(): Improve check on mode * cpl_fft_image_test_one(): Only w. FFTW installed (DFS11516) * cpl_fft_image_test_one(): Raise tol for C2C / R2C comparison (3rd) * cpl_fft_image_test_one(): Raise tol for C2C / R2C comparison (bis) * cpl_fft_image_test_one(): Raise tol for C2C / R2C comparison * cpl_fft_image(): Do not use FFTW_PRESERVE_INPUT for in-place C2C * cpl_fft_image(): Fix direction bug in C2C, avoid temporary buffer in backward C2C * cpl_fft_image(), cpl_fft_imagelist(): Update doxygen (support half sized r2c/c2r images) * cpl_fft_image_test_one(): Add tests on inverse transform * cpl_fft_image(): Support CPL_FFT_NOSCALE * cpl_fft_image(): Fix scaling for half-sized images * cpl_test_image_abs_macro(): Support complex images 2012-03-09 llundin * cpl_fft_image_test_one(): More tests * cpl_fft_image(): Fix size for backward half-size * cpl_fft_image(): Experimental half-size r2c/c2r w. unit tests 2012-03-09 rpalsa * cpl_error cpl_image_multiply_fcomplex_sse3_(): Typo fixed in comment. * Package version updated. 2012-03-09 llundin * Changes to previous patch: cpl_image_multiply_fcomplex_sse3_() at the top replaces _cpl_image_multiply_fcomplex_sse3(), /* */ comment replaces // comment * cpl_image_multiply(): Apply patch from DFS11500 2012-03-09 rpalsa * Updated to the latest version * Restore CFLAGS so that 32bit libraries can be build on 64bit systems. Remove cfitsio link dependency -lz, this means that a cfitsio build from the original tar-file is required. Checks for cfitsio, wcs and fftw now check always for the static library version. This solves LD_LIBRARY_PATH issues, until a better solution is found. 2012-03-09 llundin * cpl_image_dump_window(): Dump in order of storage. Improve doxygen * cpl_image_{subtract,multiply,divide}_scalar(): Finish doxygen change of previous edit * cpl_apertures_extract_sigma(): Document the mask-filtering (DFS11489) * cpl_apertures_extract_sigma(): rv previous edit (DFS11489) 2012-03-08 llundin * cpl_end(): Call both fftw_cleanup() and fftwf_cleanup() * cpl_fft_image_{double,float}(): Reduce number of critical sections to one pre and one post plan execution * cpl_fft_image(): Inactive, draft support of compact R2C/C2R * cpl_apertures_extract_sigma(): Drop unexpected filtering (DFS11489) 2012-03-07 llundin * cpl_fft_image(): Improve error message * cpl_fft_image(): refactor * cpl_fft_image(): Repack double-data in r2c/c2r * cpl_fft_image(): Repack float-data in r2c/c2r * cpl_fft_image(): Support complex-to-complex transforms * cpl_image_{add,subtract,multiply,divide}_scalar(): Support complex images (DFS11498) 2012-03-06 llundin * cpl_fft_image(): fftw_malloc() replaces cpl_image_duplicate() for (float) temp array * cpl_fft_image(): fftw_malloc() replaces cpl_image_duplicate() for (double) temp array * cpl_test_init_macro(): Warn on failed setting of log-file (DFS11493) * NULL replaces 0x0. cpl_msg_init(), cpl_msg_set_log_level(): cpl_msg_set_log_name(): cpl_func replaces fid. cpl_msg_out(): Fix doxygen typo. cpl_msg_set_log_name(): Create explicit error messages (DFS11493) * CPL_MAX_LOGFILE_NAME: Increase default to 72 from 52. CPL_MAX_MSG_LENGTH, CPL_MAX_FUNCTION_NAME, CPL_MAX_DOMAIN_NAME, CPL_MAX_LOGFILE_NAME: Allow compile time change * cpl_msg_out(): Drop anything after new-line (DFS11492) * Clean-up include, doxygen 2012-03-05 llundin * cpl_fits_find_extension(): Support extensions without EXTNAME card (DFS11488) 2012-03-02 cgarcia * Fix documentation typo * Use prefixes llp for long long pointers and sz for cpl_size prefixes in many functions. Fix a cpl_size pointer in cpl_column_multiply. 2012-03-02 rpalsa * Package version updated. 2012-03-01 cgarcia * Use the proper sz pointer for cpl_size type in function cpl_column_dump 2012-02-28 rpalsa * CPL_CHECK_FFTW(): Ignore suffix which is possibly appended to the version number. 2012-02-27 rpalsa * Support for long, long long and cpl_size arrays added. * CPL type enumeration: Fixed typo in the documentation. * Added argument to macros checking for libraries, to allow setting the minimum required version from configure. CPL_CHECK_WCS(), CPL_CHECK_FFTW(): Fix version checks and library search path. 2012-02-16 llundin * cpl_matrix_set_size(): Preserve elements when reducing number of rows without changing col size * cpl_matrix_set_size(): Fix inefficient behaviour (DFS3510) 2012-02-15 llundin * cpl_stats_new_from_image_window(): Document 32-bit round-off and raise 32-bit tolerance * Raise tol on cpl_image_fft() for 32-bit * cpl_image_power_*(): cpl_tools_ipow() replaces pow() for integer power * cpl_fit_image_gaussian(): Improve doxygen on covariance matrix * Avoid double free on gauss-fit-failure, increase tol on succes (for 32-bit builds) 2012-02-14 llundin * rm unused header files. iqebgv(): rm dead assignments * Initialize phys_cov to NULL prior to testing cpl_fit_image_gaussian() * cpl_fit_image_gaussian(): Improve doxygen on phys_cov * cpl_dfs_paf_dump(): Handle CPL_TYPE_CHAR and linefeed in comments (DFS11380) * cpl_matrix_is_identity(): rm dead assignment 2012-02-07 llundin * cpl_bivector_interpolate_linear(): Avoid (false) uninit warning * "< 1 +" replaces <= (DFS11249) * cpl_vector_save(): Indentation. cpl_vector_correlate(), cpl_vector_gen_lowpass_kernel(): "< 1 +" replaces <= (DFS11249). cpl_tools_sinc(), cpl_vector_exponential(): Use 0.0 for fp zero * cpl_wlcalib_fill_line_spectrum_model(): "< 1 +" replaces <= (DFS11249) * cpl_mask_dump(): "< 1 +" replaces <= (DFS11249) 2012-02-06 llundin * cpl_error_set_message_(): replaces cpl_error_set_message{,_macro}() * cpl_error_set_message_(): replaces cpl_error_set_message(). cpl_error_set_(): Replaces cpl_error_set(). cpl_error_set_where_(): Replaces cpl_error_set_where() * cpl_error_set_message_(), cpl_error_set_where_(), cpl_error_set_(): Replaces cpl_error_set_message_macro(), cpl_error_set_where(), cpl_error_set(). cpl_table_extract_column(): rm unused variable, reduce var-scope. cpl_table_set_column_depth(): rm unused variable 2012-02-03 llundin * assert() replaces cx_assert() * cpl_io_fits_set(): Drop unused support for full table, redeclare to void 2012-02-02 llundin * cpl_wlcalib_find_best_1d(): Fix uninit warnings * cpl_image_get_interpolated_test(): Raise tol on confidence 2012-01-31 llundin * Read different extensions via different paths (to test I/O optimization). Also fix indentation * cpl_io_fits_open_diskfile(): Include handle pointer in debug msg 2012-01-30 llundin * cpl_io_fits_remove_fptr(): replaces less descriptive name cpl_io_fits_find_fptr(). Indenting 2012-01-26 llundin * Remove diagnostic pragmas for now 2012-01-26 rpalsa * Package version updated. 2012-01-24 llundin * cpl_mask_load_(): Try pragma GCC diagnostic ignored "-Wcast-qual" due to CFITSIO API * cpl_fft_image(): Require images to be square (pending DFS10988) 2012-01-23 llundin * cpl_stats_new_from_image_window(): Use size_t in check of bad pixel map (bis) 2012-01-20 llundin * cpl_filter_linear_slow(), cpl_filter_morpho_slow(): Separate loops for bpm==NULL case. Reduce scope of bpmj * cpl_stats_new_from_image_window(): Use size_t in check of bad pixel map 2012-01-20 rpalsa * CPL_CHECK_CFITSIO(): Add -lz to LIBCFITSIO_STATIC CPL_CHECK_LIBS(): Add missing $LDFLAGS to CPL_LDFLAGS when linking configure tests 2012-01-20 llundin * cpl_filter_median_slow(), cpl_filter_stdev_slow(): Separate loops for bpm==NULL case 2012-01-20 rpalsa * CPL_CHECK_CFITSIO(): revert cfitsio runtime path fix 2012-01-20 llundin * Line break. Change loop variables to unsigned, "< 1 +" replaces <= (DFS11249) * cpl_filter_average_slow(): Revert previous edits removal of inner if-statement, reduce scope * cpl_mask_dump(): Adapt format to cpl_size. cpl_mask_filter(): Change loop variables to unsigned, "< 1 +" replaces <= (DFS11249) * cpl_filter_average_slow(): Change loop variables to unsigned (DFS11249) * "< 1 +" replaces <= (part of DFS11249) 2012-01-19 rpalsa * CPL_CHECK_CFITSIO(): Do not use cfitsio runtime path for configure tests, since they do not use libtool. 2012-01-17 rpalsa * CPL_CHECK_CEXT(): Can no called with arguments specifying header and library search paths. CPL_CHECK_LIBS(): Don't require CPL_CHECK_CEXT, CPL_CHECK_CFITSIO. Call CPL_CHECK_CEXT explicitly. 2012-01-16 rpalsa * CPL_CHECK_CFITSIO(): Add cfitsio runtime path to CFITSIO_LDFLAGS 2012-01-13 rpalsa * API changes in cplui added. 2012-01-12 rpalsa * Updated to the latest version 2012-01-11 llundin * cpl_fit_image_gaussian(): Do not reset error when failure is unavoidable * check_gauss_success(): Fix memory-leak on failure, remove space, use explicit double const * cpl_msg_info() replaces cpl_msg_warning() from previous edit 2012-01-11 rpalsa * Package and library version updated. * Container size and index type changed from int to cpl_size. 2012-01-11 llundin * Clean-up branching for tests of large vectors 2012-01-10 llundin * Work around CPL_SIZE_BITS=32 * cpl_init(): Use env CPL_IO_MODE to enable the I/O optimization. cpl_io_fits_is_enabled(): Added. cpl_io_fits_init(): Redeclare to boolean * Raise tol to pass last two tests on current 32-bit test machines (DFS11193) 2012-01-09 llundin * Revert tolerance on 64-bit, raise tol to pass tests on current 32-bit test machines (DFS11193) * Raise tol on float precision fit due to failure on 32-bit (DFS11193) * Raise tol on double precision fit due to failure on 32-bit 2011-12-23 rpalsa * Remove compiler flag std=c99 again from the defaults, as it applies also to the C library restricting its interface (discarding POSIX compliant interfaces). 2011-12-22 rpalsa * Add compiler flag std=c99 to the default flags. * Synchronized with libcext version. * cpl_propertylist_copy_property(): Bug fixed. When the target list contains the sought for property, get the source property from the source list, not from the target one. 2011-12-22 llundin * CPL_IO_FITS_MAX_OPEN: Default to 0 * Revert attempt to use mtime * cpl_io_fits_find_fptr(): memcmp() replaces memcpy() 2011-12-21 llundin * Oops, nested comment * Rely on mtime to know if a sub-process modified the file * Call cpl_io_fits_end() to ensure no pointers are in use. Fix const warning, add msg 2011-12-20 llundin * cpl_apertures_new_from_image(): Fail on negative label, clean-up const modifier, avoid unneeded image duplication * CPL_ERROR_ACCESS_OUT_OF_RANGE replaces CPL_ERROR_ILLEGAL_INPUT for out of bounds index. Improve doxygen, add more unit tests * cpl_image_reject_from_mask(): CPL_ERROR_INCOMPATIBLE_INPUT replaces CPL_ERROR_ILLEGAL_INPUT * self replaces in for object to process * cpl_apertures_get_maxpos_x(), cpl_apertures_get_maxpos_y(), cpl_apertures_get_minpos_x(), cpl_apertures_get_minpos_y(): Added (DFS10971) * cpl_apertures_get_pos_x(), cpl_apertures_get_pos_y(): Added, replaces now deprecated cpl_apertures_get_max_x(),cpl_apertures_get_max_y() (DFS10971) * cpl_apertures_get_maxpos_x(), cpl_apertures_get_maxpos_y(), cpl_apertures_get_minpos_x(), cpl_apertures_get_minpos_y(): Added (DFS10971) 2011-12-19 rpalsa * Added CPL_TYPE_SIZE to type enum. Changed definition of cpl_size from cxint64 to long long (including format and min/max macros) * Call to AC_HEADER_TIOCGWINSZ added. * Inclusion of ioctl.h centralized. Added check on GWINSZ_IN_SYS_IOCTL. cpl_msg_set_log_level(), cpl_tools_get_cputime(): break added in default clause. * Add header include of cpl_type.h to get format macros together with the message functions. 2011-12-19 llundin * cpl_fft_mode replaces unsigned * cpl_io_fits: Use and test stat() * CPL_DFS_FITSFILE replaces filename * cpl_get_description(): Append CPL_IO_FITS_MAX_OPEN 2011-12-16 llundin * cpl_wlcalib_fill_line_spectrum_model(): Fix format warnings due to cpl_size * cpl_io_fits_open_diskfile(), fits_close_file(): Wrap around their CFITSIO counterpart (DFS11019) * cpl_test_end(): var rename, errno fix. Rearrange header files * cpl_dfs_update_product_header_(): Added. cpl_dfs_update_product_header(): Use cpl_dfs_update_product_header_() * cpl_io_fits_close_all(): Export (to CPL) * cpl_image_get_interpolated_test(): Added * cpl_image_extract_subsample_test(): Added 2011-12-15 llundin * cpl_image_get_interpolated(): Prefer temp space from stack (suggestion from JTaylor) 2011-12-14 llundin * cpl_polynomial_multiply_scalar(): Added 2011-12-13 llundin * cpl_matrix_test_banded(): Added * Simplify flush-check * Reenable copying, move cpl_test_nonnull() * cpl_fits_flush_file(): Patched fits_flush_file() to properly flush files. cpl_io_fits_close_file(): Use cpl_fits_flush_file(). CPL_IO_FITS_MAX_OPEN: Support 0-value 2011-12-12 llundin * cpl_test_eq_error() replaces cpl_test_zero(), Check CPL error before pointer, fix warning * cpl_io_fits_resize(): Added. cpl_io_fits_set(): Use cpl_io_fits_resize() to avoid forced closed of any file * cpl_fitsfiles: Allocate * CPL_IO_FITS_MAX_OPEN default to 1024. Add some more debug messages * cpl_io_fits_set(), cpl_io_fits_find_fptr(): Ignore CFITSIO filename meta-character. cpl_io_fits_create_file(): Avoid incorrect and inefficient work-around for CFITSIO filename meta-character * Avoid system(cp) while working possible CFITSIO bug 2011-12-09 llundin * Support multiple (or no) open files via an array, disable debug-messages per default, disable doxygen (I think) * cpl_dfs_product_tests(): Support test with many extensions * cpl_wlcalib_test_one(): cpl_wlcalib_find_best_1d(): Do not evaluate non-physical anchor points, avoid useless vxc-fills * cpl_io_fits_find_fptr(), cpl_io_fits_find_name(), cpl_io_fits_set(): rm static variable from API * cpl_io_fits_set(): Access self->fptr only inside critical. cpl_io_fits_find_fptr(): Support NULL-name. cpl_io_fits_close_all(): Critical access via cpl_io_fits_find_fptr() * cpl_io_fits_open_diskfile(): Avoid redundant call to cpl_io_fits_find_fptr() * cpl_io_fits_open_diskfile(): rm cpl_io_fits_close_one(). cpl_io_fits_close_all(): Renamed from cpl_io_fits_close_one() * cpl_io_fits_create_file(): rm cpl_io_fits_close_one() * cpl_io_fits_find_fptr(), cpl_io_fits_find_name(): Improve names. cpl_io_fits_find_fptr(): Add unset param * cpl_io_fits_set(): rm pname, piomode * cpl_io_fits_set(): return true, when file to be closed * cpl_io_fits_find_name(): return iomode 2011-12-08 llundin * rm cpl_error_set_fits() from CFITSIO wrappers. cpl_io_fits_close_one(): CFITSIO style error. cpl_io_fits_find_fptr(): Added * cpl_io_fits_set(), cpl_io_fits_find(): Added w. critical sections. Drop thread-private storage. FIXME: still need to cpl_io_fits_close_one() 2011-12-07 llundin * cpl_wlcalib_find_best_1d(): Do not evaluate non-physical anchor points, avoid useless vxc-fills * cpl_wlcalib_find_best_1d(): Use cpl_vector_rewrap() * cpl_vector_rewrap(): Added internally * cpl_vector_find(): DFS11130 * cpl_vector_find(): Fail on non-sorted data * cpl_wlcalib_fill_line_spectrum_model(): Detect non-increasing wavelengths 2011-12-06 llundin * cpl_wlcalib_fill_line_spectrum_model(): Increment ulines * cpl_wlcalib_test_one(): Comments * cpl_wlcalib_test_one(): 2nd refining search * slitmodel replaces linemodel, catalog replaces lines * cpl_wlcalib_find_best_1d(): vxc wraps around xcorrs, when non-NULL * cpl_wlcalib_find_best_1d(): xcorrs stores all XC values 2011-12-05 llundin * cpl_wlcalib_test_one(): Tighten bounds on cpl_test_polynomial_abs() * cpl_wlcalib_fill_line_spectrum_model(): Use cpl_polynomial_solve_1d_() for monotony check, add degree to error msg. Guard debugging w. CPL_WLCALIB_DEBUG * cpl_polynomial_solve_1d_(): bpos replaces pdx * cpl_polynomial_solve_1d_(): Added w. pdx * cpl_wlcalib_test_one(): Correct cost count check after vxc-guard fix * Improve doxygen, add flops * cpl_fft_image(): Add omp critical sections for each FFTW-call, except the execute-ones * cpl_wlcalib_test_one(): Reduce search range on shifted poly * cpl_wlcalib_find_best_1d(): Doxygen typo * cpl_wlcalib_find_best_1d(): Guard vxc access on failure, improve doxygen * cpl_wlcalib_find_best_1d(): Extend model spectrum by 2*hsize and tighten unit tests * cpl_wlcalib_find_best_1d(): Draft version of hsize support * cpl_wlcalib_fill_line_spectrum(): Improve doxygen 2011-12-02 llundin * cpl_wlcalib_find_best_1d(), cpl_wlcalib_fill_*line_spectrum*(): CPL_ERROR_INVALID_TYPE for non-1D-poly * Improve doxygen * cpl_wlcalib_test_one(): Add lines, reduce nsamples, plot on info * cpl_wlcalib_test_one(): Verify costs * cpl_wlcalib_test_one(): Non-monotone failure * cpl_wlcalib_test_one(): Two more tests 2011-12-01 llundin * cpl_wlcalib_fill_line_spectrum_model(): Use erftmp * cpl_wlcalib_test_one(): Time the search * cpl_wlcalib_find_best_1d(): cpl_polynomial_fit_1d() replaces cpl_polynomial_fit() * rm xtrunc from linemodel struct * cpl_wlcalib_fill_*line_spectrum*(): Redeclare model to void and move it up * cpl_wlcalib_test_one(): Test XC * cpl_wlcalib_test_one(): Raise fast-tol for valgrind * cpl_wlcalib_test_one(): Reduce degree, add more tests of cpl_wlcalib_find_best_1d() * cpl_wlcalib_find_best_1d(): Fix degree error * More tests * cpl_wlcalib_find_best_1d(): Units of wl_search * cpl_polynomial_add(), cpl_polynomial_subtract(): Added * cpl_wlcalib_test_one(): Test fillers * _logline(): Improve doxygen * rm redundant include * Added some unit tests * cpl_wlcalib_find_best_1d(): cpl_size replaces int, rename variables, preserve 1st errors on failure * cpl_wlcalib_find_best_1d(): Added * cpl_wlcalib_fill_logline_spectrum(), cpl_wlcalib_fill_line_spectrum_fast(), cpl_wlcalib_fill_logline_spectrum_fast(): Define * Threshold replaces xtrunc * Export minimal set of functions * Obsolete 2011-11-30 llundin * cpl_wlcalib_fill_line_spectrum(): Define * cpl_wlcalib_fill_line_spectrum_model(), cpl_erf_antideriv(): Defined * Fix filler-declarations * cpl_errorstate_dump_one_{warning,info,debug}(): Copied from IRPLIB * Module w. linemodel object 2011-11-29 llundin * More testing of Nearest neighbor resampling * cpl_geom_img_offset_saa(): 2.0 replaces CPL_KERNEL_DEF_WIDTH * Nearest neighbor resampling (DFS08665) 2011-11-25 llundin * More tests, smaller default size * cpl_io_fits_seek: rm * cpl_io_fits_create_file(): Added, closes all * Draft solution for DFS11019 2011-11-23 llundin * cpl_image_load_(), cpl_mask_load_(): fits_movabs_hdu() replaces fits_movrel_hdu() * filter_median_bf(),test_cpl_image_filter(): Fix memory leaks 2011-11-22 llundin * cpl_image_flip(), cpl_mask_flip(): Avoid duplication on square input * cpl_image_flip_turn_test(): Added * cpl_mask_flip_turn_test(): Verify result * cpl_mask_flip_turn_test(): Test cpl_mask_flip() on square and rectangular masks 2011-11-21 rpalsa * cpl_table_erase_invalid(), cpl_table_erase_invalid_rows(): documentation clarified. 2011-11-18 llundin * cpl_image_dump_structure(), cpl_image_dump_window(): Use CPL_SIZE_FORMAT (DFS10984) * cpl_image_dump_*(): Check also return value 2011-11-17 llundin * cpl_mask_extract(): Fix wrong row extraction w. unit test (DFS10977) * cpl_test_nonnull() replaces cpl_test() of assignment 2011-11-15 llundin * cpl_geom_img_offset_combine(): Input imagelist is now const (DFS08575) 2011-11-02 rpalsa * cpl_property_get_long(), cpl_property_get_long_long(), etc: Added type promotion in case the accessed property has a smaller rank than the target type. * Include cpl_propertylist_impl.h moved to the end of the list * CPL_FITS_BADKEYS_PRIM: Removed EXTNAME, EXTVER and EXTLEVEL * cpl_type_get_sizeof(): Parentheses added 2011-10-28 llundin * clp_*_flip(): doxygen typo 2011-10-18 llundin * cpl_matrix_decomp_lu(): Support perm-array with initial invalid elements * cpl_matrix_fill_diagonal(): Generalize to non-main-diagonals * cpl_mask_threshold_image(): New function 2011-10-12 llundin * cpl_vector_extract(): Add several unit-tests 2011-10-11 llundin * cpl_mask_threshold_image(): Explicitly document lo == hi case 2011-10-06 rpalsa * CPL_CHECK_CFITSIO(): Use static libcfitsio for tests to avoid runtime environment dependencies. 2011-10-06 llundin * cpl_ppm_match_positions(): Improve doxygen grammar 2011-09-27 llundin * cpl_test_init_macro(): abort() replaces exit() to be in line with cpl_xmemory functions 2011-09-15 llundin * Doxygen univariate (1D) replaces univariate 2011-09-13 cgarcia * Adding comment regarding the dependency of functions fill_chess and median_1. 2011-08-19 llundin * cpl_recipe_define(): Fix doxygen typo 2011-08-18 llundin * cpl_image_filter_fill_chess(): replaces duplicated static fill_chess() * cpl_tools_get_kth(): Avoid duplication * Standardize multi-type support of median filtering * cpl_xmemory_status(): With _OPENMP peak allocation is approximate 2011-08-17 cgarcia * Added new float arrays tests cases for the cpl_tools_get_median function. Update the test cases to the new median algorithm. * Added functions fill_chess and fill_row copied from cplcore/cpl_filter_median.c. Brute force function now also uses the chess-like pattern filling, like the function we want to test against. Unused function bf_get_median_upper has been removed. * Added PIXEL_MAX, PIXEL_MIN #define's needed by the functions fill_chess and fill_row defined in cpl_filter_body.h * Change in documentation reflects the change in the median algorithm (mean of central values for even number of elements) * Change the implementation of the median, to use the mean of central values for even number of elements. Also the quickselect function has been modified, to implement the new median algorithm. * Added option in cpl_tools_quickselect to specify the value around which the selection should be performed. * Change in documentation reflects the change in the median algorithm (mean of central values for even number of elements) * Added warning to reflect the duplication of code in tests/cpl_filter_body.h * Documentation of CPL_BORDER_FILTER reflects the change in the median algorithm (mean of central values for even number of elements) 2011-08-17 llundin * cpl_xmemory_count(): drop for performance reasons (revert to rev. 1.32) * cpl_imagelist_empty(): Export 2011-08-12 llundin * cpl_imagelist_empty(): Export 2011-08-11 llundin * cpl_mask_threshold_image(). cpl_mask_threshold_image_create(): Wrap around cpl_mask_threshold_image() * cpl_matrix_decomp_lu(), cpl_matrix_solve_lu(): Note on API change (typo) * cpl_matrix_decomp_lu(), cpl_matrix_solve_lu(): Note on API change 2011-08-10 cgarcia * Added benchmark test for get_median function, since eventually, the performance of get_median and quickselect won't be the same. 2011-08-08 llundin * cpl_geom_img_offset_saa(): Use uint32_t to test bpm, do not test RSC to avoid NaN * cpl_geom_img_offset_saa_one(): Test that cpl_geom_img_offset_saa() with rejections average the correct numbers * cpl_geom_img_offset_saa(): Avoid interpolation on integer shifts (DFS10561) * 5.92cvs 2011-08-05 cgarcia * Added median test cases for number of elements equal 10 and 11. 2011-08-05 llundin * cplsize replaces long in function names for cpl_size data 2011-08-02 rpalsa * CPL_CHECK_CFITSIO(): Require cfitsio 3.270 or newer * printf format %d replaced by %CPL_SIZE_FORMAT where appropriate. * cpl_ppm_match_points(): Integer type arguments promoted to cpl_size * Package and library version updated. * CPL_CHECK_CFITSIO(): Fix typo in cpl_cfitsio_libdirs. Instead of checking $CFITSIODIR/lib32 it checked $CFITSIODIR/lib twice CPL_CHECK_LIBS(): Use all cplcore dependencies for runtime tests. 2011-08-02 llundin * cpl_test_get_description_b(), cpl_test_init_macro(): Break long lines * cpl_fft_image(): Fix unreachable statement warning * cpl_fits_find_extension(): rm cast work-around for CFITSIO < 3.18 * For Include + LD flags place 3rd party components last, with optional ones at the very end * cpl_image_exponential(), cpl_image_logarithm(), cpl_image_power(): Count flops 2011-08-01 llundin * cpl_image_logarithm(): Support bad pixels (DFS10528) * cpl_image_exponential(): Support bad pixels (DFS10528) * cpl_image_power(): Support bad pixels (DFS10528) * cpl_column_pow_int(), cpl_column_pow_float(), cpl_column_pow_float_complex(), cpl_column_pow_double(), cpl_column_pow_double_complex(): Fix exponent == -1 bug (DFS10451) * 6.0 (Development Snapshot) * cpl_error_set_(...) replaces cpl_error_set(cpl_func, ...) * cpl_dfs_save_propertylist(), cpl_dfs_save_imagelist(), cpl_dfs_save_table(): Fix doxygen-bug (applist now mandatory) (DFS10545) * Ralf replaces Carlo and Yves 2011-07-29 llundin * cpl_matrix_decomp_lu(), cpl_matrix_solve_lu(): Use cpl_array for permutation * Fix cpl_size cast warnings + long lines * Fix cpl_size cast warnings * Redeclare int to cpl_size * Fix (cpl_size) cast warnigns * Fix cast warnings * Redeclare int* to cpl_size* for calls cpl_polynomial_*() * cpl_fit_imagelist_polynomial_one(): Redeclare degree/kk from int to cpl_size for calls to cpl_polynomial_fit_1d()/cpl_polynomial_get_coeff() * find_transform(): Redeclare degree(s) from int to cpl_size for calls to cpl_polynomial_fit() * Fix implicit cast warnings * Fix cpl_flops cast warnings * Fix format + (double) cast warnings * cpl_polynomial_shift_double(): Non-static, mv to cpl_polynomial_impl.h * cpl_imagelist_collapse_sigclip_create(): Fix cpl_size warning * cpl_vector_load(): Fix cpl_size warning * cpl_test_matrix_abs_macro(), cpl_test_imagelist_abs_macro(): fix cpl_size warnings * Fix cpl_size implicit warnings (double+int), fix cpl_size format warnings * cpl_test_macro(), cpl_test_eq_macro(): fix cpl_size warnings * cpl_polynomial_shift_double(): mv to cpl_polynomial and make static. Fix cast size_t warnings * Draft version of cpl_size usage (no valgrind warnings, passes unit-tests) 2011-07-28 llundin * cpl_wcs_platesol(), cpl_wcs_convert(): Use cpl_size for cpl_matrix+cpl_array() sizes * cpl_image_fft(): Proper handling of limited image size support (bis) 2011-07-27 llundin * Use cpl_size * cpl_fit_imagelist_polynomial{,_window}(): Use cpl_size 2011-07-26 llundin * cpl_image_fft(): Proper handling of limited image size support * cpl_image_iqe(): Improve limited size support in cpl_iqe() * cpl_matrix_decomp_lu(), cpl_matrix_get_minpos(), cpl_matrix_get_maxpos(): Use cpl_size * Use cpl_size except for int* functions * Avoid implicit cast to size_t * cpl_fit_image_gaussian(): Redeclare int parms to cpl_size * cpl_fit_lvmq_(): Explicit cast of cpl_size to size_t * Fix formatting. cpl_fit_imagelist_polynomial(), cpl_fit_imagelist_polynomial_window(): Use CPL_ATTR_ALLOC * cpl_fit_image_gaussian(): Fix cpl_size* warning 2011-07-21 llundin * Fix header inclusion error, indent * Fix cpl_size warnings, support calls w. pre-existing error, fix indentation, avoid direct image-struct access, reduce header inclusion * Fix cast/cpl_size warnings * Use cpl_size * Fix cpl_size * warning * cpl_flux_get_noise_window(), cpl_flux_get_bias_window(): Simplify error propagation * Avoid cast of cpl_size to int * Use cpl_size * rm redundant header-files, indenting * rm space in front of ; * cpl_plot_columns(),cpL_plot_bivectors(): Use cpl_size * cpl_mask_load*(): Use cpl_size also for plane and extension * cpl_fits_count_extensions(),cpl_fits_find_extension(): Use cpl_size * Use cpl_size * cpl_load image(list): Use cpl_size also for plane and extension * Use cpl_size 2011-07-20 llundin * Use cpl_size * Use cpl_size * Use cpl_size * Use cpl_size - also for relevant object tests * Use cpl_size * Use cpl_size * Use cpl_size 2011-07-19 llundin * cpl_tools_shift_window(): Use cpl_size. cast cpl_size <=> size_t * cpl_image_io uses cpl_size * rm space before ; * Fix -Wconversion * Use cpl_size for cpl_mask+cpl_vector * cpl_plot_vector(), cpl_plot_mask(): Use cpl_size * use cpl_size * cpl_test_init_macro(): sizeof(cpl_size) 2011-07-08 llundin * CFITSIO support for I/O of largest possible buffers * rm space preceeding ; * cpl_mask_save(), cpl_mask_load_(), cpl_mask_load_one(): Use CPL_FITSIO_TYPE etc * mv macros for "CFITSIO support for I/O of largest possible buffers" to cpl_tool.sh * cpl_imagelist_collapse_sigclip_create(): Merge changes from 5.3 branch (DFS08476) 2011-07-04 llundin * cpl_imagelist_collapse_sigclip_create(): Use different CPL error codes for different types of errors (instead of just CPL_ERROR_ILLEGAL_INPUT) (bis) * cpl_imagelist_collapse_sigclip_create(): Use different CPL error codes for different types of errors (instead of just CPL_ERROR_ILLEGAL_INPUT) 2011-07-01 llundin * Merge in changes in cpl-5_3_0-BRANCH * Merge in changes in cpl-5_3_0-BRANCH (mostly DFS10427) * Merge in changes in cpl-5_3_0-BRANCH (mostly DFS10416 + doxygen typos) * Merge in changes in cpl-5_3_0-BRANCH (mostly DFS10232) * Merge changes from cpl-5_3_0-BRANCH (cpl_vector_count_distinct()) * Merge changes from 5.3 branch (cpl_tools_get_mean) 2011-05-13 llundin * Merge in changes from 5.3 branch (cpl_test_* changes) 2011-05-11 llundin * Merge in changes from 5.3 branch (DFS10280) 2011-04-20 llundin * Merge in changes from 5.3 branch: Add cpl_polynomial_impl.h with declaration of cpl_polynomial_fit_1d() * Merge changes from 5.3 branch (include cpl_error_impl.h) * Merge changes from 5.3 branch (fix gcc 4.6 warnings) * cpl_fit_imagelist_polynomial{,_window}(): Handle complex input (DFS10232) * cpl_fit_imagelist_polynomial_tests(): various clean-up, prep for test of new bug * cpl_fit_imagelist_polynomial_tests(): various clean-up * cpl_fit_imagelist_polynomial_window(): Fix minor doxygen issues, improve comments and variable names, use cpl_error_set_where_(). cpl_fit_imagelist_polynomial(): improve variable names, use cpl_error_set_where_() 2011-04-19 llundin * bigauss(), bigauss_derivative(): Declare with CPL_ATTR_NONNULL, add internal const modifiers. bigauss_derivative(): Avoid division by zero, use single point of return * cpl_apertures_get_fwhm(): Move to cpl_apertures.h and deprecate together with cpl_apertures_img.h 2011-04-18 llundin * Merge changes from 5.3 branch (fix gcc 4.6 warnings) * Merge change from 5.3 branch: cpl_msg_progress(), cpl_tools_get_cputime(): Fix gcc 4.6 warnings 2011-04-15 llundin * Merge in changes from 5.3 branch 2011-04-15 cizzo * Add omp.h including... since not just pragmas are used. 2011-04-13 cizzo * Thread safe version * Thread safe varsion 2011-04-13 llundin * Merge in changes from 5.3 branch (bis) * Merge in changes from 5.3 branch * Merge in changes from 5.3 branch (cpl_error_set_where_() + return replaces cpl_ensure(0,...), fixes clang warning) 2011-04-12 cizzo * Fix wrong association of cpl_size definition and used format (it caused compiler warnings and a segfault in the test modules for cpl_test and cpl_vector) * Added backward compatibility with cplsize = int 2011-04-12 llundin * Merge in changes from 5.3 branch (DFS10210) * cpl_test_get_description_[ab](): Added. cpl_test_get_description(): Redeclare to alloc, add FFTW version * cpl_test_get_description(): Added size of cpl_size * CPL_SIZE_BITS: Support an alternative definition of cpl_size, to int (as per CPL meeting 2011-03-24) * Merge in changes from 5.3 branch 2011-04-08 llundin * Merge in changes from 5.3 branch (DFS09012) 2011-04-06 llundin * Merge in changes from 5.3 branch (DFS10192) 2011-04-05 rpalsa * cpl_propertylist_dump(): Empty character constant fixed. * cpl_propertylist_dump(): Variable definitions changed to match the changed return type of cpl_property_get_size(). * Adapt to changed return type of of cpl_property_get_size() 2011-04-05 llundin * Merge in changes from 5.3 branch (Fix gcc 4.6 warnings) 2011-04-04 rpalsa * CPL_CHECK_CFITSIO(): Improved check on available cfitsio version. Set minimum required version to 3.260. 2011-04-01 cizzo * Add unit tests about extended functionality of cpl_table_and_selected() and cpl_table_or_selected(), now supporting also string columns * cpl_table_and_selected() and cpl_table_or_selected() now support comparison between string columns 2011-04-01 llundin * Merge in changes from 5.3 branch for DFS09020 * cpl_tools_get_bpp(): Merge in changes from 5.3 branch (DFS09020) * Merge in changes from 5.3 branch (DFS09020, DFS09331) * revert previous edit * cpl_*_save*(): cpl_type replaces cpl_type_bpp (DFS09020) 2011-03-28 rpalsa * cpl_property_get_size(): Interface updated to match prototype. 2011-03-25 cizzo * Fix doc to cpl_ppm_match_points(), using non-deprecated cpl_polynomial_fit() in the code example (DFS09113) 2011-03-18 rpalsa * Package version updated. * Preliminary support for 8-byte integer (long long) properties. 2011-03-03 cizzo * Compatible with cpl_size being 64bit integers 2011-03-03 llundin * cpl_error_set_message_( replaces cpl_error_set_message(cpl_func, * cpl_vector_save(): Support largest length possible w. unit test (default inactive) * cpl_vector_load(): Support loading of long vectors 2011-03-02 llundin * cpl_size replaces int where neeeded for cpl_vector * cpl_apertures_extract{,_window}(): Use cpl_size for cpl_vector-related variables 2011-03-02 cizzo * Use LONGLONG cfitsio calls where appropriate in cpl_table_save() and cpl_table_load() * typedef cpl_size to 64 bits signed int (based on cx lib) 2011-03-02 llundin * cpl_xmemory_count(): Name the critical section (DFS10059) * cpl_vector_fit_gaussian_test_one(): Replaces inactive code to test fix of DFS06126. cpl_vector_{corr,stdev}_bench(): Use CPL_SIZE_FORMAT 2011-03-02 cizzo * Switch to cpl_size type the appropriate integers. * Fix wrong allocation of nb array in cpl_table_save(), and invalid return in case of error in cpl_table_get_column_depth() 2011-03-01 llundin * CPL_SIZE_FORMAT replaces int for cpl_vector 2011-03-01 rpalsa * CPL_CHECK_CFITSIO(): Distributers may have changed the cfitsio build system to provide proper shared library dependencies. An extra test has been added to catch this case. * CPL_CONFIG_CFITSIO(): Use cpl_cv_cfitsio_is_thread_safe instead of cpl_cv_cfitsio_requires_pthread to check whether cfitsio supports threads. 2011-03-01 llundin * cpl_tools_permute_*(): Complete change to cpl_size * cpl_apertures_extract{,_window}(): Use cpl_size for cpl_vector-related variables 2011-03-01 cizzo * Change relevant ints to cpl_size type, and make use of the proper format strings when printing values of type cpl_size 2011-03-01 llundin * CPL_SIZE_FORMAT replaces d for cpl_bivector_get_size() * cpl_vector_ensure_distinct(): Redeclare to use cpl_size, cpl_error_set_message_() replaces cpl_error_set_message_macro(). cpl_fits_add_properties(): cpl_error_set_where_() replaces cpl_error_set_where(). Move system #include down in .c to expose any missing includes in .h. * cpl_vector_get_noise(), cpl_vector_get_fwhm()" cpl_size replaces int (DRAFT) * CPL_SIZE_FORMAT replaces ld w. long-cast. cpl_vector_load(): rm redundant cast of long nx * @defgroup cpl_type replaces cpl_types. rm redundant and out-dated doxygen of type codes. Add doxygen of cpl_size and CPL_SIZE_FORMAT 2011-02-28 llundin * cpl_size replaces int where neeeded - DRAFT, use only w. cpl_size defined to int 2011-02-28 cizzo * Make the cpl_size typedef public 2011-02-25 llundin * Move static type-specific declarations 2011-02-25 cizzo * Add protoypes for supporting cpl_size (long) type * Switch to cpl_size type * Min required changes for a permutation vector of type cpl_size 2011-02-24 llundin * cpl_fit_image_gaussian_tests(): Redeclared to take a supported pixel type; Call it with all 3 of them. Also test the returned error code 2011-02-23 llundin * cpl_matrix_shift(): Use memmove() to reduce copying (for all shifts). cpl_matrix_get_determinant(): rm assert(), improve error message 2011-02-22 rpalsa * Added again. * Correct the library version. Call CPL_CONFIG_CFITSIO instead of CPL_CHECK_CFITSIO. * CPL_CHECK_CFITSIO(): Save the result of the libpthread dependency check to a cache variable. * CPL_CONFIG_CFITSIO(): Added. It relies on CPL_CHECK_CFITSIO, but requires cfitsio to be thread-safe if building CPL with thread-support was requested. 2011-02-21 rpalsa * Entries reordered. 2011-02-21 cizzo * CPL_OPENMP(): Remove call to _AC_CC. Supported only by newer autotools. * Obsolete. * Fix typo: configure libcext subdirectory if building with a packaged libcext source tree. * CPL_CONFIG_CEXT(): Add proper compiler flags in case of building with a packaged libcext. 2011-02-21 rpalsa * Build system updated in preparation for multi-threaded environments. * _cpl_propertylist_to_fitsfile(): Bug fixed affecting the representation of a character property in the FITS header. Changed back to a single character string from its numerical equivalent. 2011-02-21 llundin * 5.3.1cvs -> 5.3.2cvs 2011-02-18 llundin * 5.3.0 -> 5.3.1cvs * 5.3.0b1 -> 5.3.0 2011-02-17 llundin * cpl_matrix_shift(): Use memmove() to reduce copying (so far for simple shifts) 2011-02-15 llundin * cpl_wcs_new_from_propertylist(): Test absence of WCS input w. non-empty input * cpl_wcs_new_from_propertylist(): Make sure to set a CPL error code in absence of WCS input. cpl_wcs_is_table(): Replaces cpl_wcs_get_istab(), fix return values on error and do not compile (per default) * On 05/02/2011 07:43, Jim Lewis wrote: > Hi Klaus, > > Here is a new version of the cpl_wcs module. This includes cpl_wcs.c, cpl_wcs.h and cpl_wcs-test.c. Have a look and tell me what you think... > > cheers, Jim * cpl_fit_image_gaussian(): Use cpl_image_count_rejected(). cpl_fit_imagelist_polynomial_window(): rm useless assert()s, cpl_image_wrap() replaces cpl_image_new() 2011-02-14 cizzo * In cpl_fit_image_gaussian() avoid casting to float when input images are different from float, and prevent handling of complex types, and different types for data and error images * Test against complex types and type mismatch between data and error images in cpl_fits_image_gaussian() 2011-02-11 llundin * cpl_fit_imagelist_polynomial_window(): Fix const warnings. bigauss(): CPL_MATH_2PI replaces 2 * CPL_MATH_PI. cpl_fit_image_gaussian(): Reduce scope of fitting variables, CPL_MATH_2PI replaces 2 * CPL_MATH_PI, CPL_MATH_PI_2 replaces CPL_MATH_PI / 2, avoid sqrt() call on error, compute covariance via cpl_matrix_product_bilinear(), fix comment typo * cpl_matrix_shift(): Preserve pointer to elements and improve unit tests 2011-02-11 cizzo * Use expected error, and not computed error, for comparing expected and computed values. Better doc on the uncertainty implied by a 3-sigma level comparison 2011-02-11 llundin * static cpl_matrix_set_size_(): Added. cpl_matrix_product(),cpl_matrix_product_transpose(),cpl_matrix_product_bilinear(): Use cpl_matrix_set_size_(). Also: cpl_error_set\w*_() replaces ditto w. cpl_func 2011-02-10 llundin * check_gauss_success(): Verify that the covariance is SPD. Also: CPL_MATH_DEG_RAD replaces 180 / CPL_MATH_PI and CPL_MATH_2PI replaces 2 * CPL_MATH_PI 2011-02-10 cizzo * Fix check in check_gauss_success(), using error, not value itself as error. 2011-02-10 llundin * cpl_matrix_product_bilinear(): Added with unit test. Also: Avoid overflow in calls to cpl_tools_add_flops() * cpl_test_matrix_abs(): Added w. unit-tests * cpl_matrix_product{,_transpose}(): Fix segfault on resize (DFS10005). Also: Add @internal to all non-exported functions 2011-02-09 llundin * cpl_fit_lvmq_(): Replaces _cpl_fit_lvmq(). cpl_fit_lvmq(): Simplify error propagation. cpl_fit_image_gaussian(): Do not reset pre-existing error, set CPL_ERROR_SINGULAR_MATRIX when returning that, deallocate own_cov on error also when covariance is NULL, propagate error, cpl_error_set\w*_() replaces ditto w. cpl_func (DFS10002) * cpl_fit_image_gaussian(): Fix segfault on non-NULL im_err and NULL red_chisq (DFS10001) * cpl_fit_image_gaussian(): Fix memory leak (DFS10000) 2011-01-28 llundin * 5.3.0b1 -> 5.3.0cvs * 5.3.0cvs -> 5.3.0b1 * Updated 2011-01-28 cizzo * Prevent compiler warnings from cpl_table_save() 2011-01-26 llundin * cpl_error_set_wcs_macro(): Support empty string instead of function name * cpl_error_set_fits_macro(): Support empty string instead of function name 2011-01-26 cizzo * Fix incorrect error message in cpl_table_save() 2011-01-25 cizzo * Add new test for columns of arrays of strings (commented) * Add support for arrays of strings in cpl_table_save() too, not just cpl_table_load(). Fix wrong number of arrayof string elements read in cpl_table_load() 2011-01-25 llundin * cpl_dfs_extract_printable(): Guard from CFITSIO v. 3.26 and improve comments * cpl_error_set_fits_macro(): Drop cast, fits_get_errstatus() is already void 2011-01-24 cgarcia * Substitute imaginary by img_imag and real by img_real in the complex operations (Fix DFS09015) 2011-01-24 llundin * cpl_dfs_extract_printable(): Extract a string valid for a FITS header. cpl_dfs_setup_product_header(): Pass parameters comments through cpl_dfs_extract_printable() (DFS09935) w. unit-test 2011-01-21 llundin * return cpl_error_set_{,where_}() replaces harder-to-read cpl_ensure_code(0, ...) 2011-01-21 cizzo * Correct call to cpl_ensure_code() in cpl_dfs_setup_product_header() 2011-01-21 llundin * cpl_image_load_one(): naxes must have space for 3 elements (DFS09929) 2011-01-21 kbanse * add #ifdef _OPENMP 2011-01-17 kbanse * local static vars not o.k. - so use threadprivate directive for OMP 2011-01-14 kbanse * remove global static variables 2011-01-14 cizzo * Ensure that after each comparison test no error is set 2011-01-13 cizzo * Safer math in cpl_column_pow_float_complex() and cpl_column_pow_double_complex() 2011-01-13 llundin * 5.3.0a3 -> 5.3.0cvs * 5.3.0cvs -> 5.3.0a3 * cpl_flux_get_window(): rm nonnull attribute (DFS09871) 2011-01-12 llundin * 5.3.0a2 -> 5.3.0cvs * 5.3.0cvs -> 5.3.0a2 * filter_median_1(), filter_median(): rm dead code (for support for different pixel types in input and output). filter_median(): const modifiers added to local declarations 2011-01-12 cizzo * Guard complex declarations * Extra test about assignment of complex elements in tables 2011-01-11 llundin * attribute warn_unused_result only supported from gcc 3.4. CPL_ATTR_REALLOC: Warn on unused result also for gcc 3.4 to 4.2 + malloc attribute for gcc 3.0 to 3.3 * NULL-input tests. cpl_plugin_dump(): Test added * cpl_plugin_get_version_string(), cpl_plugin_get_type_string(): Use CPL_ATTR_ALLOC * cpl_plugin_set_synopsis(), cpl_plugin_set_description(): Fix NULL-value doxygen-bug (DFS09864). cpl_plugin_get_version_string(), cpl_plugin_get_type_string(): cpl_sprintf() replaces strlen()+strcpy()/sprintf(). cpl_error_set*_() replaces cpl_error_set*() + _id. cpl_plugin_set_*(): cx_strdup() replaces strlen()+strcpy()/sprintf() 2011-01-10 llundin * LDFLAGS = $(CFITSIO_LDFLAGS) added (for CFITSIO) * cpl_flux_get_window(): Fix guard on nonnull attribute 2011-01-05 llundin * cpl_propertylist_update_string(), cpl_propertylist_set_string(), cpl_propertylist_insert_string(), cpl_propertylist_insert_after_string(), cpl_propertylist_prepend_string(): Handle NULL value, unit tests added (DFS09860) 2011-01-04 llundin * cpl_test_abs_complex() replaces cpl_test_abs() w. creal+cimag * cpl_test_abs_complex() tests 2011-01-04 cizzo * Added tests regarding the support of complex types * Fix wrong logic in cpl_column_pow_xxx_complex() * Added macro cpl_test_abs_complex() * Better doc to cpl_table_logarithm_column() 2011-01-03 llundin * cpl_recipedefine_{create,exec,destroy}(): Improve error message. cpl_recipedefine_create_is_ok(): Make sure to propagate any fill-error * cpl_error_set_message_() replaces cpl_error_set_message() * cpl_recipedefine_create_is_ok(): redeclare to take cpl_error_code instead of int * cpl_xmemory_resize(): Fix (gcc 4.5) const warnings 2011-01-03 cizzo * Correct writing of complex numbers to FITS, in cpl_table_save() 2011-01-03 llundin * Do not fail on missing perl 2011-01-03 cizzo * Fix wrong memory handling with complex types in cpl_table_save() * Fix wrong type check in cpl_column_fill_double_complex() cpl-6.6.1/html/0000755000460300003120000000000012553662441010250 500000000000000cpl-6.6.1/html/functions_vars.html0000644000460300003120000001062112553662441014121 00000000000000 Common Pipeline Library Reference Manual: Class Members - Variables
Common Pipeline Library Reference Manual  6.6.1
 
cpl-6.6.1/html/arrowright.png0000644000460300003120000000034512553662426013073 00000000000000‰PNG  IHDRɪ|¬IDATxí=QF‘Ø¥D«ÔkÄ:‰F©PK؃=V@§Õ³ Õ8SHxñÌ0bnrróŠ{ò½¿¾’$ ÀÏTŠP  ö¼X¬OÛd6êìòð"°²S´±O¥B€(¡àQé)š+YĈ ÒªËRÉÐ>VtÉsˆm9(ê„䜥k‚-@ȧ-Ü$ó b Ò[he ¿Kp-ôl|CùÿApRG'rÍ­aIEND®B`‚cpl-6.6.1/html/group__cpl__frame.html0000644000460300003120000020170212553662432014522 00000000000000 Common Pipeline Library Reference Manual: Frames
Common Pipeline Library Reference Manual  6.6.1

Macros

#define CPL_FRAME_GROUP_CALIB_ID   "CALIB"
 Frame group tag for calibration data. More...
 
#define CPL_FRAME_GROUP_PRODUCT_ID   "PRODUCT"
 Frame group tag for processed data. More...
 
#define CPL_FRAME_GROUP_RAW_ID   "RAW"
 Frame group tag for unprocessed data. More...
 

Typedefs

typedef struct _cpl_frame_ cpl_frame
 The frame data type. More...
 
typedef int(* cpl_frame_compare_func) (const cpl_frame *self, const cpl_frame *other)
 Frame comparison function. More...
 
typedef enum _cpl_frame_group_ cpl_frame_group
 The frame group data type. More...
 
typedef enum _cpl_frame_level_ cpl_frame_level
 The frame level data type. More...
 
typedef enum _cpl_frame_type_ cpl_frame_type
 The frame type data type. More...
 

Enumerations

enum  _cpl_frame_group_ {
  CPL_FRAME_GROUP_NONE,
  CPL_FRAME_GROUP_RAW,
  CPL_FRAME_GROUP_CALIB,
  CPL_FRAME_GROUP_PRODUCT
}
 Supported frame groups. More...
 
enum  _cpl_frame_level_ {
  CPL_FRAME_LEVEL_NONE,
  CPL_FRAME_LEVEL_TEMPORARY,
  CPL_FRAME_LEVEL_INTERMEDIATE,
  CPL_FRAME_LEVEL_FINAL
}
 Supported frame processing levels. More...
 
enum  _cpl_frame_type_ {
  CPL_FRAME_TYPE_NONE,
  CPL_FRAME_TYPE_IMAGE,
  CPL_FRAME_TYPE_MATRIX,
  CPL_FRAME_TYPE_TABLE,
  CPL_FRAME_TYPE_PAF,
  CPL_FRAME_TYPE_ANY
}
 Supported frame types. More...
 

Functions

void cpl_frame_delete (cpl_frame *self)
 Destroy a frame. More...
 
void cpl_frame_dump (const cpl_frame *frame, FILE *stream)
 Dump the frame debugging information to the given stream. More...
 
cpl_framecpl_frame_duplicate (const cpl_frame *other)
 Create a copy of a frame. More...
 
const char * cpl_frame_get_filename (const cpl_frame *self)
 Get the file name to which a frame refers. More...
 
cpl_frame_group cpl_frame_get_group (const cpl_frame *self)
 Get the current group of a frame. More...
 
cpl_frame_level cpl_frame_get_level (const cpl_frame *self)
 Get the current level of a frame. More...
 
cpl_size cpl_frame_get_nextensions (const cpl_frame *self)
 Get the number of extensions of this frame. More...
 
const char * cpl_frame_get_tag (const cpl_frame *self)
 Get the category tag of a frame. More...
 
cpl_frame_type cpl_frame_get_type (const cpl_frame *self)
 Get the type of a frame. More...
 
cpl_framecpl_frame_new (void)
 Create a new, empty frame. More...
 
cpl_error_code cpl_frame_set_filename (cpl_frame *self, const char *filename)
 Set the file name to which a frame refers. More...
 
cpl_error_code cpl_frame_set_group (cpl_frame *self, cpl_frame_group group)
 Set the group attribute of a frame. More...
 
cpl_error_code cpl_frame_set_level (cpl_frame *self, cpl_frame_level level)
 Set the level attribute of a frame. More...
 
cpl_error_code cpl_frame_set_tag (cpl_frame *self, const char *tag)
 Set a frame's category tag. More...
 
cpl_error_code cpl_frame_set_type (cpl_frame *self, cpl_frame_type type)
 Set the type of a frame. More...
 

Detailed Description

This module implements the cpl_frame type. A frame is a container for descriptive attributes related to a data file. The attributes are related to a data file through the file name member of the frame type. Among the attributes which may be assigned to a data file is an attribute identifying the type of the data stored in the file (image or table data), a classification tag indicating the kind of data the file contains and an attribute denoting to which group the data file belongs (raw, processed or calibration file). For processed data a processing level indicates whether the product is an temporary, intermediate or final product.

Synopsis:
#include <cpl_frame.h>

Macro Definition Documentation

#define CPL_FRAME_GROUP_CALIB_ID   "CALIB"

Frame group tag for calibration data.

#define CPL_FRAME_GROUP_PRODUCT_ID   "PRODUCT"

Frame group tag for processed data.

#define CPL_FRAME_GROUP_RAW_ID   "RAW"

Frame group tag for unprocessed data.

Typedef Documentation

typedef struct _cpl_frame_ cpl_frame

The frame data type.

typedef int(* cpl_frame_compare_func) (const cpl_frame *self, const cpl_frame *other)

Frame comparison function.

Type definition for functions which compares the frame other with the frame self.

All function of this type must return -1, 0, or 1 if self is considered to be less than, equal or greater than other respectively.

The frame group data type.

The frame level data type.

The frame type data type.

Enumeration Type Documentation

Supported frame groups.

Defines the possible values for the frame's group attribute.

Enumerator
CPL_FRAME_GROUP_NONE 

The frame does not belong to any supported group.

CPL_FRAME_GROUP_RAW 

The frame is associated to unprocessed data.

CPL_FRAME_GROUP_CALIB 

The frame is associated to calibration data.

CPL_FRAME_GROUP_PRODUCT 

The frame is associated to processed data.

Supported frame processing levels.

Note
The processing levels are just flags and it is left to the application to trigger the appropriate action for the different levels.
Enumerator
CPL_FRAME_LEVEL_NONE 

Undefined processing level

CPL_FRAME_LEVEL_TEMPORARY 

Temporary product. The corresponding file will be deleted when the processing chain is completed.

CPL_FRAME_LEVEL_INTERMEDIATE 

Intermediate product. The corresponding file is only kept on request. The default is to delete these products at the end of the processing chain.

CPL_FRAME_LEVEL_FINAL 

Final data product, which is always written to a file at the end of the processing chain.

Supported frame types.

Defines the possible values for the frame's type attribute.

Enumerator
CPL_FRAME_TYPE_NONE 

Undefined frame type

CPL_FRAME_TYPE_IMAGE 

Image frame type identifier

CPL_FRAME_TYPE_MATRIX 

Matrix frame type identifier

CPL_FRAME_TYPE_TABLE 

Table frame type identifier

CPL_FRAME_TYPE_PAF 

paf frame type identifier

CPL_FRAME_TYPE_ANY 

identifier for any other type

Function Documentation

void cpl_frame_delete ( cpl_frame self)

Destroy a frame.

Parameters
selfA frame.
Returns
Nothing.

The function deallocates the memory used by the frame self. If self is NULL, nothing is done, and no error is set.

Referenced by cpl_frameset_join(), and cpl_frameset_new().

void cpl_frame_dump ( const cpl_frame frame,
FILE *  stream 
)

Dump the frame debugging information to the given stream.

Parameters
frameThe frame.
streamThe output stream to use.
Returns
Nothing.

The function dumps the contents of the frame frame to the output stream stream. If stream is NULL the function writes to the standard output. If frame is NULL the function does nothing.

References cpl_frame_get_filename(), cpl_frame_get_group(), cpl_frame_get_level(), cpl_frame_get_tag(), cpl_frame_get_type(), CPL_FRAME_GROUP_CALIB, CPL_FRAME_GROUP_PRODUCT, CPL_FRAME_GROUP_RAW, CPL_FRAME_LEVEL_FINAL, CPL_FRAME_LEVEL_INTERMEDIATE, CPL_FRAME_LEVEL_TEMPORARY, CPL_FRAME_TYPE_ANY, CPL_FRAME_TYPE_IMAGE, CPL_FRAME_TYPE_MATRIX, CPL_FRAME_TYPE_PAF, and CPL_FRAME_TYPE_TABLE.

Referenced by cpl_frameset_dump().

cpl_frame* cpl_frame_duplicate ( const cpl_frame other)

Create a copy of a frame.

Parameters
otherThe frame to copy.
Returns
The function returns a handle for the created clone. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter other is a NULL pointer.

The function creates a clone of the input frame other. All members of the input frame are copied.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_frameset_duplicate(), cpl_frameset_extract(), and cpl_frameset_join().

const char* cpl_frame_get_filename ( const cpl_frame self)

Get the file name to which a frame refers.

Parameters
selfA frame.
Returns
The file name to which the frame refers, or NULL if a file name has not been set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The frame self is not associated to a file.

The function returns the read-only name of a file associated to self. A file is associated to self by calling cpl_frame_set_filename() for self. If self is not associated to a file this function returns NULL.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header(), cpl_frame_dump(), cpl_imagelist_load_frameset(), cpl_multiframe_append_datagroup(), cpl_multiframe_append_datagroup_from_position(), cpl_multiframe_append_dataset(), cpl_multiframe_append_dataset_from_position(), and cpl_multiframe_new().

cpl_frame_group cpl_frame_get_group ( const cpl_frame self)

Get the current group of a frame.

Parameters
selfA frame.
Returns
The frame's current group. The function returns CPL_FRAME_GROUP_NONE if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the group attribute of the frame self.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and CPL_FRAME_GROUP_NONE.

Referenced by cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), and cpl_frame_dump().

cpl_frame_level cpl_frame_get_level ( const cpl_frame self)

Get the current level of a frame.

Parameters
selfA frame.
Returns
The frame's current level. The function returns CPL_FRAME_LEVEL_NONE if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the level attribute of the frame self.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and CPL_FRAME_LEVEL_NONE.

Referenced by cpl_frame_dump().

cpl_size cpl_frame_get_nextensions ( const cpl_frame self)

Get the number of extensions of this frame.

Parameters
selfA frame.
Returns
The number of extensions in the file
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The frame self is not associated to a file.

The function returns the number of extensions in the frame or -1 in case of error.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_fits_count_extensions().

const char* cpl_frame_get_tag ( const cpl_frame self)

Get the category tag of a frame.

Parameters
selfA frame.
Returns
The frame's category tag or NULL if the tag is not set. The function returns NULL if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the read-only frame's category tag. If a tag has not yet been set a NULL pointer is returned.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header(), cpl_frame_dump(), cpl_frameset_duplicate(), cpl_frameset_erase_frame(), and cpl_frameset_insert().

cpl_frame_type cpl_frame_get_type ( const cpl_frame self)

Get the type of a frame.

Parameters
selfA frame.
Returns
The frame's type. The returns CPL_FRAME_TYPE_NONE if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the type of the data object to which it currently refers.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and CPL_FRAME_TYPE_NONE.

Referenced by cpl_frame_dump().

cpl_frame* cpl_frame_new ( void  )

Create a new, empty frame.

Returns
A handle for the newly created frame.

The function allocates the memory for the new frame and initializes it to an empty frame, i.e. it is created without tag and file information, and the type, group and level set to CPL_FRAME_TYPE_NONE, CPL_FRAME_GROUP_NONE, and CPL_FRAME_LEVEL_NONE, respectively.

References CPL_FRAME_GROUP_NONE, CPL_FRAME_LEVEL_NONE, and CPL_FRAME_TYPE_NONE.

cpl_error_code cpl_frame_set_filename ( cpl_frame self,
const char *  filename 
)

Set the file name to which a frame refers.

Parameters
selfA frame.
filenameThe new file name.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or filename is a NULL pointer.

The function sets the name of the file, to which the frame self refers. Any file name which was previously set by a call to this function is replaced. If no file name is present yet it is created and initialised to filename.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_frame_set_group ( cpl_frame self,
cpl_frame_group  group 
)

Set the group attribute of a frame.

Parameters
selfA frame.
groupNew group attribute.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function sets the group attribute of the frame self to group.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_frame_set_level ( cpl_frame self,
cpl_frame_level  level 
)

Set the level attribute of a frame.

Parameters
selfA frame.
levelNew level attribute.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function sets the level attribute of the frame self to level.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_frame_set_tag ( cpl_frame self,
const char *  tag 
)

Set a frame's category tag.

Parameters
selfA frame.
tagThe new category tag.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.

The function sets the category tag of self, replacing any previously set tag. If the frame does not yet have a tag is is created and initialised to tag.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_frame_set_type ( cpl_frame self,
cpl_frame_type  type 
)

Set the type of a frame.

Parameters
selfA frame.
typeNew frame type.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function sets the type of the frame self to type.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl-6.6.1/html/group__cpl__apertures.html0000644000460300003120000035614512553662432015456 00000000000000 Common Pipeline Library Reference Manual: High level functions to handle apertures
Common Pipeline Library Reference Manual  6.6.1
High level functions to handle apertures

Functions

void cpl_apertures_delete (cpl_apertures *self)
 Destructor for cpl_apertures. More...
 
void cpl_apertures_dump (const cpl_apertures *self, FILE *fp)
 Dump a cpl_apertures to an opened file pointer. More...
 
cpl_apertures * cpl_apertures_extract (const cpl_image *self, const cpl_vector *sigmas, cpl_size *pisigma)
 Simple detection of apertures in an image. More...
 
cpl_apertures * cpl_apertures_extract_mask (const cpl_image *self, const cpl_mask *selection)
 Simple apertures creation from a user supplied selection mask. More...
 
cpl_apertures * cpl_apertures_extract_sigma (const cpl_image *self, double sigma)
 Simple apertures detection in an image using a provided sigma. More...
 
cpl_apertures * cpl_apertures_extract_window (const cpl_image *self, const cpl_vector *sigmas, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, cpl_size *pisigma)
 Simple detection of apertures in an image window. More...
 
cpl_size cpl_apertures_get_bottom (const cpl_apertures *self, cpl_size ind)
 Get the bottommost y position in an aperture. More...
 
cpl_size cpl_apertures_get_bottom_x (const cpl_apertures *self, cpl_size ind)
 Get the x position of the bottommost y position in an aperture. More...
 
double cpl_apertures_get_centroid_x (const cpl_apertures *self, cpl_size ind)
 Get the X-centroid of an aperture. More...
 
double cpl_apertures_get_centroid_y (const cpl_apertures *self, cpl_size ind)
 Get the Y-centroid of an aperture. More...
 
double cpl_apertures_get_flux (const cpl_apertures *self, cpl_size ind)
 Get the flux of an aperture. More...
 
cpl_bivector * cpl_apertures_get_fwhm (const cpl_image *self, const cpl_apertures *aperts)
 Compute FWHM values in x and y for a list of apertures. More...
 
cpl_size cpl_apertures_get_left (const cpl_apertures *self, cpl_size ind)
 Get the leftmost x position in an aperture. More...
 
cpl_size cpl_apertures_get_left_y (const cpl_apertures *self, cpl_size ind)
 Get the y position of the leftmost x position in an aperture. More...
 
double cpl_apertures_get_max (const cpl_apertures *self, cpl_size ind)
 Get the maximum value of an aperture. More...
 
double cpl_apertures_get_max_x (const cpl_apertures *self, cpl_size ind)
 Get the average X-position of an aperture. More...
 
double cpl_apertures_get_max_y (const cpl_apertures *self, cpl_size ind)
 Get the average Y-position of an aperture. More...
 
cpl_size cpl_apertures_get_maxpos_x (const cpl_apertures *self, cpl_size ind)
 Get the X-position of the aperture maximum value. More...
 
cpl_size cpl_apertures_get_maxpos_y (const cpl_apertures *self, cpl_size ind)
 Get the Y-position of the aperture maximum value. More...
 
double cpl_apertures_get_mean (const cpl_apertures *self, cpl_size ind)
 Get the mean value of an aperture. More...
 
double cpl_apertures_get_median (const cpl_apertures *self, cpl_size ind)
 Get the median value of an aperture. More...
 
double cpl_apertures_get_min (const cpl_apertures *self, cpl_size ind)
 Get the minimum value of an aperture. More...
 
cpl_size cpl_apertures_get_minpos_x (const cpl_apertures *self, cpl_size ind)
 Get the X-position of the aperture minimum value. More...
 
cpl_size cpl_apertures_get_minpos_y (const cpl_apertures *self, cpl_size ind)
 Get the Y-position of the aperture minimum value. More...
 
cpl_size cpl_apertures_get_npix (const cpl_apertures *self, cpl_size ind)
 Get the number of pixels of an aperture. More...
 
double cpl_apertures_get_pos_x (const cpl_apertures *self, cpl_size ind)
 Get the average X-position of an aperture. More...
 
double cpl_apertures_get_pos_y (const cpl_apertures *self, cpl_size ind)
 Get the average Y-position of an aperture. More...
 
cpl_size cpl_apertures_get_right (const cpl_apertures *self, cpl_size ind)
 Get the rightmost x position in an aperture. More...
 
cpl_size cpl_apertures_get_right_y (const cpl_apertures *self, cpl_size ind)
 Get the y position of the rightmost x position in an aperture. More...
 
cpl_size cpl_apertures_get_size (const cpl_apertures *self)
 Get the number of apertures. More...
 
double cpl_apertures_get_stdev (const cpl_apertures *self, cpl_size ind)
 Get the standard deviation of an aperture. More...
 
cpl_size cpl_apertures_get_top (const cpl_apertures *self, cpl_size ind)
 Get the topmost y position in an aperture. More...
 
cpl_size cpl_apertures_get_top_x (const cpl_apertures *self, cpl_size ind)
 Get the x position of the topmost y position in an aperture. More...
 
cpl_apertures * cpl_apertures_new_from_image (const cpl_image *self, const cpl_image *lab)
 Compute statistics on selected apertures. More...
 
cpl_error_code cpl_apertures_sort_by_flux (cpl_apertures *self)
 Sort by decreasing aperture flux. More...
 
cpl_error_code cpl_apertures_sort_by_max (cpl_apertures *self)
 Sort by decreasing aperture peak value. More...
 
cpl_error_code cpl_apertures_sort_by_npix (cpl_apertures *self)
 Sort by decreasing aperture size. More...
 

Detailed Description

The aperture object contains a list of zones in an image. It is typically used to contain the results of an objects detection, or if one wants to work on a very specific zone in an image.

This module provides functions to handle cpl_apertures.

Function Documentation

void cpl_apertures_delete ( cpl_apertures *  self)

Destructor for cpl_apertures.

Parameters
selfThe object to delete.
Returns
void
Note
If self is NULL, nothing is done and no error is set.

This function deallocates all memory allocated for the object.

References cpl_free().

Referenced by cpl_apertures_new_from_image(), cpl_apertures_sort_by_flux(), cpl_apertures_sort_by_max(), cpl_apertures_sort_by_npix(), and cpl_geom_img_offset_combine().

void cpl_apertures_dump ( const cpl_apertures *  self,
FILE *  fp 
)

Dump a cpl_apertures to an opened file pointer.

Parameters
selfThe cpl_apertures to dump
fpFile pointer, may use stdout or stderr
Returns
void

This function dumps all information in a cpl_apertures to the passed file pointer. If the object is unallocated or contains nothing, this function does nothing.

References CPL_SIZE_FORMAT.

cpl_apertures* cpl_apertures_extract ( const cpl_image *  self,
const cpl_vector *  sigmas,
cpl_size pisigma 
)

Simple detection of apertures in an image.

Parameters
selfThe image to process
sigmasPositive, decreasing sigmas to apply
pisigmaIndex of the sigma that was used or unchanged on error
Returns
The detected apertures or NULL on error
See also
cpl_apertures_extract_sigma()

pisigma may be NULL.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if self or sigmas is NULL
  • CPL_ERROR_DATA_NOT_FOUND if the apertures cannot be detected

References cpl_apertures_extract_sigma(), cpl_ensure, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_set(), cpl_vector_get(), and cpl_vector_get_size().

Referenced by cpl_apertures_extract_window(), and cpl_geom_img_offset_combine().

cpl_apertures* cpl_apertures_extract_mask ( const cpl_image *  self,
const cpl_mask *  selection 
)

Simple apertures creation from a user supplied selection mask.

Parameters
selfThe image to process
selectionThe mask of selected pixels
Returns
The list of detected apertures or NULL if nothing detected or on error.
See also
cpl_image_labelise_mask_create(), cpl_apertures_new_from_image()

The values selected for inclusion in the apertures must have the non-zero value in the selection mask, and must not be flagged as bad in the bad pixel map of the image.

The input image type can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT or CPL_TYPE_INT.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if self and selection have different sizes.
  • CPL_ERROR_TYPE_MISMATCH if self is of a complex type
  • CPL_ERROR_DATA_NOT_FOUND if the selection mask is empty

References cpl_apertures_new_from_image(), CPL_ERROR_DATA_NOT_FOUND, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_image_delete(), and cpl_image_labelise_mask_create().

Referenced by cpl_apertures_extract_sigma().

cpl_apertures* cpl_apertures_extract_sigma ( const cpl_image *  self,
double  sigma 
)

Simple apertures detection in an image using a provided sigma.

Parameters
selfThe image to process
sigmaDetection level
Returns
The list of detected apertures or NULL on error
Note
In order to avoid (the potentially many) detections of small objects the mask of detected pixels is subjected to a 3x3 morphological opening filter.
See also
cpl_apertures_extract_mask(), cpl_mask_filter()

The threshold used for the detection is the median plus the average distance to the median times sigma.

The input image type can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT or CPL_TYPE_INT.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if sigma is non-positive
  • CPL_ERROR_TYPE_MISMATCH if self is of a complex type
  • CPL_ERROR_DATA_NOT_FOUND if the no apertures are found

References cpl_apertures_extract_mask(), CPL_BORDER_ZERO, cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_FILTER_OPENING, cpl_image_get_median_dev(), cpl_mask_delete(), cpl_mask_filter(), cpl_mask_new(), cpl_mask_not(), and cpl_mask_threshold_image_create().

Referenced by cpl_apertures_extract().

cpl_apertures* cpl_apertures_extract_window ( const cpl_image *  self,
const cpl_vector *  sigmas,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
cpl_size pisigma 
)

Simple detection of apertures in an image window.

Parameters
selfThe image to process
sigmasPositive, decreasing sigmas to apply
llxLower left x position (FITS convention)
llyLower left y position (FITS convention)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
pisigmaIndex of the sigma that was used or undefined on error
Returns
The list of detected apertures or NULL on error
See also
cpl_apertures_extract()
cpl_image_extract()

References cpl_apertures_extract(), cpl_ensure, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, cpl_image_delete(), and cpl_image_extract().

cpl_size cpl_apertures_get_bottom ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the bottommost y position in an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
the bottommost y position in the aperture or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_bottom_x ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the x position of the bottommost y position in an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
the bottommost x position of the aperture or negative on error
Note
An aperture may have multiple bottom x positions, in which case one of these is returned.
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_centroid_x ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the X-centroid of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The X-centroid position of the aperture or negative on error
Note
In case of an error the _cpl_error_code_ code is set

For a concave aperture the centroid may not belong to the aperture.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is non-positive
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if ind exceeds the number of apertures in self

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_centroid_y ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the Y-centroid of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The X-centroid position of the aperture or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_centroid_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_flux ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the flux of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The flux of the aperture or undefined on error
See also
cpl_apertures_get_max()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_bivector* cpl_apertures_get_fwhm ( const cpl_image *  self,
const cpl_apertures *  aperts 
)

Compute FWHM values in x and y for a list of apertures.

Parameters
selfThe image to process
apertsThe list of apertures
Returns
A newly allocated object containing the fwhms in x and y or NULL
See also
cpl_image_get_fwhm()
Deprecated:
Replace this call with a loop over cpl_image_get_fwhm()

References cpl_apertures_get_pos_x(), cpl_apertures_get_pos_y(), cpl_apertures_get_size(), cpl_bivector_delete(), cpl_bivector_get_x_data(), cpl_bivector_get_y_data(), cpl_bivector_new(), cpl_ensure, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_set(), and cpl_image_get_fwhm().

cpl_size cpl_apertures_get_left ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the leftmost x position in an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
the leftmost x position of the aperture or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_left_y ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the y position of the leftmost x position in an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
the y position of the leftmost x position or negative on error
Note
An aperture may have multiple leftmost x positions, in which case one of these is returned.
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_max ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the maximum value of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The maximum value of the aperture or undefined on error
Note
In case of an error the _cpl_error_code_ code is set

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is non-positive
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if ind exceeds the number of apertures in self

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_max_x ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the average X-position of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The average X-position of the aperture or negative on error
Deprecated:
Replace this function with cpl_apertures_get_pos_x()

References cpl_apertures_get_pos_x().

double cpl_apertures_get_max_y ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the average Y-position of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The average Y-position of the aperture or negative on error
Deprecated:
Replace this function with cpl_apertures_get_pos_y()

References cpl_apertures_get_pos_y().

cpl_size cpl_apertures_get_maxpos_x ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the X-position of the aperture maximum value.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The X-position of the aperture maximum value or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_centroid_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_maxpos_y ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the Y-position of the aperture maximum value.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The Y-position of the aperture maximum value or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_mean ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the mean value of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The mean value of the aperture or undefined on error
See also
cpl_apertures_get_max()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_median ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the median value of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The median value of the aperture or undefined on error
See also
cpl_apertures_get_max()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_min ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the minimum value of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The minimum value of the aperture or undefined on error
See also
cpl_apertures_get_max()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_minpos_x ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the X-position of the aperture minimum value.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The X-position of the aperture minimum value or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_minpos_y ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the Y-position of the aperture minimum value.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The Y-position of the aperture minimum value or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_minpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_npix ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the number of pixels of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The number of pixels of the aperture or negative on error
Note
In case of an error the _cpl_error_code_ code is set

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is non-positive
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if ind exceeds the number of apertures in self

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

double cpl_apertures_get_pos_x ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the average X-position of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The average X-position of the aperture or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_centroid_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_apertures_get_fwhm(), cpl_apertures_get_max_x(), and cpl_geom_img_offset_combine().

double cpl_apertures_get_pos_y ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the average Y-position of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The average Y-position of the aperture or negative on error
See also
cpl_apertures_get_pos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_apertures_get_fwhm(), cpl_apertures_get_max_y(), and cpl_geom_img_offset_combine().

cpl_size cpl_apertures_get_right ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the rightmost x position in an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
the rightmost x position in an aperture or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_right_y ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the y position of the rightmost x position in an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
the y position of the rightmost x position or negative on error
Note
An aperture may have multiple rightmost x positions, in which case one of these is returned.
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_size ( const cpl_apertures *  self)

Get the number of apertures.

Parameters
selfThe cpl_apertures object
Returns
The number of apertures or -1 on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_apertures_get_fwhm().

double cpl_apertures_get_stdev ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the standard deviation of an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
The standard deviation of the aperture or negative on error
See also
cpl_apertures_get_max()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ind is non-positive
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if ind exceeds the number of apertures in self
  • CPL_ERROR_DATA_NOT_FOUND if the aperture comprises less than two pixels

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_top ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the topmost y position in an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
the topmost y position in the aperture or negative on error
Note
In case of an error the _cpl_error_code_ code is set
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_apertures_get_top_x ( const cpl_apertures *  self,
cpl_size  ind 
)

Get the x position of the topmost y position in an aperture.

Parameters
selfThe cpl_apertures object
indThe aperture index (1 for the first one)
Returns
the x position of the topmost y position or negative on error
Note
An aperture may have multiple topmost x positions, in which case one of these is returned.
See also
cpl_apertures_get_maxpos_x()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

cpl_apertures* cpl_apertures_new_from_image ( const cpl_image *  self,
const cpl_image *  lab 
)

Compute statistics on selected apertures.

Parameters
selfReference image
labLabelized image (of type CPL_TYPE_INT)
Returns
An CPL apertures object or NULL on error
Note
The returned object must be deleted using cpl_apertures_delete().
See also
cpl_image_labelise_mask_create()

The labelized image must contain at least one pixel for each value from 1 to the maximum value in the image.

For the centroiding computation of an aperture, if some pixels have values lower or equal to 0, all the values of the aperture are locally shifted such as the minimum value of the aperture has a value of epsilon. The centroid is then computed on these positive values. In principle, centroid should always be computed on positive values, this is done to avoid raising an error in case the caller of the function wants to use it on negative values images without caring about the centroid results. In such cases, the centroid result would be meaningful, but slightly depend on the hardcoded value chosen for epsilon (1e-10).

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_TYPE_MISMATCH if lab is not of type CPL_TYPE_INT or if self is of a complex type
  • CPL_ERROR_ILLEGAL_INPUT if lab has a negative value or zero maximum
  • CPL_ERROR_INCOMPATIBLE_INPUT if lab and self have different sizes.
  • CPL_ERROR_DATA_NOT_FOUND if one of the lab values is missing.

References cpl_apertures_delete(), cpl_calloc(), cpl_ensure, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_free(), cpl_image_cast(), cpl_image_delete(), cpl_image_duplicate(), cpl_image_fill_rejected(), cpl_image_get_bpm_const(), cpl_image_get_data_double_const(), cpl_image_get_data_int_const(), cpl_image_get_max(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_image_reject_from_mask(), cpl_malloc(), cpl_mask_is_empty(), CPL_TYPE_DOUBLE, and CPL_TYPE_INT.

Referenced by cpl_apertures_extract_mask().

cpl_error_code cpl_apertures_sort_by_flux ( cpl_apertures *  self)

Sort by decreasing aperture flux.

Parameters
selfApertures to sort (MODIFIED)
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_apertures_sort_by_npix()

References cpl_apertures_delete(), cpl_calloc(), cpl_ensure_code, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

cpl_error_code cpl_apertures_sort_by_max ( cpl_apertures *  self)

Sort by decreasing aperture peak value.

Parameters
selfApertures to sort (MODIFIED)
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_apertures_sort_by_npix()

References cpl_apertures_delete(), cpl_calloc(), cpl_ensure_code, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

cpl_error_code cpl_apertures_sort_by_npix ( cpl_apertures *  self)

Sort by decreasing aperture size.

Parameters
selfApertures to sort (MODIFIED)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_apertures_delete(), cpl_calloc(), cpl_ensure_code, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

Referenced by cpl_geom_img_offset_combine().

cpl-6.6.1/html/form_7.png0000644000460300003120000000040512553662434012070 00000000000000‰PNG  IHDR8q¤d0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïtIDATxí ! '$\]Žÿÿ¶Tì²­¨Ô>a$Ç1VøÀ_¤°€o-zë¦kðIŽÕÚÍSY…z…¬Œ•Ì—£±¯ú€œ~W´]~uø34Ö9{d4@ŠŸ~ŒRĵ׬!¾º]ûñS€/8€_<goh°ºIEND®B`‚cpl-6.6.1/html/group__cpl__errorstate.html0000644000460300003120000013707512553662431015634 00000000000000 Common Pipeline Library Reference Manual: Handling of multiple CPL errors
Common Pipeline Library Reference Manual  6.6.1
Handling of multiple CPL errors

Functions

void cpl_errorstate_dump (cpl_errorstate self, cpl_boolean reverse, void(*dump_one)(unsigned, unsigned, unsigned))
 Dump the CPL error state. More...
 
void cpl_errorstate_dump_one (unsigned self, unsigned first, unsigned last)
 Dump a single CPL error. More...
 
void cpl_errorstate_dump_one_debug (unsigned self, unsigned first, unsigned last)
 Dump a single CPL error using cpl_msg_debug() More...
 
void cpl_errorstate_dump_one_info (unsigned self, unsigned first, unsigned last)
 Dump a single CPL error using cpl_msg_info() More...
 
void cpl_errorstate_dump_one_warning (unsigned self, unsigned first, unsigned last)
 Dump a single CPL error using cpl_msg_warning() More...
 
cpl_errorstate cpl_errorstate_get (void)
 Get the CPL errorstate. More...
 
cpl_boolean cpl_errorstate_is_equal (cpl_errorstate self)
 Detect a change in the CPL error state. More...
 
void cpl_errorstate_set (cpl_errorstate self)
 Set the CPL errorstate. More...
 

Detailed Description

This module provides functions for error detection and recovery and for producing an error traceback.

It is built on top of the cpl_error module.

Synopsis:
#include <cpl_errorstate.h>

Function Documentation

void cpl_errorstate_dump ( cpl_errorstate  self,
cpl_boolean  reverse,
void(*)(unsigned, unsigned, unsigned)  dump_one 
)

Dump the CPL error state.

Parameters
selfDump errors more recent than self
reverseReverse the chronological order of the dump
dump_oneFunction that dumps a single CPL error, or NULL
Returns
void
Note
dump_one may be NULL, in that case cpl_errorstate_dump_one() is called. If there are no CPL errors to be dumped, (*dump_one)() is called once with all zeros, which allows the dump-function to report that there are no errors to dump. During calls to (*dump_one)() the CPL error system has been put into a special read-only mode that prevents any change of the CPL error state. This means that any calls from (*dump_one)() to cpl_error_reset(), cpl_error_set(), cpl_error_set_where() and cpl_errorstate_set() have no effect. Also calls from (*dump_one)() to cpl_errorstate_dump() have no effect.
See also
cpl_errorstate_dump_one

CPL-based code with insufficient error checking can generate a large number of CPL errors. To avoid that a subsequent call to cpl_errorstate_dump() will fill up the output device, calls to the dump-function are skipped and only counted and the count reported when dump_one is NULL and the CPL error code is CPL_ERROR_HISTORY_LOST.

Example of usage:

1 cpl_errorstate prev_state = cpl_errorstate_get();
2 
3 // Call one or more CPL functions
4 
5 if (cpl_errorstate_is_equal(prev_state)) {
6  // No error happened
7 } else {
8  // One or more errors happened
9 
10  // Dump the error(s) in chronological order
11  cpl_errorstate_dump(prev_state, CPL_FALSE,
12  cpl_errorstate_dump_one);
13 
14  // Recover from the error(s)
15  cpl_errorstate_set(prev_state);
16 }

References cpl_error_get_code(), CPL_ERROR_HISTORY_LOST, cpl_errorstate_dump_one(), and cpl_msg_error().

Referenced by cpl_test_end(), and cpl_wlcalib_find_best_1d().

void cpl_errorstate_dump_one ( unsigned  self,
unsigned  first,
unsigned  last 
)

Dump a single CPL error.

Parameters
selfThe number of the current error to be dumped
firstThe number of the first error to be dumped
lastThe number of the last error to be dumped
Returns
void
Note
This function is implemented using only exported CPL functions.
See also
cpl_errorstate_dump

This function will dump a single CPL error, using the CPL error accessor functions. The error is numbered with the value of self.

The actual output is produced by cpl_msg_error().

first and last are provided in the API to allow for special messaging in the dump of the first and last errors.

Alternative functions for use with cpl_errorstate_dump() may use all accessor functions of the CPL error module and those functions of the CPL message module that produce messages. Additionally, the indentation functions of the CPL message module may be used, provided that the indentation is set back to its original state after the last error has been processed.

References cpl_msg_error().

Referenced by cpl_errorstate_dump().

void cpl_errorstate_dump_one_debug ( unsigned  self,
unsigned  first,
unsigned  last 
)

Dump a single CPL error using cpl_msg_debug()

Parameters
selfThe number of the current error to be dumped
firstThe number of the first error to be dumped
lastThe number of the last error to be dumped
Returns
void
See also
cpl_errorstate_dump_one, cpl_msg_debug()

References cpl_msg_debug().

Referenced by cpl_wlcalib_find_best_1d().

void cpl_errorstate_dump_one_info ( unsigned  self,
unsigned  first,
unsigned  last 
)

Dump a single CPL error using cpl_msg_info()

Parameters
selfThe number of the current error to be dumped
firstThe number of the first error to be dumped
lastThe number of the last error to be dumped
Returns
void
See also
cpl_errorstate_dump_one, cpl_msg_info()

References cpl_msg_info().

void cpl_errorstate_dump_one_warning ( unsigned  self,
unsigned  first,
unsigned  last 
)

Dump a single CPL error using cpl_msg_warning()

Parameters
selfThe number of the current error to be dumped
firstThe number of the first error to be dumped
lastThe number of the last error to be dumped
Returns
void
See also
cpl_errorstate_dump_one, cpl_msg_warning()

References cpl_msg_warning().

cpl_errorstate cpl_errorstate_get ( void  )

Get the CPL errorstate.

Returns
The CPL errorstate
Note
The caller should not modify the returned value nor transfer it to another function/scope.

Example of usage:

1 cpl_errorstate prev_state = cpl_errorstate_get();
2 
3 // (Call one or more CPL functions here)
4 
5 if (cpl_errorstate_is_equal(prev_state)) {
6  // No error happened
7 } else {
8  // One or more errors happened
9 
10  // Recover from the error(s)
11  cpl_errorstate_set(prev_state);
12 }

Referenced by cpl_apertures_extract(), cpl_apertures_extract_mask(), cpl_apertures_get_fwhm(), cpl_array_get(), cpl_array_get_complex(), cpl_array_get_cplsize(), cpl_array_get_data_cplsize(), cpl_array_get_data_double(), cpl_array_get_data_double_complex(), cpl_array_get_data_float(), cpl_array_get_data_float_complex(), cpl_array_get_data_int(), cpl_array_get_data_long(), cpl_array_get_data_long_long(), cpl_array_get_data_string(), cpl_array_get_double(), cpl_array_get_double_complex(), cpl_array_get_float(), cpl_array_get_float_complex(), cpl_array_get_int(), cpl_array_get_long(), cpl_array_get_long_long(), cpl_array_get_max(), cpl_array_get_mean(), cpl_array_get_mean_complex(), cpl_array_get_median(), cpl_array_get_min(), cpl_array_get_stdev(), cpl_array_is_valid(), cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), cpl_fit_image_gaussian(), cpl_flux_get_noise_ring(), cpl_frameset_dump(), cpl_frameset_extract(), cpl_frameset_find(), cpl_frameset_labelise(), cpl_gaussian_eval_2d(), cpl_geom_img_offset_fine(), cpl_image_get_fwhm(), cpl_imagelist_load_frameset(), cpl_matrix_get_determinant(), cpl_parameterlist_find(), cpl_parameterlist_find_context(), cpl_parameterlist_find_tag(), cpl_parameterlist_find_type(), cpl_parameterlist_get_first(), cpl_parameterlist_get_last(), cpl_parameterlist_get_next(), cpl_plot_bivectors(), cpl_plot_column(), cpl_plot_columns(), cpl_plot_image_col(), cpl_plot_image_row(), cpl_plot_vectors(), cpl_propertylist_get(), cpl_propertylist_get_bool(), cpl_propertylist_get_char(), cpl_propertylist_get_double(), cpl_propertylist_get_double_complex(), cpl_propertylist_get_float(), cpl_propertylist_get_float_complex(), cpl_propertylist_get_int(), cpl_propertylist_get_long(), cpl_propertylist_get_long_long(), cpl_propertylist_get_property(), cpl_propertylist_get_string(), cpl_table_get_column_max(), cpl_table_get_column_mean(), cpl_table_get_column_mean_complex(), cpl_table_get_column_median(), cpl_table_get_column_min(), cpl_table_get_column_stdev(), cpl_table_get_data_array(), cpl_table_get_data_double(), cpl_table_get_data_double_complex(), cpl_table_get_data_float(), cpl_table_get_data_float_complex(), cpl_table_get_data_int(), cpl_table_get_data_long(), cpl_table_get_data_long_long(), cpl_table_get_data_string(), cpl_table_has_invalid(), cpl_table_has_valid(), cpl_table_is_valid(), cpl_wcs_new_from_propertylist(), cpl_wcs_platesol(), and cpl_wlcalib_find_best_1d().

cpl_boolean cpl_errorstate_is_equal ( cpl_errorstate  self)

Detect a change in the CPL error state.

Parameters
selfThe return value of a previous call to cpl_errorstate_get()
Returns
CPL_TRUE iff the current error state is equal to self.
See also
cpl_errorstate_get

Referenced by cpl_apertures_extract_mask(), cpl_array_get(), cpl_array_get_complex(), cpl_array_get_cplsize(), cpl_array_get_data_cplsize(), cpl_array_get_data_double(), cpl_array_get_data_double_complex(), cpl_array_get_data_float(), cpl_array_get_data_float_complex(), cpl_array_get_data_int(), cpl_array_get_data_long(), cpl_array_get_data_long_long(), cpl_array_get_data_string(), cpl_array_get_double(), cpl_array_get_double_complex(), cpl_array_get_float(), cpl_array_get_float_complex(), cpl_array_get_int(), cpl_array_get_long(), cpl_array_get_long_long(), cpl_array_get_max(), cpl_array_get_mean(), cpl_array_get_mean_complex(), cpl_array_get_median(), cpl_array_get_min(), cpl_array_get_stdev(), cpl_array_is_valid(), cpl_flux_get_noise_ring(), cpl_frameset_find(), cpl_gaussian_eval_2d(), cpl_image_get_fwhm(), cpl_imagelist_load_frameset(), cpl_parameterlist_find(), cpl_parameterlist_find_context(), cpl_parameterlist_find_tag(), cpl_parameterlist_find_type(), cpl_parameterlist_get_first(), cpl_parameterlist_get_last(), cpl_parameterlist_get_next(), cpl_plot_bivectors(), cpl_plot_column(), cpl_plot_columns(), cpl_plot_image_col(), cpl_plot_image_row(), cpl_plot_vectors(), cpl_propertylist_get(), cpl_propertylist_get_bool(), cpl_propertylist_get_char(), cpl_propertylist_get_double(), cpl_propertylist_get_double_complex(), cpl_propertylist_get_float(), cpl_propertylist_get_float_complex(), cpl_propertylist_get_int(), cpl_propertylist_get_long(), cpl_propertylist_get_long_long(), cpl_propertylist_get_property(), cpl_propertylist_get_string(), cpl_table_get_column_max(), cpl_table_get_column_mean(), cpl_table_get_column_mean_complex(), cpl_table_get_column_median(), cpl_table_get_column_min(), cpl_table_get_column_stdev(), cpl_table_get_data_array(), cpl_table_get_data_double(), cpl_table_get_data_double_complex(), cpl_table_get_data_float(), cpl_table_get_data_float_complex(), cpl_table_get_data_int(), cpl_table_get_data_long(), cpl_table_get_data_long_long(), cpl_table_get_data_string(), cpl_table_has_invalid(), cpl_table_has_valid(), cpl_table_is_valid(), cpl_wcs_new_from_propertylist(), cpl_wcs_platesol(), and cpl_wlcalib_find_best_1d().

void cpl_errorstate_set ( cpl_errorstate  self)

Set the CPL errorstate.

Parameters
selfThe return value of a previous call to cpl_errorstate_get()
Returns
void
See also
cpl_errorstate_get
Note
If a CPL error was created before the call to cpl_errorstate_get() that returned self and if more than CPL_ERROR_HISTORY_SIZE CPL errors was created after that, then the accessor functions of the CPL error object (cpl_error_get_code() etc.) will return wrong values. In this case cpl_error_get_code() is still guaranteed not to return CPL_ERROR_NONE. Moreover, the default value of CPL_ERROR_HISTORY_SIZE is guaranteed to be large enough to prevent this situation from arising due to a call of a CPL function.

Referenced by cpl_apertures_extract(), cpl_apertures_get_fwhm(), cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), cpl_fit_image_gaussian(), cpl_flux_get_noise_ring(), cpl_frameset_dump(), cpl_frameset_extract(), cpl_frameset_labelise(), cpl_geom_img_offset_fine(), cpl_imagelist_load_frameset(), cpl_matrix_get_determinant(), cpl_wcs_new_from_propertylist(), and cpl_wlcalib_find_best_1d().

cpl-6.6.1/html/group__cpl__error.html0000644000460300003120000036561012553662431014571 00000000000000 Common Pipeline Library Reference Manual: Error handling
Common Pipeline Library Reference Manual  6.6.1
Error handling

Macros

#define cpl_ensure(BOOL, ERRCODE, RETURN)
 Set an error code and return iff a boolean expression is false. More...
 
#define cpl_ensure_code(BOOL, ERRCODE)
 Set an error code and return it iff a boolean expression is false. More...
 
#define cpl_error_ensure(CONDITION, CODE, ACTION, ...)
 Generic error handling macro. More...
 
#define CPL_ERROR_MAX_MESSAGE_LENGTH   256
 The maximum length of a CPL error message. More...
 
#define cpl_error_set(function, code)
 Set CPL error code, function name, source file and line number where an error occurred. More...
 
#define cpl_error_set_message(function, code, ...)
 Set CPL error code, function name, source file and line number where an error occurred along with a text message. More...
 
#define cpl_error_set_where(function)
 Propagate a CPL-error to the current location. More...
 
#define CPL_HAVE_VA_ARGS
 Flag to indicate support for variadic macros. More...
 

Typedefs

typedef enum _cpl_error_code_ cpl_error_code
 The cpl_error_code type definition. More...
 

Enumerations

enum  _cpl_error_code_ {
  CPL_ERROR_NONE = 0,
  CPL_ERROR_UNSPECIFIED = 1,
  CPL_ERROR_HISTORY_LOST,
  CPL_ERROR_DUPLICATING_STREAM,
  CPL_ERROR_ASSIGNING_STREAM,
  CPL_ERROR_FILE_IO,
  CPL_ERROR_BAD_FILE_FORMAT,
  CPL_ERROR_FILE_ALREADY_OPEN,
  CPL_ERROR_FILE_NOT_CREATED,
  CPL_ERROR_FILE_NOT_FOUND,
  CPL_ERROR_DATA_NOT_FOUND,
  CPL_ERROR_ACCESS_OUT_OF_RANGE,
  CPL_ERROR_NULL_INPUT,
  CPL_ERROR_INCOMPATIBLE_INPUT,
  CPL_ERROR_ILLEGAL_INPUT,
  CPL_ERROR_ILLEGAL_OUTPUT,
  CPL_ERROR_UNSUPPORTED_MODE,
  CPL_ERROR_SINGULAR_MATRIX,
  CPL_ERROR_DIVISION_BY_ZERO,
  CPL_ERROR_TYPE_MISMATCH,
  CPL_ERROR_INVALID_TYPE,
  CPL_ERROR_CONTINUE,
  CPL_ERROR_NO_WCS,
  CPL_ERROR_EOL
}
 Available error codes. More...
 

Functions

cpl_error_code cpl_error_get_code (void)
 Get the last cpl_error_code set. More...
 
const char * cpl_error_get_file (void)
 Get the source code file name where the last CPL error occurred. More...
 
const char * cpl_error_get_function (void)
 Get the function name where the last CPL error occurred. More...
 
unsigned cpl_error_get_line (void)
 Get the line number where the last CPL error occurred. More...
 
const char * cpl_error_get_message (void)
 Get the text message of the current CPL error. More...
 
const char * cpl_error_get_message_default (cpl_error_code code)
 Return the standard CPL error message of the current CPL error. More...
 
const char * cpl_error_get_where (void)
 Get function name, source file and line number where the last CPL error occurred. More...
 

Detailed Description

This module provides functions to maintain the cpl_error_code set by any CPL function, similarly to what is done with the errno variable of the standard C library. The following guidelines are respected:

  • If no error occurs in a CPL function the cpl_error_code will remain unchanged.
  • If an error occurs in a CPL function, a new CPL error is set, causing the cpl_error_code to be modified to the new error.

A cpl_error_code equal to the enumeration constant CPL_ERROR_NONE would indicate no error condition. Note, however, that the cpl_error_code is only set when an error occurs, and it is not reset by successful function calls. For this reason it may be appropriate in some cases to reset the cpl_error_code using the function cpl_error_reset(). The cpl_error_code set by a CPL function can be obtained by calling the function cpl_error_get_code(), but functions of type cpl_error_code would not only return this code directly, but would also return CPL_ERROR_NONE in case of success. Other CPL functions return zero on success, or a non-zero value to indicate a change of the cpl_error_code, while CPL functions returning a pointer would flag an error by returning a NULL.

To each cpl_error_code is associated a standard error message, that can be obtained by calling the function cpl_error_get_message(). Conventionally, no CPL function will ever display any error message, leaving to the caller the decision of how to handle a given error condition. A call to the function cpl_error_get_function() would return the name of the function where the error occurred, and the functions cpl_error_get_file() and cpl_error_get_line() would also return the name of the source file containing the function code, and the line number where the error occurred. The function cpl_error_get_where() would gather all this items together, in a colon-separated string.

Synopsis:
#include <cpl_error.h>

Macro Definition Documentation

#define cpl_ensure (   BOOL,
  ERRCODE,
  RETURN 
)

Set an error code and return iff a boolean expression is false.

Parameters
BOOLThe boolean to evaluate
ERRCODEThe error code to set
RETURNThe value to return
Note
This macro will cause a return from its calling function. If ERRCODE equals CPL_ERROR_NONE, the error-code is set to CPL_ERROR_UNSPECIFIED. The boolean is always evaluated (unlike assert()). This macro may not be used in inline'd functions.
See also
cpl_error_set()

Referenced by cpl_apertures_extract(), cpl_apertures_extract_sigma(), cpl_apertures_extract_window(), cpl_apertures_get_bottom(), cpl_apertures_get_bottom_x(), cpl_apertures_get_centroid_x(), cpl_apertures_get_centroid_y(), cpl_apertures_get_flux(), cpl_apertures_get_fwhm(), cpl_apertures_get_left(), cpl_apertures_get_left_y(), cpl_apertures_get_max(), cpl_apertures_get_maxpos_x(), cpl_apertures_get_maxpos_y(), cpl_apertures_get_mean(), cpl_apertures_get_median(), cpl_apertures_get_min(), cpl_apertures_get_minpos_x(), cpl_apertures_get_minpos_y(), cpl_apertures_get_npix(), cpl_apertures_get_pos_x(), cpl_apertures_get_pos_y(), cpl_apertures_get_right(), cpl_apertures_get_right_y(), cpl_apertures_get_size(), cpl_apertures_get_stdev(), cpl_apertures_get_top(), cpl_apertures_get_top_x(), cpl_apertures_new_from_image(), cpl_bivector_duplicate(), cpl_bivector_get_size(), cpl_bivector_get_x(), cpl_bivector_get_x_const(), cpl_bivector_get_x_data(), cpl_bivector_get_x_data_const(), cpl_bivector_get_y(), cpl_bivector_get_y_const(), cpl_bivector_get_y_data(), cpl_bivector_get_y_data_const(), cpl_bivector_new(), cpl_bivector_read(), cpl_bivector_wrap_vectors(), cpl_fit_imagelist_polynomial_window(), cpl_fits_count_extensions(), cpl_fits_find_extension(), cpl_frameset_extract(), cpl_frameset_labelise(), cpl_geom_img_offset_combine(), cpl_geom_img_offset_fine(), cpl_geom_img_offset_saa(), cpl_image_abs_create(), cpl_image_add_scalar_create(), cpl_image_average_create(), cpl_image_cast(), cpl_image_collapse_create(), cpl_image_collapse_median_create(), cpl_image_count_rejected(), cpl_image_divide_create(), cpl_image_divide_scalar_create(), cpl_image_duplicate(), cpl_image_exponential_create(), cpl_image_extract(), cpl_image_extract_subsample(), cpl_image_fill_test_create(), cpl_image_filter_linear(), cpl_image_filter_median(), cpl_image_filter_morpho(), cpl_image_filter_stdev(), cpl_image_get(), cpl_image_get_bpm(), cpl_image_get_bpm_const(), cpl_image_get_complex(), cpl_image_get_data(), cpl_image_get_data_const(), cpl_image_get_flux(), cpl_image_get_interpolated(), cpl_image_get_mad(), cpl_image_get_mad_window(), cpl_image_get_median_dev(), cpl_image_get_median_dev_window(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_image_iqe(), cpl_image_is_rejected(), cpl_image_labelise_mask_create(), cpl_image_logarithm_create(), cpl_image_multiply_scalar_create(), cpl_image_new_from_accepted(), cpl_image_new_from_mask(), cpl_image_normalise_create(), cpl_image_power_create(), cpl_image_rebin(), cpl_image_set_bpm(), cpl_image_subtract_scalar_create(), cpl_image_unset_bpm(), cpl_image_warp_polynomial(), cpl_image_wrap_double(), cpl_image_wrap_double_complex(), cpl_image_wrap_float(), cpl_image_wrap_float_complex(), cpl_image_wrap_int(), cpl_imagelist_collapse_create(), cpl_imagelist_collapse_median_create(), cpl_imagelist_collapse_minmax_create(), cpl_imagelist_collapse_sigclip_create(), cpl_imagelist_duplicate(), cpl_imagelist_get(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_is_uniform(), cpl_imagelist_load_frameset(), cpl_imagelist_swap_axis_create(), cpl_imagelist_unset(), cpl_mask_collapse_create(), cpl_mask_count(), cpl_mask_count_window(), cpl_mask_duplicate(), cpl_mask_extract(), cpl_mask_extract_subsample(), cpl_mask_get(), cpl_mask_get_data(), cpl_mask_get_data_const(), cpl_mask_get_size_x(), cpl_mask_get_size_y(), cpl_mask_new(), cpl_mask_wrap(), cpl_matrix_get_determinant(), cpl_matrix_invert_create(), cpl_matrix_product_create(), cpl_matrix_solve(), cpl_matrix_solve_normal(), cpl_polynomial_compare(), cpl_polynomial_duplicate(), cpl_polynomial_eval(), cpl_polynomial_eval_1d(), cpl_polynomial_eval_1d_diff(), cpl_polynomial_extract(), cpl_polynomial_get_coeff(), cpl_polynomial_get_degree(), cpl_polynomial_get_dimension(), cpl_polynomial_new(), cpl_sprintf(), cpl_stats_get_absflux(), cpl_stats_get_centroid_x(), cpl_stats_get_centroid_y(), cpl_stats_get_flux(), cpl_stats_get_mad(), cpl_stats_get_max(), cpl_stats_get_max_x(), cpl_stats_get_max_y(), cpl_stats_get_mean(), cpl_stats_get_median(), cpl_stats_get_median_dev(), cpl_stats_get_min(), cpl_stats_get_min_x(), cpl_stats_get_min_y(), cpl_stats_get_npix(), cpl_stats_get_sqflux(), cpl_stats_get_stdev(), cpl_stats_new_from_image(), cpl_stats_new_from_image_window(), cpl_vector_correlate(), cpl_vector_duplicate(), cpl_vector_extract(), cpl_vector_filter_lowpass_create(), cpl_vector_filter_median_create(), cpl_vector_find(), cpl_vector_get(), cpl_vector_get_data(), cpl_vector_get_data_const(), cpl_vector_get_max(), cpl_vector_get_mean(), cpl_vector_get_median(), cpl_vector_get_median_const(), cpl_vector_get_min(), cpl_vector_get_size(), cpl_vector_get_stdev(), cpl_vector_get_sum(), cpl_vector_load(), cpl_vector_new_from_image_column(), cpl_vector_new_from_image_row(), cpl_vector_product(), cpl_vector_read(), cpl_vsprintf(), cpl_wcs_get_cd(), cpl_wcs_get_crpix(), cpl_wcs_get_crval(), cpl_wcs_get_ctype(), cpl_wcs_get_cunit(), cpl_wcs_get_image_dims(), cpl_wcs_get_image_naxis(), and cpl_wcs_new_from_propertylist().

#define cpl_ensure_code (   BOOL,
  ERRCODE 
)

Set an error code and return it iff a boolean expression is false.

Parameters
BOOLThe boolean to evaluate
ERRCODEThe error code to set and return
See also
cpl_ensure()

Referenced by cpl_apertures_sort_by_flux(), cpl_apertures_sort_by_max(), cpl_apertures_sort_by_npix(), cpl_bivector_interpolate_linear(), cpl_bivector_sort(), cpl_detector_interpolate_rejected(), cpl_dfs_save_imagelist(), cpl_dfs_save_paf(), cpl_dfs_save_table(), cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), cpl_fft_imagelist(), cpl_flux_get_noise_ring(), cpl_image_abs(), cpl_image_accept(), cpl_image_add_scalar(), cpl_image_and(), cpl_image_and_scalar(), cpl_image_conjugate(), cpl_image_copy(), cpl_image_divide(), cpl_image_divide_scalar(), cpl_image_dump_structure(), cpl_image_dump_window(), cpl_image_exponential(), cpl_image_fft(), cpl_image_fill_abs_arg(), cpl_image_fill_gaussian(), cpl_image_fill_noise_uniform(), cpl_image_fill_polynomial(), cpl_image_fill_re_im(), cpl_image_fill_rejected(), cpl_image_fill_window(), cpl_image_filter(), cpl_image_filter_mask(), cpl_image_fit_gaussian(), cpl_image_flip(), cpl_image_get_fwhm(), cpl_image_get_mad(), cpl_image_get_mad_window(), cpl_image_get_maxpos(), cpl_image_get_maxpos_window(), cpl_image_get_median_dev(), cpl_image_get_median_dev_window(), cpl_image_get_minpos(), cpl_image_get_minpos_window(), cpl_image_hypot(), cpl_image_logarithm(), cpl_image_move(), cpl_image_multiply(), cpl_image_multiply_scalar(), cpl_image_normalise(), cpl_image_not(), cpl_image_or(), cpl_image_or_scalar(), cpl_image_power(), cpl_image_reject(), cpl_image_reject_from_mask(), cpl_image_set(), cpl_image_set_complex(), cpl_image_shift(), cpl_image_subtract_scalar(), cpl_image_threshold(), cpl_image_turn(), cpl_image_warp(), cpl_image_warp_polynomial(), cpl_image_xor(), cpl_image_xor_scalar(), cpl_imagelist_add_scalar(), cpl_imagelist_divide_scalar(), cpl_imagelist_dump_structure(), cpl_imagelist_dump_window(), cpl_imagelist_erase(), cpl_imagelist_exponential(), cpl_imagelist_logarithm(), cpl_imagelist_multiply_scalar(), cpl_imagelist_normalise(), cpl_imagelist_power(), cpl_imagelist_save(), cpl_imagelist_set(), cpl_imagelist_subtract_scalar(), cpl_imagelist_threshold(), cpl_mask_and(), cpl_mask_copy(), cpl_mask_dump_window(), cpl_mask_filter(), cpl_mask_flip(), cpl_mask_move(), cpl_mask_not(), cpl_mask_or(), cpl_mask_save(), cpl_mask_set(), cpl_mask_shift(), cpl_mask_threshold_image(), cpl_mask_turn(), cpl_mask_xor(), cpl_matrix_decomp_chol(), cpl_matrix_solve_chol(), cpl_matrix_swap_rows(), cpl_photom_fill_blackbody(), cpl_plot_bivectors(), cpl_plot_column(), cpl_plot_columns(), cpl_plot_image_col(), cpl_plot_image_row(), cpl_plot_vectors(), cpl_polynomial_add(), cpl_polynomial_copy(), cpl_polynomial_derivative(), cpl_polynomial_dump(), cpl_polynomial_fit(), cpl_polynomial_multiply_scalar(), cpl_polynomial_set_coeff(), cpl_polynomial_shift_1d(), cpl_polynomial_subtract(), cpl_propertylist_save(), cpl_stats_dump(), cpl_vector_add(), cpl_vector_add_scalar(), cpl_vector_convolve_symmetric(), cpl_vector_copy(), cpl_vector_divide(), cpl_vector_divide_scalar(), cpl_vector_exponential(), cpl_vector_fill(), cpl_vector_fill_kernel_profile(), cpl_vector_fill_polynomial(), cpl_vector_fill_polynomial_fit_residual(), cpl_vector_fit_gaussian(), cpl_vector_logarithm(), cpl_vector_multiply(), cpl_vector_multiply_scalar(), cpl_vector_power(), cpl_vector_save(), cpl_vector_set(), cpl_vector_set_size(), cpl_vector_sort(), cpl_vector_sqrt(), cpl_vector_subtract(), cpl_vector_subtract_scalar(), cpl_wcs_convert(), cpl_wcs_platesol(), cpl_wlcalib_fill_line_spectrum(), cpl_wlcalib_fill_line_spectrum_fast(), cpl_wlcalib_fill_logline_spectrum(), cpl_wlcalib_fill_logline_spectrum_fast(), cpl_wlcalib_find_best_1d(), cpl_wlcalib_slitmodel_set_catalog(), cpl_wlcalib_slitmodel_set_threshold(), cpl_wlcalib_slitmodel_set_wfwhm(), and cpl_wlcalib_slitmodel_set_wslit().

#define cpl_error_ensure (   CONDITION,
  CODE,
  ACTION,
  ... 
)

Generic error handling macro.

Parameters
CONDITIONThe condition to check
CODEThe CPL error code to set if CONDTION is non-zero
ACTIONA statement that is executed iff the CONDITION evaluates to non-zero.
...A printf-style message for cpl_error_set_message().
See also
cpl_error_set_message()
Note
This macro should not be used directly. It is defined only to support user-defined error handling macros. If CODE equals CPL_ERROR_NONE, a CPL error with code CPL_ERROR_UNSPECIFIED is created. The message may be a printf-like format string supplied with arguments unless variadic macros are not supported in which case only a (non-format) string is accepted. The provided CODE, ACTION and VA_ARGS are evaluated/executed only if the CONDITION evaluates to false (zero). The ACTION break is unsupported (it currently causes the execution to continue after cpl_error_ensure()). Some of the below examples use a goto statement to jump to a single cleanup label, assumed to be located immediately before the function's unified cleanup-code and return point. This error-handling scheme is reminiscent of using exceptions in languages that support exceptions (C++, Java, ...). The use of goto and a single clean-up label per function "if the error-handling code is non- trivial, and if errors can occur in several places" is sanctioned by Kernigan & Richie: "The C Programming Language". For any other purpose goto should be avoided.

Useful definitions might include

1 #define assure(BOOL, CODE) \
2  cpl_error_ensure(BOOL, CODE, goto cleanup, " ")
3 
4 #define check(CMD) \
5  cpl_error_ensure((CMD, cpl_error_get_code() == CPL_ERROR_NONE), \
6  cpl_error_get_code(), goto cleanup, " ")
7 
8 #define assert(BOOL) \
9  cpl_error_ensure(BOOL, CPL_ERROR_UNSPECIFIED, goto cleanup, \
10  "Internal error, please report to " PACKAGE_BUGREPORT)

or (same as above, but including printf-style error messages)

1 #define assure(BOOL, CODE, ...) \
2  cpl_error_ensure(BOOL, CODE, goto cleanup, __VA_ARGS__)
3 
4 #define check(CMD, ...) \
5  cpl_error_ensure((CMD, cpl_error_get_code() == CPL_ERROR_NONE), \
6  cpl_error_get_code(), goto cleanup, __VA_ARGS__)
7 
8 #define assert(BOOL, ...) \
9  cpl_error_ensure(BOOL, CPL_ERROR_UNSPECIFIED, goto cleanup, \
10  "Internal error, please report to " PACKAGE_BUGREPORT \
11  " " __VA_ARGS__)
12  / * Assumes that PACKAGE_BUGREPORT
13  contains no formatting special characters * /

or

1 #define skip_if(BOOL) \
2  cpl_error_ensure(BOOL, cpl_error_get_code() != CPL_ERROR_NONE ? \
3  cpl_error_get_code() : CPL_ERROR_UNSPECIFIED, \
4  goto cleanup, " ")

The check macros in the examples above can be used to check a command which sets the cpl_error_code in case of failure (or, by use of a comma expression, a longer sequence of such commands):

1 check(
2  (x = cpl_table_get_int(table, "x", 0, NULL),
3  y = cpl_table_get_int(table, "y", 0, NULL),
4  z = cpl_table_get_int(table, "z", 0, NULL)),
5  "Error reading wavelength catalogue");
#define CPL_ERROR_MAX_MESSAGE_LENGTH   256

The maximum length of a CPL error message.

See also
cpl_error_get_message()
#define cpl_error_set (   function,
  code 
)

Set CPL error code, function name, source file and line number where an error occurred.

Parameters
functionCharacter string with function name, cpl_func
codeError code
Returns
The specified error code.
Note
If code is CPL_ERROR_NONE, nothing is done (and code is returned), if code is CPL_ERROR_HISTORY_LOST (but avoid that) then CPL_ERROR_UNSPECIFIED is set and returned.

Referenced by cpl_array_get_type(), cpl_frame_duplicate(), cpl_frame_get_filename(), cpl_frame_get_group(), cpl_frame_get_level(), cpl_frame_get_nextensions(), cpl_frame_get_tag(), cpl_frame_get_type(), cpl_frame_set_filename(), cpl_frame_set_group(), cpl_frame_set_level(), cpl_frame_set_tag(), cpl_frame_set_type(), cpl_framedata_duplicate(), cpl_framedata_get_max_count(), cpl_framedata_get_min_count(), cpl_framedata_get_tag(), cpl_framedata_set(), cpl_framedata_set_max_count(), cpl_framedata_set_min_count(), cpl_framedata_set_tag(), cpl_frameset_count_tags(), cpl_frameset_duplicate(), cpl_frameset_erase(), cpl_frameset_erase_frame(), cpl_frameset_find_const(), cpl_frameset_get_first(), cpl_frameset_get_first_const(), cpl_frameset_get_frame(), cpl_frameset_get_frame_const(), cpl_frameset_get_next(), cpl_frameset_get_next_const(), cpl_frameset_get_position(), cpl_frameset_get_position_const(), cpl_frameset_get_size(), cpl_frameset_insert(), cpl_frameset_is_empty(), cpl_frameset_iterator_advance(), cpl_frameset_iterator_assign(), cpl_frameset_iterator_distance(), cpl_frameset_iterator_duplicate(), cpl_frameset_iterator_get(), cpl_frameset_iterator_get_const(), cpl_frameset_iterator_new(), cpl_frameset_join(), cpl_frameset_sort(), cpl_imagelist_load_frameset(), cpl_matrix_get_data(), cpl_matrix_get_data_const(), cpl_matrix_get_ncol(), cpl_matrix_get_nrow(), cpl_matrix_set(), cpl_parameter_disable(), cpl_parameter_duplicate(), cpl_parameter_enable(), cpl_parameter_get_alias(), cpl_parameter_get_bool(), cpl_parameter_get_class(), cpl_parameter_get_context(), cpl_parameter_get_default_bool(), cpl_parameter_get_default_double(), cpl_parameter_get_default_flag(), cpl_parameter_get_default_int(), cpl_parameter_get_default_string(), cpl_parameter_get_double(), cpl_parameter_get_enum_double(), cpl_parameter_get_enum_int(), cpl_parameter_get_enum_size(), cpl_parameter_get_enum_string(), cpl_parameter_get_help(), cpl_parameter_get_id(), cpl_parameter_get_int(), cpl_parameter_get_name(), cpl_parameter_get_range_max_double(), cpl_parameter_get_range_max_int(), cpl_parameter_get_range_min_double(), cpl_parameter_get_range_min_int(), cpl_parameter_get_string(), cpl_parameter_get_tag(), cpl_parameter_get_type(), cpl_parameter_is_enabled(), cpl_parameter_new_enum(), cpl_parameter_new_range(), cpl_parameter_new_value(), cpl_parameter_set_alias(), cpl_parameter_set_bool(), cpl_parameter_set_default_bool(), cpl_parameter_set_default_double(), cpl_parameter_set_default_flag(), cpl_parameter_set_default_int(), cpl_parameter_set_default_string(), cpl_parameter_set_double(), cpl_parameter_set_id(), cpl_parameter_set_int(), cpl_parameter_set_string(), cpl_parameter_set_tag(), cpl_parameterlist_append(), cpl_parameterlist_find_const(), cpl_parameterlist_find_context_const(), cpl_parameterlist_find_tag_const(), cpl_parameterlist_find_type_const(), cpl_parameterlist_get_first_const(), cpl_parameterlist_get_last_const(), cpl_parameterlist_get_next_const(), cpl_parameterlist_get_size(), cpl_pluginlist_append(), cpl_pluginlist_find(), cpl_pluginlist_get_first(), cpl_pluginlist_get_last(), cpl_pluginlist_get_next(), cpl_pluginlist_get_size(), cpl_pluginlist_prepend(), cpl_ppm_match_points(), cpl_ppm_match_positions(), cpl_recipeconfig_get_inputs(), cpl_recipeconfig_get_max_count(), cpl_recipeconfig_get_min_count(), cpl_recipeconfig_get_outputs(), cpl_recipeconfig_get_tags(), cpl_recipeconfig_is_required(), cpl_recipeconfig_set_input(), cpl_recipeconfig_set_inputs(), cpl_recipeconfig_set_output(), cpl_recipeconfig_set_outputs(), cpl_recipeconfig_set_tag(), cpl_recipeconfig_set_tags(), cpl_table_get_ncol(), cpl_table_get_nrow(), cpl_table_has_column(), and cpl_table_new().

#define cpl_error_set_message (   function,
  code,
  ... 
)

Set CPL error code, function name, source file and line number where an error occurred along with a text message.

Parameters
functionCharacter string with function name, cpl_func
codeError code
...Variable argument list with message
Returns
The CPL error code
See also
cpl_error_set()
Note
The message is ignored if it is NULL, empty, or consists of a single ' ' (space). Otherwise, the user supplied message is appended to the default message using ': ' (colon+space) as delimiter. If the CPL-based application may use variadic macros, the message may be a printf-style format string supplied with matching arguments. If variadic macros are not allowed (e.g. when compiling with gcc -ansi) only a non-format string is accepted. Please be aware that the format string should always be a string literal, otherwise the code may be vulnerable to the socalled 'format string exploit'. Sufficiently recent versions of gcc supports the option -Wformat-security, which tries to warn of this issue. If variadic macros are not supported, a printf-style message can be created prior to the call to cpl_error_set_message(), as in the below example.

Examples of usage:

1 if (image == NULL) {
2  return cpl_error_set_message(cpl_func, CPL_ERROR_NULL_INPUT,
3  "Image number %d is NULL", number);
4 }
1 if (error_string != NULL) {
2  return cpl_error_set_message(cpl_func, CPL_ERROR_ILLEGAL_INPUT,
3  "%s", error_string);
4 }

Example of usage if and only if variadic macros are unavaiable (e.g. when compiling with gcc -ansi):

1 if (image == NULL) {
2  char * my_txt = cpl_sprintf("Image number %d is NULL", number);
3  const cpl_error_code my_code =
4  cpl_error_set_message(cpl_func, CPL_ERROR_NULL_INPUT, my_txt);
5  cpl_free(my_txt);
6  return my_code;
7 }

Referenced by cpl_parameter_disable(), cpl_parameter_enable(), cpl_parameter_get_alias(), cpl_parameter_get_bool(), cpl_parameter_get_default_bool(), cpl_parameter_get_default_double(), cpl_parameter_get_default_int(), cpl_parameter_get_default_string(), cpl_parameter_get_double(), cpl_parameter_get_enum_double(), cpl_parameter_get_enum_int(), cpl_parameter_get_enum_size(), cpl_parameter_get_enum_string(), cpl_parameter_get_int(), cpl_parameter_get_range_max_double(), cpl_parameter_get_range_max_int(), cpl_parameter_get_range_min_double(), cpl_parameter_get_range_min_int(), cpl_parameter_get_string(), cpl_parameter_is_enabled(), cpl_parameter_new_enum(), cpl_parameter_new_range(), cpl_parameter_new_value(), cpl_parameter_set_alias(), cpl_parameter_set_bool(), cpl_parameter_set_default_bool(), cpl_parameter_set_default_double(), cpl_parameter_set_default_int(), cpl_parameter_set_default_string(), cpl_parameter_set_double(), cpl_parameter_set_int(), and cpl_parameter_set_string().

#define cpl_error_set_where (   function)

Propagate a CPL-error to the current location.

Parameters
functionCharacter string with function name, cpl_func
Returns
The preexisting CPL error code (possibly CPL_ERROR_NONE).
See also
cpl_error_set()
Note
If no error exists, nothing is done and CPL_ERROR_NONE is returned

If a CPL error already exists, this function creates a new CPL error with the preexisting CPL error code and the current location.

In a function of type cpl_error_code an error can be propagated with:

1 return cpl_error_set_where(cpl_func);

Referenced by cpl_frameset_find(), cpl_matrix_extract_column(), cpl_matrix_extract_row(), cpl_multiframe_append_datagroup(), cpl_multiframe_append_datagroup_from_position(), cpl_multiframe_append_dataset(), cpl_multiframe_append_dataset_from_position(), cpl_parameterlist_find(), cpl_parameterlist_find_context(), cpl_parameterlist_find_tag(), cpl_parameterlist_find_type(), cpl_parameterlist_get_first(), cpl_parameterlist_get_last(), and cpl_parameterlist_get_next().

#define CPL_HAVE_VA_ARGS

Flag to indicate support for variadic macros.

See also
cpl_error_set_message()
Note
Unless already defined, tries to detect whether variadic macros are supported, typically at compile-time of a CPL-based application. This check, which is hardly robust, should support
  • disabling of variadic macros when compiling with gcc -ansi
  • enabling them when compiling with a C99 compliant compiler, such as gcc -std=c99

Typedef Documentation

The cpl_error_code type definition.

Enumeration Type Documentation

Available error codes.

CPL_ERROR_NONE is equal to zero and compares to less than all other error codes.

All error codes are guaranteed to be less than CPL_ERROR_EOL (End Of List). CPL_ERROR_EOL allows user defined error codes to be added in this fashion:

1 const int my_first_error_code = 0 + CPL_ERROR_EOL;
2 const int my_second_error_code = 1 + CPL_ERROR_EOL;
3 const int my_third_error_code = 2 + CPL_ERROR_EOL;
4 
5 if (is_connected() == CPL_FALSE) {
6  return cpl_error_set_message(cpl_func, my_first_error_code, "No "
7  "connection to host %s (after %u tries)",
8  hostname, max_attempts);
9 }

Extensive use of user defined error codes should be avoided. Instead a request of new CPL error codes should be emailed to cpl-h.nosp@m.elp@.nosp@m.eso.o.nosp@m.rg.

Enumerator
CPL_ERROR_NONE 

No error condition

CPL_ERROR_UNSPECIFIED 

An unspecified error. FIXME: Do not set to 1 and verify correctness

CPL_ERROR_HISTORY_LOST 

The actual CPL error has been lost. Do not use to create a CPL error

CPL_ERROR_DUPLICATING_STREAM 

Could not duplicate output stream

CPL_ERROR_ASSIGNING_STREAM 

Could not associate a stream with a file descriptor

CPL_ERROR_FILE_IO 

Permission denied

CPL_ERROR_BAD_FILE_FORMAT 

Input file had not the expected format

CPL_ERROR_FILE_ALREADY_OPEN 

Attempted to open a file twice

CPL_ERROR_FILE_NOT_CREATED 

Could not create a file

CPL_ERROR_FILE_NOT_FOUND 

A specified file or directory was not found

CPL_ERROR_DATA_NOT_FOUND 

Data searched within a valid object were not found

CPL_ERROR_ACCESS_OUT_OF_RANGE 

Data were accessed beyond boundaries

CPL_ERROR_NULL_INPUT 

A NULL pointer was found where a valid pointer was expected

CPL_ERROR_INCOMPATIBLE_INPUT 

Data that had to be processed together did not match

CPL_ERROR_ILLEGAL_INPUT 

Illegal values were detected

CPL_ERROR_ILLEGAL_OUTPUT 

A given operation would have generated an illegal object

CPL_ERROR_UNSUPPORTED_MODE 

The requested functionality is not supported

CPL_ERROR_SINGULAR_MATRIX 

Could not invert a matrix

CPL_ERROR_DIVISION_BY_ZERO 

Attempted to divide a number by zero

CPL_ERROR_TYPE_MISMATCH 

Data were not of the expected type

CPL_ERROR_INVALID_TYPE 

Data type was unsupported or invalid

CPL_ERROR_CONTINUE 

An iterative process did not converge

CPL_ERROR_NO_WCS 

The WCS functionalities are missing

CPL_ERROR_EOL 

To permit extensibility of error handling. It is a coding error to use this within CPL itself!

Function Documentation

cpl_error_code cpl_error_get_code ( void  )

Get the last cpl_error_code set.

Returns
cpl_error_code of last occurred CPL error.

Get cpl_error_code of last occurred error.

References CPL_ERROR_NONE.

Referenced by cpl_apertures_extract_window(), cpl_bivector_interpolate_linear(), cpl_detector_interpolate_rejected(), cpl_dfs_save_paf(), cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), cpl_errorstate_dump(), cpl_frameset_dump(), cpl_frameset_extract(), cpl_frameset_labelise(), cpl_image_abs_create(), cpl_image_add_scalar_create(), cpl_image_collapse_create(), cpl_image_divide_scalar_create(), cpl_image_exponential_create(), cpl_image_fft(), cpl_image_filter_median(), cpl_image_filter_stdev(), cpl_image_get_fwhm(), cpl_image_get_interpolated(), cpl_image_get_mad(), cpl_image_get_mad_window(), cpl_image_get_maxpos(), cpl_image_get_maxpos_window(), cpl_image_get_median_dev(), cpl_image_get_median_dev_window(), cpl_image_get_minpos(), cpl_image_get_minpos_window(), cpl_image_logarithm_create(), cpl_image_multiply_scalar_create(), cpl_image_normalise(), cpl_image_power_create(), cpl_image_subtract_scalar_create(), cpl_image_warp_polynomial(), cpl_imagelist_add_scalar(), cpl_imagelist_divide_scalar(), cpl_imagelist_dump_structure(), cpl_imagelist_dump_window(), cpl_imagelist_exponential(), cpl_imagelist_load_frameset(), cpl_imagelist_logarithm(), cpl_imagelist_multiply_scalar(), cpl_imagelist_normalise(), cpl_imagelist_power(), cpl_imagelist_subtract_scalar(), cpl_imagelist_threshold(), cpl_init(), cpl_plot_image_col(), cpl_sprintf(), cpl_test_end(), cpl_vector_copy(), cpl_vector_fill_kernel_profile(), and cpl_wcs_platesol().

const char* cpl_error_get_file ( void  )

Get the source code file name where the last CPL error occurred.

Returns
Name of source file name where the last CPL error occurred.

Get the source code file name where the last CPL error occurred.

Referenced by cpl_error_get_where().

const char* cpl_error_get_function ( void  )

Get the function name where the last CPL error occurred.

Returns
Identifier string of the function name where the last CPL error occurred.

Get the function name where the last CPL error occurred.

Referenced by cpl_error_get_where().

unsigned cpl_error_get_line ( void  )

Get the line number where the last CPL error occurred.

Returns
Line number of the source file where the last CPL error occurred.

Get the line number of the source file where the last CPL error occurred.

Referenced by cpl_error_get_where().

const char* cpl_error_get_message ( void  )

Get the text message of the current CPL error.

Returns
The text message of the current CPL error.
See also
cpl_error_get_message_default(), cpl_error_set_message()

If the cpl_error_code is equal to CPL_ERROR_NONE, an empty string is returned. Otherwise, the message is the default message for the current CPL error code, possibly extended with a custom message supplied when the error was set.

References cpl_error_get_message_default(), and CPL_ERROR_NONE.

const char* cpl_error_get_where ( void  )

Get function name, source file and line number where the last CPL error occurred.

Returns
String containing function name, source file and line number separated by colons (:).

Get where the last CPL error occurred in the form function_name:source_file:line_number

References cpl_error_get_file(), cpl_error_get_function(), and cpl_error_get_line().

cpl-6.6.1/html/form_23.png0000644000460300003120000000152012553662441012143 00000000000000‰PNG  IHDR¬:sJ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï¿IDATxí]Ûnä: £¯±dòÿ{H)“[Ï¢»@ ‹5"3ò…¦)åþ|°¾² øùF`€Ÿcùp®O¿<'«%9MpßaºçI;¤Ç6Ï@_àfY`“€f¹0½|ƒMÜ%W ô:Ï·!ÞÛS¡“ÈQ›ìUÍÀ×›ø[„„¸¶+)Úýøvð< ˜9®«š`îh‰   ~!ð[›Èagåf×Ôo¼áG@`K±ûæO .:Yo›Æiˆá¼€-˼;ªP[³·šÒÀø£bÓHŽ‘bhÊÐÍ?»D´ iA]r oÙˆ]‡8Åœkš±/Zª7ËÉHõØJäjZsžz|Mˆ[Fœ9;¾jí‰^¾†¶i¼hë›î<›Dì#@°ðÈ É$3ÃH]%›ñž¼¸X?Þœç¯Ñ’³0ËÊZ 6"ÚIuU2Lâ [YÜí‹ÏW¦õo59l•ÌÂÞÁF'øÁÊv¥÷½ùmq E5rMØQ¶¹iK©ÓBag–m7ÙË|]§Zì²î‚µ²°¥Øì6²kóìxê™ó\¤àòpn _Ú`+ªHh=Çæ"a?„.1·õòV¦oZÖÖlãÜɺ6‘vž8õdµWÄE…µ˜^œ^9Wyªõ’Χ•LkÌʪ }æŒ&Á:ÙfûNŸµ³OéÀŸàúά2$Ƹû¡<Žz½r œÀìæÎñ™P½Þ‡›ûúonõ3ß­¼ §ýcàü;gŸz`r6Ý÷¢ðý÷ à/±ÿÙ ¿¥&qIEND®B`‚cpl-6.6.1/html/group__cpl__parameter.html0000644000460300003120000060212312553662432015412 00000000000000 Common Pipeline Library Reference Manual: Parameters
Common Pipeline Library Reference Manual  6.6.1

Typedefs

typedef struct _cpl_parameter_ cpl_parameter
 The opaque parameter data type. More...
 
typedef enum _cpl_parameter_class_ cpl_parameter_class
 The parameter class data type. More...
 
typedef enum _cpl_parameter_mode_ cpl_parameter_mode
 The parameter mode data type. More...
 

Enumerations

enum  _cpl_parameter_class_ {
  CPL_PARAMETER_CLASS_INVALID,
  CPL_PARAMETER_CLASS_VALUE,
  CPL_PARAMETER_CLASS_RANGE,
  CPL_PARAMETER_CLASS_ENUM
}
 Supported parameter classes. More...
 
enum  _cpl_parameter_mode_ {
  CPL_PARAMETER_MODE_CLI,
  CPL_PARAMETER_MODE_ENV,
  CPL_PARAMETER_MODE_CFG
}
 Supported parameter modes. More...
 

Functions

void cpl_parameter_delete (cpl_parameter *self)
 Delete a parameter. More...
 
cpl_error_code cpl_parameter_disable (cpl_parameter *self, cpl_parameter_mode mode)
 Deactivate a parameter for the given mode. More...
 
void cpl_parameter_dump (const cpl_parameter *self, FILE *stream)
 Dump the parameter debugging information to the given stream. More...
 
cpl_parametercpl_parameter_duplicate (const cpl_parameter *self)
 Create a copy of a parameter. More...
 
cpl_error_code cpl_parameter_enable (cpl_parameter *self, cpl_parameter_mode mode)
 Activates a parameter for the given mode. More...
 
const char * cpl_parameter_get_alias (const cpl_parameter *self, cpl_parameter_mode mode)
 Get the parameter's alias name for the given mode. More...
 
int cpl_parameter_get_bool (const cpl_parameter *self)
 Get the value of the given boolean parameter. More...
 
cpl_parameter_class cpl_parameter_get_class (const cpl_parameter *self)
 Get the parameter's class. More...
 
const char * cpl_parameter_get_context (const cpl_parameter *self)
 Get the context of a parameter. More...
 
int cpl_parameter_get_default_bool (const cpl_parameter *self)
 Get the default value of the given boolean parameter. More...
 
double cpl_parameter_get_default_double (const cpl_parameter *self)
 Get the default value of the given double parameter. More...
 
int cpl_parameter_get_default_flag (const cpl_parameter *self)
 Get the presence status flag of the given parameter. More...
 
int cpl_parameter_get_default_int (const cpl_parameter *self)
 Get the default value of the given integer parameter. More...
 
const char * cpl_parameter_get_default_string (const cpl_parameter *self)
 Get the default value of the given string parameter. More...
 
double cpl_parameter_get_double (const cpl_parameter *self)
 Get the value of the given double parameter. More...
 
double cpl_parameter_get_enum_double (const cpl_parameter *self, int position)
 Get the possible values for a double enumeration. More...
 
int cpl_parameter_get_enum_int (const cpl_parameter *self, int position)
 Get the possible values for an integer enumeration. More...
 
int cpl_parameter_get_enum_size (const cpl_parameter *self)
 Get the number of alternatives of an enumeration parameter. More...
 
const char * cpl_parameter_get_enum_string (const cpl_parameter *self, int position)
 Get the possible values for a string enumeration. More...
 
const char * cpl_parameter_get_help (const cpl_parameter *self)
 Get the description of a parameter. More...
 
int cpl_parameter_get_id (const cpl_parameter *self)
 Get the numerical identifier of the given parameter. More...
 
int cpl_parameter_get_int (const cpl_parameter *self)
 Get the value of the given integer parameter. More...
 
const char * cpl_parameter_get_name (const cpl_parameter *self)
 Get the name of a parameter. More...
 
double cpl_parameter_get_range_max_double (const cpl_parameter *self)
 Get the maximum value of a double range parameter. More...
 
int cpl_parameter_get_range_max_int (const cpl_parameter *self)
 Get the maximum value of an integer range parameter. More...
 
double cpl_parameter_get_range_min_double (const cpl_parameter *self)
 Get the minimum value of a double range parameter. More...
 
int cpl_parameter_get_range_min_int (const cpl_parameter *self)
 Get the minimum value of an integer range parameter. More...
 
const char * cpl_parameter_get_string (const cpl_parameter *self)
 Get the value of the given string parameter. More...
 
const char * cpl_parameter_get_tag (const cpl_parameter *self)
 Get the parameter's user tag. More...
 
cpl_type cpl_parameter_get_type (const cpl_parameter *self)
 Get the parameter's value type. More...
 
int cpl_parameter_is_enabled (const cpl_parameter *self, cpl_parameter_mode mode)
 Get the parameter's activity status for the environment context. More...
 
cpl_parametercpl_parameter_new_enum (const char *name, cpl_type type, const char *description, const char *context,...)
 Create a new enumeration parameter. More...
 
cpl_parametercpl_parameter_new_range (const char *name, cpl_type type, const char *description, const char *context,...)
 Create a new range parameter. More...
 
cpl_parametercpl_parameter_new_value (const char *name, cpl_type type, const char *description, const char *context,...)
 Create a new value parameter. More...
 
cpl_error_code cpl_parameter_set_alias (cpl_parameter *self, cpl_parameter_mode mode, const char *alias)
 Set alias names for the given parameter. More...
 
cpl_error_code cpl_parameter_set_bool (cpl_parameter *self, int value)
 Assign a boolean value to a parameter. More...
 
cpl_error_code cpl_parameter_set_default_bool (cpl_parameter *self, int value)
 Modify the default value of a boolean parameter. More...
 
cpl_error_code cpl_parameter_set_default_double (cpl_parameter *self, double value)
 Modify the default value of a double parameter. More...
 
cpl_error_code cpl_parameter_set_default_flag (cpl_parameter *self, int status)
 Change the presence status flag of the given parameter. More...
 
cpl_error_code cpl_parameter_set_default_int (cpl_parameter *self, int value)
 Modify the default value of an integer parameter. More...
 
cpl_error_code cpl_parameter_set_default_string (cpl_parameter *self, const char *value)
 Modify the default value of a string parameter. More...
 
cpl_error_code cpl_parameter_set_double (cpl_parameter *self, double value)
 Assign a double value to a parameter. More...
 
cpl_error_code cpl_parameter_set_id (cpl_parameter *self, int id)
 Set the numerical identifier of the given parameter. More...
 
cpl_error_code cpl_parameter_set_int (cpl_parameter *self, int value)
 Assign an integer value to a parameter. More...
 
cpl_error_code cpl_parameter_set_string (cpl_parameter *self, const char *value)
 Assign a string value to a parameter. More...
 
cpl_error_code cpl_parameter_set_tag (cpl_parameter *self, const char *tag)
 Set the tag of the given parameter. More...
 

Detailed Description

This module implements a class of data types which can be used to manage context specific, named parameters. They provide a standard way to pass, for instance, command line information to different components of an application.

The fundamental parts of a parameter are its name, a context to which it belongs (a specific component of an application for instance), its current value and a default value.

The implementation supports three classes of parameters:

  • A plain value
  • A range of values
  • An enumeration value

When a parameter is created it is created for a particular value type. The type of a parameter's current and default value may be (cf. Type codes):

  • CPL_TYPE_BOOL
  • CPL_TYPE_INT
  • CPL_TYPE_DOUBLE
  • CPL_TYPE_STRING

When a value is assigned to a parameter, the different parameter classes behave differently. For a plain value, no checks are applied to the data value to be assigned. For a range or an enumeration, on the other hand, the value to be stored is validated with respect to the minimum and maximum value of the range and the list of enumeration alternatives respectively. If the value is invalid, an error is reported.

Note
The validation of parameter values is not yet implemented.

The functions to create a new parameter of a particular class are polymorphic and accept any value type mentioned above to initialise the parameter to create. This is accomplished by using a variable argument list. The number and type of the parameters expected by these functions is determined from the parameter class and the indicated value type.

The constructor of a plain value expects a single value, the parameter's default value, which must be of the appropriate type, as argument while the constructor for a range expects the default value, the minimum and the maximum value. The constructor for an enumeration expects as arguments the default value, the number of alternatives following and the list of alternatives. Note that the default value must be a member of the list of alternative enumeration values.

An example of how parameters of the different classes are created and destroyed is shown below:

cpl_parameter *enumeration;
...
"This is a plain value of type integer",
"Example",
-1);
"This is a value range of type double",
"Example",
0.5, 0.0, 1.0);
"This is an enumeration of type "
"string",
"Example",
"first", 3, "first", "second",
"third");
...
cpl_parameter_delete(value);
cpl_parameter_delete(enumeration);

After the parameter has been created and initialised the parameters current value equals its default value. The initialisation values are copied into the parameter, i.e. if an initialiser value resides in dynamically allocated memory, it can be deallocated after the parameter has been initialised without affecting the created parameter.

Note
A variable argument list allows only limited type checking. Therefore, code explicitly what you mean and double check the constructor calls that the number of arguments and the types of the elements of the variable argument list are what the constructor expects.
Synopsis:
#include <cpl_parameter.h>

Typedef Documentation

typedef struct _cpl_parameter_ cpl_parameter

The opaque parameter data type.

The parameter class data type.

The parameter mode data type.

Enumeration Type Documentation

Supported parameter classes.

Enumerator
CPL_PARAMETER_CLASS_INVALID 

Parameter of undefined or invalid class.

CPL_PARAMETER_CLASS_VALUE 

Parameter representing a plain value.

CPL_PARAMETER_CLASS_RANGE 

Parameter representing a range of values.

CPL_PARAMETER_CLASS_ENUM 

Parameter representing an enumeration value.

Supported parameter modes.

The parameter mode is used to set or get context specific parameter attributes.

Enumerator
CPL_PARAMETER_MODE_CLI 

Command line mode of the parameter.

CPL_PARAMETER_MODE_ENV 

Environment variable mode of the parameter.

CPL_PARAMETER_MODE_CFG 

Configuration file mode of the parameter.

Function Documentation

void cpl_parameter_delete ( cpl_parameter self)

Delete a parameter.

Parameters
selfThe parameter to delete.
Returns
Nothing.

The function deletes a parameter of any class and type. All memory resources acquired by the parameter during its usage are released. If the parameter self is NULL, nothing is done and no error is set.

References CPL_PARAMETER_CLASS_ENUM, CPL_PARAMETER_CLASS_RANGE, and CPL_PARAMETER_CLASS_VALUE.

Referenced by cpl_parameter_duplicate(), cpl_parameter_new_enum(), cpl_parameter_new_range(), cpl_parameter_new_value(), and cpl_parameterlist_delete().

cpl_error_code cpl_parameter_disable ( cpl_parameter self,
cpl_parameter_mode  mode 
)

Deactivate a parameter for the given mode.

Parameters
selfA parameter.
modeThe parameter mode.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter mode mode is not supported.

The function disables the parameter self for the given mode mode.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, cpl_parameter_get_name(), CPL_PARAMETER_MODE_CFG, CPL_PARAMETER_MODE_CLI, and CPL_PARAMETER_MODE_ENV.

void cpl_parameter_dump ( const cpl_parameter self,
FILE *  stream 
)

Dump the parameter debugging information to the given stream.

Parameters
selfThe parameter.
streamThe output stream to use.
Returns
Nothing.

The function dumps the contents of of the parameter self to the output stream stream. If stream is NULL the function writes to the standard output. If self is NULL the function does nothing.

References CPL_PARAMETER_CLASS_ENUM, CPL_PARAMETER_CLASS_RANGE, CPL_PARAMETER_CLASS_VALUE, CPL_TYPE_BOOL, CPL_TYPE_DOUBLE, CPL_TYPE_INT, and CPL_TYPE_STRING.

Referenced by cpl_parameterlist_dump().

cpl_parameter* cpl_parameter_duplicate ( const cpl_parameter self)

Create a copy of a parameter.

Parameters
selfThe parameter to copy.
Returns
The copy of the given parameter, or NULL in case of an error. In the latter case an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a copy of the parameter self. The copy is a deep copy, i.e. all parameter properties are copied.

References CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_error_set, CPL_PARAMETER_CLASS_ENUM, CPL_PARAMETER_CLASS_RANGE, CPL_PARAMETER_CLASS_VALUE, and cpl_parameter_delete().

cpl_error_code cpl_parameter_enable ( cpl_parameter self,
cpl_parameter_mode  mode 
)

Activates a parameter for the given mode.

Parameters
selfA parameter.
modeThe parameter mode.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter mode mode is not supported.

The function enables the parameter self for the given mode mode.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, cpl_parameter_get_name(), CPL_PARAMETER_MODE_CFG, CPL_PARAMETER_MODE_CLI, and CPL_PARAMETER_MODE_ENV.

const char* cpl_parameter_get_alias ( const cpl_parameter self,
cpl_parameter_mode  mode 
)

Get the parameter's alias name for the given mode.

Parameters
selfA parameter.
modeThe parameter mode.
Returns
The function returns the parameter's context specific alias name. If no alias name was previously assigned the function returns NULL. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter mode mode is not supported.

The function retrieves the read-only alias name of the parameter self. The context for which an alias is retrieved is selected by the mode. The functions accepts the parameter modes CPL_PARAMETER_MODE_CFG, CPL_PARAMETER_MODE_CLI and CPL_PARAMETER_MODE_ENV.

See also
cpl_parameter_mode

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, cpl_parameter_get_name(), CPL_PARAMETER_MODE_CFG, CPL_PARAMETER_MODE_CLI, and CPL_PARAMETER_MODE_ENV.

Referenced by cpl_dfs_setup_product_header().

int cpl_parameter_get_bool ( const cpl_parameter self)

Get the value of the given boolean parameter.

Parameters
selfA boolean parameter.
Returns
The function returns the integer representation of the parameter's boolean value. TRUE is represented as non-zero value; whereas 0 indicates FALSE. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_BOOL.

The current boolean value of the parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_BOOL, and cpl_type_get_name().

Referenced by cpl_dfs_setup_product_header().

cpl_parameter_class cpl_parameter_get_class ( const cpl_parameter self)

Get the parameter's class.

Parameters
selfA parameter.
Returns
The function returns the parameter's class identifier. The function returns CPL_PARAMETER_CLASS_INVALID if self is not a valid parameter, but NULL. In this case an appropriate error code is also set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The class identifier of the parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and CPL_PARAMETER_CLASS_INVALID.

const char* cpl_parameter_get_context ( const cpl_parameter self)

Get the context of a parameter.

Parameters
selfA parameter.
Returns
The function returns the context of the parameter, or NULL if self is not a valid parameter but NULL. In the latter case an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the read-only context to which the parameter self belongs. The parameter's context must not be modified using the returned pointer.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_parameterlist_find_context_const().

int cpl_parameter_get_default_bool ( const cpl_parameter self)

Get the default value of the given boolean parameter.

Parameters
selfA boolean parameter.
Returns
The function returns the integer representation of the parameter's default boolean value. TRUE is represented as non-zero value; whereas 0 indicates FALSE. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_BOOL.

The current boolean default value of the parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_BOOL, and cpl_type_get_name().

Referenced by cpl_dfs_setup_product_header().

double cpl_parameter_get_default_double ( const cpl_parameter self)

Get the default value of the given double parameter.

Parameters
selfAn double parameter.
Returns
The function returns the parameter's default double value. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_DOUBLE.

The current double default value of the parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_DOUBLE, and cpl_type_get_name().

Referenced by cpl_dfs_setup_product_header().

int cpl_parameter_get_default_flag ( const cpl_parameter self)

Get the presence status flag of the given parameter.

Parameters
selfA parameter.
Returns
The function returns the current setting of the parameters presence flag. If the parameter is present the function returns 1 and 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function indicates whether the given parameter self was seen by an application while processing the input from the command line, the environment and/or a configuration file. If the parameter was seen the application may set this status flag and query it later using this function.

See also
cpl_parameter_set_default_flag()

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

int cpl_parameter_get_default_int ( const cpl_parameter self)

Get the default value of the given integer parameter.

Parameters
selfAn integer parameter.
Returns
The function returns the parameter's default integer value. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_INT.

The current integer default value of the parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_INT.

Referenced by cpl_dfs_setup_product_header().

const char* cpl_parameter_get_default_string ( const cpl_parameter self)

Get the default value of the given string parameter.

Parameters
selfAn string parameter.
Returns
The function returns the parameter's default string value. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_STRING.

The current read-only string default value of the parameter self is retrieved. If self is not a valid pointer the error code CPL_ERROR_NULL_INPUT is set on return. Also, if the parameter self is not an string parameter, i.e. the parameter's type is different from CPL_TYPE_INT, the error code CPL_ERROR_TYPE_MISMATCH is set.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_STRING.

Referenced by cpl_dfs_setup_product_header().

double cpl_parameter_get_double ( const cpl_parameter self)

Get the value of the given double parameter.

Parameters
selfAn double parameter.
Returns
The function returns the parameter's double value. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_INT.

The current double value of the parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_DOUBLE, and cpl_type_get_name().

Referenced by cpl_dfs_setup_product_header().

double cpl_parameter_get_enum_double ( const cpl_parameter self,
int  position 
)

Get the possible values for a double enumeration.

Parameters
selfAn enumeration parameter
positionPosition to look up in the list of possible values.
Returns
The double value at position position in the list of possible values of the enumeration self. In case of an error the function returns 0. and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The class of the parameter self is not of the kind CPL_PARAMETER_CLASS_ENUM, or self is not of type CPL_TYPE_DOUBLE.
CPL_ERROR_ACCESS_OUT_OF_RANGE The requested index position position is out of range.

The function retrieves the double value at position position from the list of enumeration values the parameter self can possibly take. For any valid enumeration parameter this list contains at leas one value. The possible values are counted starting from 0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, CPL_PARAMETER_CLASS_ENUM, cpl_parameter_get_enum_size(), cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_DOUBLE, and cpl_type_get_name().

int cpl_parameter_get_enum_int ( const cpl_parameter self,
int  position 
)

Get the possible values for an integer enumeration.

Parameters
selfAn enumeration parameter
positionPosition to look up in the list of possible values.
Returns
The integer value at position position in the list of possible values of the enumeration self. In case of an error the function returns 0 and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The class of the parameter self is not of the kind CPL_PARAMETER_CLASS_ENUM, or self is not of type CPL_TYPE_INT.
CPL_ERROR_ACCESS_OUT_OF_RANGE The requested index position position is out of range.

The function retrieves the integer value at position position from the list of enumeration values the parameter self can possibly take. For any valid enumeration parameter this list contains at least one value. The possible values are counted starting from 0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, CPL_PARAMETER_CLASS_ENUM, cpl_parameter_get_enum_size(), cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_INT.

int cpl_parameter_get_enum_size ( const cpl_parameter self)

Get the number of alternatives of an enumeration parameter.

Parameters
selfAn enumeration parameter.
Returns
The number of possible values the parameter self can take, or 0 if self does not point to a valid parameter, or the parameter is not an enumeration parameter. In case of an error the function also sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The class of the parameter self is not of the kind CPL_PARAMETER_CLASS_ENUM.

The function retrieves the number of possible alternatives for an enumeration parameter, which is always greater or equal than 1.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, CPL_PARAMETER_CLASS_ENUM, cpl_parameter_get_name(), cpl_parameter_get_type(), and cpl_type_get_name().

Referenced by cpl_parameter_get_enum_double(), cpl_parameter_get_enum_int(), and cpl_parameter_get_enum_string().

const char* cpl_parameter_get_enum_string ( const cpl_parameter self,
int  position 
)

Get the possible values for a string enumeration.

Parameters
selfAn enumeration parameter
positionPosition to look up in the list of possible values.
Returns
The string value at position position in the list of possible values of the enumeration self. In case of an error the function returns NULL and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The class of the parameter self is not of the kind CPL_PARAMETER_CLASS_ENUM, or self is not of type CPL_TYPE_STRING.
CPL_ERROR_ACCESS_OUT_OF_RANGE The requested index position position is out of range.

The function retrieves the read-only string value at position position from the list of enumeration values the parameter self can possibly take. For any valid enumeration parameter this list contains at least one value. The possible values are counted starting from 0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, CPL_PARAMETER_CLASS_ENUM, cpl_parameter_get_enum_size(), cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_STRING.

const char* cpl_parameter_get_help ( const cpl_parameter self)

Get the description of a parameter.

Parameters
selfA parameter.
Returns
The function returns the parameter description, or NULL if no description has been set. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the read-only short help of the parameter self. The parameter description must not be modified using the returned pointer.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header().

int cpl_parameter_get_id ( const cpl_parameter self)

Get the numerical identifier of the given parameter.

Parameters
selfA parameter.
Returns
The function returns the parameter's numerical identifier. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function looks up the numerical identifier of the given parameter self. A numerical identifier may be assigned to a parameter using cpl_parameter_set_id().

See also
cpl_parameter_set_id()

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

int cpl_parameter_get_int ( const cpl_parameter self)

Get the value of the given integer parameter.

Parameters
selfAn integer parameter.
Returns
The function returns the parameter's integer value. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_INT.

The current integer value of the parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_INT.

Referenced by cpl_dfs_setup_product_header().

double cpl_parameter_get_range_max_double ( const cpl_parameter self)

Get the maximum value of a double range parameter.

Parameters
selfA double range parameter.
Returns
The function returns the maximum double value the range parameter self can take. In case of an error, the function returns 0. and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The class of the parameter self is not of the kind CPL_PARAMETER_CLASS_RANGE, or self is not of type CPL_TYPE_DOUBLE.

The function retrieves the double value defined to be the upper limit of the double range parameter self.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, CPL_PARAMETER_CLASS_RANGE, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_DOUBLE, and cpl_type_get_name().

int cpl_parameter_get_range_max_int ( const cpl_parameter self)

Get the maximum value of an integer range parameter.

Parameters
selfAn integer range parameter.
Returns
The function returns the maximum integer value the range parameter self can take. In case of an error, the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The class of the parameter self is not of the kind CPL_PARAMETER_CLASS_RANGE, or self is not of type CPL_TYPE_INT.

The function retrieves the integer value defined to be the upper limit of the integer range parameter self.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, CPL_PARAMETER_CLASS_RANGE, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_INT.

double cpl_parameter_get_range_min_double ( const cpl_parameter self)

Get the minimum value of a double range parameter.

Parameters
selfA double range parameter.
Returns
The function returns the minimum double value the range parameter self can take. In case of an error, the function returns 0. and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The class of the parameter self is not of the kind CPL_PARAMETER_CLASS_RANGE, or self is not of type CPL_TYPE_DOUBLE.

The function retrieves the double value defined to be the lower limit of the double range parameter self.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, CPL_PARAMETER_CLASS_RANGE, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_DOUBLE, and cpl_type_get_name().

int cpl_parameter_get_range_min_int ( const cpl_parameter self)

Get the minimum value of an integer range parameter.

Parameters
selfAn integer range parameter.
Returns
The function returns the minimum integer value the range parameter self can take. In case of an error, the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The class of the parameter self is not of the kind CPL_PARAMETER_CLASS_RANGE, or self is not of type CPL_TYPE_INT.

The function retrieves the integer value defined to be the lower limit of the integer range parameter self.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, CPL_PARAMETER_CLASS_RANGE, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_INT.

const char* cpl_parameter_get_string ( const cpl_parameter self)

Get the value of the given string parameter.

Parameters
selfA string parameter.
Returns
The function returns the parameter's string value. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_STRING.

The current string value of the parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_STRING.

Referenced by cpl_dfs_setup_product_header().

const char* cpl_parameter_get_tag ( const cpl_parameter self)

Get the parameter's user tag.

Parameters
selfA parameter.
Returns
The function returns the parameter's user tag, or NULL if no user tag was previously set. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The current read-only setting of the user definable tag of the given parameter self is retrieved.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_parameterlist_find_tag_const().

int cpl_parameter_is_enabled ( const cpl_parameter self,
cpl_parameter_mode  mode 
)

Get the parameter's activity status for the environment context.

Parameters
selfA parameter.
modeThe parameter mode.
Returns
The function returns a non-zero value if the parameter is enabled for the environment context, or 0 if the parameter is not active. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter mode mode is not supported.

The function returns whether the parameter is enabled for the environment context or not. If the parameter is enabled for the context the application may modify the parameter's value if the parameter is referenced in the context specific input of the application. If the parameter is disabled, the application must not modify the parameter's value.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, cpl_parameter_get_name(), CPL_PARAMETER_MODE_CFG, CPL_PARAMETER_MODE_CLI, and CPL_PARAMETER_MODE_ENV.

cpl_parameter* cpl_parameter_new_enum ( const char *  name,
cpl_type  type,
const char *  description,
const char *  context,
  ... 
)

Create a new enumeration parameter.

Parameters
nameThe parameter's unique name
typeThe type of the parameter's current and default value.
descriptionAn optional comment or description of the parameter.
contextThe context to which the parameter belongs.
...Arguments used for parameter initialisation.
Returns
The function returns the newly created parameter, or NULL if the parameter could not be created. In the latter case an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_INVALID_TYPE An unsupported type was passed as type.

The function allocates memory for an enumeration parameter with the name name and a value type type. Optionally a comment describing the parameter may be passed by description and the context to which the parameter belongs may be given by context.

To properly initialise the newly created enumeration, the parameter's default value (together with the number of alternatives following) and the list of enumeration alternatives must be passed as the variable argument list arguments. The list of enumeration alternatives must contain the default value! Apart from the number of possible alternatives, which must be an argument of type int, the type of all initialisation arguments must match the parameter's value type as it is indicated by type.

The following example creates a string enumeration parameter with the unique name application.setup.enum which belongs to the context application.setup with the default def and 3 enumeration alternatives.

Example:
1 const char *first = "first";
2 const char *second = "second";
3 const char *third = "third";
4 
5 cpl_parameter *p = cpl_parameter_new_enum("application.setup.enum",
6  CPL_TYPE_STRING,
7  "An enum of type string",
8  "application.setup",
9  first, 3, first, second,
10  third);
See also
cpl_parameter_new_value(), cpl_parameter_new_range()

References CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_PARAMETER_CLASS_ENUM, cpl_parameter_delete(), and cpl_type_get_name().

cpl_parameter* cpl_parameter_new_range ( const char *  name,
cpl_type  type,
const char *  description,
const char *  context,
  ... 
)

Create a new range parameter.

Parameters
nameThe parameter's unique name
typeThe type of the parameter's current and default value.
descriptionAn optional comment or description of the parameter.
contextThe context to which the parameter belongs.
...Arguments used for parameter initialisation.
Returns
The function returns the newly created parameter, or NULL if the parameter could not be created. In the latter case an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_INVALID_TYPE An unsupported type was passed as type.

The function allocates memory for a range parameter with the name name and a value type type. Optionally a comment describing the parameter may be passed by description and the context to which the parameter belongs may be given by context.

To properly initialise the newly created range the parameters default value together with the minimum and maximum value of the range has to be passed as the variable argument list arguments. The type of all initialisation arguments must match the parameter's value type as it is indicated by type.

The following example creates a double range parameter with the unique name application.setup.range which belongs to the context application.setup with the default def and the range boundary values minimum and maximum.

Example:
1 double def = 0.5;
2 double min = 0.0;
3 double max = 1.0;
4 
5 cpl_parameter *p = cpl_parameter_new_range("application.setup.range",
6  CPL_TYPE_DOUBLE,
7  "A range of type double",
8  "application.setup",
9  def, min, max);
See also
cpl_parameter_new_value(), cpl_parameter_new_enum()

References CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_PARAMETER_CLASS_RANGE, cpl_parameter_delete(), and cpl_type_get_name().

cpl_parameter* cpl_parameter_new_value ( const char *  name,
cpl_type  type,
const char *  description,
const char *  context,
  ... 
)

Create a new value parameter.

Parameters
nameThe parameter's unique name
typeThe type of the parameter's current and default value.
descriptionAn optional comment or description of the parameter.
contextThe context to which the parameter belongs.
...Arguments used for parameter initialisation.
Returns
The function returns the newly created parameter, or NULL if the parameter could not be created. In the latter case an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter name is a NULL pointer.
CPL_ERROR_INVALID_TYPE An unsupported type was passed as type.

The function allocates memory for a value parameter with the name name and a value type type. Optionally a comment describing the parameter may be passed by description and the context to which the parameter belongs may be given by context.

The newly created parameter is initialised with the default value passed to the function as the only variable argument list argument. The type of the value must match the parameter's value type as it is indicated by type.

The following example creates an integer value parameter with the unique name application.setup.value which belongs to the context application.setup with the default value def

Example:
1 int def = 1;
2 
3 cpl_parameter *p = cpl_parameter_new_value("application.setup.value",
4  CPL_TYPE_INT,
5  "An integer value",
6  "application.setup",
7  def);
See also
cpl_parameter_new_range(), cpl_parameter_new_enum()

References CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_PARAMETER_CLASS_VALUE, cpl_parameter_delete(), and cpl_type_get_name().

cpl_error_code cpl_parameter_set_alias ( cpl_parameter self,
cpl_parameter_mode  mode,
const char *  alias 
)

Set alias names for the given parameter.

Parameters
selfA parameter
modeThe parameter mode for which the alias should be set.
aliasThe parameter's alias.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter mode mode is not supported.

The function assigns an alternative name to the parameter self for the given mode mode. This alias name may be used instead of the fully qualified parameter name in the context for which they have been set. If the alias name is NULL a previously set alias is deleted.

The context for which an alias is set is selected by the mode. The functions accepts the parameter modes CPL_PARAMETER_MODE_CFG, CPL_PARAMETER_MODE_CLI and CPL_PARAMETER_MODE_ENV.

See also
cpl_parameter_mode

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, cpl_parameter_get_name(), CPL_PARAMETER_MODE_CFG, CPL_PARAMETER_MODE_CLI, and CPL_PARAMETER_MODE_ENV.

cpl_error_code cpl_parameter_set_bool ( cpl_parameter self,
int  value 
)

Assign a boolean value to a parameter.

Parameters
selfThe parameter the value is assigned to.
valueThe boolean value to be assigned.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_BOOL.

The function assigns a boolean value value to a parameter of type CPL_TYPE_BOOL. Any non-zero value passed as value is interpreted as true.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_BOOL, and cpl_type_get_name().

cpl_error_code cpl_parameter_set_default_bool ( cpl_parameter self,
int  value 
)

Modify the default value of a boolean parameter.

Parameters
selfThe parameter whose default value is modified.
valueThe boolean value to be assigned.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_BOOL.

The function changes the default value of the parameter self to the boolean value value. The parameter self must be of type CPL_TYPE_BOOL. Any non-zero value passed as value is interpreted as true.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_BOOL, and cpl_type_get_name().

cpl_error_code cpl_parameter_set_default_double ( cpl_parameter self,
double  value 
)

Modify the default value of a double parameter.

Parameters
selfThe parameter whose default value is modified.
valueThe double value to be assigned.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_DOUBLE.

The function changes the default value of the parameter self to the double value value. The parameter self must be of type CPL_TYPE_DOUBLE.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_DOUBLE, and cpl_type_get_name().

cpl_error_code cpl_parameter_set_default_flag ( cpl_parameter self,
int  status 
)

Change the presence status flag of the given parameter.

Parameters
selfA parameter.
statusThe presence status value to assign.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function sets the presence status flag of the given parameter self to the value status. Any non-zero value means that the parameter is present. If the presence status should be changed to `not present' the argument status must be 0.

See also
cpl_parameter_get_default_flag()

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_parameter_set_default_int ( cpl_parameter self,
int  value 
)

Modify the default value of an integer parameter.

Parameters
selfThe parameter whose default value is modified.
valueThe integer value to be assigned.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_INT.

The function changes the default value of the parameter self to the integer value value. The parameter self must be of type CPL_TYPE_INT.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_INT.

cpl_error_code cpl_parameter_set_default_string ( cpl_parameter self,
const char *  value 
)

Modify the default value of a string parameter.

Parameters
selfThe parameter whose default value is modified.
valueThe string value to be assigned.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_STRING.

The function changes the default value of the parameter self to the string value value. The parameter self must be of type CPL_TYPE_STRING.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_STRING.

cpl_error_code cpl_parameter_set_double ( cpl_parameter self,
double  value 
)

Assign a double value to a parameter.

Parameters
selfThe parameter the value is assigned to.
valueThe double value to be assigned.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_DOUBLE.

The function assigns a double value value to a parameter of type CPL_TYPE_DOUBLE.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), CPL_TYPE_DOUBLE, and cpl_type_get_name().

cpl_error_code cpl_parameter_set_id ( cpl_parameter self,
int  id 
)

Set the numerical identifier of the given parameter.

Parameters
selfA parameter.
idNumerical identifier to assign.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function assigns a numerical identifier to the parameter self. The numerical value to be assigned to the parameter's numerical identifier member is passed as the argument id. The function does not do any checks on the numerical value of id. The numerical identifier may be used by an application to, for instance, assign a sequence number to the parameter.

See also
cpl_parameter_get_id()

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_parameter_set_int ( cpl_parameter self,
int  value 
)

Assign an integer value to a parameter.

Parameters
selfThe parameter the value is assigned to.
valueThe integer value to be assigned.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_INT.

The function assigns an integer value value to a parameter of type CPL_TYPE_INT.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_INT.

cpl_error_code cpl_parameter_set_string ( cpl_parameter self,
const char *  value 
)

Assign a string value to a parameter.

Parameters
selfThe parameter the value is assigned to.
valueThe string value to be assigned.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The type of the parameter self is not of type CPL_TYPE_STRING.

The function assigns a string value value to a parameter of type CPL_TYPE_STRING.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_error_set_message, CPL_ERROR_TYPE_MISMATCH, cpl_parameter_get_name(), cpl_parameter_get_type(), cpl_type_get_name(), and CPL_TYPE_STRING.

cpl_error_code cpl_parameter_set_tag ( cpl_parameter self,
const char *  tag 
)

Set the tag of the given parameter.

Parameters
selfA parameter.
tagTag string to assign.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function assigns a user definable tag tag to the parameter self. The function does not check the passed string tag in any way. The tag may be used by an application but it cannot rely on the contents of the parameter's tag.

See also
cpl_parameter_get_tag()

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl-6.6.1/html/group__cpl__matrix.html0000644000460300003120000065427512553662431014754 00000000000000 Common Pipeline Library Reference Manual: Matrices
Common Pipeline Library Reference Manual  6.6.1
Matrices

Functions

cpl_error_code cpl_matrix_add (cpl_matrix *matrix1, const cpl_matrix *matrix2)
 Add two matrices. More...
 
cpl_error_code cpl_matrix_add_scalar (cpl_matrix *matrix, double value)
 Add a scalar to a matrix. More...
 
cpl_error_code cpl_matrix_append (cpl_matrix *matrix1, const cpl_matrix *matrix2, int mode)
 Append a matrix to another. More...
 
cpl_error_code cpl_matrix_copy (cpl_matrix *matrix, const cpl_matrix *submatrix, cpl_size row, cpl_size col)
 Write the values of a matrix into another matrix. More...
 
cpl_error_code cpl_matrix_decomp_chol (cpl_matrix *self)
 Replace a matrix by its Cholesky-decomposition, L * transpose(L) = A. More...
 
void cpl_matrix_delete (cpl_matrix *matrix)
 Delete a matrix. More...
 
cpl_error_code cpl_matrix_divide (cpl_matrix *matrix1, const cpl_matrix *matrix2)
 Divide a matrix by another element by element. More...
 
cpl_error_code cpl_matrix_divide_scalar (cpl_matrix *matrix, double value)
 Divide a matrix by a scalar. More...
 
void cpl_matrix_dump (const cpl_matrix *matrix, FILE *stream)
 Print a matrix. More...
 
cpl_matrix * cpl_matrix_duplicate (const cpl_matrix *matrix)
 Make a copy of a matrix. More...
 
cpl_error_code cpl_matrix_erase_columns (cpl_matrix *matrix, cpl_size start, cpl_size count)
 Delete columns from a matrix. More...
 
cpl_error_code cpl_matrix_erase_rows (cpl_matrix *matrix, cpl_size start, cpl_size count)
 Delete rows from a matrix. More...
 
cpl_error_code cpl_matrix_exponential (cpl_matrix *matrix, double base)
 Compute the exponential of matrix elements. More...
 
cpl_matrix * cpl_matrix_extract (const cpl_matrix *matrix, cpl_size start_row, cpl_size start_column, cpl_size step_row, cpl_size step_column, cpl_size nrows, cpl_size ncolumns)
 Extract a submatrix from a matrix. More...
 
cpl_matrix * cpl_matrix_extract_column (const cpl_matrix *matrix, cpl_size column)
 Copy a matrix column. More...
 
cpl_matrix * cpl_matrix_extract_diagonal (const cpl_matrix *matrix, cpl_size diagonal)
 Extract a matrix diagonal. More...
 
cpl_matrix * cpl_matrix_extract_row (const cpl_matrix *matrix, cpl_size row)
 Extract a matrix row. More...
 
cpl_error_code cpl_matrix_fill (cpl_matrix *matrix, double value)
 Write the same value to all matrix elements. More...
 
cpl_error_code cpl_matrix_fill_column (cpl_matrix *matrix, double value, cpl_size column)
 Write the same value to a matrix column. More...
 
cpl_error_code cpl_matrix_fill_diagonal (cpl_matrix *matrix, double value, cpl_size diagonal)
 Write a given value to all elements of a given matrix diagonal. More...
 
cpl_error_code cpl_matrix_fill_row (cpl_matrix *matrix, double value, cpl_size row)
 Write the same value to a matrix row. More...
 
cpl_error_code cpl_matrix_fill_window (cpl_matrix *matrix, double value, cpl_size row, cpl_size col, cpl_size nrow, cpl_size ncol)
 Write the same value into a submatrix of a matrix. More...
 
cpl_error_code cpl_matrix_flip_columns (cpl_matrix *matrix)
 Reverse order of columns in matrix. More...
 
cpl_error_code cpl_matrix_flip_rows (cpl_matrix *matrix)
 Reverse order of rows in matrix. More...
 
double cpl_matrix_get (const cpl_matrix *matrix, cpl_size row, cpl_size column)
 Get the value of a matrix element. More...
 
double * cpl_matrix_get_data (cpl_matrix *matrix)
 Get the pointer to a matrix data buffer, or NULL in case of error. More...
 
const double * cpl_matrix_get_data_const (const cpl_matrix *matrix)
 Get the pointer to a matrix data buffer, or NULL in case of error. More...
 
double cpl_matrix_get_determinant (const cpl_matrix *matrix)
 Compute the determinant of a matrix. More...
 
double cpl_matrix_get_max (const cpl_matrix *matrix)
 Find the maximum value of matrix elements. More...
 
cpl_error_code cpl_matrix_get_maxpos (const cpl_matrix *matrix, cpl_size *row, cpl_size *column)
 Find position of the maximum value of matrix elements. More...
 
double cpl_matrix_get_mean (const cpl_matrix *matrix)
 Find the mean of all matrix elements. More...
 
double cpl_matrix_get_median (const cpl_matrix *matrix)
 Find the median of matrix elements. More...
 
double cpl_matrix_get_min (const cpl_matrix *matrix)
 Find the minimum value of matrix elements. More...
 
cpl_error_code cpl_matrix_get_minpos (const cpl_matrix *matrix, cpl_size *row, cpl_size *column)
 Find position of minimum value of matrix elements. More...
 
cpl_size cpl_matrix_get_ncol (const cpl_matrix *matrix)
 Get the number of columns of a matrix. More...
 
cpl_size cpl_matrix_get_nrow (const cpl_matrix *matrix)
 Get the number of rows of a matrix. More...
 
double cpl_matrix_get_stdev (const cpl_matrix *matrix)
 Find the standard deviation of matrix elements. More...
 
cpl_matrix * cpl_matrix_invert_create (const cpl_matrix *matrix)
 Find a matrix inverse. More...
 
int cpl_matrix_is_diagonal (const cpl_matrix *matrix, double tolerance)
 Check if a matrix is diagonal. More...
 
int cpl_matrix_is_identity (const cpl_matrix *matrix, double tolerance)
 Check for identity matrix. More...
 
int cpl_matrix_is_zero (const cpl_matrix *matrix, double tolerance)
 Check for zero matrix. More...
 
cpl_error_code cpl_matrix_logarithm (cpl_matrix *matrix, double base)
 Compute the logarithm of matrix elements. More...
 
cpl_error_code cpl_matrix_multiply (cpl_matrix *matrix1, const cpl_matrix *matrix2)
 Multiply two matrices element by element. More...
 
cpl_error_code cpl_matrix_multiply_scalar (cpl_matrix *matrix, double value)
 Multiply a matrix by a scalar. More...
 
cpl_matrix * cpl_matrix_new (cpl_size rows, cpl_size columns)
 Create a zero matrix of given size. More...
 
cpl_error_code cpl_matrix_power (cpl_matrix *matrix, double exponent)
 Compute a power of matrix elements. More...
 
cpl_matrix * cpl_matrix_product_create (const cpl_matrix *matrix1, const cpl_matrix *matrix2)
 Rows-by-columns product of two matrices. More...
 
cpl_error_code cpl_matrix_resize (cpl_matrix *matrix, cpl_size top, cpl_size bottom, cpl_size left, cpl_size right)
 Reframe a matrix. More...
 
cpl_error_code cpl_matrix_set (cpl_matrix *matrix, cpl_size row, cpl_size column, double value)
 Write a value to a matrix element. More...
 
cpl_error_code cpl_matrix_set_size (cpl_matrix *matrix, cpl_size rows, cpl_size columns)
 Resize a matrix. More...
 
cpl_error_code cpl_matrix_shift (cpl_matrix *matrix, cpl_size rshift, cpl_size cshift)
 Shift matrix elements. More...
 
cpl_matrix * cpl_matrix_solve (const cpl_matrix *coeff, const cpl_matrix *rhs)
 Solution of a linear system. More...
 
cpl_error_code cpl_matrix_solve_chol (const cpl_matrix *self, cpl_matrix *rhs)
 Solve a L*transpose(L)-system. More...
 
cpl_matrix * cpl_matrix_solve_normal (const cpl_matrix *coeff, const cpl_matrix *rhs)
 Solution of overdetermined linear equations in a least squares sense. More...
 
cpl_error_code cpl_matrix_sort_columns (cpl_matrix *matrix, int mode)
 Sort matrix by columns. More...
 
cpl_error_code cpl_matrix_sort_rows (cpl_matrix *matrix, int mode)
 Sort matrix by rows. More...
 
cpl_error_code cpl_matrix_subtract (cpl_matrix *matrix1, const cpl_matrix *matrix2)
 Subtract a matrix from another. More...
 
cpl_error_code cpl_matrix_subtract_scalar (cpl_matrix *matrix, double value)
 Subtract a scalar to a matrix. More...
 
cpl_error_code cpl_matrix_swap_columns (cpl_matrix *matrix, cpl_size column1, cpl_size column2)
 Swap two matrix columns. More...
 
cpl_error_code cpl_matrix_swap_rowcolumn (cpl_matrix *matrix, cpl_size row)
 Swap a matrix column with a matrix row. More...
 
cpl_error_code cpl_matrix_swap_rows (cpl_matrix *matrix, cpl_size row1, cpl_size row2)
 Swap two matrix rows. More...
 
cpl_error_code cpl_matrix_threshold_small (cpl_matrix *matrix, double tolerance)
 Rounding to zero very small numbers in matrix. More...
 
cpl_matrix * cpl_matrix_transpose_create (const cpl_matrix *matrix)
 Create transposed matrix. More...
 
void * cpl_matrix_unwrap (cpl_matrix *matrix)
 Delete a matrix, but not its data buffer. More...
 
cpl_matrix * cpl_matrix_wrap (cpl_size rows, cpl_size columns, double *data)
 Create a new matrix from existing data. More...
 

Detailed Description

This module provides functions to create, destroy and use a cpl_matrix. The elements of a cpl_matrix with M rows and N columns are counted from 0,0 to M-1,N-1. The matrix element 0,0 is the one at the upper left corner of a matrix. The CPL matrix functions work properly only in the case the matrices elements do not contain garbage (such as NaN or infinity).

Synopsis:
#include <cpl_matrix.h>

Function Documentation

cpl_error_code cpl_matrix_add ( cpl_matrix *  matrix1,
const cpl_matrix *  matrix2 
)

Add two matrices.

Parameters
matrix1Pointer to first matrix.
matrix2Pointer to second matrix.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT An input matrix is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The specified matrices do not have the same size.

Add two matrices element by element. The two matrices must have identical sizes. The result is written to the first matrix.

References CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_add_scalar ( cpl_matrix *  matrix,
double  value 
)

Add a scalar to a matrix.

Parameters
matrixPointer to matrix.
valueValue to add.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

Add the same value to each matrix element.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_append ( cpl_matrix *  matrix1,
const cpl_matrix *  matrix2,
int  mode 
)

Append a matrix to another.

Parameters
matrix1Pointer to first matrix.
matrix2Pointer to second matrix.
modeMatrices connected horizontally (0) or vertically (1).
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT An input matrix is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT mode is neither 0 nor 1.
CPL_ERROR_INCOMPATIBLE_INPUT Matrices cannot be joined as indicated by mode.

If mode is set to 0, the matrices must have the same number of rows, and are connected horizontally with the first matrix on the left. If mode is set to 1, the matrices must have the same number of columns, and are connected vertically with the first matrix on top. The first matrix is expanded to include the values from the second matrix, while the second matrix is left untouched.

Note
The pointer to the first matrix data buffer may change, therefore pointers previously retrieved by calling cpl_matrix_get_data() should be discarded.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_matrix_copy(), and cpl_matrix_resize().

cpl_error_code cpl_matrix_copy ( cpl_matrix *  matrix,
const cpl_matrix *  submatrix,
cpl_size  row,
cpl_size  col 
)

Write the values of a matrix into another matrix.

Parameters
matrixPointer to matrix to be modified.
submatrixPointer to matrix to get the values from.
rowPosition of row 0 of submatrix in matrix.
colPosition of column 0 of submatrix in matrix.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix or submatrix are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE No overlap exists between the two matrices.

The values of submatrix are written to matrix starting at the indicated row and column. There are no restrictions on the sizes of submatrix: just the parts of submatrix overlapping matrix are copied. There are no restrictions on row and col either, that can also be negative. If the two matrices do not overlap, nothing is done, but an error condition is set.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_matrix_append(), and cpl_matrix_resize().

cpl_error_code cpl_matrix_decomp_chol ( cpl_matrix *  self)

Replace a matrix by its Cholesky-decomposition, L * transpose(L) = A.

Parameters
selfN by N symmetric positive-definite matrix to decompose
Returns
CPL_ERROR_NONE on success, or the relevant CPL error code
Note
Only the upper triangle of self is read, L is written in the lower triangle
If the matrix is singular the elements of self become undefined
See also
Golub & Van Loan, Matrix Computations, Algorithm 4.2.1 (Cholesky: Gaxpy Version).
Errors
CPL_ERROR_NULL_INPUT An input pointer is NULL.
CPL_ERROR_ILLEGAL_INPUT self is not an n by n matrix.
CPL_ERROR_SINGULAR_MATRIX self is not symmetric, positive definite.

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_SINGULAR_MATRIX, cpl_matrix_get_data(), cpl_matrix_get_ncol(), cpl_matrix_get_nrow(), and CPL_SIZE_FORMAT.

void cpl_matrix_delete ( cpl_matrix *  matrix)

Delete a matrix.

Parameters
matrixPointer to a matrix to be deleted.
Returns
Nothing.

This function frees all the memory associated to a matrix. If matrix is NULL, nothing is done.

References cpl_free().

Referenced by cpl_fit_image_gaussian(), cpl_matrix_get_determinant(), cpl_matrix_invert_create(), cpl_matrix_solve(), cpl_matrix_solve_normal(), cpl_vector_fit_gaussian(), cpl_wcs_convert(), cpl_wcs_delete(), and cpl_wcs_platesol().

cpl_error_code cpl_matrix_divide ( cpl_matrix *  matrix1,
const cpl_matrix *  matrix2 
)

Divide a matrix by another element by element.

Parameters
matrix1Pointer to first matrix.
matrix2Pointer to second matrix.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT An input matrix is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The specified matrices do not have the same size.

Divide each element of the first matrix by the corresponding element of the second one. The two matrices must have the same number of rows and columns. The result is written to the first matrix. No check is made against a division by zero.

References CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_divide_scalar ( cpl_matrix *  matrix,
double  value 
)

Divide a matrix by a scalar.

Parameters
matrixPointer to matrix.
valueDivisor.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_DIVISION_BY_ZERO The input value is 0.0.

Divide each matrix element by the same value.

References CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

void cpl_matrix_dump ( const cpl_matrix *  matrix,
FILE *  stream 
)

Print a matrix.

Parameters
matrixThe matrix to print
streamThe output stream
Returns
Nothing.

This function is intended just for debugging. It just prints the elements of a matrix, ordered in rows and columns, to the specified stream or FILE pointer. If the specified stream is NULL, it is set to stdout. The function used for printing is the standard C fprintf().

References CPL_SIZE_FORMAT.

cpl_matrix* cpl_matrix_duplicate ( const cpl_matrix *  matrix)

Make a copy of a matrix.

Parameters
matrixMatrix to be duplicated.
Returns
Pointer to the new matrix, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

A copy of the input matrix is created. To destroy the duplicated matrix the function cpl_matrix_delete() should be used.

References CPL_ERROR_NULL_INPUT, and cpl_malloc().

Referenced by cpl_matrix_get_determinant(), cpl_matrix_invert_create(), and cpl_matrix_solve().

cpl_error_code cpl_matrix_erase_columns ( cpl_matrix *  matrix,
cpl_size  start,
cpl_size  count 
)

Delete columns from a matrix.

Parameters
matrixPointer to matrix to be modified.
startFirst column to delete.
countNumber of columns to delete.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The specified start is outside the matrix boundaries.
CPL_ERROR_ILLEGAL_INPUT count is not positive.
CPL_ERROR_ILLEGAL_OUTPUT Attempt to delete all the columns of matrix.

A portion of the matrix data is physically removed. The pointer to matrix data may change, therefore pointers previously retrieved by calling cpl_matrix_get_data() should be discarded. The specified segment can extend beyond the end of the matrix, but the attempt to remove all matrix columns is flagged as an error because zero length matrices are illegal. Columns are counted starting from 0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_realloc().

cpl_error_code cpl_matrix_erase_rows ( cpl_matrix *  matrix,
cpl_size  start,
cpl_size  count 
)

Delete rows from a matrix.

Parameters
matrixPointer to matrix to be modified.
startFirst row to delete.
countNumber of rows to delete.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The specified start is outside the matrix boundaries.
CPL_ERROR_ILLEGAL_INPUT count is not positive.
CPL_ERROR_ILLEGAL_OUTPUT Attempt to delete all the rows of matrix.

A portion of the matrix data is physically removed. The pointer to matrix data may change, therefore pointers previously retrieved by calling cpl_matrix_get_data() should be discarded. The specified segment can extend beyond the end of the matrix, but the attempt to remove all matrix rows is flagged as an error because zero length matrices are illegal. Rows are counted starting from 0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_realloc().

cpl_error_code cpl_matrix_exponential ( cpl_matrix *  matrix,
double  base 
)

Compute the exponential of matrix elements.

Parameters
matrixTarget matrix.
baseExponential base.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The input base is not positive.

Each matrix element is replaced by its exponential in the specified base. The base must be positive.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_matrix* cpl_matrix_extract ( const cpl_matrix *  matrix,
cpl_size  start_row,
cpl_size  start_column,
cpl_size  step_row,
cpl_size  step_column,
cpl_size  nrows,
cpl_size  ncolumns 
)

Extract a submatrix from a matrix.

Parameters
matrixPointer to the input matrix.
start_rowMatrix row where to begin extraction.
start_columnMatrix column where to begin extraction.
step_rowStep between extracted rows.
step_columnStep between extracted columns.
nrowsNumber of rows to extract.
ncolumnsNumber of columns to extract.
Returns
Pointer to the new matrix, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The start position is outside the matrix boundaries.
CPL_ERROR_ILLEGAL_INPUT While nrows and ncolumns are greater than 1, the specified steps are not positive.

The new matrix will include the nrows x ncolumns values read from the input matrix elements starting from position (start_row, start_column), in a grid of steps step_row and step_column. If the extraction parameters exceed the input matrix boundaries, just the overlap is returned, and this matrix would have sizes smaller than nrows x ncolumns. To destroy the new matrix the function cpl_matrix_delete() should be used.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_malloc().

Referenced by cpl_matrix_extract_column(), and cpl_matrix_extract_row().

cpl_matrix* cpl_matrix_extract_column ( const cpl_matrix *  matrix,
cpl_size  column 
)

Copy a matrix column.

Parameters
matrixPointer to matrix containing the column.
columnSequence number of column to copy.
Returns
Pointer to new matrix, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The column is outside the matrix boundaries.

If a MxN matrix is given in input, the extracted row is a new Mx1 matrix. The column number is counted from 0. To destroy the new matrix the function cpl_matrix_delete() should be used.

References CPL_ERROR_NULL_INPUT, cpl_error_set_where, and cpl_matrix_extract().

cpl_matrix* cpl_matrix_extract_diagonal ( const cpl_matrix *  matrix,
cpl_size  diagonal 
)

Extract a matrix diagonal.

Parameters
matrixPointer to the matrix containing the diagonal.
diagonalSequence number of the diagonal to copy.
Returns
Pointer to the new matrix, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The diagonal is outside the matrix boundaries (see description below).

If a MxN matrix is given in input, the extracted diagonal is a Mx1 matrix if N >= M, or a 1xN matrix if N < M. The diagonal number is counted from 0, corresponding to the matrix diagonal starting at element (0,0). A square matrix has just one diagonal; if M != N, the number of diagonals in the matrix is |M - N| + 1. To specify a diagonal sequence number outside this range would set an error condition, and a NULL pointer would be returned. To destroy the new matrix the function cpl_matrix_delete() should be used.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NULL_INPUT, and cpl_malloc().

cpl_matrix* cpl_matrix_extract_row ( const cpl_matrix *  matrix,
cpl_size  row 
)

Extract a matrix row.

Parameters
matrixPointer to the matrix containing the row.
rowSequence number of row to copy.
Returns
Pointer to new matrix, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The row is outside the matrix boundaries.

If a MxN matrix is given in input, the extracted row is a new 1xN matrix. The row number is counted from 0. To destroy the new matrix the function cpl_matrix_delete() should be used.

References CPL_ERROR_NULL_INPUT, cpl_error_set_where, and cpl_matrix_extract().

cpl_error_code cpl_matrix_fill ( cpl_matrix *  matrix,
double  value 
)

Write the same value to all matrix elements.

Parameters
matrixPointer to the matrix to access
valueValue to write
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

Write the same value to all matrix elements.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_fill_column ( cpl_matrix *  matrix,
double  value,
cpl_size  column 
)

Write the same value to a matrix column.

Parameters
matrixPointer to the matrix to access
valueValue to write
columnSequence number of column to overwrite
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The specified column is outside the matrix boundaries.

Write the same value to a matrix column. Columns are counted starting from 0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_fill_diagonal ( cpl_matrix *  matrix,
double  value,
cpl_size  diagonal 
)

Write a given value to all elements of a given matrix diagonal.

Parameters
matrixMatrix to modify
valueValue to write to diagonal
diagonalNumber of diagonal to overwrite, 0 for main, positive for above main, negative for below main
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The specified diagonal is outside the matrix boundaries (see description below).

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and CPL_SIZE_FORMAT.

cpl_error_code cpl_matrix_fill_row ( cpl_matrix *  matrix,
double  value,
cpl_size  row 
)

Write the same value to a matrix row.

Parameters
matrixMatrix to access
valueValue to write
rowSequence number of row to overwrite.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The specified row is outside the matrix boundaries.

Write the same value to a matrix row. Rows are counted starting from 0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_fill_window ( cpl_matrix *  matrix,
double  value,
cpl_size  row,
cpl_size  col,
cpl_size  nrow,
cpl_size  ncol 
)

Write the same value into a submatrix of a matrix.

Parameters
matrixPointer to matrix to be modified.
valueValue to write.
rowStart row of matrix submatrix.
colStart column of matrix submatrix.
nrowNumber of rows of matrix submatrix.
ncolNumber of columns of matrix submatrix.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The specified start position is outside the matrix boundaries.
CPL_ERROR_ILLEGAL_INPUT nrow or ncol are not positive.

The specified value is written to matrix starting at the indicated row and column; nrow and ncol can exceed the input matrix boundaries, just the range overlapping the matrix is used in that case.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_flip_columns ( cpl_matrix *  matrix)

Reverse order of columns in matrix.

Parameters
matrixPointer to matrix to be reversed.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The order of the columns in the matrix is reversed in place.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_matrix_swap_columns().

cpl_error_code cpl_matrix_flip_rows ( cpl_matrix *  matrix)

Reverse order of rows in matrix.

Parameters
matrixPointer to matrix to be reversed.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The order of the rows in the matrix is reversed in place.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

double cpl_matrix_get ( const cpl_matrix *  matrix,
cpl_size  row,
cpl_size  column 
)

Get the value of a matrix element.

Parameters
matrixPointer to a matrix.
rowMatrix element row.
columnMatrix element column.
Returns
Value of the specified matrix element, or 0.0 in case of error.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The accessed element is beyond the matrix boundaries.

Get the value of a matrix element. The matrix rows and columns are counted from 0,0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_fit_image_gaussian(), cpl_matrix_get_determinant(), cpl_matrix_get_max(), cpl_matrix_get_min(), cpl_vector_fill_polynomial_fit_residual(), and cpl_wcs_platesol().

double* cpl_matrix_get_data ( cpl_matrix *  matrix)

Get the pointer to a matrix data buffer, or NULL in case of error.

Parameters
matrixInput matrix.
Returns
Pointer to the matrix data buffer.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

A cpl_matrix object includes an array of values of type double. This function returns a pointer to this internal array, whose first element corresponds to the cpl_matrix element 0,0. The internal array contains in sequence all the cpl_matrix rows. For instance, in the case of a 3x4 matrix, the array elements

1 0 1 2 3 4 5 6 7 8 9 10 11

would correspond to the following matrix elements:

1 0 1 2 3
2 4 5 6 7
3 8 9 10 11
Note
Use at your own risk: direct manipulation of matrix data rules out any check performed by the matrix object interface, and may introduce inconsistencies between the information maintained internally, and the actual matrix data and structure.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_matrix_decomp_chol(), cpl_matrix_solve_chol(), cpl_polynomial_fit(), cpl_vector_fit_gaussian(), and cpl_wcs_convert().

const double* cpl_matrix_get_data_const ( const cpl_matrix *  matrix)

Get the pointer to a matrix data buffer, or NULL in case of error.

Parameters
matrixInput matrix.
Returns
Pointer to the matrix data buffer.
See also
cpl_matrix_get_data

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_image_filter(), cpl_matrix_solve_chol(), cpl_wcs_convert(), and cpl_wcs_platesol().

double cpl_matrix_get_determinant ( const cpl_matrix *  matrix)

Compute the determinant of a matrix.

Parameters
matrixPointer to n by n matrix.
Returns
Matrix determinant. In case of error, 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The input matrix is not square.
CPL_ERROR_UNSPECIFIED The input matrix is near-singular with a determinant so close to zero that it cannot be represented by a double.

The input matrix must be a square matrix. In case of a 1x1 matrix, the matrix single element value is returned.

References cpl_array_delete(), cpl_array_wrap_int(), cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_ERROR_SINGULAR_MATRIX, CPL_ERROR_UNSPECIFIED, cpl_errorstate_get(), cpl_errorstate_set(), cpl_malloc(), cpl_matrix_delete(), cpl_matrix_duplicate(), cpl_matrix_get(), and CPL_SIZE_FORMAT.

double cpl_matrix_get_max ( const cpl_matrix *  matrix)

Find the maximum value of matrix elements.

Parameters
matrixPointer to matrix.
Returns
Maximum value. In case of error, 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The maximum value of all matrix elements is found.

References cpl_matrix_get(), and cpl_matrix_get_maxpos().

cpl_error_code cpl_matrix_get_maxpos ( const cpl_matrix *  matrix,
cpl_size row,
cpl_size column 
)

Find position of the maximum value of matrix elements.

Parameters
matrixInput matrix.
rowReturned row position of maximum.
columnReturned column position of maximum.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The position of the maximum value of all matrix elements is found. If more than one matrix element have a value corresponding to the maximum, the lowest element row number is returned in row. If more than one maximum matrix elements have the same row number, the lowest element column number is returned in column.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_matrix_get_max().

double cpl_matrix_get_mean ( const cpl_matrix *  matrix)

Find the mean of all matrix elements.

Parameters
matrixPointer to matrix.
Returns
Mean. In case of error 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The mean value of all matrix elements is calculated.

Note
This function works properly only in the case all the elements of the input matrix do not contain garbage (such as NaN or infinity).

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_vector_fit_gaussian().

double cpl_matrix_get_median ( const cpl_matrix *  matrix)

Find the median of matrix elements.

Parameters
matrixPointer to matrix.
Returns
Median. In case of error 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The median value of all matrix elements is calculated.

References CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

double cpl_matrix_get_min ( const cpl_matrix *  matrix)

Find the minimum value of matrix elements.

Parameters
matrixPointer to matrix.
Returns
Minimum value. In case of error, 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The minimum value of all matrix elements is found.

References cpl_matrix_get(), and cpl_matrix_get_minpos().

cpl_error_code cpl_matrix_get_minpos ( const cpl_matrix *  matrix,
cpl_size row,
cpl_size column 
)

Find position of minimum value of matrix elements.

Parameters
matrixInput matrix.
rowReturned row position of minimum.
columnReturned column position of minimum.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The position of the minimum value of all matrix elements is found. If more than one matrix element have a value corresponding to the minimum, the lowest element row number is returned in row. If more than one minimum matrix elements have the same row number, the lowest element column number is returned in column.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_matrix_get_min().

cpl_size cpl_matrix_get_ncol ( const cpl_matrix *  matrix)

Get the number of columns of a matrix.

Parameters
matrixPointer to the matrix to examine.
Returns
Number of matrix columns, or zero in case of failure.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

Determine the number of columns in a matrix.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_image_filter(), cpl_matrix_decomp_chol(), cpl_matrix_solve_chol(), cpl_polynomial_fit(), cpl_ppm_match_points(), cpl_test_get_bytes_matrix(), cpl_vector_fill_polynomial_fit_residual(), and cpl_wcs_convert().

cpl_size cpl_matrix_get_nrow ( const cpl_matrix *  matrix)

Get the number of rows of a matrix.

Parameters
matrixPointer to the matrix to examine.
Returns
Number of matrix rows, or zero in case of failure.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

Determine the number of rows in a matrix.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_image_filter(), cpl_matrix_decomp_chol(), cpl_matrix_solve_chol(), cpl_polynomial_fit(), cpl_test_get_bytes_matrix(), cpl_vector_fill_polynomial_fit_residual(), cpl_wcs_convert(), and cpl_wcs_platesol().

double cpl_matrix_get_stdev ( const cpl_matrix *  matrix)

Find the standard deviation of matrix elements.

Parameters
matrixPointer to matrix.
Returns
Standard deviation. In case of error, or if a matrix is 1x1, 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The standard deviation of all matrix elements is calculated.

Note
This function works properly only in the case all the elements of the input matrix do not contain garbage (such as NaN or infinity).

References CPL_ERROR_NULL_INPUT.

cpl_matrix* cpl_matrix_invert_create ( const cpl_matrix *  matrix)

Find a matrix inverse.

Parameters
matrixPointer to matrix to invert.
Returns
Inverse matrix. In case of error a NULL is returned.
Errors
CPL_ERROR_NULL_INPUT Any input is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT self is not an n by n matrix.
CPL_ERROR_SINGULAR_MATRIX matrix cannot be inverted.

The input must be a square matrix. To destroy the new matrix the function cpl_matrix_delete() should be used.

Note
When calling cpl_matrix_invert_create() with a nearly singular matrix, it is possible to get a result containin NaN values without any error code being set.

References cpl_array_delete(), cpl_array_wrap_int(), cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_malloc(), cpl_matrix_delete(), cpl_matrix_duplicate(), cpl_matrix_new(), and cpl_matrix_set().

int cpl_matrix_is_diagonal ( const cpl_matrix *  matrix,
double  tolerance 
)

Check if a matrix is diagonal.

Parameters
matrixPointer to matrix to be checked.
toleranceMax tolerated rounding to zero.
Returns
1 in case of diagonal matrix, 0 otherwise. If a NULL pointer is passed, or the input matrix is not square, -1 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

A threshold may be specified to consider zero any number that is close enough to zero. If the specified tolerance is negative, a default of DBL_EPSILON is used. A zero tolerance may also be specified. No error is set if the input matrix is not square.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_matrix_is_identity().

int cpl_matrix_is_identity ( const cpl_matrix *  matrix,
double  tolerance 
)

Check for identity matrix.

Parameters
matrixPointer to matrix to be checked.
toleranceMax tolerated rounding to zero, or to one.
Returns
1 in case of identity matrix, 0 otherwise. If a NULL pointer is passed, or the input matrix is not square, -1 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

A threshold may be specified to consider zero any number that is close enough to zero, and 1 any number that is close enough to 1. If the specified tolerance is negative, a default of DBL_EPSILON is used. A zero tolerance may also be specified. No error is set if the input matrix is not square.

References CPL_ERROR_NULL_INPUT, and cpl_matrix_is_diagonal().

int cpl_matrix_is_zero ( const cpl_matrix *  matrix,
double  tolerance 
)

Check for zero matrix.

Parameters
matrixPointer to matrix to be checked.
toleranceMax tolerated rounding to zero.
Returns
1 in case of zero matrix, 0 otherwise. If a NULL pointer is passed, -1 is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

After specific manipulations of a matrix some of its elements may theoretically be expected to be zero. However, because of numerical noise, such elements may turn out not to be exactly zero. In this specific case, if any of the matrix element is not exactly zero, the matrix would not be classified as a null matrix. A threshold may be specified to consider zero any number that is close enough to zero. If the specified tolerance is negative, a default of DBL_EPSILON is used. A zero tolerance may also be specified.

References CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_logarithm ( cpl_matrix *  matrix,
double  base 
)

Compute the logarithm of matrix elements.

Parameters
matrixPointer to matrix.
baseLogarithm base.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The input base, or any matrix element, is not positive.

Each matrix element is replaced by its logarithm in the specified base. The base and all matrix elements must be positive. If this is not the case, the matrix would not be modified.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_multiply ( cpl_matrix *  matrix1,
const cpl_matrix *  matrix2 
)

Multiply two matrices element by element.

Parameters
matrix1Pointer to first matrix.
matrix2Pointer to second matrix.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT An input matrix is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The specified matrices do not have the same size.

Multiply the two matrices element by element. The two matrices must have identical sizes. The result is written to the first matrix.

Note
To obtain the rows-by-columns product between two matrices, cpl_matrix_product_create() should be used instead.

References CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_multiply_scalar ( cpl_matrix *  matrix,
double  value 
)

Multiply a matrix by a scalar.

Parameters
matrixPointer to matrix.
valueMultiplication factor.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

Multiply each matrix element by the same factor.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_matrix* cpl_matrix_new ( cpl_size  rows,
cpl_size  columns 
)

Create a zero matrix of given size.

Parameters
rowsNumber of matrix rows.
columnsNumber of matrix columns.
Returns
Pointer to new matrix, or NULL in case of error.
Errors
CPL_ERROR_ILLEGAL_INPUT rows or columns are not positive numbers.

This function allocates and initialises to zero a matrix of given size. To destroy this matrix the function cpl_matrix_delete() should be used.

References cpl_calloc(), CPL_ERROR_ILLEGAL_INPUT, and cpl_malloc().

Referenced by cpl_fit_image_gaussian(), cpl_matrix_invert_create(), cpl_matrix_resize(), and cpl_wcs_convert().

cpl_error_code cpl_matrix_power ( cpl_matrix *  matrix,
double  exponent 
)

Compute a power of matrix elements.

Parameters
matrixPointer to matrix.
exponentConstant exponent.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT Any matrix element is not compatible with the specified exponent (see description below).

Each matrix element is replaced by its power to the specified exponent. If the specified exponent is not negative, all matrix elements must be not negative; if the specified exponent is negative, all matrix elements must be positive; otherwise, an error condition is set and the matrix will be left unchanged. If the exponent is exactly 0.5 the (faster) sqrt() will be applied instead of pow(). If the exponent is zero, then any (non negative) matrix element would be assigned the value 1.0.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_matrix* cpl_matrix_product_create ( const cpl_matrix *  matrix1,
const cpl_matrix *  matrix2 
)

Rows-by-columns product of two matrices.

Parameters
matrix1Pointer to left side matrix.
matrix2Pointer to right side matrix.
Returns
Pointer to product matrix, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT An input matrix is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The number of columns of the first matrix is not equal to the number of rows of the second matrix.

Rows-by-columns product of two matrices. The number of columns of the first matrix must be equal to the number of rows of the second matrix. To destroy the new matrix the function cpl_matrix_delete() should be used.

References cpl_calloc(), cpl_ensure, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NULL_INPUT, and cpl_matrix_wrap().

Referenced by cpl_matrix_solve_normal().

cpl_error_code cpl_matrix_resize ( cpl_matrix *  matrix,
cpl_size  top,
cpl_size  bottom,
cpl_size  left,
cpl_size  right 
)

Reframe a matrix.

Parameters
matrixPointer to matrix to be modified.
topExtra rows on top.
bottomExtra rows on bottom.
leftExtra columns on left.
rightExtra columns on right.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT Attempt to shrink matrix to zero size (or less).

The input matrix is reframed according to specifications. Extra rows and column on the sides might also be negative, as long as they are compatible with the matrix sizes: the input matrix would be reduced in size accordingly, but an attempt to remove all matrix columns and/or rows is flagged as an error because zero length matrices are illegal. The old matrix elements contained in the new shape are left unchanged, and new matrix elements added by the reshaping are initialised to zero. No reshaping (i.e., all the extra rows set to zero) would not be flagged as an error.

Note
The pointer to the matrix data buffer may change, therefore pointers previously retrieved by calling cpl_matrix_get_data() should be discarded.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_matrix_copy(), cpl_matrix_new(), and cpl_matrix_unwrap().

Referenced by cpl_matrix_append(), and cpl_matrix_set_size().

cpl_error_code cpl_matrix_set ( cpl_matrix *  matrix,
cpl_size  row,
cpl_size  column,
double  value 
)

Write a value to a matrix element.

Parameters
matrixInput matrix.
rowMatrix element row.
columnMatrix element column.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The accessed element is beyond the matrix boundaries.

Write a value to a matrix element. The matrix rows and columns are counted from 0,0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_fit_image_gaussian(), and cpl_matrix_invert_create().

cpl_error_code cpl_matrix_set_size ( cpl_matrix *  matrix,
cpl_size  rows,
cpl_size  columns 
)

Resize a matrix.

Parameters
matrixPointer to matrix to be resized.
rowsNew number of rows.
columnsNew number of columns.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT Attempt to shrink matrix to zero size (or less).

The input matrix is resized according to specifications. The old matrix elements contained in the resized matrix are left unchanged, and new matrix elements added by an increase of the matrix number of rows and/or columns are initialised to zero.

Note
The pointer to the matrix data buffer may change, therefore pointers previously retrieved by calling cpl_matrix_get_data() should be discarded.

References CPL_ERROR_NONE, and cpl_matrix_resize().

cpl_error_code cpl_matrix_shift ( cpl_matrix *  matrix,
cpl_size  rshift,
cpl_size  cshift 
)

Shift matrix elements.

Parameters
matrixPointer to matrix to be modified.
rshiftShift in the vertical direction.
cshiftShift in the horizontal direction.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The performed shift operation is cyclical (toroidal), i.e., matrix elements shifted out of one side of the matrix get shifted in from its opposite side. There are no restrictions on the values of the shift. Positive shifts are always in the direction of increasing row/column indexes.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

cpl_matrix* cpl_matrix_solve ( const cpl_matrix *  coeff,
const cpl_matrix *  rhs 
)

Solution of a linear system.

Parameters
coeffA non-singular N by N matrix.
rhsA matrix containing one or more right-hand-sides.
Note
rhs must have N rows and may contain more than one column, which each represent an independent right-hand-side.
Returns
A newly allocated solution matrix with the size as rhs, or NULL on error.
Errors
CPL_ERROR_NULL_INPUT Any input is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT coeff is not a square matrix.
CPL_ERROR_INCOMPATIBLE_INPUT coeff and rhs do not have the same number of rows.
CPL_ERROR_SINGULAR_MATRIX coeff is singular (to working precision).

Compute the solution of a system of N equations with N unknowns:

coeff * X = rhs

coeff must be an NxN matrix, and rhs a NxM matrix. M greater than 1 means that multiple independent right-hand-sides are solved for. To destroy the solution matrix the function cpl_matrix_delete() should be used.

References cpl_array_delete(), cpl_array_wrap_int(), cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NULL_INPUT, cpl_malloc(), cpl_matrix_delete(), and cpl_matrix_duplicate().

cpl_error_code cpl_matrix_solve_chol ( const cpl_matrix *  self,
cpl_matrix *  rhs 
)

Solve a L*transpose(L)-system.

Parameters
selfN by N L*transpose(L)-matrix from cpl_matrix_decomp_chol()
rhsM right-hand-sides to be replaced by their solution
Returns
CPL_ERROR_NONE on success, or the relevant CPL error code
See also
cpl_matrix_decomp_chol()
Note
Only the lower triangle of self is accessed
Errors
CPL_ERROR_NULL_INPUT An input pointer is NULL.
CPL_ERROR_ILLEGAL_INPUT self is not an n by n matrix.
CPL_ERROR_INCOMPATIBLE_INPUT The specified matrices do not have the same number of rows.
CPL_ERROR_DIVISION_BY_ZERO The main diagonal of L contains a zero. This error can only occur if the L*transpose(L)-matrix does not come from a successful call to cpl_matrix_decomp_chol().

References cpl_ensure_code, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_matrix_get_data(), cpl_matrix_get_data_const(), cpl_matrix_get_ncol(), and cpl_matrix_get_nrow().

cpl_matrix* cpl_matrix_solve_normal ( const cpl_matrix *  coeff,
const cpl_matrix *  rhs 
)

Solution of overdetermined linear equations in a least squares sense.

Parameters
coeffThe N by M matrix of coefficients, where N >= M.
rhsAn N by K matrix containing K right-hand-sides.
Note
rhs may contain more than one column, which each represent an independent right-hand-side.
Returns
A newly allocated M by K solution matrix, or NULL on error.
Errors
CPL_ERROR_NULL_INPUT Any input is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT coeff and rhs do not have the same number of rows.
CPL_ERROR_SINGULAR_MATRIX The matrix is (near) singular and a solution cannot be computed.

The following linear system of N equations and M unknowns is given:

1 coeff * X = rhs

where coeff is the NxM matrix of the coefficients, X is the MxK matrix of the unknowns, and rhs the NxK matrix containing the K right hand side(s).

The solution to the normal equations is known to be a least-squares solution, i.e. the 2-norm of coeff * X - rhs is minimized by the solution to transpose(coeff) * coeff * X = transpose(coeff) * rhs.

In the case that coeff is square (N is equal to M) it gives a faster and more accurate result to use cpl_matrix_solve().

The solution matrix should be deallocated with the function cpl_matrix_delete().

References cpl_ensure, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NULL_INPUT, cpl_matrix_delete(), cpl_matrix_product_create(), and cpl_matrix_transpose_create().

cpl_error_code cpl_matrix_sort_columns ( cpl_matrix *  matrix,
int  mode 
)

Sort matrix by columns.

Parameters
matrixPointer to matrix to be sorted.
modeSorting mode: 0, by absolute value, otherwise by value.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The matrix elements of the top row are used as reference for the column sorting, if there are identical the values of the second row are considered, etc. Columns with the largest values go on the right. If mode is equal to zero, the columns are sorted according to their absolute values (zeroes at left).

References cpl_calloc(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

cpl_error_code cpl_matrix_sort_rows ( cpl_matrix *  matrix,
int  mode 
)

Sort matrix by rows.

Parameters
matrixPointer to matrix to be sorted.
modeSorting mode: 0, by absolute value, otherwise by value.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The matrix elements of the leftmost column are used as reference for the row sorting, if there are identical the values of the second column are considered, etc. Rows with the greater values go on top. If mode is equal to zero, the rows are sorted according to their absolute values (zeroes at bottom).

References cpl_calloc(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

cpl_error_code cpl_matrix_subtract ( cpl_matrix *  matrix1,
const cpl_matrix *  matrix2 
)

Subtract a matrix from another.

Parameters
matrix1Pointer to first matrix.
matrix2Pointer to second matrix.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT An input matrix is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The specified matrices do not have the same size.

Subtract the second matrix from the first one element by element. The two matrices must have identical sizes. The result is written to the first matrix.

References CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_subtract_scalar ( cpl_matrix *  matrix,
double  value 
)

Subtract a scalar to a matrix.

Parameters
matrixPointer to matrix.
valueValue to subtract.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

Subtract the same value to each matrix element.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_swap_columns ( cpl_matrix *  matrix,
cpl_size  column1,
cpl_size  column2 
)

Swap two matrix columns.

Parameters
matrixPointer to matrix to be modified.
column1One matrix column.
column2Another matrix column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE Any of the specified columns is outside the matrix boundaries.

The values of two given matrix columns are exchanged. Columns are counted starting from 0. If the same column number is given twice, nothing is done and no error is set.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_matrix_flip_columns().

cpl_error_code cpl_matrix_swap_rowcolumn ( cpl_matrix *  matrix,
cpl_size  row 
)

Swap a matrix column with a matrix row.

Parameters
matrixPointer to matrix to be modified.
rowMatrix row.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The specified row is outside the matrix boundaries.
CPL_ERROR_ILLEGAL_INPUT The input matrix is not square.

The values of the indicated row are exchanged with the column having the same sequence number. Rows and columns are counted starting from 0.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_swap_rows ( cpl_matrix *  matrix,
cpl_size  row1,
cpl_size  row2 
)

Swap two matrix rows.

Parameters
matrixPointer to matrix to be modified.
row1One matrix row.
row2Another matrix row.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE Any of the specified rows is outside the matrix boundaries.

The values of two given matrix rows are exchanged. Rows are counted starting from 0. If the same row number is given twice, nothing is done and no error is set.

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_matrix_threshold_small ( cpl_matrix *  matrix,
double  tolerance 
)

Rounding to zero very small numbers in matrix.

Parameters
matrixPointer to matrix to be chopped.
toleranceMax tolerated rounding to zero.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

After specific manipulations of a matrix some of its elements may theoretically be expected to be zero (for instance, as a result of multiplying a matrix by its inverse). However, because of numerical noise, such elements may turn out not to be exactly zero. With this function any very small number in the matrix is turned to exactly zero. If the tolerance is zero or negative, a default threshold of DBL_EPSILON is used.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_matrix* cpl_matrix_transpose_create ( const cpl_matrix *  matrix)

Create transposed matrix.

Parameters
matrixPointer to matrix to be transposed.
Returns
Pointer to transposed matrix. If a NULL pointer is passed, a NULL pointer is returned.
Errors
CPL_ERROR_NULL_INPUT The input matrix is a NULL pointer.

The transposed of the input matrix is created. To destroy the new matrix the function cpl_matrix_delete() should be used.

References CPL_ERROR_NULL_INPUT, cpl_malloc(), and cpl_matrix_wrap().

Referenced by cpl_matrix_solve_normal().

void* cpl_matrix_unwrap ( cpl_matrix *  matrix)

Delete a matrix, but not its data buffer.

Parameters
matrixPointer to a matrix to be deleted.
Returns
Pointer to the internal data buffer.

This function deallocates all the memory associated to a matrix, with the exception of its data buffer. This type of destructor should be used on matrices created with the cpl_matrix_wrap() constructor, if the data buffer specified then was not allocated using the functions of the cpl_memory module. In such a case, the data buffer should be deallocated separately. See the documentation of the function cpl_matrix_wrap(). If matrix is NULL, nothing is done, and a NULL pointer is returned.

References cpl_free().

Referenced by cpl_matrix_resize(), and cpl_vector_fit_gaussian().

cpl_matrix* cpl_matrix_wrap ( cpl_size  rows,
cpl_size  columns,
double *  data 
)

Create a new matrix from existing data.

Parameters
dataExisting data buffer.
rowsNumber of matrix rows.
columnsNumber of matrix columns.
Returns
Pointer to new matrix, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT The input data is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT rows or columns are not positive numbers.

This function creates a new matrix that will encapsulate the given data. At any error condition, a NULL pointer would be returned. Note that the size of the input data array is not checked in any way, and it is expected to match the specified matrix sizes. The input array is supposed to contain in sequence all the new cpl_matrix rows. For instance, in the case of a 3x4 matrix, the input array should contain 12 elements

1 0 1 2 3 4 5 6 7 8 9 10 11

that would correspond to the matrix elements

1 0 1 2 3
2 4 5 6 7
3 8 9 10 11

The data buffer is not copied, so it should not be deallocated while the matrix is still in use: the function cpl_matrix_delete() would take care of deallocating it. To avoid problems with the memory managment, the specified data buffer should be allocated using the functions of the cpl_memory module, and also statically allocated data should be strictly avoided. If this were not the case, this matrix should not be destroyed using cpl_matrix_delete(), but cpl_matrix_unwrap() should be used instead; moreover, functions implying memory handling (as cpl_matrix_set_size(), or cpl_matrix_delete_row() ) should not be used.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_malloc().

Referenced by cpl_matrix_product_create(), cpl_matrix_transpose_create(), and cpl_vector_fit_gaussian().

cpl-6.6.1/html/tab_s.png0000644000460300003120000000027012553662426011770 00000000000000‰PNG  IHDR$ÇÇ[IDATxíÝ ‚@@Ñ£?Q…¤"š¢%¦I‘—Šf–6[´HÃäQƒ<Þâõþ]ždr Í’s?ˆO=Ñññw'ÌF‡Ž íðö-~rÃ[œèŠ­ì¬mƒÖ¬ƒݯнŠÕF)Yº% §`nÌ,9B ™’©!ÑŒ\ý<Å#üîî•IEND®B`‚cpl-6.6.1/html/group__cpl__dfs.html0000644000460300003120000017124612553662432014215 00000000000000 Common Pipeline Library Reference Manual: DFS related functions
Common Pipeline Library Reference Manual  6.6.1
DFS related functions

Macros

#define CPL_DFS_PRO_CATG   "ESO PRO CATG"
 The name of the Product Category key. More...
 
#define CPL_DFS_PRO_SCIENCE   "ESO PRO SCIENCE"
 The name of the Product Science key. More...
 
#define CPL_DFS_PRO_TECH   "ESO PRO TECH"
 The name of the Product Tech key. More...
 
#define CPL_DFS_PRO_TYPE   "ESO PRO TYPE"
 The name of the Product Type key. More...
 

Enumerations

enum  {
  CPL_DFS_SIGNATURE_NONE,
  CPL_DFS_SIGNATURE_DATAMD5,
  CPL_DFS_SIGNATURE_CHECKSUM
}
 Pipeline products digital signature flags. More...
 

Functions

cpl_error_code cpl_dfs_save_imagelist (cpl_frameset *allframes, cpl_propertylist *header, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_frame *inherit, const cpl_imagelist *imagelist, cpl_type type, const char *recipe, const cpl_propertylist *applist, const char *remregexp, const char *pipe_id, const char *filename)
 Save an imagelist as a DFS-compliant pipeline product. More...
 
cpl_error_code cpl_dfs_save_paf (const char *instrume, const char *recipe, const cpl_propertylist *paflist, const char *filename)
 Create a new PAF file. More...
 
cpl_error_code cpl_dfs_save_propertylist (cpl_frameset *allframes, cpl_propertylist *header, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_frame *inherit, const char *recipe, const cpl_propertylist *applist, const char *remregexp, const char *pipe_id, const char *filename)
 Save a propertylist as a DFS-compliant pipeline product. More...
 
cpl_error_code cpl_dfs_save_table (cpl_frameset *allframes, cpl_propertylist *header, const cpl_parameterlist *parlist, const cpl_frameset *usedframes, const cpl_frame *inherit, const cpl_table *table, const cpl_propertylist *tablelist, const char *recipe, const cpl_propertylist *applist, const char *remregexp, const char *pipe_id, const char *filename)
 Save a table as a DFS-compliant pipeline product. More...
 
cpl_error_code cpl_dfs_setup_product_header (cpl_propertylist *header, const cpl_frame *product_frame, const cpl_frameset *framelist, const cpl_parameterlist *parlist, const char *recid, const char *pipeline_id, const char *dictionary_id, const cpl_frame *inherit_frame)
 Add product keywords to a pipeline product property list. More...
 
cpl_error_code cpl_dfs_sign_products (const cpl_frameset *set, unsigned int flags)
 Update DFS and DICB required header information of product frames. More...
 
cpl_error_code cpl_dfs_update_product_header (cpl_frameset *self)
 Perform any DFS-compliancy required actions (DATAMD5/PIPEFILE update) More...
 

Detailed Description

Macro Definition Documentation

#define CPL_DFS_PRO_CATG   "ESO PRO CATG"

The name of the Product Category key.

See also
cpl_dfs_save_image()
Note
A pipeline product must contain a string property with this name
#define CPL_DFS_PRO_SCIENCE   "ESO PRO SCIENCE"

The name of the Product Science key.

See also
cpl_dfs_save_image()
Note
A pipeline product should contain a boolean property with this name
#define CPL_DFS_PRO_TECH   "ESO PRO TECH"

The name of the Product Tech key.

See also
cpl_dfs_save_image()
Note
A pipeline product should contain a string property with this name
#define CPL_DFS_PRO_TYPE   "ESO PRO TYPE"

The name of the Product Type key.

See also
cpl_dfs_save_image()
Note
A pipeline product should contain a string property with this name

Enumeration Type Documentation

anonymous enum

Pipeline products digital signature flags.

Flags to select the different digital signatures to compute for pipeline product files. The values may be combined using bitwise or.

Enumerator
CPL_DFS_SIGNATURE_NONE 

Do not compute any signatures

CPL_DFS_SIGNATURE_DATAMD5 

Compute the DATAMD5 data hash

CPL_DFS_SIGNATURE_CHECKSUM 

Compute FITS standard CHECKSUM and DATASUM

Function Documentation

cpl_error_code cpl_dfs_save_imagelist ( cpl_frameset allframes,
cpl_propertylist header,
const cpl_parameterlist parlist,
const cpl_frameset usedframes,
const cpl_frame inherit,
const cpl_imagelist *  imagelist,
cpl_type  type,
const char *  recipe,
const cpl_propertylist applist,
const char *  remregexp,
const char *  pipe_id,
const char *  filename 
)

Save an imagelist as a DFS-compliant pipeline product.

Parameters
allframesThe list of input frames for the recipe
headerNULL, or filled with properties written to product header
parlistThe list of input parameters
usedframesThe list of raw/calibration frames used for this product
inheritNULL or product frames inherit their header from this frame
imagelistThe imagelist to be saved
typeThe type used to represent the data in the file
recipeThe recipe name
applistPropertylist to append to primary header, w. PRO.CATG
remregexpOptional regexp of properties not to put in main header
pipe_idPACKAGE "/" PACKAGE_VERSION
filenameFilename of created product
Note
remregexp may be NULL
Returns
CPL_ERROR_NONE or the relevant CPL error code on error
See also
cpl_dfs_save_image(), cpl_imagelist_save().

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_dfs_save_paf ( const char *  instrume,
const char *  recipe,
const cpl_propertylist paflist,
const char *  filename 
)

Create a new PAF file.

Parameters
instrumeName of instrument in capitals (NACO, VISIR, etc.)
recipeName of recipe
paflistPropertylist to save
filenameFilename of created PArameter File
Returns
CPL_ERROR_NONE or the relevant CPL error code on error
See also
cpl_dfs_save_image().

The example below shows how to create a PAF from some FITS cards from the file ref_file and QC parameters in a propertylist qclist. Please note that qclist can be used also in calls to cpl_dfs_save_image() and cpl_dfs_save_table(). Error handling is omitted for brevity:

1 const char pafcopy[] = "^(DATE-OBS|ARCFILE|ESO TPL ID|ESO DET DIT|MJD-OBS)$";
2 cpl_propertylist * paflist = cpl_propertylist_load_regexp(ref_file, 0,
3  pafcopy, 0);
4 
5 cpl_propertylist_append(paflist, qclist);
6 
7 cpl_dfs_save_paf("IIINSTRUMENT", "rrrecipe", paflist, "rrrecipe.paf");
8 
9 cpl_propertylist_delete(paflist);

References cpl_ensure_code, CPL_ERROR_FILE_IO, cpl_error_get_code(), CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_dfs_save_propertylist ( cpl_frameset allframes,
cpl_propertylist header,
const cpl_parameterlist parlist,
const cpl_frameset usedframes,
const cpl_frame inherit,
const char *  recipe,
const cpl_propertylist applist,
const char *  remregexp,
const char *  pipe_id,
const char *  filename 
)

Save a propertylist as a DFS-compliant pipeline product.

Parameters
allframesThe list of input frames for the recipe
headerNULL, or filled with properties written to product header
parlistThe list of input parameters
usedframesThe list of raw/calibration frames used for this product
inheritNULL or product frames inherit their header from this frame
recipeThe recipe name
applistPropertylist to append to primary header, w. PRO.CATG
remregexpOptional regexp of properties not to put in main header
pipe_idPACKAGE "/" PACKAGE_VERSION
filenameFilename of created product
Note
remregexp may be NULL
Returns
CPL_ERROR_NONE or the relevant CPL error code on error
See also
cpl_dfs_save_image(), cpl_propertylist_save().

The FITS header of the created product is created from the provided applist and the cards copied by cpl_dfs_setup_product_header(), with exception of the cards whose keys match the provided remregexp.

The FITS data unit will be empty.

References CPL_ERROR_NONE, and CPL_TYPE_INVALID.

cpl_error_code cpl_dfs_save_table ( cpl_frameset allframes,
cpl_propertylist header,
const cpl_parameterlist parlist,
const cpl_frameset usedframes,
const cpl_frame inherit,
const cpl_table *  table,
const cpl_propertylist tablelist,
const char *  recipe,
const cpl_propertylist applist,
const char *  remregexp,
const char *  pipe_id,
const char *  filename 
)

Save a table as a DFS-compliant pipeline product.

Parameters
allframesThe list of input frames for the recipe
headerNULL, or filled with properties written to product header
parlistThe list of input parameters
usedframesThe list of raw/calibration frames used for this product
inheritNULL or product frames inherit their header from this frame
tableThe table to be saved
tablelistOptional propertylist to use in table extension or NULL
recipeThe recipe name
applistPropertylist to append to primary header, w. PRO.CATG
remregexpOptional regexp of properties not to put in main header
pipe_idPACKAGE "/" PACKAGE_VERSION
filenameFilename of created product
Returns
CPL_ERROR_NONE or the relevant CPL error code on error
See also
cpl_dfs_save_image(), cpl_table_save().

References cpl_ensure_code, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and CPL_TYPE_INVALID.

cpl_error_code cpl_dfs_setup_product_header ( cpl_propertylist header,
const cpl_frame product_frame,
const cpl_frameset framelist,
const cpl_parameterlist parlist,
const char *  recid,
const char *  pipeline_id,
const char *  dictionary_id,
const cpl_frame inherit_frame 
)

Add product keywords to a pipeline product property list.

Parameters
headerProperty list where keywords must be written
product_frameFrame describing the product
framelistList of frames including all input frames
parlistRecipe parameter list
recidRecipe name
pipeline_idPipeline unique identifier
dictionary_idPRO dictionary identifier
inherit_frameFrame from which header information is inherited
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT An input pointer is NULL.
CPL_ERROR_DATA_NOT_FOUND The input framelist contains no input frames or a frame in the input framelist does not specify a file. In the former case the string "Empty set-of-frames" is appended to the error message returned by cpl_error_get_message().
CPL_ERROR_ILLEGAL_INPUT The product frame is not tagged or not grouped as CPL_FRAME_GROUP_PRODUCT. A specified inherit_frame doesn't belong to the input frame list, or it is not in FITS format.
CPL_ERROR_FILE_NOT_FOUND A frame in the input framelist specifies a non-existing file.
CPL_ERROR_BAD_FILE_FORMAT A frame in the input framelist specifies an invalid file.

This function checks the header associated to a pipeline product, to ensure that it is DICB compliant. In particular, this function does the following:

  1. Selects a reference frame from which the primary and secondary keyword information is inherited. The primary information is contained in the FITS keywords ORIGIN, TELESCOPE, INSTRUME, OBJECT, RA, DEC, EPOCH, EQUINOX, RADECSYS, DATE-OBS, MJD-OBS, UTC, LST, PI-COI, OBSERVER, while the secondary information is contained in all the other keywords. If the inherit_frame is just a NULL pointer, both primary and secondary information is inherited from the first frame in the input framelist with group CPL_FRAME_GROUP_RAW, or if no such frames are present the first frame with group CPL_FRAME_GROUP_CALIB. If inherit_frame is non-NULL, the secondary information is inherited from inherit_frame instead.
  2. Copy to header, if they are present, the following primary FITS keywords from the first input frame in the framelist: ORIGIN, TELESCOPE, INSTRUME, OBJECT, RA, DEC, EPOCH, EQUINOX, RADECSYS, DATE-OBS, MJD-OBS, UTC, LST, PI-COI, OBSERVER. If those keywords are already present in the header property list, they are overwritten only in case they have the same type. If any of these keywords are present with an unexpected type, a warning is issued, but the keywords are copied anyway (provided that the above conditions are fulfilled), and no error is set.
  3. Copy all the HIERARCH.ESO._ keywords from the primary FITS header of the inherit_frame in framelist, with the exception of the HIERARCH.ESO.DPR._, and of the .PRO._ and .DRS._ keywords if the inherit_frame is a calibration. If those keywords are already present in header, they are overwritten.
  4. If found, remove the HIERARCH.ESO.DPR._ keywords from header.
  5. If found, remove the ARCFILE and ORIGFILE keywords from header.
  6. Add to header the following mandatory keywords from the PRO dictionary: PIPEFILE, PRO.DID, PRO.REC1.ID, PRO.REC1.DRS.ID, PRO.REC1.PIPE.ID, and PRO.CATG. If those keywords are already present in header, they are overwritten. The keyword PRO.CATG is always set identical to the tag in product_frame.
  7. Only if missing, add to header the following mandatory keywords from the PRO dictionary: PRO.TYPE, PRO.TECH, and PRO.SCIENCE. The keyword PRO.TYPE will be set to "REDUCED". If the keyword DPR.TECH is found in the header of the first frame, PRO.TECH is given its value, alternatively if the keyword PRO.TECH is found it is copied instead, and if all fails the value "UNDEFINED" is set. Finally, if the keyword DPR.CATG is found in the header of the first frame and is set to "SCIENCE", the boolean keyword PRO.SCIENCE will be set to "true", otherwise it will be copied from an existing PRO.SCIENCE jeyword, while it will be set to "false" in all other cases.
  8. Check the existence of the keyword PRO.DATANCOM in header. If this keyword is missing, one is added, with the value of the total number of raw input frames.
  9. Add to header the keywords PRO.REC1.RAW1.NAME, PRO.REC1.RAW1.CATG, PRO.REC1.CAL1.NAME, PRO.REC1.CAL1.CATG, to describe the content of the input set-of-frames.

See the DICB PRO dictionary to have details on the mentioned PRO keywords.

Note
Non-FITS files are handled as files with an empty FITS header.

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_FILE_NOT_FOUND, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, cpl_errorstate_get(), cpl_errorstate_set(), cpl_frame_get_filename(), cpl_frame_get_group(), cpl_frame_get_tag(), CPL_FRAME_GROUP_CALIB, CPL_FRAME_GROUP_PRODUCT, CPL_FRAME_GROUP_RAW, cpl_frameset_get_size(), cpl_frameset_iterator_advance(), cpl_frameset_iterator_delete(), cpl_frameset_iterator_get_const(), cpl_frameset_iterator_new(), cpl_frameset_iterator_reset(), cpl_free(), cpl_msg_warning(), cpl_parameter_get_alias(), cpl_parameter_get_bool(), cpl_parameter_get_default_bool(), cpl_parameter_get_default_double(), cpl_parameter_get_default_int(), cpl_parameter_get_default_string(), cpl_parameter_get_double(), cpl_parameter_get_help(), cpl_parameter_get_int(), cpl_parameter_get_string(), cpl_parameter_get_type(), CPL_PARAMETER_MODE_CLI, cpl_parameterlist_get_first_const(), cpl_parameterlist_get_next_const(), cpl_propertylist_append_string(), cpl_propertylist_copy_property(), cpl_propertylist_copy_property_regexp(), cpl_propertylist_delete(), cpl_propertylist_erase(), cpl_propertylist_erase_regexp(), cpl_propertylist_get_bool(), cpl_propertylist_get_string(), cpl_propertylist_get_type(), cpl_propertylist_has(), cpl_propertylist_load_regexp(), cpl_propertylist_new(), cpl_propertylist_set_comment(), cpl_propertylist_update_bool(), cpl_propertylist_update_int(), cpl_propertylist_update_string(), cpl_sprintf(), cpl_strdup(), CPL_TYPE_BOOL, CPL_TYPE_DOUBLE, CPL_TYPE_INT, and CPL_TYPE_STRING.

cpl_error_code cpl_dfs_sign_products ( const cpl_frameset set,
unsigned int  flags 
)

Update DFS and DICB required header information of product frames.

Parameters
setThe frameset from which the product frames are taken.
flagsBit mask for selecting the digital signatures to be written.
Returns
The function returns CPL_ERROR_NONE on success, or an appropriate CPL error code otherwise.
Note
Each product frame must correspond to a FITS file created with a CPL FITS saving function.

The function takes all frames marked as products from the input frameset set. For each product the header information PIPEFILE is updated unconditionally. In addition, depending on the bit mask flags, the DATAMD5 data hash and/or the standard FITS checksums are computed and written to the product header. If a digital signature is not selected by flags when the function is called, its corresponding header keyword(s) are removed from the product frame.

Errors
CPL_ERROR_NULL_INPUT An input pointer is NULL.
CPL_ERROR_DATA_NOT_FOUND The input framelist contains a frame of type product with a missing filename.
CPL_ERROR_BAD_FILE_FORMAT The input framelist contains a frame of type product without a FITS card with key 'DATAMD5'.
CPL_ERROR_FILE_IO The input framelist contains a frame of type product for which the FITS card with key 'DATAMD5' could not be updated.

References CPL_DFS_SIGNATURE_NONE, cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_set(), cpl_frame_get_group(), CPL_FRAME_GROUP_PRODUCT, cpl_frameset_is_empty(), cpl_frameset_iterator_advance(), cpl_frameset_iterator_delete(), cpl_frameset_iterator_get_const(), and cpl_frameset_iterator_new().

cpl_error_code cpl_dfs_update_product_header ( cpl_frameset self)

Perform any DFS-compliancy required actions (DATAMD5/PIPEFILE update)

Parameters
selfThe list of frames with FITS products created by the recipe
Returns
CPL_ERROR_NONE or the relevant CPL error code on error
Note
Each product frame must correspond to a FITS file created with a CPL FITS saving function.
Errors
CPL_ERROR_NULL_INPUT An input pointer is NULL.
CPL_ERROR_DATA_NOT_FOUND The input framelist contains a frame of type product with a missing filename.
CPL_ERROR_BAD_FILE_FORMAT The input framelist contains a frame of type product without a FITS card with key 'DATAMD5'.
CPL_ERROR_FILE_IO The input framelist contains a frame of type product for which the FITS card with key 'DATAMD5' could not be updated.

References CPL_ERROR_NONE.

cpl-6.6.1/html/form_18.png0000644000460300003120000000106412553662437012157 00000000000000‰PNG  IHDR>;ÒÉÅ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï£IDATxíÝŽÜ F„Ÿ@xÿ·]'M· ;Ò0 UªTËç&Âlóùào²”Ã<Àn•U‚Œ`pÖ®ƒDÂLx~n»o>wO&ô`@,póÍQÀv‡2žŽ .CÔ·úÌÄËÞïj4ÔU€òÙ³å–*«¡©½º½L üq¹ì¶²"¸»¬—55h)ÛŸô"e}‰i¼JxÔñ&)šèÐ['€'F“ÛLô3Ñ¢Ç ›ŠSÑ^{dTh5mU­•€NžðoÓñ,^c6 @&׺«´ÞRy<UË­;æÊú£’ú©t?kh3£Ê¡ÓÀÝ%\ÖLcÝ®mgDëí¸âviÖý”Ä_¿ÒHm9çvÒu`Û:»Ø/K<å-; ‘­tU€†ÅoM­ºñl3Ú¾¬3Ñÿ˜Ä…¹2Ô9ퟘçá³™9}L¦·…jÝ©á9w>кóê©ol½Ð:¬nÙLüwZ§“á[\mÂ6×y£u²º²~Ç—:3÷[ëXîbóiד¬Œ×Úù°65ø˜/ð úEˆIEND®B`‚cpl-6.6.1/html/doxygen.png0000644000460300003120000000730312553662426012361 00000000000000‰PNG  IHDRh ;ˆØŠIDATxí]y\•Õº~45%TL Q”PE"q–Û11±]8a„w*©¨(*â" ˆzÀè`8 ¨‰¢mÅ,’òà„p$%”œBó(8k†Ü÷ýÜû6lòö»§k÷Ç÷[ÏÞß·Ö;?k½ëßÕÕÕPxÑêÏ't´ÏùÈ€zÀÇÅ3_€Q4€g@œmÿ ¾ò‰âci‰ôçÿ{ ðÇð¬ù~½Á€4:õHcÂü ðŸÁ³„ª'ÕPÆæ P7^h،♠zb„cóP¨„ 3‚† Ò}çÿO²qÁºNkÝTÛ(É?d Ç~z<’«4Óǡ؞Þv­zµÙ¦õ¬ZâdÛ,Ë6Ók±]Fz< ¾ZçƒsÕ?ìƒsUø2SÉåwê1”c`[ì—}%ѽ.Ô¼6‚BLZ˜û!F8[ ¹…×TéÛ— »Þ#gó]å:vžu?‡vèbÙR˜?wùŽŸ¾ÊÐgbÑÉÌÕ$kF~Ê;عÆ•¢ïX®?ÉèlÆÙôõà»Nʪ¼­,ìHC§gAz•ÆlÓº­gÑú ]œjÎñåM…3ÓÚæoÒ³'=‘$Ò÷f}G•ŸS_‡öèco.Êȹ :ó£ Ãds®Ù:1=¼{ƒå9?÷ý…zqÛvîÓi‰D’p¿Ë šmÙíoÛâýaÖüEqÒµwÌ}¿~{òj€ç{ôºŸFNëí[ëOq·ÇOSúXO]°>‚‚muæÄ¾e¤“5Ë{¨JÕ¯£(›´«bÂçû’ÍlÓÅ}žïú`éUÞy„ac§Á†ÔCºŠóAkl‘±y¥†ô¢ùôs÷Aø¬7ÄõôoJ±äÄ ù.¥Be. Z¬Ð×ÇÈöå¹­ù'Ù-PëìŠyF.ž‚žÝÚ€lp&.êˆð•jò7’re’z19»ã§HGíø%œüq°ïüz׈c¬_k_")ŸHJnÐÑ~ˆÐÖ˜á´äÕ5 µÁq€ÿ5#¸·îà¶+9T‘‚ ðŽ÷Rܸrz“Ï´Ì =Ï…{ðáO£Èf ¡Íwg|Ž’Ü/¢Þ$÷¯¢ëðúÀ;¿à¨Ö™âÒÆ­]¯ÜW"Þ/< ‡÷DÏà°½üB}çyIEc^—ƒ=[V“Ýh²ëMä$l];Kû®¸ýr¦È*Åò ÿtÒõ$]•MŸ÷´;×I€1èó!‚œõ¸M õ¨(fÌæ<ÁÎÎò5~z¿ù¶ž mÌêÕ >–âÚ©âëˆIÎÞçz;ãu[i·eç^ÆÜÙÓ³NÞëF6B\}7†»+üŽÓ,Ã'a ½˜-yHY¿,‘^—ñfú~ß?Hcø¸…¸ñó{Z+4\såƒû·¯Ù·nߣð«íFÆ¡sغëû§D¾?ò<–Ævkx0ÅM±ælذÁIÓxÿd”žÜÉ÷EE»AªM«g*È£YEí7Û™^[uíý®v[wGå†=Ed¼n×¶ÆæÖÅl¡'¨pGÚk+‹æ¢À¬¨C8ªâš2 dz3H£ß ¡¨BÒûSÃÅù[wŘ ~xpçútÁæmö¤Å£¥iQæ­‰AB1ÉfÙ‰›4u¹ïìIÒ]Ë6äò%ÿ†† 1t.’NJph¬zÌ ÎR1Ž"3-"¸‡‹&ìó°1âüžìó[:‡ï„¼‘……N m–“W0®_èÜœ ×õ6ùò&»)Æìꦬýæ}¬ñ~»{múù]z½£M•ºP~^Îá:eQTÙ_*7ÕÄ9É8—·Ëï 3°¶47E•î¿u÷“SÉ»U¯ _ NíºôW¬e¸ÄNÓ|»;™¿;ŒæÅd"ȉôøòÞµõï¾®½"èÄ´ÖMM+bYµ‘_ÉæEÝüÎ]P»¹XKÐI½Þ¥oE<_¹(„EP±Œ|mÇÁ¡‘Ý,ŠÓ©ººZ±Îߺ§×kÝ,kÍMš`Äø…jzeU»æ ™Át3ÓÀ½˜6—ÒöùË·r¨¹Ñ}““wö:Χùë¼ ¿|‚TܵÉQˆKßç_ÁâÀ™œ”pÑÐóໃ¼Ydâ0!®àa –øöçW$ÃÁ‘Á$/\¬$ð 2ÞímÞLH‹Ÿ èd£HVÜ,:ò½»RÍZšJ­a„z*>‹_…NT(ù‚^SVF­U¹8ñEþôñ܈óùnd;«®8™\C]ø=Èêm¬Æ:‚´ÆbãDd=Áãßžˆ‹UU5O‹|]þð®Pèêv‰á\]2ßìÿ"yÈ[ïyʧz£g{Y«{„Ùø5©ÿ;w{N3é­nâĨw§Á¢ÍK¢Ý­ûÏ29Id¿’ì y)ìPÞò8ŒÅ©¯‰±@mPÔñwjl,6 áhWÕ˜d öà uõmÁp®.™á£Ç…twöR x­BδYcŒxg*vo  yò‘•“[¬?ÜVœ˜0ÒN¡O난~Žó’¯·h#´Hkýœ±8kÓß^Àq@]àÓ“ø,56´¯÷Í-κU»n…[>]@nîøÏœp›[œ6# €4tën¯:ŽÒþ}…—8äT9_žY$/´G’K™©ù†•(óÑ’Mø©`ŸÉdѺ;ùO‹B Ó&P{qöhJÉ+Úé–§¦l2«MïöÝ_1ÑÓ«’t¸½±l€ëØya ¦ô©«®½ÆL^¬žêñš¸ùy.¾Û½Š[ u/]½‹iS}øN>²e1™q‡jfÚ&¢©iT\=kÏ›ÀXô-.84V5ðu!TE˜ þ.ŒOH´¶4—zwTr.ï‰¦Ë xõµ·œÖ„HÆù£žÈHùg Ñhñ’T$ßyq¸zþ¨p¿´ë< q•ró÷š‰wÿÍÑð–I]´–æI²é²˜sÂ"×:Õ–bÕ¦“ÈÙL6¢9VÊÓWž§<æ;”3?ý©Mê3AV#µ±ËÞ¯‘ž K£UrÝ9!›qát¦H£Ù+6ÇV…/TS^pÃùqgLP'Ú5E ‚–ÀÞºîÄ Ën"2|Ÿ;®W»Îý"Ö¬TwÖâµtúŽO'› á+W Ã+¦âZÌ–<ÕÆ&nOÝ,IŠ£06.ÁZ.Çñúøh*INÚ’Oe½ÉgBXÐÔZóäøä9èü“hÒíDSš¥¡Ê µA¯/Ôc¸ö“`A§¯"zå|‘ €ÅŸ¨ú;HÍ#‚Î|%ÄOˆƒ«OàÌÉÐÜD ž mÜðâc–ƤÉÂqm¶uË&~÷núÒË £ÇÏ€ZÕj =«_n[‡‡÷nN§ÏÝ$_¾bE˜‚€Õ)ù8¾?6‘lú“ÍÙæÖ}#bW( œ³d-®•p&¡ý’œÖa”"9öõņÐ$’Ú›AÜ!ä;ÐÑõè{~á¹8‘ÛÞ£1ÛÓÉ0ž`²#´kÒuäNÅÖ Q¹bhæ ”8ûÓMáŽa›•¿”w±h²¢®qŠæ°(bK ‚’Z¾Ò%ÐÆémáãÖË(Éý‚ÛJ)@> þ›7% ï{y Á“¾ÆÒîohfòô>{pÿ.­_Î%±ÉèägëlZØ\B2B #™¸ÚüÒºp‚hÝšü®[¥Ü<‹#SpñÌA7’ãØHƒt4:Ÿ|g¨tÓL¶*($Æ©»ì…®ù’ó÷$;b›ÔÙ`=¶£¦M„MÌÄ5ò«·Ç¾“H·ÌH.¼žHeAîº5}r­dõ¨±)ÀT};€Q5iÖ2…O0ü…0óñÃ;óæ,Š´²µ냔}g‘£]‹7å9ˆà©_{üèîêžC>úhê{Ž .ÈìðIIð€?[Kswz6Òuíý¬;µ€ç§OåâJÉa˶zv°éd† ¤µâ‚l´é舊«Åüy¾c÷ÁèÖÍ'ràúÅ™TWÕôÓ°¡L €|ʽŒ¼ì­høBã ÝTëî'ò]Kø£ìâÏ(=¹Kx €¿ LÌ,Pý¤Êµu‡¹…׈ §Å¾÷à1Ý«Äý;¿pGDäxZYÛ kfæ6¸ùóæ7®œ®þ6·ÕoÚ¾ÔH~ò®Þ¸â 8Uø“p<ºw3¡a£ÏÑ’‘3èÏ"€bˆ-ÎܺÏ_ªÅ]+ËM©zü°s“f-êçhÇãÑýÊãôÿ5}ZQNb{Ó?å%ÿ\SUõعIÓæ}~}p[œoÔÄ„êÐMMZáNÅå@>Œ„²á6(?¡Åé âK½+ü?À%ÝÝ·/Ç1‚9áUø?B)”ÕèâÞlÈÒêÏ @=àùÄÞžk­®ÅIEND®B`‚cpl-6.6.1/html/group__cpl__array.html0000644000460300003120000132503612553662431014555 00000000000000 Common Pipeline Library Reference Manual: Arrays
Common Pipeline Library Reference Manual  6.6.1
Arrays

Functions

cpl_error_code cpl_array_abs (cpl_array *array)
 Compute the absolute value of array elements. More...
 
cpl_error_code cpl_array_add (cpl_array *to_array, const cpl_array *from_array)
 Add the values of two numeric or complex arrays. More...
 
cpl_error_code cpl_array_add_scalar (cpl_array *array, double value)
 Add a constant value to a numerical array. More...
 
cpl_error_code cpl_array_add_scalar_complex (cpl_array *array, double complex value)
 Add a constant complex value to a complex array. More...
 
cpl_error_code cpl_array_arg (cpl_array *array)
 Compute the phase angle value of array elements. More...
 
cpl_array * cpl_array_cast (cpl_array *array, cpl_type type)
 Cast a numeric array to a new numeric type array. More...
 
cpl_error_code cpl_array_copy_data (cpl_array *array, const double *data)
 Copy buffer of numerical data to a numerical array. More...
 
cpl_error_code cpl_array_copy_data_complex (cpl_array *array, const double complex *data)
 Copy buffer of complex data to a complex array. More...
 
cpl_error_code cpl_array_copy_data_cplsize (cpl_array *array, const cpl_size *data)
 Copy existing data to a cpl_size array. More...
 
cpl_error_code cpl_array_copy_data_double (cpl_array *array, const double *data)
 Copy existing data to a double array. More...
 
cpl_error_code cpl_array_copy_data_double_complex (cpl_array *array, const double complex *data)
 Copy existing data to a double complex array. More...
 
cpl_error_code cpl_array_copy_data_float (cpl_array *array, const float *data)
 Copy existing data to a float array. More...
 
cpl_error_code cpl_array_copy_data_float_complex (cpl_array *array, const float complex *data)
 Copy existing data to a float complex array. More...
 
cpl_error_code cpl_array_copy_data_int (cpl_array *array, const int *data)
 Copy existing data to an integer array. More...
 
cpl_error_code cpl_array_copy_data_long (cpl_array *array, const long *data)
 Copy existing data to a long integer array. More...
 
cpl_error_code cpl_array_copy_data_long_long (cpl_array *array, const long long *data)
 Copy existing data to a long long integer array. More...
 
cpl_error_code cpl_array_copy_data_string (cpl_array *array, const char **data)
 Copy existing data to a string array. More...
 
cpl_size cpl_array_count_invalid (const cpl_array *array)
 Count number of invalid elements in an array. More...
 
void cpl_array_delete (cpl_array *array)
 Delete an array. More...
 
cpl_error_code cpl_array_divide (cpl_array *to_array, const cpl_array *from_array)
 Divide the values of two numeric or complex arrays. More...
 
cpl_error_code cpl_array_divide_scalar (cpl_array *array, double value)
 Divide a numerical array by a constant value. More...
 
cpl_error_code cpl_array_divide_scalar_complex (cpl_array *array, double complex value)
 Divide a complex array by a constant complex value. More...
 
void cpl_array_dump (const cpl_array *array, cpl_size start, cpl_size count, FILE *stream)
 Print an array. More...
 
void cpl_array_dump_structure (const cpl_array *array, FILE *stream)
 Describe the structure and the contents of an array. More...
 
cpl_array * cpl_array_duplicate (const cpl_array *array)
 Make a copy of an array. More...
 
cpl_error_code cpl_array_erase_window (cpl_array *array, cpl_size start, cpl_size count)
 Delete a segment of an array. More...
 
cpl_error_code cpl_array_exponential (cpl_array *array, double base)
 Compute the exponential of array elements. More...
 
cpl_array * cpl_array_extract (const cpl_array *array, cpl_size start, cpl_size count)
 Create an array from a section of another array. More...
 
cpl_array * cpl_array_extract_imag (cpl_array *array)
 Extract the imaginary value of array elements. More...
 
cpl_array * cpl_array_extract_real (cpl_array *array)
 Extract the real value of array elements. More...
 
cpl_error_code cpl_array_fill_window (cpl_array *array, cpl_size start, cpl_size count, double value)
 Write the same value within a numerical array segment. More...
 
cpl_error_code cpl_array_fill_window_complex (cpl_array *array, cpl_size start, cpl_size count, double complex value)
 Write the same value within a complex array segment. More...
 
cpl_error_code cpl_array_fill_window_cplsize (cpl_array *array, cpl_size start, cpl_size count, cpl_size value)
 Write the same value within a cpl_size array segment. More...
 
cpl_error_code cpl_array_fill_window_double (cpl_array *array, cpl_size start, cpl_size count, double value)
 Write the same value within a double array segment. More...
 
cpl_error_code cpl_array_fill_window_double_complex (cpl_array *array, cpl_size start, cpl_size count, double complex value)
 Write the same value within a double complex array segment. More...
 
cpl_error_code cpl_array_fill_window_float (cpl_array *array, cpl_size start, cpl_size count, float value)
 Write the same value within a float array segment. More...
 
cpl_error_code cpl_array_fill_window_float_complex (cpl_array *array, cpl_size start, cpl_size count, float complex value)
 Write the same value within a float complex array segment. More...
 
cpl_error_code cpl_array_fill_window_int (cpl_array *array, cpl_size start, cpl_size count, int value)
 Write the same value within an integer array segment. More...
 
cpl_error_code cpl_array_fill_window_invalid (cpl_array *array, cpl_size start, cpl_size count)
 Set an array segment to NULL. More...
 
cpl_error_code cpl_array_fill_window_long (cpl_array *array, cpl_size start, cpl_size count, long value)
 Write the same value within a long integer array segment. More...
 
cpl_error_code cpl_array_fill_window_long_long (cpl_array *array, cpl_size start, cpl_size count, long long value)
 Write the same value within a long long integer array segment. More...
 
cpl_error_code cpl_array_fill_window_string (cpl_array *array, cpl_size start, cpl_size count, const char *value)
 Write a string to a string array segment. More...
 
double cpl_array_get (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a numerical array. More...
 
double complex cpl_array_get_complex (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a complex array. More...
 
cpl_size cpl_array_get_cplsize (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a cpl_size array. More...
 
cpl_sizecpl_array_get_data_cplsize (cpl_array *array)
 Get a pointer to cpl_size array data. More...
 
const cpl_sizecpl_array_get_data_cplsize_const (const cpl_array *array)
 Get a pointer to constant cpl_size array data. More...
 
double * cpl_array_get_data_double (cpl_array *array)
 Get a pointer to double array data. More...
 
double complex * cpl_array_get_data_double_complex (cpl_array *array)
 Get a pointer to double complex array data. More...
 
const double complex * cpl_array_get_data_double_complex_const (const cpl_array *array)
 Get a pointer to constant double complex array data. More...
 
const double * cpl_array_get_data_double_const (const cpl_array *array)
 Get a pointer to constant double array data. More...
 
float * cpl_array_get_data_float (cpl_array *array)
 Get a pointer to float array data. More...
 
float complex * cpl_array_get_data_float_complex (cpl_array *array)
 Get a pointer to float complex array data. More...
 
const float complex * cpl_array_get_data_float_complex_const (const cpl_array *array)
 Get a pointer to constant float complex array data. More...
 
const float * cpl_array_get_data_float_const (const cpl_array *array)
 Get a pointer to constant float array data. More...
 
int * cpl_array_get_data_int (cpl_array *array)
 Get a pointer to integer array data. More...
 
const int * cpl_array_get_data_int_const (const cpl_array *array)
 Get a pointer to constant integer array data. More...
 
long * cpl_array_get_data_long (cpl_array *array)
 Get a pointer to long integer array data. More...
 
const long * cpl_array_get_data_long_const (const cpl_array *array)
 Get a pointer to constant long integer array data. More...
 
long long * cpl_array_get_data_long_long (cpl_array *array)
 Get a pointer to long long integer array data. More...
 
const long long * cpl_array_get_data_long_long_const (const cpl_array *array)
 Get a pointer to constant long long integer array data. More...
 
char ** cpl_array_get_data_string (cpl_array *array)
 Get a pointer to string array data. More...
 
const char ** cpl_array_get_data_string_const (const cpl_array *array)
 Get a pointer to constant string array data. More...
 
double cpl_array_get_double (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a double array. More...
 
double complex cpl_array_get_double_complex (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a double complex array. More...
 
float cpl_array_get_float (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a float array. More...
 
float complex cpl_array_get_float_complex (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a float complex array. More...
 
int cpl_array_get_int (const cpl_array *array, cpl_size indx, int *null)
 Read a value from an integer array. More...
 
long cpl_array_get_long (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a long integer array. More...
 
long long cpl_array_get_long_long (const cpl_array *array, cpl_size indx, int *null)
 Read a value from a long long integer array. More...
 
double cpl_array_get_max (const cpl_array *array)
 Get maximum value in a numerical array. More...
 
cpl_error_code cpl_array_get_maxpos (const cpl_array *array, cpl_size *indx)
 Get position of maximum in a numerical array. More...
 
double cpl_array_get_mean (const cpl_array *array)
 Compute the mean value of a numeric array. More...
 
double complex cpl_array_get_mean_complex (const cpl_array *array)
 Compute the mean value of a complex array. More...
 
double cpl_array_get_median (const cpl_array *array)
 Compute the median of a numeric array. More...
 
double cpl_array_get_min (const cpl_array *array)
 Get minimum value in a numerical array. More...
 
cpl_error_code cpl_array_get_minpos (const cpl_array *array, cpl_size *indx)
 Get position of minimum in a numerical array. More...
 
cpl_size cpl_array_get_size (const cpl_array *array)
 Get the length of an array. More...
 
double cpl_array_get_stdev (const cpl_array *array)
 Compute the standard deviation of a numeric array. More...
 
const char * cpl_array_get_string (const cpl_array *array, cpl_size indx)
 Read a value from a string array. More...
 
cpl_type cpl_array_get_type (const cpl_array *array)
 Get the type of an array. More...
 
int cpl_array_has_invalid (const cpl_array *array)
 Check if an array contains at least one invalid element. More...
 
int cpl_array_has_valid (const cpl_array *array)
 Check if an array contains at least one valid value. More...
 
cpl_error_code cpl_array_insert (cpl_array *target_array, const cpl_array *insert_array, cpl_size start)
 Merge two arrays. More...
 
cpl_error_code cpl_array_insert_window (cpl_array *array, cpl_size start, cpl_size count)
 Insert a segment of new elements into array. More...
 
int cpl_array_is_valid (const cpl_array *array, cpl_size indx)
 Check if an array element is valid. More...
 
cpl_error_code cpl_array_logarithm (cpl_array *array, double base)
 Compute the logarithm of array elements. More...
 
cpl_error_code cpl_array_multiply (cpl_array *to_array, const cpl_array *from_array)
 Multiply the values of two numeric or complex arrays. More...
 
cpl_error_code cpl_array_multiply_scalar (cpl_array *array, double value)
 Multiply a numerical array by a constant value. More...
 
cpl_error_code cpl_array_multiply_scalar_complex (cpl_array *array, double complex value)
 Multiply a complex array by a constant complex value. More...
 
cpl_array * cpl_array_new (cpl_size length, cpl_type type)
 Create a new array of given type. More...
 
cpl_error_code cpl_array_power (cpl_array *array, double exponent)
 Compute the power of array elements. More...
 
cpl_error_code cpl_array_set (cpl_array *array, cpl_size indx, double value)
 Write a value to a numerical array element. More...
 
cpl_error_code cpl_array_set_complex (cpl_array *array, cpl_size indx, double complex value)
 Write a value to a complex array element. More...
 
cpl_error_code cpl_array_set_cplsize (cpl_array *array, cpl_size indx, cpl_size value)
 Write a value to a cpl_size array element. More...
 
cpl_error_code cpl_array_set_double (cpl_array *array, cpl_size indx, double value)
 Write a value to a double array element. More...
 
cpl_error_code cpl_array_set_double_complex (cpl_array *array, cpl_size indx, double complex value)
 Write a value to a double complex array element. More...
 
cpl_error_code cpl_array_set_float (cpl_array *array, cpl_size indx, float value)
 Write a value to a float array element. More...
 
cpl_error_code cpl_array_set_float_complex (cpl_array *array, cpl_size indx, float complex value)
 Write a value to a float complex array element. More...
 
cpl_error_code cpl_array_set_int (cpl_array *array, cpl_size indx, int value)
 Write a value to an integer array element. More...
 
cpl_error_code cpl_array_set_invalid (cpl_array *array, cpl_size indx)
 Invalidate an array element. More...
 
cpl_error_code cpl_array_set_long (cpl_array *array, cpl_size indx, long value)
 Write a value to a long integer array element. More...
 
cpl_error_code cpl_array_set_long_long (cpl_array *array, cpl_size indx, long long value)
 Write a value to a long long integer array element. More...
 
cpl_error_code cpl_array_set_size (cpl_array *array, cpl_size new_length)
 Resize an array. More...
 
cpl_error_code cpl_array_set_string (cpl_array *array, cpl_size indx, const char *string)
 Write a character string to a string array element. More...
 
cpl_error_code cpl_array_subtract (cpl_array *to_array, const cpl_array *from_array)
 Subtract the values of two numeric or complex arrays. More...
 
cpl_error_code cpl_array_subtract_scalar (cpl_array *array, double value)
 Subtract a constant value from a numerical array. More...
 
cpl_error_code cpl_array_subtract_scalar_complex (cpl_array *array, double complex value)
 Subtract a constant complex value from a complex array. More...
 
void * cpl_array_unwrap (cpl_array *array)
 Delete an array, without losing the data buffer. More...
 
cpl_array * cpl_array_wrap_cplsize (cpl_size *data, cpl_size length)
 Create a new cpl_size array from existing data. More...
 
cpl_array * cpl_array_wrap_double (double *data, cpl_size length)
 Create a new double array from existing data. More...
 
cpl_array * cpl_array_wrap_double_complex (double complex *data, cpl_size length)
 Create a new double complex array from existing data. More...
 
cpl_array * cpl_array_wrap_float (float *data, cpl_size length)
 Create a new float array from existing data. More...
 
cpl_array * cpl_array_wrap_float_complex (float complex *data, cpl_size length)
 Create a new float complex array from existing data. More...
 
cpl_array * cpl_array_wrap_int (int *data, cpl_size length)
 Create a new integer array from existing data. More...
 
cpl_array * cpl_array_wrap_long (long *data, cpl_size length)
 Create a new long integer array from existing data. More...
 
cpl_array * cpl_array_wrap_long_long (long long *data, cpl_size length)
 Create a new long long integer array from existing data. More...
 
cpl_array * cpl_array_wrap_string (char **data, cpl_size length)
 Create a new character string array from existing data. More...
 

Detailed Description

This module provides functions to create, destroy and use a cpl_array.

Synopsis:
#include <cpl_array.h>

Function Documentation

cpl_error_code cpl_array_abs ( cpl_array *  array)

Compute the absolute value of array elements.

Parameters
arrayPointer to array.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.

Each array element is replaced by its absolute value. Invalid elements are not modified by this operation. If the array is complex, its type will be turned to real (CPL_TYPE_FLOAT_COMPLEX will be changed into CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE_COMPLEX will be changed into CPL_TYPE_DOUBLE), and any pointer retrieved by calling cpl_array_get_data_float(), cpl_array_get_data_double_complex(), etc., should be discarded.

References cpl_array_get_type(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and CPL_TYPE_COMPLEX.

cpl_error_code cpl_array_add ( cpl_array *  to_array,
const cpl_array *  from_array 
)

Add the values of two numeric or complex arrays.

Parameters
to_arrayTarget array.
from_arraySource array.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any input array is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The input arrays have different sizes.
CPL_ERROR_INVALID_TYPE Any specified array is not numerical.

The arrays are summed element by element, and the result of the sum is stored in the target array. The arrays' types may differ, and in that case the operation would be performed using the standard C upcasting rules, with a final cast of the result to the target array type. Invalid elements are propagated consistently: if either or both members of the sum are invalid, the result will be invalid too. Underflows and overflows are ignored.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_add_scalar ( cpl_array *  array,
double  value 
)

Add a constant value to a numerical array.

Parameters
arrayTarget array
valueValue to add.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The input array is not numerical.

The operation is always performed in double precision, with a final cast of the result to the target array type. Invalid elements are are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_add_scalar_complex ( cpl_array *  array,
double complex  value 
)

Add a constant complex value to a complex array.

Parameters
arrayTarget array
valueValue to add.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The input array is not complex.

The operation is always performed in double precision, with a final cast of the result to the target array type. Invalid elements are are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_arg ( cpl_array *  array)

Compute the phase angle value of array elements.

Parameters
arrayPointer to array.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.

Each array element is replaced by its phase angle value. The phase angle will be in the range of [-pi,pi]. Invalid elements are not modified by this operation. If the array is complex, its type will be turned to real (CPL_TYPE_FLOAT_COMPLEX will be changed into CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE_COMPLEX will be changed into CPL_TYPE_DOUBLE), and any pointer retrieved by calling cpl_array_get_data_float(), cpl_array_get_data_double_complex(), etc., should be discarded.

References cpl_array_get_data_double(), cpl_array_get_data_float(), cpl_array_get_size(), cpl_array_get_type(), CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_TYPE_COMPLEX, CPL_TYPE_DOUBLE, and CPL_TYPE_FLOAT.

cpl_array* cpl_array_cast ( cpl_array *  array,
cpl_type  type 
)

Cast a numeric array to a new numeric type array.

Parameters
arrayPointer to array.
typeType of new array.
Returns
New array.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified column is not numerical.
CPL_ERROR_ILLEGAL_INPUT The specified type is not numerical.

A new array of the specified type is created, and the content of the input numeric array is cast to the new type. If the input array type is identical to the specified type the array is duplicated as is done by the function cpl_array_duplicate().

References cpl_calloc(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_free(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, and CPL_TYPE_SIZE.

cpl_error_code cpl_array_copy_data ( cpl_array *  array,
const double *  data 
)

Copy buffer of numerical data to a numerical array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the array is not numerical, a CPL_ERROR_INVALID_TYPE is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

The input data are copied into the specified array. If the type of the accessed array is not CPL_TYPE_DOUBLE, the data values will be truncated according to C casting rules. The size of the input data buffer is not checked in any way, and the values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid(). If N is the length of the array, the first N values of the input data buffer would be copied to the column buffer. If the array had length zero, no values would be copied.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_complex ( cpl_array *  array,
const double complex *  data 
)

Copy buffer of complex data to a complex array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the array is not complex, a CPL_ERROR_INVALID_TYPE is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

The input data are copied into the specified array. If the type of the accessed array is not CPL_TYPE_DOUBLE, the data values will be truncated according to C casting rules. The size of the input data buffer is not checked in any way, and the values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid(). If N is the length of the array, the first N values of the input data buffer would be copied to the column buffer. If the array had length zero, no values would be copied.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_cplsize ( cpl_array *  array,
const cpl_size data 
)

Copy existing data to a cpl_size array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_SIZE, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

The input data are copied into the specified array. The size of the input data buffer is not checked in any way, and the data values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid(). If N is the length of the array, the first N values of the input data buffer would be copied to the array buffer. If the array had length zero, no values would be copied.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_double ( cpl_array *  array,
const double *  data 
)

Copy existing data to a double array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_DOUBLE, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

See documentation of function cpl_array_copy_data_int().

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_double_complex ( cpl_array *  array,
const double complex *  data 
)

Copy existing data to a double complex array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_DOUBLE_COMPLEX, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

See documentation of function cpl_array_copy_data_int().

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_float ( cpl_array *  array,
const float *  data 
)

Copy existing data to a float array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_FLOAT, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

See documentation of function cpl_array_copy_data_int().

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_float_complex ( cpl_array *  array,
const float complex *  data 
)

Copy existing data to a float complex array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_FLOAT_COMPLEX, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

See documentation of function cpl_array_copy_data_int().

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_int ( cpl_array *  array,
const int *  data 
)

Copy existing data to an integer array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_INT, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

The input data are copied into the specified array. The size of the input data buffer is not checked in any way, and the data values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid(). If N is the length of the array, the first N values of the input data buffer would be copied to the array buffer. If the array had length zero, no values would be copied.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_long ( cpl_array *  array,
const long *  data 
)

Copy existing data to a long integer array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_LONG, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

The input data are copied into the specified array. The size of the input data buffer is not checked in any way, and the data values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid(). If N is the length of the array, the first N values of the input data buffer would be copied to the array buffer. If the array had length zero, no values would be copied.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_long_long ( cpl_array *  array,
const long long *  data 
)

Copy existing data to a long long integer array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_LONG_LONG, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

The input data are copied into the specified array. The size of the input data buffer is not checked in any way, and the data values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid(). If N is the length of the array, the first N values of the input data buffer would be copied to the array buffer. If the array had length zero, no values would be copied.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_copy_data_string ( cpl_array *  array,
const char **  data 
)

Copy existing data to a string array.

Parameters
arrayExisting array.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success. If the input array is not of type CPL_TYPE_STRING, a CPL_ERROR_TYPE_MISMATCH is returned. At any NULL input pointer a CPL_ERROR_NULL_INPUT would be returned.

See documentation of function cpl_array_copy_data_int().

The input data are copied into the specified array. The size of the input buffer is not checked in any way. The strings pointed by the input buffer are all duplicated, while the strings contained in the array are released before being overwritten.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_array_count_invalid ( const cpl_array *  array)

Count number of invalid elements in an array.

Parameters
arrayArray to inquire.
Returns
Number of invalid elements in an array. -1 is always returned in case of error.

Count number of invalid elements in an array. If the array itself is a NULL pointer, an error CPL_ERROR_NULL_INPUT is set.

References CPL_ERROR_NULL_INPUT.

void cpl_array_delete ( cpl_array *  array)

Delete an array.

Parameters
arrayArray to be deleted.
Returns
Nothing.

This function deletes an array. If the input array is NULL, nothing is done, and no error is set.

References cpl_free().

Referenced by cpl_array_extract(), cpl_matrix_get_determinant(), cpl_matrix_invert_create(), cpl_matrix_solve(), cpl_ppm_match_points(), cpl_table_compare_structure(), cpl_wcs_convert(), cpl_wcs_delete(), and cpl_wcs_platesol().

cpl_error_code cpl_array_divide ( cpl_array *  to_array,
const cpl_array *  from_array 
)

Divide the values of two numeric or complex arrays.

Parameters
to_arrayTarget array.
from_arraySource array.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any input array is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The input arrays have different sizes.
CPL_ERROR_INVALID_TYPE Any specified array is not numerical.

The arrays are divided element by element, and the result is stored in the target array. See the documentation of the function cpl_array_add() for further details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_divide_scalar ( cpl_array *  array,
double  value 
)

Divide a numerical array by a constant value.

Parameters
arrayTarget array
valueDivisor.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The input array is not numerical.
CPL_ERROR_DIVISION_BY_ZERO The input value is zero.

The operation is always performed in double precision, with a final cast of the result to the target array type. Invalid elements are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_divide_scalar_complex ( cpl_array *  array,
double complex  value 
)

Divide a complex array by a constant complex value.

Parameters
arrayTarget array
valueDivisor.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The input array is not complex.
CPL_ERROR_DIVISION_BY_ZERO The input value is zero.

The operation is always performed in double precision, with a final cast of the result to the target array type. Invalid elements are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

void cpl_array_dump ( const cpl_array *  array,
cpl_size  start,
cpl_size  count,
FILE *  stream 
)

Print an array.

Parameters
arrayPointer to array
startFirst element to print
countNumber of elements to print
streamThe output stream
Returns
Nothing.

This function is mainly intended for debug purposes. Array elements are counted from 0, and their sequence number is printed at the left of each element. Invalid elements are represented as a sequence of "-" as wide as the field occupied by the array. Specifying a start beyond the array boundaries, or a non-positive count, would generate a warning message, but no error would be set. The specified number of elements to print may exceed the array end, and in that case the array would be printed up to its last element. If the specified stream is NULL, it is set to stdout. The function used for printing is the standard C fprintf().

References cpl_calloc(), cpl_free(), cpl_malloc(), CPL_SIZE_FORMAT, cpl_sprintf(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, CPL_TYPE_SIZE, and CPL_TYPE_STRING.

void cpl_array_dump_structure ( const cpl_array *  array,
FILE *  stream 
)

Describe the structure and the contents of an array.

Parameters
arrayPointer to array.
streamThe output stream
Returns
Nothing.

This function is mainly intended for debug purposes. Some information about the structure of an array and its contents is printed to terminal:

  • Data type of the array
  • Number of elements
  • Number of invalid elements

If the specified stream is NULL, it is set to stdout. The function used for printing is the standard C fprintf().

References CPL_SIZE_FORMAT, CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, CPL_TYPE_SIZE, and CPL_TYPE_STRING.

cpl_array* cpl_array_duplicate ( const cpl_array *  array)

Make a copy of an array.

Parameters
arrayArray to be duplicated.
Returns
Pointer to the new array, or NULL in case of error.

If the input array is a NULL pointer, a CPL_ERROR_NULL_INPUT is returned. Copy is "in depth": in the case of a string array, also the string elements are duplicated.

References cpl_array_get_size(), cpl_array_get_type(), cpl_array_new(), and CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_extract_imag(), and cpl_array_extract_real().

cpl_error_code cpl_array_erase_window ( cpl_array *  array,
cpl_size  start,
cpl_size  count 
)

Delete a segment of an array.

Parameters
arrayInput array
startFirst element to delete.
countNumber of elements to delete.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT array is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input array has length zero, or start is outside the table range.
CPL_ERROR_ILLEGAL_INPUT count is negative.

A portion of the array data is physically removed. The pointers to data may change, therefore pointers previously retrieved by calling cpl_array_get_data_int(), cpl_array_get_data_string(), etc., should be discarded. The specified segment can extend beyond the end of the array, and in that case elements will be removed up to the end of the array.

References cpl_array_get_size(), CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_exponential ( cpl_array *  array,
double  base 
)

Compute the exponential of array elements.

Parameters
arrayPointer to array.
baseExponential base.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical or complex.
CPL_ERROR_ILLEGAL_INPUT The input base is not positive.

Each column element is replaced by its exponential in the specified base. The operation is always performed in double precision, with a final cast of the result to the array type. Invalid elements are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_array* cpl_array_extract ( const cpl_array *  array,
cpl_size  start,
cpl_size  count 
)

Create an array from a section of another array.

Parameters
arrayInput array
startFirst element to be copied to new array.
countNumber of elements to be copied.
Returns
Pointer to the new array, or NULL in case or error.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input array has zero length, or start is outside the array boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.

A number of consecutive elements are copied from an input array to a newly created array. If the sum of start and count goes beyond the end of the input array, elements are copied up to the end.

References cpl_array_delete(), cpl_array_get_size(), cpl_array_get_type(), cpl_array_new(), and CPL_ERROR_NULL_INPUT.

cpl_array* cpl_array_extract_imag ( cpl_array *  array)

Extract the imaginary value of array elements.

Parameters
arrayPointer to array.
Returns
New array with imaginary part of input array elements.
Errors
CPL_ERROR_NULL_INPUT Input array is NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.

A new array is created with the imaginary part of all input array elements. If the input array is complex, the output type will be CPL_TYPE_FLOAT if input is CPL_TYPE_FLOAT_COMPLEX, and CPL_TYPE_DOUBLE if input is CPL_TYPE_DOUBLE_COMPLEX).

References cpl_array_duplicate(), cpl_array_get_type(), cpl_array_new(), CPL_ERROR_NULL_INPUT, CPL_TYPE_COMPLEX, and CPL_TYPE_FLOAT.

cpl_array* cpl_array_extract_real ( cpl_array *  array)

Extract the real value of array elements.

Parameters
arrayPointer to array.
Returns
New array with real part of input array elements.
Errors
CPL_ERROR_NULL_INPUT Input array is NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.

A new array is created with the real part of all input array elements. If the input array is complex, the output type will be CPL_TYPE_FLOAT if input is CPL_TYPE_FLOAT_COMPLEX, and CPL_TYPE_DOUBLE if input is CPL_TYPE_DOUBLE_COMPLEX).

References cpl_array_duplicate(), cpl_array_get_type(), cpl_array_new(), CPL_ERROR_NULL_INPUT, CPL_TYPE_COMPLEX, and CPL_TYPE_FLOAT.

cpl_error_code cpl_array_fill_window ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
double  value 
)

Write the same value within a numerical array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of numerical type, a CPL_ERROR_INVALID_TYPE is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write the same value to a numerical array segment. The value is cast to the accessed array type. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid().

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_table_where_selected(), and cpl_wcs_new_from_propertylist().

cpl_error_code cpl_array_fill_window_complex ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
double complex  value 
)

Write the same value within a complex array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of numerical type, a CPL_ERROR_INVALID_TYPE is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write the same value to a complex array segment. The value is cast to the accessed array type. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid().

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_cplsize ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
cpl_size  value 
)

Write the same value within a cpl_size array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Write the same value to a cpl_size array segment. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_double ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
double  value 
)

Write the same value within a double array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Write the same value to a double array segment. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_double_complex ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
double complex  value 
)

Write the same value within a double complex array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Write the same value to a double complex array segment. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_float ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
float  value 
)

Write the same value within a float array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Write the same value to a float array segment. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_float_complex ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
float complex  value 
)

Write the same value within a float complex array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Write the same value to a float complex array segment. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_int ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
int  value 
)

Write the same value within an integer array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Write the same value to an integer array segment. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_invalid ( cpl_array *  array,
cpl_size  start,
cpl_size  count 
)

Set an array segment to NULL.

Parameters
arrayArray to be accessed.
startPosition where to start writing NULLs.
countNumber of column elements to set to NULL.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Invalidate values contained in an array segment. The count argument can go beyond the array end, and in that case the values will be invalidated up to the end of the array. If count is zero, the array is not modified and no error is set. In the case of a string array, the invalidated strings are set free and their pointers are set to NULL; for other data types, the corresponding elements are flagged as invalid.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_long ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
long  value 
)

Write the same value within a long integer array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Write the same value to a long integer array segment. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_long_long ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
long long  value 
)

Write the same value within a long long integer array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Write the same value to a long long integer array segment. The written values are automatically flagged as valid. To invalidate an array interval use cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be written just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_fill_window_string ( cpl_array *  array,
cpl_size  start,
cpl_size  count,
const char *  value 
)

Write a string to a string array segment.

Parameters
arrayArray to be accessed.
startPosition where to begin write value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If start is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the error CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned. If count is negative, a CPL_ERROR_ILLEGAL_INPUT is returned.

Copy the same string to a string array segment. If the input string is not a NULL pointer, it is duplicated for each accessed array element. If the input string is NULL, this call is equivalent to cpl_array_fill_window_invalid(). The count argument can go beyond the array end, and in that case the specified value will be copied just up to the end of the array. If count is zero, the array is not modified and no error is set.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

double cpl_array_get ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a numerical array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Value read. In case of an invalid array element, or in case of error, 0.0 is returned.

Read a value from a numerical array. A CPL_ERROR_NULL_INPUT is set in case array is a NULL pointer. A CPL_ERROR_INVALID_TYPE is set in case a non-numerical array is accessed. CPL_ERROR_ACCESS_OUT_OF_RANGE is set if the indx is outside the array range. Indexes are counted starting from 0. If the input array has length zero, CPL_ERROR_ACCESS_OUT_OF_RANGE is always set. The null flag is used to indicate whether the accessed array element is valid (0) or invalid (1). The null flag also signals an error condition (-1). The null argument can be left to NULL.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

double complex cpl_array_get_complex ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a complex array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Value read. In case of an invalid array element, or in case of error, 0.0 is returned.

Read a value from a complex array. A CPL_ERROR_NULL_INPUT is set in case array is a NULL pointer. A CPL_ERROR_INVALID_TYPE is set in case a non-complex array is accessed. CPL_ERROR_ACCESS_OUT_OF_RANGE is set if the indx is outside the array range. Indexes are counted starting from 0. If the input array has length zero, CPL_ERROR_ACCESS_OUT_OF_RANGE is always set. The null flag is used to indicate whether the accessed array element is valid (0) or invalid (1). The null flag also signals an error condition (-1). The null argument can be left to NULL.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

cpl_size cpl_array_get_cplsize ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a cpl_size array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
The cpl_size value read. In case of an invalid array element, or in case of error, 0 is returned.

Read a value from an array of type CPL_TYPE_SIZE. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is set. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is set. Indexes are counted starting from 0. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always set. If the null flag is a valid pointer, it is used to indicate whether the accessed array element is valid (0) or invalid (1). The null flag also signals an error condition (-1).

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

cpl_size* cpl_array_get_data_cplsize ( cpl_array *  array)

Get a pointer to cpl_size array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to cpl_size array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_SIZE, a CPL_ERROR_TYPE_MISMATCH is set.

Note
Use at your own risk: direct manipulation of array data rules out any check performed by the array object interface, and may introduce inconsistencies between the array information maintained internally and the actual array data.

References cpl_array_get_data_cplsize_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_table_where_selected().

const cpl_size* cpl_array_get_data_cplsize_const ( const cpl_array *  array)

Get a pointer to constant cpl_size array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant cpl_size array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_SIZE, a CPL_ERROR_TYPE_MISMATCH is set.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_cplsize().

double* cpl_array_get_data_double ( cpl_array *  array)

Get a pointer to double array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to double array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_DOUBLE, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int().

References cpl_array_get_data_double_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_array_arg(), and cpl_wcs_convert().

double complex* cpl_array_get_data_double_complex ( cpl_array *  array)

Get a pointer to double complex array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to double complex array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_DOUBLE_COMPLEX, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int().

References cpl_array_get_data_double_complex_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

const double complex* cpl_array_get_data_double_complex_const ( const cpl_array *  array)

Get a pointer to constant double complex array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant double complex array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_DOUBLE_COMPLEX, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int_const().

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_double_complex().

const double* cpl_array_get_data_double_const ( const cpl_array *  array)

Get a pointer to constant double array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant double array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_DOUBLE, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int_const().

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_double(), and cpl_wcs_platesol().

float* cpl_array_get_data_float ( cpl_array *  array)

Get a pointer to float array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to float array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_FLOAT, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int().

References cpl_array_get_data_float_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_array_arg().

float complex* cpl_array_get_data_float_complex ( cpl_array *  array)

Get a pointer to float complex array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to float complex array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_FLOAT_COMPLEX, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int().

References cpl_array_get_data_float_complex_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

const float complex* cpl_array_get_data_float_complex_const ( const cpl_array *  array)

Get a pointer to constant float complex array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant float complex array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_FLOAT_COMPLEX, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int_const().

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_float_complex().

const float* cpl_array_get_data_float_const ( const cpl_array *  array)

Get a pointer to constant float array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant float array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_FLOAT, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int_const().

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_float().

int* cpl_array_get_data_int ( cpl_array *  array)

Get a pointer to integer array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to integer array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_INT, a CPL_ERROR_TYPE_MISMATCH is set.

Note
Use at your own risk: direct manipulation of array data rules out any check performed by the array object interface, and may introduce inconsistencies between the array information maintained internally and the actual array data.

References cpl_array_get_data_int_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_wcs_convert(), and cpl_wcs_new_from_propertylist().

const int* cpl_array_get_data_int_const ( const cpl_array *  array)

Get a pointer to constant integer array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant integer array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_INT, a CPL_ERROR_TYPE_MISMATCH is set.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_int().

long* cpl_array_get_data_long ( cpl_array *  array)

Get a pointer to long integer array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to long integer array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_LONG, a CPL_ERROR_TYPE_MISMATCH is set.

Note
Use at your own risk: direct manipulation of array data rules out any check performed by the array object interface, and may introduce inconsistencies between the array information maintained internally and the actual array data.

References cpl_array_get_data_long_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

const long* cpl_array_get_data_long_const ( const cpl_array *  array)

Get a pointer to constant long integer array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant long integer array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_LONG, a CPL_ERROR_TYPE_MISMATCH is set.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_long().

long long* cpl_array_get_data_long_long ( cpl_array *  array)

Get a pointer to long long integer array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to long long integer array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_LONG_LONG, a CPL_ERROR_TYPE_MISMATCH is set.

Note
Use at your own risk: direct manipulation of array data rules out any check performed by the array object interface, and may introduce inconsistencies between the array information maintained internally and the actual array data.

References cpl_array_get_data_long_long_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

const long long* cpl_array_get_data_long_long_const ( const cpl_array *  array)

Get a pointer to constant long long integer array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant long long integer array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_LONG_LONG, a CPL_ERROR_TYPE_MISMATCH is set.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_long_long().

char** cpl_array_get_data_string ( cpl_array *  array)

Get a pointer to string array data.

Parameters
arrayArray to get the data from.
Returns
Pointer to string array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_STRING, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int().

References cpl_array_get_data_string_const(), cpl_errorstate_get(), and cpl_errorstate_is_equal().

const char** cpl_array_get_data_string_const ( const cpl_array *  array)

Get a pointer to constant string array data.

Parameters
arrayConstant array to get the data from.
Returns
Pointer to constant string array data. If array contains no data (zero length), a NULL is returned. If array is a NULL, a NULL is returned, and an error is set.

If the array is not of type CPL_TYPE_STRING, a CPL_ERROR_TYPE_MISMATCH is set.

See documentation of function cpl_array_get_data_int().

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_get_data_string().

double cpl_array_get_double ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a double array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Array value read. In case of an invalid array element, or in case of error, 0.0 is returned.

Read a value from an array of type CPL_TYPE_DOUBLE. See the documentation of the function cpl_array_get_int().

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_fit_image_gaussian(), and cpl_gaussian_eval_2d().

double complex cpl_array_get_double_complex ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a double complex array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Array value read. In case of an invalid array element, or in case of error, 0.0 is returned.

Read a value from an array of type CPL_TYPE_DOUBLE_COMPLEX. See the documentation of the function cpl_array_get_int().

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

float cpl_array_get_float ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a float array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Array value read. In case of an invalid array element, or in case of error, 0.0 is returned.

Read a value from an array of type CPL_TYPE_FLOAT. See the documentation of the function cpl_array_get_int().

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

float complex cpl_array_get_float_complex ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a float complex array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Array value read. In case of an invalid array element, or in case of error, 0.0 is returned.

Read a value from an array of type CPL_TYPE_FLOAT_COMPLEX. See the documentation of the function cpl_array_get_int().

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

int cpl_array_get_int ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from an integer array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Integer value read. In case of an invalid array element, or in case of error, 0 is returned.

Read a value from an array of type CPL_TYPE_INT. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is set. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is set. Indexes are counted starting from 0. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always set. If the null flag is a valid pointer, it is used to indicate whether the accessed array element is valid (0) or invalid (1). The null flag also signals an error condition (-1).

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_fit_image_gaussian().

long cpl_array_get_long ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a long integer array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Long integer value read. In case of an invalid array element, or in case of error, 0 is returned.

Read a value from an array of type CPL_TYPE_LONG. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is set. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is set. Indexes are counted starting from 0. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always set. If the null flag is a valid pointer, it is used to indicate whether the accessed array element is valid (0) or invalid (1). The null flag also signals an error condition (-1).

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

long long cpl_array_get_long_long ( const cpl_array *  array,
cpl_size  indx,
int *  null 
)

Read a value from a long long integer array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Long long integer value read. In case of an invalid array element, or in case of error, 0 is returned.

Read a value from an array of type CPL_TYPE_LONG_LONG. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is set. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is set. Indexes are counted starting from 0. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always set. If the null flag is a valid pointer, it is used to indicate whether the accessed array element is valid (0) or invalid (1). The null flag also signals an error condition (-1).

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

double cpl_array_get_max ( const cpl_array *  array)

Get maximum value in a numerical array.

Parameters
arrayInput array.
Returns
Maximum value. In case of error, this is set to 0.0.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.
CPL_ERROR_DATA_NOT_FOUND The specified array has either size zero, or all its elements are invalid.

Array elements marked as invalid are excluded from the search. The array must contain at least one valid value. Arrays of strings or complex are not allowed.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

cpl_error_code cpl_array_get_maxpos ( const cpl_array *  array,
cpl_size indx 
)

Get position of maximum in a numerical array.

Parameters
arrayPointer to array.
indxReturned position of maximum value.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array or indx is NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.
CPL_ERROR_DATA_NOT_FOUND The specified array has either size zero, or all its elements are invalid.

Array values marked as invalid are excluded from the search. The indx argument will be assigned the position of the maximum value. Indexes are counted starting from 0. If more than one array element correspond to the max value, the position with the lowest indx is returned. In case of error, indx is set to zero. Arrays of strings or complex are not allowed.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

double cpl_array_get_mean ( const cpl_array *  array)

Compute the mean value of a numeric array.

Parameters
arrayInput array.
Returns
Mean value. In case of error, this is set to 0.0.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.
CPL_ERROR_DATA_NOT_FOUND The specified array has either size zero, or all its elements are invalid.

Array elements marked as invalid are excluded from the computation. The array must contain at least one valid value. Arrays of strings or complex are not allowed.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

double complex cpl_array_get_mean_complex ( const cpl_array *  array)

Compute the mean value of a complex array.

Parameters
arrayInput array.
Returns
Mean value. In case of error, this is set to 0.0.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not complex.
CPL_ERROR_DATA_NOT_FOUND The specified array has either size zero, or all its elements are invalid.

Array elements marked as invalid are excluded from the computation. The array must contain at least one valid value. Arrays of strings or numerical are not allowed.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

double cpl_array_get_median ( const cpl_array *  array)

Compute the median of a numeric array.

Parameters
arrayInput array.
Returns
Median. In case of error, this is set to 0.0.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.
CPL_ERROR_DATA_NOT_FOUND The specified array has either size zero, or all its elements are invalid.

Array elements marked as invalid are excluded from the computation. The array must contain at least one valid value. Arrays of strings or complex are not allowed.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

double cpl_array_get_min ( const cpl_array *  array)

Get minimum value in a numerical array.

Parameters
arrayInput array.
Returns
Minimum value. In case of error, this is set to 0.0.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.
CPL_ERROR_DATA_NOT_FOUND The specified array has either size zero, or all its elements are invalid.

Array elements marked as invalid are excluded from the search. The array must contain at least one valid value. Arrays of strings or complex are not allowed.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

cpl_error_code cpl_array_get_minpos ( const cpl_array *  array,
cpl_size indx 
)

Get position of minimum in a numerical array.

Parameters
arrayPointer to array.
indxReturned position of minimum value.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array or indx is NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.
CPL_ERROR_DATA_NOT_FOUND The specified array has either size zero, or all its elements are invalid.

Array values marked as invalid are excluded from the search. The indx argument will be assigned the position of the minimum value. Indexes are counted starting from 0. If more than one array element correspond to the min value, the position with the lowest indx is returned. In case of error, indx is set to zero. Arrays of strings or complex are not allowed.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_size cpl_array_get_size ( const cpl_array *  array)

Get the length of an array.

Parameters
arrayInput array.
Returns
Length of array, or zero. The latter case can occur either with an array having zero length, or if a NULL array is passed to the function, but in the latter case a CPL_ERROR_NULL_INPUT is set.

If the array is NULL, zero is returned.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_array_arg(), cpl_array_duplicate(), cpl_array_erase_window(), cpl_array_extract(), cpl_gaussian_eval_2d(), and cpl_wcs_new_from_propertylist().

double cpl_array_get_stdev ( const cpl_array *  array)

Compute the standard deviation of a numeric array.

Parameters
arrayInput array.
Returns
Standard deviation. In case of error, this is set to 0.0.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical.
CPL_ERROR_DATA_NOT_FOUND The specified array has either size zero, or all its elements are invalid.

Array elements marked as invalid are excluded from the computation. The array must contain at least one valid value. Arrays of strings or complex are not allowed.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

const char* cpl_array_get_string ( const cpl_array *  array,
cpl_size  indx 
)

Read a value from a string array.

Parameters
arrayArray to be accessed.
indxPosition of element to be read.
Returns
Character string read. In case of an invalid array element, or in case of error, a NULL pointer is returned.

Read a value from an array of type CPL_TYPE_STRING. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is set. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is set. Indexes are counted starting from 0. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always set.

Note
The returned string is a pointer to an array element, not its copy. Its manipulation will directly affect that array element, while changing that array element using cpl_array_set_string() will turn it into garbage. Therefore, if a real copy of a string array element is required, this function should be called as an argument of the function strdup().

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_table_compare_structure().

cpl_type cpl_array_get_type ( const cpl_array *  array)

Get the type of an array.

Parameters
arrayInput array
Returns
Type of array, or CPL_TYPE_INVALID if a NULL array is passed to the function.

If the array is NULL, CPL_ERROR_NULL_INPUT is set.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and CPL_TYPE_INVALID.

Referenced by cpl_array_abs(), cpl_array_arg(), cpl_array_duplicate(), cpl_array_extract(), cpl_array_extract_imag(), cpl_array_extract_real(), and cpl_fit_image_gaussian().

int cpl_array_has_invalid ( const cpl_array *  array)

Check if an array contains at least one invalid element.

Parameters
arrayArray to inquire.
Returns
1 if the array contains at least one invalid element, 0 if not, -1 in case of error.

Check if there are invalid elements in an array. If the input array is a NULL pointer, a CPL_ERROR_NULL_INPUT is set.

References CPL_ERROR_NULL_INPUT.

int cpl_array_has_valid ( const cpl_array *  array)

Check if an array contains at least one valid value.

Parameters
arrayArray to inquire.
Returns
1 if the array contains at least one valid value, 0 if not -1 in case of error.

Check if there are valid values in an array. If the input array is a NULL pointer, a CPL_ERROR_NULL_INPUT is set.

References CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_insert ( cpl_array *  target_array,
const cpl_array *  insert_array,
cpl_size  start 
)

Merge two arrays.

Parameters
target_arrayTarget array.
insert_arrayArray to be inserted in the target array.
startElement where to insert the insert array.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any input array is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE start is negative.
CPL_ERROR_TYPE_MISMATCH The input arrays do not have the same type.

The input arrays must have the same type. Data from the insert_array are duplicated and inserted at the specified position of the target_array. If the specified start is not less than the target array length, the second array will be appended to the target array. The pointers to array data in the target array may change, therefore pointers previously retrieved by calling cpl_array_get_data_int(), cpl_array_get_data_string(), etc., should be discarded.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_insert_window ( cpl_array *  array,
cpl_size  start,
cpl_size  count 
)

Insert a segment of new elements into array.

Parameters
arrayInput array
startElement where to insert the segment.
countLength of the segment.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT array is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE start is negative.
CPL_ERROR_ILLEGAL_INPUT count is negative.

Insert a segment of empty (invalid) elements. Setting start to a number greater than the array length is legal, and has the effect of appending extra elements at the end of the array: this is equivalent to expanding the array using cpl_array_set_size(). The input array may also have zero length. The pointers to array data values may change, therefore pointers previously retrieved by calling cpl_array_get_data_int(), cpl_array_get_data_string(), etc., should be discarded.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

int cpl_array_is_valid ( const cpl_array *  array,
cpl_size  indx 
)

Check if an array element is valid.

Parameters
arrayPointer to array.
indxArray element to examine.
Returns
1 if the array element is valid, 0 if invalid, -1 in case of error.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input array has zero length, or indx is outside the array boundaries.

Check if an array element is valid.

References CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), and cpl_errorstate_is_equal().

cpl_error_code cpl_array_logarithm ( cpl_array *  array,
double  base 
)

Compute the logarithm of array elements.

Parameters
arrayPointer to array.
baseLogarithm base.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is NULL pointer.
CPL_ERROR_INVALID_TYPE The specified array is not numerical or complex.
CPL_ERROR_ILLEGAL_INPUT The input base is not positive.

Each array element is replaced by its logarithm in the specified base. The operation is always performed in double precision, with a final cast of the result to the array type. Invalid elements are not modified by this operation, but zero or negative elements are invalidated by this operation. In case of complex numbers, values very close to the origin may cause an overflow.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_multiply ( cpl_array *  to_array,
const cpl_array *  from_array 
)

Multiply the values of two numeric or complex arrays.

Parameters
to_arrayTarget array.
from_arraySource array.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any input array is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The input arrays have different sizes.
CPL_ERROR_INVALID_TYPE Any specified array is not numerical.

The arrays are multiplied element by element, and the result is stored in the target array. See the documentation of the function cpl_array_add() for further details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_multiply_scalar ( cpl_array *  array,
double  value 
)

Multiply a numerical array by a constant value.

Parameters
arrayTarget array
valueFactor.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The input array is not numerical.

The operation is always performed in double precision, with a final cast of the result to the target array type. Invalid elements are are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_multiply_scalar_complex ( cpl_array *  array,
double complex  value 
)

Multiply a complex array by a constant complex value.

Parameters
arrayTarget array
valueFactor.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The input array is not complex.

The operation is always performed in double precision, with a final cast of the result to the target array type. Invalid elements are are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_array* cpl_array_new ( cpl_size  length,
cpl_type  type 
)

Create a new array of given type.

Parameters
lengthNumber of elements in array.
typeType of array
Returns
Pointer to the new array, or NULL in case of error.

This function allocates memory for an array, its type is assigned, and its number of elements is allocated. Only arrays of types CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_DOUBLE_COMPLEX and CPL_TYPE_STRING, are supported. An error CPL_ERROR_INVALID_TYPE is set in case other types are specified. All array elements are initially flagged as invalid. If a negative length is specified, an error CPL_ERROR_ILLEGAL_INPUT is set. Zero length arrays are allowed.

References cpl_calloc(), CPL_ERROR_INVALID_TYPE, CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, CPL_TYPE_SIZE, and CPL_TYPE_STRING.

Referenced by cpl_array_duplicate(), cpl_array_extract(), cpl_array_extract_imag(), cpl_array_extract_real(), cpl_table_get_column_names(), cpl_table_where_selected(), and cpl_wcs_convert().

cpl_error_code cpl_array_power ( cpl_array *  array,
double  exponent 
)

Compute the power of array elements.

Parameters
arrayPointer to array.
exponentConstant exponent.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is NULL.
CPL_ERROR_INVALID_TYPE The array is not numerical or complex.

Each array element is replaced by its power to the specified exponent. The operation is always performed in double precision, with a final cast of the result to the array type. Invalid elements are not modified by this operation, but elements are invalidated at any illegal operation: if the specified exponent is not negative, all array elements must be not negative, and if the specified exponent is negative, all array elements must be positive; array elements not fulfilling this condition will be invalidated. Only in case of complex arrays this operation becomes legal. If the exponent is 0.0, then any (valid) array element would be assigned the value 1.0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set ( cpl_array *  array,
cpl_size  indx,
double  value 
)

Write a value to a numerical array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of numerical type, a CPL_ERROR_INVALID_TYPE is returned. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a numerical array element. The value is cast to the accessed array type. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_complex ( cpl_array *  array,
cpl_size  indx,
double complex  value 
)

Write a value to a complex array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of numerical type, a CPL_ERROR_INVALID_TYPE is returned. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length zero, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a numerical array element. The value is cast to the accessed array type. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_cplsize ( cpl_array *  array,
cpl_size  indx,
cpl_size  value 
)

Write a value to a cpl_size array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a cpl_size array element. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_double ( cpl_array *  array,
cpl_size  indx,
double  value 
)

Write a value to a double array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a double array element. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_fit_image_gaussian().

cpl_error_code cpl_array_set_double_complex ( cpl_array *  array,
cpl_size  indx,
double complex  value 
)

Write a value to a double complex array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a double array element. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_float ( cpl_array *  array,
cpl_size  indx,
float  value 
)

Write a value to a float array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a float array element. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_float_complex ( cpl_array *  array,
cpl_size  indx,
float complex  value 
)

Write a value to a float complex array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a float complex array element. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_int ( cpl_array *  array,
cpl_size  indx,
int  value 
)

Write a value to an integer array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to an integer array element. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_invalid ( cpl_array *  array,
cpl_size  indx 
)

Invalidate an array element.

Parameters
arrayArray to be accessed
indxPosition of element to invalidate
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is set. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always set.

In the case of a string array, the string is set free and its pointer is set to NULL; for other data types, the corresponding element of the null flags buffer is flagged. Array elements are counted starting from zero.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_fit_image_gaussian().

cpl_error_code cpl_array_set_long ( cpl_array *  array,
cpl_size  indx,
long  value 
)

Write a value to a long integer array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a long integer array element. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_long_long ( cpl_array *  array,
cpl_size  indx,
long long  value 
)

Write a value to a long long integer array element.

Parameters
arrayArray to be accessed.
indxPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is set. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Write a value to a long long integer array element. The written value is automatically flagged as valid. To invalidate an array value use cpl_array_set_invalid(). Array elements are counted starting from 0.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_size ( cpl_array *  array,
cpl_size  new_length 
)

Resize an array.

Parameters
arrayInput array.
new_lengthNew number of elements in array.
Returns
CPL_ERROR_NONE on success. The new array size must not be negative, or a CPL_ERROR_ILLEGAL_INPUT is returned. The input array pointer should not be NULL, or a CPL_ERROR_NULL_INPUT is returned.

Reallocate an array to a new number of elements. The contents of the array data buffer will be unchanged up to the lesser of the new and old sizes. If the array size is increased, the new array elements are flagged as invalid. The pointer to data may change, therefore pointers previously retrieved by calling cpl_array_get_data_int(), cpl_array_get_data_string(), etc. should be discarded). Resizing to zero is allowed, and would produce a zero-length array. In case of failure, the old data buffer is left intact.

If the array is NULL, zero is returned.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_set_string ( cpl_array *  array,
cpl_size  indx,
const char *  string 
)

Write a character string to a string array element.

Parameters
arrayArray to be accessed.
indxPosition where to write character string.
stringCharacter string to write.
Returns
CPL_ERROR_NONE on success. If array is a NULL pointer a CPL_ERROR_NULL_INPUT is returned. If the array is not of the expected type, a CPL_ERROR_TYPE_MISMATCH is returned. If indx is outside the array range, a CPL_ERROR_ACCESS_OUT_OF_RANGE is returned. If the input array has length 0, the CPL_ERROR_ACCESS_OUT_OF_RANGE is always returned.

Copy a character string to a string array element. The written value can also be a NULL pointer. Note that the input character string is copied, therefore the original can be modified without affecting the column content. To "plug" a character string directly into an array element, use the function cpl_array_get_data_string(). Array elements are counted starting from zero.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_table_get_column_names().

cpl_error_code cpl_array_subtract ( cpl_array *  to_array,
const cpl_array *  from_array 
)

Subtract the values of two numeric or complex arrays.

Parameters
to_arrayTarget array.
from_arraySource array.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any input array is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The input arrays have different sizes.
CPL_ERROR_INVALID_TYPE Any specified array is not numerical.

The arrays are subtracted element by element, and the result is stored in the target array. See the documentation of the function cpl_array_add() for further details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_subtract_scalar ( cpl_array *  array,
double  value 
)

Subtract a constant value from a numerical array.

Parameters
arrayTarget array
valueValue to subtract.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The input array is not numerical.

The operation is always performed in double precision, with a final cast of the result to the target array type. Invalid elements are are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_array_subtract_scalar_complex ( cpl_array *  array,
double complex  value 
)

Subtract a constant complex value from a complex array.

Parameters
arrayTarget array
valueValue to subtract.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input array is a NULL pointer.
CPL_ERROR_INVALID_TYPE The input array is not complex.

The operation is always performed in double precision, with a final cast of the result to the target array type. Invalid elements are are not modified by this operation.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

void* cpl_array_unwrap ( cpl_array *  array)

Delete an array, without losing the data buffer.

Parameters
arrayArray to be deleted.
Returns
Pointer to the internal data buffer.

This function deletes an array, but its data buffer is not destroyed. Supposedly, the developer knows that the data are static, or the developer holds the pointer to the data obtained with the functions cpl_array_get_data_int(), cpl_array_get_data_float(), etc. If the input array is NULL, nothing is done, and no error is set.

References cpl_free().

Referenced by cpl_wcs_delete().

cpl_array* cpl_array_wrap_cplsize ( cpl_size data,
cpl_size  length 
)

Create a new cpl_size array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

This function creates a new cpl_size array that will encapsulate the given data. Note that the size of the data buffer is not checked in any way, and that the data values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid(). The data array is not copied, so it should never be deallocated: to deallocate it, the function cpl_array_delete() should be called instead. Alternatively, the function cpl_array_unwrap() might be used, and the data array deallocated afterwards. A zero or negative length is illegal, and would cause an error CPL_ERROR_ILLEGAL_INPUT to be set. An input NULL pointer would set an error CPL_ERROR_NULL_INPUT.

Note
Functions that handle arrays assume that an array data buffer is dynamically allocated: with a statically allocated data buffer any function implying memory handling (cpl_array_set_size(), cpl_array_delete(), etc.) would crash the program. This means that a static data buffer should never be passed to this function if memory handling is planned. In case of a static data buffer, only the cpl_array_unwrap() destructor can be used.

References cpl_calloc().

cpl_array* cpl_array_wrap_double ( double *  data,
cpl_size  length 
)

Create a new double array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

See documentation of function cpl_array_wrap_int().

References cpl_calloc().

cpl_array* cpl_array_wrap_double_complex ( double complex *  data,
cpl_size  length 
)

Create a new double complex array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

See documentation of function cpl_array_wrap_int().

References cpl_calloc().

cpl_array* cpl_array_wrap_float ( float *  data,
cpl_size  length 
)

Create a new float array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

See documentation of function cpl_array_wrap_int().

References cpl_calloc().

cpl_array* cpl_array_wrap_float_complex ( float complex *  data,
cpl_size  length 
)

Create a new float complex array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

See documentation of function cpl_array_wrap_int().

References cpl_calloc().

cpl_array* cpl_array_wrap_int ( int *  data,
cpl_size  length 
)

Create a new integer array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

This function creates a new integer array that will encapsulate the given data. Note that the size of the data buffer is not checked in any way, and that the data values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid() The data array is not copied, so it should never be deallocated: to deallocate it, the function cpl_array_delete() should be called instead. Alternatively, the function cpl_array_unwrap() might be used, and the data array deallocated afterwards. A zero or negative length is illegal, and would cause an error CPL_ERROR_ILLEGAL_INPUT to be set. An input NULL pointer would set an error CPL_ERROR_NULL_INPUT.

Note
Functions that handle arrays assume that an array data buffer is dynamically allocated: with a statically allocated data buffer any function implying memory handling (cpl_array_set_size(), cpl_array_delete(), etc.) would crash the program. This means that a static data buffer should never be passed to this function if memory handling is planned. In case of a static data buffer, only the cpl_array_unwrap() destructor can be used.

References cpl_calloc().

Referenced by cpl_matrix_get_determinant(), cpl_matrix_invert_create(), cpl_matrix_solve(), and cpl_wcs_platesol().

cpl_array* cpl_array_wrap_long ( long *  data,
cpl_size  length 
)

Create a new long integer array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

This function creates a new long integer array that will encapsulate the given data. Note that the size of the data buffer is not checked in any way, and that the data values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid() The data array is not copied, so it should never be deallocated: to deallocate it, the function cpl_array_delete() should be called instead. Alternatively, the function cpl_array_unwrap() might be used, and the data array deallocated afterwards. A zero or negative length is illegal, and would cause an error CPL_ERROR_ILLEGAL_INPUT to be set. An input NULL pointer would set an error CPL_ERROR_NULL_INPUT.

Note
Functions that handle arrays assume that an array data buffer is dynamically allocated: with a statically allocated data buffer any function implying memory handling (cpl_array_set_size(), cpl_array_delete(), etc.) would crash the program. This means that a static data buffer should never be passed to this function if memory handling is planned. In case of a static data buffer, only the cpl_array_unwrap() destructor can be used.

References cpl_calloc().

cpl_array* cpl_array_wrap_long_long ( long long *  data,
cpl_size  length 
)

Create a new long long integer array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

This function creates a new long long integer array that will encapsulate the given data. Note that the size of the data buffer is not checked in any way, and that the data values are all considered valid: invalid values should be marked using the functions cpl_array_set_invalid() The data array is not copied, so it should never be deallocated: to deallocate it, the function cpl_array_delete() should be called instead. Alternatively, the function cpl_array_unwrap() might be used, and the data array deallocated afterwards. A zero or negative length is illegal, and would cause an error CPL_ERROR_ILLEGAL_INPUT to be set. An input NULL pointer would set an error CPL_ERROR_NULL_INPUT.

Note
Functions that handle arrays assume that an array data buffer is dynamically allocated: with a statically allocated data buffer any function implying memory handling (cpl_array_set_size(), cpl_array_delete(), etc.) would crash the program. This means that a static data buffer should never be passed to this function if memory handling is planned. In case of a static data buffer, only the cpl_array_unwrap() destructor can be used.

References cpl_calloc().

cpl_array* cpl_array_wrap_string ( char **  data,
cpl_size  length 
)

Create a new character string array from existing data.

Parameters
dataExisting data buffer.
lengthNumber of elements in array.
Returns
Pointer to the new array, or NULL in case of error.

See documentation of function cpl_array_wrap_int().

References cpl_calloc().

cpl-6.6.1/html/form_20.png0000644000460300003120000000154512553662440012146 00000000000000‰PNG  IHDRÃÑÚ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïÔIDATxí]ëÒÛ* \ÄÍ&¶yÿ·­.€ I¾Nç´§N=Q¬Ëj‘ÿÀ?€?Aü!ø äà+ñw RCÚä¹7õ9à—Jþœ'eùOiÉ©=e—Ìû™ xç|M³ÝV¿‹ü'±à°JÑ㈠/’í¸ÛZ?kàõ¤—ÿÞà Diƒg&¼O¢(Új4ã´Ü:{Ü­®A¹[ñ\ö‹gqú²éùY7‰÷Æ=ŸqÈkGæÄÆûLú±®!ɺ%ÿ°²«÷±Ì%0Ù&jÑq4éd»µÅÙÞ`/¥žON%¯R«¡¨áóo›î¢«Áçˆyuõ®’ {Û[f…¯óu`óI¿~xãEXïûÆÁ¯çt%Ê]xÏà®IŸ×–a-û¡¦tô@™óå,ÓØ­4èTãVƒÒf›ÀÍeßëH@PÎ=œçÅÞñ¹±ƒ¥7Ò–°Ô¹×Ü>žËF½ìoõè8 )Fn$‰2×`×á0^Ù…Öæ ”™¶GO[”‹)c΃ØÚ‡°‘M” pi!äÜ3Ùx! »µŸ©y”ý­´Ä4i€á:ß\2 ¢l6CRÝhºóÚtfñÖCo +ì:ùƒ_ ½tB´²EÄÃ{FB ’:6Ô½Ä5RÍ®Óàõ»%ér±2·,ÿISÎxÕ:*žöÂÌá;#>ø®~©”l: Ik¨» Û@e( ÏÄ›Ê'ÙUC—£Á¯Ù¶—s´Þ™«ðF²PjKòo|Äí4Åå,ÅR›ja&FÇg]nÀ­´ö§xRFHN2ªt6Ð'/´ï™DŸ=w»µ 7™o^[„w ²-ž8-À¨.C§ÍÛ[ᜤ`Óm A'Ê<¡<Ö½f?µnó'”'…îÁ²4™qxVV§Ô¾ûð…4»Ï%°ÉÛôúY€Ÿ-ß üƒvð×Ë7ñ«;ß8N•IEND®B`‚cpl-6.6.1/html/nav_g.png0000644000460300003120000000013712553662426011774 00000000000000‰PNG  IHDRô1&IDATxíÝ1 ÁOHf„á_ ->~¸åM iËMèÀƒS½ü‚<IEND®B`‚cpl-6.6.1/html/group__cpl__fits.html0000644000460300003120000006277212553662431014410 00000000000000 Common Pipeline Library Reference Manual: FITS related basic routines
Common Pipeline Library Reference Manual  6.6.1
FITS related basic routines

Typedefs

typedef enum _cpl_fits_mode_ cpl_fits_mode
 The CPL fits mode. It is a bit field. More...
 

Enumerations

enum  _cpl_fits_mode_ {
  CPL_FITS_STOP_CACHING,
  CPL_FITS_START_CACHING,
  CPL_FITS_RESTART_CACHING,
  CPL_FITS_ONE
}
 The values of the CPL fits mode. The values can be combined with bitwise or. More...
 

Functions

cpl_size cpl_fits_count_extensions (const char *filename)
 Get the number of extensions contained in a FITS file. More...
 
cpl_size cpl_fits_find_extension (const char *filename, const char *extname)
 Get the place of a given extension in a FITS file. More...
 
int cpl_fits_get_extension_nb (const char *filename, const char *extname)
 Get the place of a given extension in a FITS file. More...
 
cpl_fits_mode cpl_fits_get_mode (void)
 Get the FITS I/O mode. More...
 
int cpl_fits_get_nb_extensions (const char *filename)
 Get the number of extensions contained in a FITS file. More...
 
cpl_error_code cpl_fits_set_mode (cpl_fits_mode mode)
 Set the FITS I/O mode. More...
 

Detailed Description

This module provides functions to get basic information on FITS files

Synopsis:
#include "cpl_fits.h"

Typedef Documentation

The CPL fits mode. It is a bit field.

Enumeration Type Documentation

The values of the CPL fits mode. The values can be combined with bitwise or.

Enumerator
CPL_FITS_STOP_CACHING 

Stop the caching of open FITS files

CPL_FITS_START_CACHING 

Start the caching of open FITS files

CPL_FITS_RESTART_CACHING 

Restart the caching of open FITS files

CPL_FITS_ONE 

Apply the mode change only to the current thread

Function Documentation

cpl_size cpl_fits_count_extensions ( const char *  filename)

Get the number of extensions contained in a FITS file.

Parameters
filenameThe file name
Returns
The number of extensions or -1 in case of error
Note
For a valid fits file without extensions zero is returned

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if the input pointer is NULL
  • CPL_ERROR_FILE_IO If the FITS file could not be opened
  • CPL_ERROR_BAD_FILE_FORMAT if the input FITS file is otherwise invalid

References cpl_ensure, CPL_ERROR_BAD_FILE_FORMAT, CPL_ERROR_FILE_IO, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_fits_get_nb_extensions(), and cpl_frame_get_nextensions().

cpl_size cpl_fits_find_extension ( const char *  filename,
const char *  extname 
)

Get the place of a given extension in a FITS file.

Parameters
filenameThe file name
extnameThe extension name
Returns
The extension number, 0 if not found or -1 on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if the file is not FITS

References cpl_ensure, CPL_ERROR_FILE_IO, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_fits_get_extension_nb(), and cpl_multiframe_append_datagroup().

int cpl_fits_get_extension_nb ( const char *  filename,
const char *  extname 
)

Get the place of a given extension in a FITS file.

Parameters
filenameThe file name
extnameThe extension name
Returns
the extension place or -1 in case of error
See also
cpl_fits_find_extension
Deprecated:
Replace this call with cpl_fits_find_extension().

References cpl_fits_find_extension().

cpl_fits_mode cpl_fits_get_mode ( void  )

Get the FITS I/O mode.

Returns
One of: CPL_FITS_STOP_CACHING, CPL_FITS_START_CACHING
See also
cpl_fits_set_mode()

References CPL_FITS_START_CACHING, and CPL_FITS_STOP_CACHING.

int cpl_fits_get_nb_extensions ( const char *  filename)

Get the number of extensions contained in a FITS file.

Parameters
filenameThe file name
Returns
the number of extensions or -1 in case of error
See also
cpl_fits_count_extensions()
Deprecated:
Replace this call with cpl_fits_count_extensions().

References cpl_fits_count_extensions().

cpl_error_code cpl_fits_set_mode ( cpl_fits_mode  mode)

Set the FITS I/O mode.

Parameters
modeThe FITS I/O mode: CPL_FITS_STOP_CACHING, CPL_FITS_START_CACHING, CPL_FITS_RESTART_CACHING
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_init() to control the FITS I/O mode when CPL is started

Normally when a FITS file is processed with a CPL call the file is openened and closed during that call. However repeated calls on FITS data with many extensions causes the FITS headers to be parsed many times which can lead to a significant performance penalty. If instead this function is called with CPL_FITS_START_CACHING, CPL will use internal storage to keep the FITS files open between calls and only close them when the FITS I/O mode is changed (or cpl_end() is called).

If a CPL function that creates a FITS file is called any previously opened handles to that file are closed. If a CPL function that appends to a FITS file is called any previously opened read-only handles to that file are closed. If a CPL function that reads from a FITS file is called any previously opened read/write-handle to that file is used for the read. Any additional concurrent reads causes the file to also be opened for reading. This means that there is also a performance gain when alternating between appending to and reading from the same file. This optimized I/O mode cannot be used if the CPL application accesses a FITS file without using CPL. An incomplete list of such access is: Calls to rename(), remove(), unlink(), fopen() and access via another process started with for example system() or popen().

The caching of opened FITS files may be used in a multi-threaded environment to the extent that the underlying FITS library (CFITSIO) supports it. One implication of this is that multiple threads may only call CPL FITS saving functions on the same file using proper synchronization such as the OpenMP 'ordered' construct. CPL makes no attempt to verify that a CPL based application performs thread parallel FITS I/O correctly.

The mode CPL_FITS_STOP_CACHING causes all cached filed to be closed. Beware that this can cause an I/O error for a file that has otherwise not been accessed for some time.

Since CPL_FITS_STOP_CACHING closes all cached FITS files, the caller must ensure that this does not interfere with the concurrent use of those same files in another thread.

The mode CPL_FITS_RESTART_CACHING has the same effect as a call with CPL_FITS_STOP_CACHING followed by a call with CPL_FITS_START_CACHING.

The modes CPL_FITS_RESTART_CACHING and CPL_FITS_ONE may be combined. This causes all files cached by the calling thread to be closed. The caching remains active (for all threads), so subsequently opened files will be cached.

CPL_FITS_RESTART_CACHING can be used after an external modification of a FITS file also cached by CPL, thus allowing the caching to work together with the above mentioned external access to the same FITS files.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if the mode is zero
  • CPL_ERROR_UNSUPPORTED_MODE if the mode is not supported
  • CPL_ERROR_INVALID_TYPE if mode is 1, e.g. due to a logical or (||) of the allowed options.
  • CPL_ERROR_BAD_FILE_FORMAT if the I/O caused by CPL_FITS_STOP_CACHING failed

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_UNSUPPORTED_MODE, CPL_FITS_ONE, CPL_FITS_RESTART_CACHING, CPL_FITS_START_CACHING, and CPL_FITS_STOP_CACHING.

Referenced by cpl_end(), and cpl_init().

cpl-6.6.1/html/form_4.png0000644000460300003120000000033712553662434012071 00000000000000‰PNG  IHDR ŠœÖ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïNIDATxíí À DÑÊÇþÛ¶š‚iÿt.ywy;ü~W#:¥d¡c'{½Ã0ðð)IÎh­¯Î{_:ÙK¯ÞÃVG$ „²î ™ÄÄÕObIEND®B`‚cpl-6.6.1/html/group__cpl__framedata.html0000644000460300003120000011516312553662432015361 00000000000000 Common Pipeline Library Reference Manual: Auxiliary Frame Data
Common Pipeline Library Reference Manual  6.6.1
Auxiliary Frame Data

Auxiliary frame data for recipe configurations. More...

Classes

struct  _cpl_framedata_
 The public frame data object. More...
 

Typedefs

typedef struct _cpl_framedata_ cpl_framedata
 The frame data object type. More...
 

Functions

void cpl_framedata_clear (cpl_framedata *self)
 Clear a frame data object. More...
 
cpl_framedatacpl_framedata_create (const char *tag, cpl_size min_count, cpl_size max_count)
 Create a new frame data object and initialize it with the given values. More...
 
void cpl_framedata_delete (cpl_framedata *self)
 Delete a frame data object. More...
 
cpl_framedatacpl_framedata_duplicate (const cpl_framedata *other)
 Create a duplicate of another frame data object. More...
 
cpl_size cpl_framedata_get_max_count (const cpl_framedata *self)
 Get the maximum number of frames. More...
 
cpl_size cpl_framedata_get_min_count (const cpl_framedata *self)
 Get the minimum number of frames. More...
 
const char * cpl_framedata_get_tag (const cpl_framedata *self)
 Get the frame tag. More...
 
cpl_framedatacpl_framedata_new (void)
 Create an new frame data object. More...
 
cpl_error_code cpl_framedata_set (cpl_framedata *self, const char *tag, cpl_size min_count, cpl_size max_count)
 Assign new values to a frame data object. More...
 
cpl_error_code cpl_framedata_set_max_count (cpl_framedata *self, cpl_size max_count)
 Set the maximum number of frames. More...
 
cpl_error_code cpl_framedata_set_min_count (cpl_framedata *self, cpl_size min_count)
 Set the minimum number of frames. More...
 
cpl_error_code cpl_framedata_set_tag (cpl_framedata *self, const char *tag)
 Set the frame tag to the given value. More...
 

Detailed Description

Auxiliary frame data for recipe configurations.

This module implements a frame data object, which stores auxiliary information of input and output frames of recipes. This information is used to store the frame configurations of recipes which can be queried by an application which is going to invoke the recipe.

The objects stores a frame tag, a unique identifier for a certain kind of frame, the minimum and maximum number of frames needed.

A frame is required if the data member min_count is set to a value greater than 0. The minimum and maximum number of frames is unspecified if the respective member, min_count or max_count, is set to -1.

The data members of this structure are public to allow for a static initialization. Any other access of the data members should still be done using the member functions.

Synopsis:
#include <cpl_framedata.h>

Typedef Documentation

The frame data object type.

Function Documentation

void cpl_framedata_clear ( cpl_framedata self)

Clear a frame data object.

Parameters
selfThe frame data object to clear.
Returns
Nothing.

The function clears the contents of the frame data object self, i.e. resets the data members to their default values. If self is NULL, nothing is done and no error is set.

Referenced by cpl_framedata_delete().

cpl_framedata* cpl_framedata_create ( const char *  tag,
cpl_size  min_count,
cpl_size  max_count 
)

Create a new frame data object and initialize it with the given values.

Parameters
tagThe frame tag initializer.
min_countThe initial value for the minimum number of frames.
max_countThe initial value for the maximum number of frames.
Returns
On success the function returns a pointer to the newly created object, or NULL otherwise.

The function allocates the memory for a frame data object, and initializes its data members with the given values of the arguments tag, min_count, and max_count.

Referenced by cpl_recipeconfig_set_input(), cpl_recipeconfig_set_output(), and cpl_recipeconfig_set_outputs().

void cpl_framedata_delete ( cpl_framedata self)

Delete a frame data object.

Parameters
selfThe frame data object to delete.
Returns
Nothing.

The function destroys the frame data object self. All resources used by self are released. If self is NULL, nothing is done and no error is set.

References cpl_framedata_clear().

Referenced by cpl_recipeconfig_set_input(), cpl_recipeconfig_set_inputs(), and cpl_recipeconfig_set_output().

cpl_framedata* cpl_framedata_duplicate ( const cpl_framedata other)

Create a duplicate of another frame data object.

Parameters
otherThe frame data object to clone.
Returns
On success the function returns a pointer to the newly created copy of the frame data object, or NULL otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter other is a NULL pointer.

The function creates a clone of the given frame data object other. The created copy does not share any resources with the original object.

References CPL_ERROR_NULL_INPUT, cpl_error_set, _cpl_framedata_::max_count, _cpl_framedata_::min_count, and _cpl_framedata_::tag.

Referenced by cpl_recipeconfig_set_inputs().

cpl_size cpl_framedata_get_max_count ( const cpl_framedata self)

Get the maximum number of frames.

Parameters
selfThe frame data object.
Returns
The function returns the maximum number of frames on success. In case an error occurred, the return value is -2 and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the maximum number of frames value stored in self. If the returned value is -1, the maximum number of frames is undefined, i.e. any number may be used.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_size cpl_framedata_get_min_count ( const cpl_framedata self)

Get the minimum number of frames.

Parameters
selfThe frame data object.
Returns
The function returns the minimum number of frames on success. In case an error occurred, the return value is -2 and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the minimum number of frames value stored in self. If the returned value is -1, the minimum number of frames is undefined, i.e. any number may be used.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

const char* cpl_framedata_get_tag ( const cpl_framedata self)

Get the frame tag.

Parameters
selfThe frame data object.
Returns
The function returns a pointer to the frame tag on success, or NULL if an error occurred.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a handle to the frame tag stored in the frame data object self.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_framedata* cpl_framedata_new ( void  )

Create an new frame data object.

Returns
On success the function returns a pointer to the newly created object, or NULL otherwise.

The function allocates the memory for a frame data object, and initializes the data members to their default values, i.e. tag is set to NULL, and both, min_count and max_count are set to -1.

cpl_error_code cpl_framedata_set ( cpl_framedata self,
const char *  tag,
cpl_size  min_count,
cpl_size  max_count 
)

Assign new values to a frame data object.

Parameters
selfThe frame data object.
tagThe tag to assign.
min_countThe value to set as minimum number of frames.
max_countThe value to set as maximum number of frames.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter tag is a NULL pointer or the empty string.

The function updates the frame data object self with the given values for tag, min_count, and max_count. All previous values stored in self are replaced. The string tag is assigned by copying its contents.

See also
cpl_framedata_set_tag()

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_framedata_set_max_count ( cpl_framedata self,
cpl_size  max_count 
)

Set the maximum number of frames.

Parameters
selfThe frame data object.
max_countThe value to set as maximum number of frames.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function sets the maximum number of frames value of self to max_count. If max_count is -1 the maximum number of frames is unspecified.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_framedata_set_min_count ( cpl_framedata self,
cpl_size  min_count 
)

Set the minimum number of frames.

Parameters
selfThe frame data object.
min_countThe value to set as minimum number of frames.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function sets the minimum number of frames value of self to min_count. If min_count is -1 the minimum number of frames is unspecified.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_framedata_set_tag ( cpl_framedata self,
const char *  tag 
)

Set the frame tag to the given value.

Parameters
selfThe frame data object.
tagThe tag to assign.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter tag is a NULL pointer or the empty string.

The function assigns the string tag to the corresponding data member of the frame data object self by copying its contents. Any previous tag stored in self is replaced.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl-6.6.1/html/group__cpl__wcs.html0000644000460300003120000013727112553662432014235 00000000000000 Common Pipeline Library Reference Manual: World Coordinate System
Common Pipeline Library Reference Manual  6.6.1
World Coordinate System

Macros

#define CPL_WCS_REGEXP
 A regular expression that matches the FITS keys used for WCS. More...
 

Functions

cpl_error_code cpl_wcs_convert (const cpl_wcs *wcs, const cpl_matrix *from, cpl_matrix **to, cpl_array **status, cpl_wcs_trans_mode transform)
 Convert between physical and world coordinates. More...
 
void cpl_wcs_delete (cpl_wcs *wcs)
 Destroy a WCS structure. More...
 
const cpl_matrix * cpl_wcs_get_cd (const cpl_wcs *wcs)
 Accessor to get the CD matrix for a WCS. More...
 
const cpl_array * cpl_wcs_get_crpix (const cpl_wcs *wcs)
 Accessor to get the CRPIX vector for a WCS. More...
 
const cpl_array * cpl_wcs_get_crval (const cpl_wcs *wcs)
 Accessor to get the CRVAL vector for a WCS. More...
 
const cpl_array * cpl_wcs_get_ctype (const cpl_wcs *wcs)
 Accessor to get the CTYPE vector for a WCS. More...
 
const cpl_array * cpl_wcs_get_cunit (const cpl_wcs *wcs)
 Accessor to get the CUNIT vector for a WCS. More...
 
const cpl_array * cpl_wcs_get_image_dims (const cpl_wcs *wcs)
 Accessor to get the axis lengths of the image associated with a WCS. More...
 
int cpl_wcs_get_image_naxis (const cpl_wcs *wcs)
 Accessor to get the dimensionality of the image associated with a WCS. More...
 
cpl_wcs * cpl_wcs_new_from_propertylist (const cpl_propertylist *plist)
 Create a wcs structure by parsing a propertylist. More...
 
cpl_error_code cpl_wcs_platesol (const cpl_propertylist *ilist, const cpl_matrix *cel, const cpl_matrix *xy, int niter, float thresh, cpl_wcs_platesol_fitmode fitmode, cpl_wcs_platesol_outmode outmode, cpl_propertylist **olist)
 Do a 2d plate solution given physical and celestial coordinates. More...
 

Detailed Description

This module provides functions to manipulate FITS World Coordinate Systems

A cpl_wcs is an object containing a pointer to the WCSLIB structure and the physical dimensions of the image from which the WCS was read. The functionality provided includes general transformations between physical and world coordinates as well as a few convenience routines for x,y <=> RA,Dec transformations.

Synopsis:
#include "cpl_wcs.h"

Macro Definition Documentation

#define CPL_WCS_REGEXP

A regular expression that matches the FITS keys used for WCS.

Function Documentation

cpl_error_code cpl_wcs_convert ( const cpl_wcs *  wcs,
const cpl_matrix *  from,
cpl_matrix **  to,
cpl_array **  status,
cpl_wcs_trans_mode  transform 
)

Convert between physical and world coordinates.

Parameters
wcsThe input cpl_wcs structure
fromThe input coordinate matrix
toThe output coordinate matrix
statusThe output status array
transformThe transformation mode
Returns
An appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter wcs, from, to or status is a NULL pointer or wcs is missing some of its information.
CPL_ERROR_UNSPECIFIED No rows or columns in the input matrix, or an unspecified error has occurred in the WCSLIB routine
CPL_ERROR_UNSUPPORTED_MODE The input conversion mode is not supported
CPL_ERROR_NO_WCS The WCS sub library is not available.

This function converts between several types of coordinates. These include: – physical coordinates: The physical location on a detector (i.e. pixel coordinates) – world coordinates: The real astronomical coordinate system for the observations. This may be spectral, celestial, time, etc. – standard coordinates: These are an intermediate relative coordinate representation, defined as a distance from a reference point in the natural units of the world coordinate system. Any defined projection geometry will have already been included in the definition of standard coordinates.

The supported conversion modes are: – CPL_WCS_PHYS2WORLD: Converts input physical to world coordinates – CPL_WCS_WORLD2PHYS: Converts input world to physical coordinates – CPL_WCS_WORLD2STD: Converts input world to standard coordinates – CPL_WCS_PHYS2STD: Converts input physical to standard coordinates

The input cpl_matrix from has to be filled with coordinates. The number of rows equals the number of objects and the number of columns has to be equal to the value of the NAXIS keyword in the wcs structure. The same convention is used for the output cpl_matrix to. For example, if an image contains NAXIS = 2 and 100 stars with positions X,Y, the new matrix will be created:

1 from = cpl_matrix_new(100, 2);

Each element in column 0 will take a X coordinate and each element in column 1 will take a Y coordinate.

The output matrix and status arrays will be allocated here, and thus will need to be freed by the calling routine. The status array is used to flag input coordinates where there has been some sort of failure in the transformation.

References cpl_array_delete(), cpl_array_get_data_double(), cpl_array_get_data_int(), cpl_array_new(), cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NO_WCS, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, CPL_ERROR_UNSUPPORTED_MODE, cpl_matrix_delete(), cpl_matrix_get_data(), cpl_matrix_get_data_const(), cpl_matrix_get_ncol(), cpl_matrix_get_nrow(), cpl_matrix_new(), CPL_TYPE_DOUBLE, and CPL_TYPE_INT.

Referenced by cpl_wcs_platesol().

void cpl_wcs_delete ( cpl_wcs *  wcs)

Destroy a WCS structure.

Parameters
wcsThe WCS structure to destroy
Returns
Nothing.
Errors
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function destroys the WCS structure wcs and its whole contents. If wcs is NULL, nothing is done and no error is set.

References cpl_array_delete(), cpl_array_unwrap(), CPL_ERROR_NO_WCS, cpl_free(), and cpl_matrix_delete().

Referenced by cpl_wcs_platesol().

const cpl_matrix* cpl_wcs_get_cd ( const cpl_wcs *  wcs)

Accessor to get the CD matrix for a WCS.

Parameters
wcsThe WCS structure to examine
Returns
A handle to a matrix with the CDi_ja linear transformation matrix, or NULL on error.
Errors
CPL_ERROR_NULL_INPUT The parameter wcs is a NULL pointer.
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function returns a handle to a matrix with the CD matrix defined for this WCS.

References cpl_ensure, CPL_ERROR_NO_WCS, and CPL_ERROR_NULL_INPUT.

const cpl_array* cpl_wcs_get_crpix ( const cpl_wcs *  wcs)

Accessor to get the CRPIX vector for a WCS.

Parameters
wcsThe WCS structure to examine
Returns
A handle to an array with the CRPIXja keyvalues for each pixel axis, or NULL on error.
Errors
CPL_ERROR_NULL_INPUT The parameter wcs is a NULL pointer.
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function returns a handle to an array with the CRPIX vector defined for this WCS.

References cpl_ensure, CPL_ERROR_NO_WCS, and CPL_ERROR_NULL_INPUT.

const cpl_array* cpl_wcs_get_crval ( const cpl_wcs *  wcs)

Accessor to get the CRVAL vector for a WCS.

Parameters
wcsThe WCS structure to examine
Returns
A handle to an array with the CRVALia keyvalues for each coord axis, or NULL on error.
Errors
CPL_ERROR_NULL_INPUT The parameter wcs is a NULL pointer.
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function returns a handle to an array with the CRVAL vector defined for this WCS.

References cpl_ensure, CPL_ERROR_NO_WCS, and CPL_ERROR_NULL_INPUT.

const cpl_array* cpl_wcs_get_ctype ( const cpl_wcs *  wcs)

Accessor to get the CTYPE vector for a WCS.

Parameters
wcsThe WCS structure to examine
Returns
A handle to an array with the CTYPEja keyvalues for each pixel axis, or NULL on error.
Errors
CPL_ERROR_NULL_INPUT The parameter wcs is a NULL pointer.
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function returns a handle to an array with the CTYPE vector defined for this WCS.

References cpl_ensure, CPL_ERROR_NO_WCS, and CPL_ERROR_NULL_INPUT.

const cpl_array* cpl_wcs_get_cunit ( const cpl_wcs *  wcs)

Accessor to get the CUNIT vector for a WCS.

Parameters
wcsThe WCS structure to examine
Returns
A handle to an array with the CUNITja keyvalues for each pixel axis, or NULL on error.
Errors
CPL_ERROR_NULL_INPUT The parameter wcs is a NULL pointer.
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function returns a handle to an array with the CUNIT vector defined for this WCS.

References cpl_ensure, CPL_ERROR_NO_WCS, and CPL_ERROR_NULL_INPUT.

const cpl_array* cpl_wcs_get_image_dims ( const cpl_wcs *  wcs)

Accessor to get the axis lengths of the image associated with a WCS.

Parameters
wcsThe WCS structure to examine
Returns
An array with the image axis sizes, or NULL on error.
Errors
CPL_ERROR_NULL_INPUT The parameter wcs is a NULL pointer.
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function returns a handle to an array with the axis lengths of the image associated with this WCS. If no image was used to define the WCS then a NULL value will be returned.

References cpl_ensure, CPL_ERROR_NO_WCS, and CPL_ERROR_NULL_INPUT.

int cpl_wcs_get_image_naxis ( const cpl_wcs *  wcs)

Accessor to get the dimensionality of the image associated with a WCS.

Parameters
wcsThe WCS structure to examine
Returns
The image dimensionality, or zero on error
Errors
CPL_ERROR_NULL_INPUT The parameter wcs is a NULL pointer.
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function returns the dimensionality of the image associated with a WCS. If no image was used to define the WCS then a value of zero is returned.

References cpl_ensure, CPL_ERROR_NO_WCS, and CPL_ERROR_NULL_INPUT.

cpl_wcs* cpl_wcs_new_from_propertylist ( const cpl_propertylist plist)

Create a wcs structure by parsing a propertylist.

Parameters
plistThe input propertylist
Returns
The newly created and filled cpl_wcs object or NULL if it could not be created. In the latter case an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter plist is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH NAXIS information in image propertylist is not an integer
CPL_ERROR_DATA_NOT_FOUND Error in getting NAXIS information for image propertylists
CPL_ERROR_UNSPECIFIED An unspecified error occurred in the WCSLIB routine.
CPL_ERROR_NO_WCS The WCS sub library is not available.

The function allocates memory for a WCS structure. A pointer to the WCSLIB header information is created by parsing the FITS WCS keywords from the header of a file. A few ancillary items are also filled in.

It is allowed to pass a cpl_propertylist with a valid WCS structure and NAXIS = 0, such a propertylist can be created by cpl_wcs_platesol(). In this case a cpl_wcs object is returned for which the dimensional information (accessible via cpl_wcs_get_image_dims()) will be NULL.

The returned property must be destroyed using the wcs destructor cpl_wcs_delete().

See also
cpl_wcs_delete()

References cpl_array_fill_window(), cpl_array_get_data_int(), cpl_array_get_size(), cpl_ensure, CPL_ERROR_NO_WCS, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_errorstate_set(), cpl_free(), cpl_propertylist_copy_property_regexp(), cpl_propertylist_delete(), cpl_propertylist_get_int(), cpl_propertylist_get_size(), cpl_propertylist_has(), cpl_propertylist_new(), and cpl_sprintf().

Referenced by cpl_wcs_platesol().

cpl_error_code cpl_wcs_platesol ( const cpl_propertylist ilist,
const cpl_matrix *  cel,
const cpl_matrix *  xy,
int  niter,
float  thresh,
cpl_wcs_platesol_fitmode  fitmode,
cpl_wcs_platesol_outmode  outmode,
cpl_propertylist **  olist 
)

Do a 2d plate solution given physical and celestial coordinates.

Parameters
ilistThe input property list containing the first pass WCS
celThe celestial coordinate matrix
xyThe physical coordinate matrix
niterThe number of fitting iterations
threshThe threshold for the fitting rejection cycle
fitmodeThe fitting mode (see below)
outmodeThe output mode (see below)
olistThe output property list containing the new WCS
Returns
An appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter cel is a NULL pointer, the parameter xy is a NULL pointer or ilist is a NULL pointer. CPL_ERROR_ILLEGAL_INPUT The parameter niter is non-positive.
CPL_ERROR_UNSPECIFIED Unable to parse the input propertylist into a proper FITS WCS or there are too few points in the input matrices for a fit.
CPL_ERROR_INCOMPATIBLE_INPUT The matrices cel and xy have different sizes.
CPL_ERROR_UNSUPPORTED_MODE Either fitmode or outmode are specified incorrectly
CPL_ERROR_DATA_NOT_FOUND The threshold is so low that no valid points are found. If the threshold is not positive, this error is certain to occur.
CPL_ERROR_NO_WCS The WCS sub library is not available.

This function allows for the following type of fits: – CPL_WCS_PLATESOL_4: Fit for zero point, 1 scale and 1 rotation. – CPL_WCS_PLATESOL_6: Fit for zero point, 2 scales, 1 rotation, 1 shear.

This function allows the zeropoint to be defined by shifting either the physical or the celestial coordinates of the reference point: – CPL_WCS_MV_CRVAL: Keeps the physical point fixed and shifts the celestial – CPL_WCS_MV_CRPIX: Keeps the celestial point fixed and shifts the physical

The output property list contains WCS relevant information only.

The matrices cel, and xy have to be set up in the same way as it is required for cpl_wcs_convert(). See the documentation of cpl_wcs_convert() for details.

See also
cpl_wcs_convert()

References cpl_array_delete(), cpl_array_get_data_double_const(), cpl_array_wrap_int(), cpl_calloc(), cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NO_WCS, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, CPL_ERROR_UNSUPPORTED_MODE, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_free(), cpl_malloc(), cpl_matrix_delete(), cpl_matrix_get(), cpl_matrix_get_data_const(), cpl_matrix_get_nrow(), cpl_property_delete(), cpl_property_get_int(), cpl_property_get_name(), cpl_property_get_type(), cpl_property_new(), cpl_property_set_comment(), cpl_property_set_double(), cpl_propertylist_append_double(), cpl_propertylist_copy_property_regexp(), cpl_propertylist_delete(), cpl_propertylist_erase(), cpl_propertylist_erase_regexp(), cpl_propertylist_get(), cpl_propertylist_get_size(), cpl_propertylist_insert_after_property(), cpl_propertylist_new(), CPL_SIZE_FORMAT, CPL_TYPE_DOUBLE, CPL_TYPE_INT, cpl_wcs_convert(), cpl_wcs_delete(), and cpl_wcs_new_from_propertylist().

cpl-6.6.1/html/group__cpl__fft.html0000644000460300003120000004021112553662432014203 00000000000000 Common Pipeline Library Reference Manual: FFTW wrappers
Common Pipeline Library Reference Manual  6.6.1
FFTW wrappers

Typedefs

typedef enum _cpl_fft_mode_ cpl_fft_mode
 The CPL fft mode. More...
 

Enumerations

enum  _cpl_fft_mode_ {
  CPL_FFT_FORWARD,
  CPL_FFT_BACKWARD,
  CPL_FFT_NOSCALE,
  CPL_FFT_FIND_MEASURE,
  CPL_FFT_FIND_PATIENT,
  CPL_FFT_FIND_EXHAUSTIVE
}
 The supported values of the CPL fft mode. More...
 

Functions

cpl_error_code cpl_fft_image (cpl_image *self, const cpl_image *other, cpl_fft_mode mode)
 Perform a FFT operation on an image. More...
 
cpl_error_code cpl_fft_imagelist (cpl_imagelist *self, const cpl_imagelist *other, cpl_fft_mode mode)
 Perform a FFT operation on the images in an imagelist. More...
 

Detailed Description

This module provides FFTW wrappers

Synopsis:
#include "cpl_fft.h"

Typedef Documentation

The CPL fft mode.

Enumeration Type Documentation

The supported values of the CPL fft mode.

Enumerator
CPL_FFT_FORWARD 

The forward transform

CPL_FFT_BACKWARD 

The backward transform

CPL_FFT_NOSCALE 

Transform without scaling (has no effect on forward transform)

CPL_FFT_FIND_MEASURE 

Spend time finding the best transform

CPL_FFT_FIND_PATIENT 

Spend more time finding the best transform

CPL_FFT_FIND_EXHAUSTIVE 

Spend even more time finding the best transform

Function Documentation

cpl_error_code cpl_fft_image ( cpl_image *  self,
const cpl_image *  other,
cpl_fft_mode  mode 
)

Perform a FFT operation on an image.

Parameters
selfPre-allocated output image to transform to
otherInput image to transform from, use self for in-place transform
modeCPL_FFT_FORWARD or CPL_FFT_BACKWARD, optionally CPL_FFT_NOSCALE
Returns
CPL_ERROR_NONE or the corresponding _cpl_error_code_ on error

This function performs an FFT on an image, using FFTW. CPL may be configured without this library, in this case an otherwise valid call will set and return the error CPL_ERROR_UNSUPPORTED_MODE.

The input and output images must match in precision level. Integer images are not supported.

In a forward transform the input image may be non-complex. In this case a real-to-complex transform is performed. This will only compute the first ny/2 + 1 columns of the transform. In this transform it is allowed to pass an output image with ny/2 + 1 columns.

Similarly, in a backward transform the output image may be non-complex. In this case a complex-to-real transform is performed. This will only transform the first ny/2 + 1 columns of the input. In this transform it is allowed to pass an input image with ny/2 + 1 columns.

Per default the backward transform scales (divides) the result with the number of elements transformed (i.e. the number of pixels in the result image). This scaling can be turned off with CPL_FFT_NOSCALE.

If many transformations in the same direction are to be done on data of the same size and type, a reduction in the time required to perform the transformations can be achieved by adding the flag CPL_FFT_FIND_MEASURE to the first transformation. For a larger number of transformations a further reduction may be achived with the flag CPL_FFT_FIND_PATIENT and for an even larger number of transformations a further reduction may be achived with the flag CPL_FFT_FIND_EXHAUSTIVE.

If many transformations are to be done then a reduction in the time required to perform the transformations can be achieved by using cpl_fft_imagelist().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an image is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the mode is illegal
  • CPL_ERROR_INCOMPATIBLE_INPUT if the image sizes do not match
  • CPL_ERROR_TYPE_MISMATCH if the image types are incompatible with each other or with the transform
  • CPL_ERROR_UNSUPPORTED_MODE if FFTW has not been installed

References CPL_ERROR_NONE.

cpl_error_code cpl_fft_imagelist ( cpl_imagelist *  self,
const cpl_imagelist *  other,
cpl_fft_mode  mode 
)

Perform a FFT operation on the images in an imagelist.

Parameters
selfPre-allocated output imagelist to transform to
otherInput imagelist to transform from
modeCPL_FFT_FORWARD or CPL_FFT_BACKWARD, optionally CPL_FFT_NOSCALE
Returns
CPL_ERROR_NONE or the corresponding _cpl_error_code_ on error
See also
cpl_fft_image()

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_imagelist_get(), cpl_imagelist_get_const(), and cpl_imagelist_get_size().

cpl-6.6.1/html/group__cpl__geom__img.html0000644000460300003120000010506212553662432015354 00000000000000 Common Pipeline Library Reference Manual: High level functions for geometric transformations
Common Pipeline Library Reference Manual  6.6.1
High level functions for geometric transformations

Functions

cpl_image ** cpl_geom_img_offset_combine (const cpl_imagelist *self, const cpl_bivector *offs, int refine, const cpl_bivector *aperts, const cpl_vector *sigmas, cpl_size *pisigma, cpl_size s_hx, cpl_size s_hy, cpl_size m_hx, cpl_size m_hy, cpl_size min_rej, cpl_size max_rej, cpl_geom_combine union_flag)
 Images list recombination. More...
 
cpl_bivector * cpl_geom_img_offset_fine (const cpl_imagelist *ilist, const cpl_bivector *estimates, const cpl_bivector *anchors, cpl_size s_hx, cpl_size s_hy, cpl_size m_hx, cpl_size m_hy, cpl_vector *correl)
 Get the offsets by correlating the images. More...
 
cpl_image ** cpl_geom_img_offset_saa (const cpl_imagelist *ilist, const cpl_bivector *offs, cpl_kernel kernel, cpl_size rejmin, cpl_size rejmax, cpl_geom_combine union_flag, double *ppos_x, double *ppos_y)
 Shift and add an images list to a single image. More...
 

Detailed Description

This module contains functions to compute the shift-and-add operation on an image list.

Synopsis:
#include "cpl_geom_img.h"

Function Documentation

cpl_image** cpl_geom_img_offset_combine ( const cpl_imagelist *  self,
const cpl_bivector *  offs,
int  refine,
const cpl_bivector *  aperts,
const cpl_vector *  sigmas,
cpl_size pisigma,
cpl_size  s_hx,
cpl_size  s_hy,
cpl_size  m_hx,
cpl_size  m_hy,
cpl_size  min_rej,
cpl_size  max_rej,
cpl_geom_combine  union_flag 
)

Images list recombination.

Parameters
selfInput imagelist - with refining images may be erased
offsList of offsets in x and y
refineIff non-zero, the offsets will be refined
apertsList of correlation apertures or NULL if unknown
sigmasPositive, decreasing sigmas to apply
pisigmaIndex of the sigma that was used or undefined on error
s_hxSearch area half-width.
s_hySearch area half-height.
m_hxMeasurement area half-width.
m_hyMeasurement area half-height.
min_rejnumber of low values to reject in stacking
max_rejnumber of high values to reject in stacking
union_flagCombination mode (CPL_GEOM_UNION or CPL_GEOM_INTERSECT)
Returns
Pointer to newly allocated images array, or NULL on error.
See also
cpl_geom_img_offset_saa()
cpl_apertures_extract()
cpl_geom_img_offset_fine()

With offset refinement enabled: This function detects cross correlation points in the first image (if not provided by the user), use them to refine the provided offsets with a cross correlation method, and then apply the shift and add to recombine the images together. Non-correlating images are removed from self.

Without offset refinement self is not modified.

The supported types are CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT.

The number of provided offsets shall be equal to the number of input images. The ith offset (offs_x, offs_y) is the offset that has to be used to shift the ith image to align it on the first one.

sigmas may be NULL if offset refinement is disabled or if aperts is non-NULL.

On success the returned image array contains 2 images:

  • the combined image
  • the contribution map

The returned cpl_image array must be deallocated like this:

1 if (array != NULL) {
2  cpl_image_delete(array[0]);
3  cpl_image_delete(array[1]);
4  cpl_free(array);
5 }

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if self or offs is NULL, or if sigmas is NULL with refinement enabled and aperts NULL.
  • CPL_ERROR_ILLEGAL_INPUT if self is not uniform
  • CPL_ERROR_INCOMPATIBLE_INPUT if self and offs have different sizes
  • CPL_ERROR_DATA_NOT_FOUND if the shift and add of the images fails

References cpl_apertures_delete(), cpl_apertures_extract(), cpl_apertures_get_pos_x(), cpl_apertures_get_pos_y(), cpl_apertures_sort_by_npix(), cpl_bivector_delete(), cpl_bivector_get_size(), cpl_bivector_get_x(), cpl_bivector_get_x_data(), cpl_bivector_get_y(), cpl_bivector_get_y_data(), cpl_bivector_new(), cpl_ensure, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NULL_INPUT, cpl_geom_img_offset_fine(), cpl_geom_img_offset_saa(), cpl_imagelist_delete(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_is_uniform(), cpl_imagelist_new(), cpl_imagelist_set(), cpl_imagelist_unset(), CPL_SIZE_FORMAT, cpl_vector_delete(), cpl_vector_get_data_const(), cpl_vector_new(), and cpl_vector_set_size().

cpl_bivector* cpl_geom_img_offset_fine ( const cpl_imagelist *  ilist,
const cpl_bivector *  estimates,
const cpl_bivector *  anchors,
cpl_size  s_hx,
cpl_size  s_hy,
cpl_size  m_hx,
cpl_size  m_hy,
cpl_vector *  correl 
)

Get the offsets by correlating the images.

Parameters
ilistInput image list
estimatesFirst-guess estimation of the offsets
anchorsList of anchor points
s_hxHalf-width of search area
s_hyHalf-height of search area
m_hxHalf-width of measurement area
m_hyHalf-height of measurement area
correlList of cross-correlation quality factors
Returns
List of offsets or NULL on error

The matching is performed using a 2d cross-correlation, using a minimal squared differences criterion. One measurement is performed per input anchor point, and the median offset is returned together with a measure of similarity for each plane.

The images in the input list must only differ from a shift. In order from the correlation to work, they must have the same level (check the average values of your input images if the correlation does not work).

The supported types are CPL_TYPE_DOUBLE and CPL_TYPE_FLOAT. The bad pixel maps are ignored by this function.

The ith offset (offsx, offsy) in the returned offsets is the one that have to be used to shift the ith image to align it on the reference image (the first one).

If not NULL, the returned cpl_bivector must be deallocated with cpl_bivector_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ilist is not valid

References cpl_bivector_get_size(), cpl_bivector_get_x_data(), cpl_bivector_get_x_data_const(), cpl_bivector_get_y_data(), cpl_bivector_get_y_data_const(), cpl_bivector_new(), CPL_BORDER_FILTER, cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_set(), CPL_FILTER_MEDIAN, cpl_image_delete(), cpl_image_filter_mask(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_image_new(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_is_uniform(), cpl_mask_delete(), cpl_mask_new(), cpl_mask_not(), cpl_msg_debug(), CPL_SIZE_FORMAT, and cpl_vector_get_data().

Referenced by cpl_geom_img_offset_combine().

cpl_image** cpl_geom_img_offset_saa ( const cpl_imagelist *  ilist,
const cpl_bivector *  offs,
cpl_kernel  kernel,
cpl_size  rejmin,
cpl_size  rejmax,
cpl_geom_combine  union_flag,
double *  ppos_x,
double *  ppos_y 
)

Shift and add an images list to a single image.

Parameters
ilistInput image list
offsList of offsets in x and y
kernelInterpolation kernel to use for resampling
rejminNumber of minimum value pixels to reject in stacking
rejmaxNumber of maximum value pixels to reject in stacking
union_flagCombination mode (CPL_GEOM_UNION or CPL_GEOM_INTERSECT)
ppos_xIf non-NULL, *ppos_x is the X-position of the first image in the combined image
ppos_yIf non-NULL, *ppos_y is the Y- position of the first image in the combined image
Returns
Pointer to newly allocated images array, or NULL on error.

The supported types are CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT.

The number of provided offsets shall be equal to the number of inputs images. The ith offset (offs_x, offs_y) is the offset that has to be used to shift the ith image to align it on the first one.

Provide the name of the kernel you want to generate. Supported kernel types are:

  • CPL_KERNEL_DEFAULT: default kernel, currently CPL_KERNEL_TANH
  • CPL_KERNEL_TANH: Hyperbolic tangent
  • CPL_KERNEL_SINC: Sinus cardinal
  • CPL_KERNEL_SINC2: Square sinus cardinal
  • CPL_KERNEL_LANCZOS: Lanczos2 kernel
  • CPL_KERNEL_HAMMING: Hamming kernel
  • CPL_KERNEL_HANN: Hann kernel
  • CPL_KERNEL_NEAREST: Nearest neighbor kernel (1 when dist < 0.5, else 0)

If the number of input images is lower or equal to 3, the rejection parameters are ignored. If the number of input images is lower or equal to 2*(rejmin+rejmax), the rejection parameters are ignored.

On success the returned image array contains 2 images:

  • the combined image
  • the contribution map

Pixels with a zero in the contribution map are flagged as bad in the combined image.

If not NULL, the returned cpl_image array arr must be deallocated like:

1 if (arr[0] != NULL) cpl_image_delete(arr[0]);
2 if (arr[1] != NULL) cpl_image_delete(arr[1]);
3 cpl_free(arr);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if ilist is invalid or if rejmin or rejmax is negative
  • CPL_ERROR_INCOMPATIBLE_INPUT if ilist and offs have different sizes
  • CPL_ERROR_ILLEGAL_OUTPUT if the CPL_GEOM_INTERSECT method is used with non-overlapping images.
  • CPL_ERROR_INVALID_TYPE if the passed image list type is not supported
  • CPL_ERROR_UNSUPPORTED_MODE if the union_flag is not one of the supported combination modes, which are CPL_GEOM_INTERSECT, CPL_GEOM_UNION, CPL_GEOM_FIRST.

References cpl_bivector_get_size(), cpl_bivector_get_x_const(), cpl_bivector_get_y_const(), cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_image_accept_all(), cpl_image_delete(), cpl_image_duplicate(), cpl_image_fill_rejected(), cpl_image_get_bpm(), cpl_image_get_bpm_const(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_image_new(), cpl_image_new_from_mask(), cpl_image_wrap_int(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_is_uniform(), cpl_imagelist_unwrap(), cpl_malloc(), cpl_mask_is_empty(), cpl_mask_not(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT, cpl_vector_delete(), cpl_vector_duplicate(), cpl_vector_fill_kernel_profile(), cpl_vector_get_data_const(), cpl_vector_get_max(), cpl_vector_get_min(), cpl_vector_new(), and cpl_vector_sort().

Referenced by cpl_geom_img_offset_combine().

cpl-6.6.1/html/form_15.png0000644000460300003120000000101212553662437012145 00000000000000‰PNG  IHDR>7c ¾0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïyIDATxíÍ’³ [þD@yÿ·ÝÁømMIÌíÛLMB1&¡¹|Ì`5ÀMT`èÀ»qªœ³¸d š©V–^À%ešÀ.ÙNî;|.åØeŽSl††i‹f£'åZ>–ý\ñ¢<`—ƒß¢_ËðL•ÑM7¤~ `Ÿ“t~nºìá§8e²ÎU¶k¼â¹_¾üGh{¸™çh à™Ö3Õ xL*¡€}Ús”K_Ûfjnüà¶h j¤2Ôþ ¢š¥]à„2oªm3OS׿2íR>)#ýz E'¢U}ž!³Iõl¶oßi;íÜc?Ç— c’êÜ/@‹rÚ5/À€?ƒM÷ÿA%òGÏî ¸‰¦¹×/8¸Žà[½áºÕ¾zÃuëÑÓpɉëÐâÊ\/så:kø=— 8ù€+6×Yµ~Ûâ\¯¹þ¹nôëFî´nß%€^”‹Ÿ¨6¨ÎfQ›gçË Є-­IEND®B`‚cpl-6.6.1/html/group__cpl__frameset__io.html0000644000460300003120000002124512553662432016066 00000000000000 Common Pipeline Library Reference Manual: Frame Sets IO functions
Common Pipeline Library Reference Manual  6.6.1
Frame Sets IO functions

Functions

cpl_imagelist * cpl_imagelist_load_frameset (const cpl_frameset *fset, cpl_type im_type, cpl_size pnum, cpl_size xtnum)
 Load an imagelist from a frameset. More...
 

Detailed Description

Synopsis:
#include <cpl_frameset_io.h>

Function Documentation

cpl_imagelist* cpl_imagelist_load_frameset ( const cpl_frameset fset,
cpl_type  im_type,
cpl_size  pnum,
cpl_size  xtnum 
)

Load an imagelist from a frameset.

Parameters
fsetThe frames set
im_typeThe required image type
pnumThe plane number, 1 for first, 0 for all planes
xtnumThe extension number, 0 for primary, n for nth, -1 for all
Returns
the loaded list of images or NULL on error.
Note
The returned cpl_imagelist must be deallocated using cpl_imagelist_delete()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if fset is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pnum is negative, xtnum is lower than -1 or one image cannot be loaded as specified

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_BAD_FILE_FORMAT, CPL_ERROR_DATA_NOT_FOUND, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_errorstate_set(), cpl_frame_get_filename(), cpl_frameset_iterator_advance(), cpl_frameset_iterator_delete(), cpl_frameset_iterator_get_const(), cpl_frameset_iterator_new(), cpl_image_delete(), cpl_imagelist_delete(), cpl_imagelist_get_size(), cpl_imagelist_new(), cpl_imagelist_set(), and CPL_SIZE_FORMAT.

cpl-6.6.1/html/group__cpl__plugin.html0000644000460300003120000032335012553662432014732 00000000000000 Common Pipeline Library Reference Manual: Plugin Interface
Common Pipeline Library Reference Manual  6.6.1
Plugin Interface

The basic plugin interface definition. More...

Classes

struct  _cpl_plugin_
 The type representation of the generic plugin interface. More...
 

Macros

#define CPL_PLUGIN_API
 Plugin API version. More...
 

Typedefs

typedef struct _cpl_plugin_ cpl_plugin
 The plugin data type. More...
 
typedef enum _cpl_plugin_type_ cpl_plugin_type
 Data type used to store the plugin type code. More...
 

Enumerations

enum  _cpl_plugin_type_ {
  CPL_PLUGIN_TYPE_NONE = 0,
  CPL_PLUGIN_TYPE_RECIPE = 1 << 0,
  CPL_PLUGIN_TYPE_RECIPE_V2 = (1 << 1) | CPL_PLUGIN_TYPE_RECIPE
}
 Definition of plugin types. More...
 

Functions

cpl_error_code cpl_plugin_copy (cpl_plugin *self, const cpl_plugin *other)
 Copy a plugin. More...
 
void cpl_plugin_delete (cpl_plugin *self)
 Destroy a plugin. More...
 
void cpl_plugin_dump (const cpl_plugin *self, FILE *stream)
 Dump the plugin debugging information to the given stream. More...
 
unsigned int cpl_plugin_get_api (const cpl_plugin *self)
 Get the version number of the plugin interface implementation. More...
 
const char * cpl_plugin_get_author (const cpl_plugin *self)
 Get the name of the plugin author. More...
 
const char * cpl_plugin_get_copyright (const cpl_plugin *self)
 Get the license and copyright information of a plugin. More...
 
cpl_plugin_func cpl_plugin_get_deinit (const cpl_plugin *self)
 Get the cleanup handler of a plugin. More...
 
const char * cpl_plugin_get_description (const cpl_plugin *self)
 Get the detailed description of a plugin. More...
 
const char * cpl_plugin_get_email (const cpl_plugin *self)
 Get the contact information of a plugin. More...
 
cpl_plugin_func cpl_plugin_get_exec (const cpl_plugin *self)
 Get the execution handler of a plugin. More...
 
int cpl_plugin_get_info (cpl_pluginlist *cpl_plugin_list)
 Append the plugin information to the given list. More...
 
cpl_plugin_func cpl_plugin_get_init (const cpl_plugin *self)
 Get the initialisation handler of a plugin. More...
 
const char * cpl_plugin_get_name (const cpl_plugin *self)
 Get the name of a plugin. More...
 
const char * cpl_plugin_get_synopsis (const cpl_plugin *self)
 Get the short description of a plugin. More...
 
unsigned long cpl_plugin_get_type (const cpl_plugin *self)
 Get the type of a plugin. More...
 
char * cpl_plugin_get_type_string (const cpl_plugin *self)
 Get the type of a plugin as string. More...
 
unsigned long cpl_plugin_get_version (const cpl_plugin *self)
 Get the version number of a plugin. More...
 
char * cpl_plugin_get_version_string (const cpl_plugin *self)
 Get the version number of a plugin as a string. More...
 
cpl_error_code cpl_plugin_init (cpl_plugin *self, unsigned int api, unsigned long version, unsigned long type, const char *name, const char *synopsis, const char *description, const char *author, const char *email, const char *copyright, cpl_plugin_func create, cpl_plugin_func execute, cpl_plugin_func destroy)
 Initialise a plugin. More...
 
cpl_plugincpl_plugin_new (void)
 Create a new, empty plugin interface. More...
 
cpl_error_code cpl_plugin_set_api (cpl_plugin *self, unsigned int api)
 Set the plugin interface version number. More...
 
cpl_error_code cpl_plugin_set_author (cpl_plugin *self, const char *author)
 Set the name of the plugin author. More...
 
cpl_error_code cpl_plugin_set_copyright (cpl_plugin *self, const char *copyright)
 Set the license and copyright information of a plugin. More...
 
cpl_error_code cpl_plugin_set_deinit (cpl_plugin *self, cpl_plugin_func func)
 Set the cleanup handler of a plugin. More...
 
cpl_error_code cpl_plugin_set_description (cpl_plugin *self, const char *description)
 Set the detailed description of a plugin. More...
 
cpl_error_code cpl_plugin_set_email (cpl_plugin *self, const char *email)
 Set the contact information of a plugin. More...
 
cpl_error_code cpl_plugin_set_exec (cpl_plugin *self, cpl_plugin_func func)
 Set the execution handler of a plugin. More...
 
cpl_error_code cpl_plugin_set_init (cpl_plugin *self, cpl_plugin_func func)
 Set the initialisation handler of a plugin. More...
 
cpl_error_code cpl_plugin_set_name (cpl_plugin *self, const char *name)
 Set the name of a plugin. More...
 
cpl_error_code cpl_plugin_set_synopsis (cpl_plugin *self, const char *synopsis)
 Set the short description of a plugin. More...
 
cpl_error_code cpl_plugin_set_type (cpl_plugin *self, unsigned long type)
 Set the type of a plugin. More...
 
int cpl_plugin_set_version (cpl_plugin *self, unsigned long version)
 Set the version number of a plugin. More...
 

Detailed Description

The basic plugin interface definition.

This module defines the basic plugin interface. The plugin interface provides the possibility to dynamically load and execute software modules. The basic plugin interface defined here serves as `superclass' for context specific plugins. All context specific plugins inherit this basic plugin interface. A plugin context is represented by a type code, i.e. the different plugin contexts are represented as different plugin types.

Most of the time an application using the plugin interface is dealing only with this basic, plugin type independent part of the interface. It provides the application with the necessary information about a particular plugin implementation and the services to initialise, execute and cleanup a dynamically loaded module.

In this way plugin type specific details may remain hidden from the application until the plugin type and its implementation details are known through querying the basic plugin interface part.

To obtain a filled plugin interface structure the application will call the function cpl_plugin_get_info(), which has the following prototype:

#include <cpl_pluginlist.h>

For each plugin library (a shared object library containing one or more plugins) this function must be implemented by the plugin developer. Its purpose is to fill a plugin interface structure for each plugin the plugin library contains and add it to a list provided by the application. This list of plugin interfaces provides the application with all the details on how to communicate with a particular plugin.

As an example on how to create a context specific plugin, i.e. how to create a new plugin type, you may have a look at Recipes.

Synopsis:
#include <cpl_plugin.h>

Macro Definition Documentation

#define CPL_PLUGIN_API

Plugin API version.

Typedef Documentation

typedef struct _cpl_plugin_ cpl_plugin

The plugin data type.

This defines the (public) plugin data type.

Data type used to store the plugin type code.

Enumeration Type Documentation

Definition of plugin types.

Predefined plugin types supported by the Common Pipeline Library itself.

Enumerator
CPL_PLUGIN_TYPE_NONE 

Plugin is of unknown or undefined type

CPL_PLUGIN_TYPE_RECIPE 

Plugin is a complete data reduction task, i.e. a sequence of individual data reduction steps, turning a raw frame into a `final' product.

CPL_PLUGIN_TYPE_RECIPE_V2 

Plugin is a recipe, i.e. a complete data reduction task. In addition, this recipe version provides extra data about the required input data. This plugin is a subclass of CPL_PLUGIN_TYPE_RECIPE.

Function Documentation

cpl_error_code cpl_plugin_copy ( cpl_plugin self,
const cpl_plugin other 
)

Copy a plugin.

Parameters
selfA plugin.
otherThe plugin structure to copy.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or other is a NULL pointer.

The function copies all members of the plugin other to the plugin self. The plugin other and its copy self do not share any resources after the copy operation. If either self, or other are invalid pointers, the function returns immediately.

Note that the plugins self and other do not need to be of the same kind (see below).

Attention
If a derived plugin (a cpl_recipe for instance) is passed to this function, after casting it to its base, a cpl_plugin this function most likely will not work as expected, since data slicing will happen. The function is only aware of the cpl_plugin part of the derived plugin and only these data members are copied. Any additional data members defined by the derived plugin are therefore lost, unless they are copied explicitly.

The should be used function as follows. If necessary, create the target plugin using the appropriate constructor, or allocate a memory block of the appropriate size to hold the derived plugin type. Use this function to copy the cpl_plugin part of your derived plugin. Copy additional data members of the target plugin explicitly.

References _cpl_plugin_::api, _cpl_plugin_::author, _cpl_plugin_::copyright, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, _cpl_plugin_::deinitialize, _cpl_plugin_::description, _cpl_plugin_::email, _cpl_plugin_::execute, _cpl_plugin_::initialize, _cpl_plugin_::name, _cpl_plugin_::synopsis, _cpl_plugin_::type, and _cpl_plugin_::version.

void cpl_plugin_delete ( cpl_plugin self)

Destroy a plugin.

Parameters
selfThe plugin to destroy.
Returns
Nothing.

The function destroys a plugin. First, the memory used by the members of the cpl_plugin type is released and then the plugin itself is destroyed.

Attention
The function may also be used to destroy plugins which have been derived from the cpl_plugin type. But if the derived plugin type defines members which are dynamically allocated, they have to be destroyed explicitly before (in the plugin's cleanup handler for instance) the derived plugin is passed to this function, or the references to these memory blocks have to be kept and cleaned up later. Otherwise memory leaks may result. If the plugin self is NULL, nothing is done and no error is set.

Referenced by cpl_pluginlist_delete().

void cpl_plugin_dump ( const cpl_plugin self,
FILE *  stream 
)

Dump the plugin debugging information to the given stream.

Parameters
selfThe plugin.
streamThe output stream to use.
Returns
Nothing.

The function dumps the contents of of the plugin self to the output stream stream. If stream is NULL the function writes to the standard output. If self is NULL the function does nothing.

References cpl_plugin_get_api(), cpl_plugin_get_author(), cpl_plugin_get_copyright(), cpl_plugin_get_deinit(), cpl_plugin_get_description(), cpl_plugin_get_email(), cpl_plugin_get_exec(), cpl_plugin_get_init(), cpl_plugin_get_name(), cpl_plugin_get_synopsis(), cpl_plugin_get_type(), cpl_plugin_get_type_string(), cpl_plugin_get_version(), and cpl_plugin_get_version_string().

Referenced by cpl_pluginlist_dump().

unsigned int cpl_plugin_get_api ( const cpl_plugin self)

Get the version number of the plugin interface implementation.

Parameters
selfA plugin.
Returns
The version number of the plugin interface implementation the plugin self complies with. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns the plugin interface version number, i.e. the version number describing the layout of the plugin data type itself. Valid version numbers are always greater or equal to 1.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

const char* cpl_plugin_get_author ( const cpl_plugin self)

Get the name of the plugin author.

Parameters
selfA plugin.
Returns
The function returns a pointer to the plugin author's name string. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns a reference to the name of the author of the plugin self. The plugin author's name must not be modified using the returned pointer. The appropriate method should be used instead!

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

const char* cpl_plugin_get_copyright ( const cpl_plugin self)

Get the license and copyright information of a plugin.

Parameters
selfA plugin.
Returns
The function returns a pointer to the plugin's copyright information string. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns a reference to the license and copyright information of the plugin self. The copyright information must not be modified using the returned pointer. The appropriate method should be used instead!

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

cpl_plugin_func cpl_plugin_get_deinit ( const cpl_plugin self)

Get the cleanup handler of a plugin.

Parameters
selfA plugin.
Returns
The plugin's cleanup handler. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the cleanup handler of the plugin self.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

const char* cpl_plugin_get_description ( const cpl_plugin self)

Get the detailed description of a plugin.

Parameters
selfA plugin.
Returns
The function returns a pointer to the plugin's detailed description. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns a reference to the detailed description (a description of the algorithm for instance) of the plugin self. The plugin's description must not be modified using this pointer. Use the appropriate method instead!

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

const char* cpl_plugin_get_email ( const cpl_plugin self)

Get the contact information of a plugin.

Parameters
selfA plugin.
Returns
The function returns a pointer to the plugin author's contact information string. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns a reference to the e-mail address of the author of the plugin self. The plugin author's e-mail address must not be modified using the returned pointer. The appropriate method should be used instead!

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

cpl_plugin_func cpl_plugin_get_exec ( const cpl_plugin self)

Get the execution handler of a plugin.

Parameters
selfA plugin.
Returns
The plugin's execution function. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the execution function of the plugin self.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

int cpl_plugin_get_info ( cpl_pluginlist cpl_plugin_list)

Append the plugin information to the given list.

Parameters
cpl_plugin_listA plugin list.
Returns
The function must return 0 on success and 1 in case of an error.

This function must be implemented by plugin developers. There must be one such implementation per plugin library, regardless of how many plugins the library actually offers, provided that there is at least one plugin implemented in this library.

This prototype is only provided in order to allow the compiler to do some basic checks when compiling a plugin library. To have the prototype available when you are compiling your plugin library, you must add the line

1 #include <cpl_plugininfo.h>

to your plugin source file.

The purpose of this function is to create a plugin object for each plugin implementation provided by the plugin library, fill the basic plugin interface (the cpl_plugin part of the created plugin object) and append the created object to the plugin list list.

The list will be provided by the application which is going to use the plugin and it may be expected that list points to a valid plugin list when this function is called.

cpl_plugin_func cpl_plugin_get_init ( const cpl_plugin self)

Get the initialisation handler of a plugin.

Parameters
selfA plugin.
Returns
The plugin's initalization function. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the initalisation function of the plugin self.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

const char* cpl_plugin_get_name ( const cpl_plugin self)

Get the name of a plugin.

Parameters
selfA plugin.
Returns
The function returns a pointer to the plugin's unique name string. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns a reference to the unique name of the plugin self. The plugin's name must not be modified using the returned pointer. The appropriate method should be used instead.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump(), and cpl_pluginlist_find().

const char* cpl_plugin_get_synopsis ( const cpl_plugin self)

Get the short description of a plugin.

Parameters
selfA plugin.
Returns
The function returns a pointer to the plugin's short description. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns a reference to the short description (its purpose for instance) of the plugin self. The plugin's short description must not be modified using this pointer. Use the appropriate method instead!

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

unsigned long cpl_plugin_get_type ( const cpl_plugin self)

Get the type of a plugin.

Parameters
selfA plugin.
Returns
The function returns the plugin type code. If an error occurs the function returns CPL_PLUGIN_TYPE_NONE and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns the type (cf. cpl_plugin_type) of the plugin self.

References CPL_ERROR_NULL_INPUT, and CPL_PLUGIN_TYPE_NONE.

Referenced by cpl_plugin_dump().

char* cpl_plugin_get_type_string ( const cpl_plugin self)

Get the type of a plugin as string.

Parameters
selfA plugin.
Returns
The function returns the string representation of the plugin type. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns the plugin type of self as a string. The type string is placed into a newly allocated buffer. This buffer must be deallocated using cpl_free() by the caller if it is no longer needed.

References CPL_ERROR_NULL_INPUT, CPL_PLUGIN_TYPE_NONE, and CPL_PLUGIN_TYPE_RECIPE.

Referenced by cpl_plugin_dump().

unsigned long cpl_plugin_get_version ( const cpl_plugin self)

Get the version number of a plugin.

Parameters
selfA plugin.
Returns
The plugin's version number. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns the version number of the plugin self.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_dump().

char* cpl_plugin_get_version_string ( const cpl_plugin self)

Get the version number of a plugin as a string.

Parameters
selfA plugin.
Returns
The string representation of the plugin's version number. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function returns the version number of the plugin self as a string. The function assumes that the integer representation of the plugin version can be decoded into a version string of the usual form: "major.minor.micro"

The resulting string is placed in a newly allocated buffer. This buffer must be deallocated using cpl_free() by the caller if it is no longer needed.

References CPL_ERROR_NULL_INPUT, and cpl_sprintf().

Referenced by cpl_plugin_dump().

cpl_error_code cpl_plugin_init ( cpl_plugin self,
unsigned int  api,
unsigned long  version,
unsigned long  type,
const char *  name,
const char *  synopsis,
const char *  description,
const char *  author,
const char *  email,
const char *  copyright,
cpl_plugin_func  create,
cpl_plugin_func  execute,
cpl_plugin_func  destroy 
)

Initialise a plugin.

Parameters
selfThe plugin to initialise.
apiThe plugin interface version number.
versionThe plugin's version number.
typeThe plugin's type.
nameThe plugin's unique name.
synopsisThe plugin's short description (purpose, synopsis ...).
descriptionThe plugin's detailed description.
authorThe plugin's author name.
emailThe plugin author's e-mail address.
copyrightThe plugin's copyright and licensing information.
createThe function used to create the plugin.
executeThe function used to execute the plugin.
destroyThe function used to destroy the plugin.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function fills the cpl_plugin part of a plugin structure. For information on which information is required and which is optional please refer to the documentation of the plugin structure cpl_plugin.

If self is not a valid pointer, the function returns immediately.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_plugin_set_api(), cpl_plugin_set_author(), cpl_plugin_set_copyright(), cpl_plugin_set_deinit(), cpl_plugin_set_description(), cpl_plugin_set_email(), cpl_plugin_set_exec(), cpl_plugin_set_init(), cpl_plugin_set_name(), cpl_plugin_set_synopsis(), cpl_plugin_set_type(), and cpl_plugin_set_version().

cpl_plugin* cpl_plugin_new ( void  )

Create a new, empty plugin interface.

Returns
The pointer to a newly allocated plugin or NULL if it could not be created.

The function allocates memory for a cpl_plugin and initialises it. The function returns a handle for the newly created plugin interface object. The created plugin interface must be destroyed using the plugin interface destructor cpl_plugin_delete().

References _cpl_plugin_::api.

cpl_error_code cpl_plugin_set_api ( cpl_plugin self,
unsigned int  api 
)

Set the plugin interface version number.

Parameters
selfA plugin
apiThe plugin interface version to set.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function sets the version number of the plugin interface of the plugin self to the version api.

Attention
The plugin interface version describes the internal layout of the plugin interface. It should be used by an application to decide whether a particular plugin can be used or not, i.e. if the plugin interface supported by the application is compatible with the interface presented by the plugin itself.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_author ( cpl_plugin self,
const char *  author 
)

Set the name of the plugin author.

Parameters
selfA plugin
authorThe name of the plugin author.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or author is a NULL pointer.

This function copies the plugin author's name from the string author to the plugin self.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_copyright ( cpl_plugin self,
const char *  copyright 
)

Set the license and copyright information of a plugin.

Parameters
selfA plugin.
copyrightThe plugin's license information.
Note
The license information must be compatible with that of CPL.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or copyright is a NULL pointer.

This function copies the plugin's license information from the string copyright to the plugin self.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_deinit ( cpl_plugin self,
cpl_plugin_func  func 
)

Set the cleanup handler of a plugin.

Parameters
selfA plugin
funcThe plugin's cleanup handler.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function installs the function func as the cleanup handler of the plugin self. The registered function is called after the plugin has been executed to release any acquired resources.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_description ( cpl_plugin self,
const char *  description 
)

Set the detailed description of a plugin.

Parameters
selfA plugin.
descriptionThe plugin's detailed description, or NULL.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function copies the detailed description text from the string description to the plugin self. The C formatting characters '\n' and '\t' may be embedded in the string description.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_email ( cpl_plugin self,
const char *  email 
)

Set the contact information of a plugin.

Parameters
selfA plugin.
emailThe plugin author's contact information.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
Returns
The function returns 0 on success, or a non-zero value otherwise. If self is not a valid pointer the function returns 1.

This function copies the plugin author contact information from the string email to the plugin self.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_exec ( cpl_plugin self,
cpl_plugin_func  func 
)

Set the execution handler of a plugin.

Parameters
selfA plugin.
funcThe plugin's execution function.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function installs the function func as the execution function of the plugin self. The registered function must be called by an application after the plugin's initialisation function was called. Calling the registered function executes the plugin.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_init ( cpl_plugin self,
cpl_plugin_func  func 
)

Set the initialisation handler of a plugin.

Parameters
selfA plugin
funcThe plugin's initialisation function
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function installs the function func as the initialisation function of the plugin self. The registered function must be called by an application before the plugin is executed.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_name ( cpl_plugin self,
const char *  name 
)

Set the name of a plugin.

Parameters
selfA plugin.
nameThe plugin's unique name.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

This function assigns the name name to the plugin self.

Attention
Since plugins are selected through their name this name should be choosen carefully in order to avoid name clashes with other plugins.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_synopsis ( cpl_plugin self,
const char *  synopsis 
)

Set the short description of a plugin.

Parameters
selfA plugin.
synopsisThe plugin's synopsis, or NULL.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function copies the short description text from the string synopsis to the plugin self.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl_error_code cpl_plugin_set_type ( cpl_plugin self,
unsigned long  type 
)

Set the type of a plugin.

Parameters
selfA plugin.
typeThe plugin type to set.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function sets the type (cf. cpl_plugin_type) of the plugin self to type.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

int cpl_plugin_set_version ( cpl_plugin self,
unsigned long  version 
)

Set the version number of a plugin.

Parameters
selfA plugin
versionThe plugin's version number to set.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

This function sets the version number of the plugin interface of the plugin self to the version api.

This function sets the version number of the plugin self to version.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plugin_init().

cpl-6.6.1/html/group__cpl__filter.html0000644000460300003120000005635412553662431014727 00000000000000 Common Pipeline Library Reference Manual: Filters
Common Pipeline Library Reference Manual  6.6.1

Typedefs

typedef enum _cpl_border_mode_ cpl_border_mode
 The border mode type. More...
 
typedef enum _cpl_filter_mode_ cpl_filter_mode
 The filter mode type. More...
 

Enumerations

enum  _cpl_border_mode_ {
  CPL_BORDER_FILTER,
  CPL_BORDER_ZERO,
  CPL_BORDER_CROP,
  CPL_BORDER_NOP,
  CPL_BORDER_COPY
}
 These are the supported border modes. For a kernel of width 2n+1, the n left- and rightmost image/mask columns do not have elements for the whole kernel. The same holds for the top and bottom image/mask rows. The border mode defines the filtering of such border pixels. More...
 
enum  _cpl_filter_mode_ {
  CPL_FILTER_EROSION,
  CPL_FILTER_DILATION,
  CPL_FILTER_OPENING,
  CPL_FILTER_CLOSING,
  CPL_FILTER_LINEAR,
  CPL_FILTER_LINEAR_SCALE,
  CPL_FILTER_AVERAGE,
  CPL_FILTER_AVERAGE_FAST,
  CPL_FILTER_MEDIAN,
  CPL_FILTER_STDEV,
  CPL_FILTER_STDEV_FAST,
  CPL_FILTER_MORPHO,
  CPL_FILTER_MORPHO_SCALE
}
 These are the supported filter modes. More...
 

Detailed Description

This module provides definitions for filtering of a cpl_image and a cpl_mask. The actual filtering functions are defined in the cpl_image and cpl_mask modules.

Synopsis:
#include "cpl_filter.h"

Typedef Documentation

The border mode type.

The filter mode type.

Enumeration Type Documentation

These are the supported border modes. For a kernel of width 2n+1, the n left- and rightmost image/mask columns do not have elements for the whole kernel. The same holds for the top and bottom image/mask rows. The border mode defines the filtering of such border pixels.

Enumerator
CPL_BORDER_FILTER 

Filter the border using the reduced number of pixels. If in median filtering the number of pixels is even choose the mean of the two central values, after the borders have been filled with a chess-like pattern of +- inf

CPL_BORDER_ZERO 

Set the border of the filtered image/mask to zero.

CPL_BORDER_CROP 

Crop the filtered image/mask.

CPL_BORDER_NOP 

Do not modify the border of the filtered image/mask.

CPL_BORDER_COPY 

Copy the border of the input image/mask.

These are the supported filter modes.

Enumerator
CPL_FILTER_EROSION 

The erosion filter (for a cpl_mask).

See also
cpl_mask_filter()
CPL_FILTER_DILATION 

The dilation filter (for a cpl_mask).

See also
cpl_mask_filter()
CPL_FILTER_OPENING 

The opening filter (for a cpl_mask).

See also
cpl_mask_filter()
CPL_FILTER_CLOSING 

The closing filter (for a cpl_mask).

See also
cpl_mask_filter()
CPL_FILTER_LINEAR 

A linear filter (for a cpl_image). The kernel elements are normalized with the sum of their absolute values. This implies that there must be at least one non-zero element in the kernel. The normalisation makes the kernel useful for filtering where flux conservation is desired.

The kernel elements are thus used as weights like this:

Kernel          Image        ...
       1 2 3         ... 1.0 2.0 3.0 ...
       4 5 6         ... 4.0 5.0 6.0 ...
       7 8 9         ... 7.0 8.0 9.0 ...
                             ...
 The filtered value corresponding to the pixel whose value is 5.0 is:

$\frac{(1*1.0+2*2.0+3*3.0+4*4.0+5*5.0+6*6.0+7*7.0+8*8.0+9*9.0)} {1+2+3+4+5+6+7+8+9}$

Filtering with CPL_FILTER_LINEAR and a flat kernel can be done faster with CPL_FILTER_AVERAGE.

See also
CPL_FILTER_LINEAR_SCALE, CPL_FILTER_AVERAGE, cpl_image_filter()
CPL_FILTER_LINEAR_SCALE 

A linear filter (for a cpl_image). Unlike CPL_FILTER_LINEAR the kernel elements are not normalized, so the filtered image will have its flux scaled with the sum of the weights of the kernel. Examples of linear, scaling kernels are gradient operators and edge detectors.

The kernel elements are thus applied like this:

Kernel          Image        ...
       1 2 3         ... 1.0 2.0 3.0 ...
       4 5 6         ... 4.0 5.0 6.0 ...
       7 8 9         ... 7.0 8.0 9.0 ...
                             ...
 The filtered value corresponding to the pixel whose value is 5.0 is:

$1*1.0+2*2.0+3*3.0+4*4.0+5*5.0+6*6.0+7*7.0+8*8.0+9*9.0$

See also
CPL_FILTER_LINEAR, cpl_image_filter()
CPL_FILTER_AVERAGE 

An average filter, i.e. the output pixel is the arithmetic average of the surrounding (1 + 2 * hsizex) (1 + 2 * hsizey) pixels. The cost per pixel is O(hsizex*hsizey). The two images may have different pixel types. When the input and output pixel types are identical, the arithmetic is done with that type, e.g. int for two integer images. When the input and output pixel types differ, the arithmetic is done in double precision when one of the two images have pixel type CPL_TYPE_DOUBLE, otherwise float is used.

See also
CPL_FILTER_AVERAGE_FAST, cpl_image_filter_mask()
CPL_FILTER_AVERAGE_FAST 

The same as CPL_FILTER_AVERAGE, except that it uses a running average, which will lead to a significant loss of precision if there are large differences in the magnitudes of the input pixels. The cost per pixel is O(1) if all elements in the kernel are used, otherwise the filtering is done as for CPL_FILTER_AVERAGE.

See also
cpl_image_filter_mask()
CPL_FILTER_MEDIAN 

A median filter (for a cpl_image). The pixel types of the input and output images must be identical.

See also
cpl_image_filter_mask()
CPL_FILTER_STDEV 

The filtered value is the standard deviation of the included input pixels.

Kernel                Image        ...
       1   0   1           ... 1.0 2.0 3.0 ...
       0   1   0           ... 4.0 5.0 6.0 ...
       1   0   1           ... 7.0 8.0 9.0 ...
                                   ...

The pixel with value 5.0 will have a filtered value of: std_dev(1.0, 3.0, 5.0, 7.0, 9.0)

See also
CPL_FILTER_STDEV_FAST, cpl_image_filter_mask()
CPL_FILTER_STDEV_FAST 

The same as CPL_FILTER_STDEV, except that it uses the same running method employed in CPL_FILTER_AVERAGE_FAST, which will lead to a significant loss of precision if there are large differences in the magnitudes of the input pixels. As for CPL_FILTER_AVERAGE_FAST, the cost per pixel is O(1) if all elements are used, otherwise the filtering is done as for CPL_FILTER_STDEV.

See also
cpl_image_filter_mask()
CPL_FILTER_MORPHO 

A morphological filter (for a cpl_image). The kernel elements are normalized with the sum of their absolute values. This implies that there must be at least one non-zero element in the kernel. The normalisation makes the kernel useful for filtering where flux conservation is desired.

The kernel elements are used as weights on the sorted values covered by the kernel:

 Kernel          Image        ...
        1 2 3         ... 4.0 6.0 5.0 ...
        4 5 6         ... 3.0 1.0 2.0 ...
        7 8 9         ... 7.0 8.0 9.0 ...
                              ...
 The filtered value corresponding to the pixel whose value is 5.0 is:

$\frac{(1*1.0+2*2.0+3*3.0+4*4.0+5*5.0+6*6.0+7*7.0+8*8.0+9*9.0)} {1+2+3+4+5+6+7+8+9}$

See also
CPL_FILTER_MORPHO_SCALE, cpl_image_filter()
CPL_FILTER_MORPHO_SCALE 

A morphological filter (for a cpl_image). Unlike CPL_FILTER_MORPHO the kernel elements are not normalized, so the filtered image will have its flux scaled with the sum of the weights of the kernel.

The kernel elements are thus applied to the sorted values covered by the kernel:

 Kernel          Image        ...
        1 2 3         ... 4.0 6.0 5.0 ...
        4 5 6         ... 3.0 1.0 2.0 ...
        7 8 9         ... 7.0 8.0 9.0 ...
                              ...
 The filtered value corresponding to the pixel whose value is 5.0 is:

$1*1.0+2*2.0+3*3.0+4*4.0+5*5.0+6*6.0+7*7.0+8*8.0+9*9.0$

See also
CPL_FILTER_MORPHO, cpl_image_filter()
cpl-6.6.1/html/doxygen.css0000644000460300003120000006162712553662426012376 00000000000000/* The standard CSS for doxygen 1.8.9.1 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; } /* @group Heading Levels */ h1.groupheader { font-size: 150%; } .title { font: 400 14px/28px Roboto,sans-serif; font-size: 150%; font-weight: bold; margin: 10px 2px; } h2.groupheader { border-bottom: 1px solid #879ECB; color: #354C7B; font-size: 150%; font-weight: normal; margin-top: 1.75em; padding-top: 8px; padding-bottom: 4px; width: 100%; } h3.groupheader { font-size: 100%; } h1, h2, h3, h4, h5, h6 { -webkit-transition: text-shadow 0.5s linear; -moz-transition: text-shadow 0.5s linear; -ms-transition: text-shadow 0.5s linear; -o-transition: text-shadow 0.5s linear; transition: text-shadow 0.5s linear; margin-right: 15px; } h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { text-shadow: 0 0 15px cyan; } dt { font-weight: bold; } div.multicol { -moz-column-gap: 1em; -webkit-column-gap: 1em; -moz-column-count: 3; -webkit-column-count: 3; } p.startli, p.startdd { margin-top: 2px; } p.starttd { margin-top: 0px; } p.endli { margin-bottom: 0px; } p.enddd { margin-bottom: 4px; } p.endtd { margin-bottom: 2px; } /* @end */ caption { font-weight: bold; } span.legend { font-size: 70%; text-align: center; } h3.version { font-size: 90%; text-align: center; } div.qindex, div.navtab{ background-color: #EBEFF6; border: 1px solid #A3B4D7; text-align: center; } div.qindex, div.navpath { width: 100%; line-height: 140%; } div.navtab { margin-right: 15px; } /* @group Link Styling */ a { color: #3D578C; font-weight: normal; text-decoration: none; } .contents a:visited { color: #4665A2; } a:hover { text-decoration: underline; } a.qindex { font-weight: bold; } a.qindexHL { font-weight: bold; background-color: #9CAFD4; color: #ffffff; border: 1px double #869DCA; } .contents a.qindexHL:visited { color: #ffffff; } a.el { font-weight: bold; } a.elRef { } a.code, a.code:visited, a.line, a.line:visited { color: #4665A2; } a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { color: #4665A2; } /* @end */ dl.el { margin-left: -1cm; } pre.fragment { border: 1px solid #C4CFE5; background-color: #FBFCFD; padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; word-wrap: break-word; font-size: 9pt; line-height: 125%; font-family: monospace, fixed; font-size: 105%; } div.fragment { padding: 4px 6px; margin: 4px 8px 4px 2px; background-color: #FBFCFD; border: 1px solid #C4CFE5; } div.line { font-family: monospace, fixed; font-size: 13px; min-height: 13px; line-height: 1.0; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: pre-wrap; /* CSS3 */ word-wrap: break-word; /* IE 5.5+ */ text-indent: -53px; padding-left: 53px; padding-bottom: 0px; margin: 0px; -webkit-transition-property: background-color, box-shadow; -webkit-transition-duration: 0.5s; -moz-transition-property: background-color, box-shadow; -moz-transition-duration: 0.5s; -ms-transition-property: background-color, box-shadow; -ms-transition-duration: 0.5s; -o-transition-property: background-color, box-shadow; -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } div.line.glow { background-color: cyan; box-shadow: 0 0 10px cyan; } span.lineno { padding-right: 4px; text-align: right; border-right: 2px solid #0F0; background-color: #E8E8E8; white-space: pre; } span.lineno a { background-color: #D8D8D8; } span.lineno a:hover { background-color: #C8C8C8; } div.ah, span.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px; padding: 0.2em; border: solid thin #333; border-radius: 0.5em; -webkit-border-radius: .5em; -moz-border-radius: .5em; box-shadow: 2px 2px 3px #999; -webkit-box-shadow: 2px 2px 3px #999; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); } div.classindex ul { list-style: none; padding-left: 0; } div.classindex span.ai { display: inline-block; } div.groupHeader { margin-left: 16px; margin-top: 12px; font-weight: bold; } div.groupText { margin-left: 16px; font-style: italic; } body { background-color: white; color: black; margin: 0; } div.contents { margin-top: 10px; margin-left: 12px; margin-right: 8px; } td.indexkey { background-color: #EBEFF6; font-weight: bold; border: 1px solid #C4CFE5; margin: 2px 0px 2px 0; padding: 2px 10px; white-space: nowrap; vertical-align: top; } td.indexvalue { background-color: #EBEFF6; border: 1px solid #C4CFE5; padding: 2px 10px; margin: 2px 0px; } tr.memlist { background-color: #EEF1F7; } p.formulaDsp { text-align: center; } img.formulaDsp { } img.formulaInl { vertical-align: middle; } div.center { text-align: center; margin-top: 0px; margin-bottom: 0px; padding: 0px; } div.center img { border: 0px; } address.footer { text-align: right; padding-right: 12px; } img.footer { border: 0px; vertical-align: middle; } /* @group Code Colorization */ span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } span.vhdldigit { color: #ff00ff } span.vhdlchar { color: #000000 } span.vhdlkeyword { color: #700070 } span.vhdllogic { color: #ff0000 } blockquote { background-color: #F7F8FB; border-left: 2px solid #9CAFD4; margin: 0 24px 0 4px; padding: 0 12px 0 16px; } /* @end */ /* .search { color: #003399; font-weight: bold; } form.search { margin-bottom: 0px; margin-top: 0px; } input.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #e8eef2; } */ td.tiny { font-size: 75%; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #A3B4D7; } th.dirtab { background: #EBEFF6; font-weight: bold; } hr { height: 0px; border: none; border-top: 1px solid #4A6AAA; } hr.footer { height: 1px; } /* @group Member Descriptions */ table.memberdecls { border-spacing: 0px; padding: 0px; } .memberdecls td, .fieldtable tr { -webkit-transition-property: background-color, box-shadow; -webkit-transition-duration: 0.5s; -moz-transition-property: background-color, box-shadow; -moz-transition-duration: 0.5s; -ms-transition-property: background-color, box-shadow; -ms-transition-duration: 0.5s; -o-transition-property: background-color, box-shadow; -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } .memberdecls td.glow, .fieldtable tr.glow { background-color: cyan; box-shadow: 0 0 15px cyan; } .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { background-color: #F9FAFC; border: none; margin: 4px; padding: 1px 0 0 8px; } .mdescLeft, .mdescRight { padding: 0px 8px 4px 8px; color: #555; } .memSeparator { border-bottom: 1px solid #DEE4F0; line-height: 1px; margin: 0px; padding: 0px; } .memItemLeft, .memTemplItemLeft { white-space: nowrap; } .memItemRight { width: 100%; } .memTemplParams { color: #4665A2; white-space: nowrap; font-size: 80%; } /* @end */ /* @group Member Details */ /* Styles for detailed member documentation */ .memtemplate { font-size: 80%; color: #4665A2; font-weight: normal; margin-left: 9px; } .memnav { background-color: #EBEFF6; border: 1px solid #A3B4D7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .mempage { width: 100%; } .memitem { padding: 0; margin-bottom: 10px; margin-right: 5px; -webkit-transition: box-shadow 0.5s linear; -moz-transition: box-shadow 0.5s linear; -ms-transition: box-shadow 0.5s linear; -o-transition: box-shadow 0.5s linear; transition: box-shadow 0.5s linear; display: table !important; width: 100%; } .memitem.glow { box-shadow: 0 0 15px cyan; } .memname { font-weight: bold; margin-left: 6px; } .memname td { vertical-align: bottom; } .memproto, dl.reflist dt { border-top: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; padding: 6px 0px 6px 0px; color: #253555; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); background-image:url('nav_f.png'); background-repeat:repeat-x; background-color: #E2E8F2; /* opera specific markup */ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; border-top-left-radius: 4px; /* firefox specific markup */ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 4px; -moz-border-radius-topleft: 4px; /* webkit specific markup */ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 4px; -webkit-border-top-left-radius: 4px; } .memdoc, dl.reflist dd { border-bottom: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; padding: 6px 10px 2px 10px; background-color: #FBFCFD; border-top-width: 0; background-image:url('nav_g.png'); background-repeat:repeat-x; background-color: #FFFFFF; /* opera specific markup */ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); /* firefox specific markup */ -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; /* webkit specific markup */ -webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-right-radius: 4px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); } dl.reflist dt { padding: 5px; } dl.reflist dd { margin: 0px 0px 10px 0px; padding: 5px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; white-space: nowrap; } .paramname em { font-style: normal; } .paramname code { line-height: 14px; } .params, .retval, .exception, .tparams { margin-left: 0px; padding-left: 0px; } .params .paramname, .retval .paramname { font-weight: bold; vertical-align: top; } .params .paramtype { font-style: italic; vertical-align: top; } .params .paramdir { font-family: "courier new",courier,monospace; vertical-align: top; } table.mlabels { border-spacing: 0px; } td.mlabels-left { width: 100%; padding: 0px; } td.mlabels-right { vertical-align: bottom; padding: 0px; white-space: nowrap; } span.mlabels { margin-left: 8px; } span.mlabel { background-color: #728DC1; border-top:1px solid #5373B4; border-left:1px solid #5373B4; border-right:1px solid #C4CFE5; border-bottom:1px solid #C4CFE5; text-shadow: none; color: white; margin-right: 4px; padding: 2px 3px; border-radius: 3px; font-size: 7pt; white-space: nowrap; vertical-align: middle; } /* @end */ /* these are for tree view inside a (index) page */ div.directory { margin: 10px 0px; border-top: 1px solid #9CAFD4; border-bottom: 1px solid #9CAFD4; width: 100%; } .directory table { border-collapse:collapse; } .directory td { margin: 0px; padding: 0px; vertical-align: top; } .directory td.entry { white-space: nowrap; padding-right: 6px; padding-top: 3px; } .directory td.entry a { outline:none; } .directory td.entry a img { border: none; } .directory td.desc { width: 100%; padding-left: 6px; padding-right: 6px; padding-top: 3px; border-left: 1px solid rgba(0,0,0,0.05); } .directory tr.even { padding-left: 6px; background-color: #F7F8FB; } .directory img { vertical-align: -30%; } .directory .levels { white-space: nowrap; width: 100%; text-align: right; font-size: 9pt; } .directory .levels span { cursor: pointer; padding-left: 2px; padding-right: 2px; color: #3D578C; } .arrow { color: #9CAFD4; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; font-size: 80%; display: inline-block; width: 16px; height: 22px; } .icon { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; height: 14px; width: 16px; display: inline-block; background-color: #728DC1; color: white; text-align: center; border-radius: 4px; margin-left: 2px; margin-right: 2px; } .icona { width: 24px; height: 22px; display: inline-block; } .iconfopen { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('folderopen.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .iconfclosed { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('folderclosed.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .icondoc { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('doc.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } table.directory { font: 400 14px Roboto,sans-serif; } /* @end */ div.dynheader { margin-top: 8px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } address { font-style: normal; color: #2A3D61; } table.doxtable { border-collapse:collapse; margin-top: 4px; margin-bottom: 4px; } table.doxtable td, table.doxtable th { border: 1px solid #2D4068; padding: 3px 7px 2px; } table.doxtable th { background-color: #374F7F; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; padding-top: 5px; } table.fieldtable { /*width: 100%;*/ margin-bottom: 10px; border: 1px solid #A8B8D9; border-spacing: 0px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); } .fieldtable td, .fieldtable th { padding: 3px 7px 2px; } .fieldtable td.fieldtype, .fieldtable td.fieldname { white-space: nowrap; border-right: 1px solid #A8B8D9; border-bottom: 1px solid #A8B8D9; vertical-align: top; } .fieldtable td.fieldname { padding-top: 3px; } .fieldtable td.fielddoc { border-bottom: 1px solid #A8B8D9; /*width: 100%;*/ } .fieldtable td.fielddoc p:first-child { margin-top: 0px; } .fieldtable td.fielddoc p:last-child { margin-bottom: 2px; } .fieldtable tr:last-child td { border-bottom: none; } .fieldtable th { background-image:url('nav_f.png'); background-repeat:repeat-x; background-color: #E2E8F2; font-size: 90%; color: #253555; padding-bottom: 4px; padding-top: 5px; text-align:left; -moz-border-radius-topleft: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom: 1px solid #A8B8D9; } .tabsearch { top: 0px; left: 10px; height: 36px; background-image: url('tab_b.png'); z-index: 101; overflow: hidden; font-size: 13px; } .navpath ul { font-size: 11px; background-image:url('tab_b.png'); background-repeat:repeat-x; background-position: 0 -5px; height:30px; line-height:30px; color:#8AA0CC; border:solid 1px #C2CDE4; overflow:hidden; margin:0px; padding:0px; } .navpath li { list-style-type:none; float:left; padding-left:10px; padding-right:15px; background-image:url('bc_s.png'); background-repeat:no-repeat; background-position:right; color:#364D7C; } .navpath li.navelem a { height:32px; display:block; text-decoration: none; outline: none; color: #283A5D; font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; } .navpath li.navelem a:hover { color:#6884BD; } .navpath li.footer { list-style-type:none; float:right; padding-left:10px; padding-right:15px; background-image:none; background-repeat:no-repeat; background-position:right; color:#364D7C; font-size: 8pt; } div.summary { float: right; font-size: 8pt; padding-right: 5px; width: 50%; text-align: right; } div.summary a { white-space: nowrap; } div.ingroups { font-size: 8pt; width: 50%; text-align: left; } div.ingroups a { white-space: nowrap; } div.header { background-image:url('nav_h.png'); background-repeat:repeat-x; background-color: #F9FAFC; margin: 0px; border-bottom: 1px solid #C4CFE5; } div.headertitle { padding: 5px 5px 5px 10px; } dl { padding: 0 0 0 10px; } /* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ dl.section { margin-left: 0px; padding-left: 0px; } dl.note { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #D0C000; } dl.warning, dl.attention { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #FF0000; } dl.pre, dl.post, dl.invariant { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00D000; } dl.deprecated { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #505050; } dl.todo { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00C0E0; } dl.test { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #3030E0; } dl.bug { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #C08050; } dl.section dd { margin-bottom: 6px; } #projectlogo { text-align: center; vertical-align: bottom; border-collapse: separate; } #projectlogo img { border: 0px none; } #projectname { font: 300% Tahoma, Arial,sans-serif; margin: 0px; padding: 2px 0px; } #projectbrief { font: 120% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } #projectnumber { font: 50% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } #titlearea { padding: 0px; margin: 0px; width: 100%; border-bottom: 1px solid #5373B4; } .image { text-align: center; } .dotgraph { text-align: center; } .mscgraph { text-align: center; } .diagraph { text-align: center; } .caption { font-weight: bold; } div.zoom { border: 1px solid #90A5CE; } dl.citelist { margin-bottom:50px; } dl.citelist dt { color:#334975; float:left; font-weight:bold; margin-right:10px; padding:5px; } dl.citelist dd { margin:2px 0; padding:5px 0; } div.toc { padding: 14px 25px; background-color: #F4F6FA; border: 1px solid #D8DFEE; border-radius: 7px 7px 7px 7px; float: right; height: auto; margin: 0 20px 10px 10px; width: 200px; } div.toc li { background: url("bdwn.png") no-repeat scroll 0 5px transparent; font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; margin-top: 5px; padding-left: 10px; padding-top: 2px; } div.toc h3 { font: bold 12px/1.2 Arial,FreeSans,sans-serif; color: #4665A2; border-bottom: 0 none; margin: 0; } div.toc ul { list-style: none outside none; border: medium none; padding: 0px; } div.toc li.level1 { margin-left: 0px; } div.toc li.level2 { margin-left: 15px; } div.toc li.level3 { margin-left: 30px; } div.toc li.level4 { margin-left: 45px; } .inherit_header { font-weight: bold; color: gray; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .inherit_header td { padding: 6px 0px 2px 5px; } .inherit { display: none; } tr.heading h2 { margin-top: 12px; margin-bottom: 4px; } /* tooltip related style info */ .ttc { position: absolute; display: none; } #powerTip { cursor: default; white-space: nowrap; background-color: white; border: 1px solid gray; border-radius: 4px 4px 4px 4px; box-shadow: 1px 1px 7px gray; display: none; font-size: smaller; max-width: 80%; opacity: 0.9; padding: 1ex 1em 1em; position: absolute; z-index: 2147483647; } #powerTip div.ttdoc { color: grey; font-style: italic; } #powerTip div.ttname a { font-weight: bold; } #powerTip div.ttname { font-weight: bold; } #powerTip div.ttdeci { color: #006318; } #powerTip div { margin: 0px; padding: 0px; font: 12px/16px Roboto,sans-serif; } #powerTip:before, #powerTip:after { content: ""; position: absolute; margin: 0px; } #powerTip.n:after, #powerTip.n:before, #powerTip.s:after, #powerTip.s:before, #powerTip.w:after, #powerTip.w:before, #powerTip.e:after, #powerTip.e:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.se:after, #powerTip.se:before, #powerTip.nw:after, #powerTip.nw:before, #powerTip.sw:after, #powerTip.sw:before { border: solid transparent; content: " "; height: 0; width: 0; position: absolute; } #powerTip.n:after, #powerTip.s:after, #powerTip.w:after, #powerTip.e:after, #powerTip.nw:after, #powerTip.ne:after, #powerTip.sw:after, #powerTip.se:after { border-color: rgba(255, 255, 255, 0); } #powerTip.n:before, #powerTip.s:before, #powerTip.w:before, #powerTip.e:before, #powerTip.nw:before, #powerTip.ne:before, #powerTip.sw:before, #powerTip.se:before { border-color: rgba(128, 128, 128, 0); } #powerTip.n:after, #powerTip.n:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.nw:after, #powerTip.nw:before { top: 100%; } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { border-top-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.n:before { border-top-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.n:after, #powerTip.n:before { left: 50%; } #powerTip.nw:after, #powerTip.nw:before { right: 14px; } #powerTip.ne:after, #powerTip.ne:before { left: 14px; } #powerTip.s:after, #powerTip.s:before, #powerTip.se:after, #powerTip.se:before, #powerTip.sw:after, #powerTip.sw:before { bottom: 100%; } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { border-bottom-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { border-bottom-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.s:after, #powerTip.s:before { left: 50%; } #powerTip.sw:after, #powerTip.sw:before { right: 14px; } #powerTip.se:after, #powerTip.se:before { left: 14px; } #powerTip.e:after, #powerTip.e:before { left: 100%; } #powerTip.e:after { border-left-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.e:before { border-left-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } #powerTip.w:after, #powerTip.w:before { right: 100%; } #powerTip.w:after { border-right-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.w:before { border-right-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } @media print { #top { display: none; } #side-nav { display: none; } #nav-path { display: none; } body { overflow:visible; } h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } .summary { display: none; } .memitem { page-break-inside: avoid; } #doc-content { margin-left:0 !important; height:auto !important; width:auto !important; overflow:inherit; display:inline; } } cpl-6.6.1/html/form_2.png0000644000460300003120000000036212553662433012064 00000000000000‰PNG  IHDR,Øßn0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïaIDATxí €0E_ꬶj÷¿m jä‚®ð>Ÿx€¿$›7žHC§†­!E€@o&Ïm»«ßÊeÅrÎú,Ø–êÊ縔øT7 lñ“fÖÃû}€˜Óúv¾ÇB¹IEND®B`‚cpl-6.6.1/html/form_19.png0000644000460300003120000000055712553662440012160 00000000000000‰PNG  IHDR>‹9Œ~0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïÞIDATxíK²Ä Eo?øIö¿Û5vÛy/ƒ zFÕ%eäˆ €ß+9Ê<‘€;àà‰¶†‹oæ§è|‹¸fÝ…Ù%8WÖ ÁÏJtmîR“¸¢!th¾î߸«ý<ô¢ ýÂ÷Ø>–à*ÅGHKÐpC|†¯·ŽÃæOÅ?CFöimÏ Ñ›:lÉ~‡ç¬Þܵ®hû¤KµO3}=pÖFÊÔðäzÁa«¼l¬dßvƒÃjm;a FG,°È3Û9DËÍÈ+-ŽF_*¬z«ðàL(ãIEND®B`‚cpl-6.6.1/html/form_16.png0000644000460300003120000000045612553662437012161 00000000000000‰PNG  IHDR0•ð¼Í0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïIDATxíKà D_›€CzÿÛ–¦„*Í®êÊš‘Ï?ùÿ³—ö5€A’õ—Å–“Äzú'õè’nøê õ~[œ¶¹àëæ©¶•+Û—N©þŒ\#Ú—š[ïáœ_Žü­ÄŽ’¾PÚ—WÝ7œÇ½¦y?ëÁSlÃÞ¡R\8l^ è Üæã‚·¸sÖàç~ÊÌEI²eÏIEND®B`‚cpl-6.6.1/html/tab_b.png0000644000460300003120000000025112553662426011746 00000000000000‰PNG  IHDR$ÇÇ[pIDATxíÝMƒ EáÇ»ÐÔ¸¸u`âÀ´V0РÆ}:t]DÁ²s¿ä®‚¶ýËu¥ø|’xùî½À>ÿ1»& mÄ8ÜSÙÑxÜLÀUûšÞ²ÄiE–ŠåOs„¢’nxàÒêÓKN²~jIEND®B`‚cpl-6.6.1/html/formula.repository0000644000460300003120000000355012553662441014001 00000000000000\form#0:$\frac{(1*1.0+2*2.0+3*3.0+4*4.0+5*5.0+6*6.0+7*7.0+8*8.0+9*9.0)} {1+2+3+4+5+6+7+8+9}$ \form#1:$1*1.0+2*2.0+3*3.0+4*4.0+5*5.0+6*6.0+7*7.0+8*8.0+9*9.0$ \form#2:$\chi^2$ \form#3:\[ z = B + \frac{A}{2 \pi \sigma_x \sigma_y \sqrt{1-\rho^2}} \exp\left({-\frac{1}{2\left(1-\rho^2\right)} \left(\left(\frac{x - \mu_x}{\sigma_x}\right)^2 -2\rho\left(\frac{x - \mu_x}{\sigma_x}\right) \left(\frac{y - \mu_y}{\sigma_y}\right) + \left(\frac{y - \mu_y}{\sigma_y}\right)^2\right)}\right) \] \form#4:$B$ \form#5:$A$ \form#6:\begin{eqnarray*} \mathrm{parameters[0]} &=& B \\ \mathrm{parameters[1]} &=& A \\ \mathrm{parameters[2]} &=& \rho \\ \mathrm{parameters[3]} &=& \mu_x \\ \mathrm{parameters[4]} &=& \mu_y \\ \mathrm{parameters[5]} &=& \sigma_x \\ \mathrm{parameters[6]} &=& \sigma_y \end{eqnarray*} \form#7:$a, b$ \form#8:$\theta$ \form#9:\begin{eqnarray*} \theta &=& \frac{1}{2} \arctan \left(2 \rho \frac{\sigma_x \sigma_y} {\sigma_x^2 - \sigma_y^2}\right) \\ a &=& \sigma_x \sigma_y \sqrt{2(1-\rho^2) \frac{\cos 2\theta} {\left(\sigma_x^2 + \sigma_y^2\right) \cos 2\theta + \sigma_y^2 - \sigma_x^2}} \\ b &=& \sigma_x \sigma_y \sqrt{2(1-\rho^2) \frac{\cos 2\theta} {\left(\sigma_x^2 + \sigma_y^2\right) \cos 2\theta - \sigma_y^2 + \sigma_x^2}} \end{eqnarray*} \form#10:$x$ \form#11:$-\pi/2$ \form#12:$+\pi/2$ \form#13:$\rho = 0$ \form#14:$\sigma_x \geq \sigma_y$ \form#15:\begin{eqnarray*} \theta &=& 0 \\ a &=& \sigma_x \\ b &=& \sigma_y \end{eqnarray*} \form#16:$\sigma_x < \sigma_y$ \form#17:$y$ \form#18:\begin{eqnarray*} \theta &=& \frac{\pi}{2} \\ a &=& \sigma_y \\ b &=& \sigma_x \end{eqnarray*} \form#19:\[ \mathrm{G} = \mathrm{J} \mathrm{C} \mathrm{J}^\mathrm{T} \] \form#20:$ (B, A, \rho, \mu_x, \mu_y, \sigma_x, \sigma_y) \rightarrow (\theta, a, b) $ \form#21:$x_{max} = w/2 + k * \sigma,$ \form#22:$w$ \form#23:$\sigma = w_{FWHM}/(2\sqrt(2\log(2))),$ \form#24:$w_{FWHM}$ \form#25:$k$ cpl-6.6.1/html/tabs.css0000644000460300003120000000221312553662426011634 00000000000000.tabs, .tabs2, .tabs3 { background-image: url('tab_b.png'); width: 100%; z-index: 101; font-size: 13px; font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; } .tabs2 { font-size: 10px; } .tabs3 { font-size: 9px; } .tablist { margin: 0; padding: 0; display: table; } .tablist li { float: left; display: table-cell; background-image: url('tab_b.png'); line-height: 36px; list-style: none; } .tablist a { display: block; padding: 0 20px; font-weight: bold; background-image:url('tab_s.png'); background-repeat:no-repeat; background-position:right; color: #283A5D; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; outline: none; } .tabs3 .tablist a { padding: 0 10px; } .tablist a:hover { background-image: url('tab_h.png'); background-repeat:repeat-x; color: #fff; text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); text-decoration: none; } .tablist li.current a { background-image: url('tab_a.png'); background-repeat:repeat-x; color: #fff; text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); } cpl-6.6.1/html/form_6.png0000644000460300003120000000560412553662434012075 00000000000000‰PNG  IHDR†ˆ­cÓ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï óIDATxí]Û’ë,¯l@mÌû¿ínÉ8q2™½’Ì:|U(ätŒ,5’@·ðøm²Ô êோ:‘‰à—âj¯µ.^qp/tÞ"J~üà#ê^”ö 5ê(ÏÓÈp¢Qz(‰‰»Ä6±¬YrvR¹rŽH£– w=1½Š¬ö†¼@c¥¡kQé‘´-aa\{óÛ )sE6ÛîÜðnBÓ $l©(F#}¡‘Êp#£ˆôxó†‘^:’øF³Û;p¡p•±k‹ýSÕ UÏøæ{ps¸™VAÍÝР¸„zИøJ£wÆ?˜ê„»^$u$%>Ÿ+ %~K£-Za¥íæ|ІUÿ7¡ê…@UGçZkJ4ñTÚp3Wæ’¥v“aŒ¼†)÷ì·ê-dÄ®­^«& V«’4$ÑBÓÓÚXÍùB-þ< F ¡ÐЙFäõ°½¤dçB±'Ž)¹”.ëyñ—”AÓóû—ê<‰Ú|’ sÜÝ]7…¯ÊÕù.ó:Zx[~ ø™\*P/7ø|>ÿ-é—Ë›žÞÈð»DY8»_º¾¬-ÀËÞûtž’µ„Wh¸þ6õ;³3½B#Ë öÛÒÙþÄæGNcbÙšä%HKü(çÆ06:2¸ëe‰¼¿ß¢$ÜöÔàFÒBS'½ºzàÒm5 2b(¢ùšPõÂÂtü4Rn…ôïhð_Ûà%.¬³N».®’ƺ†Ðš©N¨znôÌ7ïD#·RÆÍQQeèöխјøJ£/ÎQmð1¡é¹Ò›ïiø0€›é 0w4ÖêY0¥‰™?ð•†.áŸà&T½Àípý{’æp3Y‹s'W ±3ÀÞ¥u×åÀ¡oRFõk Åc+L©AÓ ™ê­ƒ´ŸMJX‡× lç¬ '´hO ø kìU0ꑟïP_2PjÈ®/Sz¶6Lyÿä&)ð¶\¿t‹8ͪGÞ–å¨À`7:ü ‰G©Åßܬà#ðøü\úqñÔþ•E¨M»ÕO/BxBâÃ{¿²Ç±ãQþõ…}IŽ–¯K±tFÔIlq°×O,[“¼i¼¬sÎ yhÿ1¸ëe‰ìü.‚4^‰FŽõèDG‡ p#i¡©“^]=pé¶1Ñšñ„ª§¹ ÅÝùÊŸ{©ÎàfÖ„@;÷¾mðvÈ®}jâBá*i¬k­™ê„ªçFÏ|cN²>Ÿ†cä4z÷4ÊÐí«[£1ñ•F_œ£ÚàcBÓs¥sOê\˜œ¯4|˜ÀyF-ç»Óm[¬žäJ3à+¬Ô…‚›Põû^˜BtIÏuHšÀyêéÞîk#!vÆÉ»´±îº8ôMʨ¾Qc­¡xl…›6hz!ÓÊëx>)4XYÕ®s81bÑžðÖØ«`;Šþ€ú’bÔ9ÕTéI, QC®S“oËÕù“4âƒK¿êÑ€·e9²˜!ø•¤û’€K<*0jŠà#ðøü§¤Ï}·€¿'dáK«GË€?+ñá½Oçl— Cñ—h¬ßѨeû2bé™mObsˆƒ½~bÙšä%HãesnÈCûÁ]/KdçßoìÜOÓh_•G`çMZhê¤WW\º­öenuÖŒ'T½°°MíöBÑç=Tçp3iȧ©¶Û/qa‡ìÚ§&.®’ƺ†Ðš©N¨znô|)ÌLNÏFÑ‚êßÓ(C·¯nÆÄW}qŽjƒ MÏ•ná™Ô@Í{>Ìà<#ËyU õ™ÆZ5F¥‰™?ð•FÖ ÿ7¡ê6vs®ï"垆¤9œg#íá¢KÒÓÁƒu;ãä]ÚXw]ú&eTߨ±ÖP<¶ÂŠ4hz!Ó ·Dé/”è`wx"hï 1FÑžðÖØ«`;Šþ€ú’b<̹$Uz’†üÎ ¼oÁ©Å#)ð¶\?I#Îê”\c¸ªGÞ–åHo`†àWr©øm Œš"ø|>ÿ)éÇÅSÙ±àßÈÎb½´|ø£ÞûæÿE¹´Œ/½þšh“º½–àÊãû–×ß²”…—ÆO/BxBòCtÞZÕ‹è4|Щ[Õ';¹§Á‰=‚›«öÜÛ©G s>ýÿ€F)®ìs"¾Óí¨2&ö}â‹F=†NUí?MÏ5§mD£%¿B£ö1¶£«ÍËе¢Ðf/²ãjHî³EcBÕ#*«óÈ„±>ïi¤:€ól‘{pžj» ¸”¥¡e?±Rá*iô.R‹©NhzÛX™ Ý µž†QØœ§ÑØÐã 5?ñ•ƺ·ðáüUKÕœ{>5¿D£Ìà4 (Œ4¼Ø))I7Sš˜ù_iD¾Aâqš…# ú/†œ§›Àif~×è5ù5]>!-Â5‰¬)õ•yÞ±¬=ÖÑ|Û2òª[ª+÷aÐôB•¨o­XÓÏ&ÅUÉôÂhž dL²gÊî{õUó8öî铲[ˆnÕŸ¥u xG®Î_¼7jÎéØRLGK€w„gw–ž–ü¹Tàã–€Àÿ°¶·[]Öãâ‰ìõð§åñÅ wg^*ɼx‹À;’ò óÚ·ÑðA§nUŸ.8ÏV9±GpsÕžìúN=j¨s·/ü„F)®l"ž½:Œ*cbßW‘!¾ÐúC§j; é¹æBSçyˆ42yšFíclG+šž;kE¡Mö)9°¶*®†Ôé>[4&T=ÒÑFMe.D*ßÓHuçÙ"÷à<Õvp)-JCË~b¥ÂUÒè]¤SÐô¶±2AJƒùáâ“Ñ0 ,%×i46ô¸GCÍO|¥±™ª? êq©’@Eü†F*s8Í’E܃×5)‰¾èVÌü¯4Ôÿˆ›Ðô(ÜkRvà4ÝN3ó»F¯©E§lv)h®IdM©¯ñÀ²öXGómËÈ«n©®Ü‡AÓ U¢¾%¡^Ú}2)®J¦¸Íé÷GRv²gÊî{õUó8¦öî铲[`´K#,vx[®Î_½7/‡£¤£%À;³;Kï’høµH¸æ~&— |Ürà±xÑ áø?þ[zmÙj”IEND®B`‚cpl-6.6.1/html/form_21.png0000644000460300003120000000106612553662440012145 00000000000000‰PNG  IHDRxêK×0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï¥IDATxíË–¤ Do’‡Pm½ÿ¢é-ÓXÖ9ú%)Ï7ÈQãxöξoÛ>C"–†®r”ó(«UÆu­y–Öê»àE{0{'ã_Œàb§£uä,³}öñÖ\Î^†Û/÷gJ•têœ)ìZ0ÅçšÜRrxü ^!nÂÑÀ« Ëà{Ìëð—ÐßÜÀÇ?4Àü©3üŽÆIEND®B`‚cpl-6.6.1/html/struct__cpl__plugin__-members.html0000644000460300003120000001226512553662432017050 00000000000000 Common Pipeline Library Reference Manual: Member List
Common Pipeline Library Reference Manual  6.6.1
_cpl_plugin_ Member List
cpl-6.6.1/html/functions.html0000644000460300003120000001100112553662441013057 00000000000000 Common Pipeline Library Reference Manual: Class Members
Common Pipeline Library Reference Manual  6.6.1
Here is a list of all documented class members with links to the class documentation for each member:
cpl-6.6.1/html/group__cpl__fit.html0000644000460300003120000015161012553662432014214 00000000000000 Common Pipeline Library Reference Manual: High-level functions for non-linear fitting
Common Pipeline Library Reference Manual  6.6.1
High-level functions for non-linear fitting

Functions

cpl_error_code cpl_fit_image_gaussian (const cpl_image *im, const cpl_image *im_err, cpl_size xpos, cpl_size ypos, cpl_size xsize, cpl_size ysize, cpl_array *parameters, cpl_array *err_params, const cpl_array *fit_params, double *rms, double *red_chisq, cpl_matrix **covariance, double *major, double *minor, double *angle, cpl_matrix **phys_cov)
 Fit a 2D gaussian to image values. More...
 
cpl_imagelist * cpl_fit_imagelist_polynomial (const cpl_vector *x_pos, const cpl_imagelist *values, cpl_size mindeg, cpl_size maxdeg, cpl_boolean is_symsamp, cpl_type pixeltype, cpl_image *fiterror)
 Least-squares fit a polynomial to each pixel in a list of images. More...
 
cpl_imagelist * cpl_fit_imagelist_polynomial_window (const cpl_vector *x_pos, const cpl_imagelist *values, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, cpl_size mindeg, cpl_size maxdeg, cpl_boolean is_symsamp, cpl_type pixeltype, cpl_image *fiterror)
 Least-squares fit a polynomial to each pixel in a list of images. More...
 
cpl_error_code cpl_fit_lvmq (const cpl_matrix *x, const cpl_matrix *sigma_x, const cpl_vector *y, const cpl_vector *sigma_y, cpl_vector *a, const int ia[], int(*f)(const double x[], const double a[], double *result), int(*dfda)(const double x[], const double a[], double result[]), double relative_tolerance, int tolerance_count, int max_iterations, double *mse, double *red_chisq, cpl_matrix **covariance)
 Fit a function to a set of data. More...
 
double cpl_gaussian_eval_2d (const cpl_array *self, double x, double y)
 Evaluate the Gaussian in a 2D-point. More...
 

Detailed Description

This module provides a routine for non-linear fitting.

Synopsis:
#include "cpl_fit.h"

Function Documentation

cpl_error_code cpl_fit_image_gaussian ( const cpl_image *  im,
const cpl_image *  im_err,
cpl_size  xpos,
cpl_size  ypos,
cpl_size  xsize,
cpl_size  ysize,
cpl_array *  parameters,
cpl_array *  err_params,
const cpl_array *  fit_params,
double *  rms,
double *  red_chisq,
cpl_matrix **  covariance,
double *  major,
double *  minor,
double *  angle,
cpl_matrix **  phys_cov 
)

Fit a 2D gaussian to image values.

Parameters
imInput image with data values to fit.
im_errOptional input image with statistical errors associated to data.
xposX position of center of fitting domain.
yposY position of center of fitting domain.
xsizeX size of fitting domain. It must be at least 3 pixels.
ysizeY size of fitting domain. It must be at least 3 pixels.
parametersPreallocated array for returning the values of the best-fit gaussian parameters (the parametrisation of the fitted gaussian is described in the main documentation section, below). This array must be of type CPL_TYPE_DOUBLE, and it must have exactly 7 elements. Generally, when passed to this function, this array would not be initialised (all elements are "invalid"). A first-guess for the gaussian parameters is not mandatory: but it is possible to specify here a first-guess value for each parameter. First-guess values can also be specified just for a subset of parameters.
err_paramsOptional preallocated array for returning the statistical error associated to each fitted parameter. This array must be of type CPL_TYPE_DOUBLE, and it must have exactly 7 elements. This makes mandatory to specify im_err. Note that the returned values are the square root of the diagonal elements (variances) of the covariance matrix (see ahead).
fit_paramsOptional array, used for flagging the parameters to freeze. This array must be of type CPL_TYPE_INT, and it must have exactly 7 elements. If an array element is set to 0, the corresponding parameter will be frozen. Any other value (including an "invalid" array element) would indicate a free parameter. If a parameter is frozen, a first-guess value must be specified at the corresponding element of the parameters array. If no array is specified here (NULL pointer), all parameters are free.
rmsIf not NULL, returned standard deviation of fit residuals.
red_chisqIf not NULL, returned reduced chi-squared of fit. This makes mandatory to specify im_err.
covarianceIf not NULL, a newly allocated covariance matrix will be returned. This makes mandatory to specify im_err. On error it is not modified.
majorIf not NULL, returned semi-major axis of ellipse at 1-sigma.
minorIf not NULL, returned semi-minor axis of ellipse at 1-sigma.
angleIf not NULL, returned angle between X axis and major axis of ellipse, counted counterclockwise (radians).
phys_covIf not NULL, a newly allocated 3x3 covariance matrix for the derived physical parameters major, minor, and angle, will be returned. This makes mandatory to specify im_err. On error it is not modified.
Returns
CPL_ERROR_NONE on successful fit.

This function fits a 2d gaussian to pixel values within a specified region by minimizing $\chi^2$ using a Levenberg-Marquardt algorithm. The gaussian model adopted here is based on the well-known cartesian form

\[ z = B + \frac{A}{2 \pi \sigma_x \sigma_y \sqrt{1-\rho^2}} \exp\left({-\frac{1}{2\left(1-\rho^2\right)} \left(\left(\frac{x - \mu_x}{\sigma_x}\right)^2 -2\rho\left(\frac{x - \mu_x}{\sigma_x}\right) \left(\frac{y - \mu_y}{\sigma_y}\right) + \left(\frac{y - \mu_y}{\sigma_y}\right)^2\right)}\right) \]

where $B$ is a background level and $A$ the volume of the gaussian (they both can be negative!), making 7 parameters altogether. Conventionally the parameters are indexed from 0 to 6 in the elements of the arrays parameters, err_params, fit_params, and of the 7x7 covariance matrix:

\begin{eqnarray*} \mathrm{parameters[0]} &=& B \\ \mathrm{parameters[1]} &=& A \\ \mathrm{parameters[2]} &=& \rho \\ \mathrm{parameters[3]} &=& \mu_x \\ \mathrm{parameters[4]} &=& \mu_y \\ \mathrm{parameters[5]} &=& \sigma_x \\ \mathrm{parameters[6]} &=& \sigma_y \end{eqnarray*}

The semi-axes $a, b$ and the orientation $\theta$ of the ellipse at 1-sigma level are finally derived from the fitting parameters as:

\begin{eqnarray*} \theta &=& \frac{1}{2} \arctan \left(2 \rho \frac{\sigma_x \sigma_y} {\sigma_x^2 - \sigma_y^2}\right) \\ a &=& \sigma_x \sigma_y \sqrt{2(1-\rho^2) \frac{\cos 2\theta} {\left(\sigma_x^2 + \sigma_y^2\right) \cos 2\theta + \sigma_y^2 - \sigma_x^2}} \\ b &=& \sigma_x \sigma_y \sqrt{2(1-\rho^2) \frac{\cos 2\theta} {\left(\sigma_x^2 + \sigma_y^2\right) \cos 2\theta - \sigma_y^2 + \sigma_x^2}} \end{eqnarray*}

Note that $\theta$ is counted counterclockwise starting from the positive direction of the $x$ axis, ranging bewteen $-\pi/2$ and $+\pi/2$ radians.

If the correlation $\rho = 0$ and $\sigma_x \geq \sigma_y$ (within uncertainties) the ellipse is either a circle or its major axis is aligned with the $x$ axis, so it is conventionally set

\begin{eqnarray*} \theta &=& 0 \\ a &=& \sigma_x \\ b &=& \sigma_y \end{eqnarray*}

If the correlation $\rho = 0$ and $\sigma_x < \sigma_y$ (within uncertainties) the major axis of the ellipse is aligned with the $y$ axis, so it is conventionally set

\begin{eqnarray*} \theta &=& \frac{\pi}{2} \\ a &=& \sigma_y \\ b &=& \sigma_x \end{eqnarray*}

If requested, the 3x3 covariance matrix G associated to the derived physical quantities is also computed, applying the usual

\[ \mathrm{G} = \mathrm{J} \mathrm{C} \mathrm{J}^\mathrm{T} \]

where J is the Jacobian of the transformation $ (B, A, \rho, \mu_x, \mu_y, \sigma_x, \sigma_y) \rightarrow (\theta, a, b) $ and C is the 7x7 matrix of the gaussian parameters.

References cpl_array_get_double(), cpl_array_get_int(), cpl_array_get_type(), cpl_array_set_double(), cpl_array_set_invalid(), CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_CONTINUE, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_SINGULAR_MATRIX, CPL_ERROR_TYPE_MISMATCH, cpl_errorstate_get(), cpl_errorstate_set(), cpl_fit_lvmq(), cpl_image_count_rejected(), cpl_image_delete(), cpl_image_extract(), cpl_image_get(), cpl_image_get_max(), cpl_image_get_maxpos(), cpl_image_get_mean(), cpl_image_get_median(), cpl_image_get_min(), cpl_image_get_minpos(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), CPL_MATH_2PI, CPL_MATH_PI_2, cpl_matrix_delete(), cpl_matrix_get(), cpl_matrix_new(), cpl_matrix_set(), CPL_SIZE_FORMAT, CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, cpl_type_get_name(), CPL_TYPE_INT, cpl_vector_delete(), cpl_vector_get(), cpl_vector_new(), and cpl_vector_set().

cpl_imagelist* cpl_fit_imagelist_polynomial ( const cpl_vector *  x_pos,
const cpl_imagelist *  values,
cpl_size  mindeg,
cpl_size  maxdeg,
cpl_boolean  is_symsamp,
cpl_type  pixeltype,
cpl_image *  fiterror 
)

Least-squares fit a polynomial to each pixel in a list of images.

Parameters
x_posThe vector of positions to fit
valuesThe list of images with values to fit
mindegThe smallest degree with a non-zero coefficient
maxdegThe polynomial degree of the fit, at least mindeg
is_symsampTrue iff the x_pos values are symmetric around their mean
pixeltypeThe pixel-type of the created image list
fiterrorWhen non-NULL, the error of the fit
Note
values and x_pos must have the same number of elements.
The created imagelist must be deallocated with cpl_imagelist_delete().
x_pos must have at least 1 + (maxdeg - mindeg) distinct values.
Returns
The image list of the fitted polynomial coefficients or NULL on error.
See also
cpl_fit_imagelist_polynomial_window()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input const pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if mindeg is negative or maxdeg is less than mindeg.
  • CPL_ERROR_INCOMPATIBLE_INPUT if x_pos and values have different lengths, or if fiterror is non-NULL with a different size than that of values, or if the input images do not all have the same dimensions and pixel type.
  • CPL_ERROR_DATA_NOT_FOUND if x_pos contains less than nc values.
  • CPL_ERROR_SINGULAR_MATRIX if x_pos contains less than nc distinct values.
  • CPL_ERROR_UNSUPPORTED_MODE if the chosen pixel type is not one of CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT.

References cpl_fit_imagelist_polynomial_window(), cpl_image_get_size_x(), cpl_image_get_size_y(), and cpl_imagelist_get_const().

cpl_imagelist* cpl_fit_imagelist_polynomial_window ( const cpl_vector *  x_pos,
const cpl_imagelist *  values,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
cpl_size  mindeg,
cpl_size  maxdeg,
cpl_boolean  is_symsamp,
cpl_type  pixeltype,
cpl_image *  fiterror 
)

Least-squares fit a polynomial to each pixel in a list of images.

Parameters
x_posThe vector of positions to fit
valuesThe list of images with values to fit
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
mindegThe smallest degree with a non-zero coefficient
maxdegThe polynomial degree of the fit, at least mindeg
is_symsampTrue iff the x_pos values are symmetric around their mean
pixeltypeThe (non-complex) pixel-type of the created image list
fiterrorWhen non-NULL, the error of the fit. Must be non-complex
Note
values and x_pos must have the same number of elements.
The created imagelist must be deallocated with cpl_imagelist_delete().
x_pos must have at least 1 + (maxdeg - mindeg) distinct values.
Returns
The image list of the fitted polynomial coefficients or NULL on error.
See also
cpl_polynomial_fit()

For each pixel, a polynomial representing the relation value = P(x) is computed where: P(x) = x^{mindeg} * (a_0 + a_1 * x + ... + a_{nc-1} * x^{nc-1}), where mindeg >= 0 and maxdeg >= mindeg, and nc is the number of polynomial coefficients to determine, nc = 1 + (maxdeg - mindeg).

The returned image list thus contains nc coefficient images, a_0, a_1, ..., a_{nc-1}.

np is the number of sample points, i.e. the number of elements in x_pos and number of images in the input image list.

If mindeg is nonzero then is_symsamp is ignored, otherwise is_symsamp may to be set to CPL_TRUE if and only if the values in x_pos are known a-priori to be symmetric around their mean, e.g. (1, 2, 4, 6, 10, 14, 16, 18, 19), but not (1, 2, 4, 6, 10, 14, 16). Setting is_symsamp to CPL_TRUE while mindeg is zero eliminates certain round-off errors. For higher order fitting the fitting problem known as "Runge's phenomenon" is minimized using the socalled "Chebyshev nodes" as sampling points. For Chebyshev nodes is_symsamp can be set to CPL_TRUE.

Even though it is not an error, it is hardly useful to use an image of pixel type integer for the fitting error. An image of pixel type float should on the other hand be sufficient for most fitting errors.

The call requires the following number of FLOPs, where nz is the number of pixels in any one image in the imagelist:

2 * nz * nc * (nc + np) + np * nc^2 + nc^3/3 + O(nc * (nc + np)).

If mindeg is zero an additional nz * nc^2 FLOPs are required.

If fiterror is non-NULL an additional 2 * nz * nc * np FLOPs are required.

Bad pixels in the input is suported as follows: First all pixels are fitted ignoring any bad pixel maps in the input. If this succeeds then each fit, where bad pixel(s) are involved is redone. During this second pass all input pixels flagged as bad are ignored. For each pixel to be redone, the remaining good samples are passed to cpl_polynomial_fit(). The input is_symsamp is ignored in this second pass. The reduced number of samples may reduce the number of sampling points to equal the number of coefficients to fit. In this case the fit has another meaning (any non-zero residual is due to rounding errors, not a fitting error). If for a given fit bad pixels reduces the number of sampling points to less than the number of coefficients to fit, then as many coefficients are fit as there are sampling points. The higher order coefficients are set to zero and flagged as bad. If a given pixel has no good samples, then the resulting fit will consist of zeroes, all flagged as bad.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input const pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if mindeg is negative or maxdeg is less than mindeg or if llx or lly are smaller than 1 or if urx or ury is smaller than llx and lly respectively.
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if urx or ury exceed the size of values.
  • CPL_ERROR_INCOMPATIBLE_INPUT if x_pos and values have different lengths, or if fiterror is non-NULL with a different size than that of values, or if the input images do not all have the same dimensions and pixel type.
  • CPL_ERROR_DATA_NOT_FOUND if x_pos contains less than nc values.
  • CPL_ERROR_SINGULAR_MATRIX if x_pos contains less than nc distinct values.
  • CPL_ERROR_UNSUPPORTED_MODE if the chosen pixel type is not one of CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT.

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_SINGULAR_MATRIX, CPL_ERROR_UNSUPPORTED_MODE, cpl_image_get_bpm_const(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_imagelist_delete(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_is_uniform(), cpl_imagelist_new(), cpl_imagelist_set(), cpl_malloc(), cpl_mask_delete(), cpl_mask_extract(), cpl_mask_or(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, cpl_type_get_sizeof(), CPL_TYPE_INT, and cpl_vector_get_size().

Referenced by cpl_fit_imagelist_polynomial().

cpl_error_code cpl_fit_lvmq ( const cpl_matrix *  x,
const cpl_matrix *  sigma_x,
const cpl_vector *  y,
const cpl_vector *  sigma_y,
cpl_vector *  a,
const int  ia[],
int(*)(const double x[], const double a[], double *result)  f,
int(*)(const double x[], const double a[], double result[])  dfda,
double  relative_tolerance,
int  tolerance_count,
int  max_iterations,
double *  mse,
double *  red_chisq,
cpl_matrix **  covariance 
)

Fit a function to a set of data.

Parameters
xN x D matrix of the positions to fit. Each matrix row is a D-dimensional position.
sigma_xUncertainty (one sigma, gaussian errors assumed) assosiated with x. Taking into account the uncertainty of the independent variable is currently unsupported, and this parameter must therefore be set to NULL.
yThe N values to fit.
sigma_yVector of size N containing the uncertainties of the y-values. If this parameter is NULL, constant uncertainties are assumed.
aVector containing M fit parameters. Must contain a guess solution on input and contains the best fit parameters on output.
iaArray of size M defining which fit parameters participate in the fit (non-zero) and which fit parameters are held constant (zero). At least one element must be non-zero. Alternatively, pass NULL to fit all parameters.
fFunction that evaluates the fit function at the position specified by the first argument (an array of size D) using the fit parameters specified by the second argument (an array of size M). The result must be output using the third parameter, and the function must return zero iff the evaluation succeded.
dfdaFunction that evaluates the first order partial derivatives of the fit function with respect to the fit parameters at the position specified by the first argument (an array of size D) using the parameters specified by the second argument (an array of size M). The result must be output using the third parameter (array of size M), and the function must return zero iff the evaluation succeded.
relative_toleranceThe algorithm converges by definition if the relative decrease in chi squared is less than tolerance tolerance_count times in a row. Recommended default: CPL_FIT_LVMQ_TOLERANCE
tolerance_countThe algorithm converges by definition if the relative decrease in chi squared is less than tolerance tolerance_count times in a row. Recommended default: CPL_FIT_LVMQ_COUNT
max_iterationsIf this number of iterations is reached without convergence, the algorithm diverges, by definition. Recommended default: CPL_FIT_LVMQ_MAXITER
mseIf non-NULL, the mean squared error of the best fit is computed.
red_chisqIf non-NULL, the reduced chi square of the best fit is computed. This requires sigma_y to be specified.
covarianceIf non-NULL, the formal covariance matrix of the best fit parameters is computed (or NULL on error). On success the diagonal terms of the covariance matrix are guaranteed to be positive. However, terms that involve a constant parameter (as defined by the input array ia) are always set to zero. Computation of the covariacne matrix requires sigma_y to be specified.
Returns
CPL_ERROR_NONE iff OK.

This function makes a minimum chi squared fit of the specified function to the specified data set using a Levenberg-Marquardt algorithm.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer other than sigma_x, sigma_y, mse, red_chisq or covariance is NULL.
  • CPL_ERROR_ILLEGAL_INPUT if an input matrix/vector is empty, if ia contains only zero values, if any of relative_tolerance, tolerance_count or max_iterations is non-positive, if N <= M and red_chisq is non-NULL, if any element of sigma_x or sigma_y is non-positive, or if evaluation of the fit function or its derivative failed.
  • CPL_ERROR_INCOMPATIBLE_INPUT if the dimensions of the input vectors/matrices do not match, or if chi square or covariance computation is requested and sigma_y is NULL.
  • CPL_ERROR_ILLEGAL_OUTPUT if memory allocation failed.
  • CPL_ERROR_CONTINUE if the Levenberg-Marquardt algorithm failed to converge.
  • CPL_ERROR_SINGULAR_MATRIX if the covariance matrix could not be computed.

References CPL_ERROR_NONE.

Referenced by cpl_fit_image_gaussian().

double cpl_gaussian_eval_2d ( const cpl_array *  self,
double  x,
double  y 
)

Evaluate the Gaussian in a 2D-point.

Parameters
selfThe seven Gaussian parameters
xThe X-coordinate to evaluate
yThe Y-coordinate to evaluate
Returns
The gaussian value or zero on error
See also
cpl_fit_image_gaussian()
Note
The function should not be able to fail if the parameters come from a succesful call to cpl_fit_image_gaussian()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if a pointer is NULL.
  • CPL_ERROR_TYPE_MISMATCH if the array is not of type double
  • CPL_ERROR_ILLEGAL_INPUT if the array has a length different from 7
  • CPL_ERROR_ILLEGAL_OUTPUT if the (absolute value of the) radius exceeds 1
  • CPL_ERROR_DIVISION_BY_ZERO if a sigma is 0, or the radius is 1

References cpl_array_get_double(), cpl_array_get_size(), CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and CPL_MATH_2PI.

cpl-6.6.1/html/group__cpl__propertylist.html0000644000460300003120000137012612553662432016220 00000000000000 Common Pipeline Library Reference Manual: Property Lists
Common Pipeline Library Reference Manual  6.6.1
Property Lists

Typedefs

typedef struct _cpl_propertylist_ cpl_propertylist
 The opaque property list data type. More...
 
typedef int(* cpl_propertylist_compare_func) (const cpl_property *first, const cpl_property *second)
 The property comparison function data type. More...
 

Functions

cpl_error_code cpl_propertylist_append (cpl_propertylist *self, const cpl_propertylist *other)
 Append a property list.. More...
 
cpl_error_code cpl_propertylist_append_bool (cpl_propertylist *self, const char *name, int value)
 Append a boolean value to a property list. More...
 
cpl_error_code cpl_propertylist_append_char (cpl_propertylist *self, const char *name, char value)
 Append a character value to a property list. More...
 
cpl_error_code cpl_propertylist_append_double (cpl_propertylist *self, const char *name, double value)
 Append a double value to a property list. More...
 
cpl_error_code cpl_propertylist_append_double_complex (cpl_propertylist *self, const char *name, double complex value)
 Append a double complex value to a property list. More...
 
cpl_error_code cpl_propertylist_append_float (cpl_propertylist *self, const char *name, float value)
 Append a float value to a property list. More...
 
cpl_error_code cpl_propertylist_append_float_complex (cpl_propertylist *self, const char *name, float complex value)
 Append a float complex value to a property list. More...
 
cpl_error_code cpl_propertylist_append_int (cpl_propertylist *self, const char *name, int value)
 Append an integer value to a property list. More...
 
cpl_error_code cpl_propertylist_append_long (cpl_propertylist *self, const char *name, long value)
 Append a long value to a property list. More...
 
cpl_error_code cpl_propertylist_append_long_long (cpl_propertylist *self, const char *name, long long value)
 Append a long long value to a property list. More...
 
cpl_error_code cpl_propertylist_append_property (cpl_propertylist *self, const cpl_property *property)
 Append a property to a property list. More...
 
cpl_error_code cpl_propertylist_append_string (cpl_propertylist *self, const char *name, const char *value)
 Append a string value to a property list. More...
 
cpl_error_code cpl_propertylist_copy_property (cpl_propertylist *self, const cpl_propertylist *other, const char *name)
 Copy a property from another property list. More...
 
cpl_error_code cpl_propertylist_copy_property_regexp (cpl_propertylist *self, const cpl_propertylist *other, const char *regexp, int invert)
 Copy matching properties from another property list. More...
 
void cpl_propertylist_delete (cpl_propertylist *self)
 Destroy a property list. More...
 
void cpl_propertylist_dump (const cpl_propertylist *self, FILE *stream)
 Print a property list. More...
 
cpl_propertylistcpl_propertylist_duplicate (const cpl_propertylist *self)
 Create a copy of the given property list. More...
 
void cpl_propertylist_empty (cpl_propertylist *self)
 Remove all properties from a property list. More...
 
int cpl_propertylist_erase (cpl_propertylist *self, const char *name)
 Erase the given property from a property list. More...
 
int cpl_propertylist_erase_regexp (cpl_propertylist *self, const char *regexp, int invert)
 Erase all properties with name matching a given regular expression. More...
 
cpl_propertycpl_propertylist_get (cpl_propertylist *self, long position)
 Access property list elements by index. More...
 
int cpl_propertylist_get_bool (const cpl_propertylist *self, const char *name)
 Get the boolean value of the given property list entry. More...
 
char cpl_propertylist_get_char (const cpl_propertylist *self, const char *name)
 Get the character value of the given property list entry. More...
 
const char * cpl_propertylist_get_comment (const cpl_propertylist *self, const char *name)
 Get the comment of the given property list entry. More...
 
const cpl_propertycpl_propertylist_get_const (const cpl_propertylist *self, long position)
 Access property list elements by index. More...
 
double cpl_propertylist_get_double (const cpl_propertylist *self, const char *name)
 Get the double value of the given property list entry. More...
 
double complex cpl_propertylist_get_double_complex (const cpl_propertylist *self, const char *name)
 Get the double complex value of the given property list entry. More...
 
float cpl_propertylist_get_float (const cpl_propertylist *self, const char *name)
 Get the float value of the given property list entry. More...
 
float complex cpl_propertylist_get_float_complex (const cpl_propertylist *self, const char *name)
 Get the float complex value of the given property list entry. More...
 
int cpl_propertylist_get_int (const cpl_propertylist *self, const char *name)
 Get the integer value of the given property list entry. More...
 
long cpl_propertylist_get_long (const cpl_propertylist *self, const char *name)
 Get the long value of the given property list entry. More...
 
long long cpl_propertylist_get_long_long (const cpl_propertylist *self, const char *name)
 Get the long long value of the given property list entry. More...
 
cpl_propertycpl_propertylist_get_property (cpl_propertylist *self, const char *name)
 Access property list elements by property name. More...
 
const cpl_propertycpl_propertylist_get_property_const (const cpl_propertylist *self, const char *name)
 Access property list elements by property name. More...
 
cpl_size cpl_propertylist_get_size (const cpl_propertylist *self)
 Get the current size of a property list. More...
 
const char * cpl_propertylist_get_string (const cpl_propertylist *self, const char *name)
 Get the string value of the given property list entry. More...
 
cpl_type cpl_propertylist_get_type (const cpl_propertylist *self, const char *name)
 Get the the type of a property list entry. More...
 
int cpl_propertylist_has (const cpl_propertylist *self, const char *name)
 Check whether a property is present in a property list. More...
 
cpl_error_code cpl_propertylist_insert_after_bool (cpl_propertylist *self, const char *after, const char *name, int value)
 Insert a boolean value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_char (cpl_propertylist *self, const char *after, const char *name, char value)
 Insert a character value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_double (cpl_propertylist *self, const char *after, const char *name, double value)
 Insert a double value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_double_complex (cpl_propertylist *self, const char *after, const char *name, double complex value)
 Insert a double complex value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_float (cpl_propertylist *self, const char *after, const char *name, float value)
 Insert a float value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_float_complex (cpl_propertylist *self, const char *after, const char *name, float complex value)
 Insert a float complex value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_int (cpl_propertylist *self, const char *after, const char *name, int value)
 Insert a integer value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_long (cpl_propertylist *self, const char *after, const char *name, long value)
 Insert a long value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_long_long (cpl_propertylist *self, const char *after, const char *name, long long value)
 Insert a long long value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_property (cpl_propertylist *self, const char *after, const cpl_property *property)
 Insert a property into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_after_string (cpl_propertylist *self, const char *after, const char *name, const char *value)
 Insert a string value into a property list after the given position. More...
 
cpl_error_code cpl_propertylist_insert_bool (cpl_propertylist *self, const char *here, const char *name, int value)
 Insert a boolean value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_char (cpl_propertylist *self, const char *here, const char *name, char value)
 Insert a character value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_double (cpl_propertylist *self, const char *here, const char *name, double value)
 Insert a double value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_double_complex (cpl_propertylist *self, const char *here, const char *name, double complex value)
 Insert a double complex value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_float (cpl_propertylist *self, const char *here, const char *name, float value)
 Insert a float value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_float_complex (cpl_propertylist *self, const char *here, const char *name, float complex value)
 Insert a float complex value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_int (cpl_propertylist *self, const char *here, const char *name, int value)
 Insert a integer value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_long (cpl_propertylist *self, const char *here, const char *name, long value)
 Insert a long value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_long_long (cpl_propertylist *self, const char *here, const char *name, long long value)
 Insert a long long value into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_property (cpl_propertylist *self, const char *here, const cpl_property *property)
 Insert a property into a property list at the given position. More...
 
cpl_error_code cpl_propertylist_insert_string (cpl_propertylist *self, const char *here, const char *name, const char *value)
 Insert a string value into a property list at the given position. More...
 
int cpl_propertylist_is_empty (const cpl_propertylist *self)
 Check whether a property list is empty. More...
 
cpl_propertylistcpl_propertylist_load (const char *name, cpl_size position)
 Create a property list from a file. More...
 
cpl_propertylistcpl_propertylist_load_regexp (const char *name, cpl_size position, const char *regexp, int invert)
 Create a filtered property list from a file. More...
 
cpl_propertylistcpl_propertylist_new (void)
 Create an empty property list. More...
 
cpl_error_code cpl_propertylist_prepend_bool (cpl_propertylist *self, const char *name, int value)
 Prepend a boolean value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_char (cpl_propertylist *self, const char *name, char value)
 Prepend a character value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_double (cpl_propertylist *self, const char *name, double value)
 Prepend a double value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_double_complex (cpl_propertylist *self, const char *name, double complex value)
 Prepend a double complex value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_float (cpl_propertylist *self, const char *name, float value)
 Prepend a float value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_float_complex (cpl_propertylist *self, const char *name, float complex value)
 Prepend a float complex value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_int (cpl_propertylist *self, const char *name, int value)
 Prepend a integer value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_long (cpl_propertylist *self, const char *name, long value)
 Prepend a long value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_long_long (cpl_propertylist *self, const char *name, long long value)
 Prepend a long long value to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_property (cpl_propertylist *self, const cpl_property *property)
 Prepend a property to a property list. More...
 
cpl_error_code cpl_propertylist_prepend_string (cpl_propertylist *self, const char *name, const char *value)
 Prepend a string value to a property list. More...
 
cpl_error_code cpl_propertylist_save (const cpl_propertylist *self, const char *filename, unsigned mode)
 Save a property list to a FITS file. More...
 
cpl_error_code cpl_propertylist_set_bool (cpl_propertylist *self, const char *name, int value)
 Set the value of the given boolean property list entry. More...
 
cpl_error_code cpl_propertylist_set_char (cpl_propertylist *self, const char *name, char value)
 Set the value of the given character property list entry. More...
 
cpl_error_code cpl_propertylist_set_comment (cpl_propertylist *self, const char *name, const char *comment)
 Modify the comment field of the given property list entry. More...
 
cpl_error_code cpl_propertylist_set_double (cpl_propertylist *self, const char *name, double value)
 Set the value of the given double property list entry. More...
 
cpl_error_code cpl_propertylist_set_double_complex (cpl_propertylist *self, const char *name, double complex value)
 Set the value of the given double complex property list entry. More...
 
cpl_error_code cpl_propertylist_set_float (cpl_propertylist *self, const char *name, float value)
 Set the value of the given float property list entry. More...
 
cpl_error_code cpl_propertylist_set_float_complex (cpl_propertylist *self, const char *name, float complex value)
 Set the value of the given float complex property list entry. More...
 
cpl_error_code cpl_propertylist_set_int (cpl_propertylist *self, const char *name, int value)
 Set the value of the given integer property list entry. More...
 
cpl_error_code cpl_propertylist_set_long (cpl_propertylist *self, const char *name, long value)
 Set the value of the given long property list entry. More...
 
cpl_error_code cpl_propertylist_set_long_long (cpl_propertylist *self, const char *name, long long value)
 Set the value of the given long long property list entry. More...
 
cpl_error_code cpl_propertylist_set_string (cpl_propertylist *self, const char *name, const char *value)
 Set the value of the given string property list entry. More...
 
cpl_error_code cpl_propertylist_sort (cpl_propertylist *self, cpl_propertylist_compare_func compare)
 Sort a property list. More...
 
cpl_error_code cpl_propertylist_update_bool (cpl_propertylist *self, const char *name, int value)
 Update a property list with a boolean value. More...
 
cpl_error_code cpl_propertylist_update_char (cpl_propertylist *self, const char *name, char value)
 Update a property list with a character value. More...
 
cpl_error_code cpl_propertylist_update_double (cpl_propertylist *self, const char *name, double value)
 Update a property list with a double value. More...
 
cpl_error_code cpl_propertylist_update_double_complex (cpl_propertylist *self, const char *name, double complex value)
 Update a property list with a double complex value. More...
 
cpl_error_code cpl_propertylist_update_float (cpl_propertylist *self, const char *name, float value)
 Update a property list with a float value. More...
 
cpl_error_code cpl_propertylist_update_float_complex (cpl_propertylist *self, const char *name, float complex value)
 Update a property list with a float complex value. More...
 
cpl_error_code cpl_propertylist_update_int (cpl_propertylist *self, const char *name, int value)
 Update a property list with a integer value. More...
 
cpl_error_code cpl_propertylist_update_long (cpl_propertylist *self, const char *name, long value)
 Update a property list with a long value. More...
 
cpl_error_code cpl_propertylist_update_long_long (cpl_propertylist *self, const char *name, long long value)
 Update a property list with a long long value. More...
 
cpl_error_code cpl_propertylist_update_string (cpl_propertylist *self, const char *name, const char *value)
 Update a property list with a string value. More...
 

Detailed Description

This module implements a container for properties (see Properties) which can be used to store auxiliary values related to another data object, an image or a table for instance. The property values can be set and retrieved by their associated name and properties can be added and removed from the list. The property list container is an ordered sequence of properties.

Synopsis:
#include <cpl_propertylist.h>

Typedef Documentation

typedef struct _cpl_propertylist_ cpl_propertylist

The opaque property list data type.

typedef int(* cpl_propertylist_compare_func) (const cpl_property *first, const cpl_property *second)

The property comparison function data type.

Function Documentation

cpl_error_code cpl_propertylist_append ( cpl_propertylist self,
const cpl_propertylist other 
)

Append a property list..

Parameters
selfA property list.
otherThe property to append.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function appends the property list other to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_property_duplicate().

cpl_error_code cpl_propertylist_append_bool ( cpl_propertylist self,
const char *  name,
int  value 
)

Append a boolean value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new boolean property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_bool(), and CPL_TYPE_BOOL.

cpl_error_code cpl_propertylist_append_char ( cpl_propertylist self,
const char *  name,
char  value 
)

Append a character value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new character property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_char(), and CPL_TYPE_CHAR.

cpl_error_code cpl_propertylist_append_double ( cpl_propertylist self,
const char *  name,
double  value 
)

Append a double value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new double property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_double(), and CPL_TYPE_DOUBLE.

Referenced by cpl_wcs_platesol().

cpl_error_code cpl_propertylist_append_double_complex ( cpl_propertylist self,
const char *  name,
double complex  value 
)

Append a double complex value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new double complex property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_double_complex(), and CPL_TYPE_DOUBLE_COMPLEX.

cpl_error_code cpl_propertylist_append_float ( cpl_propertylist self,
const char *  name,
float  value 
)

Append a float value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new float property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_float(), and CPL_TYPE_FLOAT.

cpl_error_code cpl_propertylist_append_float_complex ( cpl_propertylist self,
const char *  name,
float complex  value 
)

Append a float complex value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new float complex property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_float_complex(), and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_propertylist_append_int ( cpl_propertylist self,
const char *  name,
int  value 
)

Append an integer value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new integer property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_int(), and CPL_TYPE_INT.

cpl_error_code cpl_propertylist_append_long ( cpl_propertylist self,
const char *  name,
long  value 
)

Append a long value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new long property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_long(), and CPL_TYPE_LONG.

cpl_error_code cpl_propertylist_append_long_long ( cpl_propertylist self,
const char *  name,
long long  value 
)

Append a long long value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new long long property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_long_long(), and CPL_TYPE_LONG_LONG.

cpl_error_code cpl_propertylist_append_property ( cpl_propertylist self,
const cpl_property property 
)

Append a property to a property list.

Parameters
selfProperty list to append to
propertyThe property to append
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or property is a NULL pointer.

This function creates a new property and appends it to the end of a property list. It will not check if the property already exists.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_property_duplicate().

cpl_error_code cpl_propertylist_append_string ( cpl_propertylist self,
const char *  name,
const char *  value 
)

Append a string value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, name or value is a NULL pointer.

The function creates a new string property with name name and value value. The property is appended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_string(), and CPL_TYPE_STRING.

Referenced by cpl_dfs_setup_product_header().

cpl_error_code cpl_propertylist_copy_property ( cpl_propertylist self,
const cpl_propertylist other,
const char *  name 
)

Copy a property from another property list.

Parameters
selfA property list.
otherThe property list from which a property is copied.
nameThe name of the property to copy.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, other or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list other does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of the same type as the property which should be copied from other.

The function copies the property name from the property list other to the property list self. If the property list self does not already contain a property name the property is appended to self. If a property name exists already in self the function overwrites the contents of this property if and only if this property is of the same type as the property to be copied from other.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, CPL_ERROR_UNSUPPORTED_MODE, cpl_property_duplicate(), cpl_property_get_bool(), cpl_property_get_char(), cpl_property_get_comment(), cpl_property_get_double(), cpl_property_get_double_complex(), cpl_property_get_float(), cpl_property_get_float_complex(), cpl_property_get_int(), cpl_property_get_long(), cpl_property_get_string(), cpl_property_get_type(), cpl_property_set_bool(), cpl_property_set_char(), cpl_property_set_comment(), cpl_property_set_double(), cpl_property_set_double_complex(), cpl_property_set_float(), cpl_property_set_float_complex(), cpl_property_set_int(), cpl_property_set_long(), cpl_property_set_string(), CPL_TYPE_BOOL, CPL_TYPE_CHAR, CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, and CPL_TYPE_STRING.

Referenced by cpl_dfs_setup_product_header().

cpl_error_code cpl_propertylist_copy_property_regexp ( cpl_propertylist self,
const cpl_propertylist other,
const char *  regexp,
int  invert 
)

Copy matching properties from another property list.

Parameters
selfA property list.
otherThe property list from which a property is copied.
regexpThe regular expression used to select properties.
invertFlag inverting the sense of matching.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, other or regexp is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter regexp is an invalid regular expression.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of the same type as the property which should be copied from other.

The function copies all properties with matching names from the property list other to the property list self. If the flag invert is zero, all properties whose names match the regular expression regexp are copied. If invert is set to a non-zero value, all properties with names not matching regexp are copied rather. The function expects POSIX 1003.2 compliant extended regular expressions.

If the property list self does not already contain one of the properties to be copied this property is appended to self. If a property to be copied exists already in self the function overwrites the contents of this property.

Before properties are copied from the property list other to self the types of the properties are checked and if any type mismatch is detected the function stops processing immediately. The property list self is not at all modified in this case.

See also
cpl_propertylist_copy_property(), cpl_propertylist_append()

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, CPL_ERROR_UNSUPPORTED_MODE, cpl_property_duplicate(), cpl_property_get_bool(), cpl_property_get_char(), cpl_property_get_double(), cpl_property_get_double_complex(), cpl_property_get_float(), cpl_property_get_float_complex(), cpl_property_get_int(), cpl_property_get_long(), cpl_property_get_name(), cpl_property_get_string(), cpl_property_get_type(), cpl_property_set_bool(), cpl_property_set_char(), cpl_property_set_double(), cpl_property_set_double_complex(), cpl_property_set_float(), cpl_property_set_float_complex(), cpl_property_set_int(), cpl_property_set_long(), cpl_property_set_string(), CPL_TYPE_BOOL, CPL_TYPE_CHAR, CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, and CPL_TYPE_STRING.

Referenced by cpl_dfs_setup_product_header(), cpl_wcs_new_from_propertylist(), and cpl_wcs_platesol().

void cpl_propertylist_delete ( cpl_propertylist self)

Destroy a property list.

Parameters
selfThe property list to .
Returns
Nothing.

The function destroys the property list self and its whole contents. If self is NULL, nothing is done and no error is set.

References cpl_property_delete().

Referenced by cpl_dfs_setup_product_header(), cpl_propertylist_load(), cpl_propertylist_load_regexp(), cpl_wcs_new_from_propertylist(), and cpl_wcs_platesol().

cpl_propertylist* cpl_propertylist_duplicate ( const cpl_propertylist self)

Create a copy of the given property list.

Parameters
selfThe property list to be copied.
Returns
The created copy or NULL in case an error occurred.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function creates a deep copy of the given property list self, i.e the created copy and the original property list do not share any resources.

References CPL_ERROR_NULL_INPUT, cpl_property_duplicate(), and cpl_propertylist_new().

void cpl_propertylist_empty ( cpl_propertylist self)

Remove all properties from a property list.

Parameters
selfA property list.
Returns
Nothing.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function removes all properties from self. Each property is properly deallocated. After calling this function self is empty.

References CPL_ERROR_NULL_INPUT, and cpl_property_delete().

int cpl_propertylist_erase ( cpl_propertylist self,
const char *  name 
)

Erase the given property from a property list.

Parameters
selfA property list.
nameName of the property to erase.
Returns
On success the function returns the number of erased entries. If an error occurs the function returns 0 and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the property with the name name in the property list self and removes it. The property is destroyed. If self contains multiple duplicates of a property named name, only the first one is erased.

References CPL_ERROR_NULL_INPUT, and cpl_property_delete().

Referenced by cpl_dfs_setup_product_header(), and cpl_wcs_platesol().

int cpl_propertylist_erase_regexp ( cpl_propertylist self,
const char *  regexp,
int  invert 
)

Erase all properties with name matching a given regular expression.

Parameters
selfA property list.
regexpRegular expression.
invertFlag inverting the sense of matching.
Returns
On success the function returns the number of erased entries or 0 if no entries are erase. If an error occurs the function returns -1 and an appropriate error code is set. In CPL versions earlier than 5.0, the return value in case of error is 0.
Errors
CPL_ERROR_NULL_INPUT The parameter self or regexp is a NULL pointer.

The function searches for all the properties matching in the list self and removes them. Whether a property matches or not depends on the given regular expression regexp, and the flag invert. If invert is 0, all properties matching regexp are removed from the list. If invert is set to a non-zero value, all properties which do not match regexp are erased. The removed properties are destroyed.

The function expects POSIX 1003.2 compliant extended regular expressions.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_property_delete().

Referenced by cpl_dfs_setup_product_header(), and cpl_wcs_platesol().

cpl_property* cpl_propertylist_get ( cpl_propertylist self,
long  position 
)

Access property list elements by index.

Parameters
selfThe property list to query.
positionIndex of the element to retrieve.
Returns
The function returns the property with index position, or NULL if position is out of range.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a handle for the property list element, the property, with the index position. Numbering of property list elements extends from 0 to cpl_propertylist_get_size() - 1. If position is less than 0 or greater equal than cpl_propertylist_get_size() the function returns NULL.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_propertylist_get_const().

Referenced by cpl_wcs_platesol().

int cpl_propertylist_get_bool ( const cpl_propertylist self,
const char *  name 
)

Get the boolean value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The integer representation of the boolean value stored in the list entry. TRUE is represented as non-zero value while 0 indicates FALSE. The function returns 0 if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_BOOL.

The function searches the property list self for a property named name. If it is present in the list, its boolean value is returned. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_bool().

Referenced by cpl_dfs_setup_product_header().

char cpl_propertylist_get_char ( const cpl_propertylist self,
const char *  name 
)

Get the character value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The character value stored in the list entry. The function returns '\0' if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_CHAR.

The function searches the property list self for a property named name. If it is present in the list, its character value is returned. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_char().

const char* cpl_propertylist_get_comment ( const cpl_propertylist self,
const char *  name 
)

Get the comment of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The comment of the property list entry, or NULL.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its comment string is returned. If an entry with the name name is not found, or if the entry has no comment the function returns NULL. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_get_comment().

const cpl_property* cpl_propertylist_get_const ( const cpl_propertylist self,
long  position 
)

Access property list elements by index.

Parameters
selfThe property list to query.
positionIndex of the element to retrieve.
Returns
The function returns the property with index position, or NULL if position is out of range.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a handle for the property list element, the property, with the index position. Numbering of property list elements extends from 0 to cpl_propertylist_get_size() - 1. If position is less than 0 or greater equal than cpl_propertylist_get_size() the function returns NULL.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_propertylist_dump(), and cpl_propertylist_get().

double cpl_propertylist_get_double ( const cpl_propertylist self,
const char *  name 
)

Get the double value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The double value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_DOUBLE or CPL_TYPE_FLOAT.

The function searches the property list self for a property named name. If it is present in the list, its double value is returned. If there is more than one property with the same name, it takes the first one from the list. If the value is of type float, the function casts it to double before returning it.

The function may be used to access the value of all floating-point type properties whose floating-point value has a rank less or equal to the functions return type. If the value of a compatible property is retrieved, it is promoted to the return type of the function.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_double().

double complex cpl_propertylist_get_double_complex ( const cpl_propertylist self,
const char *  name 
)

Get the double complex value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The double complex value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_DOUBLE_COMPLEX or CPL_TYPE_FLOAT_COMPLEX.

The function searches the property list self for a property named name. If it is present in the list, its double complex value is returned. If there is more than one property with the same name, it takes the first one from the list. If the value is of type float, the function casts it to double complex before returning it.

The function may be used to access the value of all complex type properties whose complex value has a rank less or equal to the functions return type. If the value of a compatible property is retrieved, it is promoted to the return type of the function.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_double_complex().

float cpl_propertylist_get_float ( const cpl_propertylist self,
const char *  name 
)

Get the float value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The float value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

The function searches the property list self for a property named name. If it is present in the list, its float value is returned. If there is more than one property with the same name, it takes the first one from the list. If the value is of type double, the function casts it to float before returning it.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_float().

float complex cpl_propertylist_get_float_complex ( const cpl_propertylist self,
const char *  name 
)

Get the float complex value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The float complex value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_FLOAT_COMPLEX or CPL_TYPE_DOUBLE_COMPLEX.

The function searches the property list self for a property named name. If it is present in the list, its float complex value is returned. If there is more than one property with the same name, it takes the first one from the list. If the value is of type double, the function casts it to float complex before returning it.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_float_complex().

int cpl_propertylist_get_int ( const cpl_propertylist self,
const char *  name 
)

Get the integer value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The integer value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_INT.

The function searches the property list self for a property named name. If it is present in the list, its integer value is returned. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_int().

Referenced by cpl_wcs_new_from_propertylist().

long cpl_propertylist_get_long ( const cpl_propertylist self,
const char *  name 
)

Get the long value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The long value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_LONG or CPL_TYPE_INT.

The function searches the property list self for a property named name. If it is present in the list, its long value is returned. If there is more than one property with the same name, it takes the first one from the list.

The function may be used to access the value of all integer type properties whose integer value has a rank less or equal to the functions return type. If the value of a compatible property is retrieved, it is promoted to the return type of the function.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_long().

long long cpl_propertylist_get_long_long ( const cpl_propertylist self,
const char *  name 
)

Get the long long value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The long value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_LONG_LONG, CPL_TYPE_LONG, or CPL_TYPE_INT

The function searches the property list self for a property named name. If it is present in the list, its long long value is returned. If there is more than one property with the same name, it takes the first one from the list.

The function may be used to access the value of all integer type properties whose integer value has a rank less or equal to the functions return type. If the value of a compatible property is retrieved, it is promoted to the return type of the function.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_long_long().

cpl_property* cpl_propertylist_get_property ( cpl_propertylist self,
const char *  name 
)

Access property list elements by property name.

Parameters
selfThe property list to query.
nameThe name of the property to retrieve.
Returns
The function returns the property with name name, or NULL if it does not exist.
Errors
CPL_ERROR_NULL_INPUT The parameter self or the name is a NULL pointer.

The function returns a handle to the property list element, the property, with the name name. If more than one property exist with the same name, then the first one found will be returned.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_propertylist_get_property_const().

const cpl_property* cpl_propertylist_get_property_const ( const cpl_propertylist self,
const char *  name 
)

Access property list elements by property name.

Parameters
selfThe property list to query.
nameThe name of the property to retrieve.
Returns
The function returns the property with name name, or NULL if it does not exist.
Errors
CPL_ERROR_NULL_INPUT The parameter self or the name is a NULL pointer.

The function returns a handle to the property list element, the property, with the name name. If more than one property exist with the same name, then the first one found will be returned.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_propertylist_get_property().

cpl_size cpl_propertylist_get_size ( const cpl_propertylist self)

Get the current size of a property list.

Parameters
selfA property list.
Returns
The property list's current size, or 0 if the list is empty. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function reports the current number of elements stored in the property list self.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_propertylist_dump(), cpl_table_sort(), cpl_wcs_new_from_propertylist(), and cpl_wcs_platesol().

const char* cpl_propertylist_get_string ( const cpl_propertylist self,
const char *  name 
)

Get the string value of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
A handle to the string value stored in the list entry. The function returns NULL if an error occurs and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.
CPL_ERROR_TYPE_MISMATCH The sought-after property name is not of type CPL_TYPE_STRING.

The function searches the property list self for a property named name. If it is present in the list, a handle to its string value is returned. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_property_get_string().

Referenced by cpl_dfs_setup_product_header().

cpl_type cpl_propertylist_get_type ( const cpl_propertylist self,
const char *  name 
)

Get the the type of a property list entry.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The type of the stored value. If an error occurs the function returns CPL_TYPE_INVALID and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function returns the type of the value stored in self with the name name. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_property_get_type(), and CPL_TYPE_INVALID.

Referenced by cpl_dfs_setup_product_header().

int cpl_propertylist_has ( const cpl_propertylist self,
const char *  name 
)

Check whether a property is present in a property list.

Parameters
selfA property list.
nameThe property name to look up.
Returns
The function returns 1 if the property is present, or 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the property list self for a property with the name name and reports whether it was found or not.

References CPL_ERROR_NULL_INPUT.

Referenced by cpl_dfs_setup_product_header(), and cpl_wcs_new_from_propertylist().

cpl_error_code cpl_propertylist_insert_after_bool ( cpl_propertylist self,
const char *  after,
const char *  name,
int  value 
)

Insert a boolean value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new boolean property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_BOOL.

cpl_error_code cpl_propertylist_insert_after_char ( cpl_propertylist self,
const char *  after,
const char *  name,
char  value 
)

Insert a character value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new character property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_CHAR.

cpl_error_code cpl_propertylist_insert_after_double ( cpl_propertylist self,
const char *  after,
const char *  name,
double  value 
)

Insert a double value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new double property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_DOUBLE.

cpl_error_code cpl_propertylist_insert_after_double_complex ( cpl_propertylist self,
const char *  after,
const char *  name,
double complex  value 
)

Insert a double complex value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe double complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new double complex property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_DOUBLE_COMPLEX.

cpl_error_code cpl_propertylist_insert_after_float ( cpl_propertylist self,
const char *  after,
const char *  name,
float  value 
)

Insert a float value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new float property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_FLOAT.

cpl_error_code cpl_propertylist_insert_after_float_complex ( cpl_propertylist self,
const char *  after,
const char *  name,
float complex  value 
)

Insert a float complex value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe float complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new float complex property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_propertylist_insert_after_int ( cpl_propertylist self,
const char *  after,
const char *  name,
int  value 
)

Insert a integer value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new integer property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_INT.

cpl_error_code cpl_propertylist_insert_after_long ( cpl_propertylist self,
const char *  after,
const char *  name,
long  value 
)

Insert a long value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new long property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_LONG.

cpl_error_code cpl_propertylist_insert_after_long_long ( cpl_propertylist self,
const char *  after,
const char *  name,
long long  value 
)

Insert a long long value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe long long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new long long property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_LONG_LONG.

cpl_error_code cpl_propertylist_insert_after_property ( cpl_propertylist self,
const char *  after,
const cpl_property property 
)

Insert a property into a property list after the given position.

Parameters
selfProperty list
afterName of the property after which to insert the property
propertyThe property to insert
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, property or after is a NULL pointer.

The function creates a new property and inserts it into the property list self after the position of the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and cpl_property_duplicate().

Referenced by cpl_wcs_platesol().

cpl_error_code cpl_propertylist_insert_after_string ( cpl_propertylist self,
const char *  after,
const char *  name,
const char *  value 
)

Insert a string value into a property list after the given position.

Parameters
selfA property list.
afterName of the property after which the value is inserted.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, after, name or value or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new string property with name name and value value. The property is inserted into the property list self after the property named after.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_STRING.

cpl_error_code cpl_propertylist_insert_bool ( cpl_propertylist self,
const char *  here,
const char *  name,
int  value 
)

Insert a boolean value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new boolean property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_BOOL.

cpl_error_code cpl_propertylist_insert_char ( cpl_propertylist self,
const char *  here,
const char *  name,
char  value 
)

Insert a character value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new character property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_CHAR.

cpl_error_code cpl_propertylist_insert_double ( cpl_propertylist self,
const char *  here,
const char *  name,
double  value 
)

Insert a double value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new double property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_DOUBLE.

cpl_error_code cpl_propertylist_insert_double_complex ( cpl_propertylist self,
const char *  here,
const char *  name,
double complex  value 
)

Insert a double complex value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe double complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new double complex property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_DOUBLE_COMPLEX.

cpl_error_code cpl_propertylist_insert_float ( cpl_propertylist self,
const char *  here,
const char *  name,
float  value 
)

Insert a float value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new float property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_FLOAT.

cpl_error_code cpl_propertylist_insert_float_complex ( cpl_propertylist self,
const char *  here,
const char *  name,
float complex  value 
)

Insert a float complex value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe float complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new float complex property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_propertylist_insert_int ( cpl_propertylist self,
const char *  here,
const char *  name,
int  value 
)

Insert a integer value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new integer property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_INT.

cpl_error_code cpl_propertylist_insert_long ( cpl_propertylist self,
const char *  here,
const char *  name,
long  value 
)

Insert a long value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new long property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_LONG.

cpl_error_code cpl_propertylist_insert_long_long ( cpl_propertylist self,
const char *  here,
const char *  name,
long long  value 
)

Insert a long long value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe long long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new long long property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_LONG_LONG.

cpl_error_code cpl_propertylist_insert_property ( cpl_propertylist self,
const char *  here,
const cpl_property property 
)

Insert a property into a property list at the given position.

Parameters
selfProperty list
hereName indicating the position where to insert the property
propertyThe property to insert
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, property or here is a NULL pointer.

The function creates a new property and inserts it into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and cpl_property_duplicate().

cpl_error_code cpl_propertylist_insert_string ( cpl_propertylist self,
const char *  here,
const char *  name,
const char *  value 
)

Insert a string value into a property list at the given position.

Parameters
selfA property list.
hereName indicating the position at which the value is inserted.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, here, name or value or name is a NULL pointer.
CPL_ERROR_UNSPECIFIED A property with the name name could not be inserted into self.

The function creates a new string property with name name and value value. The property is inserted into the property list self at the position of the property named here.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, and CPL_TYPE_STRING.

int cpl_propertylist_is_empty ( const cpl_propertylist self)

Check whether a property list is empty.

Parameters
selfA property list.
Returns
The function returns 1 if the list is empty, and 0 otherwise. In case an error occurs the function returns -1 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function checks if self contains any properties.

References CPL_ERROR_NULL_INPUT.

cpl_propertylist* cpl_propertylist_load ( const char *  name,
cpl_size  position 
)

Create a property list from a file.

Parameters
nameName of the input file.
positionIndex of the data set to read.
Returns
The function returns the newly created property list or NULL if an error occurred.
Errors
CPL_ERROR_NULL_INPUT The parameter name is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The position is less than 0 or the properties cannot be read from the file name.
CPL_ERROR_FILE_IO The file name does not exist.
CPL_ERROR_BAD_FILE_FORMAT The file name is not a valid FITS file.
CPL_ERROR_DATA_NOT_FOUND The requested data set at index position does not exist.

The function reads the properties of the data set with index position from the file name.

Currently only the FITS file format is supported. The property list is created by reading the FITS keywords from extension position. The numbering of the data sections starts from 0. When creating the property list from a FITS header, any keyword without a value such as undefined keywords, are not transformed into a property. In the case of float or double (complex) keywords, there is no way to identify the type returned by CFITSIO, therefore this function will always load them as double (complex).

See also
cpl_propertylist_load_regexp()

References CPL_ERROR_BAD_FILE_FORMAT, CPL_ERROR_FILE_IO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_propertylist_delete(), and cpl_propertylist_new().

cpl_propertylist* cpl_propertylist_load_regexp ( const char *  name,
cpl_size  position,
const char *  regexp,
int  invert 
)

Create a filtered property list from a file.

Parameters
nameName of the input file.
positionIndex of the data set to read.
regexpRegular expression used to filter properties.
invertFlag inverting the sense of matching property names.
Returns
The function returns the newly created property list or NULL if an error occurred.
Errors
CPL_ERROR_NULL_INPUT The parameter name or the parameter regexp is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The position is less than 0, the properties cannot be read from the file name, or regexp is not a valid extended regular expression.
CPL_ERROR_FILE_IO The file name does not exist.
CPL_ERROR_BAD_FILE_FORMAT The file name is not a valid FITS file.
CPL_ERROR_DATA_NOT_FOUND The requested data set at index position does not exist.

The function reads all properties of the data set with index position with matching names from the file name. If the flag invert is zero, all properties whose names match the regular expression regexp are read. If invert is set to a non-zero value, all properties with names not matching regexp are read rather. The function expects POSIX 1003.2 compliant extended regular expressions.

Currently only the FITS file format is supported. The property list is created by reading the FITS keywords from extension position. The numbering of the data sections starts from 0.

When creating the property list from a FITS header, any keyword without a value such as undefined keywords, are not transformed into a property. In the case of float or double (complex) keywords, there is no way to identify the type returned by CFITSIO, therefore this function will always load them as double (complex).

FITS format specific keyword prefixes (e.g. HIERARCH) must not be part of the given pattern string regexp, but only the actual FITS keyword name may be given.

See also
cpl_propertylist_load()

References CPL_ERROR_BAD_FILE_FORMAT, CPL_ERROR_FILE_IO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_propertylist_delete(), and cpl_propertylist_new().

Referenced by cpl_dfs_setup_product_header().

cpl_propertylist* cpl_propertylist_new ( void  )

Create an empty property list.

Returns
The newly created property list.

The function creates a new property list and returns a handle for it. To destroy the returned property list object use the property list destructor cpl_propertylist_delete().

See also
cpl_propertylist_delete()

Referenced by cpl_dfs_setup_product_header(), cpl_propertylist_duplicate(), cpl_propertylist_load(), cpl_propertylist_load_regexp(), cpl_wcs_new_from_propertylist(), and cpl_wcs_platesol().

cpl_error_code cpl_propertylist_prepend_bool ( cpl_propertylist self,
const char *  name,
int  value 
)

Prepend a boolean value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new boolean property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_bool(), and CPL_TYPE_BOOL.

cpl_error_code cpl_propertylist_prepend_char ( cpl_propertylist self,
const char *  name,
char  value 
)

Prepend a character value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new character property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_char(), and CPL_TYPE_CHAR.

cpl_error_code cpl_propertylist_prepend_double ( cpl_propertylist self,
const char *  name,
double  value 
)

Prepend a double value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new double property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_double(), and CPL_TYPE_DOUBLE.

cpl_error_code cpl_propertylist_prepend_double_complex ( cpl_propertylist self,
const char *  name,
double complex  value 
)

Prepend a double complex value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new double complex property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_double_complex(), and CPL_TYPE_DOUBLE_COMPLEX.

cpl_error_code cpl_propertylist_prepend_float ( cpl_propertylist self,
const char *  name,
float  value 
)

Prepend a float value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new float property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_float(), and CPL_TYPE_FLOAT.

cpl_error_code cpl_propertylist_prepend_float_complex ( cpl_propertylist self,
const char *  name,
float complex  value 
)

Prepend a float complex value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new float complex property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_float_complex(), and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_propertylist_prepend_int ( cpl_propertylist self,
const char *  name,
int  value 
)

Prepend a integer value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new integer property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_int(), and CPL_TYPE_INT.

cpl_error_code cpl_propertylist_prepend_long ( cpl_propertylist self,
const char *  name,
long  value 
)

Prepend a long value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new long property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_long(), and CPL_TYPE_LONG.

cpl_error_code cpl_propertylist_prepend_long_long ( cpl_propertylist self,
const char *  name,
long long  value 
)

Prepend a long long value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function creates a new long long property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_long_long(), and CPL_TYPE_LONG_LONG.

cpl_error_code cpl_propertylist_prepend_property ( cpl_propertylist self,
const cpl_property property 
)

Prepend a property to a property list.

Parameters
selfProperty list to prepend to
propertyThe property to prepend
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or property is a NULL pointer.

This function creates a new property and prepends it to the beginning of a property list. It will not check if the property already exists.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_property_duplicate().

cpl_error_code cpl_propertylist_prepend_string ( cpl_propertylist self,
const char *  name,
const char *  value 
)

Prepend a string value to a property list.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, name or value is a NULL pointer.

The function creates a new string property with name name and value value. The property is prepended to the property list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_string(), and CPL_TYPE_STRING.

cpl_error_code cpl_propertylist_save ( const cpl_propertylist self,
const char *  filename,
unsigned  mode 
)

Save a property list to a FITS file.

Parameters
selfThe property list to save or NULL if empty
filenameName of the file to write
modeThe desired output options (combined with bitwise or)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
Errors
CPL_ERROR_NULL_INPUT The filename is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter mode is invalid.
CPL_ERROR_FILE_IO The file cannot be written or accessed.

This function saves a property list to a FITS file, using cfitsio. The data unit is empty.

Supported output modes are CPL_IO_CREATE (create a new file) and CPL_IO_EXTEND (append to an existing file)

References cpl_ensure_code, CPL_ERROR_FILE_IO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), CPL_IO_CREATE, CPL_IO_EXTEND, and cpl_sprintf().

Referenced by cpl_image_save(), and cpl_vector_save().

cpl_error_code cpl_propertylist_set_bool ( cpl_propertylist self,
const char *  name,
int  value 
)

Set the value of the given boolean property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew boolean value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its boolean value is replaced with the boolean value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_set_bool().

cpl_error_code cpl_propertylist_set_char ( cpl_propertylist self,
const char *  name,
char  value 
)

Set the value of the given character property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew character value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its character value is replaced with the character value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_set_char().

cpl_error_code cpl_propertylist_set_comment ( cpl_propertylist self,
const char *  name,
const char *  comment 
)

Modify the comment field of the given property list entry.

Parameters
selfA property list.
nameThe property name to look up.
commentNew comment string.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its comment is replaced by the string comment. The provided comment string may be NULL. In this case an already existing comment is deleted. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_property_set_comment().

Referenced by cpl_dfs_setup_product_header().

cpl_error_code cpl_propertylist_set_double ( cpl_propertylist self,
const char *  name,
double  value 
)

Set the value of the given double property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew double value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its double value is replaced with the double value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_set_double().

cpl_error_code cpl_propertylist_set_double_complex ( cpl_propertylist self,
const char *  name,
double complex  value 
)

Set the value of the given double complex property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew double complex value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its double complex value is replaced with the double complex value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_property_set_double_complex().

cpl_error_code cpl_propertylist_set_float ( cpl_propertylist self,
const char *  name,
float  value 
)

Set the value of the given float property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew float value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its float value is replaced with the float value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_set_float().

cpl_error_code cpl_propertylist_set_float_complex ( cpl_propertylist self,
const char *  name,
float complex  value 
)

Set the value of the given float complex property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew float complex value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its float complex value is replaced with the float complex value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_property_set_float_complex().

cpl_error_code cpl_propertylist_set_int ( cpl_propertylist self,
const char *  name,
int  value 
)

Set the value of the given integer property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew integer value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its integer value is replaced with the integer value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_set_int().

cpl_error_code cpl_propertylist_set_long ( cpl_propertylist self,
const char *  name,
long  value 
)

Set the value of the given long property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew long value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its long value is replaced with the long value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_set_long().

cpl_error_code cpl_propertylist_set_long_long ( cpl_propertylist self,
const char *  name,
long long  value 
)

Set the value of the given long long property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew long long value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its long long value is replaced with value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_set_long_long().

cpl_error_code cpl_propertylist_set_string ( cpl_propertylist self,
const char *  name,
const char *  value 
)

Set the value of the given string property list entry.

Parameters
selfA property list.
nameThe property name to look up.
valueNew string value.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, name or value is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its string value is replaced with the string value. If there is more than one property with the same name, it takes the first one from the list.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_property_set_string().

cpl_error_code cpl_propertylist_sort ( cpl_propertylist self,
cpl_propertylist_compare_func  compare 
)

Sort a property list.

Parameters
selfThe property list to sort.
compareThe function used to compare two properties.
Returns
The function returns CPL_ERROR_NONE on success, or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function sorts the property list self in place, using the function compare to determine whether a property is less, equal or greater than another one.

The function compare must be of the type cpl_propertylist_compare_func.

See also
cpl_propertylist_compare_func

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_propertylist_update_bool ( cpl_propertylist self,
const char *  name,
int  value 
)

Update a property list with a boolean value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe boolean value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_BOOL.

The function updates the property list self with the boolean value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_BOOL.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_property_get_type(), cpl_property_new(), cpl_property_set_bool(), and CPL_TYPE_BOOL.

Referenced by cpl_dfs_setup_product_header().

cpl_error_code cpl_propertylist_update_char ( cpl_propertylist self,
const char *  name,
char  value 
)

Update a property list with a character value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe character value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_CHAR.

The function updates the property list self with the character value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_CHAR.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_property_get_type(), cpl_property_new(), cpl_property_set_char(), and CPL_TYPE_CHAR.

cpl_error_code cpl_propertylist_update_double ( cpl_propertylist self,
const char *  name,
double  value 
)

Update a property list with a double value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_DOUBLE.

The function updates the property list self with the double value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_DOUBLE.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_property_get_type(), cpl_property_new(), cpl_property_set_double(), and CPL_TYPE_DOUBLE.

cpl_error_code cpl_propertylist_update_double_complex ( cpl_propertylist self,
const char *  name,
double complex  value 
)

Update a property list with a double complex value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe double complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_DOUBLE_COMPLEX.

The function updates the property list self with the double complex value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_DOUBLE_COMPLEX.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_double_complex(), and CPL_TYPE_DOUBLE_COMPLEX.

cpl_error_code cpl_propertylist_update_float ( cpl_propertylist self,
const char *  name,
float  value 
)

Update a property list with a float value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_FLOAT.

The function updates the property list self with the float value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_FLOAT.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_property_get_type(), cpl_property_new(), cpl_property_set_float(), and CPL_TYPE_FLOAT.

cpl_error_code cpl_propertylist_update_float_complex ( cpl_propertylist self,
const char *  name,
float complex  value 
)

Update a property list with a float complex value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe float complex value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_FLOAT_COMPLEX.

The function updates the property list self with the float complex value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_FLOAT_COMPLEX.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_property_new(), cpl_property_set_float_complex(), and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_propertylist_update_int ( cpl_propertylist self,
const char *  name,
int  value 
)

Update a property list with a integer value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe integer value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_INT.

The function updates the property list self with the integer value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_INT.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_property_get_type(), cpl_property_new(), cpl_property_set_int(), and CPL_TYPE_INT.

Referenced by cpl_dfs_setup_product_header().

cpl_error_code cpl_propertylist_update_long ( cpl_propertylist self,
const char *  name,
long  value 
)

Update a property list with a long value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_LONG.

The function updates the property list self with the long value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_LONG.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_property_get_type(), cpl_property_new(), cpl_property_set_long(), and CPL_TYPE_LONG.

cpl_error_code cpl_propertylist_update_long_long ( cpl_propertylist self,
const char *  name,
long long  value 
)

Update a property list with a long long value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe long long value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_LONG_LONG.

The function updates the property list self with the long long value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_LONG_LONG.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_property_get_type(), cpl_property_new(), cpl_property_set_long_long(), and CPL_TYPE_LONG_LONG.

cpl_error_code cpl_propertylist_update_string ( cpl_propertylist self,
const char *  name,
const char *  value 
)

Update a property list with a string value.

Parameters
selfA property list.
nameThe property name to be assigned to the value.
valueThe string value to store.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self, name or value is a NULL pointer.
CPL_ERROR_TYPE_MISMATCH The property list self contains a property with the name name which is not of type CPL_TYPE_STRING.

The function updates the property list self with the string value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_STRING.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_property_get_type(), cpl_property_new(), cpl_property_set_string(), and CPL_TYPE_STRING.

Referenced by cpl_dfs_setup_product_header().

cpl-6.6.1/html/group__cpl__table.html0000644000460300003120000255545612553662432014543 00000000000000 Common Pipeline Library Reference Manual: Tables
Common Pipeline Library Reference Manual  6.6.1
Tables

Functions

cpl_error_code cpl_table_abs_column (cpl_table *table, const char *name)
 Compute the absolute value of column values. More...
 
cpl_error_code cpl_table_add_columns (cpl_table *table, const char *to_name, const char *from_name)
 Add the values of two numeric or complex table columns. More...
 
cpl_error_code cpl_table_add_scalar (cpl_table *table, const char *name, double value)
 Add a constant value to a numerical or complex column. More...
 
cpl_error_code cpl_table_add_scalar_complex (cpl_table *table, const char *name, double complex value)
 Add a constant complex value to a numerical or complex column. More...
 
cpl_size cpl_table_and_selected (cpl_table *table, const char *name1, cpl_table_select_operator operator, const char *name2)
 Select from selected table rows, by comparing the values of two numerical columns. More...
 
cpl_size cpl_table_and_selected_double (cpl_table *table, const char *name, cpl_table_select_operator operator, double value)
 Select from selected table rows, by comparing double column values with a constant. More...
 
cpl_size cpl_table_and_selected_double_complex (cpl_table *table, const char *name, cpl_table_select_operator operator, double complex value)
 Select from selected table rows, by comparing double complex column values with a complex constant. More...
 
cpl_size cpl_table_and_selected_float (cpl_table *table, const char *name, cpl_table_select_operator operator, float value)
 Select from selected table rows, by comparing float column values with a constant. More...
 
cpl_size cpl_table_and_selected_float_complex (cpl_table *table, const char *name, cpl_table_select_operator operator, float complex value)
 Select from selected table rows, by comparing float complex column values with a complex constant. More...
 
cpl_size cpl_table_and_selected_int (cpl_table *table, const char *name, cpl_table_select_operator operator, int value)
 Select from selected table rows, by comparing integer column values with a constant. More...
 
cpl_size cpl_table_and_selected_invalid (cpl_table *table, const char *name)
 Select from selected table rows all rows with an invalid value in a specified column. More...
 
cpl_size cpl_table_and_selected_long (cpl_table *table, const char *name, cpl_table_select_operator operator, long value)
 Select from selected table rows, by comparing long column values with a constant. More...
 
cpl_size cpl_table_and_selected_long_long (cpl_table *table, const char *name, cpl_table_select_operator operator, long long value)
 Select from selected table rows, by comparing long long column values with a constant. More...
 
cpl_size cpl_table_and_selected_string (cpl_table *table, const char *name, cpl_table_select_operator operator, const char *string)
 Select from selected table rows, by comparing string column values with a character string. More...
 
cpl_size cpl_table_and_selected_window (cpl_table *table, cpl_size start, cpl_size count)
 Select from selected rows only those within a table segment. More...
 
cpl_error_code cpl_table_arg_column (cpl_table *table, const char *name)
 Compute the phase angle value of table column elements. More...
 
cpl_error_code cpl_table_cast_column (cpl_table *table, const char *from_name, const char *to_name, cpl_type type)
 Cast a numeric or complex column to a new numeric or complex type column. More...
 
int cpl_table_compare_structure (const cpl_table *table1, const cpl_table *table2)
 Compare the structure of two tables. More...
 
cpl_error_code cpl_table_conjugate_column (cpl_table *table, const char *name)
 Compute the complex conjugate of column values. More...
 
cpl_error_code cpl_table_copy_data_double (cpl_table *table, const char *name, const double *data)
 Copy existing data to a table double column. More...
 
cpl_error_code cpl_table_copy_data_double_complex (cpl_table *table, const char *name, const double complex *data)
 Copy existing data to a table double complex column. More...
 
cpl_error_code cpl_table_copy_data_float (cpl_table *table, const char *name, const float *data)
 Copy existing data to a table float column. More...
 
cpl_error_code cpl_table_copy_data_float_complex (cpl_table *table, const char *name, const float complex *data)
 Copy existing data to a table float complex column. More...
 
cpl_error_code cpl_table_copy_data_int (cpl_table *table, const char *name, const int *data)
 Copy existing data to a table integer column. More...
 
cpl_error_code cpl_table_copy_data_long (cpl_table *table, const char *name, const long *data)
 Copy existing data to a table long column. More...
 
cpl_error_code cpl_table_copy_data_long_long (cpl_table *table, const char *name, const long long *data)
 Copy existing data to a table long long column. More...
 
cpl_error_code cpl_table_copy_data_string (cpl_table *table, const char *name, const char **data)
 Copy existing data to a table string column. More...
 
cpl_error_code cpl_table_copy_structure (cpl_table *table, const cpl_table *mtable)
 Give to a table the same structure of another table. More...
 
cpl_size cpl_table_count_invalid (const cpl_table *table, const char *name)
 Count number of invalid values in a table column. More...
 
cpl_size cpl_table_count_selected (const cpl_table *table)
 Get number of selected rows in given table. More...
 
void cpl_table_delete (cpl_table *table)
 Delete a table. More...
 
cpl_error_code cpl_table_divide_columns (cpl_table *table, const char *to_name, const char *from_name)
 Divide two numeric or complex table columns. More...
 
cpl_error_code cpl_table_divide_scalar (cpl_table *table, const char *name, double value)
 Divide a numerical or complex column by a constant. More...
 
cpl_error_code cpl_table_divide_scalar_complex (cpl_table *table, const char *name, double complex value)
 Divide a numerical or complex column by a complex constant. More...
 
void cpl_table_dump (const cpl_table *table, cpl_size start, cpl_size count, FILE *stream)
 Print a table. More...
 
void cpl_table_dump_structure (const cpl_table *table, FILE *stream)
 Describe the structure and the contents of a table. More...
 
cpl_table * cpl_table_duplicate (const cpl_table *table)
 Make a copy of a table. More...
 
cpl_error_code cpl_table_duplicate_column (cpl_table *to_table, const char *to_name, const cpl_table *from_table, const char *from_name)
 Copy a column from a table to another. More...
 
cpl_error_code cpl_table_erase_column (cpl_table *table, const char *name)
 Delete a column from a table. More...
 
cpl_error_code cpl_table_erase_invalid (cpl_table *table)
 Remove from a table all columns just containing invalid elements, and then all rows containing at least one invalid element. More...
 
cpl_error_code cpl_table_erase_invalid_rows (cpl_table *table)
 Remove from a table columns and rows just containing invalid elements. More...
 
cpl_error_code cpl_table_erase_selected (cpl_table *table)
 Delete the selected rows of a table. More...
 
cpl_error_code cpl_table_erase_window (cpl_table *table, cpl_size start, cpl_size count)
 Delete a table segment. More...
 
cpl_error_code cpl_table_exponential_column (cpl_table *table, const char *name, double base)
 Compute the exponential of column values. More...
 
cpl_table * cpl_table_extract (const cpl_table *table, cpl_size start, cpl_size count)
 Create a table from a section of another table. More...
 
cpl_table * cpl_table_extract_selected (const cpl_table *table)
 Create a new table from the selected rows of another table. More...
 
cpl_error_code cpl_table_fill_column_window (cpl_table *table, const char *name, cpl_size start, cpl_size count, double value)
 Write a value to a numerical column segment. More...
 
cpl_error_code cpl_table_fill_column_window_array (cpl_table *table, const char *name, cpl_size start, cpl_size count, const cpl_array *array)
 Write an array to an array column segment. More...
 
cpl_error_code cpl_table_fill_column_window_complex (cpl_table *table, const char *name, cpl_size start, cpl_size count, double complex value)
 Write a value to a complex column segment. More...
 
cpl_error_code cpl_table_fill_column_window_double (cpl_table *table, const char *name, cpl_size start, cpl_size count, double value)
 Write a value to a double column segment. More...
 
cpl_error_code cpl_table_fill_column_window_double_complex (cpl_table *table, const char *name, cpl_size start, cpl_size count, double complex value)
 Write a value to a double complex column segment. More...
 
cpl_error_code cpl_table_fill_column_window_float (cpl_table *table, const char *name, cpl_size start, cpl_size count, float value)
 Write a value to a float column segment. More...
 
cpl_error_code cpl_table_fill_column_window_float_complex (cpl_table *table, const char *name, cpl_size start, cpl_size count, float complex value)
 Write a value to a float complex column segment. More...
 
cpl_error_code cpl_table_fill_column_window_int (cpl_table *table, const char *name, cpl_size start, cpl_size count, int value)
 Write a value to an integer column segment. More...
 
cpl_error_code cpl_table_fill_column_window_long (cpl_table *table, const char *name, cpl_size start, cpl_size count, long value)
 Write a value to an long column segment. More...
 
cpl_error_code cpl_table_fill_column_window_long_long (cpl_table *table, const char *name, cpl_size start, cpl_size count, long long value)
 Write a value to an long long column segment. More...
 
cpl_error_code cpl_table_fill_column_window_string (cpl_table *table, const char *name, cpl_size start, cpl_size count, const char *value)
 Write a character string to a string column segment. More...
 
cpl_error_code cpl_table_fill_invalid_double (cpl_table *table, const char *name, double code)
 Write to invalid double column elements a numeric code. More...
 
cpl_error_code cpl_table_fill_invalid_double_complex (cpl_table *table, const char *name, double complex code)
 Write to invalid double complex column elements a numeric code. More...
 
cpl_error_code cpl_table_fill_invalid_float (cpl_table *table, const char *name, float code)
 Write to invalid float column elements a numeric code. More...
 
cpl_error_code cpl_table_fill_invalid_float_complex (cpl_table *table, const char *name, float complex code)
 Write to invalid float complex column elements a numeric code. More...
 
cpl_error_code cpl_table_fill_invalid_int (cpl_table *table, const char *name, int code)
 Write to invalid integer column elements a numeric code. More...
 
cpl_error_code cpl_table_fill_invalid_long (cpl_table *table, const char *name, long code)
 Write to invalid long column elements a numeric code. More...
 
cpl_error_code cpl_table_fill_invalid_long_long (cpl_table *table, const char *name, long long code)
 Write to invalid long long column elements a numeric code. More...
 
double cpl_table_get (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from a numerical column. More...
 
const cpl_array * cpl_table_get_array (const cpl_table *table, const char *name, cpl_size row)
 Read an array from an array column. More...
 
cpl_size cpl_table_get_column_depth (const cpl_table *table, const char *name)
 Get the depth of a table column. More...
 
cpl_size cpl_table_get_column_dimension (const cpl_table *table, const char *name, cpl_size indx)
 Get size of one dimension of a table column of arrays. More...
 
cpl_size cpl_table_get_column_dimensions (const cpl_table *table, const char *name)
 Get the number of dimensions of a table column of arrays. More...
 
const char * cpl_table_get_column_format (const cpl_table *table, const char *name)
 Get the format of a table column. More...
 
double cpl_table_get_column_max (const cpl_table *table, const char *name)
 Get maximum value in a numerical column. More...
 
cpl_error_code cpl_table_get_column_maxpos (const cpl_table *table, const char *name, cpl_size *row)
 Get position of maximum in a numerical column. More...
 
double cpl_table_get_column_mean (const cpl_table *table, const char *name)
 Compute the mean value of a numerical column. More...
 
double complex cpl_table_get_column_mean_complex (const cpl_table *table, const char *name)
 Compute the mean value of a numerical or complex column. More...
 
double cpl_table_get_column_median (const cpl_table *table, const char *name)
 Compute the median value of a numerical column. More...
 
double cpl_table_get_column_min (const cpl_table *table, const char *name)
 Get minimum value in a numerical column. More...
 
cpl_error_code cpl_table_get_column_minpos (const cpl_table *table, const char *name, cpl_size *row)
 Get position of minimum in a numerical column. More...
 
const char * cpl_table_get_column_name (const cpl_table *table)
 Get table columns names. More...
 
cpl_array * cpl_table_get_column_names (const cpl_table *table)
 Get table columns names. More...
 
double cpl_table_get_column_stdev (const cpl_table *table, const char *name)
 Find the standard deviation of a table column. More...
 
cpl_type cpl_table_get_column_type (const cpl_table *table, const char *name)
 Get the type of a table column. More...
 
const char * cpl_table_get_column_unit (const cpl_table *table, const char *name)
 Get the unit of a table column. More...
 
double complex cpl_table_get_complex (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from a complex column. More...
 
cpl_array ** cpl_table_get_data_array (cpl_table *table, const char *name)
 Get a pointer to array column data. More...
 
const cpl_array ** cpl_table_get_data_array_const (const cpl_table *table, const char *name)
 Get a pointer to array column data. More...
 
double * cpl_table_get_data_double (cpl_table *table, const char *name)
 Get a pointer to double column data. More...
 
double complex * cpl_table_get_data_double_complex (cpl_table *table, const char *name)
 Get a pointer to double complex column data. More...
 
const double complex * cpl_table_get_data_double_complex_const (const cpl_table *table, const char *name)
 Get a pointer to constant double complex column data. More...
 
const double * cpl_table_get_data_double_const (const cpl_table *table, const char *name)
 Get a pointer to constant double column data. More...
 
float * cpl_table_get_data_float (cpl_table *table, const char *name)
 Get a pointer to float column data. More...
 
float complex * cpl_table_get_data_float_complex (cpl_table *table, const char *name)
 Get a pointer to float complex column data. More...
 
const float complex * cpl_table_get_data_float_complex_const (const cpl_table *table, const char *name)
 Get a pointer to constant float complex column data. More...
 
const float * cpl_table_get_data_float_const (const cpl_table *table, const char *name)
 Get a pointer to constant float column data. More...
 
int * cpl_table_get_data_int (cpl_table *table, const char *name)
 Get a pointer to integer column data. More...
 
const int * cpl_table_get_data_int_const (const cpl_table *table, const char *name)
 Get a pointer to constant integer column data. More...
 
long * cpl_table_get_data_long (cpl_table *table, const char *name)
 Get a pointer to long column data. More...
 
const long * cpl_table_get_data_long_const (const cpl_table *table, const char *name)
 Get a pointer to constant long column data. More...
 
long long * cpl_table_get_data_long_long (cpl_table *table, const char *name)
 Get a pointer to long long column data. More...
 
const long long * cpl_table_get_data_long_long_const (const cpl_table *table, const char *name)
 Get a pointer to constant long long column data. More...
 
char ** cpl_table_get_data_string (cpl_table *table, const char *name)
 Get a pointer to string column data. More...
 
const char ** cpl_table_get_data_string_const (const cpl_table *table, const char *name)
 Get a pointer to constant string column data. More...
 
double cpl_table_get_double (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from a double column. More...
 
double complex cpl_table_get_double_complex (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from a double complex column. More...
 
float cpl_table_get_float (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from a float column. More...
 
float complex cpl_table_get_float_complex (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from a float complex column. More...
 
int cpl_table_get_int (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from an integer column. More...
 
long cpl_table_get_long (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from a long column. More...
 
long long cpl_table_get_long_long (const cpl_table *table, const char *name, cpl_size row, int *null)
 Read a value from a long long column. More...
 
cpl_size cpl_table_get_ncol (const cpl_table *table)
 Get the number of columns in a table. More...
 
cpl_size cpl_table_get_nrow (const cpl_table *table)
 Get the number of rows in a table. More...
 
const char * cpl_table_get_string (const cpl_table *table, const char *name, cpl_size row)
 Read a value from a string column. More...
 
int cpl_table_has_column (const cpl_table *table, const char *name)
 Check if a column with a given name exists. More...
 
int cpl_table_has_invalid (const cpl_table *table, const char *name)
 Check if a column contains at least one invalid value. More...
 
int cpl_table_has_valid (const cpl_table *table, const char *name)
 Check if a column contains at least one valid value. More...
 
cpl_error_code cpl_table_imag_column (cpl_table *table, const char *name)
 Compute the imaginary part value of table column elements. More...
 
cpl_error_code cpl_table_insert (cpl_table *target_table, const cpl_table *insert_table, cpl_size row)
 Merge two tables. More...
 
cpl_error_code cpl_table_insert_window (cpl_table *table, cpl_size start, cpl_size count)
 Insert a segment of rows into table data. More...
 
int cpl_table_is_selected (const cpl_table *table, cpl_size row)
 Determine whether a table row is selected or not. More...
 
int cpl_table_is_valid (const cpl_table *table, const char *name, cpl_size row)
 Check if a column element is valid. More...
 
cpl_table * cpl_table_load (const char *filename, int xtnum, int check_nulls)
 Load a FITS table extension into a new cpl_table. More...
 
cpl_table * cpl_table_load_window (const char *filename, int xtnum, int check_nulls, const cpl_array *selcol, cpl_size firstrow, cpl_size nrow)
 Load part of a FITS table extension into a new cpl_table. More...
 
cpl_error_code cpl_table_logarithm_column (cpl_table *table, const char *name, double base)
 Compute the logarithm of column values. More...
 
cpl_error_code cpl_table_move_column (cpl_table *to_table, const char *name, cpl_table *from_table)
 Move a column from a table to another. More...
 
cpl_error_code cpl_table_multiply_columns (cpl_table *table, const char *to_name, const char *from_name)
 Multiply two numeric or complex table columns. More...
 
cpl_error_code cpl_table_multiply_scalar (cpl_table *table, const char *name, double value)
 Multiply a numerical or complex column by a constant. More...
 
cpl_error_code cpl_table_multiply_scalar_complex (cpl_table *table, const char *name, double complex value)
 Multiply a numerical or complex column by a complex constant. More...
 
cpl_error_code cpl_table_name_column (cpl_table *table, const char *from_name, const char *to_name)
 Rename a table column. More...
 
cpl_table * cpl_table_new (cpl_size length)
 Create an empty table structure. More...
 
cpl_error_code cpl_table_new_column (cpl_table *table, const char *name, cpl_type type)
 Create an empty column in a table. More...
 
cpl_error_code cpl_table_new_column_array (cpl_table *table, const char *name, cpl_type type, cpl_size depth)
 Create an empty column of arrays in a table. More...
 
cpl_size cpl_table_not_selected (cpl_table *table)
 Select unselected table rows, and unselect selected ones. More...
 
cpl_size cpl_table_or_selected (cpl_table *table, const char *name1, cpl_table_select_operator operator, const char *name2)
 Select from unselected table rows, by comparing the values of two numerical columns. More...
 
cpl_size cpl_table_or_selected_double (cpl_table *table, const char *name, cpl_table_select_operator operator, double value)
 Select from unselected table rows, by comparing double column values with a constant. More...
 
cpl_size cpl_table_or_selected_double_complex (cpl_table *table, const char *name, cpl_table_select_operator operator, double complex value)
 Select from unselected table rows, by comparing double complex column values with a complex constant. More...
 
cpl_size cpl_table_or_selected_float (cpl_table *table, const char *name, cpl_table_select_operator operator, float value)
 Select from unselected table rows, by comparing float column values with a constant. More...
 
cpl_size cpl_table_or_selected_float_complex (cpl_table *table, const char *name, cpl_table_select_operator operator, float complex value)
 Select from unselected table rows, by comparing float complex column values with a complex constant. More...
 
cpl_size cpl_table_or_selected_int (cpl_table *table, const char *name, cpl_table_select_operator operator, int value)
 Select from unselected table rows, by comparing integer column values with a constant. More...
 
cpl_size cpl_table_or_selected_invalid (cpl_table *table, const char *name)
 Select from unselected table rows all rows with an invalid value in a specified column. More...
 
cpl_size cpl_table_or_selected_long (cpl_table *table, const char *name, cpl_table_select_operator operator, long value)
 Select from unselected table rows, by comparing long column values with a constant. More...
 
cpl_size cpl_table_or_selected_long_long (cpl_table *table, const char *name, cpl_table_select_operator operator, long long value)
 Select from unselected table rows, by comparing long long column values with a constant. More...
 
cpl_size cpl_table_or_selected_string (cpl_table *table, const char *name, cpl_table_select_operator operator, const char *string)
 Select from unselected table rows, by comparing column values with a constant. More...
 
cpl_size cpl_table_or_selected_window (cpl_table *table, cpl_size start, cpl_size count)
 Select from unselected rows only those within a table segment. More...
 
cpl_error_code cpl_table_power_column (cpl_table *table, const char *name, double exponent)
 Compute the power of column values. More...
 
cpl_error_code cpl_table_real_column (cpl_table *table, const char *name)
 Compute the real part value of table column elements. More...
 
cpl_error_code cpl_table_save (const cpl_table *table, const cpl_propertylist *pheader, const cpl_propertylist *header, const char *filename, unsigned mode)
 Save a cpl_table to a FITS file. More...
 
cpl_error_code cpl_table_select_all (cpl_table *table)
 Select all table rows. More...
 
cpl_error_code cpl_table_select_row (cpl_table *table, cpl_size row)
 Flag a table row as selected. More...
 
cpl_error_code cpl_table_set (cpl_table *table, const char *name, cpl_size row, double value)
 Write a value to a numerical table column element. More...
 
cpl_error_code cpl_table_set_array (cpl_table *table, const char *name, cpl_size row, const cpl_array *array)
 Write an array to an array table column element. More...
 
cpl_error_code cpl_table_set_column_depth (cpl_table *table, const char *name, cpl_size depth)
 Modify depth of a column of arrays. More...
 
cpl_error_code cpl_table_set_column_dimensions (cpl_table *table, const char *name, const cpl_array *dimensions)
 Set the dimensions of a table column of arrays. More...
 
cpl_error_code cpl_table_set_column_format (cpl_table *table, const char *name, const char *format)
 Give a new format to a table column. More...
 
cpl_error_code cpl_table_set_column_invalid (cpl_table *table, const char *name, cpl_size start, cpl_size count)
 Invalidate a column segment. More...
 
cpl_error_code cpl_table_set_column_unit (cpl_table *table, const char *name, const char *unit)
 Give a new unit to a table column. More...
 
cpl_error_code cpl_table_set_complex (cpl_table *table, const char *name, cpl_size row, double complex value)
 Write a complex value to a complex numerical table column element. More...
 
cpl_error_code cpl_table_set_double (cpl_table *table, const char *name, cpl_size row, double value)
 Write a value to a double table column element. More...
 
cpl_error_code cpl_table_set_double_complex (cpl_table *table, const char *name, cpl_size row, double complex value)
 Write a value to a double complex table column element. More...
 
cpl_error_code cpl_table_set_float (cpl_table *table, const char *name, cpl_size row, float value)
 Write a value to a float table column element. More...
 
cpl_error_code cpl_table_set_float_complex (cpl_table *table, const char *name, cpl_size row, float complex value)
 Write a value to a float complex table column element. More...
 
cpl_error_code cpl_table_set_int (cpl_table *table, const char *name, cpl_size row, int value)
 Write a value to an integer table column element. More...
 
cpl_error_code cpl_table_set_invalid (cpl_table *table, const char *name, cpl_size row)
 Flag a column element as invalid. More...
 
cpl_error_code cpl_table_set_long (cpl_table *table, const char *name, cpl_size row, long value)
 Write a value to an long table column element. More...
 
cpl_error_code cpl_table_set_long_long (cpl_table *table, const char *name, cpl_size row, long long value)
 Write a value to an long long table column element. More...
 
cpl_error_code cpl_table_set_size (cpl_table *table, cpl_size new_length)
 Resize a table to a new number of rows. More...
 
cpl_error_code cpl_table_set_string (cpl_table *table, const char *name, cpl_size row, const char *value)
 Write a character string to a string table column element. More...
 
cpl_error_code cpl_table_shift_column (cpl_table *table, const char *name, cpl_size shift)
 Shift the position of numeric or complex column values. More...
 
cpl_error_code cpl_table_sort (cpl_table *table, const cpl_propertylist *reflist)
 Sort table rows according to columns values. More...
 
cpl_error_code cpl_table_subtract_columns (cpl_table *table, const char *to_name, const char *from_name)
 Subtract two numeric or complex table columns. More...
 
cpl_error_code cpl_table_subtract_scalar (cpl_table *table, const char *name, double value)
 Subtract a constant value from a numerical or complex column. More...
 
cpl_error_code cpl_table_subtract_scalar_complex (cpl_table *table, const char *name, double complex value)
 Subtract a constant complex value from a numerical or complex column. More...
 
cpl_error_code cpl_table_unselect_all (cpl_table *table)
 Unselect all table rows. More...
 
cpl_error_code cpl_table_unselect_row (cpl_table *table, cpl_size row)
 Flag a table row as unselected. More...
 
void * cpl_table_unwrap (cpl_table *table, const char *name)
 Unwrap a table column. More...
 
cpl_array * cpl_table_where_selected (const cpl_table *table)
 Get array of indexes to selected table rows. More...
 
cpl_error_code cpl_table_wrap_double (cpl_table *table, double *data, const char *name)
 Create in table a new double column obtained from existing data. More...
 
cpl_error_code cpl_table_wrap_double_complex (cpl_table *table, double complex *data, const char *name)
 Create in table a new double complex column from existing data. More...
 
cpl_error_code cpl_table_wrap_float (cpl_table *table, float *data, const char *name)
 Create in table a new float column obtained from existing data. More...
 
cpl_error_code cpl_table_wrap_float_complex (cpl_table *table, float complex *data, const char *name)
 Create in table a new float complex column obtained from existing data. More...
 
cpl_error_code cpl_table_wrap_int (cpl_table *table, int *data, const char *name)
 Create in table a new integer column obtained from existing data. More...
 
cpl_error_code cpl_table_wrap_long (cpl_table *table, long *data, const char *name)
 Create in table a new long column obtained from existing data. More...
 
cpl_error_code cpl_table_wrap_long_long (cpl_table *table, long long *data, const char *name)
 Create in table a new long long column obtained from existing data. More...
 
cpl_error_code cpl_table_wrap_string (cpl_table *table, char **data, const char *name)
 Create in table a new string column obtained from existing data. More...
 

Detailed Description

This module provides functions to create, use, and destroy a cpl_table. A cpl_table is made of columns, and a column consists of an array of elements of a given type. Currently three numerical types are supported, CPL_TYPE_INT, CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE, plus a type indicating columns containing character strings, CPL_TYPE_STRING. Moreover, it is possible to define columns of arrays, i.e. columns whose elements are arrays of all the basic types listed above. Within the same column all arrays must have the same type and the same length.

A table column is accessed by specifying its name. The ordering of the columns within a table is undefined: a cpl_table is not an n-tuple of columns, but just a set of columns. The N elements of a column are counted from 0 to N-1, with element 0 on top. The set of all the table columns elements with the same index constitutes a table row, and table rows are counted according to the same convention. It is possible to flag each cpl_table row as "selected" or "unselected", and each column element as "valid" or "invalid". Selecting table rows is mainly a way to extract just those table parts fulfilling any given condition, while invalidating column elements is a way to exclude such elements from any computation. A cpl_table is created with all rows selected, and a column is created with all elements invalidated.

Note
The cpl_table pointers specified in the argument list of all the cpl_table functions must point to valid objects: these functions do not perform any check in this sense. Only in the particular case of a NULL pointer the functions will set a CPL_ERROR_NULL_INPUT error code, unless differently specified.
Synopsis:
#include <cpl_table.h>

Function Documentation

cpl_error_code cpl_table_abs_column ( cpl_table *  table,
const char *  name 
)

Compute the absolute value of column values.

Parameters
tablePointer to table.
nameTable column name.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is not numerical, or has type array.

Each column element is replaced by its absolute value. Invalid elements are not modified by this operation. If the column is complex, its type will be turned to real (CPL_TYPE_FLOAT_COMPLEX will be changed into CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE_COMPLEX will be changed into CPL_TYPE_DOUBLE), and any pointer retrieved by calling cpl_table_get_data_float_complex() and cpl_array_get_data_double_complex() should be discarded.

References CPL_ERROR_NONE, cpl_table_get_column_type(), and CPL_TYPE_COMPLEX.

cpl_error_code cpl_table_add_columns ( cpl_table *  table,
const char *  to_name,
const char *  from_name 
)

Add the values of two numeric or complex table columns.

Parameters
tablePointer to table.
to_nameName of target column.
from_nameName of source column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or any column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with any specified name is not found in table.
CPL_ERROR_INVALID_TYPE Any specified column is neither numerical nor complex, or it is an array column.

The columns are summed element by element, and the result of the sum is stored in the target column. The columns' types may differ, and in that case the operation would be performed using the standard C upcasting rules, with a final cast of the result to the target column type. Invalid elements are propagated consistently: if either or both members of the sum are invalid, the result will be invalid too. Underflows and overflows are ignored.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_add_scalar ( cpl_table *  table,
const char *  name,
double  value 
)

Add a constant value to a numerical or complex column.

Parameters
tablePointer to table.
nameColumn name.
valueValue to add.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.

The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are are not modified by this operation.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_add_scalar_complex ( cpl_table *  table,
const char *  name,
double complex  value 
)

Add a constant complex value to a numerical or complex column.

Parameters
tablePointer to table.
nameColumn name.
valueValue to add.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.

The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are are not modified by this operation.

References CPL_ERROR_NONE.

cpl_size cpl_table_and_selected ( cpl_table *  table,
const char *  name1,
cpl_table_select_operator  operator,
const char *  name2 
)

Select from selected table rows, by comparing the values of two numerical columns.

Parameters
tablePointer to table.
name1Name of first table column.
operatorRelational operator.
name2Name of second table column.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column names are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with any of the specified names is not found in table.
CPL_ERROR_INVALID_TYPE Invalid types for comparison.

Either both columns must be numerical, or they both must be strings. The comparison between strings is lexicographical. Comparison between complex types and array types are not supported.

For all the already selected table rows, the values of the specified columns are compared. The table rows not fulfilling the comparison are unselected. Invalid elements from either columns never fulfill any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, CPL_NOT_LESS_THAN. See also the function cpl_table_or_selected().

References CPL_ERROR_INVALID_TYPE, cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), CPL_TYPE_COMPLEX, CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, and CPL_TYPE_STRING.

cpl_size cpl_table_and_selected_double ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
double  value 
)

Select from selected table rows, by comparing double column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE.

For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the function cpl_table_or_selected_double().

References cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_DOUBLE.

cpl_size cpl_table_and_selected_double_complex ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
double complex  value 
)

Select from selected table rows, by comparing double complex column values with a complex constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX.
CPL_ERROR_ILLEGAL_INPUT Operator other than CPL_EQUAL_TO or CPL_NOT_EQUAL_TO was specified.

For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO and CPL_NOT_EQUAL_TO. If the table has no rows, no error is set, and 0 is returned. See also the function cpl_table_or_selected_double_complex().

References CPL_ERROR_ILLEGAL_INPUT, cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_DOUBLE_COMPLEX.

cpl_size cpl_table_and_selected_float ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
float  value 
)

Select from selected table rows, by comparing float column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT.

For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the function cpl_table_or_selected_float().

References cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_FLOAT.

cpl_size cpl_table_and_selected_float_complex ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
float complex  value 
)

Select from selected table rows, by comparing float complex column values with a complex constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX.
CPL_ERROR_ILLEGAL_INPUT Operator other than CPL_EQUAL_TO or CPL_NOT_EQUAL_TO was specified.

For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO and CPL_NOT_EQUAL_TO. If the table has no rows, no error is set, and 0 is returned. See also the function cpl_table_or_selected_float_complex().

References CPL_ERROR_ILLEGAL_INPUT, cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_FLOAT_COMPLEX.

cpl_size cpl_table_and_selected_int ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
int  value 
)

Select from selected table rows, by comparing integer column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT.

For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the function cpl_table_or_selected_int().

References cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_INT.

cpl_size cpl_table_and_selected_invalid ( cpl_table *  table,
const char *  name 
)

Select from selected table rows all rows with an invalid value in a specified column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.

For all the already selected table rows, all the rows containing valid values at the specified column are unselected. See also the function cpl_table_or_selected_invalid().

References cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_STRING.

cpl_size cpl_table_and_selected_long ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
long  value 
)

Select from selected table rows, by comparing long column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG.

For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the function cpl_table_or_selected_long().

References cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_LONG.

cpl_size cpl_table_and_selected_long_long ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
long long  value 
)

Select from selected table rows, by comparing long long column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG.

For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the function cpl_table_or_selected_long_long().

References cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_LONG_LONG.

cpl_size cpl_table_and_selected_string ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
const char *  string 
)

Select from selected table rows, by comparing string column values with a character string.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
stringReference character string.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_STRING.
CPL_ERROR_ILLEGAL_INPUT Invalid regular expression.

For all the already selected table rows, the values of the specified column are compared with the reference string. The comparison function used is the C standard strcmp(), but in case the relational operators CPL_EQUAL_TO or CPL_NOT_EQUAL_TO are specified, the comparison string is treated as a regular expression. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the function cpl_table_or_selected_string().

References CPL_ERROR_ILLEGAL_INPUT, cpl_table_get_nrow(), cpl_table_unselect_all(), cpl_table_unselect_row(), and CPL_TYPE_STRING.

cpl_size cpl_table_and_selected_window ( cpl_table *  table,
cpl_size  start,
cpl_size  count 
)

Select from selected rows only those within a table segment.

Parameters
tablePointer to table.
startFirst row of table segment.
countLength of segment.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.

All the selected table rows that are outside the specified interval are unselected. If the sum of start and count goes beyond the end of the input table, rows are checked up to the end of the table. See also the function cpl_table_or_selected_window().

References cpl_calloc(), CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_free().

cpl_error_code cpl_table_arg_column ( cpl_table *  table,
const char *  name 
)

Compute the phase angle value of table column elements.

Parameters
tablePointer to table.
nameColumn name.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex.

Each column element is replaced by its phase angle value. The phase angle will be in the range of [-pi,pi]. Invalid elements are not modified by this operation. If the column is complex, its type will be turned to real (CPL_TYPE_FLOAT_COMPLEX will be changed into CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE_COMPLEX will be changed into CPL_TYPE_DOUBLE), and any pointer retrieved by calling cpl_table_get_data_float_complex(), cpl_table_get_data_double_complex(), etc., should be discarded.

References CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, cpl_table_get_column_type(), cpl_table_get_data_double(), cpl_table_get_data_float(), cpl_table_get_nrow(), CPL_TYPE_COMPLEX, CPL_TYPE_DOUBLE, and CPL_TYPE_FLOAT.

cpl_error_code cpl_table_cast_column ( cpl_table *  table,
const char *  from_name,
const char *  to_name,
cpl_type  type 
)

Cast a numeric or complex column to a new numeric or complex type column.

Parameters
tablePointer to table.
from_nameName of table column to cast.
to_nameName of new table column.
typeType of new table column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any of table or from_name is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the specified to_name already exists in table. Note however that to_name equal to from_name is legal (in-place cast).
CPL_ERROR_DATA_NOT_FOUND A column with the specified from_name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex.
CPL_ERROR_ILLEGAL_INPUT The specified type is neither numerical nor complex.

A new column of the specified type is created, and the content of the given numeric column is cast to the new type. If the input column type is identical to the specified type the column is duplicated as is done by the function cpl_table_duplicate_column(). Note that a column of arrays is always cast to another column of arrays of the specified type, unless it has depth 1. Consistently, a column of numbers can be cast to a column of arrays of depth 1. Here is a complete summary of how any (legal) type specification would be interpreted, depending on the type of the input column:

1 from_name type = CPL_TYPE_XXX
2 specified type = CPL_TYPE_XXX
3 to_name type = CPL_TYPE_XXX
4 
5 from_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER
6 specified type = CPL_TYPE_XXX | CPL_TYPE_POINTER
7 to_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER
8 
9 from_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER (depth > 1)
10 specified type = CPL_TYPE_XXX
11 to_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER
12 
13 from_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER (depth = 1)
14 specified type = CPL_TYPE_XXX
15 to_name type = CPL_TYPE_XXX
16 
17 from_name type = CPL_TYPE_XXX
18 specified type = CPL_TYPE_XXX | CPL_TYPE_POINTER
19 to_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER (depth = 1)
20 
21 from_name type = CPL_TYPE_XXX
22 specified type = CPL_TYPE_POINTER
23 to_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER (depth = 1)
24 
25 from_name type = CPL_TYPE_XXX
26 specified type = CPL_TYPE_YYY
27 to_name type = CPL_TYPE_YYY
28 
29 from_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER
30 specified type = CPL_TYPE_YYY | CPL_TYPE_POINTER
31 to_name type = CPL_TYPE_YYY | CPL_TYPE_POINTER
32 
33 from_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER (depth > 1)
34 specified type = CPL_TYPE_YYY
35 to_name type = CPL_TYPE_YYY | CPL_TYPE_POINTER
36 
37 from_name type = CPL_TYPE_XXX | CPL_TYPE_POINTER (depth = 1)
38 specified type = CPL_TYPE_YYY
39 to_name type = CPL_TYPE_YYY
40 
41 from_name type = CPL_TYPE_XXX
42 specified type = CPL_TYPE_YYY | CPL_TYPE_POINTER
43 to_name type = CPL_TYPE_YYY | CPL_TYPE_POINTER (depth = 1)
Note
If to_name is a NULL pointer, or it is equal to from_name, the cast is done in-place. The pointers to data will change, therefore pointers previously retrieved by cpl_table_get_data_xxx(), should be discarded.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, cpl_table_erase_column(), cpl_table_get_column_depth(), cpl_table_get_column_type(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, and CPL_TYPE_LONG_LONG.

Referenced by cpl_plot_column(), and cpl_plot_columns().

int cpl_table_compare_structure ( const cpl_table *  table1,
const cpl_table *  table2 
)

Compare the structure of two tables.

Parameters
table1Pointer to a table.
table2Pointer to another table.
Returns
0 if the tables have the same structure, 1 otherwise. In case of error, -1 is returned.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.

Two tables have the same structure if they have the same number of columns, with the same names, the same types, and the same units. The order of the columns is not relevant.

References cpl_array_delete(), cpl_array_get_string(), cpl_table_get_column_depth(), cpl_table_get_column_names(), cpl_table_get_column_type(), cpl_table_get_column_unit(), cpl_table_get_ncol(), and cpl_table_has_column().

Referenced by cpl_table_insert().

cpl_error_code cpl_table_conjugate_column ( cpl_table *  table,
const char *  name 
)

Compute the complex conjugate of column values.

Parameters
tablePointer to table.
nameColumn name.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is integer, or it is an array column.
CPL_ERROR_ILLEGAL_INPUT The input base is not positive.

Each column element is replaced by its complex conjugate. The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_copy_data_double ( cpl_table *  table,
const char *  name,
const double *  data 
)

Copy existing data to a table double column.

Parameters
tablePointer to table.
nameName of the column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE.

See the description of cpl_table_copy_data_int() for details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_copy_data_double_complex ( cpl_table *  table,
const char *  name,
const double complex *  data 
)

Copy existing data to a table double complex column.

Parameters
tablePointer to table.
nameName of the column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX.

See the description of cpl_table_copy_data_int() for details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_copy_data_float ( cpl_table *  table,
const char *  name,
const float *  data 
)

Copy existing data to a table float column.

Parameters
tablePointer to table.
nameName of the column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT.

See the description of cpl_table_copy_data_int() for details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_copy_data_float_complex ( cpl_table *  table,
const char *  name,
const float complex *  data 
)

Copy existing data to a table float complex column.

Parameters
tablePointer to table.
nameName of the column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX.

See the description of cpl_table_copy_data_int() for details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_copy_data_int ( cpl_table *  table,
const char *  name,
const int *  data 
)

Copy existing data to a table integer column.

Parameters
tablePointer to table.
nameName of the column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT.

The input data values are copied to the specified column. The size of the input array is not checked in any way, and it is expected to be compatible with the number of rows in the given table. The copied data values are all taken as valid: invalid values should be marked using the functions cpl_table_set_invalid() and cpl_table_set_column_invalid().

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_copy_data_long ( cpl_table *  table,
const char *  name,
const long *  data 
)

Copy existing data to a table long column.

Parameters
tablePointer to table.
nameName of the column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG.

See the description of cpl_table_copy_data_int() for details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_copy_data_long_long ( cpl_table *  table,
const char *  name,
const long long *  data 
)

Copy existing data to a table long long column.

Parameters
tablePointer to table.
nameName of the column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG.

See the description of cpl_table_copy_data_int() for details.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_copy_data_string ( cpl_table *  table,
const char *  name,
const char **  data 
)

Copy existing data to a table string column.

Parameters
tablePointer to table.
nameName of the column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_STRING.

See the description of cpl_table_copy_data_int() for details. In the particular case of a string column, it should be noted that the data are copied in-depth, i.e., also the pointed strings are duplicated. Strings contained in the existing table column are deallocated before being replaced by the new ones.

References CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_copy_structure ( cpl_table *  table,
const cpl_table *  mtable 
)

Give to a table the same structure of another table.

Parameters
tablePointer to empty table.
mtablePointer to model table.
Returns
CPL_ERROR_NONE in case of success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT table contains columns.

This function assignes to a columnless table the same column structure (names, types, units) of a given model table. All columns are physically created in the new table, and they are initialised to contain just invalid elements.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_table_get_ncol(), cpl_table_new_column(), cpl_table_new_column_array(), cpl_table_set_column_format(), and cpl_table_set_column_unit().

Referenced by cpl_table_extract_selected().

cpl_size cpl_table_count_invalid ( const cpl_table *  table,
const char *  name 
)

Count number of invalid values in a table column.

Parameters
tablePointer to table.
nameName of table column to examine.
Returns
Number of invalid elements in a table column, or -1 in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Count number of invalid elements in a table column.

Referenced by cpl_plot_column().

cpl_size cpl_table_count_selected ( const cpl_table *  table)

Get number of selected rows in given table.

Parameters
tablePointer to table.
Returns
Number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.

Get number of selected rows in given table.

References CPL_ERROR_NULL_INPUT.

void cpl_table_delete ( cpl_table *  table)

Delete a table.

Parameters
tablePointer to table to be deleted.
Returns
Nothing.

This function deletes a table, releasing all the memory associated to it, including any existing column. If table is NULL, nothing is done, and no error is set.

References cpl_free(), and cpl_table_get_ncol().

Referenced by cpl_plot_column(), cpl_plot_columns(), cpl_ppm_match_points(), and cpl_table_extract().

cpl_error_code cpl_table_divide_columns ( cpl_table *  table,
const char *  to_name,
const char *  from_name 
)

Divide two numeric or complex table columns.

Parameters
tablePointer to table.
to_nameName of target column.
from_nameName of column dividing the target column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or any column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with any specified name is not found in table.
CPL_ERROR_INVALID_TYPE Any specified column is neither numerical nor complex, or it is an array column.

The columns are divided element by element, and the result of the division is stored in the target column. The columns' types may differ, and in that case the operation would be performed using the standard C upcasting rules, with a final cast of the result to the target column type. Invalid elements are propagated consistently: if either or both members of the division are invalid, the result will be invalid too. Underflows and overflows are ignored, but a division by exactly zero will set an invalid column element.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_divide_scalar ( cpl_table *  table,
const char *  name,
double  value 
)

Divide a numerical or complex column by a constant.

Parameters
tablePointer to table.
nameColumn name.
valueDivisor value.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.
CPL_ERROR_DIVISION_BY_ZERO The input value is 0.0.

The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_divide_scalar_complex ( cpl_table *  table,
const char *  name,
double complex  value 
)

Divide a numerical or complex column by a complex constant.

Parameters
tablePointer to table.
nameColumn name.
valueDivisor value.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.
CPL_ERROR_DIVISION_BY_ZERO The input value is 0.0.

The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation.

References CPL_ERROR_NONE.

void cpl_table_dump ( const cpl_table *  table,
cpl_size  start,
cpl_size  count,
FILE *  stream 
)

Print a table.

Parameters
tablePointer to table
startFirst row to print
countNumber of rows to print
streamThe output stream
Returns
Nothing.

This function is mainly intended for debug purposes. All column elements are printed according to the column formats, that may be specified for each table column with the function cpl_table_set_column_format(). The default column formats have been chosen to provide a reasonable printout in most cases. Table rows are counted from 0, and their sequence number is printed at the left of each row. Invalid table elements are represented as a sequence of "-" as wide as the field occupied by the column to which they belong. Array elements are not resolved, and are represented by a sequence of "+" as wide as the field occupied by the column to which they belong. It is not shown whether a table row is selected or not. Specifying a start beyond the table boundaries, or a non-positive count, would generate a warning message, but no error would be set. The specified number of rows to print may exceed the table end, and in that case the table would be printed up to its last row. If the specified stream is NULL, it is set to stdout. The function used for printing is the standard C fprintf().

References cpl_calloc(), cpl_free(), cpl_malloc(), CPL_SIZE_FORMAT, cpl_sprintf(), cpl_table_get_ncol(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, and CPL_TYPE_STRING.

void cpl_table_dump_structure ( const cpl_table *  table,
FILE *  stream 
)

Describe the structure and the contents of a table.

Parameters
tablePointer to table.
streamThe output stream
Returns
Nothing.

This function is mainly intended for debug purposes. Some information about the structure of a table and its contents is printed to terminal:

  • Number of columns, with their names and types
  • Number of invalid elements for each column
  • Number of rows and of selected rows

If the specified stream is NULL, it is set to stdout. The function used for printing is the standard C fprintf().

References CPL_SIZE_FORMAT, cpl_table_get_ncol(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, and CPL_TYPE_STRING.

cpl_table* cpl_table_duplicate ( const cpl_table *  table)

Make a copy of a table.

Parameters
tablePointer to table.
Returns
Pointer to the new table, or NULL in case of NULL input, or in case of error.

The copy operation is done "in depth": columns data are duplicated too, not just their pointers. Also the selection flags of the original table are transferred to the new table.

References cpl_malloc(), cpl_table_get_ncol(), cpl_table_get_nrow(), and cpl_table_new().

Referenced by cpl_table_extract_selected().

cpl_error_code cpl_table_duplicate_column ( cpl_table *  to_table,
const char *  to_name,
const cpl_table *  from_table,
const char *  from_name 
)

Copy a column from a table to another.

Parameters
to_tableTarget table.
to_nameNew name of copied column.
from_tableSource table.
from_nameName of column to copy.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The input tables do not have the same number of rows.
CPL_ERROR_DATA_NOT_FOUND A column with the specified from_name is not found in the source table.
CPL_ERROR_ILLEGAL_OUTPUT A column with the specified to_name already exists in the target table.

Copy a column from a table to another. The column is duplicated. A column may be duplicated also within the same table.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plot_column(), and cpl_plot_columns().

cpl_error_code cpl_table_erase_column ( cpl_table *  table,
const char *  name 
)

Delete a column from a table.

Parameters
tablePointer to table.
nameName of table column to delete.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Delete a column from a table. If the table is left without columns, also the selection flags are lost.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_plot_columns(), cpl_table_cast_column(), cpl_table_erase_invalid(), and cpl_table_erase_invalid_rows().

cpl_error_code cpl_table_erase_invalid ( cpl_table *  table)

Remove from a table all columns just containing invalid elements, and then all rows containing at least one invalid element.

Parameters
tablePointer to table.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.

Firstly, all columns consisting just of invalid elements are deleted from the table. Next, the remaining table rows containing at least one invalid element are also deleted from the table. The selection flags are set back to "all selected" even if no rows or columns are erased. The pointers to data may change, therefore pointers previously retrieved by calling cpl_table_get_data_int(), etc., should be discarded.

The function is similar to the function cpl_table_erase_invalid_rows(), except for the criteria to remove rows containing invalid elements after all invalid columns have been removed. While cpl_table_erase_invalid_rows() requires all elements to be invalid in order to remove a row from the table, this function requires only one (or more) elements to be invalid.

Note
If the input table just contains invalid elements, all columns are deleted.
See also
cpl_table_erase_invalid_rows()

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_table_erase_column(), cpl_table_erase_window(), cpl_table_get_ncol(), cpl_table_get_nrow(), and cpl_table_select_all().

Referenced by cpl_plot_column().

cpl_error_code cpl_table_erase_invalid_rows ( cpl_table *  table)

Remove from a table columns and rows just containing invalid elements.

Parameters
tablePointer to table.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.

Table columns and table rows just containing invalid elements are deleted from the table, i.e. a column or a row is deleted only if all of its elements are invalid. The selection flags are set back to "all selected" even if no rows or columns are removed. The pointers to data may change, therefore pointers previously retrieved by cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded.

Note
If the input table just contains invalid elements, all columns are deleted.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_table_erase_column(), cpl_table_erase_window(), cpl_table_get_ncol(), cpl_table_get_nrow(), and cpl_table_select_all().

cpl_error_code cpl_table_erase_selected ( cpl_table *  table)

Delete the selected rows of a table.

Parameters
tablePointer to table
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT table is a NULL pointer.

A portion of the table data is physically removed. The pointer to column data may change, therefore pointers previously retrieved by calling cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded. The table selection flags are set back to "all selected".

References CPL_ERROR_NULL_INPUT, cpl_table_get_ncol(), cpl_table_get_nrow(), cpl_table_select_all(), and cpl_table_set_size().

cpl_error_code cpl_table_erase_window ( cpl_table *  table,
cpl_size  start,
cpl_size  count 
)

Delete a table segment.

Parameters
tablePointer to table.
startFirst row to delete.
countNumber of rows to delete.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has length zero, or start is outside the table range.
CPL_ERROR_ILLEGAL_INPUT count is negative.

A portion of the table data is physically removed. The pointers to column data may change, therefore pointers previously retrieved by calling cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded. The table selection flags are set back to "all selected". The specified segment can extend beyond the end of the table, and in that case rows will be removed up to the end of the table.

References CPL_ERROR_NULL_INPUT, cpl_table_get_ncol(), and cpl_table_select_all().

Referenced by cpl_table_erase_invalid(), and cpl_table_erase_invalid_rows().

cpl_error_code cpl_table_exponential_column ( cpl_table *  table,
const char *  name,
double  base 
)

Compute the exponential of column values.

Parameters
tablePointer to table.
nameColumn name.
baseExponential base.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.
CPL_ERROR_ILLEGAL_INPUT The input base is not positive.

Each column element is replaced by its exponential in the specified base. The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation.

References CPL_ERROR_NONE.

cpl_table* cpl_table_extract ( const cpl_table *  table,
cpl_size  start,
cpl_size  count 
)

Create a table from a section of another table.

Parameters
tablePointer to table.
startFirst row to be copied to new table.
countNumber of rows to be copied.
Returns
Pointer to the new table, or NULL in case or error.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.

A number of consecutive rows are copied from an input table to a newly created table. The new table will have the same structure of the original table (see function cpl_table_compare_structure() ). If the sum of start and count goes beyond the end of the input table, rows are copied up to the end. All the rows of the new table are selected, i.e., existing selection flags are not transferred from the old table to the new one.

References CPL_ERROR_NULL_INPUT, cpl_table_delete(), cpl_table_get_ncol(), cpl_table_get_nrow(), and cpl_table_new().

cpl_table* cpl_table_extract_selected ( const cpl_table *  table)

Create a new table from the selected rows of another table.

Parameters
tablePointer to table.
Returns
Pointer to new table, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.

A new table is created, containing a copy of all the selected rows of the input table. In the output table all rows are selected.

References CPL_ERROR_NULL_INPUT, cpl_table_copy_structure(), cpl_table_duplicate(), cpl_table_new(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG_LONG, and CPL_TYPE_STRING.

cpl_error_code cpl_table_fill_column_window ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
double  value 
)

Write a value to a numerical column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is not numerical, or is of type array.

Write the same value to a numerical column segment. The value is cast to the type of the accessed column according to the C casting rules. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_array ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
const cpl_array *  array 
)

Write an array to an array column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the array.
countNumber of arrays to write.
arrayArray to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column does not match the type of the input array, or it is not made of arrays.
CPL_ERROR_INCOMPATIBLE_INPUT The size of the input array is different from the depth of the specified column.

Write the same array to a segment of an array column. If the input array is not a NULL pointer, it is duplicated for each accessed column element. If the input array is a NULL pointer, this call is equivalent to a call to cpl_table_set_column_invalid(). If the sum of start and count exceeds the number of rows in the table, the column is filled up to its end.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_complex ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
double complex  value 
)

Write a value to a complex column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is not complex, or is of type array.

Write the same value to a complex column segment. The value is cast to the type of the accessed column according to the C casting rules. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_double ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
double  value 
)

Write a value to a double column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE.

Write the same value to a double column segment. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

References CPL_ERROR_NONE.

Referenced by cpl_ppm_match_points().

cpl_error_code cpl_table_fill_column_window_double_complex ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
double complex  value 
)

Write a value to a double complex column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX.

Write the same value to a double complex column segment. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_float ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
float  value 
)

Write a value to a float column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT.

Write the same value to a float column segment. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_float_complex ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
float complex  value 
)

Write a value to a float complex column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX.

Write the same value to a float complex column segment. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_int ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
int  value 
)

Write a value to an integer column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT.

Write the same value to an integer column segment. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

Note
For automatic conversion to the accessed column type use the function cpl_table_fill_column_window().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_long ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
long  value 
)

Write a value to an long column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG.

Write the same value to an long column segment. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

Note
For automatic conversion to the accessed column type use the function cpl_table_fill_column_window().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_long_long ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
long long  value 
)

Write a value to an long long column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the value.
countNumber of values to write.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG.

Write the same value to an long long column segment. The written values are automatically marked as valid. To invalidate a column interval use cpl_table_set_column_invalid() instead. If the sum of start and count exceeds the number of table rows, the column is filled up to its end.

Note
For automatic conversion to the accessed column type use the function cpl_table_fill_column_window().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_column_window_string ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count,
const char *  value 
)

Write a character string to a string column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin to write the character string.
countNumber of strings to write.
valueCharacter string to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_STRING.

Write the same value to a string column segment. If the input string is not a NULL pointer, it is duplicated for each accessed column element. If the input string is a NULL pointer, this call is equivalent to a call to cpl_table_set_column_invalid(). If the sum of start and count exceeds the number of rows in the table, the column is filled up to its end.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_invalid_double ( cpl_table *  table,
const char *  name,
double  code 
)

Write to invalid double column elements a numeric code.

Parameters
tablePointer to table containing the column.
nameColumn name.
codeCode to write to invalid column elements.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE, or of type CPL_TYPE_DOUBLE | CPL_TYPE_POINTER.

This function can be applied also to columns of arrays of doubles. In general, numeric column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (using a call to cpl_table_get_data_double() ) to procedures that are external to the CPL column system, it may turn out to be appropriate assigning to all the invalid elements a conventional code value. This code value will supposedly be recognized and handled properly by a given foreign method applied directly to the column data buffer. Note that only existing invalid elements will be coded as indicated: new invalid column elements would still have their actual values left undefined. Also, any further processing of the column would not take care of maintaining the assigned code to a given invalid column element: therefore the code should be applied just before it is actually needed.

Note
Assigning a code to an invalid element doesn't make it valid.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_invalid_double_complex ( cpl_table *  table,
const char *  name,
double complex  code 
)

Write to invalid double complex column elements a numeric code.

Parameters
tablePointer to table containing the column.
nameColumn name.
codeCode to write to invalid column elements.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX, or of type CPL_TYPE_DOUBLE_COMPLEX | CPL_TYPE_POINTER.

This function can be applied also to columns of arrays of complex doubles. In general, complex column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (calling to cpl_table_get_data_double_complex() ) to procedures which are external to the CPL column system, it may turn out to be appropriate assigning a conventional code value to all the invalid elements. This code value will supposedly be recognized and handled properly by a given foreign method applied directly to the column data buffer. Note that only existing invalid elements will be coded as indicated: new invalid column elements would still have their actual values left undefined. Also, any further processing of the column would not take care of maintaining the assigned code to a given invalid column element: therefore the code should be applied just before it is actually needed.

Note
Assigning a code to an invalid element doesn't make it valid.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_invalid_float ( cpl_table *  table,
const char *  name,
float  code 
)

Write to invalid float column elements a numeric code.

Parameters
tablePointer to table containing the column.
nameColumn name.
codeCode to write to invalid column elements.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT, or of type CPL_TYPE_FLOAT | CPL_TYPE_POINTER.

This function can be applied also to columns of arrays of floats. In general, numeric column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (using a call to cpl_table_get_data_float() ) to procedures that are external to the CPL column system, it may turn out to be appropriate assigning to all the invalid elements a conventional code value. This code value will supposedly be recognized and handled properly by a given foreign method applied directly to the column data buffer. Note that only existing invalid elements will be coded as indicated: new invalid column elements would still have their actual values left undefined. Also, any further processing of the column would not take care of maintaining the assigned code to a given invalid column element: therefore the code should be applied just before it is actually needed.

Note
Assigning a code to an invalid element doesn't make it valid.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_invalid_float_complex ( cpl_table *  table,
const char *  name,
float complex  code 
)

Write to invalid float complex column elements a numeric code.

Parameters
tablePointer to table containing the column.
nameColumn name.
codeCode to write to invalid column elements.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX, or of type CPL_TYPE_FLOAT_COMPLEX | CPL_TYPE_POINTER.

This function can be applied also to columns of arrays of complex floats. In general, complex column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (calling to cpl_table_get_data_float_complex() ) to procedures which are external to the CPL column system, it may turn out to be appropriate assigning a conventional code value to all the invalid elements. This code value will supposedly be recognized and handled properly by a given foreign method applied directly to the column data buffer. Note that only existing invalid elements will be coded as indicated: new invalid column elements would still have their actual values left undefined. Also, any further processing of the column would not take care of maintaining the assigned code to a given invalid column element: therefore the code should be applied just before it is actually needed.

Note
Assigning a code to an invalid element doesn't make it valid.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_invalid_int ( cpl_table *  table,
const char *  name,
int  code 
)

Write to invalid integer column elements a numeric code.

Parameters
tablePointer to table containing the column.
nameColumn name.
codeCode to write to invalid column elements.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT, or of type CPL_TYPE_INT | CPL_TYPE_POINTER.

This function can be applied also to columns of arrays of integers. In general, numeric column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (using a call to cpl_table_get_data_int() ) to procedures that are external to the CPL column system, it may turn out to be appropriate assigning to all the invalid elements a conventional code value. This code value will supposedly be recognized and handled properly by a given foreign method applied directly to the column data buffer. Note that only existing invalid elements will be coded as indicated: new invalid column elements would still have their actual values left undefined. Also, any further processing of the column would not take care of maintaining the assigned code to a given invalid column element: therefore the code should be applied just before it is actually needed.

Note
Assigning a code to an invalid element doesn't make it valid.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_invalid_long ( cpl_table *  table,
const char *  name,
long  code 
)

Write to invalid long column elements a numeric code.

Parameters
tablePointer to table containing the column.
nameColumn name.
codeCode to write to invalid column elements.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG, or of type CPL_TYPE_LONG | CPL_TYPE_POINTER.

This function can be applied also to columns of arrays of integers. In general, numeric column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (using a call to cpl_table_get_data_long() ) to procedures that are external to the CPL column system, it may turn out to be appropriate assigning to all the invalid elements a conventional code value. This code value will supposedly be recognized and handled properly by a given foreign method applied directly to the column data buffer. Note that only existing invalid elements will be coded as indicated: new invalid column elements would still have their actual values left undefined. Also, any further processing of the column would not take care of maintaining the assigned code to a given invalid column element: therefore the code should be applied just before it is actually needed.

Note
Assigning a code to an invalid element doesn't make it valid.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_fill_invalid_long_long ( cpl_table *  table,
const char *  name,
long long  code 
)

Write to invalid long long column elements a numeric code.

Parameters
tablePointer to table containing the column.
nameColumn name.
codeCode to write to invalid column elements.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG, or of type CPL_TYPE_LONG_LONG | CPL_TYPE_POINTER.

This function can be applied also to columns of arrays of integers. In general, numeric column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (using a call to cpl_table_get_data_long_long() ) to procedures that are external to the CPL column system, it may turn out to be appropriate assigning to all the invalid elements a conventional code value. This code value will supposedly be recognized and handled properly by a given foreign method applied directly to the column data buffer. Note that only existing invalid elements will be coded as indicated: new invalid column elements would still have their actual values left undefined. Also, any further processing of the column would not take care of maintaining the assigned code to a given invalid column element: therefore the code should be applied just before it is actually needed.

Note
Assigning a code to an invalid element doesn't make it valid.

References CPL_ERROR_NONE.

double cpl_table_get ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from a numerical column.

Parameters
tablePointer to table.
nameName of table column to be accessed.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Value read. In case of invalid table element, or in case of error, 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is not numerical, or is a column of arrays.

Rows are counted starting from 0. The null flag is used to indicate whether the accessed table element is valid (0) or invalid (1). The null flag also signals an error condition (-1). The null argument can be left to NULL.

References CPL_ERROR_INVALID_TYPE, CPL_SIZE_FORMAT, CPL_TYPE_COMPLEX, cpl_type_get_name(), and CPL_TYPE_STRING.

const cpl_array* cpl_table_get_array ( const cpl_table *  table,
const char *  name,
cpl_size  row 
)

Read an array from an array column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
Returns
Pointer to array. In case of an invalid column element, or in case of error, a NULL pointer is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type array.

Read a value from a column of any array type. Rows are counted starting from 0.

Note
The returned array is a pointer to a table element, not its copy. Its manipulation will directly affect that element, while changing that element using cpl_table_set_array() will turn it into garbage. Therefore, if a real copy of an array column element is required, this function should be called as an argument of the function cpl_array_duplicate().
cpl_size cpl_table_get_column_depth ( const cpl_table *  table,
const char *  name 
)

Get the depth of a table column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Column depth, or -1 in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Get the depth of a column. Columns of type array always have positive depth, while columns listing numbers or character strings have depth 0.

Referenced by cpl_table_cast_column(), and cpl_table_compare_structure().

cpl_size cpl_table_get_column_dimension ( const cpl_table *  table,
const char *  name,
cpl_size  indx 
)

Get size of one dimension of a table column of arrays.

Parameters
tablePointer to table.
nameColumn name.
indxIndicate dimension to query (0 = x, 1 = y, 2 = z, etc.).
Returns
Size of queried dimension of the column, or zero in case of error.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_UNSUPPORTED_MODE The specified column is not of type array.
CPL_ERROR_ACCESS_OUT_OF_RANGE The specified indx array is not compatible with the column dimensions.
CPL_ERROR_INCOMPATIBLE_INPUT The specified dimensions are incompatible with the total number of elements in the column arrays.

Get the size of one dimension of a column. If a column is not an array column, or if it has no dimensions, 1 is returned.

cpl_size cpl_table_get_column_dimensions ( const cpl_table *  table,
const char *  name 
)

Get the number of dimensions of a table column of arrays.

Parameters
tablePointer to table.
nameColumn name.
Returns
Column number of dimensions, or 0 in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Get the number of dimensions of a column. If a column is not an array column, or if it has no dimensions, 1 is returned.

const char* cpl_table_get_column_format ( const cpl_table *  table,
const char *  name 
)

Get the format of a table column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Format of column, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Return the format of a column. Note that the returned string is a pointer to the column format, not its copy. Its manipulation will directly affect the column format, while changing the column format using cpl_column_set_format() will turn it into garbage. Therefore it should be considered read-only, and if a real copy of a column format is required, this function should be called as an argument of the function strdup().

double cpl_table_get_column_max ( const cpl_table *  table,
const char *  name 
)

Get maximum value in a numerical column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Maximum value. See documentation of cpl_table_get_column_mean().

See the description of the function cpl_table_get_column_mean().

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

cpl_error_code cpl_table_get_column_maxpos ( const cpl_table *  table,
const char *  name,
cpl_size row 
)

Get position of maximum in a numerical column.

Parameters
tablePointer to table.
nameColumn name.
rowReturned position of maximum value.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table, or it just contains invalid elements, or the table has length zero.
CPL_ERROR_INVALID_TYPE The specified column is not numerical.

Invalid column values are excluded from the search. The row argument will be assigned the position of the maximum value, where rows are counted starting from 0. If more than one column element correspond to the max value, the position with the lowest row number is returned. In case of error, row is left untouched. The table selection flags have no influence on the result.

References CPL_ERROR_NONE.

double cpl_table_get_column_mean ( const cpl_table *  table,
const char *  name 
)

Compute the mean value of a numerical column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Mean value. In case of error 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table, or it just contains invalid elements, or the table has length zero.
CPL_ERROR_INVALID_TYPE The specified column is not numerical.

Invalid column values are excluded from the computation. The table selection flags have no influence on the result.

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

double complex cpl_table_get_column_mean_complex ( const cpl_table *  table,
const char *  name 
)

Compute the mean value of a numerical or complex column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Mean value. In case of error 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table, or it just contains invalid elements, or the table has length zero.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex.

Invalid column values are excluded from the computation. The table selection flags have no influence on the result.

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

double cpl_table_get_column_median ( const cpl_table *  table,
const char *  name 
)

Compute the median value of a numerical column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Median value. See documentation of cpl_table_get_column_mean().

See the description of the function cpl_table_get_column_mean().

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_ppm_match_points().

double cpl_table_get_column_min ( const cpl_table *  table,
const char *  name 
)

Get minimum value in a numerical column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Minimum value. See documentation of cpl_table_get_column_mean().

See the description of the function cpl_table_get_column_mean().

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

cpl_error_code cpl_table_get_column_minpos ( const cpl_table *  table,
const char *  name,
cpl_size row 
)

Get position of minimum in a numerical column.

Parameters
tablePointer to table.
nameColumn name.
rowReturned position of minimum value.
Returns
See function cpl_table_get_column_maxpos().

See the description of the function cpl_table_get_column_maxpos().

References CPL_ERROR_NONE.

const char* cpl_table_get_column_name ( const cpl_table *  table)

Get table columns names.

Parameters
tablePointer to table.
Returns
Name of a table column.

If this function is not called with a NULL pointer the name of the first table column will be returned. Further calls made with a NULL pointer would return the next columns names, till the end of the list of columns when a NULL would be returned. This function only guarantees that all the table column names would be returned by subsequent calls to this function, but the order in which the column names are returned is undefined. The table structure must not be modified (e.g. by deleting, creating, moving, or renaming columns) between a sequence of calls to cpl_table_get_column_name() related to the same table, or this function behaviour will be undetermined. This function returns a pointer to the table column name, and not to its copy, therefore the pointed string shouldn't be deallocated or manipulated in any way. Its manipulation would directly affect the column name, while changing the column name using cpl_table_name_column() would turn it into garbage. Therefore, if a real copy of a column name is required, this function should be called as an argument of the function strdup().

Deprecated:
This function is deprecated, because its usage could create serious problems in case it is attempted to get names from different tables simultaneously. For instance, a programmer may call cpl_table_get_column_name() in a loop, and in the same loop call a CPL function that calls as well the same function. The behaviour in this case would be unpredictable. The function cpl_table_get_column_names() should be used instead.

References cpl_table_get_ncol().

cpl_array* cpl_table_get_column_names ( const cpl_table *  table)

Get table columns names.

Parameters
tablePointer to table.
Returns
Array of table columns names.

The returned CPL array of strings should be finally destroyed using cpl_array_delete().

References cpl_array_new(), cpl_array_set_string(), CPL_ERROR_NULL_INPUT, and CPL_TYPE_STRING.

Referenced by cpl_table_compare_structure().

double cpl_table_get_column_stdev ( const cpl_table *  table,
const char *  name 
)

Find the standard deviation of a table column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Standard deviation. See documentation of cpl_table_get_column_mean().
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table, or it just contains invalid elements, or the table has length zero.
CPL_ERROR_INVALID_TYPE The specified column is not numerical.

Invalid column values are excluded from the computation of the standard deviation. If just one valid element is found, 0.0 is returned but no error is set. The table selection flags have no influence on the result.

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_ppm_match_points().

cpl_type cpl_table_get_column_type ( const cpl_table *  table,
const char *  name 
)

Get the type of a table column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Column type, or CPL_TYPE_INVALID in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Get the type of a column.

References CPL_TYPE_INVALID.

Referenced by cpl_plot_column(), cpl_plot_columns(), cpl_table_abs_column(), cpl_table_arg_column(), cpl_table_cast_column(), cpl_table_compare_structure(), cpl_table_imag_column(), cpl_table_real_column(), and cpl_table_unwrap().

const char* cpl_table_get_column_unit ( const cpl_table *  table,
const char *  name 
)

Get the unit of a table column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Unit of column, or NULL if no unit can be returned.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Return the unit of a column if present, otherwise a NULL pointer is returned. Note that the returned string is a pointer to the column unit, not its copy. Its manipulation will directly affect the column unit, while changing the column unit using cpl_column_set_unit() will turn it into garbage. Therefore it should be considered read-only, and if a real copy of a column unit is required, this function should be called as an argument of the function strdup().

Referenced by cpl_table_compare_structure().

double complex cpl_table_get_complex ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from a complex column.

Parameters
tablePointer to table.
nameName of table column to be accessed.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Value read. In case of invalid table element, or in case of error, 0.0 is returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is not complex, or is a column of arrays.

Rows are counted starting from 0. The null flag is used to indicate whether the accessed table element is valid (0) or invalid (1). The null flag also signals an error condition (-1). The null argument can be left to NULL.

References CPL_ERROR_INVALID_TYPE, CPL_SIZE_FORMAT, CPL_TYPE_COMPLEX, and cpl_type_get_name().

cpl_array** cpl_table_get_data_array ( cpl_table *  table,
const char *  name 
)

Get a pointer to array column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type array.

A table column of type array includes an array of values of type cpl_array*. This function returns a pointer to this array.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_array_const().

const cpl_array** cpl_table_get_data_array_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to array column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type array.

A table column of type array includes an array of values of type cpl_array*. This function returns a pointer to this array.

Referenced by cpl_table_get_data_array().

double* cpl_table_get_data_double ( cpl_table *  table,
const char *  name 
)

Get a pointer to double column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE.

A cpl_table column of type CPL_TYPE_DOUBLE includes an array of values of type double. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_double() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_double() for further details.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_double_const().

Referenced by cpl_plot_column(), cpl_ppm_match_points(), cpl_table_arg_column(), and cpl_table_imag_column().

double complex* cpl_table_get_data_double_complex ( cpl_table *  table,
const char *  name 
)

Get a pointer to double complex column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX.

A cpl_table column of type CPL_TYPE_DOUBLE_COMPLEX includes an array of values of type double complex. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_double_complex() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_double_complex() for further details.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_double_complex_const().

const double complex* cpl_table_get_data_double_complex_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to constant double complex column data.

Parameters
tablePointer to constant table.
nameColumn name.
Returns
Pointer to constant column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX.

A cpl_table column of type CPL_TYPE_DOUBLE_COMPLEX includes an array of values of type double complex. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_double_complex() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_double_complex() for further details.

References CPL_TYPE_DOUBLE_COMPLEX.

Referenced by cpl_table_get_data_double_complex().

const double* cpl_table_get_data_double_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to constant double column data.

Parameters
tablePointer to constant table.
nameColumn name.
Returns
Pointer to constant column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE.

A cpl_table column of type CPL_TYPE_DOUBLE includes an array of values of type double. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_double() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_double() for further details.

References CPL_TYPE_DOUBLE.

Referenced by cpl_plot_column(), cpl_plot_columns(), and cpl_table_get_data_double().

float* cpl_table_get_data_float ( cpl_table *  table,
const char *  name 
)

Get a pointer to float column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT.

A cpl_table column of type CPL_TYPE_FLOAT includes an array of values of type float. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_float() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_float() for further details.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_float_const().

Referenced by cpl_table_arg_column(), and cpl_table_imag_column().

float complex* cpl_table_get_data_float_complex ( cpl_table *  table,
const char *  name 
)

Get a pointer to float complex column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX.

A cpl_table column of type CPL_TYPE_FLOAT_COMPLEX includes an array of values of type float complex. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_float_complex() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_float_complex() for further details.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_float_complex_const().

const float complex* cpl_table_get_data_float_complex_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to constant float complex column data.

Parameters
tablePointer to constant table.
nameColumn name.
Returns
Pointer to constant column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX.

A cpl_table column of type CPL_TYPE_FLOAT_COMPLEX includes an array of values of type float complex. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_float_complex() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_float_complex() for further details.

References CPL_TYPE_FLOAT_COMPLEX.

Referenced by cpl_table_get_data_float_complex().

const float* cpl_table_get_data_float_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to constant float column data.

Parameters
tablePointer to constant table.
nameColumn name.
Returns
Pointer to constant column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT.

A cpl_table column of type CPL_TYPE_FLOAT includes an array of values of type float. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_float() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_float() for further details.

References CPL_TYPE_FLOAT.

Referenced by cpl_table_get_data_float().

int* cpl_table_get_data_int ( cpl_table *  table,
const char *  name 
)

Get a pointer to integer column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT.

A cpl_table column of type CPL_TYPE_INT includes an array of values of type int. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_int() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_int() for further details.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_int_const().

const int* cpl_table_get_data_int_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to constant integer column data.

Parameters
tablePointer to constant table.
nameColumn name.
Returns
Pointer to constant column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT.

A cpl_table column of type CPL_TYPE_INT includes an array of values of type int. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_int() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_int() for further details.

References CPL_TYPE_INT.

Referenced by cpl_table_get_data_int().

long* cpl_table_get_data_long ( cpl_table *  table,
const char *  name 
)

Get a pointer to long column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG.

A cpl_table column of type CPL_TYPE_LONG includes an array of values of type long. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_long() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_long() for further details.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_long_const().

const long* cpl_table_get_data_long_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to constant long column data.

Parameters
tablePointer to constant table.
nameColumn name.
Returns
Pointer to constant column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG.

A cpl_table column of type CPL_TYPE_LONG includes an array of values of type long. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_long() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_long() for further details.

References CPL_TYPE_LONG.

Referenced by cpl_table_get_data_long().

long long* cpl_table_get_data_long_long ( cpl_table *  table,
const char *  name 
)

Get a pointer to long long column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG.

A cpl_table column of type CPL_TYPE_LONG_LONG includes an array of values of type long long. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_long_long() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_long_long() for further details.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_long_long_const().

const long long* cpl_table_get_data_long_long_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to constant long long column data.

Parameters
tablePointer to constant table.
nameColumn name.
Returns
Pointer to constant column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG.

A cpl_table column of type CPL_TYPE_LONG_LONG includes an array of values of type long long. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_fill_invalid_long_long() should be called just before this function, assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_fill_invalid_long_long() for further details.

References CPL_TYPE_LONG_LONG.

Referenced by cpl_table_get_data_long_long().

char** cpl_table_get_data_string ( cpl_table *  table,
const char *  name 
)

Get a pointer to string column data.

Parameters
tablePointer to table.
nameColumn name.
Returns
Pointer to column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_STRING.

A table column of type CPL_TYPE_STRING includes an array of values of type char*. This function returns a pointer to this array.

Note
Use at your own risk: direct manipulation of column data rules out any check performed by the table object interface, and may introduce inconsistencies between the information maintained internally, and the actual column data and structure.

References cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_table_get_data_string_const().

const char** cpl_table_get_data_string_const ( const cpl_table *  table,
const char *  name 
)

Get a pointer to constant string column data.

Parameters
tablePointer to constant table.
nameColumn name.
Returns
Pointer to constant column data, or NULL if the column has zero length, or in case of failure.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_STRING.

A table column of type CPL_TYPE_STRING includes an array of values of type char*. This function returns a pointer to this array.

References CPL_TYPE_STRING.

Referenced by cpl_table_get_data_string().

double cpl_table_get_double ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from a double column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Double value read. In case of an invalid table element, or in case of error, 0.0 is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE.

Read a value from a column of type CPL_TYPE_DOUBLE. See the documentation of function cpl_table_get_int().

References CPL_TYPE_DOUBLE.

double complex cpl_table_get_double_complex ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from a double complex column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Double complex value read. In case of an invalid table element, or in case of error, 0.0 is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX.

Read a value from a column of type CPL_TYPE_DOUBLE_COMPLEX. See the documentation of function cpl_table_get_int().

References CPL_TYPE_DOUBLE_COMPLEX.

float cpl_table_get_float ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from a float column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Float value read. In case of an invalid table element, or in case of error, 0.0 is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT.

Read a value from a column of type CPL_TYPE_FLOAT. See the documentation of function cpl_table_get_int().

References CPL_TYPE_FLOAT.

float complex cpl_table_get_float_complex ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from a float complex column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Float complex value read. In case of an invalid table element, or in case of error, 0.0 is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX.

Read a value from a column of type CPL_TYPE_FLOAT_COMPLEX. See the documentation of function cpl_table_get_int().

References CPL_TYPE_FLOAT_COMPLEX.

int cpl_table_get_int ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from an integer column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Integer value read. In case of an invalid table element, or in case of error, 0 is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT.

Read a value from a column of type CPL_TYPE_INT. If the null flag is a valid pointer, it is used to indicate whether the accessed column element is valid (0) or invalid (1). The null flag also signals an error condition (-1). The null flag pointer can also be NULL, and in that case this option will be disabled. Rows are counted starting from 0.

Note
For automatic conversion (always to type double), use the function cpl_table_get().

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, CPL_SIZE_FORMAT, cpl_type_get_name(), and CPL_TYPE_INT.

long cpl_table_get_long ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from a long column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Long integer value read. In case of an invalid table element, or in case of error, 0 is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG.

Read a value from a column of type CPL_TYPE_LONG. See the documentation of function cpl_table_get_int().

References CPL_TYPE_LONG.

long long cpl_table_get_long_long ( const cpl_table *  table,
const char *  name,
cpl_size  row,
int *  null 
)

Read a value from a long long column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
nullFlag indicating null values, or error condition.
Returns
Long long integer value read. In case of an invalid table element, or in case of error, 0 is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG.

Read a value from a column of type CPL_TYPE_LONG_LONG. See the documentation of function cpl_table_get_int().

References CPL_TYPE_LONG_LONG.

cpl_size cpl_table_get_ncol ( const cpl_table *  table)

Get the number of columns in a table.

Parameters
tablePointer to table to examine.
Returns
Number of columns in the table. If a NULL table pointer is passed, -1 is returned.
Errors
CPL_ERROR_NULL_INPUT table is a NULL pointer.

Get the number of columns in a table.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_table_compare_structure(), cpl_table_copy_structure(), cpl_table_delete(), cpl_table_dump(), cpl_table_dump_structure(), cpl_table_duplicate(), cpl_table_erase_invalid(), cpl_table_erase_invalid_rows(), cpl_table_erase_selected(), cpl_table_erase_window(), cpl_table_extract(), cpl_table_get_column_name(), cpl_table_insert(), cpl_table_insert_window(), and cpl_table_set_size().

cpl_size cpl_table_get_nrow ( const cpl_table *  table)
const char* cpl_table_get_string ( const cpl_table *  table,
const char *  name,
cpl_size  row 
)

Read a value from a string column.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition of element to be read.
Returns
Pointer to string. In case of an invalid column element, or in case of error, a NULL pointer is always returned.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_STRING.

Read a value from a column of type CPL_TYPE_STRING. Rows are counted starting from 0.

Note
The returned string is a pointer to a table element, not its copy. Its manipulation will directly affect that element, while changing that element using cpl_table_set_string() will turn it into garbage. Therefore, if a real copy of a string column element is required, this function should be called as an argument of the function strdup().

References CPL_TYPE_STRING.

int cpl_table_has_column ( const cpl_table *  table,
const char *  name 
)

Check if a column with a given name exists.

Parameters
tablePointer to table.
nameName of table column.
Returns
1 if column exists, 0 if column doesn't exist, -1 in case of error.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.

Check if a column with a given name exists in the specified table.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_plot_column(), cpl_plot_columns(), and cpl_table_compare_structure().

int cpl_table_has_invalid ( const cpl_table *  table,
const char *  name 
)

Check if a column contains at least one invalid value.

Parameters
tablePointer to table.
nameName of table column to access.
Returns
1 if the column contains at least one invalid element, 0 if not, -1 in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Check if there are invalid elements in a column. In case of columns of arrays, invalid values within an array are not considered: an invalid element here means that an array element is not allocated, i.e., it is a NULL pointer. In order to detect invalid elements within an array element, this element must be extracted using the function cpl_table_get_array(), and then use the function cpl_array_has_invalid().

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

int cpl_table_has_valid ( const cpl_table *  table,
const char *  name 
)

Check if a column contains at least one valid value.

Parameters
tablePointer to table.
nameName of table column to access.
Returns
1 if the column contains at least one valid value, 0 if not, -1 in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

Check if there are valid elements in a column. In case of columns of arrays, invalid values within an array are not considered: an invalid element here means that an array element is not allocated, i.e., it is a NULL pointer. In order to detect valid elements within an array element, this element must be extracted using the function cpl_table_get_array(), and then use the function cpl_array_has_valid().

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

Referenced by cpl_ppm_match_points().

cpl_error_code cpl_table_imag_column ( cpl_table *  table,
const char *  name 
)

Compute the imaginary part value of table column elements.

Parameters
tablePointer to table.
nameColumn name.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex.

Each column element is replaced by its imaginary party value only. Invalid elements are not modified by this operation. If the column is complex, its type will be turned to real (CPL_TYPE_FLOAT_COMPLEX will be changed into CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE_COMPLEX will be changed into CPL_TYPE_DOUBLE), and any pointer retrieved by calling cpl_table_get_data_float_complex(), cpl_table_get_data_double_complex(), etc., should be discarded.

References CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, cpl_table_get_column_type(), cpl_table_get_data_double(), cpl_table_get_data_float(), cpl_table_get_nrow(), CPL_TYPE_COMPLEX, CPL_TYPE_DOUBLE, and CPL_TYPE_FLOAT.

cpl_error_code cpl_table_insert ( cpl_table *  target_table,
const cpl_table *  insert_table,
cpl_size  row 
)

Merge two tables.

Parameters
target_tableTarget table.
insert_tableTable to be inserted in the target table.
rowRow where to insert the insert table.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any input table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE row is negative.
CPL_ERROR_INCOMPATIBLE_INPUT The input tables do not have the same structure.

The input tables must have the same structure, as defined by the function cpl_table_compare_structure() . Data from the insert_table are duplicated and inserted at the specified position of the target_table. If the specified row is not less than the target table length, the second table will be appended to the target table. The selection flags of the target table are always set back to "all selected". The pointers to column data in the target table may change, therefore pointers previously retrieved by calling cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded.

References CPL_ERROR_INCOMPATIBLE_INPUT, cpl_table_compare_structure(), cpl_table_get_ncol(), and cpl_table_select_all().

cpl_error_code cpl_table_insert_window ( cpl_table *  table,
cpl_size  start,
cpl_size  count 
)

Insert a segment of rows into table data.

Parameters
tablePointer to table
startRow where to insert the segment.
countLength of the segment.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE start is negative.
CPL_ERROR_ILLEGAL_INPUT count is negative.

Insert a segment of empty rows, just containing invalid elements. Setting start to a number greater than the column length is legal, and has the effect of appending extra rows at the end of the table: this is equivalent to expanding the table using cpl_table_set_size(). The input column may also have zero length. The pointers to column data values may change, therefore pointers previously retrieved by calling cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded. The table selection flags are set back to "all selected".

References CPL_ERROR_NULL_INPUT, cpl_table_get_ncol(), and cpl_table_select_all().

int cpl_table_is_selected ( const cpl_table *  table,
cpl_size  row 
)

Determine whether a table row is selected or not.

Parameters
tablePointer to table.
rowTable row to check.
Returns
1 if row is selected, 0 if it is not selected, -1 in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.

Check if a table row is selected.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, and CPL_ERROR_NULL_INPUT.

int cpl_table_is_valid ( const cpl_table *  table,
const char *  name,
cpl_size  row 
)

Check if a column element is valid.

Parameters
tablePointer to table.
nameName of table column to access.
rowColumn element to examine.
Returns
1 if the column element is valid, 0 if invalid, -1 in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.

Check if a column element is valid.

References cpl_errorstate_get(), and cpl_errorstate_is_equal().

cpl_table* cpl_table_load ( const char *  filename,
int  xtnum,
int  check_nulls 
)

Load a FITS table extension into a new cpl_table.

Parameters
filenameName of FITS file with at least one table extension.
xtnumNumber of extension to read, starting from 1.
check_nullsIf set to 0, identified invalid values are not marked.
Returns
New table, or NULL in case of failure.
Errors
CPL_ERROR_NULL_INPUT Input filename is a NULL pointer.
CPL_ERROR_FILE_NOT_FOUND A file named as specified in filename is not found.
CPL_ERROR_BAD_FILE_FORMAT The input file is not in FITS format.
CPL_ERROR_ILLEGAL_INPUT The specified FITS file extension is not a table, or, if it is a table, it has more than 9999 columns.
CPL_ERROR_ACCESS_OUT_OF_RANGE xtnum is greater than the number of FITS extensions in the FITS file, or is less than 1.
CPL_ERROR_DATA_NOT_FOUND The FITS table has no rows or no columns.
CPL_ERROR_UNSPECIFIED Generic error condition, that should be reported to the CPL Team.

The selected FITS file table extension is just read and converted into the cpl_table conventions.

cpl_table* cpl_table_load_window ( const char *  filename,
int  xtnum,
int  check_nulls,
const cpl_array *  selcol,
cpl_size  firstrow,
cpl_size  nrow 
)

Load part of a FITS table extension into a new cpl_table.

Parameters
filenameName of FITS file with at least one table extension.
xtnumNumber of extension to read, starting from 1.
check_nullsIf set to 0, identified invalid values are not marked.
selcolArray with the names of the columns to extract.
firstrowFirst table row to extract.
nrowNumber of rows to extract.
Returns
New table, or NULL in case of failure.
Errors
CPL_ERROR_NULL_INPUT Input filename is a NULL pointer.
CPL_ERROR_FILE_NOT_FOUND A file named as specified in filename is not found.
CPL_ERROR_BAD_FILE_FORMAT The input file is not in FITS format.
CPL_ERROR_ILLEGAL_INPUT The specified FITS file extension is not a table. Or the specified number of rows to extract is less than zero. Or the array of column names to extract contains empty fields.
CPL_ERROR_ACCESS_OUT_OF_RANGE xtnum is greater than the number of FITS extensions in the FITS file, or is less than 1. Or firstrow is either less than zero, or greater than the number of rows in the table.
CPL_ERROR_DATA_NOT_FOUND The FITS table has no columns. Or selcol includes columns that are not found in table.
CPL_ERROR_UNSPECIFIED Generic error condition, that should be reported to the CPL Team.

The selected FITS file table extension is just read in the specified columns and rows intervals, and converted into the cpl_table conventions. If selcol is NULL, all columns are selected.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, and CPL_ERROR_ILLEGAL_INPUT.

cpl_error_code cpl_table_logarithm_column ( cpl_table *  table,
const char *  name,
double  base 
)

Compute the logarithm of column values.

Parameters
tablePointer to table.
nameTable column name.
baseLogarithm base.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.
CPL_ERROR_ILLEGAL_INPUT The input base is not positive.

Each column element is replaced by its logarithm in the specified base. The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation, but zero or negative elements are invalidated by this operation. In case of complex numbers, values very close to the origin may cause an overflow. The imaginary part of the result is chosen in the interval [-pi/ln(base),pi/ln(base)], so it should be kept in mind that doing the logarithm of exponential of a complex number will not always express the phase angle with the same number. For instance, the exponential in base 2 of (5.00, 5.00) is (-30.33, -10.19), and the logarithm in base 2 of the latter will be expressed as (5.00, -4.06).

References CPL_ERROR_NONE.

cpl_error_code cpl_table_move_column ( cpl_table *  to_table,
const char *  name,
cpl_table *  from_table 
)

Move a column from a table to another.

Parameters
to_tableTarget table.
nameName of column to move.
from_tableSource table.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_INCOMPATIBLE_INPUT The input tables do not have the same number of rows.
CPL_ERROR_ILLEGAL_INPUT Source and target tables are the same table.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in the source table.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in the target table.

Move a column from a table to another.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_multiply_columns ( cpl_table *  table,
const char *  to_name,
const char *  from_name 
)

Multiply two numeric or complex table columns.

Parameters
tablePointer to table.
to_nameName of target column.
from_nameName of column to be multiplied with target column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or any column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with any specified name is not found in table.
CPL_ERROR_INVALID_TYPE Any specified column is neither numerical nor complex, or it is an array column.

The columns are multiplied element by element, and the result of the multiplication is stored in the target column. See the documentation of the function cpl_table_add_columns() for further details.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_multiply_scalar ( cpl_table *  table,
const char *  name,
double  value 
)

Multiply a numerical or complex column by a constant.

Parameters
tablePointer to table.
nameColumn name.
valueMultiplication factor.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.

See the description of the function cpl_table_add_scalar().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_multiply_scalar_complex ( cpl_table *  table,
const char *  name,
double complex  value 
)

Multiply a numerical or complex column by a complex constant.

Parameters
tablePointer to table.
nameColumn name.
valueMultiplication factor.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.

See the description of the function cpl_table_add_scalar_complex().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_name_column ( cpl_table *  table,
const char *  from_name,
const char *  to_name 
)

Rename a table column.

Parameters
tablePointer to table.
from_nameName of table column to rename.
to_nameNew name of column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the specified from_name is not found in table.
CPL_ERROR_ILLEGAL_OUTPUT A column with the specified to_name already exists in table.

This function is used to change the name of a column.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_OUTPUT, and CPL_ERROR_NULL_INPUT.

cpl_table* cpl_table_new ( cpl_size  length)

Create an empty table structure.

Parameters
lengthNumber of rows in table.
Returns
Pointer to new table, or NULL in case of error.
Errors
CPL_ERROR_ILLEGAL_INPUT The specified length is negative.

This function allocates and initialises memory for a table data container. A new table is created with no columns, but the size of the columns that will be created is defined in advance, to ensure that all columns will be created with the same length. All table rows are marked a priori as selected. This should be considered the normal status of a table, as long as no row selection has been applied to it.

References cpl_calloc(), CPL_ERROR_ILLEGAL_INPUT, and cpl_error_set.

Referenced by cpl_plot_column(), cpl_plot_columns(), cpl_ppm_match_points(), cpl_table_duplicate(), cpl_table_extract(), and cpl_table_extract_selected().

cpl_error_code cpl_table_new_column ( cpl_table *  table,
const char *  name,
cpl_type  type 
)

Create an empty column in a table.

Parameters
tablePointer to table.
nameName of the new column.
typeType of the new column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified type is not supported.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function allocates memory for a new column of specified type, excluding array types (for creating a column of arrays use the function cpl_table_new_column_array(), where the column depth must also be specified). The new column name must be different from any other column name in the table. All the elements of the new column are marked as invalid.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, and CPL_TYPE_STRING.

Referenced by cpl_ppm_match_points(), and cpl_table_copy_structure().

cpl_error_code cpl_table_new_column_array ( cpl_table *  table,
const char *  name,
cpl_type  type,
cpl_size  depth 
)

Create an empty column of arrays in a table.

Parameters
tablePointer to table.
nameName of the new column.
typeType of the new column.
depthDepth of the new column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_INVALID_TYPE The specified type is not supported.
CPL_ERROR_ILLEGAL_INPUT The specified depth is negative.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function allocates memory for a new column of specified array type, (for creating a column of simple scalars or character strings use the function cpl_table_new_column() instead). It doesn't make any difference if a simple or an array type is specified, the corresponding array type will always be created (e.g., specifying a type CPL_TYPE_INT or a type CPL_TYPE_INT | CPL_TYPE_POINTER would always create a column of type CPL_TYPE_INT | CPL_TYPE_POINTER). The new column name must be different from any other column name in the table. All the elements of the new column are marked as invalid.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and CPL_TYPE_LONG.

Referenced by cpl_table_copy_structure().

cpl_size cpl_table_not_selected ( cpl_table *  table)

Select unselected table rows, and unselect selected ones.

Parameters
tablePointer to table.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.

Select unselected table rows, and unselect selected ones.

References CPL_ERROR_NULL_INPUT.

cpl_size cpl_table_or_selected ( cpl_table *  table,
const char *  name1,
cpl_table_select_operator  operator,
const char *  name2 
)

Select from unselected table rows, by comparing the values of two numerical columns.

Parameters
tablePointer to table.
name1Name of first table column.
operatorRelational operator.
name2Name of second table column.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column names are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with any of the specified names is not found in table.
CPL_ERROR_INVALID_TYPE Invalid types for comparison.

Either both columns must be numerical, or they both must be strings. The comparison between strings is lexicographical. Comparison between complex types and array types are not supported.

Both columns must be numerical. For all the unselected table rows, the values of the specified columns are compared. The table rows fulfilling the comparison are selected. Invalid elements from either columns never fulfill any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, CPL_NOT_LESS_THAN. See also the function cpl_table_and_selected().

References CPL_ERROR_INVALID_TYPE, cpl_table_select_row(), CPL_TYPE_COMPLEX, CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, and CPL_TYPE_STRING.

cpl_size cpl_table_or_selected_double ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
double  value 
)

Select from unselected table rows, by comparing double column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE.

For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the description of the function cpl_table_and_selected_double().

References cpl_table_select_row(), and CPL_TYPE_DOUBLE.

cpl_size cpl_table_or_selected_double_complex ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
double complex  value 
)

Select from unselected table rows, by comparing double complex column values with a complex constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX.
CPL_ERROR_ILLEGAL_INPUT Operator other than CPL_EQUAL_TO or CPL_NOT_EQUAL_TO was specified.

For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO and CPL_NOT_EQUAL_TO. If the table has no rows, no error is set, and 0 is returned. See also the description of the function cpl_table_and_selected_double_complex().

References CPL_ERROR_ILLEGAL_INPUT, cpl_table_select_row(), and CPL_TYPE_DOUBLE_COMPLEX.

cpl_size cpl_table_or_selected_float ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
float  value 
)

Select from unselected table rows, by comparing float column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT.

For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the description of the function cpl_table_and_selected_float().

References cpl_table_select_row(), and CPL_TYPE_FLOAT.

cpl_size cpl_table_or_selected_float_complex ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
float complex  value 
)

Select from unselected table rows, by comparing float complex column values with a complex constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX.
CPL_ERROR_ILLEGAL_INPUT Operator other than CPL_EQUAL_TO or CPL_NOT_EQUAL_TO was specified.

For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO and CPL_NOT_EQUAL_TO. If the table has no rows, no error is set, and 0 is returned. See also the description of the function cpl_table_and_selected_float_complex().

References CPL_ERROR_ILLEGAL_INPUT, cpl_table_select_row(), and CPL_TYPE_FLOAT_COMPLEX.

cpl_size cpl_table_or_selected_int ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
int  value 
)

Select from unselected table rows, by comparing integer column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT.

For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the description of the function cpl_table_and_selected_int().

References cpl_table_select_row(), and CPL_TYPE_INT.

cpl_size cpl_table_or_selected_invalid ( cpl_table *  table,
const char *  name 
)

Select from unselected table rows all rows with an invalid value in a specified column.

Parameters
tablePointer to table.
nameColumn name.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.

For all the unselected table rows, all the rows containing invalid values at the specified column are selected. See also the function cpl_table_and_selected_invalid().

References cpl_table_select_all(), cpl_table_select_row(), and CPL_TYPE_STRING.

cpl_size cpl_table_or_selected_long ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
long  value 
)

Select from unselected table rows, by comparing long column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG.

For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the description of the function cpl_table_and_selected_long().

References cpl_table_select_row(), and CPL_TYPE_LONG.

cpl_size cpl_table_or_selected_long_long ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
long long  value 
)

Select from unselected table rows, by comparing long long column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
valueReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG.

For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the description of the function cpl_table_and_selected_long_long().

References cpl_table_select_row(), and CPL_TYPE_LONG_LONG.

cpl_size cpl_table_or_selected_string ( cpl_table *  table,
const char *  name,
cpl_table_select_operator  operator,
const char *  string 
)

Select from unselected table rows, by comparing column values with a constant.

Parameters
tablePointer to table.
nameColumn name.
operatorRelational operator.
stringReference value.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_STRING.
CPL_ERROR_ILLEGAL_INPUT Invalid regular expression.

For all the unselected table rows, the values of the specified column are compared with the reference value. The comparison function used is the C standard strcmp(), but in case the relational operators CPL_EQUAL_TO or CPL_NOT_EQUAL_TO are specified, the comparison string is treated as a regular expression. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are CPL_EQUAL_TO, CPL_NOT_EQUAL_TO, CPL_GREATER_THAN, CPL_NOT_GREATER_THAN, CPL_LESS_THAN, and CPL_NOT_LESS_THAN. If the table has no rows, no error is set, and 0 is returned. See also the description of the function cpl_table_and_selected_string().

References CPL_ERROR_ILLEGAL_INPUT, cpl_table_select_row(), and CPL_TYPE_STRING.

cpl_size cpl_table_or_selected_window ( cpl_table *  table,
cpl_size  start,
cpl_size  count 
)

Select from unselected rows only those within a table segment.

Parameters
tableTable to handle.
startFirst row of table segment.
countLength of segment.
Returns
Current number of selected rows, or a negative number in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.

All the unselected table rows that are within the specified interval are selected. If the sum of start and count goes beyond the end of the input table, rows are checked up to the end of the table. See also the function cpl_table_and_selected_window().

References cpl_calloc(), CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_table_select_all().

cpl_error_code cpl_table_power_column ( cpl_table *  table,
const char *  name,
double  exponent 
)

Compute the power of column values.

Parameters
tablePointer to table.
nameColumn name.
exponentConstant exponent.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex.

Each column element is replaced by its power to the specified exponent. The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation, but elements are invalidated at any illegal operation: if the specified exponent is not negative, all column elements must be not negative, and if the specified exponent is negative, all column elements must be positive; column values not fulfilling this condition will be invalidated. Only in case of complex arrays this operation becomes legal. If the exponent is 0.0, then any (valid) column element would be assigned the value 1.0.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_real_column ( cpl_table *  table,
const char *  name 
)

Compute the real part value of table column elements.

Parameters
tablePointer to table.
nameColumn name.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex.

Each column element is replaced by its real party value only. Invalid elements are not modified by this operation. If the column is complex, its type will be turned to real (CPL_TYPE_FLOAT_COMPLEX will be changed into CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE_COMPLEX will be changed into CPL_TYPE_DOUBLE), and any pointer retrieved by calling cpl_table_get_data_float_complex(), cpl_table_get_data_double_complex(), etc., should be discarded.

References CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, cpl_table_get_column_type(), CPL_TYPE_COMPLEX, CPL_TYPE_DOUBLE, and CPL_TYPE_FLOAT.

cpl_error_code cpl_table_save ( const cpl_table *  table,
const cpl_propertylist pheader,
const cpl_propertylist header,
const char *  filename,
unsigned  mode 
)

Save a cpl_table to a FITS file.

Parameters
tableInput table.
pheaderPrimary header entries.
headerTable header entries.
filenameName of output FITS file.
modeOutput mode.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or filename are NULL pointers.
CPL_ERROR_UNSUPPORTED_MODE A saving mode other than CPL_IO_CREATE and CPL_IO_EXTEND was specified.
CPL_ERROR_FILE_NOT_FOUND While mode is set to CPL_IO_EXTEND, a file named as specified in filename is not found.
CPL_ERROR_BAD_FILE_FORMAT While mode is set to CPL_IO_EXTEND, the specified file is not in FITS format.
CPL_ERROR_FILE_NOT_CREATED The FITS file could not be created.
CPL_ERROR_FILE_IO The FITS file could only partially be created.
CPL_ERROR_UNSPECIFIED Generic error condition, that should be reported to the CPL Team.

This function can be used to convert a CPL table into a binary FITS table extension. If the mode is set to CPL_IO_CREATE, a new FITS file will be created containing an empty primary array, with just one FITS table extension. An existing (and writable) FITS file with the same name would be overwritten. If the mode flag is set to CPL_IO_EXTEND, a new table extension would be appended to an existing FITS file. Note that also in this case the file must be writable (and do not take for granted that a file is writable just because it was created by the same application, as this depends from the system umask). Two property lists may be passed to this function, both optionally. The first property list, pheader, is just used if the mode is set to CPL_IO_CREATE, and it is assumed to contain entries for the FITS file primary header. In pheader any property name related to the FITS convention, as SIMPLE, BITPIX, NAXIS, EXTEND, BLOCKED, and END, are ignored: such entries would be written anyway to the primary header and set to some standard values.

If a NULL pheader is passed, the primary array would be created with just such entries, that are mandatory in any regular FITS file. The second property list, header, is assumed to contain entries for the FITS table extension header. In this property list any property name related to the FITS convention, as XTENSION, BITPIX, NAXIS, PCOUNT, GCOUNT, and END, and to the table structure, as TFIELDS, TTYPEi, TUNITi, TDISPi, TNULLi, TFORMi, would be ignored: such entries are always computed internally, to guarantee their consistency with the actual table structure. A DATE keyword containing the date of table creation in ISO8601 format is also added automatically.

Note
  • Invalid strings in columns of type CPL_TYPE_STRING are written to FITS as blanks.
  • Invalid values in columns of type CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE will be written to the FITS file as a NaN.
  • Invalid values in columns of type CPL_TYPE_INT and CPL_TYPE_LONG_LONG are the only ones that need a specific code to be explicitly assigned to them. This can be realised by calling the functions cpl_table_fill_invalid_int() and cpl_table_fill_invalid_long_long(), respectively, for each table column of type CPL_TYPE_INT and CPL_TYPE_LONG_LONG containing invalid values, just before saving the table to FITS. The numerical values identifying invalid integer column elements are written to the FITS keywords TNULLn (where n is the column sequence number). Beware that if valid column elements have the value identical to the chosen null-code, they will also be considered invalid in the FITS convention.
cpl_error_code cpl_table_select_all ( cpl_table *  table)

Select all table rows.

Parameters
tablePointer to table.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.

The table selection flags are reset, meaning that they are all marked as selected. This is the initial state of any table.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_free().

Referenced by cpl_table_erase_invalid(), cpl_table_erase_invalid_rows(), cpl_table_erase_selected(), cpl_table_erase_window(), cpl_table_insert(), cpl_table_insert_window(), cpl_table_or_selected_invalid(), cpl_table_or_selected_window(), cpl_table_set_size(), and cpl_table_shift_column().

cpl_error_code cpl_table_select_row ( cpl_table *  table,
cpl_size  row 
)

Flag a table row as selected.

Parameters
tablePointer to table.
rowRow to select.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.

Flag a table row as selected. Any previous selection is kept.

References cpl_calloc(), CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_free().

Referenced by cpl_table_or_selected(), cpl_table_or_selected_double(), cpl_table_or_selected_double_complex(), cpl_table_or_selected_float(), cpl_table_or_selected_float_complex(), cpl_table_or_selected_int(), cpl_table_or_selected_invalid(), cpl_table_or_selected_long(), cpl_table_or_selected_long_long(), and cpl_table_or_selected_string().

cpl_error_code cpl_table_set ( cpl_table *  table,
const char *  name,
cpl_size  row,
double  value 
)

Write a value to a numerical table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is not numerical, or it is of type array.

Write a value to a numerical column element. The value is cast to the accessed column type according to the C casting rules. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_array ( cpl_table *  table,
const char *  name,
cpl_size  row,
const cpl_array *  array 
)

Write an array to an array table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write the array.
arrayArray to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type array.
CPL_ERROR_INCOMPATIBLE_INPUT The size of the input array is different from the depth of the specified column.

Write an array to a table column of type array. The written value can also be a NULL pointer, that is equivalent to a call to cpl_table_set_invalid(). Note that the array is copied, therefore the original can be modified without affecting the table element. To "plug" an array directly into a table element, use the function cpl_table_get_data_array(). Beware that the "plugged" array must have the same type and depth declared for the column.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_column_depth ( cpl_table *  table,
const char *  name,
cpl_size  depth 
)

Modify depth of a column of arrays.

Parameters
tablePointer to table.
nameColumn name.
depthNew column depth.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any input argument is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The specified new depth is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_TYPE_MISMATCH The column with the specified name is not an array type.

This function is applicable just to columns of arrays. The contents of the arrays in the specified column will be unchanged up to the lesser of the new and old depths. If the depth is increased, the extra array elements would be flagged as invalid. The pointers to array data may change, therefore pointers previously retrieved by calling cpl_array_get_data_int(), cpl_array_get_data_string(), etc. should be discarded.

References CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NONE.

cpl_error_code cpl_table_set_column_dimensions ( cpl_table *  table,
const char *  name,
const cpl_array *  dimensions 
)

Set the dimensions of a table column of arrays.

Parameters
tablePointer to table.
nameColumn name.
dimensionsInteger array containing the sizes of the column dimensions
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_ILLEGAL_INPUT Either the specified column is not of type array, or the dimensions array contains invalid elements.
CPL_ERROR_TYPE_MISMATCH The dimensions array is not of type CPL_TYPE_INT.
CPL_ERROR_INCOMPATIBLE_INPUT The specified dimensions are incompatible with the total number of elements in the column arrays.

Set the number of dimensions of a column. If the dimensions array has size less than 2, nothing is done and no error is returned.

References CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_set_column_format ( cpl_table *  table,
const char *  name,
const char *  format 
)

Give a new format to a table column.

Parameters
tablePointer to table.
nameColumn name.
formatNew format.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

The input format string is duplicated before being used as the column format. If format is a NULL pointer, "%%s" will be used if the column is of type CPL_TYPE_STRING, "% 1.5e" if the column is of type CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE, and "% 7d" if it is of type CPL_TYPE_INT. The format associated to a column has no effect on any operation performed on columns, and it is used just in the printf() calls made while printing a table using the function cpl_table_dump(). This information is lost after saving the table in FITS format using cpl_table_save().

References CPL_ERROR_NONE.

Referenced by cpl_table_copy_structure().

cpl_error_code cpl_table_set_column_invalid ( cpl_table *  table,
const char *  name,
cpl_size  start,
cpl_size  count 
)

Invalidate a column segment.

Parameters
tablePointer to table.
nameName of table column to access.
startPosition where to begin invalidation.
countNumber of column elements to invalidate.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or start is outside the table boundaries.
CPL_ERROR_ILLEGAL_INPUT count is negative.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

All the column elements in the specified interval are invalidated. In the case of either a string or an array column, the corresponding strings or arrays are set free. If the sum of start and count exceeds the number of rows in the table, the column is invalidated up to its end.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_column_unit ( cpl_table *  table,
const char *  name,
const char *  unit 
)

Give a new unit to a table column.

Parameters
tablePointer to table.
nameColumn name.
unitNew unit.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

The input unit string is duplicated before being used as the column unit. If unit is a NULL pointer, the column will be unitless. The unit associated to a column has no effect on any operation performed on columns, and it must be considered just an optional description of the content of a column. It is however saved to a FITS file when using cpl_table_save().

References CPL_ERROR_NONE.

Referenced by cpl_table_copy_structure().

cpl_error_code cpl_table_set_complex ( cpl_table *  table,
const char *  name,
cpl_size  row,
double complex  value 
)

Write a complex value to a complex numerical table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is not complex, or it is of type array.

Write a value to a complex column element. The value is cast to the accessed column type according to the C casting rules. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_double ( cpl_table *  table,
const char *  name,
cpl_size  row,
double  value 
)

Write a value to a double table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE.

Write a value to a table column of type CPL_TYPE_DOUBLE. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

Note
For automatic conversion to the column type, use the function cpl_table_set().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_double_complex ( cpl_table *  table,
const char *  name,
cpl_size  row,
double complex  value 
)

Write a value to a double complex table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_DOUBLE_COMPLEX.

Write a value to a table column of type CPL_TYPE_DOUBLE_COMPLEX. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

Note
For automatic conversion to the column type, use the function cpl_table_set_complex().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_float ( cpl_table *  table,
const char *  name,
cpl_size  row,
float  value 
)

Write a value to a float table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT.

Write a value to a table column of type CPL_TYPE_FLOAT. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

Note
For automatic conversion to the column type, use the function cpl_table_set().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_float_complex ( cpl_table *  table,
const char *  name,
cpl_size  row,
float complex  value 
)

Write a value to a float complex table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_FLOAT_COMPLEX.

Write a value to a table column of type CPL_TYPE_FLOAT_COMPLEX. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

Note
For automatic conversion to the column type, use the function cpl_table_set_complex().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_int ( cpl_table *  table,
const char *  name,
cpl_size  row,
int  value 
)

Write a value to an integer table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_INT.

Write a value to a table column of type CPL_TYPE_INT. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

Note
For automatic conversion to the column type, use the function cpl_table_set().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_invalid ( cpl_table *  table,
const char *  name,
cpl_size  row 
)

Flag a column element as invalid.

Parameters
tablePointer to table.
nameName of table column to access.
rowRow where to write a null.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.

In the case of either a string or an array column, the corresponding string or array is set free and its pointer is set to NULL. For other data types, the corresponding table element is flagged internally as invalid.

References CPL_ERROR_NONE.

Referenced by cpl_ppm_match_points().

cpl_error_code cpl_table_set_long ( cpl_table *  table,
const char *  name,
cpl_size  row,
long  value 
)

Write a value to an long table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG.

Write a value to a table column of type CPL_TYPE_LONG. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

Note
For automatic conversion to the column type, use the function cpl_table_set().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_long_long ( cpl_table *  table,
const char *  name,
cpl_size  row,
long long  value 
)

Write a value to an long long table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write value.
valueValue to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_LONG_LONG.

Write a value to a table column of type CPL_TYPE_LONG_LONG. The written value is automatically marked as valid. To invalidate a column value use cpl_table_set_invalid(). Table rows are counted starting from 0.

Note
For automatic conversion to the column type, use the function cpl_table_set().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_set_size ( cpl_table *  table,
cpl_size  new_length 
)

Resize a table to a new number of rows.

Parameters
tablePointer to table.
new_lengthNew number of rows in table.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The specified new length is negative.

The contents of the columns will be unchanged up to the lesser of the new and old sizes. If the table is expanded, the extra table rows would just contain invalid elements. The table selection flags are set back to "all selected". The pointer to column data may change, therefore pointers previously retrieved by calling cpl_table_get_data_int(), cpl_table_get_data_string(), etc. should be discarded.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_table_get_ncol(), and cpl_table_select_all().

Referenced by cpl_table_erase_selected().

cpl_error_code cpl_table_set_string ( cpl_table *  table,
const char *  name,
cpl_size  row,
const char *  value 
)

Write a character string to a string table column element.

Parameters
tablePointer to table.
nameName of table column to access.
rowPosition where to write the character string.
valueCharacter string to write.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or name are NULL pointers.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_TYPE_MISMATCH The specified column is not of type CPL_TYPE_STRING.

Write a string to a table column of type CPL_TYPE_STRING. The written value can also be a NULL pointer, that is equivalent to a call to cpl_table_set_invalid(). Note that the character string is copied, therefore the original can be modified without affecting the table element. To "plug" a character string directly into a table element, use the function cpl_table_get_data_string().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_shift_column ( cpl_table *  table,
const char *  name,
cpl_size  shift 
)

Shift the position of numeric or complex column values.

Parameters
tablePointer to table.
nameName of table column to shift.
shiftShift column values by so many rows.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex.
CPL_ERROR_ILLEGAL_INPUT The absolute value of shift is greater than the column length.

The position of all column values is shifted by the specified amount. If shift is positive, all values will be moved toward the bottom of the column, otherwise toward its top. In either case as many column elements as the amount of the shift will be left undefined, either at the top or at the bottom of the column according to the direction of the shift. These column elements will be marked as invalid. This function is applicable just to numeric and complex columns, and not to strings and or array types. The selection flags are always set back to "all selected" after this operation.

References CPL_ERROR_NONE, and cpl_table_select_all().

cpl_error_code cpl_table_sort ( cpl_table *  table,
const cpl_propertylist reflist 
)

Sort table rows according to columns values.

Parameters
tablePointer to table.
reflistNames of reference columns with corresponding sorting mode.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or reflist are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND Any reference column specified in reflist is not found in table.
CPL_ERROR_ILLEGAL_INPUT The size of reflist exceeds the total number of columns in table, or reflist is empty.
CPL_ERROR_TYPE_MISMATCH The input reflist includes properties of type different from CPL_TYPE_BOOL.
CPL_ERROR_UNSUPPORTED_MODE Any reference column specified in reflist is of type array.

The table rows are sorted according to the values of the specified reference columns. The reference column names are listed in the input reflist, that associates to each reference column a boolean value. If the associated value is FALSE, the table is sorted according to the ascending values of the specified column, otherwise if the associated value is TRUE, the table is sorted according to the descending values of that column. The sorting will be performed by comparing the values of the first reference column; if the compared values are equal, the values from the next column in the list are compared, and so on till the end of the reference columns list. An invalid table element is always treated as if it doesn't fulfill any comparison, i.e., sorting either by increasing or decreasing column values would accumulate invalid elements toward the top of the table. The sorting is made in-place, therefore pointers to data retrieved with calls to cpl_table_get_data_<TYPE>() remain valid.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_malloc(), and cpl_propertylist_get_size().

cpl_error_code cpl_table_subtract_columns ( cpl_table *  table,
const char *  to_name,
const char *  from_name 
)

Subtract two numeric or complex table columns.

Parameters
tablePointer to table.
to_nameName of target column.
from_nameName of column to be subtracted from target column.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or any column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with any specified name is not found in table.
CPL_ERROR_INVALID_TYPE Any specified column is neither numerical non complex, or it is an array column.

The columns are subtracted element by element, and the result of the subtraction is stored in the target column. See the documentation of the function cpl_table_add_columns() for further details.

References CPL_ERROR_NONE.

cpl_error_code cpl_table_subtract_scalar ( cpl_table *  table,
const char *  name,
double  value 
)

Subtract a constant value from a numerical or complex column.

Parameters
tablePointer to table.
nameColumn name.
valueValue to subtract.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.

See the description of the function cpl_table_add_scalar().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_subtract_scalar_complex ( cpl_table *  table,
const char *  name,
double complex  value 
)

Subtract a constant complex value from a numerical or complex column.

Parameters
tablePointer to table.
nameColumn name.
valueValue to subtract.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table or column name are NULL pointers.
CPL_ERROR_DATA_NOT_FOUND A column with the specified name is not found in table.
CPL_ERROR_INVALID_TYPE The specified column is neither numerical nor complex, or it is an array column.

See the description of the function cpl_table_add_scalar_complex().

References CPL_ERROR_NONE.

cpl_error_code cpl_table_unselect_all ( cpl_table *  table)

Unselect all table rows.

Parameters
tablePointer to table.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.

The table selection flags are all unset, meaning that no table rows are selected.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_free().

Referenced by cpl_table_and_selected(), cpl_table_and_selected_double(), cpl_table_and_selected_double_complex(), cpl_table_and_selected_float(), cpl_table_and_selected_float_complex(), cpl_table_and_selected_int(), cpl_table_and_selected_invalid(), cpl_table_and_selected_long(), cpl_table_and_selected_long_long(), and cpl_table_and_selected_string().

cpl_error_code cpl_table_unselect_row ( cpl_table *  table,
cpl_size  row 
)

Flag a table row as unselected.

Parameters
tablePointer to table.
rowRow to unselect.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The input table has zero length, or row is outside the table boundaries.

Flag a table row as unselected. Any previous selection is kept.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

Referenced by cpl_table_and_selected(), cpl_table_and_selected_double(), cpl_table_and_selected_double_complex(), cpl_table_and_selected_float(), cpl_table_and_selected_float_complex(), cpl_table_and_selected_int(), cpl_table_and_selected_invalid(), cpl_table_and_selected_long(), cpl_table_and_selected_long_long(), and cpl_table_and_selected_string().

void* cpl_table_unwrap ( cpl_table *  table,
const char *  name 
)

Unwrap a table column.

Parameters
tablePointer to table.
nameName of the column.
Returns
Pointer to internal data buffer, NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND A column with the given name is not found in table.
CPL_ERROR_UNSUPPORTED_MODE The column with the given name is a column of arrays.

This function deallocates all the memory associated to a table column, with the exception of its data buffer. This type of destructor should be used on columns created with the cpl_table_wrap_<type>() constructors, if the data buffer specified then was not allocated using the functions of the cpl_memory module. In such a case, the data buffer should be deallocated separately. See the documentation of the functions cpl_table_wrap_<type>().

Note
Columns of arrays cannot be unwrapped. Use the function cpl_table_get_data_array() to directly access the column data buffer.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, and cpl_table_get_column_type().

cpl_array* cpl_table_where_selected ( const cpl_table *  table)

Get array of indexes to selected table rows.

Parameters
tablePointer to table.
Returns
Indexes to selected table rows, or NULL in case of error.
Errors
CPL_ERROR_NULL_INPUT Input table is a NULL pointer.

Get array of indexes to selected table rows. If no rows are selected, an array of size zero is returned. The returned array must be deleted using cpl_array_delete().

References cpl_array_fill_window(), cpl_array_get_data_cplsize(), cpl_array_new(), CPL_ERROR_NULL_INPUT, and CPL_TYPE_SIZE.

cpl_error_code cpl_table_wrap_double ( cpl_table *  table,
double *  data,
const char *  name 
)

Create in table a new double column obtained from existing data.

Parameters
tablePointer to table.
nameName of the new column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function creates a new column of type CPL_TYPE_DOUBLE that will encapsulate the given data. See the description of cpl_table_wrap_int() for further details.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_wrap_double_complex ( cpl_table *  table,
double complex *  data,
const char *  name 
)

Create in table a new double complex column from existing data.

Parameters
tablePointer to table.
nameName of the new column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function creates a new column of type CPL_TYPE_FLOAT_COMPLEX that will encapsulate the given data. See the description of cpl_table_wrap_int() for further details.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_wrap_float ( cpl_table *  table,
float *  data,
const char *  name 
)

Create in table a new float column obtained from existing data.

Parameters
tablePointer to table.
nameName of the new column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function creates a new column of type CPL_TYPE_FLOAT that will encapsulate the given data. See the description of cpl_table_wrap_int() for further details.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_wrap_float_complex ( cpl_table *  table,
float complex *  data,
const char *  name 
)

Create in table a new float complex column obtained from existing data.

Parameters
tablePointer to table.
nameName of the new column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function creates a new column of type CPL_TYPE_FLOAT_COMPLEX that will encapsulate the given data. See the description of cpl_table_wrap_int() for further details.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_wrap_int ( cpl_table *  table,
int *  data,
const char *  name 
)

Create in table a new integer column obtained from existing data.

Parameters
tablePointer to table where to create the new column.
nameName of the new column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function creates a new column of type CPL_TYPE_INT that will encapsulate the given data. The size of the input data array is not checked in any way, and it is expected to match the number of rows assigned to the given table. The pointed data values are all taken as valid: invalid values should be marked using the functions cpl_table_set_invalid() and cpl_table_set_column_invalid(). The data buffer is not copied, so it should not be deallocated while the table column is still in use: the functions cpl_table_erase_column() or cpl_table_delete() would take care of deallocating it. To avoid problems with the memory managment, the specified data buffer should have been allocated using the functions of the cpl_memory module, and statically allocated data should be avoided too. If this is not possible, then the function cpl_table_unwrap() should be used on that column before destroying the table that contains it.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_wrap_long ( cpl_table *  table,
long *  data,
const char *  name 
)

Create in table a new long column obtained from existing data.

Parameters
tablePointer to table.
nameName of the new column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function creates a new column of type CPL_TYPE_LONG that will encapsulate the given data. See the description of cpl_table_wrap_int() for further details.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_wrap_long_long ( cpl_table *  table,
long long *  data,
const char *  name 
)

Create in table a new long long column obtained from existing data.

Parameters
tablePointer to table.
nameName of the new column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function creates a new column of type CPL_TYPE_LONG_LONG that will encapsulate the given data. See the description of cpl_table_wrap_int() for further details.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_table_wrap_string ( cpl_table *  table,
char **  data,
const char *  name 
)

Create in table a new string column obtained from existing data.

Parameters
tablePointer to table.
nameName of the new column.
dataExisting data buffer.
Returns
CPL_ERROR_NONE on success.
Errors
CPL_ERROR_NULL_INPUT Any argument is a NULL pointer.
CPL_ERROR_ILLEGAL_OUTPUT A column with the same name already exists in table.

This function creates a new column of type CPL_TYPE_STRING that will encapsulate the given data. See the description of cpl_table_wrap_int() for further details, especially with regard to memory managment. In the specific case of string columns the described restrictions applies also to the single column elements (strings). To deallocate specific column elements the functions cpl_table_set_invalid() and cpl_table_set_column_invalid() should be used.

References CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl-6.6.1/html/group__cpl__imagelist.html0000644000460300003120000045434312553662431015420 00000000000000 Common Pipeline Library Reference Manual: Imagelists
Common Pipeline Library Reference Manual  6.6.1
Imagelists
cpl_error_code cpl_imagelist_add (cpl_imagelist *in1, const cpl_imagelist *in2)
 Add two image lists, the first one is replaced by the result. More...
 
cpl_error_code cpl_imagelist_subtract (cpl_imagelist *in1, const cpl_imagelist *in2)
 Subtract two image lists, the first one is replaced by the result. More...
 
cpl_error_code cpl_imagelist_multiply (cpl_imagelist *in1, const cpl_imagelist *in2)
 Multiply two image lists, the first one is replaced by the result. More...
 
cpl_error_code cpl_imagelist_divide (cpl_imagelist *in1, const cpl_imagelist *in2)
 Divide two image lists, the first one is replaced by the result. More...
 
cpl_error_code cpl_imagelist_add_image (cpl_imagelist *imlist, const cpl_image *img)
 Add an image to an image list. More...
 
cpl_error_code cpl_imagelist_subtract_image (cpl_imagelist *imlist, const cpl_image *img)
 Subtract an image from an image list. More...
 
cpl_error_code cpl_imagelist_multiply_image (cpl_imagelist *imlist, const cpl_image *img)
 Multiply an image list by an image. More...
 
cpl_error_code cpl_imagelist_divide_image (cpl_imagelist *imlist, const cpl_image *img)
 Divide an image list by an image. More...
 
cpl_error_code cpl_imagelist_add_scalar (cpl_imagelist *imlist, double addend)
 Elementwise addition of a scalar to each image in the imlist. More...
 
cpl_error_code cpl_imagelist_subtract_scalar (cpl_imagelist *imlist, double subtrahend)
 Elementwise subtraction of a scalar from each image in the imlist. More...
 
cpl_error_code cpl_imagelist_multiply_scalar (cpl_imagelist *imlist, double factor)
 Elementwise multiplication of the imlist with a scalar. More...
 
cpl_error_code cpl_imagelist_divide_scalar (cpl_imagelist *imlist, double divisor)
 Elementwise division of each image in the imlist with a scalar. More...
 
cpl_error_code cpl_imagelist_logarithm (cpl_imagelist *imlist, double base)
 Compute the elementwise logarithm of each image in the imlist. More...
 
cpl_error_code cpl_imagelist_exponential (cpl_imagelist *imlist, double base)
 Compute the elementwise exponential of each image in the imlist. More...
 
cpl_error_code cpl_imagelist_power (cpl_imagelist *imlist, double exponent)
 Compute the elementwise power of each image in the imlist. More...
 
cpl_error_code cpl_imagelist_normalise (cpl_imagelist *imlist, cpl_norm mode)
 Normalize each image in the list. More...
 
cpl_error_code cpl_imagelist_threshold (cpl_imagelist *imlist, double lo_cut, double hi_cut, double assign_lo_cut, double assign_hi_cut)
 Threshold all pixel values to an interval. More...
 
cpl_image * cpl_image_new_from_accepted (const cpl_imagelist *imlist)
 Create a contribution map from the bad pixel maps of the images. More...
 
cpl_image * cpl_imagelist_collapse_create (const cpl_imagelist *imlist)
 Average an imagelist to a single image. More...
 
cpl_image * cpl_imagelist_collapse_minmax_create (const cpl_imagelist *self, cpl_size nlow, cpl_size nhigh)
 Average with rejection an imagelist to a single image. More...
 
cpl_image * cpl_imagelist_collapse_sigclip_create (const cpl_imagelist *self, double kappalow, double kappahigh, double keepfrac, cpl_collapse_mode mode, cpl_image *contrib)
 Collapse an imagelist with kappa-sigma-clipping rejection. More...
 
cpl_image * cpl_imagelist_collapse_median_create (const cpl_imagelist *self)
 Create a median image from the input imagelist. More...
 
cpl_imagelist * cpl_imagelist_swap_axis_create (const cpl_imagelist *ilist, cpl_swap_axis mode)
 Swap the axis of an image list. More...
 
cpl_imagelist * cpl_imagelist_new (void)
 Create an empty imagelist. More...
 
cpl_imagelist * cpl_imagelist_load (const char *filename, cpl_type im_type, cpl_size xtnum)
 Load a FITS file extension into a list of images. More...
 
cpl_imagelist * cpl_imagelist_load_window (const char *filename, cpl_type im_type, cpl_size xtnum, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Load images windows from a FITS file extension into an image list. More...
 
cpl_size cpl_imagelist_get_size (const cpl_imagelist *imlist)
 Get the number of images in the imagelist. More...
 
cpl_image * cpl_imagelist_get (cpl_imagelist *imlist, cpl_size inum)
 Get an image from a list of images. More...
 
const cpl_image * cpl_imagelist_get_const (const cpl_imagelist *imlist, cpl_size inum)
 Get an image from a list of images. More...
 
cpl_error_code cpl_imagelist_set (cpl_imagelist *imlist, cpl_image *im, cpl_size pos)
 Insert an image into an imagelist. More...
 
cpl_image * cpl_imagelist_unset (cpl_imagelist *self, cpl_size pos)
 Remove an image from an imagelist. More...
 
void cpl_imagelist_empty (cpl_imagelist *self)
 Empty an imagelist and deallocate all its images. More...
 
void cpl_imagelist_unwrap (cpl_imagelist *self)
 Free memory used by a cpl_imagelist object, except the images. More...
 
void cpl_imagelist_delete (cpl_imagelist *self)
 Free all memory used by a cpl_imagelist object including the images. More...
 
cpl_error_code cpl_imagelist_cast (cpl_imagelist *self, const cpl_imagelist *other, cpl_type type)
 Cast an imagelist, optionally in-place. More...
 
cpl_imagelist * cpl_imagelist_duplicate (const cpl_imagelist *imlist)
 Copy an image list. More...
 
cpl_error_code cpl_imagelist_erase (cpl_imagelist *imlist, const cpl_vector *valid)
 Reject one or more images in a list according to an array of flags. More...
 
cpl_error_code cpl_imagelist_save (const cpl_imagelist *self, const char *filename, cpl_type type, const cpl_propertylist *pl, unsigned mode)
 Save an imagelist to disk in FITS format. More...
 
int cpl_imagelist_is_uniform (const cpl_imagelist *imlist)
 Determine if an imagelist contains images of equal size and type. More...
 
cpl_error_code cpl_imagelist_dump_structure (const cpl_imagelist *self, FILE *stream)
 Dump structural information of images in an imagelist. More...
 
cpl_error_code cpl_imagelist_dump_window (const cpl_imagelist *self, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, FILE *stream)
 Dump pixel values of images in a CPL imagelist. More...
 

Detailed Description

This module provides functions to create, use, and destroy a cpl_imagelist. A cpl_imagelist is an ordered list of cpl_images. All images in a list must have the same pixel-type and the same dimensions.

Synopsis:
#include "cpl_imagelist.h"

Function Documentation

cpl_image* cpl_image_new_from_accepted ( const cpl_imagelist *  imlist)

Create a contribution map from the bad pixel maps of the images.

Parameters
imlistThe imagelist
Returns
The contributions map (a CPL_TYPE_INT cpl_image) or NULL on error
See also
cpl_imagelist_is_uniform()

The returned map counts for each pixel the number of good pixels in the list. The returned map has to be deallocated with cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input image list is not valid

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_image_add_scalar(), cpl_image_get_bpm_const(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_new(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_is_uniform(), and CPL_TYPE_INT.

Referenced by cpl_imagelist_collapse_create().

cpl_error_code cpl_imagelist_add ( cpl_imagelist *  in1,
const cpl_imagelist *  in2 
)

Add two image lists, the first one is replaced by the result.

Parameters
in1first input image list (modified)
in2image list to add
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_add()

The two input lists must have the same size, the image number n in the list in2 is added to the image number n in the list in1.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input images have different sizes
cpl_error_code cpl_imagelist_add_image ( cpl_imagelist *  imlist,
const cpl_image *  img 
)

Add an image to an image list.

Parameters
imlistinput image list (modified)
imgimage to add
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_add()

The passed image is added to each image of the passed image list.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
cpl_error_code cpl_imagelist_add_scalar ( cpl_imagelist *  imlist,
double  addend 
)

Elementwise addition of a scalar to each image in the imlist.

Parameters
imlistImagelist to be modified in place.
addendNumber to add
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_image_add_scalar()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_add_scalar().

cpl_error_code cpl_imagelist_cast ( cpl_imagelist *  self,
const cpl_imagelist *  other,
cpl_type  type 
)

Cast an imagelist, optionally in-place.

Parameters
selfDestination imagelist
otherSource imagelist, or NULL to cast in-place
typeIf called with empty self, cast to this pixel-type
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_cast()
Note
If called with a non-empty self in an out-of-place cast, the input images are cast to the type already present in self and appended to the output list. In this case the parameter type is ignored.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if the destination pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the same pointer is passed twice
  • CPL_ERROR_ILLEGAL_INPUT if the passed type is invalid
  • CPL_ERROR_TYPE_MISMATCH if the passed image type is complex and requested casting type is non-complex.
  • CPL_ERROR_INVALID_TYPE if the passed pixel type is not supported

References CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_image_cast(), cpl_image_delete(), cpl_image_get_type(), cpl_imagelist_delete(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_new(), cpl_imagelist_set(), cpl_imagelist_unset(), and cpl_malloc().

cpl_image* cpl_imagelist_collapse_create ( const cpl_imagelist *  imlist)

Average an imagelist to a single image.

Parameters
imlistthe input images list
Returns
the average image or NULL on error case.
See also
cpl_imagelist_is_uniform()

The returned image has to be deallocated with cpl_image_delete().

The bad pixel maps of the images in the input list are taken into account, the result image pixels are flagged as rejected for those where there were no good pixel at the same position in the input image list.

For integer pixel types, the averaging is performed using integer division.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input image list is not valid

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_image_accept_all(), cpl_image_add(), cpl_image_delete(), cpl_image_divide(), cpl_image_duplicate(), cpl_image_fill_rejected(), cpl_image_get_bpm_const(), cpl_image_new_from_accepted(), and cpl_imagelist_is_uniform().

cpl_image* cpl_imagelist_collapse_median_create ( const cpl_imagelist *  self)

Create a median image from the input imagelist.

Parameters
selfThe input image list
Returns
The median image of the input pixel type or NULL on error
Note
The created image has to be deallocated with cpl_image_delete()

The input image list can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE.

On success each pixel in the created image is the median of the values on the same pixel position in the input image list. If for a given pixel all values in the input image list are rejected, the resulting pixel is set to zero and flagged as rejected.

The median is defined here as the middle value of an odd number of sorted samples and for an even number of samples as the mean of the two central values. Note that with an even number of samples the median may not be among the input samples.

Also, note that in the case of an even number of integer data, the mean value will be computed using integer arithmetic. Cast your integer data to a floating point pixel type if that is not the desired behavior.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input image list is not valid
  • CPL_ERROR_INVALID_TYPE if the passed image list pixel type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_imagelist_get_const(), and cpl_imagelist_is_uniform().

cpl_image* cpl_imagelist_collapse_minmax_create ( const cpl_imagelist *  self,
cpl_size  nlow,
cpl_size  nhigh 
)

Average with rejection an imagelist to a single image.

Parameters
selfThe image list to average
nlowNumber of low rejected values
nhighNumber of high rejected values
Returns
The average image or NULL on error
Note
The returned image has to be deallocated with cpl_image_delete().

The input images are averaged, for each pixel position the nlow lowest pixels and the nhigh highest pixels are discarded for the average computation.

The input image list can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. The created image will be of the same type.

On success each pixel in the created image is the average of the non-rejected values on the pixel position in the input image list.

For a given pixel position any bad pixels (i.e. values) are handled as follows: Given n bad values on a given pixel position, n/2 of those values are assumed to be low outliers and n/2 of those values are assumed to be high outliers. Any low or high rejection will first reject up to n/2 bad values and if more values need to be rejected that rejection will take place on the good values. This rationale behind this is to allow the rejection of outliers to include bad pixels without introducing a bias. If for a given pixel all values in the input image list are rejected, the resulting pixel is set to zero and flagged as rejected.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an the input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input image list is not valid or if the sum of the rejections is not lower than the number of images or if nlow or nhigh is negative
  • CPL_ERROR_INVALID_TYPE if the passed image list type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), and cpl_imagelist_is_uniform().

cpl_image* cpl_imagelist_collapse_sigclip_create ( const cpl_imagelist *  self,
double  kappalow,
double  kappahigh,
double  keepfrac,
cpl_collapse_mode  mode,
cpl_image *  contrib 
)

Collapse an imagelist with kappa-sigma-clipping rejection.

Parameters
selfThe input imagelist
kappalowkappa-factor for lower clipping threshold
kappahighkappa-factor for upper clipping threshold
keepfracThe fraction of values to keep (0.0 < keepfrac <= 1.0)
modeClipping mode, CPL_COLLAPSE_MEAN or CPL_COLLAPSE_MEDIAN
contribPre-allocated integer-image for contribution map or NULL
Returns
The collapsed image or NULL on error case.
Note
The returned image has to be deallocated with cpl_image_delete().

The collapsing is an iterative process which will stop when it converges (i.e. an iteration did not reject any values for a given pixel) or when the next iteration would reduce the fraction of values to keep to less than or equal to keepfrac.

A call with keepfrac == 1.0 will thus perform no clipping.

Supported modes: CPL_COLLAPSE_MEAN: The center value of the acceptance range will be the mean. CPL_COLLAPSE_MEDIAN: The center value of the acceptance range will be the median. CPL_COLLAPSE_MEDIAN_MEAN: The center value of the acceptance range will be the median in the first iteration and in subsequent iterations it will be the mean.

For each pixel position the pixels whose value is higher than center + kappahigh * stdev or lower than center - kappalow * stdev are discarded for the subsequent center and stdev computation, where center is defined according to the clipping mode, and stdev is the standard deviation of the values at that pixel position. Since the acceptance interval must be non-empty, the sum of kappalow and kappahigh must be positive. A typical call has both kappalow and kappahigh positive.

The minimum number of values that the clipping can select is 2. This is because the clipping criterion is based on the sample standard deviation, which needs at least two values to be defined. This means that all calls with (positive) values of keepfrac less than 2/n will behave the same. To ensure that the values in (at least) i planes out of n are kept, keepfrac can be set to (i - 0.5) / n, e.g. to keep at least 50 out of 100 values, keepfrac can be set to 0.495.

The output pixel is set to the mean of the non-clipped values, also in the median mode. Regardless of the input pixel type, the mean is computed in double precision. The result is then cast to the output-pixel type, which is identical to the input pixel type.

The input parameter contrib is optional. It must be either NULL or point to a pre-allocated image of type CPL_TYPE_INT and size equal to the images in the imagelist. On success, it will contain the contribution map, i.e. the number of kept (non-clipped) values after the iterative process on every pixel.

Bad pixels are ignored from the start. This means that with a sufficient number of bad pixels, the fraction of good values will be less than keepfrac. In this case no iteration is performed at all. If there is at least one good value available, then the mean will be based on the good value(s). If for a given pixel position there are no good values, then that pixel is set to zero, rejected as bad and if available the value in the contribution map is set to zero.

The input imagelist can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_DATA_NOT_FOUND if there are less than 2 images in the list
  • CPL_ERROR_ILLEGAL_INPUT if the sum of kappalow and kappahigh is non-positive,
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if keepfrac is outside the required interval which is 0.0 < keepfrac <= 1.0
  • CPL_ERROR_TYPE_MISMATCH if contrib is non-NULL but not of type CPL_TYPE_INT
  • CPL_ERROR_INCOMPATIBLE_INPUT if contrib is non-NULL but of a size incompatible with the input imagelist
  • CPL_ERROR_INVALID_TYPE if the type of the input imagelist is unsupported
  • CPL_ERROR_UNSUPPORTED_MODE if the passed mode is none of the above listed

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_image_get_data_int(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_is_uniform(), and CPL_TYPE_INT.

void cpl_imagelist_delete ( cpl_imagelist *  self)

Free all memory used by a cpl_imagelist object including the images.

Parameters
selfThe image list or NULL
Returns
Nothing
See also
cpl_imagelist_empty(), cpl_imagelist_unwrap()

References cpl_imagelist_empty(), and cpl_imagelist_unwrap().

Referenced by cpl_fit_imagelist_polynomial_window(), cpl_geom_img_offset_combine(), cpl_imagelist_cast(), and cpl_imagelist_load_frameset().

cpl_error_code cpl_imagelist_divide ( cpl_imagelist *  in1,
const cpl_imagelist *  in2 
)

Divide two image lists, the first one is replaced by the result.

Parameters
in1first input image list (modified)
in2image list to divide
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_divide()
cpl_imagelist_add()
cpl_error_code cpl_imagelist_divide_image ( cpl_imagelist *  imlist,
const cpl_image *  img 
)

Divide an image list by an image.

Parameters
imlistinput image list (modified)
imgimage for division
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_divide()
cpl_imagelist_add_image()
cpl_error_code cpl_imagelist_divide_scalar ( cpl_imagelist *  imlist,
double  divisor 
)

Elementwise division of each image in the imlist with a scalar.

Parameters
imlistImagelist to be modified in place.
divisorNon-zero number to divide with
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_imagelist_add_scalar()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_divide_scalar().

cpl_error_code cpl_imagelist_dump_structure ( const cpl_imagelist *  self,
FILE *  stream 
)

Dump structural information of images in an imagelist.

Parameters
selfImagelist to dump
streamOutput stream, accepts stdout or stderr
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if a write operation fails

References cpl_ensure_code, CPL_ERROR_FILE_IO, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_dump_structure(), and cpl_imagelist_get_const().

cpl_error_code cpl_imagelist_dump_window ( const cpl_imagelist *  self,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
FILE *  stream 
)

Dump pixel values of images in a CPL imagelist.

Parameters
selfImagelist to dump
llxSpecifies the window position
llySpecifies the window position
urxSpecifies the window position
urySpecifies the window position
streamOutput stream, accepts stdout or stderr
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if a write operation fails
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the defined window is not in the image
  • CPL_ERROR_ILLEGAL_INPUT if the window definition is wrong (e.g llx > urx)

References cpl_ensure_code, CPL_ERROR_FILE_IO, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_dump_window(), and cpl_imagelist_get_const().

cpl_imagelist* cpl_imagelist_duplicate ( const cpl_imagelist *  imlist)

Copy an image list.

Parameters
imlistSource image list.
Returns
1 newly allocated image list, or NULL on error.

Copy an image list into a new image list object. The returned image list must be deallocated using cpl_imagelist_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_image_duplicate(), cpl_imagelist_new(), and cpl_imagelist_set().

void cpl_imagelist_empty ( cpl_imagelist *  self)

Empty an imagelist and deallocate all its images.

Parameters
selfThe image list or NULL
Returns
Nothing
See also
cpl_imagelist_empty(), cpl_imagelist_delete()
Note
If self is NULL nothing is done and no error is set.

After the call the image list can be populated again. It must eventually be deallocted with a call to cpl_imagelist_delete().

References cpl_image_delete(), and cpl_imagelist_unset().

Referenced by cpl_imagelist_delete().

cpl_error_code cpl_imagelist_erase ( cpl_imagelist *  imlist,
const cpl_vector *  valid 
)

Reject one or more images in a list according to an array of flags.

Parameters
imlistNon-empty imagelist to examine for image rejection.
validVector of flags (>=-0.5: valid, <-0.5: invalid)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

This function takes an imagelist and a vector of flags. The imagelist and vector must have equal lengths.

Images flagged as invalid are removed from the list.

The removal of image(s) will reduce the length of the list accordingly.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the vector size and the image list size are different

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_delete(), cpl_vector_get(), and cpl_vector_get_size().

cpl_error_code cpl_imagelist_exponential ( cpl_imagelist *  imlist,
double  base 
)

Compute the elementwise exponential of each image in the imlist.

Parameters
imlistImagelist to be modified in place.
baseBase of the exponential.
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_image_exponential()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_exponential().

cpl_image* cpl_imagelist_get ( cpl_imagelist *  imlist,
cpl_size  inum 
)

Get an image from a list of images.

Parameters
imlistthe image list
inumthe image id (from 0 to number of images-1)
Returns
A pointer to the image or NULL in error case.

The returned pointer refers to already allocated data.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if inum is bigger thant the list size
  • CPL_ERROR_ILLEGAL_INPUT if inum is negative

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_fft_imagelist(), and cpl_imagelist_swap_axis_create().

cpl_size cpl_imagelist_get_size ( const cpl_imagelist *  imlist)
int cpl_imagelist_is_uniform ( const cpl_imagelist *  imlist)

Determine if an imagelist contains images of equal size and type.

Parameters
imlistThe imagelist to check
Returns
Zero if uniform, positive if non-uniform and negative on error.

The function returns 1 if the list is empty.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_image_get_size_x(), cpl_image_get_size_y(), and cpl_image_get_type().

Referenced by cpl_fit_imagelist_polynomial_window(), cpl_geom_img_offset_combine(), cpl_geom_img_offset_fine(), cpl_geom_img_offset_saa(), cpl_image_new_from_accepted(), cpl_imagelist_collapse_create(), cpl_imagelist_collapse_median_create(), cpl_imagelist_collapse_minmax_create(), cpl_imagelist_collapse_sigclip_create(), cpl_imagelist_save(), and cpl_imagelist_swap_axis_create().

cpl_imagelist* cpl_imagelist_load ( const char *  filename,
cpl_type  im_type,
cpl_size  xtnum 
)

Load a FITS file extension into a list of images.

Parameters
filenameThe FITS file name
im_typeType of the images in the created image list
xtnumThe extension number (0 for primary HDU)
Returns
The loaded list of images or NULL on error.
See also
cpl_image_load()

This function loads all the images of a specified extension (NAXIS=2 or 3) into an image list.

Type can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT or CPL_TYPE_INT. The loaded images have an empty bad pixel map.

The returned cpl_imagelist must be deallocated using cpl_imagelist_delete()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if xtnum is negative
  • CPL_ERROR_INVALID_TYPE if the passed type is not supported
  • CPL_ERROR_FILE_IO If the file cannot be opened or read, or if xtnum is bigger than the number of extensions in the FITS file
  • CPL_ERROR_BAD_FILE_FORMAT if the file cannot be parsed
  • CPL_ERROR_DATA_NOT_FOUND if the data cannot be read from the file
cpl_imagelist* cpl_imagelist_load_window ( const char *  filename,
cpl_type  im_type,
cpl_size  xtnum,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Load images windows from a FITS file extension into an image list.

Parameters
filenameThe FITS file name
im_typeType of the images in the created image list
xtnumThe extension number (0 for primary HDU)
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
The loaded list of image windows or NULL on error.
See also
cpl_imagelist_load(), cpl_image_load_window()
Note
The returned cpl_imagelist must be deallocated using cpl_imagelist_delete()

This function loads all the image windows of a specified extension in an image list.

Type can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT or CPL_TYPE_INT.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if xtnum is negative
  • CPL_ERROR_INVALID_TYPE if the passed type is not supported
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if xtnum is bigger than the number of extensions in the FITS file
  • CPL_ERROR_BAD_FILE_FORMAT if the file cannot be parsed
  • CPL_ERROR_DATA_NOT_FOUND if the data cannot be read from the file
cpl_error_code cpl_imagelist_logarithm ( cpl_imagelist *  imlist,
double  base 
)

Compute the elementwise logarithm of each image in the imlist.

Parameters
imlistImagelist to be modified in place.
baseBase of the logarithm.
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_image_logarithm()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_logarithm().

cpl_error_code cpl_imagelist_multiply ( cpl_imagelist *  in1,
const cpl_imagelist *  in2 
)

Multiply two image lists, the first one is replaced by the result.

Parameters
in1first input image list (modified)
in2image list to multiply
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_multiply()
cpl_imagelist_add()
cpl_error_code cpl_imagelist_multiply_image ( cpl_imagelist *  imlist,
const cpl_image *  img 
)

Multiply an image list by an image.

Parameters
imlistinput image list (modified)
imgimage to multiply
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_multiply()
cpl_imagelist_add_image()
cpl_error_code cpl_imagelist_multiply_scalar ( cpl_imagelist *  imlist,
double  factor 
)

Elementwise multiplication of the imlist with a scalar.

Parameters
imlistImagelist to be modified in place.
factorNumber to multiply with
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_imagelist_add_scalar()

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_multiply_scalar().

cpl_imagelist* cpl_imagelist_new ( void  )

Create an empty imagelist.

Returns
1 newly allocated cpl_imagelist
See also
cpl_imagelist_set()

The returned cpl_imagelist must be deallocated using cpl_imagelist_delete()

References cpl_calloc().

Referenced by cpl_fit_imagelist_polynomial_window(), cpl_geom_img_offset_combine(), cpl_imagelist_cast(), cpl_imagelist_duplicate(), cpl_imagelist_load_frameset(), and cpl_imagelist_swap_axis_create().

cpl_error_code cpl_imagelist_normalise ( cpl_imagelist *  imlist,
cpl_norm  mode 
)

Normalize each image in the list.

Parameters
imlistImagelist to modify.
modeNormalization mode.
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_normalise()

The list may be partly modified if an error occurs.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_normalise().

cpl_error_code cpl_imagelist_power ( cpl_imagelist *  imlist,
double  exponent 
)

Compute the elementwise power of each image in the imlist.

Parameters
imlistImagelist to be modified in place.
exponentScalar exponent
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_image_power()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_power().

cpl_error_code cpl_imagelist_save ( const cpl_imagelist *  self,
const char *  filename,
cpl_type  type,
const cpl_propertylist pl,
unsigned  mode 
)

Save an imagelist to disk in FITS format.

Parameters
selfImagelist to save
filenameName of the FITS file to write
typeThe type used to represent the data in the file
plProperty list for the output header or NULL
modeThe desired output options (combined with bitwise or)
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_save()

This function saves an image list to a FITS file. If a property list is provided, it is written to the named file before the pixels are written.

Supported image lists types are CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT.

The type used in the file can be one of: CPL_TYPE_UCHAR (8 bit unsigned), CPL_TYPE_SHORT (16 bit signed), CPL_TYPE_USHORT (16 bit unsigned), CPL_TYPE_INT (32 bit signed), CPL_TYPE_FLOAT (32 bit floating point), or CPL_TYPE_DOUBLE (64 bit floating point). Additionally, the special value CPL_TYPE_UNSPECIFIED is allowed. This value means that the type used for saving is the pixel type of the input image. Using the image pixel type as saving type ensures that the saving incurs no loss of information.

Supported output modes are CPL_IO_CREATE (create a new file), CPL_IO_EXTEND (extend an existing file with a new extension) and CPL_IO_APPEND (append a list of images to the last data unit, which must already contain compatible image(s)).

When the data written to disk are of an integer type, the output mode CPL_IO_EXTEND can be combined (via bit-wise or) with an option for tile-compression. This compression of integer data is lossless. The options are: CPL_IO_COMPRESS_GZIP, CPL_IO_COMPRESS_RICE, CPL_IO_COMPRESS_HCOMPRESS, CPL_IO_COMPRESS_PLIO. With compression the type must be CPL_TYPE_UNSPECIFIED or CPL_TYPE_INT.

In extend and append mode, make sure that the file has write permissions. You may have problems if you create a file in your application and append something to it with the umask set to 222. In this case, the file created by your application would not be writable, and the append would fail.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the type or the mode is not supported
  • CPL_ERROR_FILE_IO if the file cannot be written
  • CPL_ERROR_INVALID_TYPE if the passed image list type is not supported

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_imagelist_is_uniform().

cpl_error_code cpl_imagelist_set ( cpl_imagelist *  imlist,
cpl_image *  im,
cpl_size  pos 
)

Insert an image into an imagelist.

Parameters
imlistThe imagelist
imThe image to insert
posThe list position (from 0 to number of images)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

It is allowed to specify the position equal to the number of images in the list. This will increment the size of the imagelist.

No action occurs if an image is inserted more than once into the same position. It is allowed to insert the same image into two different positions in a list.

The image is inserted at the position pos in the image list. If the image already there is only present in that one location in the list, then the image is deallocated.

It is not allowed to insert images of different size into a list.

The added image is owned by the imagelist object, which deallocates it cpl_imagelist_delete is called. Other option is to use cpl_imagelist_unset to recover ownership of the image, in which case the cpl_imagelist object is not longer responsible for deallocating it.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pos is negative
  • CPL_ERROR_TYPE_MISMATCH if im and imlist are of different types
  • CPL_ERROR_INCOMPATIBLE_INPUT if im and imlist have different sizes
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if pos is bigger than the number of images in imlist

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_image_delete(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), and cpl_realloc().

Referenced by cpl_fit_imagelist_polynomial_window(), cpl_geom_img_offset_combine(), cpl_imagelist_cast(), cpl_imagelist_duplicate(), and cpl_imagelist_load_frameset().

cpl_error_code cpl_imagelist_subtract ( cpl_imagelist *  in1,
const cpl_imagelist *  in2 
)

Subtract two image lists, the first one is replaced by the result.

Parameters
in1first input image list (modified)
in2image list to subtract
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_subtract()
cpl_imagelist_add()
cpl_error_code cpl_imagelist_subtract_image ( cpl_imagelist *  imlist,
const cpl_image *  img 
)

Subtract an image from an image list.

Parameters
imlistinput image list (modified)
imgimage to subtract
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_subtract()
cpl_imagelist_add_image()
cpl_error_code cpl_imagelist_subtract_scalar ( cpl_imagelist *  imlist,
double  subtrahend 
)

Elementwise subtraction of a scalar from each image in the imlist.

Parameters
imlistImagelist to be modified in place.
subtrahendNumber to subtract
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_imagelist_add_scalar()

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_subtract_scalar().

cpl_imagelist* cpl_imagelist_swap_axis_create ( const cpl_imagelist *  ilist,
cpl_swap_axis  mode 
)

Swap the axis of an image list.

Parameters
ilistThe image list to swap
modeThe swapping mode
Returns
The swapped image list or NULL in error case

This function is intended for users that want to use the cpl_imagelist object as a cube. Swapping the axis would give them access to the usual functions in the 3 dimensions. This has the cost that it duplicates the memory consumption, which can be a problem for big amounts of data.

Image list can be CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The mode can be either CPL_SWAP_AXIS_XZ or CPL_SWAP_AXIS_YZ

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if mode is not equal to one of the possible values or if the image list is not valid
  • CPL_ERROR_INVALID_TYPE if the passed image list type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_image_reject_from_mask(), cpl_imagelist_get(), cpl_imagelist_get_const(), cpl_imagelist_get_size(), cpl_imagelist_is_uniform(), cpl_imagelist_new(), cpl_mask_delete(), cpl_mask_get_data(), and cpl_mask_new().

cpl_error_code cpl_imagelist_threshold ( cpl_imagelist *  imlist,
double  lo_cut,
double  hi_cut,
double  assign_lo_cut,
double  assign_hi_cut 
)

Threshold all pixel values to an interval.

Parameters
imlistImage list to threshold.
lo_cutLower bound.
hi_cutHigher bound.
assign_lo_cutValue to assign to pixels below low bound.
assign_hi_cutValue to assign to pixels above high bound.
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_threshold()

Threshold the images of the list using cpl_image_threshold() The input image list is modified.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if lo_cut is bigger than hi_cut

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_threshold().

cpl_image* cpl_imagelist_unset ( cpl_imagelist *  self,
cpl_size  pos 
)

Remove an image from an imagelist.

Parameters
selfThe imagelist
posThe list position (from 0 to number of images-1)
Returns
The pointer to the removed image or NULL in error case

The specified image is not deallocated, it is simply removed from the list. The pointer to the image is returned to let the user decide to deallocate it or not. Eventually, the image will have to be deallocated with cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pos is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if pos is bigger than the number of images in self

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_geom_img_offset_combine(), cpl_imagelist_cast(), and cpl_imagelist_empty().

void cpl_imagelist_unwrap ( cpl_imagelist *  self)

Free memory used by a cpl_imagelist object, except the images.

Parameters
selfThe image list or NULL
Returns
Nothing
See also
cpl_imagelist_empty()
Note
The caller must have pointers to all images in the list and is reponsible for their deallocation. If self is NULL nothing is done and no error is set.

References cpl_free().

Referenced by cpl_geom_img_offset_saa(), and cpl_imagelist_delete().

cpl-6.6.1/html/form_1.png0000644000460300003120000000211012553662433012054 00000000000000‰PNG  IHDR¶t9Éî0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï·IDATxíÛ®ì( D‹K.@þÿoÇ€“Ñiæ­[A»w‘Õel¯ðððð¿Ží0<]9ì“$:oˆG(Sža žÝûEÆÀ0®/ÂoæTRÐÞÚóÓcó#!•¡¯“>z¡L=´ó¯• eJï^ÙJ#Ô<ñåÖØBË4ÿ &ÊØ¥" ] £ î:–X¦ôy^aQaâGTˆñ—kb æœð¯µweJ˜à½§µ®Ì=hÕûX·®Ì=¢Â5dW(’8kè­óªbRž*ŸÚý‘fïòOue L Ez¼NQðq[{Pß»wXv/e[}Û/ˆ¤jNP™ëÊœHïÑ•…GúÂÿ°GSæÄEe©ù/s]ˆV¶³vkUÎüZήøaKa>åôa¢+ÑóFÙàÝØ<°ßЦõN=è¶õ’ðv㌲‡9ìV–8'|°[´xteáAoò Ò¢ªÊœPñ2G ‹‰®Ì‰Ôþy¦]ÎÏáNÅ÷ÍX¶š||.‚ ê!9¢lÖåï‚°WIîÂcç lØv—ÃßK³-‰´ãÓO6ÚÑêÉu›7©!å y4e½ò’™UUVÔYëDUÄA{Ë¥™F4e$Z[ß¾¶ë;•.Þ‡éájDUaèeŸîëú•ÝW¡Ê¡üMiG¿ËöŽ gÞÀÒãgÀ›¸Óá“ï¥êÑ••ÇV<&º2't ‰¼òJteááwòB›GSfe³Á|óÕ²åË$¦Vôñ4¸ÁÊk‚¨‰»3aSJ1±Ó+å6œz¨àÜéþ£UîJÀ;bNÑ<*Ks£ÇIëûð@¨‡OóhÊrå¥ù:Ñ”‘ÉÝÖˆ¦,=|ŠZx°"ˆ^$S3™ʵNWtiq¹ñóΈ¢¼‰vH¦KէЈT’x~xÔ°”¦_á@Ój—ÄA1xòéžz•ZsIl´¯\"š+Qq«‹¨²¢‘o‚K¬,=½ýäZV‚•ÑCå¯ìž²eX¹h ÇWïLq'Ч¨L°ò&ZÙ ]õ|Š2q8“N´¥G:¬8Eº{ °–„rv/Çnõ0§ñ´âµG8·»¼Z=ŠòU»ŠZTY9(—SÂÜ› ƒ+K­çïL°òòH;€x„b8C‚þ ¤"ˆV6êã^EÒ1¹öÈ¿ `xš4'þ½G:¼ˆ§+ †Ñ•¿ŒJ(SBí]üC‘üüüü÷ãnõ)á×R4IEND®B`‚cpl-6.6.1/html/group__cpl__vector.html0000644000460300003120000051304512553662432014740 00000000000000 Common Pipeline Library Reference Manual: Vector
Common Pipeline Library Reference Manual  6.6.1
Vector

Functions

cpl_error_code cpl_vector_add (cpl_vector *v1, const cpl_vector *v2)
 Add a cpl_vector to another. More...
 
cpl_error_code cpl_vector_add_scalar (cpl_vector *v, double addend)
 Elementwise addition of a scalar to a vector. More...
 
cpl_error_code cpl_vector_convolve_symmetric (cpl_vector *smoothed, const cpl_vector *conv_kernel)
 Convolve a 1d-signal with a symmetric 1D-signal. More...
 
cpl_error_code cpl_vector_copy (cpl_vector *destination, const cpl_vector *source)
 This function copies contents of a vector into another vector. More...
 
cpl_size cpl_vector_correlate (cpl_vector *vxc, const cpl_vector *v1, const cpl_vector *v2)
 Cross-correlation of two vectors. More...
 
void cpl_vector_delete (cpl_vector *v)
 Delete a cpl_vector. More...
 
cpl_error_code cpl_vector_divide (cpl_vector *v1, const cpl_vector *v2)
 Divide two vectors element-wise. More...
 
cpl_error_code cpl_vector_divide_scalar (cpl_vector *v, double divisor)
 Elementwise division of a vector with a scalar. More...
 
void cpl_vector_dump (const cpl_vector *v, FILE *stream)
 Dump a cpl_vector as ASCII to a stream. More...
 
cpl_vector * cpl_vector_duplicate (const cpl_vector *v)
 This function duplicates an existing vector and allocates memory. More...
 
cpl_error_code cpl_vector_exponential (cpl_vector *v, double base)
 Compute the exponential of all vector elements. More...
 
cpl_vector * cpl_vector_extract (const cpl_vector *v, cpl_size istart, cpl_size istop, cpl_size istep)
 Extract a sub_vector from a vector. More...
 
cpl_error_code cpl_vector_fill (cpl_vector *v, double val)
 Fill a cpl_vector. More...
 
cpl_error_code cpl_vector_fill_kernel_profile (cpl_vector *profile, cpl_kernel type, double radius)
 Fill a vector with a kernel profile. More...
 
cpl_vector * cpl_vector_filter_lowpass_create (const cpl_vector *v, cpl_lowpass filter_type, cpl_size hw)
 Apply a low-pass filter to a cpl_vector. More...
 
cpl_vector * cpl_vector_filter_median_create (const cpl_vector *v, cpl_size hw)
 Apply a 1d median filter of given half-width to a cpl_vector. More...
 
cpl_size cpl_vector_find (const cpl_vector *sorted, double key)
 In a sorted vector find the element closest to the given value. More...
 
cpl_error_code cpl_vector_fit_gaussian (const cpl_vector *x, const cpl_vector *sigma_x, const cpl_vector *y, const cpl_vector *sigma_y, cpl_fit_mode fit_pars, double *x0, double *sigma, double *area, double *offset, double *mse, double *red_chisq, cpl_matrix **covariance)
 Apply a 1d gaussian fit. More...
 
double cpl_vector_get (const cpl_vector *in, cpl_size idx)
 Get an element of the vector. More...
 
double * cpl_vector_get_data (cpl_vector *in)
 Get a pointer to the data part of the vector. More...
 
const double * cpl_vector_get_data_const (const cpl_vector *in)
 Get a pointer to the data part of the vector. More...
 
double cpl_vector_get_max (const cpl_vector *v)
 Get the maximum of the cpl_vector. More...
 
double cpl_vector_get_mean (const cpl_vector *v)
 Compute the mean value of vector elements. More...
 
double cpl_vector_get_median (cpl_vector *v)
 Compute the median of the elements of a vector. More...
 
double cpl_vector_get_median_const (const cpl_vector *v)
 Compute the median of the elements of a vector. More...
 
double cpl_vector_get_min (const cpl_vector *v)
 Get the minimum of the cpl_vector. More...
 
cpl_size cpl_vector_get_size (const cpl_vector *in)
 Get the size of the vector. More...
 
double cpl_vector_get_stdev (const cpl_vector *v)
 Compute the bias-corrected standard deviation of a vectors elements. More...
 
double cpl_vector_get_sum (const cpl_vector *v)
 Get the sum of the elements of the cpl_vector. More...
 
cpl_vector * cpl_vector_load (const char *filename, cpl_size xtnum)
 Load a list of values from a FITS file. More...
 
cpl_error_code cpl_vector_logarithm (cpl_vector *v, double base)
 Compute the element-wise logarithm. More...
 
cpl_error_code cpl_vector_multiply (cpl_vector *v1, const cpl_vector *v2)
 Multiply two vectors component-wise. More...
 
cpl_error_code cpl_vector_multiply_scalar (cpl_vector *v, double factor)
 Elementwise multiplication of a vector with a scalar. More...
 
cpl_vector * cpl_vector_new (cpl_size n)
 Create a new cpl_vector. More...
 
cpl_vector * cpl_vector_new_lss_kernel (double slitw, double fwhm)
 Create Right Half of a symmetric smoothing kernel for LSS. More...
 
cpl_error_code cpl_vector_power (cpl_vector *v, double exponent)
 Compute the power of all vector elements. More...
 
double cpl_vector_product (const cpl_vector *v1, const cpl_vector *v2)
 Compute the vector dot product. More...
 
cpl_vector * cpl_vector_read (const char *filename)
 Read a list of values from an ASCII file and create a cpl_vector. More...
 
cpl_error_code cpl_vector_save (const cpl_vector *self, const char *filename, cpl_type type, const cpl_propertylist *pl, unsigned mode)
 Save a vector to a FITS file. More...
 
cpl_error_code cpl_vector_set (cpl_vector *in, cpl_size idx, double value)
 Set an element of the vector. More...
 
cpl_error_code cpl_vector_set_size (cpl_vector *in, cpl_size newsize)
 Resize the vector. More...
 
cpl_error_code cpl_vector_sort (cpl_vector *self, cpl_sort_direction dir)
 Sort a cpl_vector. More...
 
cpl_error_code cpl_vector_sqrt (cpl_vector *v)
 Compute the sqrt of a cpl_vector. More...
 
cpl_error_code cpl_vector_subtract (cpl_vector *v1, const cpl_vector *v2)
 Subtract a cpl_vector from another. More...
 
cpl_error_code cpl_vector_subtract_scalar (cpl_vector *v, double subtrahend)
 Elementwise subtraction of a scalar from a vector. More...
 
void * cpl_vector_unwrap (cpl_vector *v)
 Delete a cpl_vector except the data array. More...
 
cpl_vector * cpl_vector_wrap (cpl_size n, double *data)
 Create a cpl_vector from existing data. More...
 

Detailed Description

This module provides functions to handle cpl_vector.

A cpl_vector is an object containing a list of values (as doubles) and the (always positive) number of values. The functionalities provided here are simple ones like sorting, statistics, or simple operations. The cpl_bivector object is composed of two of these vectors.

Synopsis:
#include "cpl_vector.h"

Function Documentation

cpl_error_code cpl_vector_add ( cpl_vector *  v1,
const cpl_vector *  v2 
)

Add a cpl_vector to another.

Parameters
v1First cpl_vector (modified)
v2Second cpl_vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

The second vector is added to the first one. The input first vector is modified.

The input vectors must have the same size.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if v1 and v2 have different sizes

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_vector_add_scalar ( cpl_vector *  v,
double  addend 
)

Elementwise addition of a scalar to a vector.

Parameters
vcpl_vector to modify
addendNumber to add
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Add a number to each element of the cpl_vector.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_vector_convolve_symmetric ( cpl_vector *  smoothed,
const cpl_vector *  conv_kernel 
)

Convolve a 1d-signal with a symmetric 1D-signal.

Parameters
smoothedPreallocated vector to be smoothed in place
conv_kernelVector with symmetric convolution function
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
Deprecated:
Unstable API, may change or disappear. Do not use in new code!

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_vector_delete(), cpl_vector_duplicate(), cpl_vector_get_data(), cpl_vector_get_data_const(), and cpl_vector_get_size().

cpl_error_code cpl_vector_copy ( cpl_vector *  destination,
const cpl_vector *  source 
)

This function copies contents of a vector into another vector.

Parameters
destinationdestination cpl_vector
sourcesource cpl_vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_vector_set_size() if source and destination have different sizes.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_vector_set_size().

Referenced by cpl_bivector_copy(), and cpl_vector_duplicate().

cpl_size cpl_vector_correlate ( cpl_vector *  vxc,
const cpl_vector *  v1,
const cpl_vector *  v2 
)

Cross-correlation of two vectors.

Parameters
vxcOdd-sized vector with the computed cross-correlations
v11st vector to correlate
v22nd vector to correlate
Returns
Index of maximum cross-correlation, or negative on error

vxc must have an odd number of elements, 2*half_search+1, where half_search is the half-size of the search domain.

The length of v2 may not exceed that of v1. If the difference in length between v1 and v2 is less than half_search then this difference must be even (if the difference is odd resampling of v2 may be useful).

The cross-correlation is computed with shifts ranging from -half_search to half_search.

On succesful return element i (starting with 0) of vxc contains the cross- correlation at offset i-half_search. On error vxc is unmodified.

The cross-correlation is in fact the dot-product of two unit-vectors and ranges therefore from -1 to 1.

The cross-correlation is, in absence of rounding errors, commutative only for equal-sized vectors, i.e. changing the order of v1 and v2 will move element j in vxc to 2*half_search - j and thus change the return value from i to 2*half_search - i.

If, in absence of rounding errors, more than one shift would give the maximum cross-correlation, rounding errors may cause any one of those shifts to be returned. If rounding errors have no effect the index corresponding to the shift with the smallest absolute value is returned (with preference given to the smaller of two indices that correspond to the same absolute shift).

If v1 is longer than v2, the first element in v1 used for the resulting cross-correlation is max(0,shift + (cpl_vector_get_size(v1)-cpl_vector_get_size(v2))/2).

Cross-correlation with half_search == 0 requires about 8n FLOPs, where n = cpl_vector_get_size(v2). Each increase of half_search by 1 requires about 4n FLOPs more, when all of v2's elements can be cross-correlated, otherwise the extra cost is about 4m, where m is the number of elements in v2 that can be cross-correlated, n - half_search <= m < n.

In case of error, the _cpl_error_code_ code is set, and the returned delta and cross-correlation is undefined.

Example of 1D-wavelength calibration (error handling omitted for brevity):

1 cpl_vector * model = my_model(dispersion);
2 cpl_vector * vxc = cpl_vector_new(1+2*maxshift);
3 const cpl_size shift = cpl_vector_correlate(vxc, model, observed) - maxshift;
4 cpl_error_code error = cpl_polynomial_shift_1d(dispersion, 0, (double)shift);
5 
6 cpl_msg_info(cpl_func, "Shifted dispersion relation by %" CPL_SIZE_FORMAT
7  " pixels, shift);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if v1 and v2 have different sizes or if vxc is not as requested

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_vector_get_size(), and cpl_vector_set().

cpl_error_code cpl_vector_divide ( cpl_vector *  v1,
const cpl_vector *  v2 
)

Divide two vectors element-wise.

Parameters
v1First cpl_vector
v2Second cpl_vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_vector_add()

If an element in v2 is zero v1 is not modified and CPL_ERROR_DIVISION_BY_ZERO is returned.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if v1 and v2 have different sizes
  • CPL_ERROR_DIVISION_BY_ZERO if a division by 0 would occur

References cpl_ensure_code, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_vector_divide_scalar ( cpl_vector *  v,
double  divisor 
)

Elementwise division of a vector with a scalar.

Parameters
vcpl_vector to modify
divisorNon-zero number to divide with
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Divide each element of the cpl_vector with a number.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_DIVISION_BY_ZERO if divisor is 0.0

References cpl_ensure_code, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

void cpl_vector_dump ( const cpl_vector *  v,
FILE *  stream 
)

Dump a cpl_vector as ASCII to a stream.

Parameters
vInput cpl_vector to dump
streamOutput stream, accepts stdout or stderr
Returns
void

Each element is preceded by its index number (starting with 1!) and written on a single line.

Comment lines start with the hash character.

stream may be NULL in which case stdout is used.

Note
In principle a cpl_vector can be saved using cpl_vector_dump() and re-read using cpl_vector_read(). This will however introduce significant precision loss due to the limited accuracy of the ASCII representation.

References CPL_SIZE_FORMAT.

cpl_vector* cpl_vector_duplicate ( const cpl_vector *  v)

This function duplicates an existing vector and allocates memory.

Parameters
vthe input cpl_vector
Returns
a newly allocated cpl_vector or NULL in case of an error

The returned object must be deallocated using cpl_vector_delete()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_vector_copy(), and cpl_vector_new().

Referenced by cpl_bivector_duplicate(), cpl_geom_img_offset_saa(), cpl_plot_column(), cpl_vector_convolve_symmetric(), and cpl_vector_fit_gaussian().

cpl_error_code cpl_vector_exponential ( cpl_vector *  v,
double  base 
)

Compute the exponential of all vector elements.

Parameters
vTarget cpl_vector.
baseExponential base.
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

If the base is zero all vector elements must be positive and if the base is negative all vector elements must be integer, otherwise a cpl_error_code is returned and the vector is unmodified.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT base and v are not as requested
  • CPL_ERROR_DIVISION_BY_ZERO if one of the v values is negative or 0

References cpl_ensure_code, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_vector* cpl_vector_extract ( const cpl_vector *  v,
cpl_size  istart,
cpl_size  istop,
cpl_size  istep 
)

Extract a sub_vector from a vector.

Parameters
vInput cpl_vector
istartStart index (from 0 to number of elements - 1)
istopStop index (from 0 to number of elements - 1)
istepExtract every step element
Returns
A newly allocated cpl_vector or NULL in case of an error

The returned object must be deallocated using cpl_vector_delete()

FIXME: Currently istop must be greater than istart. FIXME: Currently istep must equal 1.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if istart, istop, istep are not as requested

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_vector_new().

cpl_error_code cpl_vector_fill ( cpl_vector *  v,
double  val 
)

Fill a cpl_vector.

Parameters
vcpl_vector to be filled with the value val
valValue used to fill the cpl_vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Input vector is modified

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_wlcalib_find_best_1d().

cpl_error_code cpl_vector_fill_kernel_profile ( cpl_vector *  profile,
cpl_kernel  type,
double  radius 
)

Fill a vector with a kernel profile.

Parameters
profilecpl_vector to be filled
typeType of kernel profile
radiusRadius of the profile in pixels
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_get_interpolated

A number of predefined kernel profiles are available:

  • CPL_KERNEL_DEFAULT: default kernel, currently CPL_KERNEL_TANH
  • CPL_KERNEL_TANH: Hyperbolic tangent
  • CPL_KERNEL_SINC: Sinus cardinal
  • CPL_KERNEL_SINC2: Square sinus cardinal
  • CPL_KERNEL_LANCZOS: Lanczos2 kernel
  • CPL_KERNEL_HAMMING: Hamming kernel
  • CPL_KERNEL_HANN: Hann kernel
  • CPL_KERNEL_NEAREST: Nearest neighbor kernel (1 when dist < 0.5, else 0)

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if radius is non-positive, or in case of the CPL_KERNEL_TANH profile if the length of the profile exceeds 32768

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, and cpl_vector_get_size().

Referenced by cpl_geom_img_offset_saa().

cpl_vector* cpl_vector_filter_lowpass_create ( const cpl_vector *  v,
cpl_lowpass  filter_type,
cpl_size  hw 
)

Apply a low-pass filter to a cpl_vector.

Parameters
vcpl_vector
filter_typeType of filter to use
hwFilter half-width
Returns
Pointer to newly allocated cpl_vector or NULL in case of an error

This type of low-pass filtering consists in a convolution with a given kernel. The chosen filter type determines the kind of kernel to apply for convolution. Supported kernels are CPL_LOWPASS_LINEAR and CPL_LOWPASS_GAUSSIAN.

In the case of CPL_LOWPASS_GAUSSIAN, the gaussian sigma used is 1/sqrt(2). As this function is not meant to be general and cover all possible cases, this sigma is hardcoded and cannot be changed.

The returned smooth cpl_vector must be deallocated using cpl_vector_delete(). The returned signal has exactly as many samples as the input signal.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if filter_type is not supported or if hw is negative or bigger than half the vector v size

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_vector_delete(), and cpl_vector_new().

cpl_vector* cpl_vector_filter_median_create ( const cpl_vector *  v,
cpl_size  hw 
)

Apply a 1d median filter of given half-width to a cpl_vector.

Parameters
vcpl_vector
hwFilter half-width
Returns
Pointer to newly allocated cpl_vector or NULL in case of an error

This function applies a median smoothing to a cpl_vector and returns a newly allocated cpl_vector containing a median-smoothed version of the input. The returned cpl_vector has exactly as many samples as the input one. It must be deallocated using cpl_vector_delete(). For half-widths of 1,2,3,4, the filtering is optimised for speed.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT if hw is negative or bigger than half the vector v size

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_malloc(), and cpl_vector_new().

cpl_size cpl_vector_find ( const cpl_vector *  sorted,
double  key 
)

In a sorted vector find the element closest to the given value.

Parameters
sortedCPL vector sorted using CPL_SORT_ASCENDING
keyValue to find
Returns
The index that minimizes fabs(sorted[index] - key) or negative on error
See also
cpl_vector_sort()

Bisection is used to find the element.

If two (neighboring) elements with different values both minimize fabs(sorted[index] - key) the index of the larger element is returned.

If the vector contains identical elements that minimize fabs(sorted[index] - key) then it is undefined which element has its index returned.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if two elements are found to not be sorted

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_bivector_interpolate_linear().

cpl_error_code cpl_vector_fit_gaussian ( const cpl_vector *  x,
const cpl_vector *  sigma_x,
const cpl_vector *  y,
const cpl_vector *  sigma_y,
cpl_fit_mode  fit_pars,
double *  x0,
double *  sigma,
double *  area,
double *  offset,
double *  mse,
double *  red_chisq,
cpl_matrix **  covariance 
)

Apply a 1d gaussian fit.

Parameters
xPositions to fit
sigma_xUncertainty (one sigma, gaussian errors assumed) assosiated with x. Taking into account the uncertainty of the independent variable is currently unsupported, and this parameter must therefore be set to NULL.
yValues to fit
sigma_yUncertainty (one sigma, gaussian errors assumed) associated with y. If NULL, constant uncertainties are assumed.
fit_parsSpecifies which parameters participate in the fit (any other parameters will be held constant). Possible values are CPL_FIT_CENTROID, CPL_FIT_STDEV, CPL_FIT_AREA, CPL_FIT_OFFSET and any bitwise combination of these. As a shorthand for including all four parameters in the fit, use CPL_FIT_ALL.
x0(output) Center of best fit gaussian. If CPL_FIT_CENTROID is not set, this is also an input parameter.
sigma(output) Width of best fit gaussian. A positive number on success. If CPL_FIT_STDEV is not set, this is also an input parameter.
area(output) Area of gaussian. A positive number on succes. If CPL_FIT_AREA is not set, this is also an input parameter.
offset(output) Fitted background level. If CPL_FIT_OFFSET is not set, this is also an input parameter.
mse(output) If non-NULL, the mean squared error of the best fit is returned.
red_chisq(output) If non-NULL, the reduced chi square of the best fit is returned. This requires the noise vector to be specified.
covariance(output) If non-NULL, the formal covariance matrix of the best fit is returned. This requires sigma_y to be specified. The order of fit parameters in the covariance matrix is defined as (x0, sigma, area, offset), for example the (3,3) element of the matrix (counting from zero) is the variance of the fitted offset. The matrix must be deallocated by calling cpl_matrix_delete() . On error, NULL is returned.
Returns
CPL_ERROR_NONE iff okay

This function fits to the input vectors a 1d gaussian function of the form

f(x) = area / sqrt(2 pi sigma^2) * exp( -(x - x0)^2/(2 sigma^2)) + offset

(area > 0) by minimizing chi^2 using a Levenberg-Marquardt algorithm.

The values to fit are read from the input vector x. Optionally, a vector sigma_x (of same size as x) may be specified.

Optionally, the mean squared error, the reduced chi square and the covariance matrix of the best fit are computed . Set corresponding parameter to NULL to ignore.

If the covariance matrix is requested and successfully computed, the diagonal elements (the variances) are guaranteed to be positive.

Occasionally, the Levenberg-Marquardt algorithm fails to converge to a set of sensible parameters. In this case (and only in this case), a CPL_ERROR_CONTINUE is set. To allow the caller to recover from this particular error, the parameters x0, sigma, area and offset will on output contain estimates of the best fit parameters, specifically estimated as the median position, the median of the absolute residuals multiplied by 1.4828, the minimum flux value and the maximum flux difference multiplied by sqrt(2 pi sigma^2), respectively. In this case, mse, red_chisq and covariance are not computed. Note that the variance of x0 (the (0,0) element of the covariance matrix) in this case can be estimated by sigma^2 / area .

A CPL_ERROR_SINGULAR_MATRIX occurs if the covariance matrix cannot be computed. In that case all other output parameters are valid.

Current limitations

  • Taking into account the uncertainties of the independent variable is not supported.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if x, y, x0, sigma, area or offset is NULL.
  • CPL_ERROR_INVALID_TYPE if the specified fit_pars is not a bitwise combination of the allowed values (e.g. 0 or 1).
  • CPL_ERROR_UNSUPPORTED_MODE sigma_x is non-NULL.
  • CPL_ERROR_INCOMPATIBLE_INPUT if the sizes of any input vectors are different, or if the computation of reduced chi square or covariance is requested, but sigma_y is not provided.
  • CPL_ERROR_ILLEGAL_INPUT if any input noise values, sigma or area is non-positive, or if chi square computation is requested and there are less than 5 data points to fit.
  • CPL_ERROR_ILLEGAL_OUTPUT if memory allocation failed.
  • CPL_ERROR_CONTINUE if the fitting algorithm failed.
  • CPL_ERROR_SINGULAR_MATRIX if the covariance matrix could not be calculated.

References cpl_ensure_code, CPL_ERROR_CONTINUE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_SINGULAR_MATRIX, CPL_ERROR_UNSUPPORTED_MODE, cpl_free(), cpl_malloc(), CPL_MATH_SQRT2PI, cpl_matrix_delete(), cpl_matrix_get_data(), cpl_matrix_get_mean(), cpl_matrix_unwrap(), cpl_matrix_wrap(), cpl_vector_delete(), cpl_vector_duplicate(), cpl_vector_get(), cpl_vector_get_data(), cpl_vector_get_data_const(), cpl_vector_get_max(), cpl_vector_get_min(), cpl_vector_get_size(), cpl_vector_new(), and cpl_vector_set().

double cpl_vector_get ( const cpl_vector *  in,
cpl_size  idx 
)

Get an element of the vector.

Parameters
inthe input vector
idxthe index of the element (0 to nelem-1)
Returns
The element value

In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if idx is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if idx is out of the vector bounds

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_apertures_extract(), cpl_fit_image_gaussian(), cpl_imagelist_erase(), cpl_polynomial_eval(), cpl_vector_fill_polynomial_fit_residual(), cpl_vector_fit_gaussian(), and cpl_wlcalib_find_best_1d().

double* cpl_vector_get_data ( cpl_vector *  in)

Get a pointer to the data part of the vector.

Parameters
inthe input vector
Returns
Pointer to the data or NULL in case of an error

The returned pointer refers to already allocated data.

Note
Use at your own risk: direct manipulation of vector data rules out any check performed by the vector object interface, and may introduce inconsistencies between the information maintained internally, and the actual vector data and structure.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_bivector_get_x_data(), cpl_bivector_get_y_data(), cpl_geom_img_offset_fine(), cpl_image_fill_jacobian_polynomial(), cpl_image_warp_polynomial(), cpl_photom_fill_blackbody(), cpl_vector_convolve_symmetric(), cpl_vector_fill_polynomial(), cpl_vector_fill_polynomial_fit_residual(), cpl_vector_fit_gaussian(), cpl_vector_new_from_image_column(), cpl_vector_new_from_image_row(), and cpl_wlcalib_find_best_1d().

double cpl_vector_get_max ( const cpl_vector *  v)

Get the maximum of the cpl_vector.

Parameters
vconst cpl_vector
Returns
the maximum value of the vector or undefined on error
See also
cpl_vector_get_min()

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_geom_img_offset_saa(), and cpl_vector_fit_gaussian().

double cpl_vector_get_mean ( const cpl_vector *  v)

Compute the mean value of vector elements.

Parameters
vInput const cpl_vector
Returns
Mean value of vector elements or undefined on error.
See also
cpl_vector_get_min()

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

double cpl_vector_get_median ( cpl_vector *  v)

Compute the median of the elements of a vector.

Parameters
vInput cpl_vector
Returns
Median value of the vector elements or undefined on error.
See also
cpl_vector_get_median_const()
Note
For efficiency reasons, this function modifies the order of the elements of the input vector.

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_flux_get_noise_ring().

double cpl_vector_get_median_const ( const cpl_vector *  v)

Compute the median of the elements of a vector.

Parameters
vInput const cpl_vector
Returns
Median value of the vector elements or undefined on error.
See also
cpl_vector_get_min()

For a finite population or sample, the median is the middle value of an odd number of values (arranged in ascending order) or any value between the two middle values of an even number of values. The criteria used for an even number of values in the input array is to choose the mean between the two middle values. Note that in this case, the median might not be a value of the input array. Also, note that in the case of integer data types, the result will be converted to an integer. Consider to transform your int array to float if that is not the desired behavior.

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_free(), and cpl_malloc().

double cpl_vector_get_min ( const cpl_vector *  v)

Get the minimum of the cpl_vector.

Parameters
vconst cpl_vector
Returns
The minimum value of the vector or undefined on error

In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_geom_img_offset_saa(), and cpl_vector_fit_gaussian().

double cpl_vector_get_stdev ( const cpl_vector *  v)

Compute the bias-corrected standard deviation of a vectors elements.

Parameters
vInput const cpl_vector
Returns
standard deviation of the elements or a negative number on error.
See also
cpl_vector_get_min()

S(n-1) = sqrt((1/n-1) sum((xi-mean)^2) (i=1 -> n)

The length of v must be at least 2.

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_flux_get_noise_ring().

double cpl_vector_get_sum ( const cpl_vector *  v)

Get the sum of the elements of the cpl_vector.

Parameters
vconst cpl_vector
Returns
the sum of the elements of the vector or undefined on error
See also
cpl_vector_get_min()

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

cpl_vector* cpl_vector_load ( const char *  filename,
cpl_size  xtnum 
)

Load a list of values from a FITS file.

Parameters
filenameName of the input file
xtnumExtension number in the file (0 for primary HDU)
Returns
1 newly allocated cpl_vector or NULL in case of an error
See also
cpl_vector_save

This function loads a vector from a FITS file (NAXIS=1), using cfitsio. The returned image has to be deallocated with cpl_vector_delete().

'xtnum' specifies from which extension the vector should be loaded. This could be 0 for the main data section or any number between 1 and N, where N is the number of extensions present in the file.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the extension is not valid
  • CPL_ERROR_FILE_IO if the file cannot be read
  • CPL_ERROR_UNSUPPORTOED_MODE if the file is too large to be read

References cpl_ensure, CPL_ERROR_BAD_FILE_FORMAT, CPL_ERROR_FILE_IO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_free(), cpl_malloc(), CPL_SIZE_FORMAT, and cpl_vector_wrap().

cpl_error_code cpl_vector_logarithm ( cpl_vector *  v,
double  base 
)

Compute the element-wise logarithm.

Parameters
vcpl_vector to modify.
baseLogarithm base.
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

The base and all the vector elements must be positive and the base must be different from 1, or a cpl_error_code will be returned and the vector will be left unmodified.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if base is negative or zero or if one of the vector values is negative or zero
  • CPL_ERROR_DIVISION_BY_ZERO if a division by zero occurs

References cpl_ensure_code, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_vector_multiply ( cpl_vector *  v1,
const cpl_vector *  v2 
)

Multiply two vectors component-wise.

Parameters
v1First cpl_vector
v2Second cpl_vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_vector_add()

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_vector_multiply_scalar ( cpl_vector *  v,
double  factor 
)

Elementwise multiplication of a vector with a scalar.

Parameters
vcpl_vector to modify
factorNumber to multiply with
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Multiply each element of the cpl_vector with a number.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_vector* cpl_vector_new ( cpl_size  n)

Create a new cpl_vector.

Parameters
nNumber of element of the cpl_vector
Returns
1 newly allocated cpl_vector or NULL in case of an error

The returned object must be deallocated using cpl_vector_delete(). There is no default values assigned to the created object, they are undefined until they are set.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if n is negative or zero

References CPL_ERROR_ILLEGAL_INPUT, cpl_malloc(), and CPL_SIZE_FORMAT.

Referenced by cpl_bivector_new(), cpl_bivector_read(), cpl_fit_image_gaussian(), cpl_flux_get_noise_ring(), cpl_geom_img_offset_combine(), cpl_geom_img_offset_saa(), cpl_image_fill_jacobian_polynomial(), cpl_image_warp_polynomial(), cpl_vector_duplicate(), cpl_vector_extract(), cpl_vector_fill_polynomial_fit_residual(), cpl_vector_filter_lowpass_create(), cpl_vector_filter_median_create(), cpl_vector_fit_gaussian(), cpl_vector_new_from_image_column(), cpl_vector_new_from_image_row(), cpl_vector_new_lss_kernel(), cpl_vector_read(), and cpl_wlcalib_find_best_1d().

cpl_vector* cpl_vector_new_lss_kernel ( double  slitw,
double  fwhm 
)

Create Right Half of a symmetric smoothing kernel for LSS.

Parameters
slitwThe slit width [pixel]
fwhmThe spectral FWHM [pixel]
Returns
Right Half of (symmetric) smoothing vector
Deprecated:
Unstable API, may change or disappear. Do not use in new code!

References CPL_MATH_SIG_FWHM, cpl_vector_delete(), and cpl_vector_new().

cpl_error_code cpl_vector_power ( cpl_vector *  v,
double  exponent 
)

Compute the power of all vector elements.

Parameters
vTarget cpl_vector.
exponentConstant exponent.
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

If the exponent is negative all vector elements must be non-zero and if the exponent is non-integer all vector elements must be non-negative, otherwise a cpl_error_code is returned and the vector is unmodified.

Following the behaviour of C99 pow() function, this function sets 0^0 = 1.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if v and exponent are not as requested
  • CPL_ERROR_DIVISION_BY_ZERO if one of the v values is 0

References cpl_ensure_code, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

double cpl_vector_product ( const cpl_vector *  v1,
const cpl_vector *  v2 
)

Compute the vector dot product.

Parameters
v1One vector
v2Another vector of the same size
Returns
The (non-negative) product or negative on error.

The same vector may be passed twice, in which case the square of its 2-norm is computed.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if v1 and v2 have different sizes

References cpl_ensure, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NULL_INPUT, cpl_vector_get_data_const(), and cpl_vector_get_size().

Referenced by cpl_vector_fill_polynomial_fit_residual().

cpl_vector* cpl_vector_read ( const char *  filename)

Read a list of values from an ASCII file and create a cpl_vector.

Parameters
filenameName of the input ASCII file
Returns
1 newly allocated cpl_vector or NULL in case of an error
See also
cpl_vector_dump

Parse an input ASCII file values and create a cpl_vector from it Lines beginning with a hash are ignored, blank lines also. In valid lines the value is preceeded by an integer, which is ignored.

The returned object must be deallocated using cpl_vector_delete()

In addition to normal files, FIFO (see man mknod) are also supported.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if the file cannot be read
  • CPL_ERROR_BAD_FILE_FORMAT if the file contains no valid lines

References cpl_ensure, CPL_ERROR_BAD_FILE_FORMAT, CPL_ERROR_FILE_IO, CPL_ERROR_NULL_INPUT, cpl_vector_delete(), cpl_vector_new(), cpl_vector_set(), and cpl_vector_set_size().

cpl_error_code cpl_vector_save ( const cpl_vector *  self,
const char *  filename,
cpl_type  type,
const cpl_propertylist pl,
unsigned  mode 
)

Save a vector to a FITS file.

Parameters
selfVector to write to disk or NULL
filenameName of the file to write
typeThe type used to represent the data in the file
plProperty list for the output header or NULL
modeThe desired output options (combined with bitwise or)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

This function saves a vector to a FITS file (NAXIS=1), using cfitsio. If a property list is provided, it is written to the named file before the pixels are written. If the image is not provided, the created file will only contain the primary header. This can be useful to create multiple extension files.

The type used in the file can be one of: CPL_TYPE_UCHAR (8 bit unsigned), CPL_TYPE_SHORT (16 bit signed), CPL_TYPE_USHORT (16 bit unsigned), CPL_TYPE_INT (32 bit signed), CPL_TYPE_FLOAT (32 bit floating point), or CPL_TYPE_DOUBLE (64 bit floating point). Use CPL_TYPE_DOUBLE when no loss of information is required.

Supported output modes are CPL_IO_CREATE (create a new file) and CPL_IO_EXTEND (append to an existing file)

If you are in append mode, make sure that the file has writing permissions. You may have problems if you create a file in your application and append something to it with the umask set to 222. In this case, the file created by your application would not be writable, and the append would fail.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the type or the mode is not supported
  • CPL_ERROR_FILE_NOT_CREATED if the output file cannot be created
  • CPL_ERROR_FILE_IO if the data cannot be written to the file
  • CPL_ERROR_UNSUPPORTOED_MODE if the file is too large to be saved

References cpl_ensure_code, CPL_ERROR_FILE_IO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_free(), CPL_IO_CREATE, CPL_IO_EXTEND, cpl_propertylist_save(), and cpl_sprintf().

cpl_error_code cpl_vector_set ( cpl_vector *  in,
cpl_size  idx,
double  value 
)

Set an element of the vector.

Parameters
inthe input vector
idxthe index of the element (0 to nelem-1)
valuethe value to set in the vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if idx is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if idx is out of the vector bounds

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_bivector_read(), cpl_fit_image_gaussian(), cpl_flux_get_noise_ring(), cpl_plot_column(), cpl_vector_correlate(), cpl_vector_fit_gaussian(), cpl_vector_read(), and cpl_wlcalib_find_best_1d().

cpl_error_code cpl_vector_set_size ( cpl_vector *  in,
cpl_size  newsize 
)

Resize the vector.

Parameters
inThe vector to be resized
newsizeThe new (positive) number of elements in the vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
Note
On succesful return the value of the elements of the vector is unchanged to the minimum of the old and new sizes; any newly allocated elements are undefined. The pointer to the vector data buffer may change, therefore pointers previously retrieved by calling cpl_vector_get_data() should be discarded. If the vector was created with cpl_vector_wrap() the argument pointer to that call should be discarded as well.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if newsize is negative or zero

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_realloc().

Referenced by cpl_bivector_read(), cpl_geom_img_offset_combine(), cpl_vector_copy(), cpl_vector_fill_polynomial_fit_residual(), and cpl_vector_read().

cpl_error_code cpl_vector_sort ( cpl_vector *  self,
cpl_sort_direction  dir 
)

Sort a cpl_vector.

Parameters
selfcpl_vector to sort in place
dirCPL_SORT_ASCENDING or CPL_SORT_DESCENDING
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

The input cpl_vector is modified to sort its values in either ascending (CPL_SORT_ASCENDING) or descending (CPL_SORT_DESCENDING) order.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if dir is neither CPL_SORT_DESCENDING nor CPL_SORT_ASCENDING

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_geom_img_offset_saa().

cpl_error_code cpl_vector_sqrt ( cpl_vector *  v)

Compute the sqrt of a cpl_vector.

Parameters
vcpl_vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

The sqrt of the data is computed. The input cpl_vector is modified

If an element in v is negative v is not modified and CPL_ERROR_ILLEGAL_INPUT is returned.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if one of the vector values is negative

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_vector_subtract ( cpl_vector *  v1,
const cpl_vector *  v2 
)

Subtract a cpl_vector from another.

Parameters
v1First cpl_vector (modified)
v2Second cpl_vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_vector_add()

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_vector_subtract_scalar ( cpl_vector *  v,
double  subtrahend 
)

Elementwise subtraction of a scalar from a vector.

Parameters
vcpl_vector to modify
subtrahendNumber to subtract
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Subtract a number from each element of the cpl_vector.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

void* cpl_vector_unwrap ( cpl_vector *  v)

Delete a cpl_vector except the data array.

Parameters
vcpl_vector to delete
Returns
A pointer to the data array or NULL if the input is NULL.
Note
The data array must subsequently be deallocated. Failure to do so will result in a memory leak.

References cpl_free().

Referenced by cpl_flux_get_noise_ring(), cpl_plot_column(), cpl_polynomial_fit(), and cpl_wlcalib_find_best_1d().

cpl_vector* cpl_vector_wrap ( cpl_size  n,
double *  data 
)

Create a cpl_vector from existing data.

Parameters
nNumber of elements in the vector
dataPointer to array of n doubles
Returns
1 newly allocated cpl_vector or NULL in case of an error

The returned object must be deallocated using cpl_vector_unwrap().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if n is negative or zero

Referenced by cpl_flux_get_noise_ring(), cpl_plot_column(), cpl_polynomial_fit(), cpl_ppm_match_positions(), cpl_vector_load(), and cpl_wlcalib_find_best_1d().

cpl-6.6.1/html/cpl.css0000644000460300003120000000046212553662426011465 00000000000000TABLE.ec { width: 100%; text-align: left; background-color: #f5f5f5; margin-top: 0px; padding-top: 0px; border: none; } TD.ecl { font-family: monospace; vertical-align: top; padding-right: 20px; border: none; } TD.ecr { vertical-align: top; border: none; } cpl-6.6.1/html/group__cpl__test.html0000644000460300003120000026446412553662432014425 00000000000000 Common Pipeline Library Reference Manual: Unit testing functions
Common Pipeline Library Reference Manual  6.6.1
Unit testing functions

Macros

#define cpl_test(bool)
 Evaluate an expression and increment an internal counter if zero. More...
 
#define cpl_test_abs(first, second, tolerance)
 Test if two numerical expressions are within a given absolute tolerance. More...
 
#define cpl_test_array_abs(first, second, tolerance)
 Test if two numerical arrays are identical within a given (absolute) tolerance. More...
 
#define cpl_test_assert(bool)
 Evaluate an expression and terminate the process if it fails. More...
 
#define cpl_test_eq(first, second)
 Test if two integer expressions are equal. More...
 
#define cpl_test_eq_error(first, second)
 Test if two error expressions are equal and reset the CPL error code. More...
 
#define cpl_test_eq_mask(first, second)
 Test if two CPL masks are equal. More...
 
#define cpl_test_eq_ptr(first, second)
 Test if two pointer expressions are equal. More...
 
#define cpl_test_eq_string(first, second)
 Test if two strings are equal. More...
 
#define cpl_test_error(error)
 Test and reset the CPL error code. More...
 
#define cpl_test_errorstate(errorstate)
 Test and if necessary reset the CPL errorstate. More...
 
#define cpl_test_fits(fitsfile)
 Test if a file is valid FITS using an external verification utility. More...
 
#define cpl_test_image_abs(first, second, tolerance)
 Test if two images are identical within a given (absolute) tolerance. More...
 
#define cpl_test_image_rel(first, second, tolerance)
 Test if two images are identical within a given (relative) tolerance. More...
 
#define cpl_test_imagelist_abs(first, second, tolerance)
 Test if two imagelists are identical within a given (absolute) tolerance. More...
 
#define cpl_test_init(REPORT, LEVEL)
 Initialize CPL + CPL messaging + unit test. More...
 
#define cpl_test_leq(value, tolerance)
 Evaluate A <= B and increment an internal counter if it is not true. More...
 
#define cpl_test_lt(value, tolerance)
 Evaluate A < B and increment an internal counter if it is not true. More...
 
#define cpl_test_matrix_abs(first, second, tolerance)
 Test if two matrices are identical within a given (absolute) tolerance. More...
 
#define cpl_test_memory_is_empty()
 Test if the memory system is empty. More...
 
#define cpl_test_noneq(first, second)
 Test if two integer expressions are not equal. More...
 
#define cpl_test_noneq_ptr(first, second)
 Test if two pointer expressions are not equal. More...
 
#define cpl_test_noneq_string(first, second)
 Test if two strings are not equal. More...
 
#define cpl_test_nonnull(pointer)
 Test if a pointer is non-NULL. More...
 
#define cpl_test_null(pointer)
 Test if a pointer is NULL and update an internal counter on failure. More...
 
#define cpl_test_polynomial_abs(first, second, tolerance)
 Test if two polynomials are identical within a given (absolute) tolerance. More...
 
#define cpl_test_rel(first, second, tolerance)
 Test if two numerical expressions are within a given relative tolerance. More...
 
#define cpl_test_vector_abs(first, second, tolerance)
 Test if two vectors are identical within a given (absolute) tolerance. More...
 
#define cpl_test_zero(zero)
 Evaluate an expression and increment an internal counter if non-zero. More...
 

Functions

int cpl_test_end (cpl_size nfail)
 Finalize CPL and unit-testing environment and report any failures. More...
 
size_t cpl_test_get_bytes_image (const cpl_image *self)
 Get the amount of storage [bytes] for the CPL object. More...
 
size_t cpl_test_get_bytes_imagelist (const cpl_imagelist *self)
 Get the amount of storage [bytes] for the CPL object. More...
 
size_t cpl_test_get_bytes_matrix (const cpl_matrix *self)
 Get the amount of storage [bytes] for the CPL object. More...
 
size_t cpl_test_get_bytes_vector (const cpl_vector *self)
 Get the amount of storage [bytes] for the CPL object. More...
 
cpl_size cpl_test_get_failed (void)
 Get the number of failed CPL tests. More...
 
cpl_size cpl_test_get_tested (void)
 Get the number of CPL tests performed. More...
 
double cpl_test_get_walltime (void)
 Get the process wall-clock time, when available. More...
 

Detailed Description

This module provides various functions for unit testing.

Synopsis:
#include "cpl_test.h"

Macro Definition Documentation

#define cpl_test (   bool)

Evaluate an expression and increment an internal counter if zero.

Parameters
boolThe expression to evaluate, side-effects are allowed
Note
A zero value of the expression is a failure, other values are not
Returns
void
See also
cpl_test_init()
Note
This macro should be used for unit tests

Example of usage:

1 cpl_test(myfunc()); // myfunc() is expected to return non-zero
#define cpl_test_abs (   first,
  second,
  tolerance 
)

Test if two numerical expressions are within a given absolute tolerance.

Parameters
firstThe first value in the comparison, side-effects are allowed
secondThe second value in the comparison, side-effects are allowed
toleranceA non-negative tolerance
Note
If the tolerance is negative, the test will always fail
See also
cpl_test()

Example of usage:

1 cpl_test_abs(computed, expected, DBL_EPSILON);
#define cpl_test_array_abs (   first,
  second,
  tolerance 
)

Test if two numerical arrays are identical within a given (absolute) tolerance.

Parameters
firstThe first array in the comparison
secondThe second array of identical size in the comparison
toleranceA non-negative tolerance
Returns
void
See also
cpl_test_abs()
Note
The test will fail if one or both the arrays are NULL or of a non-numerical type
#define cpl_test_assert (   bool)

Evaluate an expression and terminate the process if it fails.

Parameters
boolThe (boolean) expression to evaluate, side-effects are allowed
Note
A zero value of the expression is a failure, other values are not
Returns
void
See also
cpl_test()
Note
This macro should be used for unit tests that cannot continue after a failure.

Example of usage:

1 int main (void)
2 {
3 
4  cpl_test_init(CPL_MSG_WARNING);
5 
6  cpl_test(myfunc(&p));
7  cpl_test_assert(p != NULL);
8  cpl_test(*p);
9 
10  return cpl_test_end(0);
11 }
#define cpl_test_eq (   first,
  second 
)

Test if two integer expressions are equal.

Parameters
firstThe first value in the comparison, side-effects are allowed
secondThe second value in the comparison, side-effects are allowed
See also
cpl_test()
Returns
void

Example of usage:

1 cpl_test_eq(computed, expected);

For comparison of floating point values, see cpl_test_abs() and cpl_test_rel().

#define cpl_test_eq_error (   first,
  second 
)

Test if two error expressions are equal and reset the CPL error code.

Parameters
firstThe first value in the comparison
secondThe second value in the comparison
See also
cpl_test_error
Note
If the two CPL error expressions are equal they will also be tested against the current CPL error code. After the test(s), the CPL errorstate is reset.

Example of usage:

1 cpl_error_code error = my_func(NULL);
2 
3 // my_func(NULL) is expected to return CPL_ERROR_NULL_INPUT
4 // and to set the same error code
5 cpl_test_eq_error(error, CPL_ERROR_NULL_INPUT);
6 
7 // The errorstate has been reset.
8 
9 error = my_func(p); // Successful call
10 cpl_test_eq_error(error, CPL_ERROR_NONE);
#define cpl_test_eq_mask (   first,
  second 
)

Test if two CPL masks are equal.

Parameters
firstThe first mask or NULL of the comparison
secondThe second mask or NULL of the comparison
Note
One or two NULL pointer(s) is considered a failure.

Example of usage:

1 cpl_test_eq_mask(computed, expected);
#define cpl_test_eq_ptr (   first,
  second 
)

Test if two pointer expressions are equal.

Parameters
firstThe first value in the comparison, side-effects are allowed
secondThe second value in the comparison, side-effects are allowed
See also
cpl_test_eq()
Returns
void

Example of usage:

1 cpl_test_eq_ptr(computed, expected);
#define cpl_test_eq_string (   first,
  second 
)

Test if two strings are equal.

Parameters
firstThe first string or NULL of the comparison
secondThe second string or NULL of the comparison
Note
One or two NULL pointer(s) is considered a failure.

Example of usage:

1 cpl_test_eq_string(computed, expected);
#define cpl_test_error (   error)

Test and reset the CPL error code.

Parameters
errorThe expected CPL error code (incl. CPL_ERROR_NONE)
See also
cpl_test()
Note
After the test, the CPL errorstate is reset
Returns
void

Example of usage:

1 cpl_test( my_func(NULL) ); // my_func(NULL) is expected to return non-zero
2 
3 cpl_test_error(CPL_ERROR_NULL_INPUT); // ... and to set this error code
4 
5 // The errorstate has been reset.
6 
7 cpl_test( !my_func(p) ); // my_func(p) is expected to return zero
#define cpl_test_errorstate (   errorstate)

Test and if necessary reset the CPL errorstate.

Parameters
errorstateThe expected CPL errorstate
See also
cpl_test()
Note
After the test, the CPL errorstate is set to the provided state
Returns
void

This function is useful for verifying that a successful call to a function does not modify any pre-existing errors.

Example of usage:

1 const cpl_error_code error = cpl_error_set(cpl_func, CPL_ERROR_EOL);
2 cpl_errorstate prestate = cpl_errorstate_get();
3 const cpl_error_code ok = my_func(); // Expected to succeed
4 
5 cpl_test_errorstate(prestate); // Verify that no additional errors occurred
6 cpl_test_error(CPL_ERROR_EOL); // Reset error
7 cpl_test_eq(ok, CPL_ERROR_NONE); // Verify that my_func() succeeded
#define cpl_test_fits (   fitsfile)

Test if a file is valid FITS using an external verification utility.

Parameters
fitsfileThe file to verify, NULL causes failure
Note
The external verification utility is specified with the environemt variable CPL_TEST_FITS, if is not set the test will pass on any non-NULL file.

Example of usage:

1 export CPL_TEST_FITS=/usr/local/bin/fitsverify
1 cpl_test_fits(fitsfile);
#define cpl_test_image_abs (   first,
  second,
  tolerance 
)

Test if two images are identical within a given (absolute) tolerance.

Parameters
firstThe first image in the comparison
secondThe second image of identical size in the comparison
toleranceA non-negative tolerance
Returns
void
See also
cpl_test_abs()
Note
The test will fail if one or both the images are NULL
#define cpl_test_image_rel (   first,
  second,
  tolerance 
)

Test if two images are identical within a given (relative) tolerance.

Parameters
firstThe first image in the comparison
secondThe second image of identical size in the comparison
toleranceA non-negative tolerance
Returns
void
See also
cpl_test_rel()
Note
The test will fail if one or both the images are NULL

For each pixel position the two values x, y must pass the test: |x - y| <= tol * min(|x|, |y|). This definition is chosen since it is commutative and meaningful also for zero-valued pixels.

#define cpl_test_imagelist_abs (   first,
  second,
  tolerance 
)

Test if two imagelists are identical within a given (absolute) tolerance.

Parameters
firstThe first imagelist in the comparison
secondThe second imagelist of identical size in the comparison
toleranceA non-negative tolerance
Returns
void
See also
cpl_test_image_abs()
Note
The test will fail if one or both the imagelists are NULL
#define cpl_test_init (   REPORT,
  LEVEL 
)

Initialize CPL + CPL messaging + unit test.

Parameters
REPORTThe email address for the error message e.g. PACKAGE_BUGREPORT
LEVELThe default messaging level, e.g. CPL_MSG_WARNING
Returns
void
See also
cpl_init()
Note
This macro should be used at the beginning of main() of a unit test instead of cpl_init() and before any other CPL function call.
#define cpl_test_leq (   value,
  tolerance 
)

Evaluate A <= B and increment an internal counter if it is not true.

Parameters
valueThe number to test
toleranceThe upper limit to compare against
Returns
void
See also
cpl_test_init()
Note
This macro should be used for unit tests

Example of usage:

1 cpl_test_leq(fabs(myfunc(&p)), DBL_EPSILON);
2 cpl_test_nonnull(p);
#define cpl_test_lt (   value,
  tolerance 
)

Evaluate A < B and increment an internal counter if it is not true.

Parameters
valueThe number to test
toleranceThe upper limit to compare against
Returns
void
See also
cpl_test_init()
Note
This macro should be used for unit tests

Example of usage:

1 cpl_test_lt(0.0, myfunc());
#define cpl_test_matrix_abs (   first,
  second,
  tolerance 
)

Test if two matrices are identical within a given (absolute) tolerance.

Parameters
firstThe first matrix in the comparison
secondThe second matrix of identical size in the comparison
toleranceA non-negative tolerance
Returns
void
See also
cpl_test_abs()
Note
The test will fail if one or both the matrices are NULL
#define cpl_test_memory_is_empty ( )

Test if the memory system is empty.

See also
cpl_memory_is_empty()
Deprecated:
Called by cpl_test_end()
#define cpl_test_noneq (   first,
  second 
)

Test if two integer expressions are not equal.

Parameters
firstThe first value in the comparison, side-effects are allowed
secondThe second value in the comparison, side-effects are allowed
See also
cpl_test_eq()
Returns
void

Example of usage:

1 cpl_test_noneq(computed, wrong);
#define cpl_test_noneq_ptr (   first,
  second 
)

Test if two pointer expressions are not equal.

Parameters
firstThe first value in the comparison, side-effects are allowed
secondThe second value in the comparison, side-effects are allowed
See also
cpl_test_eq_ptr()
Returns
void

Example of usage:

1 cpl_test_noneq_ptr(computed, wrong);
#define cpl_test_noneq_string (   first,
  second 
)

Test if two strings are not equal.

Parameters
firstThe first string or NULL of the comparison
secondThe second string or NULL of the comparison
Note
One or two NULL pointer(s) is considered a failure.

Example of usage:

1 cpl_test_noneq_string(computed, expected);
#define cpl_test_nonnull (   pointer)

Test if a pointer is non-NULL.

Parameters
pointerThe pointer to check, side-effects are allowed
See also
cpl_test_nonnull()
Returns
void

Example of usage:

1 cpl_test_nonnull(pointer); // pointer is expected to be non-NULL
#define cpl_test_null (   pointer)

Test if a pointer is NULL and update an internal counter on failure.

Parameters
pointerThe NULL-pointer to check, side-effects are allowed
See also
cpl_test()
Returns
void

Example of usage:

1 cpl_test_null(pointer); // pointer is expected to be NULL
#define cpl_test_polynomial_abs (   first,
  second,
  tolerance 
)

Test if two polynomials are identical within a given (absolute) tolerance.

Parameters
firstThe first polynomial in the comparison
secondThe second polynomial in the comparison
toleranceA non-negative tolerance
Returns
void
See also
cpl_test_abs()
Note
The test will fail if one or both the polynomials are NULL
#define cpl_test_rel (   first,
  second,
  tolerance 
)

Test if two numerical expressions are within a given relative tolerance.

Parameters
firstThe first value in the comparison, side-effects are allowed
secondThe second value in the comparison, side-effects are allowed
toleranceA non-negative tolerance
Note
If the tolerance is negative or if one but not both of the two values is zero, the test will always fail. If both values are zero, the test will succeed for any non-negative tolerance. The test is commutative in the two values.
See also
cpl_test()

The test is carried out by comparing the absolute value of the difference abs (first - second) to the product of the tolerance and the minimum of the absolute value of the two values, tolerance * min(abs(first), abs(second)) (The test is implemented like this to avoid division with a number that may be zero.

Example of usage:

1 cpl_test_rel(computed, expected, 0.001);
#define cpl_test_vector_abs (   first,
  second,
  tolerance 
)

Test if two vectors are identical within a given (absolute) tolerance.

Parameters
firstThe first vector in the comparison
secondThe second vector of identical size in the comparison
toleranceA non-negative tolerance
Returns
void
See also
cpl_test_abs()
Note
The test will fail if one or both the vectors are NULL
#define cpl_test_zero (   zero)

Evaluate an expression and increment an internal counter if non-zero.

Parameters
zeroThe numerical expression to evaluate, side-effects are allowed
Note
A zero value of the expression is a success, other values are not
Returns
void
See also
cpl_test()
Note
This macro should be used for unit tests

Example of usage:

1 cpl_test_zero(myfunc()); // myfunc() is expected to return zero

Referenced by cpl_test_end().

Function Documentation

int cpl_test_end ( cpl_size  nfail)

Finalize CPL and unit-testing environment and report any failures.

Parameters
nfailThe number of failures counted apart from cpl_test() et al.
Returns
EXIT_SUCCESS iff the CPL errorstate is clean
Note
This function should be used for the final return from a unit test
See also
cpl_test_init()

nfail should normally be zero, but may be set to a positive number when it is necessary to ensure a failure. nfail should only be negative in the unit test of the unit-test functions themselves.

Example of usage:

1 int main (void)
2 {
3 
4  cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
5 
6  cpl_test(myfunc(&p));
7  cpl_test(p != NULL);
8 
9  return cpl_test_end(0);
10 }

References cpl_end(), cpl_error_get_code(), CPL_ERROR_NONE, cpl_errorstate_dump(), cpl_free(), cpl_memory_dump(), cpl_memory_is_empty(), cpl_msg_debug(), cpl_msg_error(), cpl_msg_get_level(), cpl_msg_get_log_name(), cpl_msg_indent_less(), cpl_msg_indent_more(), cpl_msg_info(), cpl_msg_set_level(), cpl_msg_warning(), cpl_test_get_walltime(), and cpl_test_zero.

size_t cpl_test_get_bytes_image ( const cpl_image *  self)

Get the amount of storage [bytes] for the CPL object.

Parameters
selfThe CPL object
Returns
The size in bytes
Note
Passing NULL is allowed and will return zero
See also
cpl_test_get_bytes_vector

References cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), and cpl_type_get_sizeof().

Referenced by cpl_test_get_bytes_imagelist().

size_t cpl_test_get_bytes_imagelist ( const cpl_imagelist *  self)

Get the amount of storage [bytes] for the CPL object.

Parameters
selfThe CPL object
Returns
The size in bytes
Note
Passing NULL is allowed and will return zero
See also
cpl_test_get_bytes_vector

References cpl_imagelist_get_const(), cpl_imagelist_get_size(), and cpl_test_get_bytes_image().

size_t cpl_test_get_bytes_matrix ( const cpl_matrix *  self)

Get the amount of storage [bytes] for the CPL object.

Parameters
selfThe CPL object
Returns
The size in bytes
Note
Passing NULL is allowed and will return zero
See also
cpl_test_get_bytes_vector

References cpl_matrix_get_ncol(), and cpl_matrix_get_nrow().

size_t cpl_test_get_bytes_vector ( const cpl_vector *  self)

Get the amount of storage [bytes] for the CPL object.

Parameters
selfThe CPL object
Returns
The size in bytes
Note
Passing NULL is allowed and will return zero

Example of usage:

1 int my_benchmark (void)
2 {
3  const size_t storage = cpl_test_get_bytes_vector(mydata);
4  double walltime, tstop;
5  const double tstart = cpl_test_get_walltime();
6 
7  myfunc(mydata);
8 
9  tstop = cpl_test_get_walltime();
10 
11  walltime = tstop - tstart;
12 
13  if (walltime > 0.0) {
14  cpl_msg_info(cpl_func, "Processing rate: %g",
15  (double)storage/walltime);
16  }
17 }

References cpl_vector_get_size().

cpl_size cpl_test_get_failed ( void  )

Get the number of failed CPL tests.

Returns
The count of failed tests
See also
cpl_test_get_tested()

Example of usage:

1 void my_tester (void)
2 {
3  const cpl_size prefailed = cpl_test_get_failed();
4 
5  cpl_test(mytest());
6 
7  if (cpl_test_get_failed() > prefailed) {
8  cpl_msg_info(cpl_func, "The function mytest() failed!");
9  }
10 }
cpl_size cpl_test_get_tested ( void  )

Get the number of CPL tests performed.

Returns
The test count
See also
cpl_test_get_failed()
double cpl_test_get_walltime ( void  )

Get the process wall-clock time, when available.

Returns
The process wall-clock time in seconds.
Note
Will always return 0 if clock_gettime() and gettimeofday() are unavailable or failing
See also
clock_gettime(), gettimeofday()

Example of usage:

1 int my_benchmark (void)
2 {
3  double walltime, tstop;
4  const double tstart = cpl_test_get_walltime();
5 
6  myfunc();
7 
8  tstop = cpl_test_get_walltime();
9 
10  walltime = tstop - tstart;
11 
12  cpl_msg_info(cpl_func, "The call took %g seconds of wall-clock time",
13  walltime);
14 
15 }

Referenced by cpl_test_end().

cpl-6.6.1/html/index.html0000644000460300003120000000367712553662441012202 00000000000000 Common Pipeline Library Reference Manual: Main Page
Common Pipeline Library Reference Manual  6.6.1
Common Pipeline Library Reference Manual Documentation
cpl-6.6.1/html/group__cpl__recipedefine.html0000644000460300003120000003552712553662432016064 00000000000000 Common Pipeline Library Reference Manual: Recipe Definition
Common Pipeline Library Reference Manual  6.6.1
Recipe Definition

Macros

#define cpl_get_license(PACKAGE_NAME, YEAR)
 Generate the recipe copyright and license text (GPL v.2) More...
 
#define cpl_recipe_define(RECIPE_NAME, RECIPE_VERSION, RECIPE_AUTHOR, RECIPE_EMAIL, RECIPE_YEAR, RECIPE_SYNOPSIS, RECIPE_DESCRIPTION)
 Define a standard CPL recipe. More...
 
#define CPL_RECIPE_DEFINE(RECIPE_NAME, RECIPE_VERSION, RECIPE_FILL_PARAMS, RECIPE_AUTHOR, RECIPE_AUTHOR_EMAIL, RECIPE_YEAR, RECIPE_SYNOPSIS, RECIPE_DESCRIPTION)
 Define a standard CPL recipe. More...
 

Detailed Description

This module implements the support for recipe defition.

Synopsis:
#include <cpl_recipedefine.h>

Macro Definition Documentation

#define cpl_get_license (   PACKAGE_NAME,
  YEAR 
)

Generate the recipe copyright and license text (GPL v.2)

Parameters
PACKAGE_NAMEThe name as a string literal, e.g. from config.h
YEARThe year(s) as a string literal
Returns
The recipe copyright and license text as a string literal

Example:

1 const char * eso_gpl_license = cpl_get_license(PACKAGE_NAME, "2005, 2008");
#define cpl_recipe_define (   RECIPE_NAME,
  RECIPE_VERSION,
  RECIPE_AUTHOR,
  RECIPE_EMAIL,
  RECIPE_YEAR,
  RECIPE_SYNOPSIS,
  RECIPE_DESCRIPTION 
)

Define a standard CPL recipe.

Parameters
RECIPE_NAMEThe name as an identifier
RECIPE_VERSIONThe binary version number
RECIPE_AUTHORThe author as a string literal
RECIPE_EMAILThe contact email as a string literal
RECIPE_YEARThe copyright year as a string literal
RECIPE_SYNOPSISThe synopsis as a string literal
RECIPE_DESCRIPTIONThe man-page as a string literal

A CPL-based recipe may use this macro to define its four mandatory functions: cpl_plugin_get_info(), <recipe>_create(), <recipe>_exec() and <recipe>_destroy(), as well as declaring the actual data reduction function, <recipe>() as

1 static int <recipe>(cpl_frameset *, const cpl_parameterlist *);

The macro also declares the recipe-specific function that fills the recipe parameterlist with the supported parameters as

1 static cpl_error_code <recipe>_fill_parameterlist(cpl_parameterlist *self);

A recipe that invokes cpl_recipe_define() must define this function.

The macro cpl_recipe_define() may be used by defining a macro, e.g. in my_recipe.h:

1 #define MY_RECIPE_DEFINE(NAME, SYNOPSIS, DESCRIPTION) \
2  cpl_recipe_define(NAME, MY_BINARY_VERSION, \
3  "Firstname Lastname", "2006, 2008", SYNOPSIS, DESCRIPTION)
  • and then by invoking this macro in each recipe:
1 #include "my_recipe.h"
2 
3 MY_RECIPE_DEFINE(instrume_img_dark,
4  "Dark recipe",
5  "instrume_img_dark -- imaging dark recipe.\n"
6  " ... recipe man-page\n");
7 
8 static
9 cpl_error_code instrume_img_dark_fill_parameterlist(cpl_parameterlist *self);
10 {
11 
12  // Fill the parameterlist with the parameters supported by the recipe.
13 
14  retun CPL_ERROR_NONE;
15 }
#define CPL_RECIPE_DEFINE (   RECIPE_NAME,
  RECIPE_VERSION,
  RECIPE_FILL_PARAMS,
  RECIPE_AUTHOR,
  RECIPE_AUTHOR_EMAIL,
  RECIPE_YEAR,
  RECIPE_SYNOPSIS,
  RECIPE_DESCRIPTION 
)

Define a standard CPL recipe.

Parameters
RECIPE_NAMEThe name as an identifier
RECIPE_VERSIONThe binary version number
RECIPE_FILL_PARAMSA function call to fill the recipe parameterlist. Must evaluate to zero if and only if successful
RECIPE_AUTHORThe author as a string literal
RECIPE_AUTHOR_EMAILThe author email as a string literal
RECIPE_YEARThe copyright year as a string literal
RECIPE_SYNOPSISThe synopsis as a string literal
RECIPE_DESCRIPTIONThe man-page as a string literal
Deprecated:
Use cpl_recipe_define()
cpl-6.6.1/html/open.png0000644000460300003120000000017312553662426011643 00000000000000‰PNG  IHDR à‘BIDATxíÝÁ €0 Ð׬ՙ\Àº€39—b!©9{|ðI>$#Àß´ý8/¨ÄØzƒ/Ï>2À[ÎgiU,/¬~¼Ï\ Ä9Ù¸IEND®B`‚cpl-6.6.1/html/form_9.png0000644000460300003120000000755112553662435012104 00000000000000‰PNG  IHDR*oÐí0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïØIDATxíçšê<„_EKÂáþïv»%6Ïæ ó-~\…êªê¿¼Àãxòu€¿‚ÀH+—€{Ñ[€gpøs\?܉ž‚þÜTÙàIÄð—ðU½¸…0LÓxÊ2ÛË¿MMàáªìn¼…,,¬xØf6ʃPU:€[Ðñ†“`T€i;ÙÌ#) ð[x€ª]ç8Í1Ó{Ú¯QÚeð¸Ë®9ìúà½p?Uv÷ WÄZ"£`“ªI¼jåJ°#ý%Ué÷hã®C€ó™û©8€ï£;F¶Ý|1…yúJM4»ä;q•í~3íþL+îÁ6‡Ç¨*]œ¶žhöLfD xÊ,W œÏß+IÒ$šxš5Z:ÑD¼½Y}\8ÎÆÃµÔwCà‡¡áS¡ÊYyL&ˆTB’È““+óeëã¼±YJA¨ru³ÆÏÅm»¤êNë¼E´>]Tкù¸bŒlÜLAäR²9tn*ÂN»ÌT³ƒZHªª(Ûú[®`‹ÍYŸ¿‚ñ¯2ÄÇùVg#°epué“üñÂ@ôm'óeÁ±Wž©²£<¬‰#†wιoãM¨šöÛù²Ö¥uÅ>ÅI©"ªXæÌ—7©:(Ç)I—6ð,!߬äF–Ú(lÃûE+Ô²ü ¤|(w`­ÖJÂÞΈ½#Ú増¼74aÇ;¹:¥r#î:¦Ò¾¯ú£–´wü ôã©ß| q…×L…•+䓨üð—Pz€ïÃÞ 6Ó4&eJú"Àe”Û^™:²›÷9x/Ø»Ãuû…"]Sdâ§a8éfm»Nb-OÃxL¨ñZ‘ï‹St| ›jPš;cÌL…Ïí¨Ä)M5îO·ÿXTé¾íFÜ܆UF€Õ™:!ç¶•)H–G–oü1ÿïÜz_à°á°NÚ^¹-Ð^´tAäUžä¸»ºf£u™ì;eЇœÔhÀòtÉ'%2öbÌ?)*€Ðmm³ec8†°8ëU+ÕÂËÞÙwþ$ÊÍ|3 {áŠÜ¯&¾»›üE”méH u%ìPås¨M¡ºàÿnÕ›®v‘ÿ#¦A w÷[€>øà€>øQ¤a†ÿ~® Œ1æ¿€ŸAøà ¸ðÀè,À_ ¼LjU ±ü`Ü<Šw¡Êgã''PH àýð.T ƒ¬e„É’ÞFéÀù´À¿†-9ˆb”O¼®!ÊG ÂVÿžTY,À?…éLÞ #%"j:–kêèÇ”¦÷lÊù7"´ô")”?1•0¯!geË!àÝ «ø·ªÃ”*7{˜¦&pMs¡É‹ÎÞ ¿BUQ2ì$Ô„ !¬×ð^8zéƒo³¢J pV·Ãóö0S Y7Z3ͪ"C†i†LoŠ àÍàk‚º¶û®~Ý//”úwÏÇ›ÉIæ²)‹€¼*#i‡1:Œ6E€·C’m‡‡™6×í´ŸÐá4e~Å´¿ ݹ’#miK¹»º¨T ï ì÷åo›­U_•W{Tª¡Iz’­mé&U^[z®îðAVö =XœJH=€ÕÙ—i*§çÃ0•«ÄɽþT¢ùI¹üý£Gwßã#×uªØBæ'« C쪕zgÕ™^RïHUVÝÊÍz]þl8|èüìÕ6òœ Vƒß ¢L`Ž<ï÷èn³<†äúÚ¶N™•dOF2Zå±ÚÞK—XwÝãŽ>Œ§ p©‚âÈ1À%Lj• ±ÜdÊ«vºï< ÀCaY|ùÛôÔë~Ãzéi·ˆªU8ßêæ­Oxä¹øÀê”'us;ä|6~’Z‰¹ÓiÜËqŒTc''çY^Û…¶¤ƒæuýÌ­4+Ïù×Ip8ÿÝà¼M»ìÁÀâd=E¢B ©Áxsœ¼#Ìã,/€›]ÔS7eð%š+M'MAÊ¿`j9®—»²þy}+†-ºcŶHVçFùH#Aت‚¿'È0òò ¦Ö³¼v’?³®Reûx%M‡èΚQ%6Ò‡‚…­}k“&'ùaSyTFÒÕNF›âõ8â·:KÌ[ò™g¦¿èÃ/´ÀE/¸š¦kœ¼ ¬Ny´Þ¿Ó&WãônLJ[Qð<&Í€GajþÎvv=;ÁÚ;¹/[yrFñ|ºÍ†÷½µWì<‹¡5e€ÑÉ !ìÑ`ãA·ø¤ãušEÛèâ9/^…Òz4À£Èß ÑR³¿{¶6¶ +Óü tÏSð-ØUÛýˆ¿váj“ø`æ'ú*À|ðÀ¼Ê8Žã àGP>ø&|ð\øà $ðN°à ñ6Qr ú}yS®Þ…ª®ÃL1‘Þ4>ßeYÃ$a ˜ é=›òï¤zè³”(Å(Ÿ1x¥Æ:)Û@7k頻NVðOáU=¾K2}A~Ë5WÎêC€7ïh½?Tb„71NÇ?H¬ëEñ À»áW´>Ô5ªŒ‰‡ÆMÒ(?C%à½ð+Tub:ãz™[~‰ ‹:®muJÕ0‹ à¸×f‹•…žÿ|•Ñ©ÿ ’dÈ.cÆF‹œ*²<ÉQ(.ª¸žEî^† ëêr©¨´%°‰ñ¢„W4M_ù¨ŸÆ6nŒzíEš’å.eð²¬îà$2dYà»öc,A§ÿ•Vp†×P£Jd_ƒ¶éuØÓŒ­‰ß³™«s ]ð ø~†Óöȿ+=è•ü˜ôØ¡ÊG™W˜R{¸?!+7[ÀâŒy>€å²‰CíÂMV3°:Íü’P’è6U^ؙܔÛC#À»#‰J®w p £Œž÷$}†3qg­œï^PS;ZÊj–M.ÆX‡aí0 Ã;â¤x‰*¡*ëæXœ° Îé¯å‹­Ï¥F^Q>.U¥©5¥Æûb^­€1Ƽ#Ωn(=ÐK­ë,NÝy–6ìCN¥Æ‹šÈ‹,5¾MÓ[+صævÀAÞ9Ïkj¸k¾¥ï‹òü Dï[£Ø…Ímó®ù®˜Æ.w¨Àbsq¥j˜ä­»¹4mqUŠ™™¬[>þ¼3Þvø¸ôÀ6Œv6ùjôß^—(7nªkªu[k°”ð¢ïŠËĵüâ0·–‰ùÖ·÷9×x1*°:£Ï;ûŸgx}WÂbøÞâÊÙgnUfwsžÚ"®ÛæBßbw-ÀÄîú°FÀB.uaÙ+°†áŸâ`y€WÀ›6×AWÝ­KoUlMâ‘’¶µ™>{̺:°:eà:íEGZv¡N "ïÅDºÍ¹ÃœÉ¸9 Àó°ÝÜý“æúe‘¿mîæÊ•jÔ]¹ä·iùf²ÂbÈ Ò…¶±0ýÍY^ˆÚúïŒe`qήôý0 2µ¹‰,w¥Ô9´6Ò”ú,¤å3†jK+eÊ<;lp`‹ #ÏIvs€¨&ž¢ÊUªB6QZ¬²ÄÕõ&ÞŽÞP†&•ö©eš|'´uE=y|QÚð0å¬>–§=X§ éló›³¼“7<ŠJU•–xÙÆkEM’cT«ÙµRb¬ÿÛVúêUeDƧSC÷èÅfì¨ÉQoŽò)12K ‰ã,•ÕËY^ iá)gWªTv•¥FŽ"hõPb بR'©2&7IW#?Ãz:Ð Common Pipeline Library Reference Manual: Related Pages
Common Pipeline Library Reference Manual  6.6.1
Related Pages
Here is a list of all related documentation pages:
cpl-6.6.1/html/group__cpl__multiframe.html0000644000460300003120000015162612553662432015606 00000000000000 Common Pipeline Library Reference Manual: Multi Frames
Common Pipeline Library Reference Manual  6.6.1
Multi Frames

Modules

 Regular Expression Filter
 

Typedefs

typedef struct _cpl_multiframe_ cpl_multiframe
 The opaque multi-frame data type. More...
 
typedef enum _cpl_multiframe_id_mode_ cpl_multiframe_id_mode
 The flags indicating the naming scheme to use for multi-frame datasets. More...
 

Enumerations

enum  _cpl_multiframe_id_mode_ {
  CPL_MULTIFRAME_ID_SET,
  CPL_MULTIFRAME_ID_PREFIX,
  CPL_MULTIFRAME_ID_JOIN
}
 The flags indicating the naming scheme to use for multi-frame datasets. More...
 

Functions

cpl_error_code cpl_multiframe_add_empty (cpl_multiframe *self, const char *id)
 Add a placeholder to a multi-frame container. More...
 
cpl_error_code cpl_multiframe_append_datagroup (cpl_multiframe *self, const char *id, const cpl_frame *frame, cpl_size nsets, const char **names, const cpl_regex **filter1, const cpl_regex **filter2, const char **properties, unsigned int flags)
 Adds a group of dataset references given by name to a multi-frame container object. More...
 
cpl_error_code cpl_multiframe_append_datagroup_from_position (cpl_multiframe *self, const char *id, const cpl_frame *frame, cpl_size nsets, cpl_size *positions, const cpl_regex **filter1, const cpl_regex **filter2, const char **properties, unsigned int flags)
 Adds a group of dataset references given by position to a multi-frame container object. More...
 
cpl_error_code cpl_multiframe_append_dataset (cpl_multiframe *self, const char *id, const cpl_frame *frame, const char *name, const cpl_regex *filter1, const cpl_regex *filter2, unsigned int flags)
 Adds a dataset reference given by name to a multi-frame container object. More...
 
cpl_error_code cpl_multiframe_append_dataset_from_position (cpl_multiframe *self, const char *id, const cpl_frame *frame, cpl_size position, const cpl_regex *filter1, const cpl_regex *filter2, unsigned int flags)
 Adds a dataset reference given by position to a multi-frame container object. More...
 
void cpl_multiframe_delete (cpl_multiframe *self)
 Destroys a multi-frame container object. More...
 
cpl_size cpl_multiframe_get_size (const cpl_multiframe *self)
 Get the size of a multi-frame container object. More...
 
cpl_multiframecpl_multiframe_new (const cpl_frame *head, const char *id, cpl_regex *filter)
 Create a new multi-frame container object. More...
 
cpl_error_code cpl_multiframe_write (cpl_multiframe *self, const char *filename)
 Write a multi-frame container to a file. More...
 

Detailed Description

This module implements the cpl_multiframe container type. A multi frame contains references to datasets (FITS extensions) which may be distributed across several physical files. These references can then be merged into a new product file.

Synopsis:
#include <cpl_multiframe.h>
Note
This feature should be considered as experimental!

Typedef Documentation

typedef struct _cpl_multiframe_ cpl_multiframe

The opaque multi-frame data type.

The flags indicating the naming scheme to use for multi-frame datasets.

Enumeration Type Documentation

The flags indicating the naming scheme to use for multi-frame datasets.

Enumerator
CPL_MULTIFRAME_ID_SET 

Use the given identifier as dataset name

CPL_MULTIFRAME_ID_PREFIX 

Create the dataset name from the given identifier by appending the name of the source dataset.

CPL_MULTIFRAME_ID_JOIN 

Create the dataset name by concatenating the names of the involved source datasets. The given identifier is used as separator.

Function Documentation

cpl_error_code cpl_multiframe_add_empty ( cpl_multiframe self,
const char *  id 
)

Add a placeholder to a multi-frame container.

Parameters
selfThe multi-frame object.
idUnique dataset identifier.
Returns
The function returns CPL_ERROR_NONE on success, and an appropriate error code otherwise.

The function adds an empty dataset, a placeholder to a multi-frame container. An empty dataset is special since it is not attached to an underlying data file. When the multi-frame object is written to a file, an empty dataset appears as a named, but otherwise empty unit.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_ILLEGAL_OUTPUT, and CPL_ERROR_NONE.

cpl_error_code cpl_multiframe_append_datagroup ( cpl_multiframe self,
const char *  id,
const cpl_frame frame,
cpl_size  nsets,
const char **  names,
const cpl_regex **  filter1,
const cpl_regex **  filter2,
const char **  properties,
unsigned int  flags 
)

Adds a group of dataset references given by name to a multi-frame container object.

Parameters
selfThe multi-frame object.
idUnique dataset identifier.
frameThe source data frame from which the datasets are taken.
nsetsThe number of datasets to be merged.
namesThe names of the source datasets in the source data frame.
filter1Property filters to apply to the primary header of each source dataset.
filter2Property filters to apply to the extension header of each source dataset.
propertiesProperty names to be updated.
flagsFlag controlling the creation of the dataset's target id.
Returns
The function returns CPL_ERROR_NONE on success, and an appropriate error code otherwise.

The function is equivalent to cpl_multiframe_append_datagroup_from_position(), but the source datasets to be added are looked up in the source data frame frame using their names given in the array names.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set_where, cpl_fits_find_extension(), cpl_frame_get_filename(), CPL_MULTIFRAME_ID_JOIN, and CPL_MULTIFRAME_ID_PREFIX.

cpl_error_code cpl_multiframe_append_datagroup_from_position ( cpl_multiframe self,
const char *  id,
const cpl_frame frame,
cpl_size  nsets,
cpl_size positions,
const cpl_regex **  filter1,
const cpl_regex **  filter2,
const char **  properties,
unsigned int  flags 
)

Adds a group of dataset references given by position to a multi-frame container object.

Parameters
selfThe multi-frame object.
idUnique dataset identifier.
frameThe source data frame from which the datasets are taken.
nsetsThe number of datasets to be merged.
positionsPositions of the source datasets in the source data frame.
filter1Property filters to apply to the primary header of each source dataset.
filter2Property filters to apply to the extension header of each source dataset.
propertiesProperty names to be updated.
flagsFlag controlling the creation of the dataset's target id.
Returns
The function returns CPL_ERROR_NONE on success, and an appropriate error code otherwise.

The function adds nsets new dataset entry to the multi-frame self. The datasets to add are taken from the source data frame frame and are specified by the first nsets positions passed through the array positions. Before each selected dataset is added to the multi-frame self, the dataset's primary and supplementary properties are merged. If the filter arguments are given, i.e. the respective entries in filter1 and/or filter2 are non NULL, they are applied to the primary and the supplementary properties before both are merged. The arrays filter1 and filter2 must be given, and they must have nsets elements. The array elements, i.e. an individual filter may be set to NULL if no filter should be applied.

The creation of the dataset's target id is controlled by the argument flags. It can be only set to CPL_MULTIFRAME_ID_PREFIX or CPL_MULTIFRAME_ID_JOIN. If flags is set to CPL_MULTIFRAME_ID_PREFIX then id is used as prefix for the current dataset's original name (extension name). If the dataset to be appended does not have a name, id is used as the dataset identifier. If flags is set to CPL_MULTIFRAME_ID_JOIN, the dataset's identifier is created by concatenating the dataset name found in the primary properties, and the dataset name taken from the supplementary properties, using id as separator string. If no dataset name is found in the supplementary properties, only the dataset name found in the primary properties is used as identifier and the given separator is not appended. Note that for this last method it is an error if there is no dataset name present in the primary properties of the source dataset.

The argument id may be the empty string for the method CPL_MULTIFRAME_ID_JOIN. For the method CPL_MULTIFRAME_ID_PREFIX this is an error.

If properties is given it has to be a NULL terminated array of property names. For each specified property name their value is changed according to the naming scheme selected by flags, i.e. the value is either prefixed by id, or it is set to the concatenation of the source dataset name found in its primary properties, id, and its original value. This can be used to correctly change properties used to reference one of the other datasets in the given group through their value. If a given property is not found, it is ignored.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set_where, cpl_frame_get_filename(), CPL_MULTIFRAME_ID_JOIN, and CPL_MULTIFRAME_ID_PREFIX.

cpl_error_code cpl_multiframe_append_dataset ( cpl_multiframe self,
const char *  id,
const cpl_frame frame,
const char *  name,
const cpl_regex filter1,
const cpl_regex filter2,
unsigned int  flags 
)

Adds a dataset reference given by name to a multi-frame container object.

Parameters
selfThe multi-frame object.
idUnique dataset identifier.
frameThe source data frame from which the dataset is taken.
nameName of the source dataset in the source data frame.
filter1Property filter to apply to the primary header of the source dataset.
filter2Property filter to apply to the extension header of the source dataset.
flagsFlag controlling the creation of the dataset's target id.
Returns
The function returns CPL_ERROR_NONE on success, and an appropriate error code otherwise.

The function adds a new dataset entry to the multi-frame self. The dataset to add is looked up in the source data frame frame using its name name. It is an error if no dataset with the given name name is found. Before the selected dataset is added to the multi-frame self, the dataset's primary and supplementary properties are merged. If the filter arguments are given, i.e. filter1 and/or filter2 are non NULL, they are applied to the primary and the supplementary properties before both are merged.

The creation of the dataset's target id is controlled by the argument flags. It can be set to one of the values defined by the enumeration cpl_multiframe_id_mode. If flags is set to CPL_MULTIFRAME_ID_SET, the argument id is used as dataset identifier. If flags is set to CPL_MULTIFRAME_ID_PREFIX then id is used as prefix for the dataset's original name (extension name). If the dataset to be appended does not have a name, id is used as the full dataset identifier. If flags is set to CPL_MULTIFRAME_ID_JOIN, the dataset's identifier is created by concatenating the dataset name found in the primary properties, and the dataset name taken from the supplementary properties, using id as separator string. If no dataset name is found in the supplementary properties, only the dataset name found in the primary properties is used as identifier and the given separator is not appended. Note that for this last method it is an error if there is no dataset name present in the primary properties of the source dataset.

The argument id may be the empty string for the methods CPL_MULTIFRAME_ID_SET and CPL_MULTIFRAME_ID_JOIN. For the method CPL_MULTIFRAME_ID_PREFIX this is an error.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set_where, cpl_frame_get_filename(), CPL_MULTIFRAME_ID_JOIN, CPL_MULTIFRAME_ID_PREFIX, and CPL_MULTIFRAME_ID_SET.

cpl_error_code cpl_multiframe_append_dataset_from_position ( cpl_multiframe self,
const char *  id,
const cpl_frame frame,
cpl_size  position,
const cpl_regex filter1,
const cpl_regex filter2,
unsigned int  flags 
)

Adds a dataset reference given by position to a multi-frame container object.

Parameters
selfThe multi-frame object.
idUnique dataset identifier.
frameThe source data frame from which the dataset is taken.
positionPosition of the source dataset in the source data frame.
filter1Property filter to apply to the primary header of the source dataset.
filter2Property filter to apply to the extension header of the source dataset.
flagsFlag controlling the creation of the dataset's target id.
Returns
The function returns CPL_ERROR_NONE on success, and an appropriate error code otherwise.

The function adds a new dataset entry to the multi-frame self. The dataset to add is the taken from position position of the source data frame frame. Before the selected dataset is added to the multi-frame self, the dataset's primary and supplementary properties are merged. If the filter arguments are given, i.e. filter1 and/or filter2 are non NULL, they are applied to the primary and the supplementary properties before both are merged.

The creation of the dataset's target id is controlled by the argument flags. It can be set to one of the values defined by the enumeration cpl_multiframe_id_mode. If flags is set to CPL_MULTIFRAME_ID_SET, the argument id is used as dataset identifier. If flags is set to CPL_MULTIFRAME_ID_PREFIX then id is used as prefix for the dataset's original name (extension name). If the dataset to be appended does not have a name, id is used as the full dataset identifier. If flags is set to CPL_MULTIFRAME_ID_JOIN, the dataset's identifier is created by concatenating the dataset name found in the primary properties, and the dataset name taken from the supplementary properties, using id as separator string. If no dataset name is found in the supplementary properties, only the dataset name found in the primary properties is used as identifier and the given separator is not appended. Note that for this last method it is an error if there is no dataset name present in the primary properties of the source dataset.

The argument id may be the empty string for the methods CPL_MULTIFRAME_ID_SET and CPL_MULTIFRAME_ID_JOIN. For the method CPL_MULTIFRAME_ID_PREFIX this is an error.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set_where, cpl_frame_get_filename(), CPL_MULTIFRAME_ID_JOIN, CPL_MULTIFRAME_ID_PREFIX, and CPL_MULTIFRAME_ID_SET.

void cpl_multiframe_delete ( cpl_multiframe self)

Destroys a multi-frame container object.

Parameters
selfThe multi-frame container.
Returns
Nothing.

The function deallocates the multi-frame container self.

Referenced by cpl_multiframe_new().

cpl_size cpl_multiframe_get_size ( const cpl_multiframe self)

Get the size of a multi-frame container object.

Parameters
selfThe multi-frame object.
Returns
The function returns the current number of datasets referenced by the multi-frame container.

The function returns the number of dataset entries stored in the multi-frame self.

References CPL_ERROR_NULL_INPUT.

cpl_multiframe* cpl_multiframe_new ( const cpl_frame head,
const char *  id,
cpl_regex filter 
)

Create a new multi-frame container object.

Parameters
headThe first dataset of the multi-frame object
idUnique dataset identifier.
filterFilter to be applied to the dataset properties on merge.
Returns
The function returns a newly allocated multi-frame object on success, or NULL otherwise.

The function allocates the memory for a multi-frame container and adds the frame master as the head, i.e. the first and emtpy dataset of the multi-frame object. A unique dataset identifier id may be given. The identifier id may be the empty string, in which case it is ignored when writing the multi-frame object to a file. Furthermore a regular expression filter object may be given which will be applied to each of the properties of the dataset head. Only those properties of em head, which pass the filter filter will be propagated to the created multi-frame container.

References CPL_ERROR_NULL_INPUT, cpl_frame_get_filename(), cpl_multiframe_delete(), cpl_regex_delete(), CPL_REGEX_EXTENDED, cpl_regex_new(), and CPL_REGEX_NOSUBS.

cpl_error_code cpl_multiframe_write ( cpl_multiframe self,
const char *  filename 
)

Write a multi-frame container to a file.

Parameters
selfThe multi-frame container object.
filenameName of the file to which the multi-frame object is written.
Returns
The function returns CPL_ERROR_NONE on success, and an appropriate error code otherwise.

The function writes the multi-frame object self to the file filename. A multi-frame object contains only the properties and the references to the data units, which may be located in different files. Only when this function is called the all referenced datasets are copied and written to the output file.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_FILE_NOT_CREATED, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl-6.6.1/html/group__cpl__frameset.html0000644000460300003120000026110512553662432015241 00000000000000 Common Pipeline Library Reference Manual: Frame Sets
Common Pipeline Library Reference Manual  6.6.1
Frame Sets

Modules

 Frame Set Iterators
 Iterator support for frame sets.
 

Typedefs

typedef struct _cpl_frameset_ cpl_frameset
 The frame set data type. More...
 

Functions

int cpl_frameset_count_tags (const cpl_frameset *self, const char *tag)
 Counts the frames stored in a frame set having the given tag. More...
 
void cpl_frameset_delete (cpl_frameset *self)
 Destroy a frame set. More...
 
void cpl_frameset_dump (const cpl_frameset *self, FILE *stream)
 Dump the frameset debugging information to the given stream. More...
 
cpl_framesetcpl_frameset_duplicate (const cpl_frameset *other)
 Create a copy of the given frame set. More...
 
cpl_size cpl_frameset_erase (cpl_frameset *self, const char *tag)
 Erase all frames with the given tag from a frame set. More...
 
cpl_error_code cpl_frameset_erase_frame (cpl_frameset *self, cpl_frame *frame)
 Erase the given frame from a frame set. More...
 
cpl_framesetcpl_frameset_extract (const cpl_frameset *self, const cpl_size *labels, cpl_size desired_label)
 Extract a subset of frames from a set of frames. More...
 
cpl_framecpl_frameset_find (cpl_frameset *self, const char *tag)
 Find a frame with the given tag in a frame set. More...
 
const cpl_framecpl_frameset_find_const (const cpl_frameset *self, const char *tag)
 Find a frame with the given tag in a frame set. More...
 
cpl_framecpl_frameset_get_first (cpl_frameset *self)
 Get the first frame in the given set. More...
 
const cpl_framecpl_frameset_get_first_const (const cpl_frameset *self)
 Get the first frame in the given set. More...
 
cpl_framecpl_frameset_get_frame (cpl_frameset *set, cpl_size position)
 Get a frame from a frame set. More...
 
const cpl_framecpl_frameset_get_frame_const (const cpl_frameset *set, cpl_size position)
 Get a frame from a frame set. More...
 
cpl_framecpl_frameset_get_next (cpl_frameset *self)
 Get the next frame in the given set. More...
 
const cpl_framecpl_frameset_get_next_const (const cpl_frameset *self)
 Get the next frame in the given set. More...
 
cpl_framecpl_frameset_get_position (cpl_frameset *self, cpl_size position)
 Get the frame at a given position in the frame set. More...
 
const cpl_framecpl_frameset_get_position_const (const cpl_frameset *self, cpl_size position)
 Get the frame at a given iterator position. More...
 
cpl_size cpl_frameset_get_size (const cpl_frameset *self)
 Get the current size of a frame set. More...
 
cpl_error_code cpl_frameset_insert (cpl_frameset *self, cpl_frame *frame)
 Insert a frame into the given frame set. More...
 
int cpl_frameset_is_empty (const cpl_frameset *self)
 Check whether a frame set is empty. More...
 
cpl_error_code cpl_frameset_join (cpl_frameset *self, const cpl_frameset *other)
 Join two frame sets. More...
 
cpl_sizecpl_frameset_labelise (const cpl_frameset *self, int(*compare)(const cpl_frame *, const cpl_frame *), cpl_size *nb_labels)
 Separate a list of frames into groups, using a comparison function. More...
 
cpl_framesetcpl_frameset_new (void)
 Create a new, empty frame set. More...
 
cpl_error_code cpl_frameset_sort (cpl_frameset *self, cpl_frame_compare_func compare)
 Sort a frame set. More...
 

Detailed Description

The module implements a container type for frames. Frames can be stored in a frame set and retrieved, either by searching for a particular frame tag or by sequential access. Frame sets can be created, filled and saved to a so called `set of frames' file or loaded from such a file.

Synopsis:
#include <cpl_frameset.h>

Typedef Documentation

typedef struct _cpl_frameset_ cpl_frameset

The frame set data type.

This data type is opaque.

Function Documentation

int cpl_frameset_count_tags ( const cpl_frameset self,
const char *  tag 
)

Counts the frames stored in a frame set having the given tag.

Parameters
selfA frame set.
tagThe frame tag.
Returns
The number of frames with tag tag. The function returns 0 if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.

The function scans the frame set self for frames with the tag tag and returns the number of frames found.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

void cpl_frameset_delete ( cpl_frameset self)

Destroy a frame set.

Parameters
selfThe frame set to destroy.
Returns
Nothing.

The function destroys the frame set self and its whole contents. If self is NULL, nothing is done and no error is set.

void cpl_frameset_dump ( const cpl_frameset self,
FILE *  stream 
)

Dump the frameset debugging information to the given stream.

Parameters
selfThe frameset.
streamThe output stream to use.
Returns
Nothing.

The function dumps the contents of the frameset self to the output stream stream. If stream is NULL the function writes to the standard output. If self is NULL or the frameset is empty, the function does nothing.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, cpl_error_get_code(), cpl_errorstate_get(), cpl_errorstate_set(), cpl_frame_dump(), cpl_frameset_get_size(), cpl_frameset_iterator_advance(), cpl_frameset_iterator_delete(), cpl_frameset_iterator_get_const(), and cpl_frameset_iterator_new().

cpl_frameset* cpl_frameset_duplicate ( const cpl_frameset other)

Create a copy of the given frame set.

Parameters
otherThe frame set to be copied.
Returns
A handle for the created clone. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter other is a NULL pointer.

The function creates a deep copy, i.e. the frame set object and its contents, of the frame set other. The created copy and the original set do not share any resources.

References CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_frame_duplicate(), cpl_frame_get_tag(), and cpl_frameset_new().

cpl_size cpl_frameset_erase ( cpl_frameset self,
const char *  tag 
)

Erase all frames with the given tag from a frame set.

Parameters
selfA frame set.
tagThe tag used to locate the frames to remove.
Returns
The function returns the number of frames removed. If an error occurs 0 is returned and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.

The function searches the frame set self for frames having the tag tag and removes them from the set. The removed frames are destroyed. If no frame with the tag tag is found the function has no effect.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_error_code cpl_frameset_erase_frame ( cpl_frameset self,
cpl_frame frame 
)

Erase the given frame from a frame set.

Parameters
selfA frame set.
frameThe frame to remove.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or frame is a NULL pointer.

The function searches the frame set self for the first occurrance of frame. If it is present, the frame is removed from the set and destroyed. If frame is not present in self the function has no effect.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_frame_get_tag().

cpl_frameset* cpl_frameset_extract ( const cpl_frameset self,
const cpl_size labels,
cpl_size  desired_label 
)

Extract a subset of frames from a set of frames.

Parameters
selfInput frame set
labelsThe array of labels associated to each input frame
desired_labelThe label identifying the requested frames
Note
The array of labels must have (at least) the length of the frame set
Returns
A pointer to a newly allocated frame set or NULL on error
Errors
CPL_ERROR_NULL_INPUT The parameter self or labels is a NULL pointer.

The returned object must be deallocated with cpl_frameset_delete()

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_set(), cpl_frame_duplicate(), cpl_frameset_insert(), cpl_frameset_iterator_advance(), cpl_frameset_iterator_delete(), cpl_frameset_iterator_get_const(), cpl_frameset_iterator_new(), and cpl_frameset_new().

cpl_frame* cpl_frameset_find ( cpl_frameset self,
const char *  tag 
)

Find a frame with the given tag in a frame set.

Parameters
selfA frame set.
tagThe frame tag to search for.
Returns
The handle for a frame with tag tag, or NULL if no such frame was found. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.

The function searches the frame set self for the frames with the tag tag. If such a frame is present, a handle for it is returned. If the set contains several frames with the tag tag the first one is returned. The remaining frames with this tag can be accessed sequentially by using NULL as tag when calling this function repeatedly, since the most recent frame accessed is cached. This cache is reset whenever the provided tag is not NULL. If no frame with the tag tag is present in self or no more frames with this tag are found the function returns NULL.

Note
Since the most recently accessed frame is cached in the frameset this function is not re-entrant!

References cpl_error_set_where, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_frameset_find_const().

const cpl_frame* cpl_frameset_find_const ( const cpl_frameset self,
const char *  tag 
)

Find a frame with the given tag in a frame set.

Parameters
selfA frame set.
tagThe frame tag to search for.
Returns
The handle for a frame with tag tag, or NULL if no such frame was found. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.

The function searches the frame set self for the frames with the tag tag. If such a frame is present, a handle for it is returned. If the set contains several frames with the tag tag the first one is returned. The remaining frames with this tag can be accessed sequentially by using NULL as tag when calling this function repeatedly, since the most recent frame accessed is cached. This cache is reset whenever the provided tag is not NULL. If no frame with the tag tag is present in self or no more frames with this tag are found the function returns NULL.

Note
Since the most recently accessed frame is cached in the frameset this function is not re-entrant!

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_frameset_find().

cpl_frame* cpl_frameset_get_first ( cpl_frameset self)

Get the first frame in the given set.

Parameters
selfA frame set.
Returns
A handle for the first frame in the set, or NULL if the set is empty. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the first frame in the frame set self if it exists. If a first frame does not exist, i.e. the frame set is empty, NULL is returned. The function also updates the internal cache.

See also
cpl_frameset_get_next()
Deprecated:
This function will be removed from CPL version 7. Code using these functions should be ported to make use of frame set iterators instead!

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

const cpl_frame* cpl_frameset_get_first_const ( const cpl_frameset self)

Get the first frame in the given set.

Parameters
selfA frame set.
Returns
A handle for the first frame in the set, or NULL if the set is empty. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the first frame in the frame set self if it exists. If a first frame does not exist, i.e. the frame set is empty, NULL is returned. The function also updates the internal cache.

See also
cpl_frameset_get_next_const()
Deprecated:
This function will be removed from CPL version 7. Code using these functions should be ported to make use of frame set iterators instead!

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_frame* cpl_frameset_get_frame ( cpl_frameset set,
cpl_size  position 
)

Get a frame from a frame set.

Parameters
setInput frame set.
positionThe requested frame.
Returns
The function returns a handle to the frame at position position in the set, or NULL in case an error occurs.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter position is out of range.

The function returns a handle to the frame at the index position in the set. The frame position ranges from 0 to one less than the size of the frame set.

The returned frame is still owned by the frame set set, i.e. the obtained frame must not be deleted through the returned handle and also its tag must not be modified.

As an alternative to using this function, the functions cpl_frameset_get_first() and cpl_frameset_get_next() should be considered, if performance is an issue.

See also
cpl_frameset_get_size(), cpl_frameset_get_first(), cpl_frameset_get_next()
Deprecated:
This function will be removed from CPL version 7. Code using these functions should use cpl_frameset_get_position() instead!

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_frameset_get_position(), and cpl_frameset_get_size().

const cpl_frame* cpl_frameset_get_frame_const ( const cpl_frameset set,
cpl_size  position 
)

Get a frame from a frame set.

Parameters
setInput frame set.
positionThe requested frame.
Returns
The function returns a handle to the frame at position position in the set, or NULL in case an error occurs.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter position is out of range.

The function returns a handle to the frame at the index position in the set. The frame position ranges from 0 to one less than the size of the frame set.

The returned frame is still owned by the frame set set, i.e. the obtained frame must not be deleted through the returned handle and also its tag must not be modified.

As an alternative to using this function, the functions cpl_frameset_get_first_const() and cpl_frameset_get_next_const() should be considered, if performance is an issue.

See also
cpl_frameset_get_size(), cpl_frameset_get_first_const(), cpl_frameset_get_next_const()
Deprecated:
This function will be removed from CPL version 7. Code using these functions should use cpl_frameset_get_position_const() instead!

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_frameset_get_position_const(), and cpl_frameset_get_size().

cpl_frame* cpl_frameset_get_next ( cpl_frameset self)

Get the next frame in the given set.

Parameters
selfA frame set.
Returns
A handle for the next frame in a set. If there are no more frames in the set the function returns NULL. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the next frame in the frame set self if it exists and otherwise NULL. The function uses the internal cache to determine the most recently accessed frame. This means that the function only works as expected if self has been initialised by a call to cpl_frameset_get_first(), and if no function updating the internal cache was called between two subsequent calls to this function.

See also
cpl_frameset_get_first()
Deprecated:
This function will be removed from CPL version 7. Code using these functions should be ported to make use of frame set iterators instead!

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

const cpl_frame* cpl_frameset_get_next_const ( const cpl_frameset self)

Get the next frame in the given set.

Parameters
selfA frame set.
Returns
A handle for the next frame in a set. If there are no more frames in the set the function returns NULL. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the next frame in the frame set self if it exists and otherwise NULL. The function uses the internal cache to determine the most recently accessed frame. This means that the function only works as expected if self has been initialised by a call to cpl_frameset_get_first_const(), and if no function updating the internal cache was called between two subsequent calls to this function.

See also
cpl_frameset_get_first_const()
Deprecated:
This function will be removed from CPL version 7. Code using these functions should be ported to make use of frame set iterators instead!

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_frame* cpl_frameset_get_position ( cpl_frameset self,
cpl_size  position 
)

Get the frame at a given position in the frame set.

Parameters
selfThe frame set
positionFrame position.
Returns
The function returns the frame at the given position, or NULL if an error occurs.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter position is invalid, i.e. the given value is outside of its domain.

The function retrieves the frame stored in the frame set self at the index position position. The index positions are counted from zero, and reach up to one less than the number of frames in the frame set.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_frameset_get_size().

Referenced by cpl_frameset_get_frame().

const cpl_frame* cpl_frameset_get_position_const ( const cpl_frameset self,
cpl_size  position 
)

Get the frame at a given iterator position.

Parameters
selfThe iterator to dereference
positionIterator offset from the beginning of the frame set.
Returns
The function returns the frame at the iterator position, or NULL if an error occurs.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter position is invalid, i.e. the given value is outside of its domain.

The function retrieves the frame stored in the frame set self at the index position position. The index positions are counted from zero, and reach up to one less than the number of frames in the frame set.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_frameset_get_size().

Referenced by cpl_frameset_get_frame_const().

cpl_size cpl_frameset_get_size ( const cpl_frameset self)

Get the current size of a frame set.

Parameters
selfA frame set.
Returns
The frame set's current size, or 0 if it is empty. The function returns 0 if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The reports the current number of frames stored in the frame set self.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header(), cpl_frameset_dump(), cpl_frameset_get_frame(), cpl_frameset_get_frame_const(), cpl_frameset_get_position(), cpl_frameset_get_position_const(), and cpl_frameset_labelise().

cpl_error_code cpl_frameset_insert ( cpl_frameset self,
cpl_frame frame 
)

Insert a frame into the given frame set.

Parameters
selfA frame set.
frameThe frame to insert.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or frame is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter frame has an invalid tag.

The function adds the frame frame to the frame set self using the frame's tag as key.

The insertion of a frame into a frameset transfers the ownership of the frame frame to the frameset self. This means that the frame must not be deallocated through the pointer frame.

In addition, the frame pointer returned by any member function call returning a handle to a frameset's member frame, must not be used to insert the returned frame into another framset without prior duplication of this frame, and, it must not be used to modify the frames tag without removing it from the frameset first and re-inserting it with the new tag afterwards.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_frame_get_tag().

Referenced by cpl_frameset_extract(), and cpl_frameset_join().

int cpl_frameset_is_empty ( const cpl_frameset self)

Check whether a frame set is empty.

Parameters
selfA frame set.
Returns
The function returns 1 if the set is empty, and 0 otherwise. If an error occurs 0 is returned and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function checks if self contains any frames.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_sign_products(), and cpl_frameset_join().

cpl_error_code cpl_frameset_join ( cpl_frameset self,
const cpl_frameset other 
)

Join two frame sets.

Parameters
selfThe target frame set
otherThe source frame set
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or frame is a NULL pointer.

The function adds the contents of the frame set other to self by inserting copies of the elements of the frame set other. If the source frame set other is NULL, or if it is empty, the function has no effect.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_frame_delete(), cpl_frame_duplicate(), cpl_frameset_insert(), and cpl_frameset_is_empty().

cpl_size* cpl_frameset_labelise ( const cpl_frameset self,
int(*)(const cpl_frame *, const cpl_frame *)  compare,
cpl_size nb_labels 
)

Separate a list of frames into groups, using a comparison function.

Parameters
selfInput frame set
comparePointer to comparison function to use.
nb_labelsNumber of different sets or undefined on error
Returns
array of labels defining the selection or NULL on error
Errors
CPL_ERROR_NULL_INPUT The parameter self, compare or nb_labels is a NULL pointer.

This function takes a set of frames and groups the frames that are 'identical' together. The user provided comparison function defines what being identical means for two frames. A label (non-negative int) is associated to each group of identical frames, these labels are returned in an array of length equal to the size of the frameset.

The comparison function should be commutative, must take two frames and return 1 if they are identical, 0 if they are different, and -1 on error.

The number of calls to the comparison functions is O(n*m), where n is the number of frames in the set, and m is the number of different labels found in the set. In the worst case m equals n, and the call requires n(n-1)/2 calls to the comparison function. If all identical frames appear together in the list, the number of required calls is only n + O(m^2).

The returned array must be deallocated with cpl_free().

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_set(), cpl_frameset_get_size(), cpl_frameset_iterator_advance(), cpl_frameset_iterator_delete(), cpl_frameset_iterator_get(), cpl_frameset_iterator_new(), cpl_msg_debug(), and CPL_SIZE_FORMAT.

cpl_frameset* cpl_frameset_new ( void  )

Create a new, empty frame set.

Returns
The handle for the newly created frame set.

The function allocates the memory for the new frame set, initialises the set to be empty and returns a handle for it.

References cpl_frame_delete().

Referenced by cpl_frameset_duplicate(), and cpl_frameset_extract().

cpl_error_code cpl_frameset_sort ( cpl_frameset self,
cpl_frame_compare_func  compare 
)

Sort a frame set.

Parameters
selfThe frame set to sort.
compareComparison function for frames.
Returns
The function returns CPL_ERROR_NONE on success, or an appropriate CPL error code otherwise.
Errors
  • CPL_ERROR_NULL_INPUT The parameter self or compare is a NULL pointer.

The function replaces the existing order of the frame set self by sorting its contents according to the comparison function compare.

By default, the order of a frame set, i.e. the order of any newly created frame set object, is defined by the order in which frames are inserted into the frame set. By calling this function, this order will be lost. If this order has to be preserved, sorting has to be done on a copy of self.

The function compare compares two frames and must return -1, 0, or 1 if the first frame is considered to be less than, equal or larger than the second frame, respectively.

See also
cpl_frame_compare_func

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl-6.6.1/html/group__cpl__parameterlist.html0000644000460300003120000017274012553662432016315 00000000000000 Common Pipeline Library Reference Manual: Parameter Lists
Common Pipeline Library Reference Manual  6.6.1
Parameter Lists

Typedefs

typedef struct _cpl_parameterlist_ cpl_parameterlist
 The opaque parameter list data type. More...
 

Functions

cpl_error_code cpl_parameterlist_append (cpl_parameterlist *self, cpl_parameter *parameter)
 Append a parameter to a parameter list. More...
 
void cpl_parameterlist_delete (cpl_parameterlist *self)
 Destroy a parameter list. More...
 
void cpl_parameterlist_dump (const cpl_parameterlist *self, FILE *stream)
 Dump the contents of a parameter list to the given stream. More...
 
cpl_parametercpl_parameterlist_find (cpl_parameterlist *self, const char *name)
 Find a parameter with the given name in a parameter list. More...
 
const cpl_parametercpl_parameterlist_find_const (const cpl_parameterlist *self, const char *name)
 Find a parameter with the given name in a parameter list. More...
 
cpl_parametercpl_parameterlist_find_context (cpl_parameterlist *self, const char *context)
 Find a parameter which belongs to the given context in a parameter list. More...
 
const cpl_parametercpl_parameterlist_find_context_const (const cpl_parameterlist *self, const char *context)
 Find a parameter which belongs to the given context in a parameter list. More...
 
cpl_parametercpl_parameterlist_find_tag (cpl_parameterlist *self, const char *tag)
 Find a parameter with the given tag in a parameter list. More...
 
const cpl_parametercpl_parameterlist_find_tag_const (const cpl_parameterlist *self, const char *tag)
 Find a parameter with the given tag in a parameter list. More...
 
cpl_parametercpl_parameterlist_find_type (cpl_parameterlist *self, cpl_type type)
 Find a parameter of the given type in a parameter list. More...
 
const cpl_parametercpl_parameterlist_find_type_const (const cpl_parameterlist *self, cpl_type type)
 Find a parameter of the given type in a parameter list. More...
 
cpl_parametercpl_parameterlist_get_first (cpl_parameterlist *self)
 Get the first parameter in the given parameter list. More...
 
const cpl_parametercpl_parameterlist_get_first_const (const cpl_parameterlist *self)
 Get the first parameter in the given parameter list. More...
 
cpl_parametercpl_parameterlist_get_last (cpl_parameterlist *self)
 Get the last parameter in the given list. More...
 
const cpl_parametercpl_parameterlist_get_last_const (const cpl_parameterlist *self)
 Get the last parameter in the given list. More...
 
cpl_parametercpl_parameterlist_get_next (cpl_parameterlist *self)
 Get the next parameter in the given list. More...
 
const cpl_parametercpl_parameterlist_get_next_const (const cpl_parameterlist *self)
 Get the next parameter in the given list. More...
 
cpl_size cpl_parameterlist_get_size (const cpl_parameterlist *self)
 Get the current size of a parameter list. More...
 
cpl_parameterlistcpl_parameterlist_new (void)
 Create a new parameter list. More...
 

Detailed Description

The module implements a parameter list data type, a container for the cpl_parameter type. It provides a convenient way to pass a set of parameters, as a whole, to a function.

It is used in the plugin interface (cf. Plugin Interface), for instance, to pass the parameters a recipe accepts from the plugin to the calling application and vice versa.

All functions expect a valid pointer to a parameter list as input, unless otherwise specified.

Synopsis:
#include <cpl_parameterlist.h>

Typedef Documentation

typedef struct _cpl_parameterlist_ cpl_parameterlist

The opaque parameter list data type.

Function Documentation

cpl_error_code cpl_parameterlist_append ( cpl_parameterlist self,
cpl_parameter parameter 
)

Append a parameter to a parameter list.

Parameters
selfA parameter list.
parameterThe parameter to append.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The parameter parameter is appended to the parameter list self.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

void cpl_parameterlist_delete ( cpl_parameterlist self)

Destroy a parameter list.

Parameters
selfThe parameter list to destroy.
Returns
Nothing.

The function destroys the parameter list object self and all parameters it possibly contains. The individual parameters are destroyed using the parameter destructor (cf. Parameters). If self is NULL, nothing is done and no error is set.

References cpl_parameter_delete().

void cpl_parameterlist_dump ( const cpl_parameterlist self,
FILE *  stream 
)

Dump the contents of a parameter list to the given stream.

Parameters
selfThe parameter list.
streamThe output stream to use.
Returns
Nothing.

The function dumps the debugging information for each parameter found in the parameter list self to the output stream stream. The debugging information for each individual parameter is dumped using cpl_parameter_dump(). If self is NULL the function does nothing.

See also
cpl_parameter_dump()

References cpl_parameter_dump().

cpl_parameter* cpl_parameterlist_find ( cpl_parameterlist self,
const char *  name 
)

Find a parameter with the given name in a parameter list.

Parameters
selfA parameter list.
nameThe parameter name to search for.
Returns
The function returns a handle for the first parameter with the name name, or NULL if no such parameter was found. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the parameter list self for the first occurrence of a parameter with the fully qualified name name. If no parameter with this name exists, the function returns NULL.

References cpl_error_set_where, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_parameterlist_find_const().

const cpl_parameter* cpl_parameterlist_find_const ( const cpl_parameterlist self,
const char *  name 
)

Find a parameter with the given name in a parameter list.

Parameters
selfA parameter list.
nameThe parameter name to search for.
Returns
The function returns a handle for the first parameter with the name name, or NULL if no such parameter was found. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

The function searches the parameter list self for the first occurrence of a parameter with the fully qualified name name. If no parameter with this name exists, the function returns NULL.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_parameter_get_name().

Referenced by cpl_parameterlist_find().

cpl_parameter* cpl_parameterlist_find_context ( cpl_parameterlist self,
const char *  context 
)

Find a parameter which belongs to the given context in a parameter list.

Parameters
selfA parameter list.
contextThe parameter context to search for.
Returns
The function returns a handle for the first parameter with the context context, or NULL if no such parameter was found. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or context is a NULL pointer.

The function searches the parameter list self for the first occurrence of a parameter which belongs to the context context. If no parameter with this type exists, the function returns NULL.

References cpl_error_set_where, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_parameterlist_find_context_const().

const cpl_parameter* cpl_parameterlist_find_context_const ( const cpl_parameterlist self,
const char *  context 
)

Find a parameter which belongs to the given context in a parameter list.

Parameters
selfA parameter list.
contextThe parameter context to search for.
Returns
The function returns a handle for the first parameter with the context context, or NULL if no such parameter was found. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or context is a NULL pointer.

The function searches the parameter list self for the first occurrence of a parameter which belongs to the context context. If no parameter with this type exists, the function returns NULL.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_parameter_get_context().

Referenced by cpl_parameterlist_find_context().

cpl_parameter* cpl_parameterlist_find_tag ( cpl_parameterlist self,
const char *  tag 
)

Find a parameter with the given tag in a parameter list.

Parameters
selfA parameter list.
tagThe parameter tag to search for.
Returns
The function returns a handle for the first parameter with the tag tag, or NULL if no such parameter was found. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.

The function searches the parameter list self for the first occurrence of a parameter with the user tag tag. If no parameter with this tag exists, the function returns NULL.

References cpl_error_set_where, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_parameterlist_find_tag_const().

const cpl_parameter* cpl_parameterlist_find_tag_const ( const cpl_parameterlist self,
const char *  tag 
)

Find a parameter with the given tag in a parameter list.

Parameters
selfA parameter list.
tagThe parameter tag to search for.
Returns
The function returns a handle for the first parameter with the tag tag, or NULL if no such parameter was found. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.

The function searches the parameter list self for the first occurrence of a parameter with the user tag tag. If no parameter with this tag exists, the function returns NULL.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_parameter_get_tag().

Referenced by cpl_parameterlist_find_tag().

cpl_parameter* cpl_parameterlist_find_type ( cpl_parameterlist self,
cpl_type  type 
)

Find a parameter of the given type in a parameter list.

Parameters
selfA parameter list.
typeThe parameter type to search for.
Returns
The function returns a handle for the first parameter with the type type, or NULL if no such parameter was found. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function searches the parameter list self for the first occurrence of a parameter whose value is of the type type. If no parameter with this type exists, the function returns NULL.

References cpl_error_set_where, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_parameterlist_find_type_const().

const cpl_parameter* cpl_parameterlist_find_type_const ( const cpl_parameterlist self,
cpl_type  type 
)

Find a parameter of the given type in a parameter list.

Parameters
selfA parameter list.
typeThe parameter type to search for.
Returns
The function returns a handle for the first parameter with the type type, or NULL if no such parameter was found. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function searches the parameter list self for the first occurrence of a parameter whose value is of the type type. If no parameter with this type exists, the function returns NULL.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_parameter_get_type().

Referenced by cpl_parameterlist_find_type().

cpl_parameter* cpl_parameterlist_get_first ( cpl_parameterlist self)

Get the first parameter in the given parameter list.

Parameters
selfA parameter list.
Returns
The function returns a handle for the first parameter in the list, or NULL if the list is empty. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the first parameter in the parameter list self, if it exists. If there is no first parameter, i.e. if the list is empty, NULL is returned. The function updates the internal search position cache.

References cpl_error_set_where, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_parameterlist_get_first_const().

const cpl_parameter* cpl_parameterlist_get_first_const ( const cpl_parameterlist self)

Get the first parameter in the given parameter list.

Parameters
selfA parameter list.
Returns
The function returns a handle for the first parameter in the list, or NULL if the list is empty. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the first parameter in the parameter list self, if it exists. If there is no first parameter, i.e. if the list is empty, NULL is returned. The function updates the internal search position cache.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header(), and cpl_parameterlist_get_first().

cpl_parameter* cpl_parameterlist_get_last ( cpl_parameterlist self)

Get the last parameter in the given list.

Parameters
selfA parameter list.
Returns
The function returns a handle for the last parameter in the list. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter self is an empty list.

The function returns the last parameter stored in the parameter list self. The list self must not be empty.

References cpl_error_set_where, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_parameterlist_get_last_const().

const cpl_parameter* cpl_parameterlist_get_last_const ( const cpl_parameterlist self)

Get the last parameter in the given list.

Parameters
selfA parameter list.
Returns
The function returns a handle for the last parameter in the list. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameter self is an empty list.

The function returns the last parameter stored in the parameter list self. The list self must not be empty.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_parameterlist_get_last().

cpl_parameter* cpl_parameterlist_get_next ( cpl_parameterlist self)

Get the next parameter in the given list.

Parameters
selfA parameter list.
Returns
The function returns a handle for the next parameter in the list, or NULL if there are no more parameters in the list. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the next parameter in the parameter list self if it exists and NULL otherwise. The function uses the last cached search position to determine the most recently accessed parameter. This means that the function only works as expected if the self has been initialised by a call to cpl_parameterlist_get_first(), and if no function updating the internal cache was called between two subsequent calls to this function.

References cpl_error_set_where, cpl_errorstate_get(), cpl_errorstate_is_equal(), and cpl_parameterlist_get_next_const().

const cpl_parameter* cpl_parameterlist_get_next_const ( const cpl_parameterlist self)

Get the next parameter in the given list.

Parameters
selfA parameter list.
Returns
The function returns a handle for the next parameter in the list, or NULL if there are no more parameters in the list. If an error occurs the function returns NULL and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns the next parameter in the parameter list self if it exists and NULL otherwise. The function uses the last cached search position to determine the most recently accessed parameter. This means that the function only works as expected if the self has been initialised by a call to cpl_parameterlist_get_first_const(), and if no function updating the internal cache was called between two subsequent calls to this function.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header(), and cpl_parameterlist_get_next().

cpl_size cpl_parameterlist_get_size ( const cpl_parameterlist self)

Get the current size of a parameter list.

Parameters
selfA parameter list
Returns
The parameter list's current size, or 0 if the list is empty. If an error occurs the function returns 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function reports the current number of elements stored in the parameter list self.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_parameterlist* cpl_parameterlist_new ( void  )

Create a new parameter list.

Returns
A pointer to the newly created parameter list.

The function creates a new parameter list object. The created object must be destroyed using the parameter list destructor cpl_parameterlist_delete().

cpl-6.6.1/html/group__cpl__pluginlist.html0000644000460300003120000007435712553662432015640 00000000000000 Common Pipeline Library Reference Manual: Plugin List
Common Pipeline Library Reference Manual  6.6.1
Plugin List

Typedefs

typedef struct _cpl_pluginlist_ cpl_pluginlist
 The opaque plugin list data type. More...
 

Functions

cpl_error_code cpl_pluginlist_append (cpl_pluginlist *self, const cpl_plugin *plugin)
 Append a plugin to a plugin list. More...
 
void cpl_pluginlist_delete (cpl_pluginlist *self)
 Delete a plugin list. More...
 
void cpl_pluginlist_dump (const cpl_pluginlist *self, FILE *stream)
 Dump the contents of a plugin list to the given stream. More...
 
cpl_plugincpl_pluginlist_find (cpl_pluginlist *self, const char *name)
 Find a plugin with a given name in a plugin list. More...
 
cpl_plugincpl_pluginlist_get_first (cpl_pluginlist *self)
 Get the first plugin of a plugin list. More...
 
cpl_plugincpl_pluginlist_get_last (cpl_pluginlist *self)
 Get the last plugin of a plugin list. More...
 
cpl_plugincpl_pluginlist_get_next (cpl_pluginlist *self)
 Get the next plugin from a plugin list. More...
 
int cpl_pluginlist_get_size (cpl_pluginlist *self)
 Get the current size of a plugin list. More...
 
cpl_pluginlistcpl_pluginlist_new (void)
 Creates an empty plugin list. More...
 
cpl_error_code cpl_pluginlist_prepend (cpl_pluginlist *self, const cpl_plugin *plugin)
 Prepend a plugin to a plugin list. More...
 

Detailed Description

This module implements a list container for plugin objects and provides the facilities to query, to traverse and to update the container. The purpose of this container is to be able to store references to available plugins and to handle sets of plugins as a whole.

Since the plugin list just stores pointers to cpl_plugin, a plugin list may contain plugins of different kind at the same time, because all context specific plugins inherit the cpl_plugin type (see Plugin Interface).

Synopsis:
#include <cpl_pluginlist.h>

Typedef Documentation

typedef struct _cpl_pluginlist_ cpl_pluginlist

The opaque plugin list data type.

Function Documentation

cpl_error_code cpl_pluginlist_append ( cpl_pluginlist self,
const cpl_plugin plugin 
)

Append a plugin to a plugin list.

Parameters
selfA plugin list.
pluginThe plugin to append.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or plugin is a NULL pointer.

The plugin plugin is inserted into the plugin list self after the last element.

If self does not point to a valid plugin list, or if plugin is not a valid pointer the function returns immediately.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

void cpl_pluginlist_delete ( cpl_pluginlist self)

Delete a plugin list.

Parameters
selfThe plugin list to delete.
Returns
Nothing.

The function deletes the plugin list self and destroys all plugins the list potentially contains. If self is NULL, nothing is done and no error is set.

References cpl_plugin_delete().

void cpl_pluginlist_dump ( const cpl_pluginlist self,
FILE *  stream 
)

Dump the contents of a plugin list to the given stream.

Parameters
selfThe plugin list.
streamThe output stream to use.
Returns
Nothing.

The function dumps the debugging information for each plugin found in the plugin list self to the output stream stream. The debugging information for each individual plugin is dumped using cpl_plugin_dump(). If self is NULL the function does nothing.

See also
cpl_plugin_dump()

References cpl_plugin_dump().

cpl_plugin* cpl_pluginlist_find ( cpl_pluginlist self,
const char *  name 
)

Find a plugin with a given name in a plugin list.

Parameters
selfThe plugin list to query.
nameThe plugin's unique name to look for.
Returns
The first plugin with the given name name, or NULL if it no plugin with this name could be found. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or name is a NULL pointer.

This function searches the plugin list self for a plugin with the unique name name and returns a pointer to the first one found. If no plugin with the given name is found the function returns NULL.

References CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_plugin_get_name().

cpl_plugin* cpl_pluginlist_get_first ( cpl_pluginlist self)

Get the first plugin of a plugin list.

Parameters
selfA plugin list.
Returns
The first plugin stored in the plugin list self, or NULL if the list is empty. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a handle to the first plugin stored in the self.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_plugin* cpl_pluginlist_get_last ( cpl_pluginlist self)

Get the last plugin of a plugin list.

Parameters
selfA plugin list.
Returns
The last plugin stored in the plugin list self, or NULL if the list is empty. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function returns a pointer to the last plugin stored in the plugin list self.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_plugin* cpl_pluginlist_get_next ( cpl_pluginlist self)

Get the next plugin from a plugin list.

Parameters
selfA plugin list.
Returns
The function returns the next plugin in the list, or NULL if the end of the list has been reached. The function returns NULL if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The function was called without initialising the plugin list self by calling cpl_pluginlist_first().

The function returns the next plugin in self. To find the next plugin, the plugin list caches the position of the most recently obtained plugin. This requires a call to cpl_pluginlist_get_first() prior to calling this function in order to properly initialise the internal cache.

If the end of self has been reached the internal cache is reset to the first plugin in the list.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_error_set.

int cpl_pluginlist_get_size ( cpl_pluginlist self)

Get the current size of a plugin list.

Parameters
selfA plugin list.
Returns
The plugin list's current size, or 0 if the list is empty. The function returns 0 if an error occurs and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function reports the current number of plugins stored in the plugin list self. If self does not point to a valid plugin list the function returns 0.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_pluginlist* cpl_pluginlist_new ( void  )

Creates an empty plugin list.

Returns
The newly created plugin list, or NULL if it could not be created.

The function allocates memory for a plugin list object and initialises it to be empty.

cpl_error_code cpl_pluginlist_prepend ( cpl_pluginlist self,
const cpl_plugin plugin 
)

Prepend a plugin to a plugin list.

Parameters
selfA plugin list.
pluginThe plugin to prepend.
Returns
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self or plugin is a NULL pointer.

The plugin plugin is inserted into the plugin list self before the first element.

If self does not point to a valid plugin list, or if plugin is not a valid pointer the function returns immediately.

References CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl-6.6.1/html/group__cpl__frameset__iterator.html0000644000460300003120000010167612553662432017317 00000000000000 Common Pipeline Library Reference Manual: Frame Set Iterators
Common Pipeline Library Reference Manual  6.6.1
Frame Set Iterators

Iterator support for frame sets. More...

Typedefs

typedef struct _cpl_frameset_iterator_ cpl_frameset_iterator
 The frame set iterator data type. More...
 

Functions

cpl_error_code cpl_frameset_iterator_advance (cpl_frameset_iterator *self, int distance)
 Advance an iterator by a number of elements. More...
 
cpl_error_code cpl_frameset_iterator_assign (cpl_frameset_iterator *self, const cpl_frameset_iterator *other)
 Assign a frame set iterator to another. More...
 
void cpl_frameset_iterator_delete (cpl_frameset_iterator *self)
 Destroy a frame set iterator. More...
 
int cpl_frameset_iterator_distance (const cpl_frameset_iterator *self, const cpl_frameset_iterator *other)
 Calculate the distance between two iterators. More...
 
cpl_frameset_iteratorcpl_frameset_iterator_duplicate (const cpl_frameset_iterator *other)
 Create a frame set iterator from an existing frame set iterator. More...
 
cpl_framecpl_frameset_iterator_get (cpl_frameset_iterator *self)
 Get the frame from the frame set at the current position of the iterator. More...
 
const cpl_framecpl_frameset_iterator_get_const (const cpl_frameset_iterator *self)
 Get the frame from the frame set at the current position of the iterator. More...
 
cpl_frameset_iteratorcpl_frameset_iterator_new (const cpl_frameset *parent)
 Create a new frame set iterator. More...
 
void cpl_frameset_iterator_reset (cpl_frameset_iterator *self)
 Reset a frame set iterator to the beginning of a frame set. More...
 

Detailed Description

Iterator support for frame sets.

Frame set iterators allow to access the contents of a frame set sequentially, in an ordered manner. An iterator is created for a particular frame set, and it stays bound to that frame set until it is destroyed. However multiple iterators can be defined for the same frame set.

By default, the order of frames in a frame set is the order in which the individual frames have been inserted. However, a particular sorting order can be defined by sorting the frame set using a custom comparison function for frames.

Frame set iterators are supposed to be short-lived objects, and it is not recommended to use them for keeping, or passing around references to the frame set contents. In particular, changing the contents of the underlying frame set by erasing, or inserting frames may invalidate all existing iterators.

Typedef Documentation

typedef struct _cpl_frameset_iterator_ cpl_frameset_iterator

The frame set iterator data type.

This data type is opaque.

Function Documentation

cpl_error_code cpl_frameset_iterator_advance ( cpl_frameset_iterator self,
int  distance 
)

Advance an iterator by a number of elements.

Parameters
selfThe frame set iterator to reposition.
distanceThe of number of elements by which the iterator is moved.
Returns
The function returns CPL_ERROR_NONE on success, or an appropriate CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ACCESS_OUT_OF_RANGE The given iterator offset would move the iterator beyond the beginning or the end of the frame set.

The functions moves the iterator by distance number of elements, with respect to its current position. The number of elements distance may be negative or positive, and the iterator position will move backward and forward respectively.

It is an error if the given distance would move the iterator either past the one-before-the-beginning position or the one-past-the-end position of the underlying frame set. In this case the iterator is not repositioned and an out of range error is returned.

References CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), cpl_frameset_dump(), cpl_frameset_extract(), cpl_frameset_labelise(), and cpl_imagelist_load_frameset().

cpl_error_code cpl_frameset_iterator_assign ( cpl_frameset_iterator self,
const cpl_frameset_iterator other 
)

Assign a frame set iterator to another.

Parameters
selfThe frame set iterator to assign to.
otherThe frame set iterator to be assigned.
Returns
The function returns CPL_ERROR_NONE on success, or an appropriate CPL error code otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameters self or other is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The parameters self and other are not bound to the same frame set.

The function assigns the iterator other to the iterator self. Only iterators which are bound to the same frame set can be assigned to each other!

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_error_set.

void cpl_frameset_iterator_delete ( cpl_frameset_iterator self)

Destroy a frame set iterator.

Parameters
selfThe frame set to destroy.
Returns
Nothing.

The function destroys the frame set iterator object self. If self is NULL, no operation is performed.

Referenced by cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), cpl_frameset_dump(), cpl_frameset_extract(), cpl_frameset_labelise(), and cpl_imagelist_load_frameset().

int cpl_frameset_iterator_distance ( const cpl_frameset_iterator self,
const cpl_frameset_iterator other 
)

Calculate the distance between two iterators.

Parameters
selfFirst frame set iterator.
otherSecond frame set iterator.
Returns
The function returns the distance between the two input iterators. If an error occurs, the function returns a distance of 0 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self or other is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The two iterators iterators are not bound to the same frame set.
CPL_ERROR_DATA_NOT_FOUND At least one input iterator is invalid.

The function calculates the distance between the iterators self and other.

To properly detect whether this function has failed or not it is recommended to reset the errors before it is called, since the returned value is not a distinctive feature.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_frameset_iterator* cpl_frameset_iterator_duplicate ( const cpl_frameset_iterator other)

Create a frame set iterator from an existing frame set iterator.

Parameters
otherThe frame set iterator to clone.
Returns
A copy of the frame set iterator other on success, or NULL otherwise.
Errors
CPL_ERROR_NULL_INPUT The parameter other is a NULL pointer.

The function creates a copy of the iterator object other. An iterator copy constructed by this function is bound to the same frame set other has been constructed for, and it points to the same frame that other points to.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_frame* cpl_frameset_iterator_get ( cpl_frameset_iterator self)

Get the frame from the frame set at the current position of the iterator.

Parameters
selfThe frame set iterator to dereference.
Returns
The frame stored in the frame set at the position of the iterator, or NULL if an error occurs. The function also returns NULL if the iterator is positioned at the sentinel element (i.e. the one-before-the-beginning or one-past-the-end position).
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function dereferences the iterator self, i.e. it retrieves the frame at the position pointed to by self.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_frameset_labelise().

const cpl_frame* cpl_frameset_iterator_get_const ( const cpl_frameset_iterator self)

Get the frame from the frame set at the current position of the iterator.

Parameters
selfThe frame set iterator to dereference.
Returns
The frame stored in the frame set at the position of the iterator, or NULL if an error occurs.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function dereferences the iterator self, i.e. it retrieves the frame at the position pointed to by self.

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), cpl_frameset_dump(), cpl_frameset_extract(), and cpl_imagelist_load_frameset().

cpl_frameset_iterator* cpl_frameset_iterator_new ( const cpl_frameset parent)

Create a new frame set iterator.

Parameters
parentThe frame set for which the iterator is created.
Returns
The newly allocated frame set iterator object, or NULL if an error occurred.
Errors
CPL_ERROR_NULL_INPUT The parameter parent is a NULL pointer.

The function creates a new iterator object bound to the frame set parent. The iterator is initialized such that it points to the beginning of parent.

The beginning is defined by the current ordering defined for the frame set parent.

See also
cpl_frameset_sort()

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

Referenced by cpl_dfs_setup_product_header(), cpl_dfs_sign_products(), cpl_frameset_dump(), cpl_frameset_extract(), cpl_frameset_labelise(), and cpl_imagelist_load_frameset().

void cpl_frameset_iterator_reset ( cpl_frameset_iterator self)

Reset a frame set iterator to the beginning of a frame set.

Parameters
selfThe iterator to reposition.
Returns
Nothing.

The function moves the frame set iterator self back to the beginning of its underlying frame set. The first frame in the frame set is defined by the established sorting order.

See also
cpl_frameset_sort()

Referenced by cpl_dfs_setup_product_header().

cpl-6.6.1/html/tab_h.png0000644000460300003120000000026112553662426011755 00000000000000‰PNG  IHDR$ÇÇ[xIDATxíÝMÁ@†áž~¥ÜÆÎ’Evˆ¿"!•²‘d*×rGq=Š{¼ßSݧçë­ÓÉHÇ uO^õø[À_‡¢ãXvyËþÒ±=·VCffææ{°öŠó´Rçœ%_õçÿŽ¢ö·°Çrug¶(?gh\i>|sIEND®B`‚cpl-6.6.1/html/modules.html0000644000460300003120000003163012553662441012531 00000000000000 Common Pipeline Library Reference Manual: Modules
Common Pipeline Library Reference Manual  6.6.1
Modules
cpl-6.6.1/html/struct__cpl__recipe__.html0000644000460300003120000001672712553662432015400 00000000000000 Common Pipeline Library Reference Manual: _cpl_recipe_ Struct Reference
Common Pipeline Library Reference Manual  6.6.1
_cpl_recipe_ Struct Reference

The type representation of the recipe plugin interface. More...

Public Attributes

cpl_framesetframes
 Pointer to a frame set, or NULL if no frame set is available. More...
 
cpl_plugin interface
 Generic plugin interface. More...
 
cpl_parameterlistparameters
 Pointer to the recipes parameter list, or NULL if the recipe does not provide/accept any parameters. More...
 

Detailed Description

The type representation of the recipe plugin interface.

Member Data Documentation

cpl_frameset* _cpl_recipe_::frames

Pointer to a frame set, or NULL if no frame set is available.

This member points to the frame set (see Frame Sets) the recipe should process. The frame set to process has to be provided by the application which is going to execute this recipe, i.e. this member has to be set by the application.

The recipe can rely on the availability of the frame set at the time the application executes the recipe by calling cpl_plugin::execute. The recipe is free to ignore a provided frame set if it does not need any input frames.

cpl_plugin _cpl_recipe_::interface

Generic plugin interface.

See the Plugin Interface documentation for a detailed description.

cpl_parameterlist* _cpl_recipe_::parameters

Pointer to the recipes parameter list, or NULL if the recipe does not provide/accept any parameters.

This member points to a cpl_parameterlist, containing all parameters the recipe accepts, or NULL if the recipe does not need any parameters for execution.

An application which wants to execute the recipe may update this list with new parameter values, obtained from the command line for instance.

cpl-6.6.1/html/form_25.png0000644000460300003120000000032612553662441012150 00000000000000‰PNG  IHDR a«¬Õ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïEIDATxí €0¿`1‘ý·5¤Ôâþ Ç ðKã¶½—“—ÎOó‚(%Ü]` |ìodìkЉ| ”Ž„˜³¿FéS[kIEND®B`‚cpl-6.6.1/html/form_13.png0000644000460300003120000000042512553662436012151 00000000000000‰PNG  IHDR#Yi†&0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï„IDATxíÛ ! Dîz[ÝúÿÛ¨±Ø"}(ô180‘Ã$úÿWô!|Q¸ ¸W{€=¼Deml2Ù¼«6¦ÎF¼äBÒ[¬L›{uXÎÊñµïµäb2EyÃqwg´Æ}’ì{යs3©AÎG]'³{yÏfù&€­ÆD€ßõ oê4ùDIEND®B`‚cpl-6.6.1/html/group__cpl__math.html0000644000460300003120000011141512553662431014361 00000000000000 Common Pipeline Library Reference Manual: Fundamental math functionality
Common Pipeline Library Reference Manual  6.6.1
Fundamental math functionality

Macros

#define CPL_MATH_1_PI   0.3183098861837906715377675267450287240689192914809129
 1/pi More...
 
#define CPL_MATH_2_PI   0.6366197723675813430755350534900574481378385829618258
 2/pi More...
 
#define CPL_MATH_2_SQRTPI   1.1283791670955125738961589031215451716881012586579977
 2/sqrt(pi) More...
 
#define CPL_MATH_2PI   6.2831853071795864769252867665590057683943387987502116
 2 pi More...
 
#define CPL_MATH_4_PI   1.2732395447351626861510701069801148962756771659236516
 4/pi More...
 
#define CPL_MATH_DEG_RAD   57.295779513082320876798154814105170332405472466564322
 180/pi More...
 
#define CPL_MATH_E   2.7182818284590452353602874713526624977572470936999595
 The base of the exponential function. More...
 
#define CPL_MATH_FWHM_SIG   2.3548200450309493820231386529193992754947713787716411
 FWHM per Sigma, 2.0*sqrt(2.0*log(2.0)) More...
 
#define CPL_MATH_LN10   2.3025850929940456840179914546843642076011014886287730
 The natural logarithm of 10. More...
 
#define CPL_MATH_LN2   0.6931471805599453094172321214581765680755001343602553
 The natural logarithm of 2. More...
 
#define CPL_MATH_LOG10E   0.4342944819032518276511289189166050822943970058036666
 log10(e) More...
 
#define CPL_MATH_LOG2E   1.4426950408889634073599246810018921374266459541529859
 log2(e) More...
 
#define CPL_MATH_PI   3.1415926535897932384626433832795028841971693993751058
 The ratio of a circles circumference to its diameter. More...
 
#define CPL_MATH_PI_2   1.5707963267948966192313216916397514420985846996875529
 pi/2 More...
 
#define CPL_MATH_PI_4   0.7853981633974483096156608458198757210492923498437765
 pi/4 More...
 
#define CPL_MATH_RAD_DEG   0.0174532925199432957692369076848861271344287188854173
 pi/180 More...
 
#define CPL_MATH_SIG_FWHM   0.4246609001440095213607514170514448098575705468921770
 Sigma per FWHM, 0.5/sqrt(2.0*log(2.0)) More...
 
#define CPL_MATH_SQRT1_2   0.7071067811865475244008443621048490392848359376884740
 sqrt(1/2) More...
 
#define CPL_MATH_SQRT2   1.4142135623730950488016887242096980785696718753769481
 The square root of 2. More...
 
#define CPL_MATH_SQRT2PI   2.5066282746310005024157652848110452530069867406099383
 sqrt(2pi) More...
 
#define CPL_MATH_SQRT3   1.7320508075688772935274463415058723669428052538103806
 The square root of 3. More...
 
#define CPL_MATH_STD_MAD   1.4826
 Standard deviation per Median Absolute Deviation for Gaussian data. More...
 
#define CPL_MAX(first, second)
 Return the maximum of two values. More...
 
#define CPL_MIN(first, second)
 Return the minimum of two values. More...
 

Detailed Description

This module provides fundamental math constants.

Source: On-Line Encyclopedia of Integer Sequences (OEIS)

pi: http://www.research.att.com/~njas/sequences/A000796

e: http://www.research.att.com/~njas/sequences/A001113

ln(2): http://www.research.att.com/~njas/sequences/A002162

ln(10): http://www.research.att.com/~njas/sequences/A002392

sqrt(2): http://www.research.att.com/~njas/sequences/A002193

sqrt(3): http://www.research.att.com/~njas/sequences/A002194

The derived constants have been computed with the GNU Multiple-Precision Library v. 4.2.2.

The constants are listed with a precision that allows a one-line definition.

Synopsis:
#include <cpl_math_const.h>

Macro Definition Documentation

#define CPL_MATH_1_PI   0.3183098861837906715377675267450287240689192914809129

1/pi

See also
CPL_MATH_PI
Note
Derived from a fundamental constant
#define CPL_MATH_2_PI   0.6366197723675813430755350534900574481378385829618258

2/pi

See also
CPL_MATH_PI
Note
Derived from a fundamental constant
#define CPL_MATH_2_SQRTPI   1.1283791670955125738961589031215451716881012586579977

2/sqrt(pi)

See also
CPL_MATH_PI
Note
Derived from a fundamental constant
#define CPL_MATH_2PI   6.2831853071795864769252867665590057683943387987502116

2 pi

See also
CPL_MATH_PI
Note
Derived from a fundamental constant

Referenced by cpl_fit_image_gaussian(), cpl_gaussian_eval_2d(), cpl_image_fit_gaussian(), and cpl_photom_fill_blackbody().

#define CPL_MATH_4_PI   1.2732395447351626861510701069801148962756771659236516

4/pi

See also
CPL_MATH_PI
Note
Derived from a fundamental constant
#define CPL_MATH_DEG_RAD   57.295779513082320876798154814105170332405472466564322

180/pi

See also
CPL_MATH_PI
Note
Derived from a fundamental constant

Referenced by cpl_ppm_match_points().

#define CPL_MATH_E   2.7182818284590452353602874713526624977572470936999595

The base of the exponential function.

See also
On-Line Encyclopedia of Integer Sequences (OEIS), http://www.research.att.com/~njas/sequences/A001113
#define CPL_MATH_FWHM_SIG   2.3548200450309493820231386529193992754947713787716411

FWHM per Sigma, 2.0*sqrt(2.0*log(2.0))

See also
CPL_MATH_LN2
Note
Derived from a fundamental constant

Referenced by cpl_image_fit_gaussian().

#define CPL_MATH_LN10   2.3025850929940456840179914546843642076011014886287730

The natural logarithm of 10.

See also
On-Line Encyclopedia of Integer Sequences (OEIS), http://www.research.att.com/~njas/sequences/A002392
#define CPL_MATH_LN2   0.6931471805599453094172321214581765680755001343602553

The natural logarithm of 2.

See also
On-Line Encyclopedia of Integer Sequences (OEIS), http://www.research.att.com/~njas/sequences/A002162
#define CPL_MATH_LOG10E   0.4342944819032518276511289189166050822943970058036666

log10(e)

See also
CPL_MATH_LN10
Note
Derived from a fundamental constant
#define CPL_MATH_LOG2E   1.4426950408889634073599246810018921374266459541529859

log2(e)

See also
CPL_MATH_LN2
Note
Derived from a fundamental constant
#define CPL_MATH_PI   3.1415926535897932384626433832795028841971693993751058

The ratio of a circles circumference to its diameter.

See also
On-Line Encyclopedia of Integer Sequences (OEIS), http://www.research.att.com/~njas/sequences/A000796

Referenced by cpl_photom_fill_blackbody().

#define CPL_MATH_PI_2   1.5707963267948966192313216916397514420985846996875529

pi/2

See also
CPL_MATH_PI
Note
Derived from a fundamental constant

Referenced by cpl_fit_image_gaussian().

#define CPL_MATH_PI_4   0.7853981633974483096156608458198757210492923498437765

pi/4

See also
CPL_MATH_PI
Note
Derived from a fundamental constant
#define CPL_MATH_RAD_DEG   0.0174532925199432957692369076848861271344287188854173

pi/180

See also
CPL_MATH_PI
Note
Derived from a fundamental constant
#define CPL_MATH_SIG_FWHM   0.4246609001440095213607514170514448098575705468921770

Sigma per FWHM, 0.5/sqrt(2.0*log(2.0))

See also
CPL_MATH_LN2
Note
Derived from a fundamental constant

Referenced by cpl_vector_new_lss_kernel().

#define CPL_MATH_SQRT1_2   0.7071067811865475244008443621048490392848359376884740

sqrt(1/2)

See also
CPL_MATH_SQRT2
Note
Derived from a fundamental constant
#define CPL_MATH_SQRT2   1.4142135623730950488016887242096980785696718753769481

The square root of 2.

See also
On-Line Encyclopedia of Integer Sequences (OEIS), http://www.research.att.com/~njas/sequences/A002193
#define CPL_MATH_SQRT2PI   2.5066282746310005024157652848110452530069867406099383

sqrt(2pi)

See also
CPL_MATH_PI
Note
Derived from a fundamental constant

Referenced by cpl_vector_fit_gaussian().

#define CPL_MATH_SQRT3   1.7320508075688772935274463415058723669428052538103806

The square root of 3.

See also
On-Line Encyclopedia of Integer Sequences (OEIS), http://www.research.att.com/~njas/sequences/A002194
#define CPL_MATH_STD_MAD   1.4826

Standard deviation per Median Absolute Deviation for Gaussian data.

See also
cpl_image_get_mad_window()

For a Gaussian distribution the Median Absolute Deviation (MAD) is a robust and consistent estimate of the Standard Deviation (STD) in the sense that the STD is approximately K * MAD, where K is a constant equal to approximately 1.4826.

#define CPL_MAX (   first,
  second 
)

Return the maximum of two values.

Parameters
firstThe first expression in the comparison
secondThe second expression in the comparison
Returns
The maximum of the two values
See also
CPL_MIN()
#define CPL_MIN (   first,
  second 
)

Return the minimum of two values.

Parameters
firstThe first expression in the comparison
secondThe second expression in the comparison
Returns
The minimum of the two values
Note
If the first argument is the smallest then it is evaluated twice otherwise the second argument is evaluated twice
cpl-6.6.1/html/group__cpl__memory.html0000644000460300003120000012646212553662431014750 00000000000000 Common Pipeline Library Reference Manual: Memory Management Utilities
Common Pipeline Library Reference Manual  6.6.1
Memory Management Utilities

Functions

void * cpl_calloc (size_t natoms, size_t nbytes)
 Allocate memory for natoms elements of size size. More...
 
void cpl_free (void *memblk)
 Memory block deallocation. More...
 
void * cpl_malloc (size_t nbytes)
 Allocate nbytes bytes. More...
 
void cpl_memory_dump (void)
 Display the memory status. More...
 
int cpl_memory_is_empty (void)
 Tell if there is some memory allocated. More...
 
void * cpl_realloc (void *memblk, size_t nbytes)
 Change the size of a memory block. More...
 
char * cpl_sprintf (const char *format,...)
 Create a string and fill it in an sprintf()-like manner. More...
 
char * cpl_strdup (const char *string)
 Duplicate a string. More...
 
char * cpl_vsprintf (const char *format, va_list arglist)
 Create a string and fill it in an vsprintf()-like manner. More...
 

Detailed Description

This module provides the CPL memory management utilities.

Function Documentation

void* cpl_calloc ( size_t  natoms,
size_t  nbytes 
)

Allocate memory for natoms elements of size size.

Parameters
natomsNumber of atomic elements.
nbytesElement size in bytes.
Returns
Pointer to the allocated memory block.

The function allocates memory suitable for storage of natoms elements of size nbytes bytes. The allocated memory is cleared, i.e. the value 0 is written to each single byte.

Note
If the memory subsytem has not been initialised before calling this function, the program execution is stopped printing a message to the error channel showing the current code position.

Referenced by cpl_apertures_new_from_image(), cpl_apertures_sort_by_flux(), cpl_apertures_sort_by_max(), cpl_apertures_sort_by_npix(), cpl_array_cast(), cpl_array_dump(), cpl_array_new(), cpl_array_wrap_cplsize(), cpl_array_wrap_double(), cpl_array_wrap_double_complex(), cpl_array_wrap_float(), cpl_array_wrap_float_complex(), cpl_array_wrap_int(), cpl_array_wrap_long(), cpl_array_wrap_long_long(), cpl_array_wrap_string(), cpl_image_fft(), cpl_imagelist_new(), cpl_mask_new(), cpl_matrix_new(), cpl_matrix_product_create(), cpl_matrix_sort_columns(), cpl_matrix_sort_rows(), cpl_polynomial_compare(), cpl_polynomial_new(), cpl_ppm_match_positions(), cpl_table_and_selected_window(), cpl_table_dump(), cpl_table_new(), cpl_table_or_selected_window(), cpl_table_select_row(), cpl_wcs_platesol(), and cpl_wlcalib_slitmodel_new().

void cpl_free ( void *  memblk)

Memory block deallocation.

Returns
Nothing.

Deallocates a memory block previously allocated by any of the CPL allocator functions.

See also
cpl_malloc(), cpl_calloc()

Referenced by cpl_apertures_delete(), cpl_apertures_new_from_image(), cpl_apertures_sort_by_flux(), cpl_apertures_sort_by_max(), cpl_apertures_sort_by_npix(), cpl_array_cast(), cpl_array_delete(), cpl_array_dump(), cpl_array_unwrap(), cpl_bivector_delete(), cpl_bivector_sort(), cpl_bivector_unwrap_vectors(), cpl_dfs_setup_product_header(), cpl_image_delete(), cpl_image_divide_create(), cpl_image_fft(), cpl_image_get_interpolated(), cpl_image_labelise_mask_create(), cpl_image_unwrap(), cpl_image_warp(), cpl_image_warp_polynomial(), cpl_imagelist_cast(), cpl_imagelist_unwrap(), cpl_init(), cpl_mask_delete(), cpl_mask_save(), cpl_mask_unwrap(), cpl_matrix_delete(), cpl_matrix_get_median(), cpl_matrix_resize(), cpl_matrix_shift(), cpl_matrix_sort_columns(), cpl_matrix_sort_rows(), cpl_matrix_unwrap(), cpl_msg_progress(), cpl_plot_bivector(), cpl_plot_bivectors(), cpl_plot_columns(), cpl_plot_image(), cpl_plot_image_col(), cpl_plot_image_row(), cpl_plot_mask(), cpl_plot_vector(), cpl_plot_vectors(), cpl_polynomial_compare(), cpl_polynomial_copy(), cpl_polynomial_delete(), cpl_polynomial_extract(), cpl_polynomial_set_coeff(), cpl_ppm_match_positions(), cpl_propertylist_save(), cpl_stats_delete(), cpl_table_and_selected_window(), cpl_table_delete(), cpl_table_dump(), cpl_table_or_selected_window(), cpl_table_select_all(), cpl_table_select_row(), cpl_table_sort(), cpl_table_unselect_all(), cpl_table_unselect_row(), cpl_test_end(), cpl_vector_delete(), cpl_vector_filter_median_create(), cpl_vector_fit_gaussian(), cpl_vector_get_median_const(), cpl_vector_load(), cpl_vector_save(), cpl_vector_unwrap(), cpl_wcs_delete(), cpl_wcs_new_from_propertylist(), cpl_wcs_platesol(), and cpl_wlcalib_slitmodel_delete().

void* cpl_malloc ( size_t  nbytes)

Allocate nbytes bytes.

Parameters
nbytesNumber of bytes.
Returns
Pointer to the allocated memory block.

The function allocates nbytes bytes of memory. The allocated memory is not cleared.

Note
If the memory subsytem has not been initialised before calling this function, the program execution is stopped printing a message to the error channel showing the current code position.

Referenced by cpl_apertures_new_from_image(), cpl_apertures_sort_by_flux(), cpl_apertures_sort_by_max(), cpl_apertures_sort_by_npix(), cpl_array_dump(), cpl_bivector_duplicate(), cpl_bivector_new(), cpl_bivector_sort(), cpl_bivector_wrap_vectors(), cpl_fit_imagelist_polynomial_window(), cpl_geom_img_offset_saa(), cpl_image_cast(), cpl_image_divide_create(), cpl_image_duplicate(), cpl_image_get_interpolated(), cpl_image_labelise_mask_create(), cpl_image_new_from_mask(), cpl_image_or_mask(), cpl_image_warp(), cpl_image_warp_polynomial(), cpl_imagelist_cast(), cpl_mask_collapse_create(), cpl_mask_duplicate(), cpl_mask_extract(), cpl_mask_wrap(), cpl_matrix_duplicate(), cpl_matrix_extract(), cpl_matrix_extract_diagonal(), cpl_matrix_get_determinant(), cpl_matrix_get_median(), cpl_matrix_invert_create(), cpl_matrix_new(), cpl_matrix_shift(), cpl_matrix_solve(), cpl_matrix_sort_columns(), cpl_matrix_sort_rows(), cpl_matrix_transpose_create(), cpl_matrix_wrap(), cpl_msg_progress(), cpl_plot_bivectors(), cpl_plot_columns(), cpl_plot_image(), cpl_plot_mask(), cpl_plot_vectors(), cpl_polynomial_copy(), cpl_polynomial_duplicate(), cpl_polynomial_extract(), cpl_polynomial_set_coeff(), cpl_ppm_match_positions(), cpl_stats_new_from_image_window(), cpl_table_dump(), cpl_table_duplicate(), cpl_table_sort(), cpl_table_unselect_row(), cpl_vector_filter_median_create(), cpl_vector_fit_gaussian(), cpl_vector_get_median_const(), cpl_vector_load(), cpl_vector_new(), and cpl_wcs_platesol().

void cpl_memory_dump ( void  )

Display the memory status.

Referenced by cpl_test_end().

int cpl_memory_is_empty ( void  )

Tell if there is some memory allocated.

Returns
-1 if the model is off, 1 if it is empty, 0 otherwise

Referenced by cpl_test_end().

void* cpl_realloc ( void *  memblk,
size_t  nbytes 
)

Change the size of a memory block.

Parameters
memblkPointer to the memory to re-allocate.
nbytesNew memory block size in bytes.
Returns
Pointer to the allocated memory block.

The function changes the size of an already allocated memory block memblk to the new size nbytes bytes. The contents is unchanged to the minimum of old and new size; newly allocated memory is not initialized. If memblk is NULL the call to cpl_realloc() is equivalent to cpl_malloc(), and if nbytes is 0 the call is equivalent to cpl_free(). Unless memblk is NULL, it must have been returned by a previous call to cpl_malloc(), cpl_calloc(), or cpl_realloc().

Note
  • The returned memory block returned on successfull allocation may not be the same as the one pointed to by memblk. Existing references pointing to locations within the original memory block might be invalidated!
  • If the memory subsytem has not been initialised before calling this function, the program execution is stopped printing a message to the error channel showing the current code position.
See also
cpl_malloc(), cpl_calloc()

Referenced by cpl_imagelist_set(), cpl_matrix_erase_columns(), cpl_matrix_erase_rows(), cpl_polynomial_copy(), cpl_polynomial_derivative(), cpl_polynomial_set_coeff(), and cpl_vector_set_size().

char* cpl_sprintf ( const char *  format,
  ... 
)

Create a string and fill it in an sprintf()-like manner.

Parameters
formatThe format string
...Variable argument list for format
Returns
The created string or NULL on error
Note
The created string must be deallocated with cpl_free()
See also
cpl_vsprintf()

The allocated memory is exactly what is needed to hold the string.

Errors
CPL_ERROR_NULL_INPUT The format string is NULL.
CPL_ERROR_ILLEGAL_INPUT The format string has an invalid format.

Example of usage:

1 int error;
2 
3 char * cp_cmd = cpl_sprintf("cp %s %s/%s", long_file, new_dir,
4  new_file);
5 assert( cp_cmd != NULL);
6 
7 error = system(cp_cmd);
8 
9 assert(!error);
10 
11 cpl_free(cp_cmd);

References cpl_ensure, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, and cpl_vsprintf().

Referenced by cpl_array_dump(), cpl_dfs_setup_product_header(), cpl_init(), cpl_mask_save(), cpl_plot_bivector(), cpl_plot_bivectors(), cpl_plot_columns(), cpl_plot_image(), cpl_plot_image_col(), cpl_plot_image_row(), cpl_plot_mask(), cpl_plot_vector(), cpl_plot_vectors(), cpl_plugin_get_version_string(), cpl_propertylist_save(), cpl_table_dump(), cpl_vector_save(), and cpl_wcs_new_from_propertylist().

char* cpl_strdup ( const char *  string)

Duplicate a string.

Parameters
stringString to be duplicated.
Returns
Newly allocated copy of the original string.

Duplicates the input string string. The newly allocated copy returned to the caller can be deallocated using cpl_free().

See also
cpl_free()

Referenced by cpl_dfs_setup_product_header(), and cpl_init().

char* cpl_vsprintf ( const char *  format,
va_list  arglist 
)

Create a string and fill it in an vsprintf()-like manner.

Parameters
formatThe format string
arglistThe argument list for the format
Returns
The created string or NULL on error
Note
The created string must be deallocated with cpl_free()
See also
vsprintf()

The allocated memory is exactly what is needed to hold the string.

Errors
CPL_ERROR_NULL_INPUT The format string is NULL.
CPL_ERROR_ILLEGAL_INPUT The format string has an invalid format.

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_sprintf().

cpl-6.6.1/html/group__cpl__wlcalib.html0000644000460300003120000013576512553662432015064 00000000000000 Common Pipeline Library Reference Manual: Wavelength calibration
Common Pipeline Library Reference Manual  6.6.1
Wavelength calibration

Functions

cpl_error_code cpl_wlcalib_fill_line_spectrum (cpl_vector *self, void *model, const cpl_polynomial *disp)
 Generate a 1D spectrum from a model and a dispersion relation. More...
 
cpl_error_code cpl_wlcalib_fill_line_spectrum_fast (cpl_vector *self, void *model, const cpl_polynomial *disp)
 Generate a 1D spectrum from a model and a dispersion relation. More...
 
cpl_error_code cpl_wlcalib_fill_logline_spectrum (cpl_vector *self, void *model, const cpl_polynomial *disp)
 Generate a 1D spectrum from a model and a dispersion relation. More...
 
cpl_error_code cpl_wlcalib_fill_logline_spectrum_fast (cpl_vector *self, void *model, const cpl_polynomial *disp)
 Generate a 1D spectrum from a model and a dispersion relation. More...
 
cpl_error_code cpl_wlcalib_find_best_1d (cpl_polynomial *self, const cpl_polynomial *guess, const cpl_vector *spectrum, void *model, cpl_error_code(*filler)(cpl_vector *, void *, const cpl_polynomial *), const cpl_vector *wl_search, cpl_size nsamples, cpl_size hsize, double *xcmax, cpl_vector *xcorrs)
 Find the best 1D dispersion polynomial in a given search space. More...
 
void cpl_wlcalib_slitmodel_delete (cpl_wlcalib_slitmodel *self)
 Free memory associated with a cpl_wlcalib_slitmodel object. More...
 
cpl_wlcalib_slitmodel * cpl_wlcalib_slitmodel_new (void)
 Create a new line model to be initialized. More...
 
cpl_error_code cpl_wlcalib_slitmodel_set_catalog (cpl_wlcalib_slitmodel *self, cpl_bivector *catalog)
 Set the catalog of lines to be used by the spectrum filler. More...
 
cpl_error_code cpl_wlcalib_slitmodel_set_threshold (cpl_wlcalib_slitmodel *self, double value)
 The (positive) threshold for truncating the transfer function. More...
 
cpl_error_code cpl_wlcalib_slitmodel_set_wfwhm (cpl_wlcalib_slitmodel *self, double value)
 Set the FWHM of the transfer function to be used by the spectrum filler. More...
 
cpl_error_code cpl_wlcalib_slitmodel_set_wslit (cpl_wlcalib_slitmodel *self, double value)
 Set the slit width to be used by the spectrum filler. More...
 

Detailed Description

This module contains functions to perform 1D-wavelength calibration, typically of long-slit spectroscopy data.

Synopsis:
#include "cpl_wlcalib.h"

Function Documentation

cpl_error_code cpl_wlcalib_fill_line_spectrum ( cpl_vector *  self,
void *  model,
const cpl_polynomial *  disp 
)

Generate a 1D spectrum from a model and a dispersion relation.

Parameters
selfVector to fill with spectrum
modelPointer to cpl_wlcalib_slitmodel object
disp1D-Dispersion relation, at least of degree 1
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
Note
The model is passed as a void pointer so the function can be used with cpl_wlcalib_find_best_1d().
See also
cpl_wlcalib_find_best_1d()

The fill a vector with a spectrum, one must first initialize the parameters of the model (error checks omitted for brevity):

1 cpl_vector * spectrum = cpl_vector_new(nresolution);
2 cpl_wlcalib_slitmodel * model = cpl_wlcalib_slitmodel_new();
3 cpl_bivector * lines = my_load_lines_catalog(filename);
4 cpl_polynomial * dispersion = my_1d_dispersion();
5 
6 cpl_wlcalib_slitmodel_set_wslit(model, 3.0);
7 cpl_wlcalib_slitmodel_set_wfwhm(model, 4.0);
8 cpl_wlcalib_slitmodel_set_threshold(model, 5.0);
9 cpl_wlcalib_slitmodel_set_catalog(model, lines);

With that the spectrum can be filled:

1 cpl_wlcalib_fill_line_spectrum(spectrum, model, dispersion);

Clean-up when no more spectra are needed (lines are deleted with the model):

1 cpl_wlcalib_slitmodel_delete(model);
2 cpl_polynomial_delete(dispersion);
3 cpl_vector_delete(spectrum);

Each line profile is given by the convolution of the Dirac delta function with a Gaussian with $\sigma = w_{FWHM}/(2\sqrt(2\log(2))),$ and a top-hat with the slit width as width. This continuous line profile is then integrated over each pixel, wherever the intensity is above the threshold set by the given model. For a given line the value on a given pixel requires the evaluation of two calls to erf().

Possible _cpl_error_code_ set by this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE If the input polynomial is not 1D
  • CPL_ERROR_ILLEGAL_INPUT If the input polynomial is non-increasing over the given input (pixel) range, or if a model parameter is non-physical (e.g. non-positive slit width).
  • CPL_ERROR_DATA_NOT_FOUND If no catalog lines are available in the range of the dispersion relation
  • CPL_ERROR_INCOMPATIBLE_INPUT If the wavelengths of two catalog lines are found to be in non-increasing order.

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_wlcalib_fill_line_spectrum_fast ( cpl_vector *  self,
void *  model,
const cpl_polynomial *  disp 
)

Generate a 1D spectrum from a model and a dispersion relation.

Parameters
selfVector to fill with spectrum
modelPointer to cpl_wlcalib_slitmodel object
disp1D-Dispersion relation, at least of degree 1
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
Note
The generated spectrum will use an approximate line profile for speed
See also
cpl_wlcalib_fill_line_spectrum()

The approximation preserves the position of the maximum, the symmetry and the flux of the line profile.

The use of a given line in a spectrum requires the evaluation of four calls to erf().

The fast spectrum generation can be useful when the model spectrum includes many catalog lines.

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_wlcalib_fill_logline_spectrum ( cpl_vector *  self,
void *  model,
const cpl_polynomial *  disp 
)

Generate a 1D spectrum from a model and a dispersion relation.

Parameters
selfVector to fill with spectrum
modelPointer to cpl_wlcalib_slitmodel object
disp1D-Dispersion relation, at least of degree 1
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
Note
The spectrum is generated from 1 + the logarithm of the line intensities
See also
cpl_wlcalib_fill_line_spectrum()

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_wlcalib_fill_logline_spectrum_fast ( cpl_vector *  self,
void *  model,
const cpl_polynomial *  disp 
)

Generate a 1D spectrum from a model and a dispersion relation.

Parameters
selfVector to fill with spectrum
modelPointer to cpl_wlcalib_slitmodel object
disp1D-Dispersion relation, at least of degree 1
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
Note
The spectrum is generated from 1 + the logarithm of the line intensities and an approximate line profile for speed
See also
cpl_wlcalib_fill_line_spectrum_fast()

References cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_wlcalib_find_best_1d ( cpl_polynomial *  self,
const cpl_polynomial *  guess,
const cpl_vector *  spectrum,
void *  model,
cpl_error_code(*)(cpl_vector *, void *, const cpl_polynomial *)  filler,
const cpl_vector *  wl_search,
cpl_size  nsamples,
cpl_size  hsize,
double *  xcmax,
cpl_vector *  xcorrs 
)

Find the best 1D dispersion polynomial in a given search space.

Parameters
selfPre-created 1D-polynomial for the result
guess1D-polynomial with the guess, may equal self
spectrumThe vector with the observed 1D-spectrum
modelThe spectrum model
fillerThe function used to make the spectrum
wl_searchSearch range around the anchor points, same unit as guess
nsamplesNumber of samples around the anchor points
hsizeMaximum (pixel) displacement of the polynomial guess
xcmaxOn success, the maximum cross-correlation
xcorrsThe vector to fill with the correlation values or NULL
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_wlcalib_fill_line_spectrum() for the model and filler.

Find the polynomial that maximizes the cross-correlation between an observed 1D-spectrum and a model spectrum based on the polynomial dispersion relation.

The wavelength search range is in the same units as the Y-values of the dispersion relation.

For each candidate polynomial P(x), the polynomial P(x+u), -hsize <= u <= hsize is also evaluated. The half-size hsize may be zero. When it is non-zero, an additional 2 * hsize cross-correlations are performed for each candidate polynomial, one for each possible shift. The maximizing polynomial among those shifted polynomials is kept. A well-chosen half-size can allow for the use of fewer number of samples around the anchor points, leading to a reduction of polynomials to be evaluated.

The complexity in terms of model spectra creation is O(N^D) and in terms of cross-correlations O(hsize * N^D), where N is nsamples and D is the length of wl_error.

xcorrs must be NULL or have a size of (at least) N^D*(1 + 2 * hsize).

Possible _cpl_error_code_ set by this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE If an input polynomial is not 1D
  • CPL_ERROR_ILLEGAL_INPUT If nfree is less than 2, or nsamples is less than 1, hsize negative or if wl_search contains a zero search bound, or if xcorrs is non-NULL and too short.
  • CPL_ERROR_DATA_NOT_FOUND If no model spectra can be created using the supplied model and filler

References cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_dump(), cpl_errorstate_dump_one_debug(), cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_errorstate_set(), cpl_polynomial_copy(), cpl_polynomial_delete(), cpl_polynomial_eval_1d(), cpl_polynomial_get_degree(), cpl_polynomial_get_dimension(), cpl_polynomial_new(), cpl_polynomial_shift_1d(), cpl_vector_delete(), cpl_vector_fill(), cpl_vector_get(), cpl_vector_get_data(), cpl_vector_get_data_const(), cpl_vector_get_size(), cpl_vector_new(), cpl_vector_set(), cpl_vector_unwrap(), and cpl_vector_wrap().

void cpl_wlcalib_slitmodel_delete ( cpl_wlcalib_slitmodel *  self)

Free memory associated with a cpl_wlcalib_slitmodel object.

Parameters
selfThe cpl_wlcalib_slitmodel object or NULL
Returns
Nothing
See also
cpl_wlcalib_slitmodel_new()
Note
If self is NULL nothing is done and no error is set.

References cpl_bivector_delete(), cpl_free(), and cpl_vector_delete().

cpl_wlcalib_slitmodel* cpl_wlcalib_slitmodel_new ( void  )

Create a new line model to be initialized.

Returns
1 newly allocated cpl_wlcalib_slitmodel
Note
All elements are initialized to either zero or NULL.
See also
cpl_wlcalib_slitmodel_delete() for object deallocation.

The model comprises these elements: Slit Width FWHM of transfer function Truncation threshold of the transfer function Catalog of lines (typically arc or sky)

The units of the X-values of the lines is a length, it is assumed to be the same as that of the Y-values of the dispersion relation (e.g. meter), the units of slit width and the FWHM are assumed to be the same as the X-values of the dispersion relation (e.g. pixel), while the units of the produced spectrum will be that of the Y-values of the lines.

References cpl_calloc().

cpl_error_code cpl_wlcalib_slitmodel_set_catalog ( cpl_wlcalib_slitmodel *  self,
cpl_bivector *  catalog 
)

Set the catalog of lines to be used by the spectrum filler.

Parameters
selfThe cpl_wlcalib_slitmodel object
catalogThe catalog of lines (e.g. arc lines)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_wlcalib_slitmodel_new()
Note
The values in the X-vector must be increasing. Any previously set catalog is deallocated

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_bivector_delete(), cpl_ensure_code, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_wlcalib_slitmodel_set_threshold ( cpl_wlcalib_slitmodel *  self,
double  value 
)

The (positive) threshold for truncating the transfer function.

Parameters
selfThe cpl_wlcalib_slitmodel object
valueThe (non-negative) truncation threshold, 5 is a good value.
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_wlcalib_slitmodel_new()
Note
The threshold should be high enough to ensure a good line profile, but not too high to make the spectrum generation too costly.

The line profile is truncated at this distance [pixel] from its maximum: $x_{max} = w/2 + k * \sigma,$ where $w$ is the slit width and $\sigma = w_{FWHM}/(2\sqrt(2\log(2))),$ where $w_{FWHM}$ is the Full Width at Half Maximum (FWHM) of the transfer function and $k$ is the user supplied value.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT the value is negative

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_wlcalib_slitmodel_set_wfwhm ( cpl_wlcalib_slitmodel *  self,
double  value 
)

Set the FWHM of the transfer function to be used by the spectrum filler.

Parameters
selfThe cpl_wlcalib_slitmodel object
valueThe (positive) FWHM
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_wlcalib_slitmodel_new()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT the value is non-positive

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl_error_code cpl_wlcalib_slitmodel_set_wslit ( cpl_wlcalib_slitmodel *  self,
double  value 
)

Set the slit width to be used by the spectrum filler.

Parameters
selfThe cpl_wlcalib_slitmodel object
valueThe (positive) width of the slit
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_wlcalib_slitmodel_new()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT the value is non-positive

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

cpl-6.6.1/html/group__cpl__bivector.html0000644000460300003120000016634512553662431015261 00000000000000 Common Pipeline Library Reference Manual: Bi-vector object
Common Pipeline Library Reference Manual  6.6.1
Bi-vector object

Functions

cpl_error_code cpl_bivector_copy (cpl_bivector *self, const cpl_bivector *other)
 Copy contents of a bivector into another bivector. More...
 
void cpl_bivector_delete (cpl_bivector *f)
 Delete a cpl_bivector. More...
 
void cpl_bivector_dump (const cpl_bivector *f, FILE *stream)
 Dump a cpl_bivector as ASCII to a stream. More...
 
cpl_bivector * cpl_bivector_duplicate (const cpl_bivector *in)
 Duplicate a cpl_bivector. More...
 
cpl_size cpl_bivector_get_size (const cpl_bivector *in)
 Get the size of the cpl_bivector. More...
 
cpl_vector * cpl_bivector_get_x (cpl_bivector *in)
 Get a pointer to the x vector of the cpl_bivector. More...
 
const cpl_vector * cpl_bivector_get_x_const (const cpl_bivector *in)
 Get a pointer to the x vector of the cpl_bivector. More...
 
double * cpl_bivector_get_x_data (cpl_bivector *in)
 Get a pointer to the x data part of the cpl_bivector. More...
 
const double * cpl_bivector_get_x_data_const (const cpl_bivector *in)
 Get a pointer to the x data part of the cpl_bivector. More...
 
cpl_vector * cpl_bivector_get_y (cpl_bivector *in)
 Get a pointer to the y vector of the cpl_bivector. More...
 
const cpl_vector * cpl_bivector_get_y_const (const cpl_bivector *in)
 Get a pointer to the y vector of the cpl_bivector. More...
 
double * cpl_bivector_get_y_data (cpl_bivector *in)
 Get a pointer to the y data part of the cpl_bivector. More...
 
const double * cpl_bivector_get_y_data_const (const cpl_bivector *in)
 Get a pointer to the y data part of the cpl_bivector. More...
 
cpl_error_code cpl_bivector_interpolate_linear (cpl_bivector *fout, const cpl_bivector *fref)
 Linear interpolation of a 1d-function. More...
 
cpl_bivector * cpl_bivector_new (cpl_size n)
 Create a new cpl_bivector. More...
 
cpl_bivector * cpl_bivector_read (const char *filename)
 Read a list of values from an ASCII file and create a cpl_bivector. More...
 
cpl_error_code cpl_bivector_sort (cpl_bivector *self, const cpl_bivector *other, cpl_sort_direction dir, cpl_sort_mode mode)
 Sort a cpl_bivector. More...
 
void cpl_bivector_unwrap_vectors (cpl_bivector *f)
 Free memory associated to a cpl_bivector, excluding the two vectors. More...
 
cpl_bivector * cpl_bivector_wrap_vectors (cpl_vector *x, cpl_vector *y)
 Create a new cpl_bivector from two cpl_vectors. More...
 

Detailed Description

This module provides functions to handle cpl_bivector.

A cpl_bivector is composed of two vectors of the same size. It can be used to store 1d functions, with the x and y positions of the samples, offsets in x and y or simply positions in an image.

This module provides among other things functions for interpolation and for sorting one vector according to another.

Synopsis:
#include "cpl_bivector.h"

Function Documentation

cpl_error_code cpl_bivector_copy ( cpl_bivector *  self,
const cpl_bivector *  other 
)

Copy contents of a bivector into another bivector.

Parameters
selfdestination cpl_vector
othersource cpl_vector
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_vector_set_size() if source and destination have different sizes.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_bivector_get_x(), cpl_bivector_get_x_const(), cpl_bivector_get_y(), cpl_bivector_get_y_const(), CPL_ERROR_NONE, and cpl_vector_copy().

void cpl_bivector_delete ( cpl_bivector *  f)

Delete a cpl_bivector.

Parameters
fcpl_bivector to delete
Returns
void

This function deletes a bivector. If the input bivector f is NULL, nothing is done, and no error is set.

References cpl_free(), and cpl_vector_delete().

Referenced by cpl_apertures_get_fwhm(), cpl_flux_get_noise_ring(), cpl_geom_img_offset_combine(), cpl_image_fit_gaussian(), cpl_wlcalib_slitmodel_delete(), and cpl_wlcalib_slitmodel_set_catalog().

void cpl_bivector_dump ( const cpl_bivector *  f,
FILE *  stream 
)

Dump a cpl_bivector as ASCII to a stream.

Parameters
fInput cpl_bivector to dump or NULL
streamOutput stream, accepts stdout or stderr or NULL
Returns
void

Comment lines start with the hash character.

stream may be NULL in which case stdout is used.

Note
In principle a cpl_bivector can be saved using cpl_bivector_dump() and re-read using cpl_bivector_read(). This will however introduce significant precision loss due to the limited accuracy of the ASCII representation.

References cpl_bivector_get_size(), cpl_vector_get_data_const(), and cpl_vector_get_size().

cpl_bivector* cpl_bivector_duplicate ( const cpl_bivector *  in)

Duplicate a cpl_bivector.

Parameters
incpl_bivector to duplicate
Returns
1 newly allocated cpl_bivector or NULL on error

The returned object must be deallocated using cpl_bivector_delete()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input bivector contains vectors of different sizes

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_malloc(), cpl_vector_duplicate(), and cpl_vector_get_size().

cpl_size cpl_bivector_get_size ( const cpl_bivector *  in)

Get the size of the cpl_bivector.

Parameters
inthe input bivector
Returns
The size or a negative number on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input bivector contains vectors of different sizes

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_vector_get_size().

Referenced by cpl_bivector_dump(), cpl_bivector_interpolate_linear(), cpl_bivector_sort(), cpl_geom_img_offset_combine(), cpl_geom_img_offset_fine(), cpl_geom_img_offset_saa(), cpl_plot_bivector(), and cpl_plot_bivectors().

cpl_vector* cpl_bivector_get_x ( cpl_bivector *  in)

Get a pointer to the x vector of the cpl_bivector.

Parameters
ina cpl_bivector
Returns
Pointer to the x vector or NULL on error

The returned pointer refers to an already created cpl_vector.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_bivector_copy(), and cpl_geom_img_offset_combine().

const cpl_vector* cpl_bivector_get_x_const ( const cpl_bivector *  in)

Get a pointer to the x vector of the cpl_bivector.

Parameters
ina cpl_bivector
Returns
Pointer to the x vector or NULL on error
See also
cpl_bivector_get_x

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_bivector_copy(), cpl_bivector_interpolate_linear(), and cpl_geom_img_offset_saa().

double* cpl_bivector_get_x_data ( cpl_bivector *  in)

Get a pointer to the x data part of the cpl_bivector.

Parameters
ina cpl_bivector
Returns
Pointer to the double x array or NULL on error
See also
cpl_vector_get_data The returned pointer refers to already allocated data.
Note
Use at your own risk: direct manipulation of vector data rules out any check performed by the vector object interface, and may introduce inconsistencies between the information maintained internally, and the actual vector data and structure.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_vector_get_data().

Referenced by cpl_apertures_get_fwhm(), cpl_bivector_interpolate_linear(), cpl_bivector_sort(), cpl_geom_img_offset_combine(), cpl_geom_img_offset_fine(), cpl_image_fit_gaussian(), and cpl_image_iqe().

const double* cpl_bivector_get_x_data_const ( const cpl_bivector *  in)

Get a pointer to the x data part of the cpl_bivector.

Parameters
ina cpl_bivector
Returns
Pointer to the double x array or NULL on error
See also
cpl_bivector_get_x_data

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_vector_get_data_const().

Referenced by cpl_bivector_interpolate_linear(), cpl_bivector_sort(), cpl_flux_get_noise_ring(), cpl_geom_img_offset_fine(), cpl_plot_bivector(), and cpl_plot_bivectors().

cpl_vector* cpl_bivector_get_y ( cpl_bivector *  in)

Get a pointer to the y vector of the cpl_bivector.

Parameters
ina cpl_bivector
Returns
Pointer to the y vector or NULL on error

The returned pointer refers to an already created cpl_vector.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_bivector_copy(), and cpl_geom_img_offset_combine().

const cpl_vector* cpl_bivector_get_y_const ( const cpl_bivector *  in)

Get a pointer to the y vector of the cpl_bivector.

Parameters
ina cpl_bivector
Returns
Pointer to the y vector or NULL on error

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_bivector_copy(), and cpl_geom_img_offset_saa().

double* cpl_bivector_get_y_data ( cpl_bivector *  in)

Get a pointer to the y data part of the cpl_bivector.

Parameters
ina cpl_bivector
Returns
Pointer to the double y array or NULL on error
See also
cpl_vector_get_x_data

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_vector_get_data().

Referenced by cpl_apertures_get_fwhm(), cpl_bivector_interpolate_linear(), cpl_bivector_sort(), cpl_geom_img_offset_combine(), cpl_geom_img_offset_fine(), and cpl_image_iqe().

const double* cpl_bivector_get_y_data_const ( const cpl_bivector *  in)

Get a pointer to the y data part of the cpl_bivector.

Parameters
ina cpl_bivector
Returns
Pointer to the double y array or NULL on error
See also
cpl_bivector_get_y_data

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_vector_get_data_const().

Referenced by cpl_bivector_interpolate_linear(), cpl_bivector_sort(), cpl_flux_get_noise_ring(), cpl_geom_img_offset_fine(), cpl_plot_bivector(), and cpl_plot_bivectors().

cpl_error_code cpl_bivector_interpolate_linear ( cpl_bivector *  fout,
const cpl_bivector *  fref 
)

Linear interpolation of a 1d-function.

Parameters
foutPreallocated with X-vector set, to hold interpolation in Y
frefReference 1d-function
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_

fref must have both its abscissa and ordinate defined. fout must have its abscissa defined and its ordinate allocated.

The linear interpolation will be done from the values in fref to the abscissa points in fout.

For each abscissa point in fout, fref must either have two neigboring abscissa points such that xref_i < xout_j < xref{i+1}, or a single identical abscissa point, such that xref_i == xout_j.

This is ensured by monotonely growing abscissa points in both fout and fref (and by min(xref) <= min(xout) and max(xout) < max(xref)).

However, for efficiency reasons (since fref can be very long) the monotonicity is only verified to the extent necessary to actually perform the interpolation.

This input requirement implies that extrapolation is not allowed.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_DATA_NOT_FOUND if fout has an endpoint which is out of range
  • CPL_ERROR_ILLEGAL_INPUT if the monotonicity requirement on the 2 input abscissa vectors is not met.

References cpl_bivector_get_size(), cpl_bivector_get_x_const(), cpl_bivector_get_x_data(), cpl_bivector_get_x_data_const(), cpl_bivector_get_y_data(), cpl_bivector_get_y_data_const(), cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, and cpl_vector_find().

cpl_bivector* cpl_bivector_new ( cpl_size  n)

Create a new cpl_bivector.

Parameters
nPositive number of points
Returns
1 newly allocated cpl_bivector or NULL on error

The returned object must be deallocated using cpl_bivector_delete() or cpl_bivector_unwrap_vectors(), provided the two cpl_vectors are deallocated separately.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if n is < 1.

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, cpl_malloc(), and cpl_vector_new().

Referenced by cpl_apertures_get_fwhm(), cpl_geom_img_offset_combine(), cpl_geom_img_offset_fine(), and cpl_image_iqe().

cpl_bivector* cpl_bivector_read ( const char *  filename)

Read a list of values from an ASCII file and create a cpl_bivector.

Parameters
filenameName of the input ASCII file
Returns
1 newly allocated cpl_bivector or NULL on error
See also
cpl_vector_load

The input ASCII file must contain two values per line.

The returned object must be deallocated using cpl_bivector_delete() Two columns of numbers are expected in the input file.

In addition to normal files, FIFO (see man mknod) are also supported.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if the file cannot be read
  • CPL_ERROR_BAD_FILE_FORMAT if the file contains no valid lines

References cpl_bivector_wrap_vectors(), cpl_ensure, CPL_ERROR_BAD_FILE_FORMAT, CPL_ERROR_FILE_IO, CPL_ERROR_NULL_INPUT, cpl_vector_delete(), cpl_vector_new(), cpl_vector_set(), and cpl_vector_set_size().

cpl_error_code cpl_bivector_sort ( cpl_bivector *  self,
const cpl_bivector *  other,
cpl_sort_direction  dir,
cpl_sort_mode  mode 
)

Sort a cpl_bivector.

Parameters
selfcpl_bivector to hold sorted result
otherInput cpl_bivector to sort, may equal self
dirCPL_SORT_ASCENDING or CPL_SORT_DESCENDING
modeCPL_SORT_BY_X or CPL_SORT_BY_Y
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

The values in the input are sorted according to direction and mode, and the result is placed self which must be of the same size as other.

As for qsort(): If two members compare as equal, their order in the sorted array is undefined.

In place sorting is supported.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if self and other have different sizes
  • CPL_ERROR_ILLEGAL_INPUT if dir is neither CPL_SORT_DESCENDING nor CPL_SORT_ASCENDING.
  • CPL_ERROR_UNSUPPORTED_MODE if self and other are the same or point to the same underlying arrays, or if mode is neither CPL_SORT_BY_X nor CPL_SORT_BY_Y

References cpl_bivector_get_size(), cpl_bivector_get_x_data(), cpl_bivector_get_x_data_const(), cpl_bivector_get_y_data(), cpl_bivector_get_y_data_const(), cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_free(), and cpl_malloc().

void cpl_bivector_unwrap_vectors ( cpl_bivector *  f)

Free memory associated to a cpl_bivector, excluding the two vectors.

Parameters
fcpl_bivector to delete
Returns
void
See also
cpl_bivector_wrap_vectors

References cpl_free().

Referenced by cpl_plot_column(), and cpl_polynomial_fit().

cpl_bivector* cpl_bivector_wrap_vectors ( cpl_vector *  x,
cpl_vector *  y 
)

Create a new cpl_bivector from two cpl_vectors.

Parameters
xthe x cpl_vector
ythe y cpl_vector
Returns
1 cpl_bivector or NULL on error
Note
The input cpl_vectors must have identical sizes. Afterwards one of those two vectors may be resized, which will corrupt the bivector. Such a corrupted bivector should not be used any more, but rather deallocated, using cpl_bivector_unwrap_vectors() or cpl_bivector_delete().

The returned object must be deallocated using cpl_bivector_delete() or with cpl_bivector_unwrap_vectors(), provided the two cpl_vectors are deallocated separately.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input vectors have different sizes

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_malloc(), and cpl_vector_get_size().

Referenced by cpl_bivector_read(), cpl_plot_column(), cpl_polynomial_fit(), and cpl_ppm_match_positions().

cpl-6.6.1/html/group__cpl__init.html0000644000460300003120000002462412553662431014400 00000000000000 Common Pipeline Library Reference Manual: Library Initialization
Common Pipeline Library Reference Manual  6.6.1
Library Initialization

Functions

void cpl_end (void)
 Stop the internal subsystems of CPL. More...
 
const char * cpl_get_description (unsigned self)
 Create a string of version numbers of CPL and its libraries. More...
 
void cpl_init (unsigned self)
 Initialise the CPL core library. More...
 

Detailed Description

The module provides the CPL library startup routine. The startup routine initialises CPL internal data structures. For this reason, any application using functions from the CPL libraries must call the startup routine prior to calling any other CPL function.

Synopsis:
#include <cpl_init.h>

Function Documentation

void cpl_end ( void  )

Stop the internal subsystems of CPL.

Returns
Nothing.
Note
Currently, the behaviour of any CPL function becomes undefined after this function is called.

This function must be called after any other CPL function is called.

References cpl_fits_set_mode(), CPL_FITS_STOP_CACHING, and cpl_msg_stop().

Referenced by cpl_test_end().

const char* cpl_get_description ( unsigned  self)

Create a string of version numbers of CPL and its libraries.

Parameters
selfCPL_DESCRIPTION_DEFAULT
Returns
A pointer to a constant character array

References cpl_msg_warning().

void cpl_init ( unsigned  self)

Initialise the CPL core library.

Parameters
selfCPL_INIT_DEFAULT is the only supported value
Returns
Nothing.
Note
The function must be called once before any other CPL function.
See also
cpl_fits_set_mode()

This function sets up the library internal subsystems, which other CPL functions expect to be in a defined state. In particular, the CPL memory management and the CPL messaging systems are initialised by this function call.

One of the internal subsystems of CPL handles memory allocation. The default CPL memory mode is defined during the build procedure, this default can be changed during the call to cpl_init() via the environment variable CPL_MEMORY_MODE. The valid values are 0: Use the default system functions for memory handling 1: Exit if a memory-allocation fails, provide checking for memory leaks, limited reporting of memory allocation and limited protection on deallocation of invalid pointers. 2: Exit if a memory-allocation fails, provide checking for memory leaks, extended reporting of memory allocation and protection on deallocation of invalid pointers. Any other value (including NULL) will leave the default memory mode unchanged.

This function also reads the environment variable CPL_IO_MODE. Iff set to 1, cpl_fits_set_mode() is called with CPL_FITS_START_CACHING.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_INCOMPATIBLE_INPUT if there is an inconsistency between the run- time and compile-time versions of a library that CPL depends on internally, e.g. CFITSIO. This error may occur with dynamic linking. If it does occur, the use of CPL may lead to unexpected behaviour.

References cpl_error_get_code(), CPL_ERROR_INCOMPATIBLE_INPUT, cpl_fits_set_mode(), CPL_FITS_START_CACHING, cpl_free(), cpl_msg_init(), cpl_msg_warning(), cpl_sprintf(), and cpl_strdup().

cpl-6.6.1/html/form_5.png0000644000460300003120000000033412553662434012067 00000000000000‰PNG  IHDR ŠœÖ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïKIDATxíÝÛ€0DÑKb”˜AúïÖçè~ØÃs~–~§šlÀ—%geiáj'VáTqu¸Ç&eÅÌSÊÎÿ¯{Õudlvïëìa?F’½IEND®B`‚cpl-6.6.1/html/closed.png0000644000460300003120000000020412553662426012146 00000000000000‰PNG  IHDR à‘KIDATxíÝm @!†ÑGk™É7À-`&séts¦Àñþòð@åk}ª2€… P%Á_Ëþ¿N² .:0Dk¥‹Â›x" Ö›)¡xÒ5õIEND®B`‚cpl-6.6.1/html/group__cpl__recipeconfig.html0000644000460300003120000017234112553662432016073 00000000000000 Common Pipeline Library Reference Manual: Recipe Configurations
Common Pipeline Library Reference Manual  6.6.1
Recipe Configurations

Functions

void cpl_recipeconfig_clear (cpl_recipeconfig *self)
 Clear a recipe configuration object. More...
 
void cpl_recipeconfig_delete (cpl_recipeconfig *self)
 Delete a recipe configuration object. More...
 
char ** cpl_recipeconfig_get_inputs (const cpl_recipeconfig *self, const char *tag)
 Get the input configuration for a given tag. More...
 
cpl_size cpl_recipeconfig_get_max_count (const cpl_recipeconfig *self, const char *tag, const char *input)
 Get the maximum number of frames for the given configuration and tag. More...
 
cpl_size cpl_recipeconfig_get_min_count (const cpl_recipeconfig *self, const char *tag, const char *input)
 Get the minimum number of frames for the given configuration and tag. More...
 
char ** cpl_recipeconfig_get_outputs (const cpl_recipeconfig *self, const char *tag)
 Get the output configuration for a given tag. More...
 
char ** cpl_recipeconfig_get_tags (const cpl_recipeconfig *self)
 Get the list of supported configuration tags. More...
 
int cpl_recipeconfig_is_required (const cpl_recipeconfig *self, const char *tag, const char *input)
 Check whether a frame with the given tag is required. More...
 
cpl_recipeconfig * cpl_recipeconfig_new (void)
 Create a new recipe configuration object. More...
 
int cpl_recipeconfig_set_input (cpl_recipeconfig *self, const char *tag, const char *input, cpl_size min_count, cpl_size max_count)
 Add the configuration for the given input and configuration tag. More...
 
int cpl_recipeconfig_set_inputs (cpl_recipeconfig *self, const char *tag, const cpl_framedata *data)
 Set the input configuration for a given tag. More...
 
int cpl_recipeconfig_set_output (cpl_recipeconfig *self, const char *tag, const char *output)
 Add an output frame tag for the given configuration tag. More...
 
int cpl_recipeconfig_set_outputs (cpl_recipeconfig *self, const char *tag, const char **data)
 Set the output configuration for a given tag. More...
 
int cpl_recipeconfig_set_tag (cpl_recipeconfig *self, const char *tag, cpl_size min_count, cpl_size max_count)
 Set a configuration tag. More...
 
int cpl_recipeconfig_set_tags (cpl_recipeconfig *self, const cpl_framedata *data)
 Set the list of configuration tags. More...
 

Detailed Description

This module implements the support for recipe configurations. A recipe configuration stores information about the input data frames a recipe can process, which other input frame are needed in addition, and which output frames may be created by the recipe.

For each input frame extra information, for instance, whether a particular frame type is a required or optional recipe input, or how many frames of a certain type are at least needed, can also be stored.

The information for the individual recipe configurations and also for the individual frames can be accessed by means of a unique string identifier for the configuration and the frame respectively. This string identifier is called configuration tag in the former, and frame tag in the latter case. In particular, the configuration tag is a frame tag too, namely the frame tag of the recipe's "primary" input, or trigger frame.

The recipe configuration object stores a separate configuration for each of the different frame types, indicated by its tag, it is able to process. Each of these configurations can be retrieved, using the appropriate configuration tag as a key.

In the same way the information about individual frames can be retrieved from the selected configuration.

Synopsis:
#include <cpl_recipeconfig.h>

Function Documentation

void cpl_recipeconfig_clear ( cpl_recipeconfig *  self)

Clear a recipe configuration object.

Parameters
selfThe recipe configuration object.
Returns
Nothing.

The function clears the contents of the recipe configuration self. After the return from this call, self is empty.

See also
cpl_recipeconfig_new()
void cpl_recipeconfig_delete ( cpl_recipeconfig *  self)

Delete a recipe configuration object.

Parameters
selfThe recipe configuration object.
Returns
Nothing.

The function destroys the recipe configuration object self. Any resources used by self are released. If self is NULL, nothing is done and no error is set.

char** cpl_recipeconfig_get_inputs ( const cpl_recipeconfig *  self,
const char *  tag 
)

Get the input configuration for a given tag.

Parameters
selfThe recipe configuration object.
tagThe tag for which the input configuration is requested.
Returns
On success, the function returns a NULL terminated array of strings, and NULL if an error occurred. In the latter case an appropriate error code is also set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The configuration tag tag was not found.

The function retrieves the list of input frame tags stored in the recipe configuration for the configuration tag tag from the configuration object self.

In case the input configuration for the tag tag is empty, i.e. no input frame tag has been added the function still returns a C string array. In this case the first element is set to NULL.

The returned array and each of its elements must be deallocated using cpl_free() if they are no longer used. The array is NULL terminated, i.e. the last element of the array is set to NULL.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_error_set.

cpl_size cpl_recipeconfig_get_max_count ( const cpl_recipeconfig *  self,
const char *  tag,
const char *  input 
)

Get the maximum number of frames for the given configuration and tag.

Parameters
selfThe recipe configuration object.
tagThe configuration tag to look up.
inputThe frame tag to search for.
Returns
The function returns the maximum number of frames with the tag input, or -1, if an error occurred. In the latter case an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self, tag or input is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The configuration tag tag is NULL, or an invalid string, the empty string for instance.
CPL_ERROR_DATA_NOT_FOUND No frame tag tag or input was found, or self was not properly initialized.

The function queries the recipe configuration self for the configuration tag tag, searches this configuration for the frame tag input and returns the maximum number of frames required for this frame type.

If the same string is passed as tag and input, the settings for the frame with tag tag are returned.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_error_set, and _cpl_framedata_::max_count.

cpl_size cpl_recipeconfig_get_min_count ( const cpl_recipeconfig *  self,
const char *  tag,
const char *  input 
)

Get the minimum number of frames for the given configuration and tag.

Parameters
selfThe recipe configuration object.
tagThe configuration tag to look up.
inputThe frame tag to search for.
Returns
The function returns the minimum number of frames with the tag input, or -1, if an error occurred. In the latter case an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self, tag or input is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The configuration tag tag is NULL, or an invalid string, the empty string for instance.
CPL_ERROR_DATA_NOT_FOUND No frame tag tag or input was found, or self was not properly initialized.

The function queries the recipe configuration self for the configuration tag tag, searches this configuration for the frame tag input and returns the minimum number of frames required for this frame type.

If the same string is passed as tag and input, the settings for the frame with tag tag are returned.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_error_set, and _cpl_framedata_::min_count.

char** cpl_recipeconfig_get_outputs ( const cpl_recipeconfig *  self,
const char *  tag 
)

Get the output configuration for a given tag.

Parameters
selfThe recipe configuration object.
tagThe tag for which the ouput configuration is requested.
Returns
On success, the function returns a NULL terminated array of strings, and NULL if an error occurred. In the latter case an appropriate error code is also set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.
CPL_ERROR_DATA_NOT_FOUND The configuration tag tag was not found.

The function retrieves the list of all possible output frame tags stored in the recipe configuration object self for the configuration tag tag.

In case the output configuration for the tag tag is empty, i.e. no output frame tag has been added the function still returns a C string array. In this case the first element is set to NULL.

The returned array and each of its elements must be deallocated using cpl_free() if they are no longer used. The array is NULL terminated, i.e. the last element of the array is set to NULL.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, and cpl_error_set.

char** cpl_recipeconfig_get_tags ( const cpl_recipeconfig *  self)

Get the list of supported configuration tags.

Parameters
selfThe recipe configuration object.
Returns
On success, the function returns a NULL terminated array of strings, and NULL if an error occurred. In the latter case an appropriate error code is also set.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.

The function retrieves the list of configuration tags stored in the recipe configuration object self. The frame tags are returned as the elements of an array of C strings. The last element of the array is a NULL pointer indicating the end of the list.

In case the recipe configuration object is empty, i.e. no configuration tag has been added, or cpl_recipeconfig_clear() has been called for this object, the function still returns the C string array. In this case the first element is set to NULL.

If the returned list is not used any more each element, and the array itself must be deallocated using cpl_free().

References CPL_ERROR_NULL_INPUT, and cpl_error_set.

int cpl_recipeconfig_is_required ( const cpl_recipeconfig *  self,
const char *  tag,
const char *  input 
)

Check whether a frame with the given tag is required.

Parameters
selfA recipe configuration object.
tagThe configuration tag to look up.
inputThe frame tag to search for.
Returns
The function returns 1 if the frame with the tag input is required, and 0 if the frame is not a required input. If an error occurred -1 is returned and an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self, tag or input is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The frame tag tag is NULL, an invalid string, the empty string for instance.
CPL_ERROR_DATA_NOT_FOUND No frame tag tag or input was found, or self was not properly initialized.

The function queries the recipe configuration self for the configuration tag tag and searches this configuration for the frame tag input. It returns the maximum number of frames required for this frame type.

If the same string is passed as tag and input, the settings for the frame with tag tag are returned.

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_NULL_INPUT, cpl_error_set, and _cpl_framedata_::min_count.

cpl_recipeconfig* cpl_recipeconfig_new ( void  )

Create a new recipe configuration object.

Returns
The function returns a pointer to the newly created recipe configuration.

The function creates a new, empty recipe configuration object.

int cpl_recipeconfig_set_input ( cpl_recipeconfig *  self,
const char *  tag,
const char *  input,
cpl_size  min_count,
cpl_size  max_count 
)

Add the configuration for the given input and configuration tag.

Parameters
selfThe recipe configuration object.
tagThe configuration tag.
inputThe input frame tag.
min_countThe value to set as the minimum number of frames.
max_countThe value to set as the maximum number of frames.
Returns
The function returns 0 on success and a non-zero value if an error occurred. The return value is -1 if self, tag or input is NULL, or, if tag or input is an invalid string. The function returns 1 if self was not properly initialized using cpl_recipeconfig_set_tag() or cpl_recipeconfig_set_tags(). If no tag tag is found in self the function returns 2. If an error occurs an appropriate error code is also set.
Errors
CPL_ERROR_NULL_INPUT The parameter self, tag or input is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The frame tag tag or input is an empty string, or tag and input are equal.
CPL_ERROR_DATA_NOT_FOUND No configuration for the tag tag was found, or self was not properly initialized.

The function sets the configuration for the input frame tag input of the configuration associated with the tag tag in the recipe configuration object self. The minimum and maximum number of frames of this input frame tag are given using the min_count and max_count arguments. Using a value of -1 for the minimum and maximum number of frames, means that these two numbers are unspecified. Using a minimum number min_count greater then 0 makes the frame a required input.

Before an input configuration can be set using this function, the configuration tag tag must have been added to self previously using cpl_recipeconfig_set_tag() or cpl_recipeconfig_set_tags().

See also
cpl_recipeconfig_set_tag(), cpl_recipeconfig_set_tags()

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_framedata_create(), and cpl_framedata_delete().

int cpl_recipeconfig_set_inputs ( cpl_recipeconfig *  self,
const char *  tag,
const cpl_framedata data 
)

Set the input configuration for a given tag.

Parameters
selfThe recipe configuration object.
tagThe tag for which the input configuration is set.
dataAn array containing the configuration informations.
Returns
The function returns 0 on success, or a non-zero value otherwise. If self or tag is NULL, or if tag is invalid, i.e. the empty string the function returns -1 and sets an appropriate error code. If no configuration tags were previously configured using cpl_recipeconfig_set_tag() or cpl_recipeconfig_set_tags() the function returns 1. If no configuration was found for the given tag tag the return value is 2. Finally, if the frame tag to add to the configuration is invalid, the function returns 3.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The frame tag tag is an invalid tag, i.e. the empty string or the input frame tag read from data is invalid, or the same as tag.
CPL_ERROR_DATA_NOT_FOUND No configuration for the tag tag was found, or self was not properly initialized.

The function sets the input configuration for the tag tag in the recipe configuration object self. The minimum and maximum number of frames of this tag can be given using the arguments min_count and max_count. Using a value of -1 for the minimum and maximum number of frames, means that these two numbers are unspecified. Using a value greater than 0 for the minimum number of frames makes the input frame a required frame.

The function sets the configuration data for each input tag specified in the array data, until a tag set to NULL is reached. The array data must contain such an entry as last element, in order to indicate the end of the array.

Before an input configuration can be set using this function, the configuration tag tag must have been added to self previously using cpl_recipeconfig_set_tag() or cpl_recipeconfig_set_tags().

See also
cpl_recipeconfig_set_tag(), cpl_recipeconfig_set_tags()

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_framedata_delete(), cpl_framedata_duplicate(), and _cpl_framedata_::tag.

int cpl_recipeconfig_set_output ( cpl_recipeconfig *  self,
const char *  tag,
const char *  output 
)

Add an output frame tag for the given configuration tag.

Parameters
selfThe recipe configuration object.
tagThe configuration tag.
outputThe output frame tag to add.
Returns
The function returns 0 on success and a non-zero value if an error occurred. The return value is -1 if self, tag or output is NULL, or if tag or input is an invalid string. The function returns 1 if self was not properly initialized using cpl_recipeconfig_set_tag() or cpl_recipeconfig_set_tags(). If no tag tag is found in self the function returns 2. If an error occurs an appropriate error code is also set.
Errors
CPL_ERROR_NULL_INPUT The parameter self, tag or output is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The frame tag tag or input is an invalid string, i.e. the empty string.
CPL_ERROR_DATA_NOT_FOUND No configuration for the tag tag was found, or self was not properly initialized.

The function adds the output frame tag ouput to the configuration associated with the tag tag in the recipe configuration object self.

Before an output frame tag can be set using this function, the configuration tag tag must have been added to self previously, using cpl_recipeconfig_set_tag() or cpl_recipeconfig_set_tags().

See also
cpl_recipeconfig_set_tag(), cpl_recipeconfig_set_tags()

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, cpl_framedata_create(), and cpl_framedata_delete().

int cpl_recipeconfig_set_outputs ( cpl_recipeconfig *  self,
const char *  tag,
const char **  data 
)

Set the output configuration for a given tag.

Parameters
selfThe recipe configuration object.
tagThe tag for which the output configuration is set.
dataAn array of strings containing the output frame tags to set.
Returns
The function returns 0 on success, or a non-zero value otherwise. If self or tag is NULL, or if tag is invalid, i.e. the empty string the function returns -1 and sets an appropriate error code. If no configuration tags were previously configured using cpl_recipeconfig_set_tag() or cpl_recipeconfig_set_tags() the function returns 1. If no configuration was found for the given tag tag the return value is 2.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The frame tag tag is an invalid tag, i.e. the empty string.
CPL_ERROR_DATA_NOT_FOUND No configuration for the tag tag was found, or self was not properly initialized.

The function sets the output configuration for the tag tag in the recipe configuration object self. The output configuration is a list of all possible frame tags which could result from the execution of the corresponding recipe.

The function stores each output frame tag found in the array data, until an array element set to NULL is reached. The array data must contain such an entry as last element, in order to indicate the end of the array.

Before an output configuration can be set using this function, the configuration tag tag must have been added to self previously using cpl_recipeconfig_set_tag() or cpl_recipeconfig_set_tags().

See also
cpl_recipeconfig_set_tag(), cpl_recipeconfig_set_tags()

References CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, and cpl_framedata_create().

int cpl_recipeconfig_set_tag ( cpl_recipeconfig *  self,
const char *  tag,
cpl_size  min_count,
cpl_size  max_count 
)

Set a configuration tag.

Parameters
selfThe recipe configuration object.
tagThe configuration tag.
min_countThe value to set as the minimum number of frames.
max_countThe value to set as the maximum number of frames.
Returns
The function returns 0 on success and a non-zero value if an error occurred. The return value is -1 if self or tag is NULL, or if tag is an invalid string. If an error occurs an appropriate error code is set.
Errors
CPL_ERROR_NULL_INPUT The parameter self or tag is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The frame tag tag is an invalid tag, i.e. the empty string.

The function creates a configuration for the configuration tag tag and adds it to the recipe configuration object self. The minimum and maximum number of frames of this tag can be given using the arguments min_count and max_count. Using a value of -1 for the minimum and maximum number of frames, means that these two numbers are unspecified. If the minimum number of frames is greater than 0, the frame is considered to be required, otherwise it is optional.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_error_set.

int cpl_recipeconfig_set_tags ( cpl_recipeconfig *  self,
const cpl_framedata data 
)

Set the list of configuration tags.

Parameters
selfThe recipe configuration object.
dataA frame data array from which the tags are set.
Returns
The function returns 0 on success, or a non-zero value otherwise. Inparticular, if the self is NULL the function returns -1 and sets the appropriate error code. If any configuration tag in the input array data is invalid, an empty string for instance, the function returns 1 and sets an appropriate error code.
Errors
CPL_ERROR_NULL_INPUT The parameter self is a NULL pointer.
CPL_ERROR_ILLEGAL_INPUT The frame data array data contains an invalid tag.

The function is a convenience function to allow an initialization of a recipe configuration from static data. The configuration tags to be stored are taken from the frame data array data and are added to the recipe configuration self. The configuration tag is copied to self.

In addition the tags can be configured using the remaining members of the frame data structures of data.

The function adds each configuration tag found in the array data to the configuration self, until a configuration tag set to NULL is reached. The array data must be terminated by such an entry, which indicates the end of the array.

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, and _cpl_framedata_::tag.

cpl-6.6.1/html/tab_a.png0000644000460300003120000000021612553662426011746 00000000000000‰PNG  IHDR$ÇÇ[UIDATxíK €0C'o¤(Šˆ[Žà%Üxÿ#Ù©­ç ùÁöó¦W¦e# 3t I 3+¼øEã~\D½9¯Ûàè’wM·¿öÿ}Yõ_êA4Yžã}IEND®B`‚cpl-6.6.1/html/dir_0893a83ae506d6342ff4de074eaf5145.html0000644000460300003120000000721512553662432016223 00000000000000 Common Pipeline Library Reference Manual: cpldfs Directory Reference
Common Pipeline Library Reference Manual  6.6.1
cpldfs Directory Reference

Files

file  cpl_dfs.c
 
file  cpl_dfs.h
 
file  cpl_multiframe.c
 
file  cpl_multiframe.h
 
file  md5.c
 
file  md5.h
 
cpl-6.6.1/html/form_12.png0000644000460300003120000000046412553662436012153 00000000000000‰PNG  IHDR"D+]V0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï£IDATxíYà ',fI÷¿mmRH«þõÓÒ³°˜™¼èeÒßÚ—-‚O¥ôЈ+RåëÇÑÇœ÷¾M\ðqÜ©‰E»« "—ʦ̤1ìqû—›Øž{éãÎYNšÓ‰…\gŸÚ[{wZˆ8œ¹øñm´îsÃwEýXÀ¦¹ €¯rÛÿxF"'€çIEND®B`‚cpl-6.6.1/html/dir_5cd28bf58103222faf21a5533c3a1fe9.html0000644000460300003120000001773512553662432016272 00000000000000 Common Pipeline Library Reference Manual: cplui Directory Reference
Common Pipeline Library Reference Manual  6.6.1
cplui Directory Reference

Files

file  cpl_frame.c
 
file  cpl_frame.h
 
file  cpl_frame_impl.h
 
file  cpl_framedata.c
 
file  cpl_framedata.h
 
file  cpl_frameset.c
 
file  cpl_frameset.h
 
file  cpl_frameset_io.c
 
file  cpl_frameset_io.h
 
file  cpl_parameter.c
 
file  cpl_parameter.h
 
file  cpl_parameterlist.c
 
file  cpl_parameterlist.h
 
file  cpl_plugin.c
 
file  cpl_plugin.h
 
file  cpl_plugininfo.h
 
file  cpl_pluginlist.c
 
file  cpl_pluginlist.h
 
file  cpl_recipe.h
 
file  cpl_recipeconfig.c
 
file  cpl_recipeconfig.h
 
file  cpl_recipedefine.c
 
file  cpl_recipedefine.h
 
cpl-6.6.1/html/bc_s.png0000644000460300003120000000124412553662426011610 00000000000000‰PNG  IHDR€_ kIDATxíËkQÆÏ¹É̤I&“¦mš&156*nÄ…”ܸR,4 +Hµ(U­b”ª1‚ŠˆJ.º(E·mßúhëJmKS'C›(‚èäÑ…¤ï &äÖþ ‡ïrÎåü3gö(z÷ýÒ&_9ó}’ÕŸ@‰mÚu ` Øh`ñ÷Ô¯  „ú&·ññ×Ù~“½—Üò‡ÎÝÑM4¸%‰3²§?Êêh)€ÿù™\ÄYi>Jb @gûßiÞˆú²Ñkg§ãê\è½­šEUæv+?E€î"pæÖÛB\ƒY&ðØó$vM+ê’Dn¼)}òþ:§Xoâ ƒ3ŠÚ¯'¯¿.‚fÁ0ìuŠ9òLýj€f6¸%«3Gf”Ô#Ôsm(,ùÃk*Ê’³Jª…¯¼JË¢o䆔¼u_~ °r]%%mnu]z°r5[ÍÆ°«Úò•Xeµ’†Iù<ÈèÐÅg@IÔÚÞàµë3‚:/<JÇ’ÐQ) ñ¹…tÚß÷(Mû\63éCgl!ýí;ÿ¸4Ùhâñ=÷Zë29­w’ÝÒ´·ˆV;ÊL3ƒj&7©·º½÷a!I†)ëë$-öÇÓú³›‹7tIV¾VàñÔübf¨8¡ÈƒB<﫵imnÿœÈ‡„ lߣù‡ÛD —#É5“­'Æ4?쬲øM’™›°»g¬‚|5Åçµ½GNdÓÐr|ô”Ã&„ì"7+'³@ 5‡G➑Džâɬ^;õã–.3Òr"ý_R³¿Â@²oI¾å$IEND®B`‚cpl-6.6.1/html/form_8.png0000644000460300003120000000032612553662435012074 00000000000000‰PNG  IHDR ƒw·¬0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïEIDATxíÀ@·×£hÄÿ[IÑôbl_€­5¨Ûz`hq{ñrÀ+÷P .%{j­Óý­zŸ´“i^íJWtNÜ%@IEND®B`‚cpl-6.6.1/html/group__cpl__version.html0000644000460300003120000002760712553662432015127 00000000000000 Common Pipeline Library Reference Manual: Library Version Information
Common Pipeline Library Reference Manual  6.6.1
Library Version Information

Functions

unsigned int cpl_version_get_binary_age (void)
 Get the library's binary age. More...
 
unsigned int cpl_version_get_binary_version (void)
 Get the library's binary version number. More...
 
unsigned int cpl_version_get_interface_age (void)
 Get the library's interface age. More...
 
unsigned int cpl_version_get_major (void)
 Get the library's major version number. More...
 
unsigned int cpl_version_get_micro (void)
 Get the library's micro version number. More...
 
unsigned int cpl_version_get_minor (void)
 Get the library's minor version number. More...
 
const char * cpl_version_get_version (void)
 Get the library's version string. More...
 

Detailed Description

This module provides functions to access the library's version information.

The library version applies to all component libraries of the Common pipeline library, and changes if any of the component libraries changes.

The library version is a version code made up of three components, the major, minor and micro version number, and is usually represented by a string of the form "major.minor.micro".

Synopsis:
#include <cpl_version.h>

Function Documentation

unsigned int cpl_version_get_binary_age ( void  )

Get the library's binary age.

Returns
The function returns the library's binary age.

The function returns the binary age of the library.

unsigned int cpl_version_get_binary_version ( void  )

Get the library's binary version number.

Returns
The function returns the library's version number.

The function returns the version number of the library encoded as a single integer number.

unsigned int cpl_version_get_interface_age ( void  )

Get the library's interface age.

Returns
The function returns the library's interface age.

The function returns the interface age of the library.

unsigned int cpl_version_get_major ( void  )

Get the library's major version number.

Returns
The function returns the library's major version number.

The function returns the major version number of the library.

unsigned int cpl_version_get_micro ( void  )

Get the library's micro version number.

Returns
The function returns the library's micro version number.

The function returns the micro version number of the library.

unsigned int cpl_version_get_minor ( void  )

Get the library's minor version number.

Returns
The function returns the library's minor version number.

The function returns the minor version number of the library.

const char* cpl_version_get_version ( void  )

Get the library's version string.

Returns
The function returns the library's version string.

The function returns the package version of the library as a string. The returned version string is composed of the major, minor and, possibly, the micro version of the library separated by dots. The micro version may not be there if it is 0.

cpl-6.6.1/html/annotated.html0000644000460300003120000000637612553662441013047 00000000000000 Common Pipeline Library Reference Manual: Class List
Common Pipeline Library Reference Manual  6.6.1
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
 C_cpl_framedata_The public frame data object
 C_cpl_plugin_The type representation of the generic plugin interface
 C_cpl_recipe_The type representation of the recipe plugin interface
cpl-6.6.1/html/nav_h.png0000644000460300003120000000014212553662426011771 00000000000000‰PNG  IHDR ,é@)IDATxíÝA @BQ­³šÛ›Ð¢Žáà) )ëý éaÅèÜ¿Æo‡RlÐßIEND®B`‚cpl-6.6.1/html/classes.html0000644000460300003120000000600312553662441012512 00000000000000 Common Pipeline Library Reference Manual: Class Index
Common Pipeline Library Reference Manual  6.6.1
Class Index
  _  
_cpl_plugin_   _cpl_recipe_   
_cpl_framedata_   
cpl-6.6.1/html/struct__cpl__recipe__-members.html0000644000460300003120000000604512553662432017020 00000000000000 Common Pipeline Library Reference Manual: Member List
Common Pipeline Library Reference Manual  6.6.1
_cpl_recipe_ Member List

This is the complete list of members for _cpl_recipe_, including all inherited members.

frames_cpl_recipe_
interface_cpl_recipe_
parameters_cpl_recipe_
cpl-6.6.1/html/bdwn.png0000644000460300003120000000022312553662426011630 00000000000000‰PNG  IHDR5åZIDATxíË € DŸP–1ñlžmÀ r±j².e è†D[ØÉ¾ÙÏÔ¼µ¦ã´Þ|陣6€Všë3´Å?Ls'(}¬>+ žKó÷¥¿ch`‚ ^׃ÞnIEND®B`‚cpl-6.6.1/html/dir_283883d147ab9a845d7032d17e09a122.html0000644000460300003120000002056512553662432016001 00000000000000 Common Pipeline Library Reference Manual: cpldrs Directory Reference
Common Pipeline Library Reference Manual  6.6.1
cpldrs Directory Reference

Files

file  cpl_apertures.c
 
file  cpl_apertures.h
 
file  cpl_apertures_img.h
 
file  cpl_detector.c
 
file  cpl_detector.h
 
file  cpl_detector_body.h
 
file  cpl_fft.c
 
file  cpl_fft.h
 
file  cpl_fft_body.h
 
file  cpl_fit.c
 
file  cpl_fit.h
 
file  cpl_fit_body.h
 
file  cpl_geom_img.c
 
file  cpl_geom_img.h
 
file  cpl_geom_img_body.h
 
file  cpl_photom.c
 
file  cpl_photom.h
 
file  cpl_phys_const.h
 
file  cpl_ppm.c
 
file  cpl_ppm.h
 
file  cpl_wcs.c
 
file  cpl_wcs.h
 
file  cpl_wlcalib.c
 
file  cpl_wlcalib.h
 
file  cpl_wlcalib_impl.h
 
cpl-6.6.1/html/group__cpl__polynomial.html0000644000460300003120000033350412553662432015621 00000000000000 Common Pipeline Library Reference Manual: Polynomials
Common Pipeline Library Reference Manual  6.6.1
Polynomials

Functions

cpl_error_code cpl_polynomial_add (cpl_polynomial *self, const cpl_polynomial *first, const cpl_polynomial *second)
 Add two polynomials of the same dimension. More...
 
int cpl_polynomial_compare (const cpl_polynomial *p1, const cpl_polynomial *p2, double tol)
 Compare the coefficients of two polynomials. More...
 
cpl_error_code cpl_polynomial_copy (cpl_polynomial *out, const cpl_polynomial *in)
 This function copies contents of a polynomial into another one. More...
 
void cpl_polynomial_delete (cpl_polynomial *p)
 Delete a cpl_polynomial. More...
 
cpl_error_code cpl_polynomial_derivative (cpl_polynomial *self, cpl_size dim)
 Compute a first order partial derivative. More...
 
cpl_error_code cpl_polynomial_dump (const cpl_polynomial *p, FILE *stream)
 Dump a cpl_polynomial as ASCII to a stream. More...
 
cpl_polynomial * cpl_polynomial_duplicate (const cpl_polynomial *p)
 This function duplicates an existing polynomial. More...
 
double cpl_polynomial_eval (const cpl_polynomial *p, const cpl_vector *x)
 Evaluate the polynomial at the given point. More...
 
double cpl_polynomial_eval_1d (const cpl_polynomial *self, double x, double *pd)
 Evaluate a univariate (1D) polynomial using Horners rule. More...
 
double cpl_polynomial_eval_1d_diff (const cpl_polynomial *self, double a, double b, double *ppa)
 Evaluate p(a) - p(b) using Horners rule. More...
 
cpl_polynomial * cpl_polynomial_extract (const cpl_polynomial *self, cpl_size dim, const cpl_polynomial *other)
 Collapse one dimension of a multi-variate polynomial by composition. More...
 
cpl_error_code cpl_polynomial_fit (cpl_polynomial *self, const cpl_matrix *samppos, const cpl_boolean *sampsym, const cpl_vector *fitvals, const cpl_vector *fitsigm, cpl_boolean dimdeg, const cpl_size *mindeg, const cpl_size *maxdeg)
 Fit a polynomial to a set of samples in a least squares sense. More...
 
cpl_polynomial * cpl_polynomial_fit_1d_create (const cpl_vector *x_pos, const cpl_vector *values, cpl_size degree, double *mse)
 Fit a 1D-polynomial to a 1D-signal in a least squares sense. More...
 
cpl_polynomial * cpl_polynomial_fit_2d_create (cpl_bivector *xy_pos, cpl_vector *values, cpl_size degree, double *mse)
 Fit a 2D-polynomial to a 2D-surface in a least squares sense. More...
 
double cpl_polynomial_get_coeff (const cpl_polynomial *in, const cpl_size *pows)
 Get a coefficient of the polynomial. More...
 
cpl_size cpl_polynomial_get_degree (const cpl_polynomial *p)
 The degree of the polynomial. More...
 
cpl_size cpl_polynomial_get_dimension (const cpl_polynomial *p)
 The dimension of the polynomial. More...
 
cpl_error_code cpl_polynomial_multiply_scalar (cpl_polynomial *self, const cpl_polynomial *other, double factor)
 Multiply a polynomial with a scalar. More...
 
cpl_polynomial * cpl_polynomial_new (cpl_size dim)
 Create a new cpl_polynomial. More...
 
cpl_error_code cpl_polynomial_set_coeff (cpl_polynomial *in, const cpl_size *pows, double c)
 Set a coefficient of the polynomial. More...
 
cpl_error_code cpl_polynomial_shift_1d (cpl_polynomial *p, cpl_size i, double u)
 Modify p, p(x0, x1, ..., xi, ...) := (x0, x1, ..., xi+u, ...) More...
 
cpl_error_code cpl_polynomial_solve_1d (const cpl_polynomial *p, double x0, double *px, cpl_size mul)
 A real solution to p(x) = 0 using Newton-Raphsons method. More...
 
cpl_error_code cpl_polynomial_subtract (cpl_polynomial *self, const cpl_polynomial *first, const cpl_polynomial *second)
 Subtract two polynomials of the same dimension. More...
 
cpl_error_code cpl_vector_fill_polynomial (cpl_vector *v, const cpl_polynomial *p, double x0, double d)
 Evaluate a 1D-polynomial on equidistant points using Horners rule. More...
 
cpl_error_code cpl_vector_fill_polynomial_fit_residual (cpl_vector *self, const cpl_vector *fitvals, const cpl_vector *fitsigm, const cpl_polynomial *fit, const cpl_matrix *samppos, double *rechisq)
 Compute the residual of a polynomial fit. More...
 

Detailed Description

This module provides functions to handle uni- and multivariate polynomials.

Univariate (1D) polynomials use the Horner rule for evaluation, while multivariate polynomials are evaluated simply as the sum of each term.

This means that of the two polynomials

* P1(x) = p0 + p1.x + p4.x^2
* 

and

* P2(x,y) = p0 + p1.x + p2.y + p3.x.y + p4.x^2 + p5.y^2
* 

P1(x) may evaluate to more accurate results than P2(x,0), especially around the roots.

Note that a polynomial like P3(z) = p0 + p1.z + p2.z^2 + p3.z^3, z=x^4 is preferable to p4(x) = p0 + p1.x^4 + p2.x^8 + p3.x^12.

Function Documentation

cpl_error_code cpl_polynomial_add ( cpl_polynomial *  self,
const cpl_polynomial *  first,
const cpl_polynomial *  second 
)

Add two polynomials of the same dimension.

Parameters
selfThe polynomial to hold the result
firstThe 1st polynomial to add
secondThe 2nd polynomial to add
Returns
CPL_ERROR_NONE or the relevant CPL error code
Note
self may be passed also as first and/or second

Possible CPL error code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the polynomials do not have identical dimensions
  • CPL_ERROR_UNSUPPORTED_MODE if the dimension is not 1 (FIXME)

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_polynomial_get_coeff(), cpl_polynomial_get_degree(), cpl_polynomial_get_dimension(), and cpl_polynomial_set_coeff().

int cpl_polynomial_compare ( const cpl_polynomial *  p1,
const cpl_polynomial *  p2,
double  tol 
)

Compare the coefficients of two polynomials.

Parameters
p1the 1st polynomial
p2the 2nd polynomial
tolThe absolute (non-negative) tolerance
Returns
0 when equal, positive when different, negative on error.

The two polynomials are considered equal iff they have identical dimensions and the absolute difference between their coefficients does not exceed the tolerance.

This means that the following pair of polynomials per definition are considered different: P1(x1,x2) = 3*x1 different from P2(x1) = 3*x1.

If all parameters are valid and p1 and p2 point to the same polynomial the functions returns 0.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if tol is negative

References cpl_calloc(), cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and cpl_free().

cpl_error_code cpl_polynomial_copy ( cpl_polynomial *  out,
const cpl_polynomial *  in 
)

This function copies contents of a polynomial into another one.

Parameters
outPre-allocated output cpl_polynomial
inInput cpl_polynomial
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_

in and out must point to different polynomials.

If out already contains coefficients, they are overwritten.

This is the only function that can modify the dimension of a polynomial.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if in and out point to the same polynomial

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_malloc(), cpl_polynomial_delete(), cpl_polynomial_duplicate(), and cpl_realloc().

Referenced by cpl_wlcalib_find_best_1d().

void cpl_polynomial_delete ( cpl_polynomial *  p)

Delete a cpl_polynomial.

Parameters
pcpl_polynomial to delete
Returns
void

The function deallocates the memory used by the polynomial p. If p is NULL, nothing is done, and no error is set.

References cpl_free().

Referenced by cpl_image_fill_jacobian_polynomial(), cpl_polynomial_copy(), cpl_polynomial_fit_1d_create(), cpl_polynomial_fit_2d_create(), cpl_polynomial_shift_1d(), cpl_ppm_match_points(), and cpl_wlcalib_find_best_1d().

cpl_error_code cpl_polynomial_derivative ( cpl_polynomial *  self,
cpl_size  dim 
)

Compute a first order partial derivative.

Parameters
selfThe polynomial to be modified in place
dimThe dimension to differentiate (zero for first dimension)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_

The dimension of the polynomial is preserved, even if the operation may cause the polynomial to become independent of the dimension dim of the variable.

The call requires n FLOPs, where n is the number of (non-zero) polynomial coefficients whose power in dimension dim is at least 1.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if dim is negative.
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if dim exceeds the dimension of self.

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_realloc().

Referenced by cpl_image_fill_jacobian_polynomial().

cpl_error_code cpl_polynomial_dump ( const cpl_polynomial *  p,
FILE *  stream 
)

Dump a cpl_polynomial as ASCII to a stream.

Parameters
pInput cpl_polynomial to dump
streamOutput stream, accepts stdout or stderr
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_

Each coefficient is preceded by its integer power(s) and written on a single line. If the polynomial has non-zero coefficients, only those are printed, otherwise the (zero-valued) constant term is printed.

Comment lines start with the hash character.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if the write operation fails

References cpl_ensure_code, CPL_ERROR_FILE_IO, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and CPL_SIZE_FORMAT.

cpl_polynomial* cpl_polynomial_duplicate ( const cpl_polynomial *  p)

This function duplicates an existing polynomial.

Parameters
pThe input cpl_polynomial
Returns
A newly allocated cpl_polynomial or NULL on error

Notice that the returned object is a newly allocated cpl_polynomial that must be deallocated by the caller using cpl_polynomial_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_malloc(), and cpl_polynomial_new().

Referenced by cpl_image_fill_jacobian_polynomial(), and cpl_polynomial_copy().

double cpl_polynomial_eval ( const cpl_polynomial *  p,
const cpl_vector *  x 
)

Evaluate the polynomial at the given point.

Parameters
pThe polynomial
xPoint of evaluation
Returns
The computed value or undefined on error.

The length of x must be the polynomial dimension.

A polynomial with no non-zero coefficients evaluates as 0.

If the classical evaluation method is used, the computational cost is:

For 1-dimensional polynomials the call requires 2n FLOPs where n+1 is the number of coefficients in p, see also cpl_polynomial_eval_1d().

For multivariate polynomials the call requires n*(1+dim) + d_1 + d_2 + ... + d_dim FLOPs, where dim is the dimension, n is the number of coefficients in p and d_i is the highest power used in dimension i, i = 1, 2, ..., dim.

If the Horner evaluation method is used the complexity has not been studied yet.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the length of x differs from the dimension of the polynomial

References cpl_ensure, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NULL_INPUT, cpl_polynomial_eval_1d(), cpl_vector_get(), and cpl_vector_get_size().

Referenced by cpl_image_fill_jacobian_polynomial(), and cpl_vector_fill_polynomial_fit_residual().

double cpl_polynomial_eval_1d ( const cpl_polynomial *  self,
double  x,
double *  pd 
)

Evaluate a univariate (1D) polynomial using Horners rule.

Parameters
selfThe 1D-polynomial
xThe point of evaluation
pdIff pd is non-NULL, the derivative evaluated at x
Returns
The result or undefined on error.

A polynomial with no non-zero coefficents evaluates to 0 with a derivative that does likewise.

The result is computed as p_0 + x * ( p_1 + x * ( p_2 + ... x * p_n )) and requires 2n FLOPs where n+1 is the number of coefficients.

If the derivative is requested it is computed using a nested Horner rule. This requires 4n FLOPs in total.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the polynomial is not (1D) univariate

References cpl_ensure, CPL_ERROR_INVALID_TYPE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_polynomial_eval(), cpl_vector_fill_polynomial(), and cpl_wlcalib_find_best_1d().

double cpl_polynomial_eval_1d_diff ( const cpl_polynomial *  self,
double  a,
double  b,
double *  ppa 
)

Evaluate p(a) - p(b) using Horners rule.

Parameters
selfThe 1D-polynomial
aThe evaluation point of the minuend
bThe evaluation point of the subtrahend
ppaIff ppa is not NULL, p(a)
Returns
The difference or undefined on error

The call requires about 4n FLOPs where n is the number of coefficients in self, which is the same as that required for two separate polynomial evaluations. cpl_polynomial_eval_1d_diff() is however more accurate.

ppa may be NULL. If it is not, *ppa is set to self(a), which is calculated at no extra cost.

The underlying algorithm is the same as that used in cpl_polynomial_eval_1d() when the derivative is also requested.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the polynomial has the wrong dimension

References cpl_ensure, CPL_ERROR_INVALID_TYPE, and CPL_ERROR_NULL_INPUT.

cpl_polynomial* cpl_polynomial_extract ( const cpl_polynomial *  self,
cpl_size  dim,
const cpl_polynomial *  other 
)

Collapse one dimension of a multi-variate polynomial by composition.

Parameters
selfThe multi-variate polynomial
dimThe dimension to collapse (zero for first dimension)
otherThe polynomial to replace dimension dim of self
Returns
The collapsed polynomial or NULL on error

The dimension of the polynomial self must be one greater than that of the other polynomial. Given these two polynomials the dimension dim of self is collapsed by creating a new polynomial from self(x0, x1, ..., x{dim-1}, other(x0, x1, ..., x{dim-1}, x{dim+1}, x{dim+2}, ..., x{n-1}), x{dim+1}, x{dim+2}, ..., x{n-1}).

The created polynomial thus has a dimension which is one less than the polynomial self and which is equal to that of the other polynomial. Collapsing one dimension of a 1D-polynomial is equivalent to evaluating it, which can be done with cpl_polynomial_eval_1d().

FIXME: The other polynomial must currently have a degree of zero, i.e. it must be a constant.

Currently, the call requires dn + p FLOPs, where d the dimension of the polynomial self, p is the largest power of dimension dim and n the number of (non-zero) coefficients of the polynomial self.

The returned object is a newly allocated cpl_polynomial that must be deallocated by the caller using cpl_polynomial_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the polynomial is uni-variate.
  • CPL_ERROR_ILLEGAL_INPUT if dim is negative.
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if dim exceeds the dimension of self.
  • CPL_ERROR_INCOMPATIBLE_INPUT if other has the wrong dimension.
  • CPL_ERROR_UNSUPPORTED_MODE if other is not of degree 0.

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_free(), cpl_malloc(), cpl_polynomial_get_coeff(), cpl_polynomial_get_degree(), cpl_polynomial_new(), and cpl_polynomial_set_coeff().

cpl_error_code cpl_polynomial_fit ( cpl_polynomial *  self,
const cpl_matrix *  samppos,
const cpl_boolean *  sampsym,
const cpl_vector *  fitvals,
const cpl_vector *  fitsigm,
cpl_boolean  dimdeg,
const cpl_size mindeg,
const cpl_size maxdeg 
)

Fit a polynomial to a set of samples in a least squares sense.

Parameters
selfPolynomial of dimension d to hold the coefficients
sampposMatrix of p sample positions, with d rows and p columns
sampsymNULL, or d booleans, true iff the sampling is symmetric
fitvalsVector of the p values to fit
fitsigmUncertainties of the sampled values, or NULL for all ones
dimdegTrue iff there is a fitting degree per dimension
mindegPointer to 1 or d minimum fitting degree(s), or NULL
maxdegPointer to 1 or d maximum fitting degree(s), at least mindeg
Returns
CPL_ERROR_NONE on success, else the relevant _cpl_error_code_
Note
Currently only uni- and bi-variate polynomials are supported, fitsigm must be NULL. For all but uni-variate polynomials mindeg must be zero.
See also
cpl_vector_fill_polynomial_fit_residual()

Any pre-set non-zero coefficients in self are overwritten or reset by the fit.

For 1D-polynomials N = 1 + maxdeg - mindeg coefficients are fitted.

For multi-variate polynomials the fit depends on dimdeg:

If dimdeg is false, an n-degree coefficient is fitted iff mindeg <= n <= maxdeg. For a 2D-polynomial this means that N * (N + 1) / 2 coefficients are fitted.

If dimdeg is true, nci = 1 + maxdeg[i] + mindeg[i] coefficients are fitted for dimension i, i.e. for a 2D-polynomial N = nc1 * nc2 coefficients are fitted.

The number of distinct samples should exceed the number of coefficients to fit. The number of distinct samples may also equal the number of coefficients to fit, but in this case the fit has another meaning (any non-zero residual is due to rounding errors, not a fitting error). It is an error to try to fit more coefficients than there are distinct samples.

If the relative uncertainties of the sampled values are known, they may be passed via fitsigm. NULL means that all uncertainties equals one.

symsamp is ignored if mindeg is nonzero, otherwise the caller may use sampsym to indicate an a priori knowledge that the sampling positions are symmetric. NULL indicates no knowledge of such symmetry. sampsym[i] may be set to true iff the sampling is symmetric around u_i, where u_i is the mean of the sampling positions in dimension i.

In 1D this implies that the sampling points as pairs average u_0 (with an odd number of samples one sample must equal u_0). E.g. both x = (1, 2, 4, 6, 7) and x = (1, 6, 4, 2, 7) have sampling symmetry, while x = (1, 2, 4, 6) does not.

In 2D this implies that the sampling points are symmetric in the 2D-plane. For the first dimension sampling symmetry means that the sampling is line- symmetric around y = u_1, while for the second dimension, sampling symmetry implies line-symmetry around x = u_2. Point symmetry around (x,y) = (u_1, u_2) means that both sampsym[0] and sampsym[1] may be set to true.

Knowledge of symmetric sampling allows the fit to be both faster and eliminates certain round-off errors.

For higher order fitting the fitting problem known as "Runge's phenomenon" is minimized using the socalled "Chebyshev nodes" as sampling points. For Chebyshev nodes symsamp can be set to CPL_TRUE.

Warning: An increase in the polynomial degree will normally reduce the fitting error. However, due to rounding errors and the limited accuracy of the solver of the normal equations, an increase in the polynomial degree may at some point cause the fitting error to increase. In some cases this happens with an increase of the polynomial degree from 8 to 9.

The fit is done in the following steps: 1) If mindeg is zero, the sampling positions are first transformed into Xhat_i = X_i - mean(X_i), i=1, .., dimension. 2) The Vandermonde matrix is formed from Xhat. 3) The normal equations of the Vandermonde matrix is solved. 4) If mindeg is zero, the resulting polynomial in Xhat is transformed back to X.

For a univariate (1D) fit the call requires 6MN + N^3/3 + 7/2N^2 + O(M) FLOPs where M is the number of data points and where N is the number of polynomial coefficients to fit, N = 1 + maxdeg - mindeg.

For a bivariate fit the call requires MN^2 + N^3/3 + O(MN) FLOPs where M is the number of data points and where N is the number of polynomial coefficients to fit.

Examples of usage:

1 cpl_polynomial * fit1d = cpl_polynomial_new(1);
2 cpl_matrix * samppos1d = my_sampling_points_1d(); // 1-row matrix
3 cpl_vector * fitvals = my_sampling_values();
4 const cpl_boolean sampsym = CPL_TRUE;
5 const int maxdeg1d = 4; // Fit 5 coefficients
6 cpl_error_code error1d
7  = cpl_polynomial_fit(fit1d, samppos1d, &sampsym, fitvals, NULL,
8  CPL_FALSE, NULL, &maxdeg1d);
1 cpl_polynomial * fit2d = cpl_polynomial_new(2);
2 cpl_matrix * samppos2d = my_sampling_points_2d(); // 2-row matrix
3 cpl_vector * fitvals = my_sampling_values();
4 const int maxdeg2d[] = {2, 1}; // Fit 6 coefficients
5 cpl_error_code error2d
6  = cpl_polynomial_fit(fit2d, samppos2d, NULL, fitvals, NULL, CPL_FALSE,
7  NULL, maxdeg2d);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if a mindeg value is negative, or if a maxdeg value is less than the corresponding mindeg value.
  • CPL_ERROR_DATA_NOT_FOUND if the number of columns in samppos is less than the number of coefficients to be determined.
  • CPL_ERROR_INCOMPATIBLE_INPUT if samppos, fitvals or fitsigm have incompatible sizes, or if samppos, self or sampsym have incompatible sizes.
  • CPL_ERROR_SINGULAR_MATRIX if samppos contains too few distinct values
  • CPL_ERROR_DIVISION_BY_ZERO if an element in fitsigm is zero
  • CPL_ERROR_UNSUPPORTED_MODE if the polynomial dimension exceeds two, or if there is a non-zero value in the mindeg array.

References cpl_bivector_unwrap_vectors(), cpl_bivector_wrap_vectors(), cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_matrix_get_data(), cpl_matrix_get_ncol(), cpl_matrix_get_nrow(), cpl_polynomial_get_dimension(), CPL_SIZE_FORMAT, cpl_vector_get_size(), cpl_vector_unwrap(), and cpl_vector_wrap().

cpl_polynomial* cpl_polynomial_fit_1d_create ( const cpl_vector *  x_pos,
const cpl_vector *  values,
cpl_size  degree,
double *  mse 
)

Fit a 1D-polynomial to a 1D-signal in a least squares sense.

Parameters
x_posVector of positions of the signal to fit.
valuesVector of values of the signal to fit.
degreeNon-negative polynomial degree.
mseIff mse is not null, the mean squared error on success
Returns
The fitted polynomial or NULL on error
See also
cpl_polynomial_fit()
Deprecated:
Replace this call with cpl_polynomial_fit() and optionally cpl_vector_fill_polynomial_fit_residual().

References CPL_ERROR_NONE, cpl_polynomial_delete(), and cpl_polynomial_new().

cpl_polynomial* cpl_polynomial_fit_2d_create ( cpl_bivector *  xy_pos,
cpl_vector *  values,
cpl_size  degree,
double *  mse 
)

Fit a 2D-polynomial to a 2D-surface in a least squares sense.

Parameters
xy_posBivector positions of the surface to fit.
valuesVector of values of the surface to fit.
degreeNon-negative polynomial degree.
mseIff mse is not null, the mean squared error on success
Returns
The fitted polynomial or NULL on error
See also
cpl_polynomial_fit()
Deprecated:
Replace this call with cpl_polynomial_fit() and optionally cpl_vector_fill_polynomial_fit_residual().

References CPL_ERROR_NONE, cpl_polynomial_delete(), and cpl_polynomial_new().

double cpl_polynomial_get_coeff ( const cpl_polynomial *  in,
const cpl_size pows 
)

Get a coefficient of the polynomial.

Parameters
inthe input polynomial
powsthe powers of the different variables
Returns
The coefficient or undefined on error

The array pows must have the size of the polynomial dimension and have non-negative elements.

It is allowed to specify a (set of) power(s) for which no coefficient has previously been set. In this case the function returns zero.

Example of usage:

1 const cpl_size power = 3;
2 double coefficient = cpl_polynomial_get_coeff(poly1d, &power);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pows contains negative values

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_SIZE_FORMAT.

Referenced by cpl_polynomial_add(), cpl_polynomial_extract(), cpl_polynomial_multiply_scalar(), cpl_polynomial_shift_1d(), and cpl_polynomial_subtract().

cpl_size cpl_polynomial_get_degree ( const cpl_polynomial *  p)

The degree of the polynomial.

Parameters
pthe polynomial
Returns
The degree or negative on error

The degree is the highest sum of exponents (with a non-zero coefficient).

If there are no non-zero coefficients the degree is zero.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_polynomial_add(), cpl_polynomial_extract(), cpl_polynomial_multiply_scalar(), cpl_polynomial_shift_1d(), cpl_polynomial_subtract(), and cpl_wlcalib_find_best_1d().

cpl_size cpl_polynomial_get_dimension ( const cpl_polynomial *  p)

The dimension of the polynomial.

Parameters
pthe polynomial
Returns
The dimension or negative on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_image_fill_jacobian_polynomial(), cpl_image_fill_polynomial(), cpl_image_warp_polynomial(), cpl_polynomial_add(), cpl_polynomial_fit(), cpl_polynomial_multiply_scalar(), cpl_polynomial_shift_1d(), cpl_polynomial_subtract(), cpl_vector_fill_polynomial_fit_residual(), and cpl_wlcalib_find_best_1d().

cpl_error_code cpl_polynomial_multiply_scalar ( cpl_polynomial *  self,
const cpl_polynomial *  other,
double  factor 
)

Multiply a polynomial with a scalar.

Parameters
selfThe polynomial to hold the result
otherThe polynomial to scale, may equal self
factorThe factor to multiply with
Returns
CPL_ERROR_NONE or the relevant CPL error code

Possible CPL error code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_UNSUPPORTED_MODE if the dimension is not 1 (FIXME)

References cpl_ensure_code, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_polynomial_get_coeff(), cpl_polynomial_get_degree(), cpl_polynomial_get_dimension(), and cpl_polynomial_set_coeff().

cpl_polynomial* cpl_polynomial_new ( cpl_size  dim)

Create a new cpl_polynomial.

Parameters
dimThe positive polynomial dimension (number of variables)
Returns
1 newly allocated cpl_polynomial, or NULL on error

The returned object must be deallocated using cpl_polynomial_delete().

A newly created polynomial has degree 0 and evaluates as 0.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if dim is negative or zero

References cpl_calloc(), cpl_ensure, and CPL_ERROR_ILLEGAL_INPUT.

Referenced by cpl_polynomial_duplicate(), cpl_polynomial_extract(), cpl_polynomial_fit_1d_create(), cpl_polynomial_fit_2d_create(), cpl_polynomial_shift_1d(), cpl_ppm_match_points(), and cpl_wlcalib_find_best_1d().

cpl_error_code cpl_polynomial_set_coeff ( cpl_polynomial *  in,
const cpl_size pows,
double  c 
)

Set a coefficient of the polynomial.

Parameters
inthe input polynomial
powsthe powers of the different variables
cthe coefficient
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_

The array pows must have the size of the polynomial dimension and have non-negative elements.

If the coefficient is already there, it is overwritten, if not, a new coefficient is added to the polynomial. This may cause the degree of the polynomial to be increased.

Setting the coefficient of x1^4 * x3^2 in the 4-dimensional polynomial poly4d to 12.3 would be performed by:

1 const cpl_size pows[] = {4, 0, 2, 0};
2 cpl_error_code error = cpl_polynomial_set_coeff(poly4d, pows, 12.3);

Setting the coefficient of x^3 in the 1-dimensional polynomial poly1d to 12.3 would be performed by:

1 const cpl_size power = 3;
2 cpl_error_code error = cpl_polynomial_set_coeff(poly1d, &power, 12.3);

For efficiency reasons the coefficients of a 1D-polynomial are best inserted with that of the highest power first.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pows contains negative values

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_malloc(), and cpl_realloc().

Referenced by cpl_polynomial_add(), cpl_polynomial_extract(), cpl_polynomial_multiply_scalar(), cpl_polynomial_shift_1d(), and cpl_polynomial_subtract().

cpl_error_code cpl_polynomial_shift_1d ( cpl_polynomial *  p,
cpl_size  i,
double  u 
)

Modify p, p(x0, x1, ..., xi, ...) := (x0, x1, ..., xi+u, ...)

Parameters
pThe polynomial to be modified in place
iThe dimension to shift (0 for first)
uThe shift
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_
Note
Currently, only dimensions 1 and 2 are supported

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if i is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if i exceeds the dimension of p
  • CPL_ERROR_UNSUPPORTED_MODE if the polynomial has a dimension larger than 2

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_polynomial_delete(), cpl_polynomial_get_coeff(), cpl_polynomial_get_degree(), cpl_polynomial_get_dimension(), cpl_polynomial_new(), and cpl_polynomial_set_coeff().

Referenced by cpl_wlcalib_find_best_1d().

cpl_error_code cpl_polynomial_solve_1d ( const cpl_polynomial *  p,
double  x0,
double *  px,
cpl_size  mul 
)

A real solution to p(x) = 0 using Newton-Raphsons method.

Parameters
pThe 1D-polynomial
x0First guess of the solution
pxThe solution, on error see below
mulThe root multiplicity (or 1 if unknown)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_

Even if a real solution exists, it may not be found if the first guess is too far from the solution. But a solution is guaranteed to be found if all roots of p are real. If the constant term is zero, the solution 0 will be returned regardless of the first guess.

No solution is found when the iterative process stops because: 1) It can not proceed because p`(x) = 0 (CPL_ERROR_DIVISION_BY_ZERO). 2) Only a finite number of iterations are allowed (CPL_ERROR_CONTINUE). Both cases may be due to lack of a real solution or a bad first guess. In these two cases *px is set to the value where the error occurred. In case of other errors *px is unmodified.

The accuracy and robustness deteriorates with increasing multiplicity of the solution. This is also the case with numerical multiplicity, i.e. when multiple solutions are located close together.

mul is assumed to be the multiplicity of the solution. Knowledge of the root multiplicity often improves the robustness and accuracy. If there is no knowledge of the root multiplicity mul should be 1. Setting mul to a too high value should be avoided.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the polynomial has the wrong dimension
  • CPL_ERROR_ILLEGAL_INPUT if the multiplicity is non-positive
  • CPL_ERROR_DIVISION_BY_ZERO if a division by zero occurs
  • CPL_ERROR_CONTINUE if the algorithm does not converge

References CPL_ERROR_NONE.

cpl_error_code cpl_polynomial_subtract ( cpl_polynomial *  self,
const cpl_polynomial *  first,
const cpl_polynomial *  second 
)

Subtract two polynomials of the same dimension.

Parameters
selfThe polynomial to hold the result
firstThe polynomial to subtract from
secondThe polynomial to subtract
Returns
CPL_ERROR_NONE or the relevant CPL error code
Note
self may be passed also as first and/or second

Possible CPL error code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the polynomials do not have identical dimensions
  • CPL_ERROR_UNSUPPORTED_MODE if the dimension is not 1 (FIXME)

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_polynomial_get_coeff(), cpl_polynomial_get_degree(), cpl_polynomial_get_dimension(), and cpl_polynomial_set_coeff().

cpl_error_code cpl_vector_fill_polynomial ( cpl_vector *  v,
const cpl_polynomial *  p,
double  x0,
double  d 
)

Evaluate a 1D-polynomial on equidistant points using Horners rule.

Parameters
vPreallocated vector to contain the result
pThe 1D-polynomial
x0The first point of evaluation
dThe increment between points of evaluation
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_
See also
cpl_vector_fill

The evaluation points are x_i = x0 + i * d, i=0, 1, ..., n-1, where n is the length of the vector.

If d is zero it is preferable to simply use cpl_vector_fill(v, cpl_polynomial_eval_1d(p, x0, NULL)).

The call requires about 2nm FLOPs, where m+1 is the number of coefficients in p.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the polynomial has the wrong dimension

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_polynomial_eval_1d(), cpl_vector_get_data(), and cpl_vector_get_size().

cpl_error_code cpl_vector_fill_polynomial_fit_residual ( cpl_vector *  self,
const cpl_vector *  fitvals,
const cpl_vector *  fitsigm,
const cpl_polynomial *  fit,
const cpl_matrix *  samppos,
double *  rechisq 
)

Compute the residual of a polynomial fit.

Parameters
selfVector to hold the fitting residuals, fitvals may be used
fitvalsVector of the p fitted values
fitsigmUncertainties of the sampled values or NULL for a uniform uncertainty
fitThe fitted polynomial
sampposMatrix of p sample positions, with d rows and p columns
rechisqIf non-NULL, the reduced chi square of the fit
Returns
CPL_ERROR_NONE on success, else the relevant _cpl_error_code_
Note
If necessary, self is resized to the length of fitvals.
See also
cpl_polynomial_fit()

It is allowed to pass the same vector as both fitvals and as self, in which case fitvals is overwritten with the residuals.

If the relative uncertainties of the sampled values are known, they may be passed via fitsigm. NULL means that all uncertainties equal one. The uncertainties are taken into account when computing the reduced chi square value.

If rechisq is non-NULL, the reduced chi square of the fit is computed as well.

The mean square error, which was computed directly by the former CPL functions cpl_polynomial_fit_1d_create() and cpl_polynomial_fit_2d_create() can be computed from the fitting residual like this:

1 const double mse = cpl_vector_product(fitresidual, fitresidual)
2  / cpl_vector_get_size(fitresidual);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer (other than fitsigm) is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if samppos, fitvals, fitsigm or fit have incompatible sizes
  • CPL_ERROR_DIVISION_BY_ZERO if an element in fitsigm is zero
  • CPL_ERROR_DATA_NOT_FOUND if the number of columns in samppos is less than the number of coefficients in the fitted polynomial.

References cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_matrix_get(), cpl_matrix_get_ncol(), cpl_matrix_get_nrow(), cpl_polynomial_eval(), cpl_polynomial_get_dimension(), cpl_vector_delete(), cpl_vector_get(), cpl_vector_get_data(), cpl_vector_get_data_const(), cpl_vector_get_size(), cpl_vector_new(), cpl_vector_product(), and cpl_vector_set_size().

cpl-6.6.1/html/form_14.png0000644000460300003120000000047012553662436012152 00000000000000‰PNG  IHDR0gp ƒ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï§IDATxí]ƒ0 ƒ¿–¤¿ÀîÛ(‚´‰§=™ºRqœšp€?Ð ÀjO¨õ›%O ['˧^ÅÏâzŽù^/Ö)]¤Ú>ý¢¿–fƒmƒ=—òC÷·Þ3-¡ 2…æˆù4ئ‹Ì”UÏÞo4íÿÁާ‘4]Ëâ[ k;ïËÐWîØt‹åÆîuLAÛ yCŽ¥±î~3RoÜRóú†7õ¦Ÿ0…Û!IEND®B`‚cpl-6.6.1/html/group__cpl__type.html0000644000460300003120000011617712553662432014424 00000000000000 Common Pipeline Library Reference Manual: Type codes
Common Pipeline Library Reference Manual  6.6.1
Type codes

Functions

const char * cpl_type_get_name (cpl_type type)
 Get a string with the name of a type, e.g. "char", "int", "float". More...
 
size_t cpl_type_get_sizeof (cpl_type type)
 Compute the size of a type. More...
 
enum  _cpl_type_ {
  CPL_TYPE_FLAG_ARRAY,
  CPL_TYPE_INVALID,
  CPL_TYPE_CHAR,
  CPL_TYPE_UCHAR,
  CPL_TYPE_BOOL,
  CPL_TYPE_SHORT,
  CPL_TYPE_USHORT,
  CPL_TYPE_INT,
  CPL_TYPE_UINT,
  CPL_TYPE_LONG,
  CPL_TYPE_ULONG,
  CPL_TYPE_LONG_LONG,
  CPL_TYPE_SIZE,
  CPL_TYPE_FLOAT,
  CPL_TYPE_DOUBLE,
  CPL_TYPE_POINTER,
  CPL_TYPE_COMPLEX,
  CPL_TYPE_UNSPECIFIED,
  CPL_TYPE_BITMASK,
  CPL_TYPE_STRING,
  CPL_TYPE_FLOAT_COMPLEX,
  CPL_TYPE_DOUBLE_COMPLEX
}
 The CPL type codes and flags. More...
 
typedef enum _cpl_type_ cpl_type
 The type code type. More...
 
typedef long long cpl_size
 The type used for sizes and indices in CPL. More...
 
typedef uint64_t cpl_bitmask
 The CPL bitmask type for bitmask operations. More...
 
#define CPL_SIZE_MIN
 Minimum value a variable of type cpl_size can hold. More...
 
#define CPL_SIZE_MAX
 Maximum value a variable of type cpl_size can hold. More...
 
#define CPL_SIZE_FORMAT
 The format specifier for the type cpl_size. More...
 

Detailed Description

This module provides codes for the basic types (including char, int, float, etc.) used in CPL. These type codes may be used to indicate the type of a value stored in another object, the value of a property or the pixel of an image for instance. In addition, a utility function is provided to compute the size, which is required to store a value of the type indicated by a given type code.

The module

Synopsis
#include <cpl_type.h>

Macro Definition Documentation

#define CPL_SIZE_MAX

Maximum value a variable of type cpl_size can hold.

#define CPL_SIZE_MIN

Minimum value a variable of type cpl_size can hold.

Typedef Documentation

typedef uint64_t cpl_bitmask

The CPL bitmask type for bitmask operations.

Note
The CPL bitmask is currently used only for bit-wise operations on CPL images of integer pixel type, which are 32-bits wide. For forward compatibility the CPL bitmask is 64 bits wide, which is cast to 32 bits when used with a CPL_TYPE_INT.
static cpl_image cpl_size

The type used for sizes and indices in CPL.

typedef enum _cpl_type_ cpl_type

The type code type.

Enumeration Type Documentation

enum _cpl_type_

The CPL type codes and flags.

Enumerator
CPL_TYPE_FLAG_ARRAY 

Flag indicating whether a type is an array or a basic type.

CPL_TYPE_INVALID 

Invalid or undetermined type.

CPL_TYPE_CHAR 

Type code corresponding to type char.

CPL_TYPE_UCHAR 

Type code corresponding to type unsigned char.

CPL_TYPE_BOOL 

Type code corresponding to the boolean type.

CPL_TYPE_SHORT 

Type code corresponding to type short.

CPL_TYPE_USHORT 

Type code corresponding to type unsigned short.

CPL_TYPE_INT 

Type code corresponding to type int.

CPL_TYPE_UINT 

Type code corresponding to type unsigned int.

CPL_TYPE_LONG 

Type code corresponding to type long.

CPL_TYPE_ULONG 

Type code corresponding to type unsigned long.

CPL_TYPE_LONG_LONG 

Type code corresponding to type long long.

CPL_TYPE_SIZE 

Type code corresponding to type cpl_size

CPL_TYPE_FLOAT 

Type code corresponding to type float.

CPL_TYPE_DOUBLE 

Type code corresponding to type double.

CPL_TYPE_POINTER 

Type code corresponding to a pointer type.

CPL_TYPE_COMPLEX 

Type code corresponding to a complex type.

CPL_TYPE_UNSPECIFIED 

Type code to be used for inheritance of original FITS type.

CPL_TYPE_BITMASK 

Type code corresponding to type cpl_bitmask

CPL_TYPE_STRING 

Type code corresponding to a character array.

CPL_TYPE_FLOAT_COMPLEX 

Type code corresponding to type float complex.

CPL_TYPE_DOUBLE_COMPLEX 

Type code corresponding to type double complex.

Function Documentation

const char* cpl_type_get_name ( cpl_type  type)

Get a string with the name of a type, e.g. "char", "int", "float".

Parameters
typeType code to be evaluated.
Returns
A pointer to a string literal with the name or empty string on error.

References CPL_ERROR_INVALID_TYPE, CPL_TYPE_BOOL, CPL_TYPE_CHAR, CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLAG_ARRAY, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_INVALID, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, CPL_TYPE_POINTER, CPL_TYPE_SHORT, CPL_TYPE_STRING, CPL_TYPE_UCHAR, CPL_TYPE_UINT, CPL_TYPE_ULONG, CPL_TYPE_UNSPECIFIED, and CPL_TYPE_USHORT.

Referenced by cpl_fit_image_gaussian(), cpl_image_and(), cpl_image_and_scalar(), cpl_image_dump_structure(), cpl_image_exponential(), cpl_image_hypot(), cpl_image_logarithm(), cpl_image_not(), cpl_image_or(), cpl_image_or_scalar(), cpl_image_power(), cpl_image_xor(), cpl_image_xor_scalar(), cpl_parameter_get_bool(), cpl_parameter_get_default_bool(), cpl_parameter_get_default_double(), cpl_parameter_get_default_int(), cpl_parameter_get_default_string(), cpl_parameter_get_double(), cpl_parameter_get_enum_double(), cpl_parameter_get_enum_int(), cpl_parameter_get_enum_size(), cpl_parameter_get_enum_string(), cpl_parameter_get_int(), cpl_parameter_get_range_max_double(), cpl_parameter_get_range_max_int(), cpl_parameter_get_range_min_double(), cpl_parameter_get_range_min_int(), cpl_parameter_get_string(), cpl_parameter_new_enum(), cpl_parameter_new_range(), cpl_parameter_new_value(), cpl_parameter_set_bool(), cpl_parameter_set_default_bool(), cpl_parameter_set_default_double(), cpl_parameter_set_default_int(), cpl_parameter_set_default_string(), cpl_parameter_set_double(), cpl_parameter_set_int(), cpl_parameter_set_string(), cpl_propertylist_dump(), cpl_table_get(), cpl_table_get_complex(), and cpl_table_get_int().

size_t cpl_type_get_sizeof ( cpl_type  type)

Compute the size of a type.

Parameters
typeType code to be evaluated.
Returns
The size of the fundamental type, or 0 in case an invalid type code was given.

The function computes the atomic size of the type type. The result for fundamental types like CPL_TYPE_FLOAT is what you would expect from the C sizeof() operator. For arrays, i.e. types having the CPL_TYPE_FLAG_ARRAY set the returned size is not the size of a pointer to CPL_TYPE_FLOAT for instance, but the size of its fundamental type, i.e. the returned size is same as for the type CPL_TYPE_FLOAT.

Especially for the type CPL_TYPE_STRING, which is explicitly defined for convenience reasons, the size returned by this function is the size of CPL_TYPE_CHAR!

References CPL_TYPE_BOOL, CPL_TYPE_CHAR, CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLAG_ARRAY, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, CPL_TYPE_INVALID, CPL_TYPE_LONG, CPL_TYPE_LONG_LONG, CPL_TYPE_POINTER, CPL_TYPE_SHORT, CPL_TYPE_UCHAR, CPL_TYPE_UINT, CPL_TYPE_ULONG, CPL_TYPE_UNSPECIFIED, and CPL_TYPE_USHORT.

Referenced by cpl_fit_imagelist_polynomial_window(), cpl_image_and(), cpl_image_and_scalar(), cpl_image_copy(), cpl_image_duplicate(), cpl_image_filter(), cpl_image_filter_mask(), cpl_image_not(), cpl_image_or(), cpl_image_or_scalar(), cpl_image_shift(), cpl_image_xor(), cpl_image_xor_scalar(), cpl_property_new(), cpl_property_new_array(), and cpl_test_get_bytes_image().

cpl-6.6.1/html/folderopen.png0000644000460300003120000000112512553662426013035 00000000000000‰PNG  IHDRÚ}\ˆIDATxí]?oÓPÿ9iš4i°;ii“¶‰ZЉ‘‰ÀÀ7`bèÔÙ¬Øù,HìU'ô$*Tµ]‚T¡DPÚÄ6wÏ}‰;¡C; a¿ÓߟûÝïîž¼jAÀ­InSþ}€9H“ÓŽ|?íÁ÷ =_ÊÆŠ­†¥Àue*;¯YEäsYäæB¢Ÿ¿þÄ—£sÙ½½ÙŒ† É«›©ÀYÇq !GÇ¿v̇¹ÑØ®š °Œ‚ÔF¹}q¥b]÷7í·0)Úd›¾ÿð-èº}Pfä£ÖY{4™ÑÂ@}úæôñ2ÛüÔ—ñúåNŒI‚ÁǃcçÁº%£¬UаI³mc±ô˜å¼ÔÆüÈ>é¸xþt9Æ$µý OæVE*õU´Ì‚ç#ž×ˆ•ïûr@l$øPÿrHaaÇ¥ ²›dZ®rè‘ãqI„o¼øT\Ž,tªj2FAxv-LŸp׌p TÄI/ \¥sfí½; jViTƒèú¤o^cpÅü¼ûû»Ïb]”€¢¤<†aþÕœ²“ßÓ˜y“£§9:Œîù+À³€ñà,E žf³6éNˆÄE£KU}Ü^;¶ØnZ¢uß­US4— ѬëbížN¶.Úk¦ØjTÄöº%µªâ i¯VÄÊÝò§™ Èù¸)ùÿG€™òºJ@T x”IEND®B`‚cpl-6.6.1/html/form_17.png0000644000460300003120000000032612553662437012156 00000000000000‰PNG  IHDR a«¬Õ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïEIDATxíÁ À0 /6v ÁÉþÛöÑ8é«:8íðSë ²7«‘ú‚Ê„UZt4 Rˆ(ÂÜhîçâãc™ÛÙ7J, Ç61ÔIEND®B`‚cpl-6.6.1/html/group__cpl__detector.html0000644000460300003120000006022112553662432015240 00000000000000 Common Pipeline Library Reference Manual: High-level functions to compute detector features
Common Pipeline Library Reference Manual  6.6.1
High-level functions to compute detector features

Functions

cpl_error_code cpl_detector_interpolate_rejected (cpl_image *self)
 Interpolate any bad pixels in an image and delete the bad pixel map. More...
 
cpl_error_code cpl_flux_get_bias_window (const cpl_image *diff, const cpl_size *zone_def, cpl_size ron_hsize, cpl_size ron_nsamp, double *bias, double *error)
 Compute the bias in a rectangle. More...
 
cpl_error_code cpl_flux_get_noise_ring (const cpl_image *diff, const double *zone_def, cpl_size ron_hsize, cpl_size ron_nsamp, double *noise, double *error)
 Compute the readout noise in a ring. More...
 
cpl_error_code cpl_flux_get_noise_window (const cpl_image *diff, const cpl_size *zone_def, cpl_size ron_hsize, cpl_size ron_nsamp, double *noise, double *error)
 Compute the readout noise in a rectangle. More...
 

Detailed Description

Synopsis:
#include "cpl_detector.h"

Function Documentation

cpl_error_code cpl_detector_interpolate_rejected ( cpl_image *  self)

Interpolate any bad pixels in an image and delete the bad pixel map.

Parameters
selfThe image to clean
Returns
The _cpl_error_code_ or CPL_ERROR_NONE

The value of a bad pixel is interpolated from the good pixels among the 8 nearest. (If all but one of the eight neighboring pixels are bad, the interpolation becomes a nearest neighbor interpolation). For integer images the interpolation in done with floating-point and rounded to the nearest integer.

If there are pixels for which all of the eight neighboring pixels are bad, a subsequent interpolation pass is done, where the already interpolated pixels are included as source for the interpolation.

The interpolation passes are repeated until all bad pixels have been interpolated. In the worst case, all pixels will be interpolated from a single good pixel.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_DATA_NOT_FOUND if all pixels are bad

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_accept_all(), cpl_image_get_bpm_const(), cpl_image_get_data(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_mask_get_data_const(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, and CPL_TYPE_INT.

cpl_error_code cpl_flux_get_bias_window ( const cpl_image *  diff,
const cpl_size zone_def,
cpl_size  ron_hsize,
cpl_size  ron_nsamp,
double *  bias,
double *  error 
)

Compute the bias in a rectangle.

Parameters
diffInput image, usually a difference frame.
zone_defZone where the bias is to be computed.
ron_hsizeto specify half size of squares (<0 to use default)
ron_nsampto specify the nb of samples (<0 to use default)
biasOutput parameter: bias in the frame.
errorOutput parameter: error on the bias.
Returns
CPL_ERROR_NONE on success or the relevant _cpl_error_code_ on error
See also
cpl_flux_get_noise_window(), rand()
Note
No calls to srand() are made from CPL

References CPL_ERROR_NONE.

cpl_error_code cpl_flux_get_noise_ring ( const cpl_image *  diff,
const double *  zone_def,
cpl_size  ron_hsize,
cpl_size  ron_nsamp,
double *  noise,
double *  error 
)

Compute the readout noise in a ring.

Parameters
diffInput image, usually a difference frame.
zone_defZone where the readout noise is to be computed.
ron_hsizeto specify half size of squares (<0 to use default)
ron_nsampto specify the nb of samples (<0 to use default)
noiseOn success, *noise is the noise in the frame.
errorNULL, or on success, *error is the error in the noise
Returns
CPL_ERROR_NONE on success or the relevant _cpl_error_code_ on error
See also
cpl_flux_get_noise_window(), rand()
Note
No calls to srand() are made from CPL

The provided zone is an array of four integers specifying the zone to take into account for the computation. The integers specify a ring as x, y, r1, r2 where these coordinates are given in the FITS notation (x from 1 to nx, y from 1 to ny and bottom to top).

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if diff noise or zone_def is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the internal radius is bigger than the external one in zone_def
  • CPL_ERROR_DATA_NOT_FOUND if an insufficient number of samples were found inside the ring

References cpl_bivector_delete(), cpl_bivector_get_x_data_const(), cpl_bivector_get_y_data_const(), cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_errorstate_set(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_stdev_window(), CPL_SIZE_FORMAT, cpl_vector_delete(), cpl_vector_get_median(), cpl_vector_get_stdev(), cpl_vector_new(), cpl_vector_set(), cpl_vector_unwrap(), and cpl_vector_wrap().

cpl_error_code cpl_flux_get_noise_window ( const cpl_image *  diff,
const cpl_size zone_def,
cpl_size  ron_hsize,
cpl_size  ron_nsamp,
double *  noise,
double *  error 
)

Compute the readout noise in a rectangle.

Parameters
diffInput image, usually a difference frame.
zone_defZone where the readout noise is to be computed.
ron_hsizeto specify half size of squares (<0 to use default)
ron_nsampto specify the nb of samples (<0 to use default)
noiseOutput parameter: noise in the frame.
errorOutput parameter: error on the noise.
Returns
CPL_ERROR_NONE on success or the relevant _cpl_error_code_ on error
See also
rand()
Note
No calls to srand() are made from CPL

This function is meant to compute the readout noise in a frame by means of a MonteCarlo approach. The input is a frame, usually a difference between two frames taken with the same settings for the acquisition system, although no check is done on that, it is up to the caller to feed in the right kind of frame.

The provided zone is an array of four integers specifying the zone to take into account for the computation. The integers specify ranges as xmin, xmax, ymin, ymax, where these coordinates are given in the FITS notation (x from 1 to lx, y from 1 to ly and bottom to top). Specify NULL instead of an array of four values to use the whole frame in the computation.

The algorithm will create typically 100 9x9 windows on the frame, scattered optimally using a Poisson law. In each window, the standard deviation of all pixels in the window is computed and this value is stored. The readout noise is the median of all computed standard deviations, and the error is the standard deviation of the standard deviations.

Both noise and error are returned by modifying a passed double. If you do not care about the error, pass NULL.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if diff or noise is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the specified window (zone_def) is invalid

References CPL_ERROR_NONE.

cpl-6.6.1/html/form_10.png0000644000460300003120000000032212553662435012141 00000000000000‰PNG  IHDR U.T±0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïAIDATxíÁ À /!¡-E°ÿ¶-„ŠWG8É’ewø‹ºŠKT£Ù]fÏÐQý¤¶ÇÅÒ;5ñEª¥Óbß<'ÌÂ˜ŽºIEND®B`‚cpl-6.6.1/html/form_11.png0000644000460300003120000000044712553662436012153 00000000000000‰PNG  IHDR"D+]V0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ï–IDATxí]à ƒ?Â?âþ·]¨­&µo{´bZã€OðO&€wVð%9€†Œ òxÑ¨ÉØ®’bÖªÒ¦ÿH¤¦–ŽäµS‡¶Ñ[màãü¦&†¾v.-عBžuË¿.pÕGŸ1ÿ‰­Y× Ü+VJ;ç´ÑûžtKTsñól´ñO¹´·PÏÜ^(+Œ/ÈÎÒ/±eIEND®B`‚cpl-6.6.1/html/struct__cpl__framedata__.html0000644000460300003120000001565312553662432016052 00000000000000 Common Pipeline Library Reference Manual: _cpl_framedata_ Struct Reference
Common Pipeline Library Reference Manual  6.6.1
_cpl_framedata_ Struct Reference

The public frame data object. More...

Public Attributes

cpl_size max_count
 
cpl_size min_count
 
const char * tag
 

Detailed Description

The public frame data object.

The frame data object stores a frame identifier, the frame tag, and the minimum and maximum number of frames needed.

The data members of this structure are public to allow for a static initialization. Any other access of the public data members should still be done using the member functions.

Member Data Documentation

cpl_size _cpl_framedata_::max_count

The maximum number of frames of the kind given by the tag, the recipe requires in input. A value of -1 means that the maximum number of frames is unspecified.

Referenced by cpl_framedata_duplicate(), and cpl_recipeconfig_get_max_count().

cpl_size _cpl_framedata_::min_count

The minimum number of frames of the kind given by the tag, the recipe requires in input. A value of -1 means that the minimum number of frames is unspecified.

Referenced by cpl_framedata_duplicate(), cpl_recipeconfig_get_min_count(), and cpl_recipeconfig_is_required().

const char* _cpl_framedata_::tag

The frame tag. A unique string identifier for a particular kind of frame.

Referenced by cpl_framedata_duplicate(), cpl_recipeconfig_set_inputs(), and cpl_recipeconfig_set_tags().

cpl-6.6.1/html/struct__cpl__framedata__-members.html0000644000460300003120000000610512553662432017472 00000000000000 Common Pipeline Library Reference Manual: Member List
Common Pipeline Library Reference Manual  6.6.1
_cpl_framedata_ Member List

This is the complete list of members for _cpl_framedata_, including all inherited members.

max_count_cpl_framedata_
min_count_cpl_framedata_
tag_cpl_framedata_
cpl-6.6.1/html/dynsections.js0000644000460300003120000000610412553662426013074 00000000000000function toggleVisibility(linkObj) { var base = $(linkObj).attr('id'); var summary = $('#'+base+'-summary'); var content = $('#'+base+'-content'); var trigger = $('#'+base+'-trigger'); var src=$(trigger).attr('src'); if (content.is(':visible')===true) { content.hide(); summary.show(); $(linkObj).addClass('closed').removeClass('opened'); $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); } else { content.show(); summary.hide(); $(linkObj).removeClass('closed').addClass('opened'); $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); } return false; } function updateStripes() { $('table.directory tr'). removeClass('even').filter(':visible:even').addClass('even'); } function toggleLevel(level) { $('table.directory tr').each(function() { var l = this.id.split('_').length-1; var i = $('#img'+this.id.substring(3)); var a = $('#arr'+this.id.substring(3)); if (l5¡æ«ýg‹‚øꟶÂXì·½àJÚåå\uá«H+€îÛŽªÆÔ¿"åôë¹µé‚Æçdó\J÷‘ rI;ÓºÉÎC&V| à/ ú¦Ž éQ§º$»¶Äóšøp •¢œ®‘„¡¢»i@I.6¶i¦.2høö®Èb,iÀœ·W€[¨úý$njKK“ž lÛwe*€Pe>,ô¾@Jì’Le¹4+™ºÖÌÇ\õ·Œ©n¿È¥¾Àãš'q›Ø[˜§Ös]÷T˜ï.ÄíO9»dvéb…¹,+©v΢ ýRcÁâøÆ5‰ô~€¢¤qiŒ^´ZžsX °ƒïà&|Õ”`=a2942¯‹z!¾OOe:q8þÊÕ±}µrr"Ǫ}¹z¿Lœk_Ü €b4Tßã’ÛéàO¸”¬¸¦]{Øt&ÇYyÔnͼXŽK4«í[',ŽtÛvk¢Ÿ©aõ èŸ×ýZ¬ÄŽs¡N»Ù¯}ĸäê=Ͼ§Sþüý2o€[<áR»¸d©¬gUFÏSs·ú«JÒ™ÖýJW3äBLtÝŽ% ±:ƒó È5õxüܘ–\´îêצ{Rê°YÝcŠÓøâˆNзíë{Ûtœ75À=žp)î|-g•¼jçkV§÷­msSW¸ÅvI˜ÞbþS¶§kB¦NÏV²Í0s<© H ¶ËËæêßòkWÞ®zšDˆËàðEª/r©äMO¸4rö‘¦ÒÂ0ôdLÍÕXkƒÙ¿‹Z¨ãldz™3]5Ú·Vš„Õ÷&o%Ëqg‘Ÿ·Ø äâÝæÔãZY;ãߟ^6ž{—ˆ Õ$˜¯‘¶ÌJÛÀ5Æ@‹uP¯VÚ¬Â×!»·6N7Mhܾ»ç¨—„ª·¶šLJ×ÊûP%TzÛ• 1D¤b¯‚wfŽ;ñ¬~=~Æö5L7ù°¹}«»ÆQuN¯ÞfwÏ™(íþnemÊUg4p‡Ê¯ÕvÝÎ>A]À%övÒ:t# ªnl-ÂØÀŒµ5‹ÂœŽÝâ­ÌÎEWë3³unÆckmí96ý؇ãÇÔUÖJ–ãuC8tÆöhÃM•ëSó®äe“ÇdöA£I$ë 5:¥Ü²\¿¶«>@SäK7ˆÊr«ørhšå·ž 6…Ø×°õž¥‹YY7}l¯õ*¿¢[ßf\Æs×ã²M¨Æ­_îæry)†ÜF_âË ŒÚwž0FB>™Ì\Ê|Èüù¥pŽînà%p¡ÍI¯Íµ•­bï£Ë›[Ë´ô¶ùçoéª+SEÛ §d…-UéÜú^ËùW ±ßUás2¿øVÚ̺ŒTÙø†ÁK©OZwb:ΛגÐ_ã’qÉ-PM%÷ZË“­ ðQNÝ:€òkz¯Ô”Kò¯©ÙÊÎĸ2±ùÀ!DŒe²QÃñ.¡Z4™_üZÙìàוI¨¶oRœG4xìëåæ#f¹ÖÄ:1̦ÿú[\ª;¹U5Vjhµ­ê£þƒ\ÚKà®Mv ÝÔÛÔ""„¸³µHªhj›SÉüžçb†ïÍ;Ë%_òü¡Z® §”]êš‹1Æü),»ÜëÆ^ÐSÕ‹™f¸¤Œ1æœrÉcà—ÞÒT_É<ƒ0?mŒ1÷8å’1ÆÜã—žå²¼ã—dpGÌ^(glÛ¶¯^~t×uÝ‚7Q3:k}–­·£©ê%é5w%yø«–¼»®ëʱ˜u†K]×u÷XÍ~Ë¥%­výÓ병Gûé›0¿ºëºîg\zÖÿ5ÃåT2¿rY¥÷ˆKÞÒ)­KÒMÛe±…¿´ã´øÒ¼«_B–©êaîÌ¿µãj#®9yÓ8õö¯í8 Þ?Ýq›v=áR[™&ëLžÞjè¹”B½ßï÷üƒ/I±F½ÄÍTõZù—n›m’åÿ§¹$ÖÐtÊϲšê¿Á¥J>¯ž¸™MÛuÁÌ¥Ö(¥Ô –œ[­ÄYΌֶ n¸¤ÅÆNѨZJHžŠ\ ;à9V ØBr÷{Ê Ö-Õg\ !fw(€N‚&óû,—~×àüޏ…þ¤˜¤¹…°Cª f²- ¹uÛ®%zù›n6€=Œøë q"mlxù^rpÛÂ&Iç‡Æò‘u¦íKç÷Q.û Æð·ûL'Ÿ 9•ð2W«_[¨.&œØH¼+"sÓeK+×^’Âø²yrrš\ã^Þït~Ÿh1†øÈ:è`rÙ»pMn2÷hÚW¹ŒE Ú]È¡74'€ä^ÖÞ¼‹3òÞÙkg6œÌäz3[]Šù¤»àì-Ó‘½>1–¢ÊH àí ?ÊeߣHÈÜÆ¸…ÈPJ&oK6Îà€þƺζò8-¹Y'\j¬í<•Ä»FÍ'{÷š[íj‡óžM àˆ<‡ÈÓ]÷r\67@Éÿ|’Ë^9É8f5¢—Ô‹MmÎðŒKÚO²ÍØo•x5Õhærò\ªe"£‡·¸˜48ãÒY¡:yüªÐ³I‘%CAˆ\õZôòÈàìÕŸä²WŽÏŸØ\ð¦ý‡I;itƒü¹/¯™¿8áR§ëÊSén4qô»v¹Tµó5¿RâªQÉ5W˜gç·Éí›õ>·RU(¨õ Bä\°—¾6çƒt§&óA.ÃŽËMlY^ä÷Ðr¸¦ÂW·“†,ªzRÿÒŒ9·¥¦<—¤!flÇ÷p¹7£OR‘`¾/W¾äUèEK‹_fR3¾Yþ ¥UŽæMÑŠ“hÇÜJBèÌ*óGýŒµˆ%Ó½þTW¹È¡ 7ÌnÅñ¹™Ò-µÉqŠÕàÚJÃóhë,÷é³[¸¶ L-¦Q‡ɤW×8A‡ÐàÎ3EŸKÍr©*÷aƒêøˆ˜ÕUså«JÞmm“ó„ËÝpÀ‘¯E!^¡„8Ϲkº#o㔋«»¥™@¼ýœxG3J  ­öÜ5õ¤ðUò•|ù–Ož#Ê‹%Pv5ª¬/Iêt9 lŒ>4s”kªÒ×£Ú÷˜bhCk›87Sx¿53îÞ¸Ê?«rs*·%ù±Ê’ê8áÚ9_¯rùñŸÚÒe.SGrL®µyAbôIG ÐY#<¢Ó󆥡*û® ½LD¢*7(75ÂÇqëIJ\êå¿û] Áëb|ÕQµy ¦M¬âr"žÏY©q/Êy·”à í²õiù½ÉŒ¢@§¹ÈTçÑñžWQÚÆðvõùŠk½H01%?¤Us¦±DU²¸f¥UHV̼FÆŒM‹7¡%À-ÄÊò8íœ_¢‰ÀR¥NWŸ©«®Q °¹_sÞ ËK `‡!²æ5{íQfzi;@§¹ˆ? ‡8íapÉŠ»P­;ãÛBn‘ТóÑ[8@«np,2iΙjõF[Æ´É¡úÜÙ¶ðŠ(ƒz´ËÏCtg\ÌPûÒ•.rQÕ‘…îПy¸TžÁв’€º­.µý5më’öÚ À)6þ|AT€ >ìŸz®›lˆ“°®:üã>Á“\TFûÇÎD%¬ø>êàŠj¼´%lÑTrKàcT%TøÅ²w²ø“0.PùšJPC°nÑo6 À/.¡ã~è¾­n€¿ómQý·Ù ðÿ¯¸áZ€E+àê—K%Pqaýüà?ÄÿÊ¿W$ZÊc IEND®B`‚cpl-6.6.1/html/doc.png0000644000460300003120000000135212553662426011447 00000000000000‰PNG  IHDRÚ}\ˆ±IDATxíMOS[…Ÿžsúa?-XZ(PD4‚ AWbu`b 77wäHFÆCËÔÂÿà/`vo„ˆAPòq‹P @ ­ûÝè980 îà¤+»§Ýy×^ïZï9SW¹\83g‰3'°Nâçl¹¸_b¯p ïåûÆVÜÖ¡€Ÿ×"¬Ö†X€d]Ðà3“ÉÃÄÌ™xŸ ßMàœ[<çSPkvc—hÈ'…™˜^Åm™hØ7 `Û™¦ èÀåráq›‘œ¾!daeKŸþÆÕ˜:Ì*³_דâèi?I–eP*B7Ÿ¿åô!¹Ýgr6Ër6oKbëþãðôrI”ËTˆüªŒ¨xóö=›ù¢&‰(e+ßóÄkýÇ`ëÁÜb.“¸ÐW×w0¥°jÑzN™¬|©WEãµ¢a¯6[öX†AkÓù*/œ¨‰€ÉY­ ÿV’§–u²jÂ>1W *½·°PGŽzÿ¨/Eg{ ŸÇâaoŠÁVú:è¿™¤1$ôR§W,–ªà¨@ŠË56¾ÀÔÜ-¾,mê¸Î/æè¹– òr5¥T*S(Vf8ö9u’ Õ£w›ùóa=Í<{Ò¡UŒ÷r¯+ÉådDÏF$è°…£é¿`zþ»ÎúöN‘µÜ®0Q3£~_^Ëóâ¯N=ˆvpTà±LžT}ˆîkq†Òm<¼ÎÓ?Zh¿X£ï_þÝ¥[)ƒ `gêÃa_Ô*äÔ2`'=õ´Fÿ2EâÁPú ÷»›l=8‹Wv°%THqÉ¿<"¤ïG¾ÆxH{#ÆÖ«aÔJÕÞ‡—m‹„ çñKsÿàñVŠØ¡°·MâÒ^ TÁ– Ý›r¥ß½ømüÿ_™?ªWİ÷#uIEND®B`‚cpl-6.6.1/html/deprecated.html0000644000460300003120000004230712553662431013163 00000000000000 Common Pipeline Library Reference Manual: Deprecated List
Common Pipeline Library Reference Manual  6.6.1
Deprecated List
globalScope> Member cpl_apertures_get_fwhm (const cpl_image *self, const cpl_apertures *aperts)
Replace this call with a loop over cpl_image_get_fwhm()
globalScope> Member cpl_apertures_get_max_x (const cpl_apertures *self, cpl_size ind)
Replace this function with cpl_apertures_get_pos_x()
globalScope> Member cpl_apertures_get_max_y (const cpl_apertures *self, cpl_size ind)
Replace this function with cpl_apertures_get_pos_y()
globalScope> Member CPL_BPP_16_SIGNED
Use CPL_TYPE_SHORT
globalScope> Member CPL_BPP_16_UNSIGNED
Use CPL_TYPE_USHORT
globalScope> Member CPL_BPP_32_SIGNED
Use CPL_TYPE_INT
globalScope> Member CPL_BPP_8_UNSIGNED
Use CPL_TYPE_UCHAR
globalScope> Member CPL_BPP_IEEE_DOUBLE
Use CPL_TYPE_DOUBLE
globalScope> Member CPL_BPP_IEEE_FLOAT
Use CPL_TYPE_FLOAT
globalScope> Member cpl_fits_get_extension_nb (const char *filename, const char *extname)
Replace this call with cpl_fits_find_extension().
globalScope> Member cpl_fits_get_nb_extensions (const char *filename)
Replace this call with cpl_fits_count_extensions().
globalScope> Member cpl_frameset_get_first (cpl_frameset *self)
This function will be removed from CPL version 7. Code using these functions should be ported to make use of frame set iterators instead!
globalScope> Member cpl_frameset_get_first_const (const cpl_frameset *self)
This function will be removed from CPL version 7. Code using these functions should be ported to make use of frame set iterators instead!
globalScope> Member cpl_frameset_get_frame (cpl_frameset *set, cpl_size position)
This function will be removed from CPL version 7. Code using these functions should use cpl_frameset_get_position() instead!
globalScope> Member cpl_frameset_get_frame_const (const cpl_frameset *set, cpl_size position)
This function will be removed from CPL version 7. Code using these functions should use cpl_frameset_get_position_const() instead!
globalScope> Member cpl_frameset_get_next (cpl_frameset *self)
This function will be removed from CPL version 7. Code using these functions should be ported to make use of frame set iterators instead!
globalScope> Member cpl_frameset_get_next_const (const cpl_frameset *self)
This function will be removed from CPL version 7. Code using these functions should be ported to make use of frame set iterators instead!
globalScope> Member cpl_image_filter_linear (const cpl_image *in, const cpl_matrix *ker)
Replace this call with cpl_image_filter() using CPL_FILTER_LINEAR and CPL_BORDER_FILTER.
globalScope> Member cpl_image_filter_median (const cpl_image *in, const cpl_matrix *ker)
Replace this call with cpl_image_filter_mask() using CPL_FILTER_MEDIAN and CPL_BORDER_FILTER.
globalScope> Member cpl_image_filter_morpho (const cpl_image *in, const cpl_matrix *ker)
Replace this call with cpl_image_filter() using CPL_FILTER_MORPHO and CPL_BORDER_FILTER.
globalScope> Member cpl_image_filter_stdev (const cpl_image *in, const cpl_matrix *ker)
Replace this call with cpl_image_filter_mask() using CPL_FILTER_STDEV and CPL_BORDER_FILTER.
globalScope> Member cpl_image_fit_gaussian (const cpl_image *im, cpl_size xpos, cpl_size ypos, cpl_size size, double *norm, double *xcen, double *ycen, double *sig_x, double *sig_y, double *fwhm_x, double *fwhm_y)
If you need a 2D gaussian fit please use the function cpl_fit_image_gaussian(). Please note that on CPL versions earlier than 5.1.0 this function was wrongly documented: the parameters sig_x and sig_y were defined as "the sigma in x (or y) of the gaussian", while actually they returned the semi-major and semi-minor axes of the gaussian distribution at 1-sigma. PLEASE NOTE THAT IF YOU USED THIS FUNCTION FOR DETERMINING THE SPREAD OF A DISTRIBUTION ALONG THE X DIRECTION, THIS WAS VERY LIKELY OVERESTIMATED (because sig_x was always assigned the semi-major axis of the distribution ignoring the rotation), WHILE THE SPREAD ALONG THE Y DIRECTION WOULD BE UNDERESTIMATED. In addition to that, even with circular distributions this function may lead to an underestimation of sig_x and sig_y (up to 25% underestimation in the case of noiseless data with a box 4 times the sigma, 1% underestimation in the case of noiseless data with a box 7 times the sigma). This latter problem is related to the function cpl_image_iqe().
globalScope> Member cpl_mask_closing (cpl_mask *in, const cpl_matrix *ker)
Replace this call with cpl_mask_filter() using CPL_FILTER_CLOSING and CPL_BORDER_ZERO.
globalScope> Member cpl_mask_dilation (cpl_mask *in, const cpl_matrix *ker)
Replace this call with cpl_mask_filter() using CPL_FILTER_DILATION and CPL_BORDER_ZERO.
globalScope> Member cpl_mask_erosion (cpl_mask *in, const cpl_matrix *ker)
Replace this call with cpl_mask_filter() using CPL_FILTER_EROSION and CPL_BORDER_ZERO.
globalScope> Member cpl_mask_opening (cpl_mask *in, const cpl_matrix *ker)
Replace this call with cpl_mask_filter() using CPL_FILTER_OPENING and CPL_BORDER_ZERO.
globalScope> Member cpl_msg_progress (const char *component, int i, int iter, const char *format,...)
Use standard calls such as cpl_msg_info() instead.
globalScope> Member cpl_polynomial_fit_1d_create (const cpl_vector *x_pos, const cpl_vector *values, cpl_size degree, double *mse)
Replace this call with cpl_polynomial_fit() and optionally cpl_vector_fill_polynomial_fit_residual().
globalScope> Member cpl_polynomial_fit_2d_create (cpl_bivector *xy_pos, cpl_vector *values, cpl_size degree, double *mse)
Replace this call with cpl_polynomial_fit() and optionally cpl_vector_fill_polynomial_fit_residual().
globalScope> Member CPL_RECIPE_DEFINE (RECIPE_NAME, RECIPE_VERSION, RECIPE_FILL_PARAMS,RECIPE_AUTHOR, RECIPE_AUTHOR_EMAIL, RECIPE_YEAR,RECIPE_SYNOPSIS, RECIPE_DESCRIPTION)
Use cpl_recipe_define()
globalScope> Member cpl_table_get_column_name (const cpl_table *table)
This function is deprecated, because its usage could create serious problems in case it is attempted to get names from different tables simultaneously. For instance, a programmer may call cpl_table_get_column_name() in a loop, and in the same loop call a CPL function that calls as well the same function. The behaviour in this case would be unpredictable. The function cpl_table_get_column_names() should be used instead.
globalScope> Member cpl_test_memory_is_empty ()
Called by cpl_test_end()
globalScope> Member cpl_type_bpp
Use cpl_type
globalScope> Member cpl_vector_convolve_symmetric (cpl_vector *smoothed, const cpl_vector *conv_kernel)
Unstable API, may change or disappear. Do not use in new code!
globalScope> Member cpl_vector_new_lss_kernel (double slitw, double fwhm)
Unstable API, may change or disappear. Do not use in new code!
cpl-6.6.1/html/sync_on.png0000644000460300003120000000151512553662426012353 00000000000000‰PNG  IHDRàw=øIDATxíÝ_HTYÀñï8ã¤ó§i§4-g6ÆËÕ&kQ)¨Ô!Š0ÒURKÚ…„ê¡/»PEÁ>ìK-+KÁ²Ñ.Y”¾dEPaA‰ø°¥¶›ZSÓïÜ;3wºŠ–¯—߯gfîïœsçœWKÇñ.€ÉøD­¨a‘'¬âq_ôˆk¢ÀŒ ÀDŽøQ´ÄïC¨¶åñÏÿgÅ ñ 0„Y‚:qZ¦Á)~õâ€èLý0HVñ× žz-¿‰C“%¨g¦˜6€é8%Úõ¬ëwêÙUÏ¿˜ª³Ä }? ?€·3ÀÀž©Š À”K• @hà a±ðaÇæUe‹ sù~ë2²ì“&Ú&B*AÄljæºììi*˨,Ëçí»÷oÆ£T”,d[˜¼3-*ÁÀ…>å‡Ë çLÉŸçfk˜Ò éw#*AEjKUy>ûšËÉõ&{µ¢8—m5Ki¬ jjƒD*¿NŽÖigwÃ7Dª’mz骹úKÛ¾±ˆ¶M!æ¤ÍkÐ?šoý¬_åÓlXí#Ò~–¸¬ê×ÒÑXŠÓ‘ùRÙ*Eû‚ՂדðEÜ;6«e"Q(²Ù=–¿Ezæ5Kؼָ_ 1òzBªJë ±XŒì96åªjL^7{ùãJÑ÷1½i@%8'7M©_\Qœ#ÓUŒËñýÿyõ Wo Éx8¼s¥v¯ªì|×SnÜ q_m Ýé î>bèÕí[JX,½4[Tú{R£ë¼ôˆ¾þa€tÝjjzzÅ'ÅìȶiIžŽòwÏs ¡€—ÕKøõâC^ŽŒ˜Y­¨µÉ%6¨´êˆº]vÛðhâ½iWv–hôëê°Ò¨¾'æÌ‚·ñ|[ßìúÅ^€YrD=<ýDû]äÇ÷s€Ïõ‹8™ºCì? À ¨—t4õᩎ¡Jã‡W‹É± îr¼cjMɘìx| šE©øNÔ‰œøA¢þ«–€Z¼ñ‡jó î#™§¢¢4gIEND®B`‚cpl-6.6.1/html/form_24.png0000644000460300003120000000053212553662441012146 00000000000000‰PNG  IHDR4 Š^¡0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïÉIDATxíIrÅ D 1z¸ÿmÓÂþ•,“Mvm—-õ ¸À¿Á|B§ž¿EÍIû†ÒݼRk¢UU<Ê5oàm[¨¦•FÃÈ/ˆ4º¾Ž EyêÀNµ§3„´®Äp’IlaHx’×À$·ZT5a×›Oo‰„Ø&?ÊR )~ä¸Íj y—·t¤tZ[)Fg¹MÄÍ ó 9••sÌñž_‰ýŽ´#ãÏÏ‘2ÒšïHß«¯§1΄G²N‰áó4ÝK9€?â §S¥¨*’{IEND®B`‚cpl-6.6.1/html/group__cpl__plot.html0000644000460300003120000016173512553662431014420 00000000000000 Common Pipeline Library Reference Manual: Plotting of CPL objects
Common Pipeline Library Reference Manual  6.6.1
Plotting of CPL objects

Functions

cpl_error_code cpl_plot_bivector (const char *pre, const char *options, const char *post, const cpl_bivector *bivector)
 Plot a bivector. More...
 
cpl_error_code cpl_plot_bivectors (const char *pre, const char **options, const char *post, const cpl_bivector **bivectors, cpl_size nbvec)
 Plot an array of bivectors. More...
 
cpl_error_code cpl_plot_column (const char *pre, const char *options, const char *post, const cpl_table *tab, const char *xlab, const char *ylab)
 Plot a column of a table. More...
 
cpl_error_code cpl_plot_columns (const char *pre, const char *options, const char *post, const cpl_table *tab, const char **labels, cpl_size nlabels)
 Plot severals column of a table. More...
 
cpl_error_code cpl_plot_image (const char *pre, const char *options, const char *post, const cpl_image *image)
 Plot an image. More...
 
cpl_error_code cpl_plot_image_col (const char *pre, const char *options, const char *post, const cpl_image *image, cpl_size firstcol, cpl_size lastcol, cpl_size colstep)
 Plot a range of image columns. More...
 
cpl_error_code cpl_plot_image_row (const char *pre, const char *options, const char *post, const cpl_image *image, cpl_size firstrow, cpl_size lastrow, cpl_size rowstep)
 Plot a range of image rows. More...
 
cpl_error_code cpl_plot_mask (const char *pre, const char *options, const char *post, const cpl_mask *mask)
 Plot a mask. More...
 
cpl_error_code cpl_plot_vector (const char *pre, const char *options, const char *post, const cpl_vector *vector)
 Plot a vector. More...
 
cpl_error_code cpl_plot_vectors (const char *pre, const char *options, const char *post, const cpl_vector **vectors, cpl_size nvec)
 Plot an array of vectors. More...
 

Detailed Description

This module provides functions to plot basic CPL objects

This module is offered to help during the development process. The functions offered should NOT be used in any operational environment. For that reason, the support of those remains limited, and no functionality extension can be expected from the CPL team.

The created plot windows can be closed by pressing the 'q' key like you would do with a normal gnuplot window.

The default behaviour of the plotting is to use gnuplot (with option -persist). The user can control the actual plotting-command used to create the plot by setting the environment variable CPL_PLOTTER. Currently, if CPL_PLOTTER is set it must contain the string 'gnuplot'. Setting it to 'cat > my_gnuplot_$$.txt' causes a number of ASCII-files to be created, which each produce a plot when given as standard input to gnuplot.

A finer control of the plotting options can be obtained by writing an executable script, e.g. my_gnuplot, that executes gnuplot after setting the desired gnuplot options (e.g. set terminal pslatex color) and then setting CPL_PLOTTER to my_gnuplot.

Images can be plotted not only with gnuplot, but also using the pnm format. This is controlled with the environment variable CPL_IMAGER. If CPL_IMAGER is set to a string that does not contain the word gnuplot, the recipe will generate the plot in pnm format. E.g. setting CPL_IMAGER to 'display - &' will produce a gray-scale image using the image viewer display.

#include "cpl_plot.h"

Function Documentation

cpl_error_code cpl_plot_bivector ( const char *  pre,
const char *  options,
const char *  post,
const cpl_bivector *  bivector 
)

Plot a bivector.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
bivectorThe bivector to plot
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error

The bivector must have a positive number of elements.

See also
also cpl_mplot_open().

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References cpl_bivector_get_size(), cpl_bivector_get_x_data_const(), cpl_bivector_get_y_data_const(), CPL_ERROR_NONE, cpl_free(), CPL_SIZE_FORMAT, and cpl_sprintf().

Referenced by cpl_plot_column().

cpl_error_code cpl_plot_bivectors ( const char *  pre,
const char **  options,
const char *  post,
const cpl_bivector **  bivectors,
cpl_size  nbvec 
)

Plot an array of bivectors.

Parameters
preAn optional string with pre-plot commands
optionsArray of strings with plotting options
postAn optional string with post-plot commands
bivectorsThe bivectors array to plot
nbvecThe number of bivectors, at least one is required
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error

Each bivector in the array defines a sequence of points to be plotted. The bivectors can have different size.

The options array must be of same size as the bivectors array. The i'th string in the array specifies the plotting options for the i'th bivector.

See also
also cpl_mplot_open().

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_DATA_NOT_FOUND
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References cpl_bivector_get_size(), cpl_bivector_get_x_data_const(), cpl_bivector_get_y_data_const(), cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_FILE_IO, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_free(), cpl_malloc(), CPL_SIZE_FORMAT, and cpl_sprintf().

cpl_error_code cpl_plot_column ( const char *  pre,
const char *  options,
const char *  post,
const cpl_table *  tab,
const char *  xlab,
const char *  ylab 
)

Plot a column of a table.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
tabThe table to plot
xlabThe label of the column used in x
ylabThe label of the column used in y
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
See also
also cpl_mplot_open().

If xlab is NULL, the sequence number is used for X.

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_DATA_NOT_FOUND
  • CPL_ERROR_INVALID_TYPE
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References cpl_bivector_unwrap_vectors(), cpl_bivector_wrap_vectors(), cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_plot_bivector(), cpl_table_cast_column(), cpl_table_count_invalid(), cpl_table_delete(), cpl_table_duplicate_column(), cpl_table_erase_invalid(), cpl_table_get_column_type(), cpl_table_get_data_double(), cpl_table_get_data_double_const(), cpl_table_get_nrow(), cpl_table_has_column(), cpl_table_new(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT, cpl_vector_delete(), cpl_vector_duplicate(), cpl_vector_get_size(), cpl_vector_set(), cpl_vector_unwrap(), and cpl_vector_wrap().

cpl_error_code cpl_plot_columns ( const char *  pre,
const char *  options,
const char *  post,
const cpl_table *  tab,
const char **  labels,
cpl_size  nlabels 
)

Plot severals column of a table.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
tabThe table to plot
labelsThe labels of the columns
nlabelsThe number of labels
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error
See also
also cpl_mplot_open().

If xlab is NULL, the sequence number is used for X.

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_DATA_NOT_FOUND
  • CPL_ERROR_INVALID_TYPE
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_FILE_IO, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_free(), cpl_malloc(), CPL_SIZE_FORMAT, cpl_sprintf(), cpl_table_cast_column(), cpl_table_delete(), cpl_table_duplicate_column(), cpl_table_erase_column(), cpl_table_get_column_type(), cpl_table_get_data_double_const(), cpl_table_get_nrow(), cpl_table_has_column(), cpl_table_new(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, and CPL_TYPE_INT.

cpl_error_code cpl_plot_image ( const char *  pre,
const char *  options,
const char *  post,
const cpl_image *  image 
)

Plot an image.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
imageThe image to plot
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error

The image must have a positive number of pixels.

See also
also cpl_image_open().

If the specified plotting command does not contain the string 'gnuplot', the plotting command is assumed to be able to parse a pgm (P5) image from stdin. Valid examples of such a command may include 'cat > myplot$$.pgm' and 'display - &'.

The 'pre' and 'post' commands are ignored in PGM-plots, while the 'options' string is written as a comment in the header of the image.

See also cpl_plot_vector().

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References CPL_ERROR_NONE, cpl_free(), cpl_image_cast(), cpl_image_delete(), cpl_image_get_data_double(), cpl_image_get_data_double_const(), cpl_image_get_max(), cpl_image_get_min(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_image_multiply_scalar(), cpl_image_subtract_scalar(), cpl_image_subtract_scalar_create(), cpl_malloc(), CPL_SIZE_FORMAT, cpl_sprintf(), and CPL_TYPE_DOUBLE.

cpl_error_code cpl_plot_image_col ( const char *  pre,
const char *  options,
const char *  post,
const cpl_image *  image,
cpl_size  firstcol,
cpl_size  lastcol,
cpl_size  colstep 
)

Plot a range of image columns.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
imageThe image to plot
firstcolThe first column to plot (1 for first)
lastcolThe last column to plot
colstepThe positive column stride
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error

The image must have a positive number of pixels.

lastcol shall be greater than or equal to firstcol.

See also
also cpl_mplot_open().

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_ACCESS_OUT_OF_RANGE (firstcol or lastcol are out of range)
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_free(), cpl_image_cast(), cpl_image_delete(), cpl_image_get_data_double_const(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), CPL_SIZE_FORMAT, cpl_sprintf(), and CPL_TYPE_DOUBLE.

cpl_error_code cpl_plot_image_row ( const char *  pre,
const char *  options,
const char *  post,
const cpl_image *  image,
cpl_size  firstrow,
cpl_size  lastrow,
cpl_size  rowstep 
)

Plot a range of image rows.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
imageThe image to plot
firstrowThe first row to plot (1 for first)
lastrowThe last row to plot
rowstepThe positive row stride
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error

The image must have a positive number of pixels.

lastrow shall be greater than or equal to firstrow.

See also
also cpl_mplot_open().

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_ACCESS_OUT_OF_RANGE (firstrow or lastrow are out of range)
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_free(), cpl_image_cast(), cpl_image_delete(), cpl_image_get_data_double_const(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), CPL_SIZE_FORMAT, cpl_sprintf(), and CPL_TYPE_DOUBLE.

cpl_error_code cpl_plot_mask ( const char *  pre,
const char *  options,
const char *  post,
const cpl_mask *  mask 
)

Plot a mask.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
maskThe mask to plot
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error

If the specified plotting command does not contain the string 'gnuplot', the plotting command is assumed to be able to parse a pgm (P5) mask from stdin. Valid examples of such a command may include 'cat > myplot$$.pgm' and 'display - &'.

The 'pre' and 'post' commands are ignored in PGM-plots, while the 'options' string is written as a comment in the header of the mask.

See also cpl_plot_vector().

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References CPL_ERROR_NONE, cpl_free(), cpl_malloc(), cpl_mask_get_data_const(), cpl_mask_get_size_x(), cpl_mask_get_size_y(), CPL_SIZE_FORMAT, and cpl_sprintf().

cpl_error_code cpl_plot_vector ( const char *  pre,
const char *  options,
const char *  post,
const cpl_vector *  vector 
)

Plot a vector.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
vectorThe vector to plot
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error

The vector must have a positive number of elements.

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References CPL_ERROR_NONE, cpl_free(), CPL_SIZE_FORMAT, cpl_sprintf(), cpl_vector_get_data_const(), and cpl_vector_get_size().

cpl_error_code cpl_plot_vectors ( const char *  pre,
const char *  options,
const char *  post,
const cpl_vector **  vectors,
cpl_size  nvec 
)

Plot an array of vectors.

Parameters
preAn optional string with pre-plot commands
optionsAn optional string with plotting options
postAn optional string with post-plot commands
vectorsThe vectors array to plot
nvecThe number of vectors
Returns
CPL_ERROR_NONE or the relevant CPL_ERROR_# on error

The array should contain at least 3 vectors, the first one can be NULL.

The non-NULL vectors must have the same number of elements. The first vector gives the x-axis. If NULL, the index is used.

See also
also cpl_mplot_open().

Possible cpl_error_code set in this function:

  • CPL_ERROR_FILE_IO
  • CPL_ERROR_NULL_INPUT
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_UNSUPPORTED_MODE if plotting is unsupported on the specific run-time system.

References cpl_ensure_code, CPL_ERROR_FILE_IO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_free(), cpl_malloc(), CPL_SIZE_FORMAT, cpl_sprintf(), cpl_vector_get_data_const(), and cpl_vector_get_size().

cpl-6.6.1/html/group__cpl__image.html0000644000460300003120000223131612553662431014517 00000000000000 Common Pipeline Library Reference Manual: Images
Common Pipeline Library Reference Manual  6.6.1

Typedefs

typedef enum _cpl_value_ cpl_value
 The CPL special value. It is a bit field. More...
 

Enumerations

enum  _cpl_value_ {
  CPL_VALUE_NAN,
  CPL_VALUE_PLUSINF,
  CPL_VALUE_MINUSINF,
  CPL_VALUE_ZERO,
  CPL_VALUE_INF,
  CPL_VALUE_NOTFINITE
}
 The special values that can be rejected They are a bit-field and can be combined with bitwise or. More...
 

Functions

cpl_error_code cpl_image_abs (cpl_image *image)
 Take the absolute value of an image. More...
 
cpl_image * cpl_image_abs_create (const cpl_image *image_in)
 Take the absolute value of an image. More...
 
cpl_error_code cpl_image_accept (cpl_image *im, cpl_size x, cpl_size y)
 Set a pixel as good in an image. More...
 
cpl_error_code cpl_image_accept_all (cpl_image *self)
 Set all pixels in the image as good. More...
 
cpl_error_code cpl_image_add (cpl_image *im1, const cpl_image *im2)
 Add two images, store the result in the first image. More...
 
cpl_image * cpl_image_add_create (const cpl_image *image1, const cpl_image *image2)
 Add two images. More...
 
cpl_error_code cpl_image_add_scalar (cpl_image *self, double scalar)
 Elementwise addition of a scalar to an image. More...
 
cpl_image * cpl_image_add_scalar_create (const cpl_image *image, double addend)
 Create a new image by elementwise addition of a scalar to an image. More...
 
cpl_error_code cpl_image_and (cpl_image *self, const cpl_image *first, const cpl_image *second)
 The bit-wise and of two images with integer pixels. More...
 
cpl_error_code cpl_image_and_scalar (cpl_image *self, const cpl_image *first, cpl_bitmask second)
 The bit-wise and of a scalar and an image with integer pixels. More...
 
cpl_image * cpl_image_average_create (const cpl_image *image_1, const cpl_image *image_2)
 Build the average of two images. More...
 
cpl_image * cpl_image_cast (const cpl_image *self, cpl_type type)
 Convert a cpl_image to a given type. More...
 
cpl_image * cpl_image_collapse_create (const cpl_image *self, int direction)
 Collapse an image along its rows or columns. More...
 
cpl_image * cpl_image_collapse_median_create (const cpl_image *self, int direction, cpl_size drop_ll, cpl_size drop_ur)
 Collapse an image along its rows or columns, with filtering. More...
 
cpl_image * cpl_image_collapse_window_create (const cpl_image *self, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, int direction)
 Collapse an image region along its rows or columns. More...
 
cpl_error_code cpl_image_conjugate (cpl_image *self, const cpl_image *other)
 Complex conjugate the pixels in a complex image. More...
 
cpl_error_code cpl_image_copy (cpl_image *im1, const cpl_image *im2, cpl_size xpos, cpl_size ypos)
 Copy one image into another. More...
 
cpl_size cpl_image_count_rejected (const cpl_image *im)
 Count the number of bad pixels declared in an image. More...
 
void cpl_image_delete (cpl_image *d)
 Free memory associated to an cpl_image object. More...
 
cpl_error_code cpl_image_divide (cpl_image *im1, const cpl_image *im2)
 Divide two images, store the result in the first image. More...
 
cpl_image * cpl_image_divide_create (const cpl_image *image1, const cpl_image *image2)
 Divide two images. More...
 
cpl_error_code cpl_image_divide_scalar (cpl_image *self, double scalar)
 Elementwise division of an image with a scalar. More...
 
cpl_image * cpl_image_divide_scalar_create (const cpl_image *image, double divisor)
 Create a new image by elementwise division of an image with a scalar. More...
 
cpl_error_code cpl_image_dump_structure (const cpl_image *self, FILE *stream)
 Dump structural information of a CPL image. More...
 
cpl_error_code cpl_image_dump_window (const cpl_image *self, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, FILE *stream)
 Dump pixel values in a CPL image. More...
 
cpl_image * cpl_image_duplicate (const cpl_image *src)
 Copy an image. More...
 
cpl_error_code cpl_image_exponential (cpl_image *self, double base)
 Compute the elementwise exponential of the image. More...
 
cpl_image * cpl_image_exponential_create (const cpl_image *image, double base)
 Create a new image by elementwise exponentiation of an image. More...
 
cpl_image * cpl_image_extract (const cpl_image *in, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Extract a rectangular zone from an image into another image. More...
 
cpl_image * cpl_image_extract_subsample (const cpl_image *image, cpl_size xstep, cpl_size ystep)
 Sub-sample an image. More...
 
cpl_error_code cpl_image_fft (cpl_image *img_real, cpl_image *img_imag, unsigned mode)
 Fast Fourier Transform a square, power-of-two sized image. More...
 
cpl_error_code cpl_image_fill_abs_arg (cpl_image *im_abs, cpl_image *im_arg, const cpl_image *self)
 Split a complex image into its absolute and argument part(s) More...
 
cpl_error_code cpl_image_fill_gaussian (cpl_image *ima, double xcen, double ycen, double norm, double sig_x, double sig_y)
 Generate an image from a 2d gaussian function. More...
 
cpl_error_code cpl_image_fill_jacobian (cpl_image *out, const cpl_image *deltax, const cpl_image *deltay)
 Compute area change ratio for a transformation map. More...
 
cpl_error_code cpl_image_fill_jacobian_polynomial (cpl_image *out, const cpl_polynomial *poly_x, const cpl_polynomial *poly_y)
 Compute area change ratio for a 2D polynomial transformation. More...
 
cpl_error_code cpl_image_fill_noise_uniform (cpl_image *ima, double min_pix, double max_pix)
 Generate an image with uniform random noise distribution. More...
 
cpl_error_code cpl_image_fill_polynomial (cpl_image *ima, const cpl_polynomial *poly, double startx, double stepx, double starty, double stepy)
 Generate an image from a 2d polynomial function. More...
 
cpl_error_code cpl_image_fill_re_im (cpl_image *im_real, cpl_image *im_imag, const cpl_image *self)
 Split a complex image into its real and/or imaginary part(s) More...
 
cpl_error_code cpl_image_fill_rejected (cpl_image *im, double a)
 Set the bad pixels in an image to a fixed value. More...
 
cpl_image * cpl_image_fill_test_create (cpl_size nx, cpl_size ny)
 Generate a test image with pixel type CPL_TYPE_DOUBLE. More...
 
cpl_error_code cpl_image_fill_window (cpl_image *self, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, double value)
 Fill an image window with a constant. More...
 
cpl_error_code cpl_image_filter (cpl_image *self, const cpl_image *other, const cpl_matrix *kernel, cpl_filter_mode filter, cpl_border_mode border)
 Filter an image using a floating-point kernel. More...
 
cpl_image * cpl_image_filter_linear (const cpl_image *in, const cpl_matrix *ker)
 Compute a linear filtering. More...
 
cpl_error_code cpl_image_filter_mask (cpl_image *self, const cpl_image *other, const cpl_mask *kernel, cpl_filter_mode filter, cpl_border_mode border)
 Filter an image using a binary kernel. More...
 
cpl_image * cpl_image_filter_median (const cpl_image *in, const cpl_matrix *ker)
 Apply a spatial median filter to an image. More...
 
cpl_image * cpl_image_filter_morpho (const cpl_image *in, const cpl_matrix *ker)
 Filter an image in spatial domain with a morpho kernel. More...
 
cpl_image * cpl_image_filter_stdev (const cpl_image *in, const cpl_matrix *ker)
 Standard deviation filter. More...
 
cpl_error_code cpl_image_fit_gaussian (const cpl_image *im, cpl_size xpos, cpl_size ypos, cpl_size size, double *norm, double *xcen, double *ycen, double *sig_x, double *sig_y, double *fwhm_x, double *fwhm_y)
 Apply a gaussian fit on an image sub window. More...
 
cpl_error_code cpl_image_flip (cpl_image *im, int angle)
 Flip an image on a given mirror line. More...
 
double cpl_image_get (const cpl_image *image, cpl_size xpos, cpl_size ypos, int *pis_rejected)
 Get the value of a pixel at a given position. More...
 
double cpl_image_get_absflux (const cpl_image *image)
 Computes the sum of absolute values over an image. More...
 
double cpl_image_get_absflux_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Computes the sum of absolute values over an image sub-window. More...
 
cpl_mask * cpl_image_get_bpm (cpl_image *img)
 Gets the bad pixels map. More...
 
const cpl_mask * cpl_image_get_bpm_const (const cpl_image *img)
 Gets the bad pixels map. More...
 
double cpl_image_get_centroid_x (const cpl_image *image)
 Computes the x centroid value over the whole image. More...
 
double cpl_image_get_centroid_x_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Computes the x centroid value over an image sub-window. More...
 
double cpl_image_get_centroid_y (const cpl_image *image)
 Computes the y centroid value over the whole image. More...
 
double cpl_image_get_centroid_y_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Computes the y centroid value over an image sub-window. More...
 
double complex cpl_image_get_complex (const cpl_image *image, cpl_size xpos, cpl_size ypos, int *pis_rejected)
 Get the value of a complex pixel at a given position. More...
 
void * cpl_image_get_data (cpl_image *img)
 Gets the pixel data. More...
 
const void * cpl_image_get_data_const (const cpl_image *img)
 Gets the pixel data. More...
 
double * cpl_image_get_data_double (cpl_image *img)
 Get the data as a double array. More...
 
double complex * cpl_image_get_data_double_complex (cpl_image *img)
 Get the data as a double complex array. More...
 
const double complex * cpl_image_get_data_double_complex_const (const cpl_image *img)
 Get the data as a double complex array. More...
 
const double * cpl_image_get_data_double_const (const cpl_image *img)
 Get the data as a double array. More...
 
float * cpl_image_get_data_float (cpl_image *img)
 Get the data as a float array. More...
 
float complex * cpl_image_get_data_float_complex (cpl_image *img)
 Get the data as a float complex array. More...
 
const float complex * cpl_image_get_data_float_complex_const (const cpl_image *img)
 Get the data as a float complex array. More...
 
const float * cpl_image_get_data_float_const (const cpl_image *img)
 Get the data as a float array. More...
 
int * cpl_image_get_data_int (cpl_image *img)
 Get the data as a integer array. More...
 
const int * cpl_image_get_data_int_const (const cpl_image *img)
 Get the data as a integer array. More...
 
double cpl_image_get_flux (const cpl_image *image)
 Computes the sum of pixel values over an image. More...
 
double cpl_image_get_flux_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Computes the sum of pixel values over an image sub-window. More...
 
cpl_error_code cpl_image_get_fwhm (const cpl_image *in, cpl_size xpos, cpl_size ypos, double *fwhm_x, double *fwhm_y)
 Compute FWHM values in x and y for an object. More...
 
double cpl_image_get_interpolated (const cpl_image *source, double xpos, double ypos, const cpl_vector *xprofile, double xradius, const cpl_vector *yprofile, double yradius, double *pconfid)
 Interpolate a pixel. More...
 
double cpl_image_get_mad (const cpl_image *image, double *sigma)
 Computes median and median absolute deviation (MAD) on an image. More...
 
double cpl_image_get_mad_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, double *sigma)
 Computes median and median absolute deviation (MAD) on an image window. More...
 
double cpl_image_get_max (const cpl_image *image)
 computes maximum pixel value over an image. More...
 
double cpl_image_get_max_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 computes maximum pixel value over an image sub-window. More...
 
cpl_error_code cpl_image_get_maxpos (const cpl_image *image, cpl_size *px, cpl_size *py)
 Computes maximum pixel value and position over an image. More...
 
cpl_error_code cpl_image_get_maxpos_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, cpl_size *px, cpl_size *py)
 Computes maximum pixel value and position over an image sub window. More...
 
double cpl_image_get_mean (const cpl_image *image)
 computes mean pixel value over an image. More...
 
double cpl_image_get_mean_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 computes mean pixel value over an image sub-window. More...
 
double cpl_image_get_median (const cpl_image *image)
 computes median pixel value over an image. More...
 
double cpl_image_get_median_dev (const cpl_image *image, double *sigma)
 Computes median and mean absolute median deviation on an image window. More...
 
double cpl_image_get_median_dev_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, double *sigma)
 Computes median and mean absolute median deviation on an image window. More...
 
double cpl_image_get_median_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 computes median pixel value over an image sub-window. More...
 
double cpl_image_get_min (const cpl_image *image)
 computes minimum pixel value over an image. More...
 
double cpl_image_get_min_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 computes minimum pixel value over an image sub-window. More...
 
cpl_error_code cpl_image_get_minpos (const cpl_image *image, cpl_size *px, cpl_size *py)
 Computes minimum pixel value and position over an image. More...
 
cpl_error_code cpl_image_get_minpos_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury, cpl_size *px, cpl_size *py)
 Computes minimum pixel value and position over an image sub window. More...
 
cpl_size cpl_image_get_size_x (const cpl_image *img)
 Get the image x size. More...
 
cpl_size cpl_image_get_size_y (const cpl_image *img)
 Get the image y size. More...
 
double cpl_image_get_sqflux (const cpl_image *image)
 Computes the sum of squared values over an image. More...
 
double cpl_image_get_sqflux_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Computes the sum of squared values over an image sub-window. More...
 
double cpl_image_get_stdev (const cpl_image *image)
 computes pixel standard deviation over an image. More...
 
double cpl_image_get_stdev_window (const cpl_image *image, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 computes pixel standard deviation over an image sub-window. More...
 
cpl_type cpl_image_get_type (const cpl_image *img)
 Get the image type. More...
 
cpl_error_code cpl_image_hypot (cpl_image *self, const cpl_image *first, const cpl_image *second)
 The pixel-wise Euclidean distance function of the images. More...
 
cpl_bivector * cpl_image_iqe (const cpl_image *in, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Compute an image quality estimation for an object. More...
 
int cpl_image_is_rejected (const cpl_image *im, cpl_size x, cpl_size y)
 Test if a pixel is good or bad. More...
 
cpl_image * cpl_image_labelise_mask_create (const cpl_mask *in, cpl_size *nbobjs)
 Labelise a mask to differentiate different objects. More...
 
cpl_image * cpl_image_load (const char *filename, cpl_type im_type, cpl_size pnum, cpl_size xtnum)
 Load an image from a FITS file. More...
 
cpl_image * cpl_image_load_window (const char *filename, cpl_type im_type, cpl_size pnum, cpl_size xtnum, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Load an image from a FITS file. More...
 
cpl_error_code cpl_image_logarithm (cpl_image *self, double base)
 Compute the elementwise logarithm of the image. More...
 
cpl_image * cpl_image_logarithm_create (const cpl_image *image, double base)
 Create a new image by taking the elementwise logarithm of an image. More...
 
cpl_error_code cpl_image_move (cpl_image *im, cpl_size nb_cut, const cpl_size *new_pos)
 Reorganize the pixels in an image. More...
 
cpl_error_code cpl_image_multiply (cpl_image *im1, const cpl_image *im2)
 Multiply two images, store the result in the first image. More...
 
cpl_image * cpl_image_multiply_create (const cpl_image *image1, const cpl_image *image2)
 Multiply two images. More...
 
cpl_error_code cpl_image_multiply_scalar (cpl_image *self, double scalar)
 Elementwise multiplication of an image with a scalar. More...
 
cpl_image * cpl_image_multiply_scalar_create (const cpl_image *image, double factor)
 Create a new image by multiplication of a scalar and an image. More...
 
cpl_image * cpl_image_new (cpl_size nx, cpl_size ny, cpl_type type)
 Allocate an image structure and pixel buffer for a image. More...
 
cpl_image * cpl_image_new_from_mask (const cpl_mask *mask)
 Create an int image from a mask. More...
 
cpl_error_code cpl_image_normalise (cpl_image *image, cpl_norm mode)
 Normalise pixels in an image. More...
 
cpl_image * cpl_image_normalise_create (const cpl_image *image_in, cpl_norm mode)
 Create a new normalised image from an existing image. More...
 
cpl_error_code cpl_image_not (cpl_image *self, const cpl_image *first)
 The bit-wise complement (not) of an image with integer pixels. More...
 
cpl_error_code cpl_image_or (cpl_image *self, const cpl_image *first, const cpl_image *second)
 The bit-wise or of two images with integer pixels. More...
 
void cpl_image_or_mask (cpl_image *self, const cpl_image *first, const cpl_image *second)
 The bit-wise or of the input masks onto the output mask. More...
 
void cpl_image_or_mask_unary (cpl_image *self, const cpl_image *first)
 The bit-wise or of the input mask(s) onto the output mask. More...
 
cpl_error_code cpl_image_or_scalar (cpl_image *self, const cpl_image *first, cpl_bitmask second)
 The bit-wise or of a scalar and an image with integer pixels. More...
 
cpl_error_code cpl_image_power (cpl_image *self, double exponent)
 Compute the elementwise power of the image. More...
 
cpl_image * cpl_image_power_create (const cpl_image *image, double exponent)
 Create a new image by elementwise raising of an image to a power. More...
 
cpl_image * cpl_image_rebin (const cpl_image *image, cpl_size xstart, cpl_size ystart, cpl_size xstep, cpl_size ystep)
 Rebin an image. More...
 
cpl_error_code cpl_image_reject (cpl_image *im, cpl_size x, cpl_size y)
 Set a pixel as bad in an image. More...
 
cpl_error_code cpl_image_reject_from_mask (cpl_image *im, const cpl_mask *map)
 Set the bad pixels in an image as defined in a mask. More...
 
cpl_error_code cpl_image_reject_value (cpl_image *self, cpl_value mode)
 Reject pixels with the specified special value(s) More...
 
cpl_error_code cpl_image_save (const cpl_image *self, const char *filename, cpl_type type, const cpl_propertylist *pl, unsigned mode)
 Save an image to a FITS file. More...
 
cpl_error_code cpl_image_set (cpl_image *image, cpl_size xpos, cpl_size ypos, double value)
 Set the pixel at the given position to the given value. More...
 
cpl_mask * cpl_image_set_bpm (cpl_image *self, cpl_mask *bpm)
 Replace the bad pixel map of the image. More...
 
cpl_error_code cpl_image_set_complex (cpl_image *image, cpl_size xpos, cpl_size ypos, double complex value)
 Set the pixel at the given position to the given complex value. More...
 
cpl_error_code cpl_image_shift (cpl_image *self, cpl_size dx, cpl_size dy)
 Shift an image by integer offsets. More...
 
cpl_error_code cpl_image_subtract (cpl_image *im1, const cpl_image *im2)
 Subtract two images, store the result in the first image. More...
 
cpl_image * cpl_image_subtract_create (const cpl_image *image1, const cpl_image *image2)
 Subtract two images. More...
 
cpl_error_code cpl_image_subtract_scalar (cpl_image *self, double scalar)
 Elementwise subtraction of a scalar from an image. More...
 
cpl_image * cpl_image_subtract_scalar_create (const cpl_image *image, double subtrahend)
 Create an image by elementwise subtraction of a scalar from an image. More...
 
cpl_error_code cpl_image_threshold (cpl_image *image_in, double lo_cut, double hi_cut, double assign_lo_cut, double assign_hi_cut)
 Threshold an image to a given interval. More...
 
cpl_error_code cpl_image_turn (cpl_image *self, int rot)
 Rotate an image by a multiple of 90 degrees clockwise. More...
 
cpl_mask * cpl_image_unset_bpm (cpl_image *self)
 Remove the bad pixel map from the image. More...
 
void * cpl_image_unwrap (cpl_image *d)
 Free memory associated to an cpl_image object, but the pixel buffer. More...
 
cpl_error_code cpl_image_warp (cpl_image *out, const cpl_image *in, const cpl_image *deltax, const cpl_image *deltay, const cpl_vector *xprofile, double xradius, const cpl_vector *yprofile, double yradius)
 Warp an image. More...
 
cpl_error_code cpl_image_warp_polynomial (cpl_image *out, const cpl_image *in, const cpl_polynomial *poly_x, const cpl_polynomial *poly_y, const cpl_vector *xprofile, double xradius, const cpl_vector *yprofile, double yradius)
 Warp an image according to a 2D polynomial transformation. More...
 
cpl_image * cpl_image_wrap_double (cpl_size nx, cpl_size ny, double *pixels)
 Create a double image using an existing pixel buffer. More...
 
cpl_image * cpl_image_wrap_double_complex (cpl_size nx, cpl_size ny, double complex *pixels)
 Create a double complex image using an existing pixel buffer. More...
 
cpl_image * cpl_image_wrap_float (cpl_size nx, cpl_size ny, float *pixels)
 Create a float image using an existing pixel buffer. More...
 
cpl_image * cpl_image_wrap_float_complex (cpl_size nx, cpl_size ny, float complex *pixels)
 Create a float complex image using an existing pixel buffer. More...
 
cpl_image * cpl_image_wrap_int (cpl_size nx, cpl_size ny, int *pixels)
 Create an integer image using an existing pixel buffer. More...
 
cpl_error_code cpl_image_xor (cpl_image *self, const cpl_image *first, const cpl_image *second)
 The bit-wise xor of two images with integer pixels. More...
 
cpl_error_code cpl_image_xor_scalar (cpl_image *self, const cpl_image *first, cpl_bitmask second)
 The bit-wise xor of a scalar and an image with integer pixels. More...
 
cpl_vector * cpl_vector_new_from_image_column (const cpl_image *image_in, cpl_size pos)
 Extract a column from an image. More...
 
cpl_vector * cpl_vector_new_from_image_row (const cpl_image *image_in, cpl_size pos)
 Extract a row from an image. More...
 

Detailed Description

This module provides functions to create, use, and destroy a cpl_image. A cpl_image is a 2-dimensional data structure with a pixel type (one of CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT_COMPLEX or CPL_TYPE_DOUBLE_COMPLEX) and an optional bad pixel map.

The pixel indexing follows the FITS convention in the sense that the lower left pixel in a CPL image has index (1, 1). The pixel buffer is stored row-wise so for optimum performance any pixel-wise access should be done likewise.

Functionality include: FITS I/O Image arithmetic, casting, extraction, thresholding, filtering, resampling Bad pixel handling Image statistics Generation of test images Special functions, such as the image quality estimator

Synopsis:
#include "cpl_image.h"

Usage: define the following preprocessor symbols as needed, then include this file

Typedef Documentation

typedef enum _cpl_value_ cpl_value

The CPL special value. It is a bit field.

Enumeration Type Documentation

The special values that can be rejected They are a bit-field and can be combined with bitwise or.

Enumerator
CPL_VALUE_NAN 

Not-a-Number (NaN)

CPL_VALUE_PLUSINF 

Plus Infinity

CPL_VALUE_MINUSINF 

Minus Infinity

CPL_VALUE_ZERO 

Zero

CPL_VALUE_INF 

Infinity with any sign

CPL_VALUE_NOTFINITE 

NaN or infinity with any sign

Function Documentation

cpl_error_code cpl_image_abs ( cpl_image *  image)

Take the absolute value of an image.

Parameters
imageImage to be modified in place
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error

Set each pixel to its absolute value.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_image_abs_create(), cpl_image_fill_jacobian(), and cpl_image_fill_jacobian_polynomial().

cpl_image* cpl_image_abs_create ( const cpl_image *  image_in)

Take the absolute value of an image.

Parameters
image_inImage operand.
Returns
1 newly allocated image or NULL on error
See also
cpl_image_abs

For each pixel, out = abs(in). The returned image must be deallocated using cpl_image_delete().

References cpl_ensure, cpl_error_get_code(), cpl_image_abs(), cpl_image_delete(), and cpl_image_duplicate().

cpl_error_code cpl_image_accept ( cpl_image *  im,
cpl_size  x,
cpl_size  y 
)

Set a pixel as good in an image.

Parameters
imthe input image
xthe x pixel position in the image (first pixel is 1)
ythe y pixel position in the image (first pixel is 1)
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the specified position is out of the image

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_mask_get_data().

Referenced by cpl_image_set(), and cpl_image_set_complex().

cpl_error_code cpl_image_accept_all ( cpl_image *  self)

Set all pixels in the image as good.

Parameters
selfthe input image
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References CPL_ERROR_NONE, cpl_image_unset_bpm(), and cpl_mask_delete().

Referenced by cpl_detector_interpolate_rejected(), cpl_geom_img_offset_saa(), and cpl_imagelist_collapse_create().

cpl_error_code cpl_image_add ( cpl_image *  im1,
const cpl_image *  im2 
)

Add two images, store the result in the first image.

Parameters
im1first operand.
im2second operand.
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

The first input image is modified to contain the result of the operation.

The bad pixel map of the first image becomes the union of the bad pixel maps of the input images.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the input images have different sizes
  • CPL_ERROR_TYPE_MISMATCH if the second input image has complex type while the first one does not

Referenced by cpl_image_fill_test_create(), and cpl_imagelist_collapse_create().

cpl_image* cpl_image_add_create ( const cpl_image *  image1,
const cpl_image *  image2 
)

Add two images.

Parameters
image1first operand
image2second operand
Returns
1 newly allocated image or NULL on error

Creates a new image, being the result of the operation, and returns it to the caller. The returned image must be deallocated using cpl_image_delete(). The function supports images with different types among CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. The returned image type is the one of the first passed image.

The bad pixels map of the result is the union of the bad pixels maps of the input images.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the input images have different sizes
  • CPL_ERROR_TYPE_MISMATCH if the second input image has complex type while the first one does not
cpl_error_code cpl_image_add_scalar ( cpl_image *  self,
double  scalar 
)

Elementwise addition of a scalar to an image.

Parameters
selfImage to be modified in place.
scalarNumber to add
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error

Modifies the image by adding a number to each of its pixels.

The operation is always performed in double precision, with a final cast of the result to the image pixel type.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_get_type().

Referenced by cpl_image_add_scalar_create(), cpl_image_new_from_accepted(), and cpl_imagelist_add_scalar().

cpl_image* cpl_image_add_scalar_create ( const cpl_image *  image,
double  addend 
)

Create a new image by elementwise addition of a scalar to an image.

Parameters
imageImage to add
addendNumber to add
Returns
1 newly allocated image or NULL in case of an error
See also
cpl_image_add_scalar

Creates a new image, being the result of the operation, and returns it to the caller. The returned image must be deallocated using cpl_image_delete(). The function supports images with different types among CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. The type of the created image is that of the passed image.

References cpl_ensure, cpl_error_get_code(), cpl_image_add_scalar(), cpl_image_delete(), and cpl_image_duplicate().

cpl_error_code cpl_image_and ( cpl_image *  self,
const cpl_image *  first,
const cpl_image *  second 
)

The bit-wise and of two images with integer pixels.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
secondSecond operand
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
Note
CPL_TYPE_INT is required
See also
cpl_mask_and() for the equivalent logical operation

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the images have different sizes
  • CPL_ERROR_INVALID_TYPE if the passed image type is as required

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), cpl_image_or_mask(), cpl_type_get_name(), cpl_type_get_sizeof(), and CPL_TYPE_INT.

cpl_error_code cpl_image_and_scalar ( cpl_image *  self,
const cpl_image *  first,
cpl_bitmask  second 
)

The bit-wise and of a scalar and an image with integer pixels.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
secondSecond operand (scalar)
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
Note
CPL_TYPE_INT is required

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the images have different sizes
  • CPL_ERROR_INVALID_TYPE if the passed image type is as required

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), cpl_image_or_mask_unary(), cpl_type_get_name(), cpl_type_get_sizeof(), and CPL_TYPE_INT.

cpl_image* cpl_image_average_create ( const cpl_image *  image_1,
const cpl_image *  image_2 
)

Build the average of two images.

Parameters
image_1First image operand.
image_2Second image operand.
Returns
1 newly allocated image or NULL on error

Builds the average of two images and returns a newly allocated image, to be deallocated using cpl_image_delete(). The average is arithmetic, i.e. outpix=(pix1+pix2)/2 Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_mask_duplicate(), and cpl_mask_or().

cpl_image* cpl_image_cast ( const cpl_image *  self,
cpl_type  type 
)

Convert a cpl_image to a given type.

Parameters
selfThe image to convert
typeThe destination type
Returns
the newly allocated cpl_image or NULL on error

Casting to non-complex types is only supported for non-complex types.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the passed type is invalid
  • CPL_ERROR_TYPE_MISMATCH if the passed image type is complex and requested casting type is non-complex.
  • CPL_ERROR_INVALID_TYPE if the passed pixel type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_image_delete(), cpl_image_duplicate(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_malloc(), cpl_mask_duplicate(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, CPL_TYPE_INT, and CPL_TYPE_INVALID.

Referenced by cpl_apertures_new_from_image(), cpl_image_fit_gaussian(), cpl_imagelist_cast(), cpl_plot_image(), cpl_plot_image_col(), and cpl_plot_image_row().

cpl_image* cpl_image_collapse_create ( const cpl_image *  self,
int  direction 
)

Collapse an image along its rows or columns.

Parameters
selfInput image to collapse.
directionCollapsing direction.
Returns
1 newly allocated 1D image or NULL on error

On success the function returns a 1D image, created by adding up all pixels on the same row or column.

Collapse along y (sum of rows):

p7  p8  p9     Input image is a 3x3 image containing 9 pixels.
p4  p5  p6     The output is an image containing one row with
p1  p2  p3     3 pixels A, B, C, where:
----------

A   B   C      A = p1+p4+p7
               B = p2+p5+p8
               C = p3+p6+p9

If p7 is a bad pixel, A = (p1+p4)*3/2.
If p1, p4, p7 are bad, A is flagged as bad.

Provide the collapsing direction as an int. Give 0 to collapse along y (sum of rows) and get an image with a single row in output, or give 1 to collapse along x (sum of columns) to get an image with a single column in output. Only the good pixels are collapsed. Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The returned image must be deallocated using cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, cpl_error_get_code(), cpl_image_collapse_window_create(), cpl_image_get_size_x(), and cpl_image_get_size_y().

cpl_image* cpl_image_collapse_median_create ( const cpl_image *  self,
int  direction,
cpl_size  drop_ll,
cpl_size  drop_ur 
)

Collapse an image along its rows or columns, with filtering.

Parameters
selfInput image to collapse.
directionCollapsing direction.
drop_llIgnore this many lower rows/leftmost columns
drop_urIgnore this many upper rows/rightmost columns
Returns
1 newly allocated image having 1 row or 1 column or NULL on error
See also
cpl_image_collapse_create()

The collapsing direction is defined as for cpl_image_collapse_create(). For each output pixel, the median of the corresponding non-ignored pixels is computed. A combination of bad pixels and drop parameters can cause a median value in the output image to be undefined. Such pixels will be flagged as bad and set to zero.

If the output would contain only bad pixels an error is set.

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The returned image must be deallocated using cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if a rejection parameter is negative, or if the sum of ignored pixels is bigger than the image size in the collapsing direction
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_DATA_NOT_FOUND if the output image would have only bad pixels

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, and CPL_ERROR_NULL_INPUT.

cpl_image* cpl_image_collapse_window_create ( const cpl_image *  self,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
int  direction 
)

Collapse an image region along its rows or columns.

Parameters
selfImage to collapse.
llxlower left x coord.
llylower left y coord
urxupper right x coord
uryupper right y coord
directionCollapsing direction.
Returns
a newly allocated image or NULL on error
See also
cpl_image_collapse_create()

llx, lly, urx, ury are the image region coordinates in FITS convention. Those specified bounds are included in the collapsed region.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the specified window is not valid

References cpl_image_get_type(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, and CPL_TYPE_INT.

Referenced by cpl_image_collapse_create().

cpl_error_code cpl_image_conjugate ( cpl_image *  self,
const cpl_image *  other 
)

Complex conjugate the pixels in a complex image.

Parameters
selfPre-allocated complex image to hold the result
otherThe complex image to conjugate, may equal self
Returns
CPL_ERROR_NONE or _cpl_error_code_ on error
Note
The two images must match in size and precision

Any bad pixels are also conjugated.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT If an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT If the images have different sizes
  • CPL_ERROR_INVALID_TYPE If an input image is not of complex type
  • CPL_ERROR_TYPE_MISMATCH If the images have different precision

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, CPL_TYPE_DOUBLE_COMPLEX, and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_image_copy ( cpl_image *  im1,
const cpl_image *  im2,
cpl_size  xpos,
cpl_size  ypos 
)

Copy one image into another.

Parameters
im1the image in which im2 is inserted
im2the inserted image
xposthe x pixel position in im1 where the lower left pixel of im2 should go (from 1 to the x size of im1)
yposthe y pixel position in im1 where the lower left pixel of im2 should go (from 1 to the y size of im1)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error.
Note
The two pixel buffers may not overlap

(xpos, ypos) must be a valid position in im1. If im2 is bigger than the place left in im1, the part that falls outside of im1 is simply ignored, an no error is raised. The bad pixels are inherited from im2 in the concerned im1 zone.

The two input images must be of the same type, namely one of CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_TYPE_MISMATCH if the input images are of different types
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if xpos or ypos are outside the specified range

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_image_get_data(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_mask_copy(), cpl_mask_delete(), cpl_mask_new(), and cpl_type_get_sizeof().

Referenced by cpl_image_filter_mask().

cpl_size cpl_image_count_rejected ( const cpl_image *  im)

Count the number of bad pixels declared in an image.

Parameters
imthe input image
Returns
the number of bad pixels or -1 if the input image is NULL

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_mask_count().

Referenced by cpl_fit_image_gaussian().

cpl_error_code cpl_image_divide ( cpl_image *  im1,
const cpl_image *  im2 
)

Divide two images, store the result in the first image.

Parameters
im1first operand.
im2second operand.
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_add()
Note
The result of division with a zero-valued pixel is marked as a bad pixel.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the input images have different sizes
  • CPL_ERROR_TYPE_MISMATCH if the second input image has complex type while the first one does not
  • CPL_ERROR_DIVISION_BY_ZERO is all pixels in the divisor are zero

References cpl_ensure_code, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_mask_delete(), cpl_mask_duplicate(), cpl_mask_get_data(), cpl_mask_new(), cpl_mask_or(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, and CPL_TYPE_INT.

Referenced by cpl_imagelist_collapse_create().

cpl_image* cpl_image_divide_create ( const cpl_image *  image1,
const cpl_image *  image2 
)

Divide two images.

Parameters
image1first operand
image2second operand
Returns
1 newly allocated image or NULL on error
See also
cpl_image_add_create()
cpl_image_divide() The result of division with a zero-valued pixel is marked as a bad pixel.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the input images have different sizes
  • CPL_ERROR_TYPE_MISMATCH if the second input image has complex type while the first one does not
  • CPL_ERROR_DIVISION_BY_ZERO is all pixels in the divisor are zero

References cpl_ensure, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, cpl_free(), cpl_image_delete(), cpl_image_wrap_double(), cpl_image_wrap_double_complex(), cpl_image_wrap_float(), cpl_image_wrap_float_complex(), cpl_image_wrap_int(), cpl_malloc(), cpl_mask_delete(), cpl_mask_duplicate(), cpl_mask_get_data(), cpl_mask_new(), cpl_mask_or(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, and CPL_TYPE_INT.

cpl_error_code cpl_image_divide_scalar ( cpl_image *  self,
double  scalar 
)

Elementwise division of an image with a scalar.

Parameters
selfImage to be modified in place.
scalarNon-zero number to divide with
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_image_add_scalar()

Modifies the image by dividing each of its pixels with a number.

If the scalar is zero the image is not modified and an error is returned.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_DIVISION_BY_ZERO a division by 0 occurs

References cpl_ensure_code, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_get_type().

Referenced by cpl_image_divide_scalar_create(), cpl_image_fft(), cpl_image_normalise(), and cpl_imagelist_divide_scalar().

cpl_image* cpl_image_divide_scalar_create ( const cpl_image *  image,
double  divisor 
)

Create a new image by elementwise division of an image with a scalar.

Parameters
imageImage to divide
divisorNon-zero number to divide with
Returns
1 newly allocated image or NULL in case of an error
See also
cpl_image_divide_scalar
cpl_image_add_scalar_create

References cpl_ensure, cpl_error_get_code(), cpl_image_delete(), cpl_image_divide_scalar(), and cpl_image_duplicate().

cpl_error_code cpl_image_dump_structure ( const cpl_image *  self,
FILE *  stream 
)

Dump structural information of a CPL image.

Parameters
selfImage to dump
streamOutput stream, accepts stdout or stderr
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if a write operation fails

References cpl_ensure_code, CPL_ERROR_FILE_IO, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_mask_count(), CPL_SIZE_FORMAT, and cpl_type_get_name().

Referenced by cpl_imagelist_dump_structure().

cpl_error_code cpl_image_dump_window ( const cpl_image *  self,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
FILE *  stream 
)

Dump pixel values in a CPL image.

Parameters
selfImage to dump
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxSpecifies the window position
urySpecifies the window position
streamOutput stream, accepts stdout or stderr
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if a write operation fails
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the defined window is not in the image
  • CPL_ERROR_ILLEGAL_INPUT if the window definition is wrong (e.g llx > urx)

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_FILE_IO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get(), cpl_image_get_complex(), cpl_mask_get(), cpl_mask_is_empty(), CPL_SIZE_FORMAT, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT_COMPLEX, and CPL_TYPE_INT.

Referenced by cpl_imagelist_dump_window().

cpl_image* cpl_image_duplicate ( const cpl_image *  src)

Copy an image.

Parameters
srcSource image.
Returns
1 newly allocated image, or NULL on error.

Copy an image into a new image object. The pixels and the bad pixel map are also copied. The returned image must be deallocated using cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_malloc(), cpl_mask_duplicate(), and cpl_type_get_sizeof().

Referenced by cpl_apertures_new_from_image(), cpl_geom_img_offset_saa(), cpl_image_abs_create(), cpl_image_add_scalar_create(), cpl_image_cast(), cpl_image_divide_scalar_create(), cpl_image_exponential_create(), cpl_image_logarithm_create(), cpl_image_multiply_scalar_create(), cpl_image_normalise_create(), cpl_image_power_create(), cpl_image_subtract_scalar_create(), cpl_imagelist_collapse_create(), and cpl_imagelist_duplicate().

cpl_error_code cpl_image_exponential ( cpl_image *  self,
double  base 
)

Compute the elementwise exponential of the image.

Parameters
selfImage to be modified in place.
baseBase of the exponential.
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error

Modifies the image by computing the base-scalar exponential of each of its pixels.

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Pixels for which the power of the given base is not defined are rejected and set to zero.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, cpl_type_get_name(), and CPL_TYPE_INT.

Referenced by cpl_image_exponential_create(), and cpl_imagelist_exponential().

cpl_image* cpl_image_exponential_create ( const cpl_image *  image,
double  base 
)

Create a new image by elementwise exponentiation of an image.

Parameters
imageImage to exponentiate
baseBase of the exponential
Returns
1 newly allocated image or NULL in case of an error
See also
cpl_image_logarithm
cpl_image_add_scalar_create

References cpl_ensure, cpl_error_get_code(), cpl_image_delete(), cpl_image_duplicate(), and cpl_image_exponential().

cpl_image* cpl_image_extract ( const cpl_image *  in,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Extract a rectangular zone from an image into another image.

Parameters
inInput image
llxLower left X coordinate
llyLower left Y coordinate
urxUpper right X coordinate
uryUpper right Y coordinate
Returns
1 newly allocated image or NULL on error
Note
The returned image must be deallocated using cpl_image_delete()

The input coordinates define the extracted region by giving the coordinates of the lower left and upper right corners (inclusive).

Coordinates must be provided in the FITS convention: lower left corner of the image is at (1,1), x increasing from left to right, y increasing from bottom to top. Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the window coordinates are not valid
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, and cpl_mask_extract().

Referenced by cpl_apertures_extract_window(), cpl_fit_image_gaussian(), and cpl_image_iqe().

cpl_image* cpl_image_extract_subsample ( const cpl_image *  image,
cpl_size  xstep,
cpl_size  ystep 
)

Sub-sample an image.

Parameters
imageThe image to subsample
xstepTake every xstep pixel in x
ystepTake every ystep pixel in y
Returns
The newly allocated sub-sampled image or NULL in error case
See also
cpl_image_extract

step represents the sampling step in x and y: both steps = 2 will create an image with a quarter of the pixels of the input image.

image type can be CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. If the image has bad pixels, they will be resampled in the same way.

The returned image must be deallocated using cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if the input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if xstep, ystep are not positive
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, and cpl_mask_extract_subsample().

cpl_error_code cpl_image_fft ( cpl_image *  img_real,
cpl_image *  img_imag,
unsigned  mode 
)

Fast Fourier Transform a square, power-of-two sized image.

Parameters
img_realThe image real part to be transformed in place
img_imagThe image imaginary part to be transformed in place
modeThe desired FFT options (combined with bitwise or)
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

The input images must be of double type.

If the second passed image is NULL, the resulting imaginary part cannot be returned. This can be useful if the input is real and the output is known to also be real. But if the output has a significant imaginary part, you might want to pass a 0-valued image as the second parameter.

Any rejected pixel is used as if it were a good pixel.

The image must be square with a size that is a power of two.

These are the supported FFT modes: CPL_FFT_DEFAULT: Default, forward FFT transform CPL_FFT_INVERSE: Inverse FFT transform CPL_FFT_UNNORMALIZED: Do not normalize (with N*N for N-by-N image) on inverse. Has no effect on forward transform. CPL_FFT_SWAP_HALVES: Swap the four quadrants of the result image.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the image is not square or if the image size is not a power of 2.
  • CPL_ERROR_INVALID_TYPE if mode is 1, e.g. due to a logical or (||) of the allowed FFT options.
  • CPL_ERROR_UNSUPPORTED_MODE if mode is otherwise different from the allowed FFT options.
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_calloc(), cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_free(), cpl_image_divide_scalar(), cpl_image_move(), and CPL_TYPE_DOUBLE.

cpl_error_code cpl_image_fill_abs_arg ( cpl_image *  im_abs,
cpl_image *  im_arg,
const cpl_image *  self 
)

Split a complex image into its absolute and argument part(s)

Parameters
im_absPre-allocated image to hold the absolute part, or NULL
im_argPre-allocated image to hold the argument part, or NULL
selfComplex image to process
Returns
CPL_ERROR_NONE or _cpl_error_code_ on error
Note
At least one output image must be non-NULL. The images must match in size and precision

Any bad pixels are also processed.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT If the input image or both output images are NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT If the images have different sizes
  • CPL_ERROR_INVALID_TYPE If the input image is not of complex type
  • CPL_ERROR_TYPE_MISMATCH If the images have different precision

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_TYPE_COMPLEX, CPL_TYPE_DOUBLE_COMPLEX, and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_image_fill_gaussian ( cpl_image *  ima,
double  xcen,
double  ycen,
double  norm,
double  sig_x,
double  sig_y 
)

Generate an image from a 2d gaussian function.

Parameters
imathe gaussian image to generate
xcenx position of the center (1 for the first pixel)
yceny position of the center (1 for the first pixel)
normnorm of the gaussian.
sig_xSigma in x for the gaussian distribution.
sig_ySigma in y for the gaussian distribution.
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

This function expects an already allocated image. This function generates an image of a 2d gaussian. The gaussian is defined by the position of its centre, given in pixel coordinates inside the image with the FITS convention (x from 1 to nx, y from 1 to ny), its norm and the value of sigma in x and y.

f(x, y) = (norm/(2*pi*sig_x*sig_y)) * exp(-(x-xcen)^2/(2*sig_x^2)) * exp(-(y-ycen)^2/(2*sig_y^2))

The input image type can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_image_fill_test_create().

cpl_error_code cpl_image_fill_jacobian ( cpl_image *  out,
const cpl_image *  deltax,
const cpl_image *  deltay 
)

Compute area change ratio for a transformation map.

Parameters
outPre-allocated image to hold the result
deltaxThe x shifts for each pixel
deltayThe y shifts for each pixel
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_warp()

The shifts images deltax and deltay, describing the transformation, must be of type CPL_TYPE_DOUBLE and of the same size as out. For each pixel (u, v) of the out image, the deltax and deltay code the following transformation:

* u - deltax(u,v) = x
* v - deltay(u,v) = y
* 

This function writes the density of the (u, v) coordinate system relative to the (x, y) coordinates for each (u, v) pixel of image out.

This is trivially obtained by computing the absolute value of the determinant of the Jacobian of the transformation for each pixel of the (u, v) image out.

The partial derivatives are estimated at the position (u, v) in the following way:

* dx/du = 1 + 1/2 ( deltax(u-1, v) - deltax(u+1, v) )
* dx/dv =     1/2 ( deltax(u, v-1) - deltax(u, v+1) )
* dy/du =     1/2 ( deltay(u-1, v) - deltay(u+1, v) )
* dy/dv = 1 + 1/2 ( deltay(u, v-1) - deltay(u, v+1) )
* 

Typically this function would be used to determine a flux-conservation factor map for the target image specified in function cpl_image_warp(). For example,

* cpl_image_warp(out, in, deltax, deltay, xprof, xrad, yprof, yrad);
* correction_map = cpl_image_new(cpl_image_get_size_x(out),
*                                cpl_image_get_size_y(out),
*                                cpl_image_get_type(out));
* cpl_image_fill_jacobian(correction_map, deltax, deltay);
* out_flux_corrected = cpl_image_multiply_create(out, correction_map);
* 

where out_flux_corrected is the resampled image out after correction for flux conservation.

Note
The map produced by this function is not applicable for flux conservation in case the transformation implies severe undersampling of the original signal.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the polynomial dimensions are not 2
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, cpl_image_abs(), cpl_image_delete(), cpl_image_get_data_double(), cpl_image_get_data_double_const(), cpl_image_get_data_float(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_image_new(), CPL_TYPE_DOUBLE, and CPL_TYPE_FLOAT.

cpl_error_code cpl_image_fill_jacobian_polynomial ( cpl_image *  out,
const cpl_polynomial *  poly_x,
const cpl_polynomial *  poly_y 
)

Compute area change ratio for a 2D polynomial transformation.

Parameters
outPre-allocated image to hold the result
poly_xDefines source x-pos corresponding to destination (u,v).
poly_yDefines source y-pos corresponding to destination (u,v).
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_warp_polynomial()

Given an input image with pixel coordinates (x, y) which is mapped into an output image with pixel coordinates (u, v), and the polynomial inverse transformation (u, v) to (x, y) as in cpl_image_warp_polynomial(), this function writes the density of the (u, v) coordinate system relative to the (x, y) coordinates for each (u, v) pixel of image out.

This is trivially obtained by computing the absolute value of the determinant of the Jacobian of the transformation for each pixel of the (u, v) image out.

Typically this function would be used to determine a flux-conservation factor map for the target image specified in function cpl_image_warp_polynomial(). For example,

* cpl_image_warp_polynomial(out, in, poly_x, poly_y, xprof, xrad, yprof, yrad);
* correction_map = cpl_image_new(cpl_image_get_size_x(out),
*                                cpl_image_get_size_y(out),
*                                cpl_image_get_type(out));
* cpl_image_fill_jacobian_polynomial(correction_map, poly_x, poly_y);
* out_flux_corrected = cpl_image_multiply_create(out, correction_map);
* 

where out_flux_corrected is the resampled image out after correction for flux conservation.

Note
The map produced by this function is not applicable for flux conservation in case the transformation implies severe undersampling of the original signal.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the polynomial dimensions are not 2
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSPECIFIED, cpl_image_abs(), cpl_image_get_data_double(), cpl_image_get_data_float(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_polynomial_delete(), cpl_polynomial_derivative(), cpl_polynomial_duplicate(), cpl_polynomial_eval(), cpl_polynomial_get_dimension(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, cpl_vector_delete(), cpl_vector_get_data(), and cpl_vector_new().

cpl_error_code cpl_image_fill_noise_uniform ( cpl_image *  ima,
double  min_pix,
double  max_pix 
)

Generate an image with uniform random noise distribution.

Parameters
imathe image to generate
min_pixMinimum output pixel value.
max_pixMaximum output pixel value.
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

Generate an image with a uniform random noise distribution. Pixel values are within the provided bounds. This function expects an already allocated image. The input image type can be CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if min_pix is bigger than max_pix
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_image_fill_test_create().

cpl_error_code cpl_image_fill_polynomial ( cpl_image *  ima,
const cpl_polynomial *  poly,
double  startx,
double  stepx,
double  starty,
double  stepy 
)

Generate an image from a 2d polynomial function.

Parameters
imathe polynomial image to generate
polythe 2d polynomial
startxthe x value associated with the left pixels column
stepxthe x step
startythe y value associated with the bottom pixels row
stepythe y step
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

This function expects an already allocated image. The pixel value of the pixel (i, j) is set to poly(startx+(i-1)*stepx, starty+(j-1)*stepy).

The input image type can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

If you want to generate an image whose pixel values are the values of the polynomial applied to the pixel positions, just call cpl_image_fill_polynomial(ima, poly, 1.0, 1.0, 1.0, 1.0);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the polynomial's dimension is not 2
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_polynomial_get_dimension().

cpl_error_code cpl_image_fill_re_im ( cpl_image *  im_real,
cpl_image *  im_imag,
const cpl_image *  self 
)

Split a complex image into its real and/or imaginary part(s)

Parameters
im_realPre-allocated image to hold the real part, or NULL
im_imagPre-allocated image to hold the imaginary part, or NULL
selfComplex image to process
Returns
CPL_ERROR_NONE or _cpl_error_code_ on error
Note
At least one output image must be non-NULL. The images must match in size and precision

Any bad pixels are also processed.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT If the input image or both output images are NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT If the images have different sizes
  • CPL_ERROR_INVALID_TYPE If the input image is not of complex type
  • CPL_ERROR_TYPE_MISMATCH If the images have different precision

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_TYPE_COMPLEX, CPL_TYPE_DOUBLE_COMPLEX, and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_image_fill_rejected ( cpl_image *  im,
double  a 
)

Set the bad pixels in an image to a fixed value.

Parameters
imThe image to modify.
aThe fixed value
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT, CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT
  • CPL_ERROR_INVALID_TYPE if the image pixel type is not supported

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_mask_get_data(), and cpl_mask_is_empty().

Referenced by cpl_apertures_new_from_image(), cpl_geom_img_offset_saa(), and cpl_imagelist_collapse_create().

cpl_image* cpl_image_fill_test_create ( cpl_size  nx,
cpl_size  ny 
)

Generate a test image with pixel type CPL_TYPE_DOUBLE.

Parameters
nxx size
nyy size
Returns
1 newly allocated image or NULL on error

Generates a reference pattern for testing purposes only. The created image has to be deallocated with cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if nx or ny is non-positive

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, cpl_image_add(), cpl_image_delete(), cpl_image_fill_gaussian(), cpl_image_fill_noise_uniform(), cpl_image_multiply_scalar(), cpl_image_new(), and CPL_TYPE_DOUBLE.

cpl_error_code cpl_image_fill_window ( cpl_image *  self,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
double  value 
)

Fill an image window with a constant.

Parameters
selfThe image to fill
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxSpecifies the window position
urySpecifies the window position
valueThe value to fill with
Returns
The _cpl_error_code_ or CPL_ERROR_NONE
Note
Any bad pixels are accepted

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the specified window is not valid

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_set().

cpl_error_code cpl_image_filter ( cpl_image *  self,
const cpl_image *  other,
const cpl_matrix *  kernel,
cpl_filter_mode  filter,
cpl_border_mode  border 
)

Filter an image using a floating-point kernel.

Parameters
selfPre-allocated image to hold the filtered result
otherImage to filter
kernelPixel weigths
filterCPL_FILTER_LINEAR, CPL_FILTER_MORPHO
borderCPL_BORDER_FILTER
Returns
CPL_ERROR_NONE or the relevant CPL error code
See also
cpl_image_filter_mask

The two images must have equal dimensions.

The kernel must have an odd number of rows and an odd number of columns and at least one non-zero element.

For scaling filters (CPL_FILTER_LINEAR_SCALE and CPL_FILTER_MORPHO_SCALE) the flux of the filtered image will be scaled with the sum of the weights of the kernel. If for a given input pixel location the kernel covers only bad pixels, the filtered pixel value is flagged as bad and set to zero.

For flux-preserving filters (CPL_FILTER_LINEAR and CPL_FILTER_MORPHO) the filtered pixel must have at least one input pixel with a non-zero weight available. Output pixels where this is not the case are set to zero and flagged as bad.

In-place filtering is not supported.

Supported filters: CPL_FILTER_LINEAR, CPL_FILTER_MORPHO, CPL_FILTER_LINEAR_SCALE, CPL_FILTER_MORPHO_SCALE.

Supported borders modes: CPL_BORDER_FILTER

Example:
1 cpl_image_filter(filtered, raw, kernel, CPL_FILTER_LINEAR,
2  CPL_BORDER_FILTER);

Beware that the 1st pixel - at (1,1) - in an image is the lower left, while the 1st element in a matrix - at (0,0) - is the top left. Thus to shift an image 1 pixel up and 1 pixel right with the CPL_FILTER_LINEAR and a 3 by 3 kernel, one should set to 1.0 the bottom leftmost matrix element which is at row 3, column 1, i.e.

1 cpl_matrix_set(kernel, 2, 0);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL.
  • CPL_ERROR_ILLEGAL_INPUT if the kernel has a side of even length.
  • CPL_ERROR_DIVISION_BY_ZERO If the kernel is a zero-matrix.
  • CPL_ERROR_ACCESS_OUT_OF_RANGE If the kernel has a side longer than the input image.
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported.
  • CPL_ERROR_TYPE_MISMATCH if in median filtering the input and output pixel types differ.
  • CPL_ERROR_INCOMPATIBLE_INPUT If the input and output images have incompatible sizes.
  • CPL_ERROR_UNSUPPORTED_MODE If the output pixel buffer overlaps the input one (or the kernel), or the border/filter mode is unsupported.

References CPL_BORDER_CROP, CPL_BORDER_FILTER, cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_DIVISION_BY_ZERO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, CPL_FILTER_LINEAR, CPL_FILTER_LINEAR_SCALE, CPL_FILTER_MORPHO, CPL_FILTER_MORPHO_SCALE, cpl_image_get_data(), cpl_image_get_data_const(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_mask_get_data(), cpl_mask_get_data_const(), cpl_mask_is_empty(), cpl_mask_wrap(), cpl_matrix_get_data_const(), cpl_matrix_get_ncol(), cpl_matrix_get_nrow(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, cpl_type_get_sizeof(), and CPL_TYPE_INT.

Referenced by cpl_image_filter_linear(), and cpl_image_filter_morpho().

cpl_image* cpl_image_filter_linear ( const cpl_image *  in,
const cpl_matrix *  ker 
)

Compute a linear filtering.

Parameters
inThe image to filter
kerThe kernel
Returns
The filtered image or NULL on error
See also
cpl_image_filter()
Deprecated:
Replace this call with cpl_image_filter() using CPL_FILTER_LINEAR and CPL_BORDER_FILTER.

References CPL_BORDER_FILTER, cpl_ensure, CPL_ERROR_NULL_INPUT, CPL_FILTER_LINEAR, cpl_image_delete(), cpl_image_filter(), and cpl_image_new().

cpl_error_code cpl_image_filter_mask ( cpl_image *  self,
const cpl_image *  other,
const cpl_mask *  kernel,
cpl_filter_mode  filter,
cpl_border_mode  border 
)

Filter an image using a binary kernel.

Parameters
selfPre-allocated image to hold the filtered result
otherImage to filter
kernelPixels to use, if set to CPL_BINARY_1
filterCPL_FILTER_MEDIAN, CPL_FILTER_AVERAGE and more, see below
borderCPL_BORDER_FILTER and more, see below
Returns
CPL_ERROR_NONE or the relevant CPL error code

The kernel must have an odd number of rows and an odd number of columns.

The two images must have equal dimensions, except for the border mode CPL_BORDER_CROP, where the input image must have 2 * hx columns more and 2 * hy rows more than the output image, where the kernel has size (1 + 2 * hx, 1 + 2 * hy).

In standard deviation filtering the kernel must have at least two elements set to CPL_BINARY_1, for others at least one element must be set to CPL_BINARY_1.

Supported pixel types are: CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE.

In median filtering the two images must have the same pixel type.

In standard deviation filtering a filtered pixel must be computed from at least two input pixels, for other filters at least one input pixel must be available. Output pixels where this is not the case are set to zero and flagged as rejected.

In-place filtering is not supported.

Supported modes:

CPL_FILTER_MEDIAN: CPL_BORDER_FILTER, CPL_BORDER_COPY, CPL_BORDER_NOP, CPL_BORDER_CROP.

CPL_FILTER_AVERAGE: CPL_BORDER_FILTER

CPL_FILTER_AVERAGE_FAST: CPL_BORDER_FILTER

CPL_FILTER_STDEV: CPL_BORDER_FILTER

CPL_FILTER_STDEV_FAST: CPL_BORDER_FILTER

Example:
1 cpl_image_filter_mask(filtered, raw, kernel, CPL_FILTER_MEDIAN,
2  CPL_BORDER_FILTER);

To shift an image 1 pixel up and 1 pixel right with the CPL_FILTER_MEDIAN filter and a 3 by 3 kernel, one should set to CPL_BINARY_1 the bottom leftmost kernel element - at row 3, column 1, i.e.

1 cpl_mask * kernel = cpl_mask_new(3, 3);
2 cpl_mask_set(kernel, 1, 1);

The kernel required to do a 5 x 5 median filtering is created like this:

1 cpl_mask * kernel = cpl_mask_new(5, 5);
2 cpl_mask_not(kernel);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL.
  • CPL_ERROR_ILLEGAL_INPUT if the kernel has a side of even length.
  • CPL_ERROR_DATA_NOT_FOUND If the kernel is empty, or in case of CPL_FILTER_STDEV if the kernel has only one element set to CPL_BINARY_1.
  • CPL_ERROR_ACCESS_OUT_OF_RANGE If the kernel has a side longer than the input image.
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported.
  • CPL_ERROR_TYPE_MISMATCH if in median filtering the input and output pixel types differ.
  • CPL_ERROR_INCOMPATIBLE_INPUT If the input and output images have incompatible sizes.
  • CPL_ERROR_UNSUPPORTED_MODE If the output pixel buffer overlaps the input one (or the kernel), or the border/filter mode is unsupported.

References CPL_BORDER_CROP, CPL_BORDER_FILTER, cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_TYPE_MISMATCH, CPL_ERROR_UNSUPPORTED_MODE, CPL_FILTER_AVERAGE, CPL_FILTER_AVERAGE_FAST, CPL_FILTER_MEDIAN, CPL_FILTER_STDEV, CPL_FILTER_STDEV_FAST, cpl_image_copy(), cpl_image_get_data(), cpl_image_get_data_const(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_mask_get_data(), cpl_mask_get_data_const(), cpl_mask_get_size_x(), cpl_mask_get_size_y(), cpl_mask_is_empty(), cpl_mask_wrap(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, cpl_type_get_sizeof(), and CPL_TYPE_INT.

Referenced by cpl_geom_img_offset_fine(), cpl_image_filter_median(), and cpl_image_filter_stdev().

cpl_image* cpl_image_filter_median ( const cpl_image *  in,
const cpl_matrix *  ker 
)

Apply a spatial median filter to an image.

Parameters
inImage to filter.
kerthe kernel
Returns
1 newly allocated image or NULL in error case
See also
cpl_image_filter_mask
Deprecated:
Replace this call with cpl_image_filter_mask() using CPL_FILTER_MEDIAN and CPL_BORDER_FILTER.

References CPL_BORDER_FILTER, cpl_ensure, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, CPL_FILTER_MEDIAN, cpl_image_delete(), cpl_image_filter_mask(), cpl_image_new(), and cpl_mask_delete().

cpl_image* cpl_image_filter_morpho ( const cpl_image *  in,
const cpl_matrix *  ker 
)

Filter an image in spatial domain with a morpho kernel.

Parameters
inImage to filter.
kerFilter definition.
Returns
1 newly allocated image or NULL in error case.
See also
cpl_image_filter()
Deprecated:
Replace this call with cpl_image_filter() using CPL_FILTER_MORPHO and CPL_BORDER_FILTER.

References CPL_BORDER_FILTER, cpl_ensure, CPL_ERROR_NULL_INPUT, CPL_FILTER_MORPHO, cpl_image_delete(), cpl_image_filter(), and cpl_image_new().

cpl_image* cpl_image_filter_stdev ( const cpl_image *  in,
const cpl_matrix *  ker 
)

Standard deviation filter.

Parameters
ininput image
kerthe kernel
Returns
a newly allocated filtered image or NULL on error
See also
cpl_image_filter_mask
Deprecated:
Replace this call with cpl_image_filter_mask() using CPL_FILTER_STDEV and CPL_BORDER_FILTER.

References CPL_BORDER_FILTER, cpl_ensure, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, CPL_FILTER_STDEV, cpl_image_delete(), cpl_image_filter_mask(), cpl_image_new(), cpl_mask_delete(), cpl_mask_get_size_x(), and cpl_mask_get_size_y().

cpl_error_code cpl_image_fit_gaussian ( const cpl_image *  im,
cpl_size  xpos,
cpl_size  ypos,
cpl_size  size,
double *  norm,
double *  xcen,
double *  ycen,
double *  sig_x,
double *  sig_y,
double *  fwhm_x,
double *  fwhm_y 
)

Apply a gaussian fit on an image sub window.

Parameters
imthe input image
xposthe x position of the center (1 for the first pixel)
yposthe y position of the center (1 for the first pixel)
sizethe window size in pixels, at least 4
normthe norm of the gaussian or NULL
xcenthe x center of the gaussian or NULL
ycenthe y center of the gaussian or NULL
sig_xthe semi-major axis of the gaussian or NULL
sig_ythe semi-minor axis of the gaussian or NULL
fwhm_xthe FHHM in x or NULL
fwhm_ythe FHHM in y or NULL
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_fit_image_gaussian()
cpl_image_iqe()
Deprecated:
If you need a 2D gaussian fit please use the function cpl_fit_image_gaussian(). Please note that on CPL versions earlier than 5.1.0 this function was wrongly documented: the parameters sig_x and sig_y were defined as "the sigma in x (or y) of the gaussian", while actually they returned the semi-major and semi-minor axes of the gaussian distribution at 1-sigma. PLEASE NOTE THAT IF YOU USED THIS FUNCTION FOR DETERMINING THE SPREAD OF A DISTRIBUTION ALONG THE X DIRECTION, THIS WAS VERY LIKELY OVERESTIMATED (because sig_x was always assigned the semi-major axis of the distribution ignoring the rotation), WHILE THE SPREAD ALONG THE Y DIRECTION WOULD BE UNDERESTIMATED. In addition to that, even with circular distributions this function may lead to an underestimation of sig_x and sig_y (up to 25% underestimation in the case of noiseless data with a box 4 times the sigma, 1% underestimation in the case of noiseless data with a box 7 times the sigma). This latter problem is related to the function cpl_image_iqe().

This function is only acceptable for determining the position of a peak.

References cpl_bivector_delete(), cpl_bivector_get_x_data(), cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_cast(), cpl_image_delete(), cpl_image_get_type(), cpl_image_iqe(), CPL_MATH_2PI, CPL_MATH_FWHM_SIG, and CPL_TYPE_FLOAT.

cpl_error_code cpl_image_flip ( cpl_image *  im,
int  angle 
)

Flip an image on a given mirror line.

Parameters
imthe image to flip.
anglemirror line in polar coord. is theta = (PI/4) * angle
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

This function operates locally on the pixel buffer.

angle can take one of the following values:

  • 0 (theta=0) to flip the image around the horizontal
  • 1 (theta=pi/4) to flip the image around y=x
  • 2 (theta=pi/2) to flip the image around the vertical
  • 3 (theta=3pi/4) to flip the image around y=-x

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the angle is different from the allowed values
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_mask_flip().

double cpl_image_get ( const cpl_image *  image,
cpl_size  xpos,
cpl_size  ypos,
int *  pis_rejected 
)

Get the value of a pixel at a given position.

Parameters
imageInput image.
xposPixel x position (FITS convention, 1 for leftmost)
yposPixel y position (FITS convention, 1 for lowest)
pis_rejected1 if the pixel is bad, 0 if good, negative on error
Returns
The pixel value (cast to a double) or undefined if *pis_rejected

The return value is defined if the pixel is not flagged as rejected, i. e. when *pis_rejected == 0.

In case of an error, the _cpl_error_code_ code is set.

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the passed position is not in the image
  • CPL_ERROR_INVALID_TYPE if the image pixel type is not supported

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_INVALID_TYPE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_fit_image_gaussian(), cpl_image_dump_window(), and cpl_image_get_fwhm().

double cpl_image_get_absflux ( const cpl_image *  image)

Computes the sum of absolute values over an image.

Parameters
imageinput image.
Returns
the absolute flux (sum of |pixels|) value
See also
cpl_image_get_min()

Referenced by cpl_image_normalise().

double cpl_image_get_absflux_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Computes the sum of absolute values over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the absolute flux (sum of |pixels|) value
See also
cpl_image_get_min_window()
cpl_mask* cpl_image_get_bpm ( cpl_image *  img)

Gets the bad pixels map.

Parameters
imgImage to query.
Returns
A pointer to the mask identifying the bad pixels or NULL.

The returned pointer refers to already allocated data. If the bad pixel map is NULL, an empty one is created.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_mask_new().

Referenced by cpl_geom_img_offset_saa(), and cpl_image_reject_from_mask().

const cpl_mask* cpl_image_get_bpm_const ( const cpl_image *  img)

Gets the bad pixels map.

Parameters
imgImage to query.
Returns
A pointer to the mask identifying the bad pixels or NULL.
Note
NULL is returned if the image has no bad pixel map
See also
cpl_image_get_bpm

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_apertures_new_from_image(), cpl_detector_interpolate_rejected(), cpl_fit_imagelist_polynomial_window(), cpl_geom_img_offset_saa(), cpl_image_new_from_accepted(), cpl_imagelist_collapse_create(), and cpl_mask_threshold_image().

double cpl_image_get_centroid_x ( const cpl_image *  image)

Computes the x centroid value over the whole image.

Parameters
imageinput image.
Returns
the x centroid value
See also
cpl_image_get_min_window()
double cpl_image_get_centroid_x_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Computes the x centroid value over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the x centroid value
See also
cpl_image_get_min_window()
double cpl_image_get_centroid_y ( const cpl_image *  image)

Computes the y centroid value over the whole image.

Parameters
imageinput image.
Returns
the y centroid value
See also
cpl_image_get_min_window()
double cpl_image_get_centroid_y_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Computes the y centroid value over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the y centroid value
See also
cpl_image_get_min_window()
double complex cpl_image_get_complex ( const cpl_image *  image,
cpl_size  xpos,
cpl_size  ypos,
int *  pis_rejected 
)

Get the value of a complex pixel at a given position.

Parameters
imageInput complex image.
xposPixel x position (FITS convention, 1 for leftmost)
yposPixel y position (FITS convention, 1 for lowest)
pis_rejected1 if the pixel is bad, 0 if good, negative on error
Returns
The pixel value (cast to a double complex) or undefined if *pis_rejected
See also
cpl_image_get()
Note
This function is available iff the application includes complex.h

The return value is defined if the pixel is not flagged as rejected, i. e. when *pis_rejected == 0.

In case of an error, the _cpl_error_code_ code is set.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the passed position is not in the image

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_INVALID_TYPE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_image_dump_window().

void* cpl_image_get_data ( cpl_image *  img)

Gets the pixel data.

Parameters
imgImage to query.
Returns
A pointer to the image pixel data or NULL on error.

The returned pointer refers to already allocated data.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_detector_interpolate_rejected(), cpl_image_copy(), cpl_image_filter(), and cpl_image_filter_mask().

const void* cpl_image_get_data_const ( const cpl_image *  img)

Gets the pixel data.

Parameters
imgImage to query.
Returns
A pointer to the image pixel data or NULL on error.
See also
cpl_image_get_data

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_image_filter(), cpl_image_filter_mask(), and cpl_mask_threshold_image().

double* cpl_image_get_data_double ( cpl_image *  img)

Get the data as a double array.

Parameters
imga cpl_image object
Returns
pointer to the double data array or NULL on error.

The returned pointer refers to already allocated data.

The pixels are stored in a one dimensional array. The pixel value PIXVAL at position (i, j) in the image - (0, 0) is the lower left pixel, i gives the column position from left to right, j gives the row position from bottom to top - is given by : PIXVAL = array[i + j*nx]; where nx is the x size of the image and array is the data array returned by this function. array can be used to access or modify the pixel value in the image.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_TYPE_MISMATCH if the passed image type is not double

Referenced by cpl_image_fill_jacobian(), cpl_image_fill_jacobian_polynomial(), and cpl_plot_image().

double complex* cpl_image_get_data_double_complex ( cpl_image *  img)

Get the data as a double complex array.

Parameters
imga cpl_image object
Returns
pointer to the double complex data array or NULL on error.
See also
cpl_image_get_data_double()
Note
This function is available iff the application includes complex.h
const double complex* cpl_image_get_data_double_complex_const ( const cpl_image *  img)

Get the data as a double complex array.

Parameters
imga cpl_image object
Returns
pointer to the double complex data array or NULL on error.
See also
cpl_image_get_data_double_complex()
const double* cpl_image_get_data_double_const ( const cpl_image *  img)

Get the data as a double array.

Parameters
imga cpl_image object
Returns
pointer to the double data array or NULL on error.
See also
cpl_image_get_data_double

Referenced by cpl_apertures_new_from_image(), cpl_image_fill_jacobian(), cpl_image_warp(), cpl_plot_image(), cpl_plot_image_col(), and cpl_plot_image_row().

float* cpl_image_get_data_float ( cpl_image *  img)

Get the data as a float array.

Parameters
imga cpl_image object
Returns
pointer to the float data array or NULL on error.
See also
cpl_image_get_data_double()

Referenced by cpl_image_fill_jacobian(), cpl_image_fill_jacobian_polynomial(), and cpl_image_iqe().

float complex* cpl_image_get_data_float_complex ( cpl_image *  img)

Get the data as a float complex array.

Parameters
imga cpl_image object
Returns
pointer to the float complex data array or NULL on error.
See also
cpl_image_get_data_double_complex()
const float complex* cpl_image_get_data_float_complex_const ( const cpl_image *  img)

Get the data as a float complex array.

Parameters
imga cpl_image object
Returns
pointer to the float complex data array or NULL on error.
See also
cpl_image_get_data_double_complex()
const float* cpl_image_get_data_float_const ( const cpl_image *  img)

Get the data as a float array.

Parameters
imga cpl_image object
Returns
pointer to the float data array or NULL on error.
See also
cpl_image_get_data_float()
int* cpl_image_get_data_int ( cpl_image *  img)

Get the data as a integer array.

Parameters
imga cpl_image object
Returns
pointer to the integer data array or NULL on error.
See also
cpl_image_get_data_double()

Referenced by cpl_image_labelise_mask_create(), and cpl_imagelist_collapse_sigclip_create().

const int* cpl_image_get_data_int_const ( const cpl_image *  img)

Get the data as a integer array.

Parameters
imga cpl_image object
Returns
pointer to the integer data array or NULL on error.
See also
cpl_image_get_data_int()

Referenced by cpl_apertures_new_from_image().

double cpl_image_get_flux ( const cpl_image *  image)

Computes the sum of pixel values over an image.

Parameters
imageinput image.
Returns
the flux value
See also
cpl_image_get_min()

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_image_get_flux_window().

Referenced by cpl_image_normalise().

double cpl_image_get_flux_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Computes the sum of pixel values over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the flux value
See also
cpl_image_get_min_window()

Referenced by cpl_image_get_flux().

cpl_error_code cpl_image_get_fwhm ( const cpl_image *  in,
cpl_size  xpos,
cpl_size  ypos,
double *  fwhm_x,
double *  fwhm_y 
)

Compute FWHM values in x and y for an object.

Parameters
inthe input image
xposthe x position of the object (1 for the first pixel)
yposthe y position of the object (1 for the first pixel)
fwhm_xthe computed FWHM in x or -1 on error
fwhm_ythe computed FWHM in y or -1 on error
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_

This function uses a basic method: start from the center of the object and go away until the half maximum value is reached in x and y.

For the FWHM in x (resp. y) to be computed, the image size in the x (resp. y) direction should be at least of 5 pixels.

If for any reason, one of the FHWMs cannot be computed, its returned value is -1.0, but an error is not necessarily raised. For example, if a 4 column image is passed, the fwhm_x would be -1.0, the fwhm_y would be correctly computed, and no error would be raised.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_DATA_NOT_FOUND if (xpos, ypos) specifies a rejected pixel or a pixel with a non-positive value
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if xpos or ypos is outside the image size range

References cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_image_get(), cpl_vector_delete(), cpl_vector_new_from_image_column(), and cpl_vector_new_from_image_row().

Referenced by cpl_apertures_get_fwhm().

double cpl_image_get_interpolated ( const cpl_image *  source,
double  xpos,
double  ypos,
const cpl_vector *  xprofile,
double  xradius,
const cpl_vector *  yprofile,
double  yradius,
double *  pconfid 
)

Interpolate a pixel.

Parameters
sourceInterpolation source
xposPixel x floating-point position (FITS convention)
yposPixel y floating-point position (FITS convention)
xprofileInterpolation weight as a function of the distance in X
xradiusPositive inclusion radius in the X-dimension
yprofileInterpolation weight as a function of the distance in Y
yradiusPositive inclusion radius in the Y-dimension
pconfidConfidence level of the interpolated value (range 0 to 1)
Returns
The interpolated pixel value, or undefined on error
See also
cpl_image_get()

If the X- and Y-radii are identical the area of inclusion is a circle, otherwise it is an ellipse, with the larger of the two radii as the semimajor axis and the other as the semiminor axis.

The radii are only required to be positive. However, for small radii, especially radii less than 1/sqrt(2), (xpos, ypos) may be located such that no source pixels are included in the interpolation, causing the interpolated pixel value to be undefined.

The X- and Y-profiles can be generated with cpl_vector_fill_kernel_profile(profile, radius). For profiles generated with cpl_vector_fill_kernel_profile() it is important to use the same radius both there and in cpl_image_get_interpolated().

A good profile length is CPL_KERNEL_DEF_SAMPLES, using radius CPL_KERNEL_DEF_WIDTH.

On error *pconfid is negative (unless pconfid is NULL). Otherwise, if *pconfid is zero, the interpolated pixel-value is undefined. Otherwise, if *pconfid is less than 1, the area of inclusion is close to the image border or contains rejected pixels.

The input image type can be CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE.

Here is an example of a simple image unwarping (with error-checking omitted for brevity):

const double xyradius = CPL_KERNEL_DEF_WIDTH;

cpl_vector * xyprofile = cpl_vector_new(CPL_KERNEL_DEF_SAMPLES); cpl_image * unwarped = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);

cpl_vector_fill_kernel_profile(xyprofile, CPL_KERNEL_DEFAULT, xyradius);

for (iv = 1; iv <= ny; iv++) { for (iu = 1; iu <= nx; iu++) { double confidence; const double x = my_unwarped_x(); const double y = my_unwarped_y();

const double value = cpl_image_get_interpolated(warped, x, y, xyprofile, xyradius, xyprofile, xyradius, &confidence);

if (confidence > 0) cpl_image_set(unwarped, iu, iv, value); else cpl_image_reject(unwarped, iu, iv); } }

cpl_vector_delete(xyprofile);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if xradius, xprofile, yprofile and yradius are not as requested
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_malloc(), cpl_mask_get_data_const(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT, cpl_vector_get_data_const(), and cpl_vector_get_size().

double cpl_image_get_mad ( const cpl_image *  image,
double *  sigma 
)

Computes median and median absolute deviation (MAD) on an image.

Parameters
imageInput image.
sigmaThe median of the absolute median deviation of the good pixels
Returns
The median of the non-bad pixels
See also
cpl_image_get_mad_window()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_DATA_NOT_FOUND if all the pixels are bad in the image

References cpl_ensure, cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, cpl_stats_delete(), cpl_stats_get_mad(), cpl_stats_get_median(), CPL_STATS_MAD, and cpl_stats_new_from_image().

double cpl_image_get_mad_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
double *  sigma 
)

Computes median and median absolute deviation (MAD) on an image window.

Parameters
imageInput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
sigmaThe median of the absolute median deviation of the good pixels
Returns
The median of the non-bad pixels
See also
cpl_image_get_median_window(), CPL_MATH_STD_MAD

For each non-bad pixel in the window the absolute deviation from the median is computed. The median of these absolute deviations in returned via sigma, while the median itself is returned by the function.

If the pixels are gaussian, the computed sigma is a robust and consistent estimate of the standard deviation in the sense that the standard deviation is approximately k * MAD, where k is a constant equal to approximately 1.4826. CPL defines CPL_MATH_STD_MAD as this scaling constant.

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE. On error the _cpl_error_code_ code is set and the return value is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_ILLEGAL_INPUT if the specified window is illegal
  • CPL_ERROR_DATA_NOT_FOUND if all the pixels are bad in the image window

References cpl_ensure, cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, cpl_stats_delete(), cpl_stats_get_mad(), cpl_stats_get_median(), CPL_STATS_MAD, and cpl_stats_new_from_image_window().

double cpl_image_get_max ( const cpl_image *  image)

computes maximum pixel value over an image.

Parameters
imageinput image.
Returns
the maximum value
See also
cpl_image_get_min()

Referenced by cpl_apertures_new_from_image(), cpl_fit_image_gaussian(), and cpl_plot_image().

double cpl_image_get_max_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

computes maximum pixel value over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the maximum value
See also
cpl_image_get_min_window()
cpl_error_code cpl_image_get_maxpos ( const cpl_image *  image,
cpl_size px,
cpl_size py 
)

Computes maximum pixel value and position over an image.

Parameters
imageInput image.
pxptr to the x coordinate of the maximum position
pyptr to the y coordinate of the maximum position
Returns
CPL_ERROR_NONE or the _cpl_error_code_ on error
See also
cpl_image_get_minpos()

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_stats_delete(), cpl_stats_get_max_x(), cpl_stats_get_max_y(), CPL_STATS_MAXPOS, and cpl_stats_new_from_image().

Referenced by cpl_fit_image_gaussian().

cpl_error_code cpl_image_get_maxpos_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
cpl_size px,
cpl_size py 
)

Computes maximum pixel value and position over an image sub window.

Parameters
imageInput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
pxptr to the x coordinate of the maximum position
pyptr to the y coordinate of the maximum position
Returns
CPL_ERROR_NONE or the _cpl_error_code_ on error
See also
cpl_image_get_minpos_window()

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_stats_delete(), cpl_stats_get_max_x(), cpl_stats_get_max_y(), CPL_STATS_MAXPOS, and cpl_stats_new_from_image_window().

double cpl_image_get_mean ( const cpl_image *  image)

computes mean pixel value over an image.

Parameters
imageinput image.
Returns
the mean value
See also
cpl_image_get_min()

Referenced by cpl_fit_image_gaussian(), and cpl_image_normalise().

double cpl_image_get_mean_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

computes mean pixel value over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the mean value
See also
cpl_image_get_min_window()
double cpl_image_get_median ( const cpl_image *  image)

computes median pixel value over an image.

Parameters
imageInput image.
Returns
the median value
See also
cpl_image_get_median_window()

In case of error, the _cpl_error_code_ code is set, and the returned double is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Referenced by cpl_fit_image_gaussian().

double cpl_image_get_median_dev ( const cpl_image *  image,
double *  sigma 
)

Computes median and mean absolute median deviation on an image window.

Parameters
imageInput image.
sigmaThe mean of the absolute median deviation of the (good) pixels
Returns
The median of the non-bad pixels
See also
cpl_image_get_median_dev_window()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_DATA_NOT_FOUND if all the pixels are bad in the image

References cpl_ensure, cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, cpl_stats_delete(), cpl_stats_get_median(), cpl_stats_get_median_dev(), CPL_STATS_MEDIAN_DEV, and cpl_stats_new_from_image().

Referenced by cpl_apertures_extract_sigma().

double cpl_image_get_median_dev_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
double *  sigma 
)

Computes median and mean absolute median deviation on an image window.

Parameters
imageInput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
sigmaThe mean of the absolute median deviation of the (good) pixels
Returns
The median of the non-bad pixels
See also
cpl_image_get_mad_window()

For each non-bad pixel in the window the absolute deviation from the median is computed. The mean of these absolute deviations in returned via sigma, while the median itself is returned by the function. The computed median and sigma may be a robust estimate of the mean and standard deviation of the pixels. The sigma is however still sensitive to outliers. See cpl_image_get_mad_window() for a more robust estimator.

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE. On error the _cpl_error_code_ code is set and the return value is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_ILLEGAL_INPUT if the specified window is illegal
  • CPL_ERROR_DATA_NOT_FOUND if all the pixels are bad in the image window

References cpl_ensure, cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NULL_INPUT, cpl_stats_delete(), cpl_stats_get_median(), cpl_stats_get_median_dev(), CPL_STATS_MEDIAN_DEV, and cpl_stats_new_from_image_window().

double cpl_image_get_median_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

computes median pixel value over an image sub-window.

Parameters
imageInput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
The median value, or undefined on error

The specified bounds are included in the specified region.

In case of error, the _cpl_error_code_ code is set, and the returned value is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

For a finite population or sample, the median is the middle value of an odd number of values (arranged in ascending order) or any value between the two middle values of an even number of values. For an even number of elements in the array, the mean of the two central values is returned. Note that in this case, the median might not belong to the input array.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the window is outside the image or if there are only bad pixels in the window
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
double cpl_image_get_min ( const cpl_image *  image)

computes minimum pixel value over an image.

Parameters
imageinput image.
Returns
the minimum value
See also
cpl_image_get_min_window()

In case of error, the _cpl_error_code_ code is set, and the returned double is undefined. Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Referenced by cpl_fit_image_gaussian(), and cpl_plot_image().

double cpl_image_get_min_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

computes minimum pixel value over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the minimum value, or undefined on error
See also
cpl_stats_new_from_window()
Note
In case of error, the _cpl_error_code_ code is set.

The specified bounds are included in the specified region.

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
cpl_error_code cpl_image_get_minpos ( const cpl_image *  image,
cpl_size px,
cpl_size py 
)

Computes minimum pixel value and position over an image.

Parameters
imageInput image.
pxptr to the x coordinate of the minimum position
pyptr to the y coordinate of the minimum position
Returns
CPL_ERROR_NONE or the _cpl_error_code_ on error
See also
cpl_image_get_minpos_window()

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_stats_delete(), cpl_stats_get_min_x(), cpl_stats_get_min_y(), CPL_STATS_MINPOS, and cpl_stats_new_from_image().

Referenced by cpl_fit_image_gaussian().

cpl_error_code cpl_image_get_minpos_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury,
cpl_size px,
cpl_size py 
)

Computes minimum pixel value and position over an image sub window.

Parameters
imageInput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
pxptr to the x coordinate of the minimum position
pyptr to the y coordinate of the minimum position
Returns
CPL_ERROR_NONE or the _cpl_error_code_ on error
See also
cpl_image_get_min_window()

The specified bounds are included in the specified region.

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT or CPL_TYPE_DOUBLE.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_stats_delete(), cpl_stats_get_min_x(), cpl_stats_get_min_y(), CPL_STATS_MINPOS, and cpl_stats_new_from_image_window().

double cpl_image_get_sqflux ( const cpl_image *  image)

Computes the sum of squared values over an image.

Parameters
imageinput image.
Returns
the sqaure flux
See also
cpl_image_get_min()
double cpl_image_get_sqflux_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Computes the sum of squared values over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the square flux
See also
cpl_image_get_min_window()
double cpl_image_get_stdev ( const cpl_image *  image)

computes pixel standard deviation over an image.

Parameters
imageinput image.
Returns
the standard deviation value
See also
cpl_image_get_min()
double cpl_image_get_stdev_window ( const cpl_image *  image,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

computes pixel standard deviation over an image sub-window.

Parameters
imageinput image.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
the standard deviation value
See also
cpl_image_get_min_window()

Referenced by cpl_flux_get_noise_ring().

cpl_error_code cpl_image_hypot ( cpl_image *  self,
const cpl_image *  first,
const cpl_image *  second 
)

The pixel-wise Euclidean distance function of the images.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
secondSecond operand
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error

The Euclidean distance function is useful for gaussian error propagation on addition/subtraction operations.

For pixel values a and b the Euclidean distance c is defined as: $$c = sqrt{a^2 + b^2}$$

first may be NULL, in this case the distance is computed in-place on self using second as the other operand.

Images can be of type CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

If both input operands are of type CPL_TYPE_FLOAT the distance is computed in single precision (using hypotf()), otherwise in double precision (using hypot()).

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the images have different sizes
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, and cpl_type_get_name().

cpl_bivector* cpl_image_iqe ( const cpl_image *  in,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Compute an image quality estimation for an object.

Parameters
inthe input image
llx
llythe zone to analyse ((1, 1) for the first pixel)
urxThe zone must be at least 4 by 4 pixels
ury
Returns
a newly allocated cpl_bivector containing the results or NULL in error case.

This function makes internal use of the iqe() MIDAS function (called here cpl_iqe()) written by P. Grosbol. Refer to the MIDAS documentation for more details. This function has proven to give good results over the years when called from RTD. The goal is to provide the exact same functionality in CPL as the one provided in RTD. The code is simply copied from the MIDAS package, it is not maintained by the CPL team.

The returned object must be deallocated with cpl_bivector_delete(). It contains in the first vector the computed values, and in the second one, the associated errors. The computed values are:

  • x position of the object
  • y position of the object
  • FWHM along the major axis
  • FWHM along the minor axis
  • the angle of the major axis with the horizontal in degrees
  • the peak value of the object
  • the background computed

The bad pixels map of the image is not taken into account. The input image must be of type float.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the specified zone is not valid or if the computation fails on this zone
  • CPL_ERROR_INVALID_TYPE if the input image has the wrong type
Note
This function may lead to a strong underestimation of the sigmas and FWHMs (up to 25% underestimation in the case of noiseless data with a box 4 times the sigma, 1% underestimation in the case of noiseless data with a box 7 times the sigma).

References cpl_bivector_get_x_data(), cpl_bivector_get_y_data(), cpl_bivector_new(), cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_image_delete(), cpl_image_extract(), cpl_image_get_data_float(), cpl_image_get_size_x(), cpl_image_get_size_y(), and CPL_TYPE_FLOAT.

Referenced by cpl_image_fit_gaussian().

int cpl_image_is_rejected ( const cpl_image *  im,
cpl_size  x,
cpl_size  y 
)

Test if a pixel is good or bad.

Parameters
imthe input image
xthe x pixel position in the image (first pixel is 1)
ythe y pixel position in the image (first pixel is 1)
Returns
1 if the pixel is bad, 0 if the pixel is good, negative on error.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the specified position is out of the image

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NULL_INPUT, and cpl_mask_get().

cpl_image* cpl_image_labelise_mask_create ( const cpl_mask *  in,
cpl_size nbobjs 
)

Labelise a mask to differentiate different objects.

Parameters
inmask to labelise
nbobjsIf non-NULL, number of objects found on success
Returns
A newly allocated label image or NULL on error

This function labelises all blobs in a mask. All 4-neighbour connected zones set to 1 in the input mask will end up in the returned integer image as zones where all pixels are set to the same (unique for this blob in this image) label. A non-recursive flood-fill is applied to label the zones. The flood-fill is dimensioned by the number of lines in the image, and the maximal number of lines possibly covered by a blob. The returned image must be deallocated with cpl_image_delete()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if the input mask is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_image_get_data_int(), cpl_image_new(), cpl_malloc(), cpl_mask_get_data_const(), cpl_mask_get_size_x(), cpl_mask_get_size_y(), and CPL_TYPE_INT.

Referenced by cpl_apertures_extract_mask().

cpl_image* cpl_image_load ( const char *  filename,
cpl_type  im_type,
cpl_size  pnum,
cpl_size  xtnum 
)

Load an image from a FITS file.

Parameters
filenameName of the file to load from.
im_typeType of the created image
pnumPlane number in the Data Unit (0 for first)
xtnumExtension number in the file (0 for primary HDU)
Returns
1 newly allocated image or NULL on error

This function loads an image from a FITS file (NAXIS=2 or 3).

The returned image has to be deallocated with cpl_image_delete().

The passed type for the output image can be : CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE or CPL_TYPE_INT.

This type is there to specify the type of the cpl_image that will be created by the function. It is totally independant from the way the data are stored in the FITS file. A FITS image containg float pixels can be loaded as a cpl_image of type double. In this case, the user would specify CPL_TYPE_DOUBLE as im_type.

Additionally, CPL_TYPE_UNSPECIFIED can be passed to inherit the FITS file type. The type of the image is defined based on the BITPIX information of the FITS file. After a successful call, the type of the created image can be accessed via cpl_image_get_type().

'xtnum' specifies from which extension the image should be loaded. This could be 0 for the main data section (files without extension), or any number between 1 and N, where N is the number of extensions present in the file.

The requested plane number runs from 0 to nplanes-1, where nplanes is the number of planes present in the requested data section.

The created image has an empty bad pixel map.

Examples:

1 // Load as a float image the only image in FITS file (a.fits) without ext.
2 // and NAXIS=2.
3 cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_FLOAT, 0, 0);
4 // Load as a double image the first plane in a FITS cube (a.fits) without
5 // extension, NAXIS=3 and NAXIS3=128
6 cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_DOUBLE, 0, 0);
7 // Load as an integer image the third plane in a FITS cube (a.fits) without
8 // extension, NAXIS=3 and NAXIS3=128
9 cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_INT, 2, 0);
10 // Load as a double image the first plane from extension 5
11 cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_DOUBLE, 0, 5);
12 // Load as a double image the third plane in extension 5
13 cpl_image * im = cpl_image_load("a.fits", CPL_TYPE_DOUBLE, 2, 5);

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_FILE_IO if the file cannot be opened or does not exist
  • CPL_ERROR_BAD_FILE_FORMAT if the data cannot be loaded from the file
  • CPL_ERROR_INVALID_TYPE if the passed pixel type is not supported
  • CPL_ERROR_ILLEGAL_INPUT if the passed extension number is negative
  • CPL_ERROR_DATA_NOT_FOUND if the specified extension has no image data
cpl_image* cpl_image_load_window ( const char *  filename,
cpl_type  im_type,
cpl_size  pnum,
cpl_size  xtnum,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Load an image from a FITS file.

Parameters
filenameName of the file to load from.
im_typeType of the created image
pnumPlane number in the Data Unit (0 for first)
xtnumExtension number in the file.
llxLower left x position (FITS convention, 1 for leftmost)
llyLower left y position (FITS convention, 1 for lowest)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
1 newly allocated image or NULL on error
See also
cpl_image_load()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_FILE_IO if the file does not exist
  • CPL_ERROR_BAD_FILE_FORMAT if the data cannot be loaded from the file
  • CPL_ERROR_INVALID_TYPE if the passed pixel type is not supported
  • CPL_ERROR_ILLEGAL_INPUT if the passed position is invalid
cpl_error_code cpl_image_logarithm ( cpl_image *  self,
double  base 
)

Compute the elementwise logarithm of the image.

Parameters
selfImage to be modified in place.
baseBase of the logarithm.
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error

Modifies the image by computing the base-scalar logarithm of each of its pixels.

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Pixels for which the logarithm is not defined are rejected and set to zero.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_ILLEGAL_INPUT if base is non-positive
  • CPL_ERROR_DIVISION_BY_ZERO if the base equals 1

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, cpl_type_get_name(), and CPL_TYPE_INT.

Referenced by cpl_image_logarithm_create(), and cpl_imagelist_logarithm().

cpl_image* cpl_image_logarithm_create ( const cpl_image *  image,
double  base 
)

Create a new image by taking the elementwise logarithm of an image.

Parameters
imageImage to take logarithm of
baseBase of the logarithm.
Returns
1 newly allocated image or NULL in case of an error
See also
cpl_image_logarithm
cpl_image_add_scalar_create

References cpl_ensure, cpl_error_get_code(), cpl_image_delete(), cpl_image_duplicate(), and cpl_image_logarithm().

cpl_error_code cpl_image_move ( cpl_image *  im,
cpl_size  nb_cut,
const cpl_size new_pos 
)

Reorganize the pixels in an image.

Parameters
imthe image to reorganize
nb_cutthe number of cut in x and y
new_posarray with the nb_cut^2 new positions
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

nb_cut^2 defines in how many tiles the images will be moved. Each tile will then be moved to an other place defined in new_pos. 1 will leave the image unchanged, 2 is used to move the quadrants, etc.. new_pos contains nb_cut^2 values between 1 and nb_cut^2. The zones positions are counted from the lower left part of the image. It is not allowed to move two tiles to the same position (the relation between th new tiles positions and the initial position is bijective !).

The image x and y sizes have to be multiples of nb_cut.

Example:

16   17   18           6    5    4
13   14   15           3    2    1

10   11   12   ---->  12   11   10
 7    8    9           9    8    7

 4    5    6          18   17   16
 1    2    3          15   14   13

 image 3x6            cpl_image_move(image, 3, new_pos);
                      with new_pos = {9,8,7,6,5,4,3,2,1};

The bad pixels are moved accordingly.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if nb_cut is not strictly positive or cannot divide one of the image sizes or if the new_pos array specifies to move two tiles to the same position.
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_mask_move().

Referenced by cpl_image_fft().

cpl_error_code cpl_image_multiply ( cpl_image *  im1,
const cpl_image *  im2 
)

Multiply two images, store the result in the first image.

Parameters
im1first operand.
im2second operand.
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_add()

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_TYPE_DOUBLE_COMPLEX, and CPL_TYPE_FLOAT_COMPLEX.

cpl_image* cpl_image_multiply_create ( const cpl_image *  image1,
const cpl_image *  image2 
)

Multiply two images.

Parameters
image1first operand
image2second operand
Returns
1 newly allocated image or NULL on error
See also
cpl_image_add_create()
cpl_error_code cpl_image_multiply_scalar ( cpl_image *  self,
double  scalar 
)

Elementwise multiplication of an image with a scalar.

Parameters
selfImage to be modified in place.
scalarNumber to multiply with
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_image_add_scalar()

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_get_type().

Referenced by cpl_image_fill_test_create(), cpl_image_multiply_scalar_create(), cpl_imagelist_multiply_scalar(), and cpl_plot_image().

cpl_image* cpl_image_multiply_scalar_create ( const cpl_image *  image,
double  factor 
)

Create a new image by multiplication of a scalar and an image.

Parameters
imageImage to be multiplied
factorNumber to multiply with
Returns
1 newly allocated image or NULL in case of an error
See also
cpl_image_multiply_scalar
cpl_image_add_scalar_create

References cpl_ensure, cpl_error_get_code(), cpl_image_delete(), cpl_image_duplicate(), and cpl_image_multiply_scalar().

cpl_image* cpl_image_new ( cpl_size  nx,
cpl_size  ny,
cpl_type  type 
)

Allocate an image structure and pixel buffer for a image.

Parameters
nxSize in x (the number of columns)
nySize in y (the number of rows)
typeThe pixel type
Returns
1 newly allocated cpl_image or NULL in case of an error

Allocates space for the cpl_image structure and sets the dimensions and type of pixel data. The pixel buffer is allocated and initialised to zero. The pixel array will contain nx*ny values being the image pixels from the lower left to the upper right line by line.

Supported pixel types are CPL_TYPE_INT, CPL_TYPE_FLOAT, CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT_COMPLEX and CPL_TYPE_DOUBLE_COMPLEX.

The returned cpl_image must be deallocated using cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_ILLEGAL_INPUT if nx or ny is non-positive
  • CPL_ERROR_INVALID_TYPE if the passed pixel type is not supported

Referenced by cpl_geom_img_offset_fine(), cpl_geom_img_offset_saa(), cpl_image_fill_jacobian(), cpl_image_fill_test_create(), cpl_image_filter_linear(), cpl_image_filter_median(), cpl_image_filter_morpho(), cpl_image_filter_stdev(), cpl_image_labelise_mask_create(), and cpl_image_new_from_accepted().

cpl_image* cpl_image_new_from_mask ( const cpl_mask *  mask)

Create an int image from a mask.

Parameters
maskthe original mask
Returns
1 newly allocated cpl_image or NULL on error

The created image is of type CPL_TYPE_INT.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_image_wrap_int(), cpl_malloc(), cpl_mask_get_data_const(), cpl_mask_get_size_x(), and cpl_mask_get_size_y().

Referenced by cpl_geom_img_offset_saa().

cpl_error_code cpl_image_normalise ( cpl_image *  image,
cpl_norm  mode 
)

Normalise pixels in an image.

Parameters
imageImage operand.
modeNormalisation mode.
Returns
CPL_ERROR_NONE, or the relevant _cpl_error_code_ on error.

Normalises an image according to a given criterion.

Possible normalisations are:

  • CPL_NORM_SCALE sets the pixel interval to [0,1].
  • CPL_NORM_MEAN sets the mean value to 1.
  • CPL_NORM_FLUX sets the flux to 1.
  • CPL_NORM_ABSFLUX sets the absolute flux to 1.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_divide_scalar(), cpl_image_get_absflux(), cpl_image_get_flux(), cpl_image_get_mean(), cpl_image_subtract_scalar(), cpl_stats_delete(), cpl_stats_get_max(), cpl_stats_get_min(), CPL_STATS_MAX, CPL_STATS_MIN, and cpl_stats_new_from_image().

Referenced by cpl_image_normalise_create(), and cpl_imagelist_normalise().

cpl_image* cpl_image_normalise_create ( const cpl_image *  image_in,
cpl_norm  mode 
)

Create a new normalised image from an existing image.

Parameters
image_inImage operand.
modeNormalisation mode.
Returns
1 newly allocated image or NULL on error
See also
cpl_image_normalise

Stores the result in a newly allocated image and returns it. The returned image must be deallocated using cpl_image_delete().

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, cpl_image_delete(), cpl_image_duplicate(), and cpl_image_normalise().

cpl_error_code cpl_image_not ( cpl_image *  self,
const cpl_image *  first 
)

The bit-wise complement (not) of an image with integer pixels.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
Note
CPL_TYPE_INT is required
See also
cpl_mask_not() for the equivalent logical operation

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the images have different sizes
  • CPL_ERROR_INVALID_TYPE if the passed image type is as required

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), cpl_image_or_mask_unary(), cpl_type_get_name(), cpl_type_get_sizeof(), and CPL_TYPE_INT.

cpl_error_code cpl_image_or ( cpl_image *  self,
const cpl_image *  first,
const cpl_image *  second 
)

The bit-wise or of two images with integer pixels.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
secondSecond operand
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
Note
CPL_TYPE_INT is required
See also
cpl_mask_or() for the equivalent logical operation

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the images have different sizes
  • CPL_ERROR_INVALID_TYPE if the passed image type is as required

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), cpl_image_or_mask(), cpl_type_get_name(), cpl_type_get_sizeof(), and CPL_TYPE_INT.

void cpl_image_or_mask ( cpl_image *  self,
const cpl_image *  first,
const cpl_image *  second 
)

The bit-wise or of the input masks onto the output mask.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
secondSecond operand
Returns
void
Note
Error checking assumed to have been performed by the caller

References cpl_malloc(), cpl_mask_duplicate(), cpl_mask_get_data(), cpl_mask_get_data_const(), cpl_mask_or(), and cpl_mask_wrap().

Referenced by cpl_image_and(), cpl_image_or(), and cpl_image_xor().

void cpl_image_or_mask_unary ( cpl_image *  self,
const cpl_image *  first 
)

The bit-wise or of the input mask(s) onto the output mask.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
Returns
void
Note
Error checking assumed to have been performed by the caller
See also
cpl_image_or_mask

References cpl_mask_duplicate(), cpl_mask_get_data(), and cpl_mask_get_data_const().

Referenced by cpl_image_and_scalar(), cpl_image_not(), cpl_image_or_scalar(), and cpl_image_xor_scalar().

cpl_error_code cpl_image_or_scalar ( cpl_image *  self,
const cpl_image *  first,
cpl_bitmask  second 
)

The bit-wise or of a scalar and an image with integer pixels.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
secondSecond operand (scalar)
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
Note
CPL_TYPE_INT is required

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the images have different sizes
  • CPL_ERROR_INVALID_TYPE if the passed image type is as required

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), cpl_image_or_mask_unary(), cpl_type_get_name(), cpl_type_get_sizeof(), and CPL_TYPE_INT.

cpl_error_code cpl_image_power ( cpl_image *  self,
double  exponent 
)

Compute the elementwise power of the image.

Parameters
selfImage to be modified in place.
exponentScalar exponent.
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error

Modifies the image by lifting each of its pixels to exponent.

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Pixels for which the power to the given exponent is not defined are rejected and set to zero.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, cpl_type_get_name(), and CPL_TYPE_INT.

Referenced by cpl_image_power_create(), and cpl_imagelist_power().

cpl_image* cpl_image_power_create ( const cpl_image *  image,
double  exponent 
)

Create a new image by elementwise raising of an image to a power.

Parameters
imageImage to raise to a power
exponentscalar exponent
Returns
1 newly allocated image or NULL in case of an error
See also
cpl_image_power
cpl_image_add_scalar_create

References cpl_ensure, cpl_error_get_code(), cpl_image_delete(), cpl_image_duplicate(), and cpl_image_power().

cpl_image* cpl_image_rebin ( const cpl_image *  image,
cpl_size  xstart,
cpl_size  ystart,
cpl_size  xstep,
cpl_size  ystep 
)

Rebin an image.

Parameters
imageThe image to rebin
xstartstart x position of binning (starting from 1...)
ystartstart y position of binning (starting from 1...)
xstepBin size in x.
ystepBin size in y.
Returns
The newly allocated rebinned image or NULL in case of error

If both bin sizes in x and y are = 2, an image with (about) a quarter of the pixels of the input image will be created. Each new pixel will be the sum of the values of all contributing input pixels. If a bin is incomplete (i.e., the input image size is not a multiple of the bin sizes), it is not computed.

xstep and ystep must not be greater than the sizes of the rebinned region.

The input image type can be CPL_TYPE_INT, CPL_TYPE_FLOAT and CPL_TYPE_DOUBLE. If the image has bad pixels, they will be propagated to the rebinned image "pessimistically", i.e., if at least one of the contributing input pixels is bad, then the corresponding output pixel will also be flagged "bad". If you need an image of "weights" for each rebinned pixel, just cast the input image bpm into a CPL_TYPE_INT image, and apply cpl_image_rebin() to it too.

The returned image must be deallocated using cpl_image_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if the input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if xstep, ystep, xstart, ystart are not positive
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_image_get_size_x(), cpl_mask_get_data(), cpl_mask_get_data_const(), and cpl_mask_new().

cpl_error_code cpl_image_reject ( cpl_image *  im,
cpl_size  x,
cpl_size  y 
)

Set a pixel as bad in an image.

Parameters
imthe input image
xthe x pixel position in the image (first pixel is 1)
ythe y pixel position in the image (first pixel is 1)
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the specified position is out of the image

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_mask_get_data(), and cpl_mask_new().

cpl_error_code cpl_image_reject_from_mask ( cpl_image *  im,
const cpl_mask *  map 
)

Set the bad pixels in an image as defined in a mask.

Parameters
imthe input image
mapthe mask defining the bad pixels
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

If the input image has a bad pixel map prior to the call, it is overwritten.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if the input image or the input map is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the image and the map have different sizes

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_bpm(), cpl_mask_get_data(), cpl_mask_get_data_const(), cpl_mask_get_size_x(), and cpl_mask_get_size_y().

Referenced by cpl_apertures_new_from_image(), cpl_image_warp(), cpl_image_warp_polynomial(), and cpl_imagelist_swap_axis_create().

cpl_error_code cpl_image_reject_value ( cpl_image *  self,
cpl_value  mode 
)

Reject pixels with the specified special value(s)

Parameters
selfInput image to modify
modeBit field specifying which special value(s) to reject

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if mode is 1, e.g. due to a logical or (||) of the allowed options or if the pixel type is complex
  • CPL_ERROR_UNSUPPORTED_MODE if mode is otherwise different from the allowed options.

References CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, and CPL_TYPE_INT.

cpl_error_code cpl_image_save ( const cpl_image *  self,
const char *  filename,
cpl_type  type,
const cpl_propertylist pl,
unsigned  mode 
)

Save an image to a FITS file.

Parameters
selfImage to write to disk or NULL
filenameName of the file to write to
typeThe type used to represent the data in the file
plProperty list for the output header or NULL
modeThe desired output options
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_propertylist_save()

This function saves an image to a FITS file. If a property list is provided, it is written to the header where the image is written. The image may be NULL, in this case only the propertylist is saved.

Supported image types are CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT.

The type used in the file can be one of: CPL_TYPE_UCHAR (8 bit unsigned), CPL_TYPE_SHORT (16 bit signed), CPL_TYPE_USHORT (16 bit unsigned), CPL_TYPE_INT (32 bit signed), CPL_TYPE_FLOAT (32 bit floating point), or CPL_TYPE_DOUBLE (64 bit floating point). Additionally, the special value CPL_TYPE_UNSPECIFIED is allowed. This value means that the type used for saving is the pixel type of the input image. Using the image pixel type as saving type ensures that the saving incurs no loss of information.

Supported output modes are CPL_IO_CREATE (create a new file) and CPL_IO_EXTEND (append a new extension to an existing file).

Upon success the image will reside in a FITS data unit with NAXIS = 2. Is it possible to save a single image in a FITS data unit with NAXIS = 3, see cpl_imagelist_save().

When the data written to disk are of an integer type, the output mode CPL_IO_EXTEND can be combined (via bit-wise or) with an option for tile-compression. This compression of integer data is lossless. The options are: CPL_IO_COMPRESS_GZIP, CPL_IO_COMPRESS_RICE, CPL_IO_COMPRESS_HCOMPRESS, CPL_IO_COMPRESS_PLIO. With compression the type must be CPL_TYPE_UNSPECIFIED or CPL_TYPE_INT.

Note that in append mode the file must be writable (and do not take for granted that a file is writable just because it was created by the same application, as this depends from the system umask).

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the type or the mode is not supported
  • CPL_ERROR_INVALID_TYPE if the passed pixel type is not supported
  • CPL_ERROR_FILE_NOT_CREATED if the output file cannot be created
  • CPL_ERROR_FILE_IO if the data cannot be written to the file

References CPL_ERROR_NONE, and cpl_propertylist_save().

cpl_error_code cpl_image_set ( cpl_image *  image,
cpl_size  xpos,
cpl_size  ypos,
double  value 
)

Set the pixel at the given position to the given value.

Parameters
imageinput image.
xposPixel x position (FITS convention, 1 for leftmost)
yposPixel y position (FITS convention, 1 for lowest)
valueNew pixel value
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

Images can be CPL_TYPE_FLOAT, CPL_TYPE_INT, CPL_TYPE_DOUBLE.

If the pixel is flagged as rejected, this flag is removed.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the passed position is not in the image
  • CPL_ERROR_INVALID_TYPE if the image pixel type is not supported

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_accept().

Referenced by cpl_image_fill_window().

cpl_mask* cpl_image_set_bpm ( cpl_image *  self,
cpl_mask *  bpm 
)

Replace the bad pixel map of the image.

Parameters
selfImage to modfify
bpmBad Pixel Map (BPM) to set, replacing the old one, or NULL
Returns
A pointer to the old mask of bad pixels, or NULL
Note
NULL is returned if the image had no bad pixel map, while a non-NULL returned mask must be deallocated by the caller using cpl_mask_delete().
See also
cpl_image_get_bpm_const()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if self is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_image_unset_bpm().

cpl_error_code cpl_image_set_complex ( cpl_image *  image,
cpl_size  xpos,
cpl_size  ypos,
double complex  value 
)

Set the pixel at the given position to the given complex value.

Parameters
imageinput image.
xposPixel x position (FITS convention, 1 for leftmost)
yposPixel y position (FITS convention, 1 for lowest)
valueNew pixel value
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_set()
Note
This function is available iff the application includes complex.h

Images can be CPL_TYPE_FLOAT_COMPLEX or CPL_TYPE_DOUBLE_COMPLEX.

If the pixel is flagged as rejected, this flag is removed.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the passed position is not in the image
  • CPL_ERROR_INVALID_TYPE if the image pixel type is not supported

References cpl_ensure_code, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_accept(), and CPL_TYPE_FLOAT_COMPLEX.

cpl_error_code cpl_image_shift ( cpl_image *  self,
cpl_size  dx,
cpl_size  dy 
)

Shift an image by integer offsets.

Parameters
selfThe image to shift in place
dxThe shift in X
dyThe shift in Y
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

The new zones (in the result image) where no new value is computed are set to 0 and flagged as bad pixels. The shift values have to be valid: -nx < dx < nx and -ny < dy < ny

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the requested shift is bigger than the image size

References cpl_ensure_code, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_mask_new(), cpl_mask_shift(), and cpl_type_get_sizeof().

cpl_error_code cpl_image_subtract ( cpl_image *  im1,
const cpl_image *  im2 
)

Subtract two images, store the result in the first image.

Parameters
im1first operand.
im2second operand.
Returns
the _cpl_error_code_ or CPL_ERROR_NONE
See also
cpl_image_add()
cpl_image* cpl_image_subtract_create ( const cpl_image *  image1,
const cpl_image *  image2 
)

Subtract two images.

Parameters
image1first operand
image2second operand
Returns
1 newly allocated image or NULL on error
See also
cpl_image_add_create()
cpl_error_code cpl_image_subtract_scalar ( cpl_image *  self,
double  scalar 
)

Elementwise subtraction of a scalar from an image.

Parameters
selfImage to be modified in place.
scalarNumber to subtract
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
See also
cpl_image_add_scalar()

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_image_get_type().

Referenced by cpl_image_normalise(), cpl_image_subtract_scalar_create(), cpl_imagelist_subtract_scalar(), and cpl_plot_image().

cpl_image* cpl_image_subtract_scalar_create ( const cpl_image *  image,
double  subtrahend 
)

Create an image by elementwise subtraction of a scalar from an image.

Parameters
imageImage to be subtracted from
subtrahendNumber to subtract
Returns
1 newly allocated image or NULL in case of an error
See also
cpl_image_subtract_scalar
cpl_image_add_scalar_create

References cpl_ensure, cpl_error_get_code(), cpl_image_delete(), cpl_image_duplicate(), and cpl_image_subtract_scalar().

Referenced by cpl_plot_image().

cpl_error_code cpl_image_threshold ( cpl_image *  image_in,
double  lo_cut,
double  hi_cut,
double  assign_lo_cut,
double  assign_hi_cut 
)

Threshold an image to a given interval.

Parameters
image_inImage to threshold.
lo_cutLower bound.
hi_cutHigher bound.
assign_lo_cutValue to assign to pixels below low bound.
assign_hi_cutValue to assign to pixels above high bound.
Returns
the _cpl_error_code_ or CPL_ERROR_NONE

Pixels outside of the provided interval are assigned the given values.

Use FLT_MIN and FLT_MAX for floating point images and DBL_MIN and DBL_MAX for double images for the lo_cut and hi_cut to avoid any pixel replacement.

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. lo_cut must be smaller than or equal to hi_cut.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_ILLEGAL_INPUT if lo_cut is greater than hi_cut

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, and CPL_ERROR_NULL_INPUT.

Referenced by cpl_imagelist_threshold().

cpl_error_code cpl_image_turn ( cpl_image *  self,
int  rot 
)

Rotate an image by a multiple of 90 degrees clockwise.

Parameters
selfThe image to rotate in place.
rotThe multiple: -1 is a rotation of 90 deg counterclockwise.
Returns
CPL_ERROR_NONE on success, otherwise the relevant _cpl_error_code_
Note
The dimension of a rectangular image is changed.

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

The definition of the rotation relies on the FITS convention: The lower left corner of the image is at (1,1), x increasing from left to right, y increasing from bottom to top.

For rotations of +90 or -90 degrees on rectangular non-1D-images, the pixel buffer is temporarily duplicated.

rot may be any integer value, its modulo 4 determines the rotation:

  • -3 to turn 270 degrees counterclockwise.
  • -2 to turn 180 degrees counterclockwise.
  • -1 to turn 90 degrees counterclockwise.
  • 0 to not turn
  • +1 to turn 90 degrees clockwise (same as -3)
  • +2 to turn 180 degrees clockwise (same as -2).
  • +3 to turn 270 degrees clockwise (same as -1).

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, and cpl_mask_turn().

cpl_mask* cpl_image_unset_bpm ( cpl_image *  self)

Remove the bad pixel map from the image.

Parameters
selfimage to process
Returns
A pointer to the cpl_mask of bad pixels, or NULL
Note
NULL is returned if the image has no bad pixel map
The returned mask must be deallocated using cpl_mask_delete().
See also
cpl_image_set_bpm()

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_image_set_bpm().

Referenced by cpl_image_accept_all().

void* cpl_image_unwrap ( cpl_image *  d)

Free memory associated to an cpl_image object, but the pixel buffer.

Parameters
dImage to destroy.
Returns
A pointer to the data array or NULL if the input is NULL.

Frees all memory associated to an cpl_image, except the pixel buffer. cpl_image_unwrap() is provided for images that are constructed by passing a pixel buffer to one of cpl_image_wrap_{double,float,int}().

Note
The pixel buffer must subsequently be deallocated. Failure to do so will result in a memory leak.

References cpl_free(), and cpl_mask_delete().

cpl_error_code cpl_image_warp ( cpl_image *  out,
const cpl_image *  in,
const cpl_image *  deltax,
const cpl_image *  deltay,
const cpl_vector *  xprofile,
double  xradius,
const cpl_vector *  yprofile,
double  yradius 
)

Warp an image.

Parameters
outPre-allocated destination image to hold the result
inSource image to warp
deltaxThe x shift of each pixel, same image size as out
deltayThe y shift of each pixel, same image size as out
xprofileInterpolation weight as a function of the distance in X
xradiusPositive inclusion radius in the X-dimension
yprofileInterpolation weight as a function of the distance in Y
yradiusPositive inclusion radius in the Y-dimension
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_get_interpolated()

The pixel value at the (integer) position (u, v) in the destination image is interpolated from the (typically non-integer) pixel position (x, y) in the source image, where

x = u - deltax(u, v),
y = v - deltay(u, v).

The identity transform is thus given by deltax and deltay filled with zeros.

The first pixel is (1, 1), located in the lower left. 'out' and 'in' may have different sizes, while deltax and deltay must have the same size as 'out'. deltax and deltay must have pixel type CPL_TYPE_DOUBLE.

Beware that extreme transformations may lead to blank images.

'out' and 'in' may be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

Examples of profiles and radius are:

xprofile = cpl_vector_new(CPL_KERNEL_DEF_SAMPLES);
cpl_vector_fill_kernel_profile(profile, CPL_KERNEL_DEFAULT,
      CPL_KERNEL_DEF_WIDTH);
xradius = CPL_KERNEL_DEF_WIDTH;

In case a correction for flux conservation were required, please create a correction map using the function cpl_image_fill_jacobian().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input images sizes are incompatible or if the delta images are not of type CPL_TYPE_DOUBLE
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure_code, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_image_get_data_double_const(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_image_reject_from_mask(), cpl_malloc(), cpl_mask_delete(), cpl_mask_get_data(), cpl_mask_new(), CPL_TYPE_DOUBLE, cpl_vector_get_data_const(), and cpl_vector_get_size().

cpl_error_code cpl_image_warp_polynomial ( cpl_image *  out,
const cpl_image *  in,
const cpl_polynomial *  poly_x,
const cpl_polynomial *  poly_y,
const cpl_vector *  xprofile,
double  xradius,
const cpl_vector *  yprofile,
double  yradius 
)

Warp an image according to a 2D polynomial transformation.

Parameters
outPre-allocated image to hold the result
inImage to warp.
poly_xDefines source x-pos corresponding to destination (u,v).
poly_yDefines source y-pos corresponding to destination (u,v).
xprofileInterpolation weight as a function of the distance in X
xradiusPositive inclusion radius in the X-dimension
yprofileInterpolation weight as a function of the distance in Y
yradiusPositive inclusion radius in the Y-dimension
Returns
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error
See also
cpl_image_get_interpolated()

'out' and 'in' may have different dimensions and types.

The pair of 2D polynomials are used internally like this

x = cpl_polynomial_eval(poly_x, (u, v));
y = cpl_polynomial_eval(poly_y, (u, v));

where (u,v) are (integer) pixel positions in the destination image and (x,y) are the corresponding pixel positions (typically non-integer) in the source image.

The identity transform (poly_x(u,v) = u, poly_y(u,v) = v) would thus overwrite the 'out' image with the 'in' image, starting from the lower left if the two images are of different sizes.

Beware that extreme transformations may lead to blank images.

The input image type may be CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.

In case a correction for flux conservation were required, please create a correction map using the function cpl_image_fill_jacobian_polynomial().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the polynomial dimensions are not 2
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_free(), cpl_image_reject_from_mask(), cpl_malloc(), cpl_mask_delete(), cpl_mask_get_data(), cpl_mask_new(), cpl_polynomial_get_dimension(), cpl_vector_delete(), cpl_vector_get_data(), cpl_vector_get_data_const(), cpl_vector_get_size(), and cpl_vector_new().

cpl_image* cpl_image_wrap_double ( cpl_size  nx,
cpl_size  ny,
double *  pixels 
)

Create a double image using an existing pixel buffer.

Parameters
nxSize in x (the number of columns)
nySize in y (the number of rows)
pixelsdouble * pixel data
Returns
1 newly allocated cpl_image or NULL in case of an error
See also
cpl_image_new

The pixel array is set to point to that of the argument. The pixel array must contain nx*ny doubles.

The allocated image must be deallocated with cpl_image_unwrap().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if nx or ny is non-positive or zero.

References cpl_ensure, CPL_ERROR_NULL_INPUT, and CPL_TYPE_DOUBLE.

Referenced by cpl_image_divide_create().

cpl_image* cpl_image_wrap_double_complex ( cpl_size  nx,
cpl_size  ny,
double complex *  pixels 
)

Create a double complex image using an existing pixel buffer.

Parameters
nxSize in x (the number of columns)
nySize in y (the number of rows)
pixelsdouble complex * pixel data.
Returns
1 newly allocated cpl_image or NULL on error
See also
cpl_image_wrap_double()
Note
This function is available iff the application includes complex.h

References cpl_ensure, CPL_ERROR_NULL_INPUT, and CPL_TYPE_DOUBLE_COMPLEX.

Referenced by cpl_image_divide_create().

cpl_image* cpl_image_wrap_float ( cpl_size  nx,
cpl_size  ny,
float *  pixels 
)

Create a float image using an existing pixel buffer.

Parameters
nxSize in x (the number of columns)
nySize in y (the number of rows)
pixelsfloat * pixel data.
Returns
1 newly allocated cpl_image or NULL on error
See also
cpl_image_wrap_double()

References cpl_ensure, CPL_ERROR_NULL_INPUT, and CPL_TYPE_FLOAT.

Referenced by cpl_image_divide_create().

cpl_image* cpl_image_wrap_float_complex ( cpl_size  nx,
cpl_size  ny,
float complex *  pixels 
)

Create a float complex image using an existing pixel buffer.

Parameters
nxSize in x (the number of columns)
nySize in y (the number of rows)
pixelsfloat complex * pixel data.
Returns
1 newly allocated cpl_image or NULL on error
See also
cpl_image_wrap_double_complex()

References cpl_ensure, CPL_ERROR_NULL_INPUT, and CPL_TYPE_FLOAT_COMPLEX.

Referenced by cpl_image_divide_create().

cpl_image* cpl_image_wrap_int ( cpl_size  nx,
cpl_size  ny,
int *  pixels 
)

Create an integer image using an existing pixel buffer.

Parameters
nxSize in x (the number of columns)
nySize in y (the number of rows)
pixelsint * pixel data.
Returns
1 newly allocated cpl_image or NULL on error
See also
cpl_image_wrap_double()

References cpl_ensure, CPL_ERROR_NULL_INPUT, and CPL_TYPE_INT.

Referenced by cpl_geom_img_offset_saa(), cpl_image_divide_create(), and cpl_image_new_from_mask().

cpl_error_code cpl_image_xor ( cpl_image *  self,
const cpl_image *  first,
const cpl_image *  second 
)

The bit-wise xor of two images with integer pixels.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
secondSecond operand
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
Note
CPL_TYPE_INT is required
See also
cpl_mask_xor() for the equivalent logical operation

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the images have different sizes
  • CPL_ERROR_INVALID_TYPE if the passed image type is as required

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), cpl_image_or_mask(), cpl_type_get_name(), cpl_type_get_sizeof(), and CPL_TYPE_INT.

cpl_error_code cpl_image_xor_scalar ( cpl_image *  self,
const cpl_image *  first,
cpl_bitmask  second 
)

The bit-wise xor of a scalar and an image with integer pixels.

Parameters
selfPre-allocated image to hold the result
firstFirst operand, or NULL for an in-place operation
secondSecond operand (scalar)
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_ on error
Note
CPL_TYPE_INT is required

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_INCOMPATIBLE_INPUT if the images have different sizes
  • CPL_ERROR_INVALID_TYPE if the passed image type is as required

References cpl_ensure_code, CPL_ERROR_INCOMPATIBLE_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_get_type(), cpl_image_or_mask_unary(), cpl_type_get_name(), cpl_type_get_sizeof(), and CPL_TYPE_INT.

cpl_vector* cpl_vector_new_from_image_column ( const cpl_image *  image_in,
cpl_size  pos 
)

Extract a column from an image.

Parameters
image_inInput image
posPosition of the column (1 for the left one)
Returns
1 newly allocated cpl_vector or NULL on error

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The returned vector must be deallocated using cpl_vector_delete().

The bad pixels map is not taken into account in this function.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pos is not valid
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_vector_delete(), cpl_vector_get_data(), and cpl_vector_new().

Referenced by cpl_image_get_fwhm().

cpl_vector* cpl_vector_new_from_image_row ( const cpl_image *  image_in,
cpl_size  pos 
)

Extract a row from an image.

Parameters
image_inInput image
posPosition of the row (1 for the bottom one)
Returns
1 newly allocated cpl_vector or NULL on error

Images can be of type CPL_TYPE_INT, CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE. The returned vector must be deallocated using cpl_vector_delete().

The bad pixels map is not taken into account in this function.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pos is not valid
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, cpl_vector_delete(), cpl_vector_get_data(), and cpl_vector_new().

Referenced by cpl_image_get_fwhm().

cpl-6.6.1/html/group__cpl__stats.html0000644000460300003120000023024212553662432014567 00000000000000 Common Pipeline Library Reference Manual: Statistics
Common Pipeline Library Reference Manual  6.6.1

Typedefs

typedef struct _cpl_stats_ cpl_stats
 The opaque CPL stats data type. More...
 
typedef enum _cpl_stats_mode_ cpl_stats_mode
 The CPL stats mode. It is a bit field. More...
 

Enumerations

enum  _cpl_stats_mode_ {
  CPL_STATS_MIN,
  CPL_STATS_MAX,
  CPL_STATS_MEAN,
  CPL_STATS_MEDIAN,
  CPL_STATS_STDEV,
  CPL_STATS_FLUX,
  CPL_STATS_ABSFLUX,
  CPL_STATS_SQFLUX,
  CPL_STATS_MINPOS,
  CPL_STATS_MAXPOS,
  CPL_STATS_CENTROID,
  CPL_STATS_MEDIAN_DEV,
  CPL_STATS_MAD,
  CPL_STATS_ALL
}
 The values of the CPL stats mode. The values can be combined with bitwise or. More...
 

Functions

void cpl_stats_delete (cpl_stats *stats)
 Free memory associated to an cpl_stats object. More...
 
cpl_error_code cpl_stats_dump (const cpl_stats *self, cpl_stats_mode mode, FILE *stream)
 Dump a cpl_stats object. More...
 
double cpl_stats_get_absflux (const cpl_stats *in)
 Get the absolute flux from a cpl_stats object. More...
 
double cpl_stats_get_centroid_x (const cpl_stats *in)
 Get the x centroid position from a cpl_stats object. More...
 
double cpl_stats_get_centroid_y (const cpl_stats *in)
 Get the y centroid position from a cpl_stats object. More...
 
double cpl_stats_get_flux (const cpl_stats *in)
 Get the flux from a cpl_stats object. More...
 
double cpl_stats_get_mad (const cpl_stats *in)
 Get the median of the absolute median deviation. More...
 
double cpl_stats_get_max (const cpl_stats *in)
 Get the maximum from a cpl_stats object. More...
 
cpl_size cpl_stats_get_max_x (const cpl_stats *in)
 Get the maximum x position from a cpl_stats object. More...
 
cpl_size cpl_stats_get_max_y (const cpl_stats *in)
 Get the maximum y position from a cpl_stats object. More...
 
double cpl_stats_get_mean (const cpl_stats *in)
 Get the mean from a cpl_stats object. More...
 
double cpl_stats_get_median (const cpl_stats *in)
 Get the median from a cpl_stats object. More...
 
double cpl_stats_get_median_dev (const cpl_stats *in)
 Get the mean of the absolute median deviation from a cpl_stats object. More...
 
double cpl_stats_get_min (const cpl_stats *in)
 Get the minimum from a cpl_stats object. More...
 
cpl_size cpl_stats_get_min_x (const cpl_stats *in)
 Get the minimum x position from a cpl_stats object. More...
 
cpl_size cpl_stats_get_min_y (const cpl_stats *in)
 Get the minimum y position from a cpl_stats object. More...
 
cpl_size cpl_stats_get_npix (const cpl_stats *in)
 Get the number of pixels from a cpl_stats object. More...
 
double cpl_stats_get_sqflux (const cpl_stats *in)
 Get the sum of the squared values from a cpl_stats object. More...
 
double cpl_stats_get_stdev (const cpl_stats *in)
 Get the std. dev. from a cpl_stats object. More...
 
cpl_statscpl_stats_new_from_image (const cpl_image *image, cpl_stats_mode mode)
 Compute various statistics of an image. More...
 
cpl_statscpl_stats_new_from_image_window (const cpl_image *image, cpl_stats_mode mode, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
 Compute various statistics of an image sub-window. More...
 

Detailed Description

This module provides functions to handle the cpl_stats object. This object can contain the statistics that have been computed from different CPL objects. Currently, only the function that computes statistics on images (or images windows) is provided.

Synopsis:
#include "cpl_stats.h"

Typedef Documentation

typedef struct _cpl_stats_ cpl_stats

The opaque CPL stats data type.

The CPL stats mode. It is a bit field.

Enumeration Type Documentation

The values of the CPL stats mode. The values can be combined with bitwise or.

Enumerator
CPL_STATS_MIN 

The minimum

CPL_STATS_MAX 

The maximum

CPL_STATS_MEAN 

The mean

CPL_STATS_MEDIAN 

The median

CPL_STATS_STDEV 

The standard deviation

CPL_STATS_FLUX 

The flux

CPL_STATS_ABSFLUX 

The absolute flux

CPL_STATS_SQFLUX 

The square flux

CPL_STATS_MINPOS 

The position of the minimum

CPL_STATS_MAXPOS 

The position of the maximum

CPL_STATS_CENTROID 

The centroid position

CPL_STATS_MEDIAN_DEV 

The mean of the absolute median deviation

CPL_STATS_MAD 

The median of the absolute median deviation

CPL_STATS_ALL 

All of the above

Function Documentation

void cpl_stats_delete ( cpl_stats stats)

Free memory associated to an cpl_stats object.

Parameters
statsthe object to delete
Returns
void

Frees all memory associated to a cpl_stats object. If the object stats is NULL, nothing is done and no error is set.

References cpl_free().

Referenced by cpl_image_get_mad(), cpl_image_get_mad_window(), cpl_image_get_maxpos(), cpl_image_get_maxpos_window(), cpl_image_get_median_dev(), cpl_image_get_median_dev_window(), cpl_image_get_minpos(), cpl_image_get_minpos_window(), cpl_image_normalise(), and cpl_stats_new_from_image_window().

cpl_error_code cpl_stats_dump ( const cpl_stats self,
cpl_stats_mode  mode,
FILE *  stream 
)

Dump a cpl_stats object.

Parameters
selfcpl_stats object to dump
modeBit field specifying which statistics to dump
streamThe output stream
Returns
CPL_ERROR_NONE or the relevant the _cpl_error_code_
See also
cpl_stats_new_from_image_window()

It is an error to request parameters that have not been set.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if mode specifies statistics that have not been computed
  • CPL_ERROR_FILE_IO if the write fails

References cpl_ensure_code, CPL_ERROR_FILE_IO, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, CPL_SIZE_FORMAT, CPL_STATS_ABSFLUX, CPL_STATS_CENTROID, CPL_STATS_FLUX, CPL_STATS_MAD, CPL_STATS_MAX, CPL_STATS_MAXPOS, CPL_STATS_MEAN, CPL_STATS_MEDIAN, CPL_STATS_MEDIAN_DEV, CPL_STATS_MIN, CPL_STATS_MINPOS, CPL_STATS_SQFLUX, and CPL_STATS_STDEV.

double cpl_stats_get_absflux ( const cpl_stats in)

Get the absolute flux from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
The absolute flux, or a negative number on error
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_ABSFLUX.

double cpl_stats_get_centroid_x ( const cpl_stats in)

Get the x centroid position from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the x centroid
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_CENTROID.

double cpl_stats_get_centroid_y ( const cpl_stats in)

Get the y centroid position from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the y centroid
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_CENTROID.

double cpl_stats_get_flux ( const cpl_stats in)

Get the flux from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the flux
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_FLUX.

double cpl_stats_get_mad ( const cpl_stats in)

Get the median of the absolute median deviation.

Parameters
inthe cpl_stats object
Returns
The median of the absolute median deviation, or undefined on error
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_MAD.

Referenced by cpl_image_get_mad(), and cpl_image_get_mad_window().

double cpl_stats_get_max ( const cpl_stats in)

Get the maximum from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the maximum value
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_STATS_MAX, and CPL_STATS_MAXPOS.

Referenced by cpl_image_normalise().

cpl_size cpl_stats_get_max_x ( const cpl_stats in)

Get the maximum x position from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the x position (1 for the first pixel), non-positive on error.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_STATS_MAX, and CPL_STATS_MAXPOS.

Referenced by cpl_image_get_maxpos(), and cpl_image_get_maxpos_window().

cpl_size cpl_stats_get_max_y ( const cpl_stats in)

Get the maximum y position from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the y position (1 for the first pixel), non-positive on error.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_STATS_MAX, and CPL_STATS_MAXPOS.

Referenced by cpl_image_get_maxpos(), and cpl_image_get_maxpos_window().

double cpl_stats_get_mean ( const cpl_stats in)

Get the mean from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the mean value
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_MEAN.

double cpl_stats_get_median ( const cpl_stats in)

Get the median from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the median value
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_MEDIAN.

Referenced by cpl_image_get_mad(), cpl_image_get_mad_window(), cpl_image_get_median_dev(), and cpl_image_get_median_dev_window().

double cpl_stats_get_median_dev ( const cpl_stats in)

Get the mean of the absolute median deviation from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
The mean of the absolute median deviation, or undefined on error
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_MEDIAN_DEV.

Referenced by cpl_image_get_median_dev(), and cpl_image_get_median_dev_window().

double cpl_stats_get_min ( const cpl_stats in)

Get the minimum from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the minimum value

The call that created the cpl_stats object must have determined the minimum value.

In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the requested stat has not been computed in in

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_STATS_MIN, and CPL_STATS_MINPOS.

Referenced by cpl_image_normalise().

cpl_size cpl_stats_get_min_x ( const cpl_stats in)

Get the minimum x position from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the x position (1 for the first pixel), non-positive on error.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_STATS_MIN, and CPL_STATS_MINPOS.

Referenced by cpl_image_get_minpos(), and cpl_image_get_minpos_window().

cpl_size cpl_stats_get_min_y ( const cpl_stats in)

Get the minimum y position from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the y position (1 for the first pixel), non-positive on error.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, CPL_STATS_MIN, and CPL_STATS_MINPOS.

Referenced by cpl_image_get_minpos(), and cpl_image_get_minpos_window().

cpl_size cpl_stats_get_npix ( const cpl_stats in)

Get the number of pixels from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the number of pixels, -1 in error case.

The creation of a cpl_stats object always causes the number of pixels to be determined.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

References cpl_ensure, and CPL_ERROR_NULL_INPUT.

double cpl_stats_get_sqflux ( const cpl_stats in)

Get the sum of the squared values from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the square flux, or a negative number on error
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_SQFLUX.

double cpl_stats_get_stdev ( const cpl_stats in)

Get the std. dev. from a cpl_stats object.

Parameters
inthe cpl_stats object
Returns
the standard deviation
See also
cpl_stats_get_min()

References cpl_ensure, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, and CPL_STATS_STDEV.

cpl_stats* cpl_stats_new_from_image ( const cpl_image *  image,
cpl_stats_mode  mode 
)

Compute various statistics of an image.

Parameters
imageinput image.
modeBit field specifying which statistics to compute
Returns
1 newly allocated cpl_stats structure or NULL in error case
See also
cpl_stats_new_from_image_window()

References cpl_ensure, CPL_ERROR_NULL_INPUT, and cpl_stats_new_from_image_window().

Referenced by cpl_image_get_mad(), cpl_image_get_maxpos(), cpl_image_get_median_dev(), cpl_image_get_minpos(), and cpl_image_normalise().

cpl_stats* cpl_stats_new_from_image_window ( const cpl_image *  image,
cpl_stats_mode  mode,
cpl_size  llx,
cpl_size  lly,
cpl_size  urx,
cpl_size  ury 
)

Compute various statistics of an image sub-window.

Parameters
imageInput image.
modeBit field specifying which statistics to compute
llxLower left x position (FITS convention)
llyLower left y position (FITS convention)
urxUpper right x position (FITS convention)
uryUpper right y position (FITS convention)
Returns
1 newly allocated cpl_stats structure or NULL in error case

Compute various image statistics.

The specified bounds are included in the specified region.

The statistics to compute is specified with a bit field, that may be set to any of these values

  • CPL_STATS_MIN
  • CPL_STATS_MAX
  • CPL_STATS_MEAN
  • CPL_STATS_MEDIAN
  • CPL_STATS_MEDIAN_DEV
  • CPL_STATS_MAD
  • CPL_STATS_STDEV
  • CPL_STATS_FLUX
  • CPL_STATS_ABSFLUX
  • CPL_STATS_SQFLUX
  • CPL_STATS_CENTROID
  • CPL_STATS_MINPOS
  • CPL_STATS_MAXPOS or any bitwise or (|) of these. For convenience the special value CPL_STATS_ALL may also be used, it is the conbination of all of the above values.

E.g. the mode CPL_STATS_MIN | CPL_STATS_MEDIAN specifies the minimum and the median of the image.

In the case of CPL_STATS_MIN and CPL_STATS_MAX where more than one set of coordinates share the extremum it is undefined which of those coordinates will be returned.

On i386 platforms there can be significant differences in the round-off of the computation of single statistics and statistics computed via CPL_STATS_ALL. This is especially true for squared quantities such as the CPL_STATS_SQFLUX and CPL_STATS_STDEV.

Images can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT.

For the CPL_STATS_CENTROID computation, if there are negative pixels, the minimum value is added to all the pixels in order to have all pixels with positive values for computation.

The returned object must be deallocated using cpl_stats_delete().

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if the defined window is not in the image
  • CPL_ERROR_ILLEGAL_INPUT if the window definition is wrong (e.g llx > urx)
  • CPL_ERROR_DATA_NOT_FOUND if all the pixels are bad
  • CPL_ERROR_INVALID_TYPE if the passed image type is not supported
  • CPL_ERROR_INVALID_TYPE if mode is 1, e.g. due to a logical or (||) of the allowed options.
  • CPL_ERROR_UNSUPPORTED_MODE if mode is otherwise different from the allowed options.

References cpl_ensure, CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_INVALID_TYPE, CPL_ERROR_NULL_INPUT, CPL_ERROR_UNSUPPORTED_MODE, cpl_malloc(), cpl_mask_get_data_const(), CPL_STATS_ABSFLUX, CPL_STATS_ALL, CPL_STATS_CENTROID, cpl_stats_delete(), CPL_STATS_FLUX, CPL_STATS_MAD, CPL_STATS_MAX, CPL_STATS_MAXPOS, CPL_STATS_MEAN, CPL_STATS_MEDIAN, CPL_STATS_MEDIAN_DEV, CPL_STATS_MIN, CPL_STATS_MINPOS, CPL_STATS_SQFLUX, and CPL_STATS_STDEV.

Referenced by cpl_image_get_mad_window(), cpl_image_get_maxpos_window(), cpl_image_get_median_dev_window(), cpl_image_get_minpos_window(), and cpl_stats_new_from_image().

cpl-6.6.1/html/folderclosed.png0000644000460300003120000000115012553662426013343 00000000000000‰PNG  IHDRÚ}\ˆ/IDATxí]MOÔ@~ÚúuØlp]ö¿#›Å]PYECˆ\9ù¼yÑß`ÖÄÿàÿÀÉxóâ¢C &=qÐÄ£—vZçv¶3m؃‡vžLûNç}Þ÷}Þ½ZA@n° OäNp ’xóþK°ññ€xÜj”°8sÑ€“ “€œ_¼[Âíæ§ïD'‚•yye+ø¼û 7#rNŸlïük* ¾0Ь_d«_(àñÖ±àôz=ñxõv§÷h©‰z¹€šØP-äóä’̪uý¼$»\DãJc—B4¯ãÝÖ.:£Ï-ÑÏß}µŠLEíºþ #—ûáºÀÏgN;BŠ€6ïýñ䬜…ö@’Ðåñp&™h>p9¤™EEά¨ÎÊ‘" u¥n€$R"?{¹<˜…ë…%PNtâ$‰ß¶±úá+^<é"§2 ªDq”q´\¬«Ò™a–Œ‘©Aÿ€"Ôµ ™êŸèP£}#Eàz{û.8i îp³ê(ADwD¦E<ê¬cE¦$ HdÊÄ ”.:Ù GŽ-`ŒL‚ý¾'¢‰Ä<¤CIª½;ÙÇTZd±i};>èôß‚z×;K×§8t ¤Ž q”:uvÿv•Ý›¬²ÙvEân{„M·FXg¼ÌfZÖ¨°¹‰*›ßÌß©±ù©:›j–YqèÜë#3çÏSøWøÿÿÑr'ø Ôùù‚ ©¡IEND®B`‚cpl-6.6.1/html/form_22.png0000644000460300003120000000033012553662441012140 00000000000000‰PNG  IHDR ³Ÿõ0PLTEZ? tRNS.H]o€ž¬¹ÅÒÝéôÿªg°ïGIDATxíÛ €0 ÄœW‹D(ûoKT â‹ ¬Ë‡ï2Àÿ¹ q[È€AœKcÇ*“4¶•I}¥âºô¨FÞ‘ÖÜ{<ã— DòÓRÕ–IEND®B`‚cpl-6.6.1/html/struct__cpl__plugin__.html0000644000460300003120000004507512553662432015425 00000000000000 Common Pipeline Library Reference Manual: _cpl_plugin_ Struct Reference
Common Pipeline Library Reference Manual  6.6.1
_cpl_plugin_ Struct Reference

The type representation of the generic plugin interface. More...

Public Attributes

unsigned int api
 The API version the Plugin complies to. More...
 
const char * author
 Name of the plugin's author. More...
 
const char * copyright
 Plugin's copyright. More...
 
cpl_plugin_func deinitialize
 Deinitialization a plugin instance. More...
 
const char * description
 Plugin's detailed description. More...
 
const char * email
 Author's email address. More...
 
cpl_plugin_func execute
 Executes a plugin instance. More...
 
cpl_plugin_func initialize
 Initializes a plugin instance. More...
 
const char * name
 Plugin's unique name. More...
 
const char * synopsis
 Plugin's short help string. More...
 
unsigned long type
 The Plugin type. More...
 
unsigned long version
 The Plugin version. More...
 

Detailed Description

The type representation of the generic plugin interface.

Member Data Documentation

unsigned int _cpl_plugin_::api

The API version the Plugin complies to.

The API version number identifies the internal layout of the plugin interface structure. It may be used by an application calling a plugin to setup the correct interface to communicate with the plugin or, in the simplest case, to ignore any plugin which does not match the plugin API an application has been buid for.

Referenced by cpl_plugin_copy(), and cpl_plugin_new().

const char* _cpl_plugin_::author

Name of the plugin's author.

Variable contains the null-terminated identifier string of the plugins author. If the plugin does not specify an author this pointer should be set to a NULL pointer.

Referenced by cpl_plugin_copy().

const char* _cpl_plugin_::copyright

Plugin's copyright.

Variable contains the copyright and license string applying to the plugin. The returned string must be null-terminated. If no copyright applies this pointer should be set to a NULL pointer.

Referenced by cpl_plugin_copy().

cpl_plugin_func _cpl_plugin_::deinitialize

Deinitialization a plugin instance.

Returns
The function must return 0 on success, and a non-zero value if the plugin deinitalization failed.

The function to deinitialize the plugin instance plugin. If this is NULL no deinitialization of the plugin instance is needed.

Referenced by cpl_plugin_copy().

const char* _cpl_plugin_::description

Plugin's detailed description.

Variable contains the plugin's null-terminated detailed description string. The description is the detailed help for the plugin. For formatting the output the C special characters '\n', '\t' maybe embedded in the returned string. If the plugin does not provide a detailed description the pointer should be set to a NULL pointer.

Referenced by cpl_plugin_copy().

const char* _cpl_plugin_::email

Author's email address.

Variable contains the null-terminated string of the author's email address. If the plugin does not specify an email address this pointer should be set to a NULL pointer.

Referenced by cpl_plugin_copy().

cpl_plugin_func _cpl_plugin_::execute

Executes a plugin instance.

Parameters
pluginThe plugin to execute.
Returns
The function must return 0 on success, and a non-zero value if the plugin execution failed.

The function executes the plugin instance plugin.

Referenced by cpl_plugin_copy().

cpl_plugin_func _cpl_plugin_::initialize

Initializes a plugin instance.

Parameters
pluginThe plugin to instantiate.
Returns
The function must return 0 on success, and a non-zero value if the plugin instantiation failed.

The function to initialize a plugin instance. This maybe NULL if the initialization of the plugin is not needed. Otherwise it has to be called before plugin type specific members are accessed.

Referenced by cpl_plugin_copy().

const char* _cpl_plugin_::name

Plugin's unique name.

Variable contains the unique name of the Plugin. To ensure uniqueness across all possible Plugins one should follow the hierarchical naming convention mentioned in the CPL documentation.

Referenced by cpl_plugin_copy().

const char* _cpl_plugin_::synopsis

Plugin's short help string.

Variable contains the plugin's null-terminated short help string. The short help string should summarize the plugin's purpose in not more than a few lines. It may contain new line characters. If the plugin does not provide a short help the pointer should be set to a NULL pointer.

Referenced by cpl_plugin_copy().

unsigned long _cpl_plugin_::type

The Plugin type.

The Plugin type identifies the type of plugin. The data type is not a cpl_plugin_type in order to keep this interface as generic as possible.

Referenced by cpl_plugin_copy().

unsigned long _cpl_plugin_::version

The Plugin version.

The Plugin version number defines the version number for the plugin. The Plugin version number is an encoded version of the usual MAJOR.MINOR.MICRO form for version numbers.

Referenced by cpl_plugin_copy().

cpl-6.6.1/html/group__cpl__recipe.html0000644000460300003120000001151212553662432014675 00000000000000 Common Pipeline Library Reference Manual: Recipes
Common Pipeline Library Reference Manual  6.6.1
Recipes

Recipe plugin interface definition. More...

Classes

struct  _cpl_recipe_
 The type representation of the recipe plugin interface. More...
 

Typedefs

typedef struct _cpl_recipe_ cpl_recipe
 The recipe plugin data type. More...
 

Detailed Description

Recipe plugin interface definition.

This defines the interface in order to implement recipes as Pluggable Data Reduction Modules (PDRMs). It extends the generic plugin interface with a parameter list and a frame set containing the recipe's setup information (parameters to run with) and the data frames to process.

This interface is constructed in such a way, that a pointer to an object of type cpl_recipe can be cast into a pointer to cpl_plugin (see Plugin Interface).

Synopsis:
#include <cpl_recipe.h>

Typedef Documentation

typedef struct _cpl_recipe_ cpl_recipe

The recipe plugin data type.

cpl-6.6.1/html/group__cpl__regex.html0000644000460300003120000004644312553662432014553 00000000000000 Common Pipeline Library Reference Manual: Regular Expression Filter
Common Pipeline Library Reference Manual  6.6.1
Regular Expression Filter

Typedefs

typedef struct _cpl_regex_ cpl_regex
 The opaque regular expression filter data type. More...
 
typedef enum _cpl_regex_syntax_option_ cpl_regex_syntax_option
 Regular expression syntax options. More...
 

Enumerations

enum  _cpl_regex_syntax_option_ {
  CPL_REGEX_ICASE,
  CPL_REGEX_NOSUBS,
  CPL_REGEX_BASIC,
  CPL_REGEX_EXTENDED
}
 

Functions

int cpl_regex_apply (const cpl_regex *self, const char *string)
 Compare a regular expression with a given character string. More...
 
void cpl_regex_delete (cpl_regex *self)
 Destroys a regular expression filter object. More...
 
int cpl_regex_is_negated (const cpl_regex *self)
 Test whether a regular expression filter is negated. More...
 
void cpl_regex_negate (cpl_regex *self)
 Toggle the negation state of a regular expression filter. More...
 
cpl_regexcpl_regex_new (const char *expression, int negated, flag_type flags)
 Create a new regular expression filter. More...
 

Detailed Description

The module implements a regular expression filter type. The type cpl_regex is a compiled regular expression created with a given set of regular expression syntax options, and an optional negation of the result when it is applied to an input string.

Typedef Documentation

typedef struct _cpl_regex_ cpl_regex

The opaque regular expression filter data type.

Regular expression syntax options.

Enumeration Type Documentation

Regular expressions syntax options

Enumerator
CPL_REGEX_ICASE 

Case insensitive searches.

CPL_REGEX_NOSUBS 

No sub-expressions.

CPL_REGEX_BASIC 

Basic POSIX grammer.

CPL_REGEX_EXTENDED 

Extended POSIX grammer.

Function Documentation

int cpl_regex_apply ( const cpl_regex self,
const char *  string 
)

Compare a regular expression with a given character string.

Parameters
selfThe regular expression filter object to apply.
stringThe string to be tested.
Returns
The function returns 0 if the filter object does not match the input string, and a non-zero value otherwise.

The function compares the input string string with the regular expression of the filter object self. The function returns a non-zero value for positive matches, i.e. the regular expression matches the input string string and the filter is not negated, or the regular expression does not match the input string but the filter is negated. Otherwise the function reports a negative match, i.e. returns 0.

void cpl_regex_delete ( cpl_regex self)

Destroys a regular expression filter object.

Parameters
selfThe regular expression filter object.
Returns
Nothing.

The function destroys the given regular expression filter object self, and deallocates the memory used. If the filter object self is NULL, nothing is done and no error is set.

Referenced by cpl_multiframe_new().

int cpl_regex_is_negated ( const cpl_regex self)

Test whether a regular expression filter is negated.

Parameters
selfThe regular expression filter object to test.
Returns
The function returns 0 if the filter self is not negated, and 1 otherwise.

The function reports whether the filter self is negated or not.

void cpl_regex_negate ( cpl_regex self)

Toggle the negation state of a regular expression filter.

Parameters
selfThe regular expression filter object to update.
Returns
Nothing.

The function toggles the negation state of the given regular expression filter object self. If self is negated, it is not negated after this function has been called, and vice versa.

cpl_regex* cpl_regex_new ( const char *  expression,
int  negated,
flag_type  flags 
)

Create a new regular expression filter.

Parameters
expressionRegular expression.
negatedNegate the result when applying the filter.
flagsRegular expression syntax options.
Returns
The function returns a newly allocated regular expression filter object, or NULL in case an error occurred.

The function allocates a regular expression filter object and initializes it with the compiled regular expression expression. If the flag negated is set the result when applying the filter to an input string is negated. The argument flags allows to specify regular expression syntax options for the compilation of the regular expression.

The returned regular expression filter object must be destroyed using the destructor cpl_regex_delete().

Note that the syntax option CPL_REGEX_NOSUBS is always set implicitly, since the interface does not allow to retrieve this information.

References CPL_ERROR_ILLEGAL_INPUT, CPL_REGEX_BASIC, CPL_REGEX_EXTENDED, CPL_REGEX_ICASE, and CPL_REGEX_NOSUBS.

Referenced by cpl_multiframe_new().

cpl-6.6.1/html/group__cpl__ppm.html0000644000460300003120000010040712553662432014224 00000000000000 Common Pipeline Library Reference Manual: Point pattern matching module
Common Pipeline Library Reference Manual  6.6.1
Point pattern matching module

Functions

cpl_array * cpl_ppm_match_points (const cpl_matrix *data, cpl_size use_data, double err_data, const cpl_matrix *pattern, cpl_size use_pattern, double err_pattern, double tolerance, double radius, cpl_matrix **mdata, cpl_matrix **mpattern, double *lin_scale, double *lin_angle)
 Match 2-D distributions of points. More...
 
cpl_bivector * cpl_ppm_match_positions (const cpl_vector *peaks, const cpl_vector *lines, double min_disp, double max_disp, double tolerance, cpl_array **seq_peaks, cpl_array **seq_lines)
 Match 1-D patterns. More...
 

Detailed Description

Synopsis:
#include "cpl_ppm.h"

Function Documentation

cpl_array* cpl_ppm_match_points ( const cpl_matrix *  data,
cpl_size  use_data,
double  err_data,
const cpl_matrix *  pattern,
cpl_size  use_pattern,
double  err_pattern,
double  tolerance,
double  radius,
cpl_matrix **  mdata,
cpl_matrix **  mpattern,
double *  lin_scale,
double *  lin_angle 
)

Match 2-D distributions of points.

Parameters
dataList of data points (e.g., detected stars positions).
use_dataNumber of data points used for preliminary match.
err_dataError on data points positions.
patternList of pattern points (e.g., expected stars positions).
use_patternNumber of pattern points used for preliminary match.
err_patternError on pattern points positions.
toleranceMax relative difference of angles and scales from their median value for match acceptance.
radiusSearch radius applied in final matching (data units).
mdataList of identified data points.
mpatternList of matching pattern points.
lin_scaleLinear transformation scale factor.
lin_angleLinear transformation rotation angle.
Returns
Indexes of identified data points (pattern-to-data).

A point is described here by its coordinates on a cartesian plane. The input matrices data and pattern must have 2 rows, as their column vectors are the points coordinates.

This function attemps to associate points in data to points in pattern, under the assumption that a transformation limited to scaling, rotation, and translation, would convert positions in pattern into positions in data. Association between points is also indicated in the following as "match", or "identification".

Point identification is performed in two steps. In the first step only a subset of the points is identified (preliminary match). In the second step the identified points are used to define a first-guess transformation from pattern points to data points, that is applied to identify all the remaining points as well. The second step would be avoided if a use_pattern equal to the number of points in pattern is given, and exactly use_pattern points would be identified already in the first step.

First step:

All possible triangles (sub-patterns) are built using the first use_data points from data and the first use_pattern points from pattern. The values of use_data and use_pattern must always be at least 3 (however, see the note at the end), and should not be greater than the length of the corresponding lists of points. The point-matching algorithm goes as follow:

1 For every triplet of points:
2  Select one point as the reference. The triangle coordinates
3  are defined by
4 
5  ((Rmin/Rmax)^2, theta_min - theta_max)
6 
7  where Rmin (Rmax) is the shortest (longest) distance from the
8  reference point to one of the two other points, and theta_min
9  (theta_max) is the view angle in [0; 2pi[ to the nearest
10  (farthest) point.
11 
12  Triangles are computed by using each point in the triplet
13  as reference, thereby computing 3 times as many triangles
14  as needed.
15 
16  The accuracy of triangle patterns is robust against distortions
17  (i.e., systematic inaccuracies in the points positions) of the
18  second order. This is because, if the points positions had
19  constant statistical uncertainty, the relative uncertainty in
20  the triangle coordinates would be inversely proportional to
21  the triangle size, while if second order distortions are
22  present the systematic error on points position would be
23  directly proportional to the triangle size.
24 
25 For every triangle derived from the @em pattern points:
26  Match with nearest triangle derived from @em data points
27  if their distance in the parameter space is less than their
28  uncertainties (propagated from the points positions uncertainties
29  @em err_data and @em err_pattern). For every matched pair of
30  triangles, record their scale ratio, and their orientation
31  difference. Note that if both @em err_data and @em err_pattern
32  are zero, the tolerance in triangle comparison will also be
33  zero, and therefore no match will be found.
34 
35 Get median scale ratio and median angle of rotation, and reject
36 matches with a relative variation greater than @em tolerance from
37 the median of either quantities. The estimator of all the rotation
38 angles a_i is computed as
39 
40  atan( med sin(a_i) / med cos(a_i) )

Second step:

From the safely matched triangles, a list of identified points is derived, and the best transformation from pattern points to data points (in terms of best rotation angle, best scaling factor, and best shift) is applied to attempt the identification of all the points that are still without match. This matching is made by selecting for each pattern point the data point which is closest to its transformed position, and at a distance less than radius.

The returned array of integers is as long as the number of points in pattern, and each element reports the position of the matching point in data (counted starting from zero), or is invalid if no match was found for the pattern point. For instance, if element N of the array has value M, it means that the Nth point in pattern matches the Mth point in data. A NULL pointer is returned in case no point was identified.

If mdata and mpattern are both valid pointers, two more matrices will be returned with the coordinates of the identified points. These two matrices will both have the same size: 2 rows, and as many columns as successfully identified points. Matching points will be in the same column of both matrices. Those matrix should in the end be destroyed using cpl_matrix_delete().

If lin_scale is a valid pointer, it is returned with a good estimate of the scale (distance_in_data = lin_scale * distance_in_pattern). This makes sense only in case the transformation between pattern and data is an affine transformation. In case of failure, lin_scale is set to zero.

If lin_angle is a valid pointer, it is returned with a good estimate of the rotation angle between pattern and data in degrees (counted counterclockwise, from -180 to +180, and with data_orientation = pattern_orientation + lin_angle). This makes sense only in case the transformation between pattern and data is an affine transformation. In case of failure, lin_angle is set to zero.

The returned values for lin_scale and lin_angle have the only purpose of providing a hint on the relation between pattern points and data points. This function doesn't attempt in any way to determine or even suggest a possible transformation between pattern points and data points: this function just matches points, and it is entriely a responsibility of the caller to fit the appropriate transformation between one coordinate system and the other. A polynomial transformation of degree 2 from pattern to data may be fit in the following way (assuming that mpattern and mdata are available):

1 int degree = 2;
2 int npoints = cpl_matrix_get_ncol(mdata);
3 double *dpoints = cpl_matrix_get_data(mdata);
4 cpl_vector *data_x = cpl_vector_wrap(npoints, dpoints);
5 cpl_vector *data_y = cpl_vector_wrap(npoints, dpoints + npoints);
6 cpl_polynomial *x_trans = cpl_polynomial_new(degree);
7 cpl_polynomial *y_trans = cpl_polynomial_new(degree);
8 
9 cpl_polynomial_fit(x_trans, mpattern, NULL, data_x, NULL, CPL_FALSE,
10  NULL, degree);
11 cpl_polynomial_fit(y_trans, mpattern, NULL, data_y, NULL, CPL_FALSE,
12  NULL, degree);
Note
The basic requirement for using this function is that the searched point pattern (or at least most of it) is contained in the data. As an indirect consequence of this, it would generally be appropriate to have more points in data than in pattern (and analogously, to have use_data greater than use_pattern), even if this is not strictly necessary.

Also, pattern and data should not contain too few points (say, less than 5 or 4) or the identification may risk to be incorrect: more points enable the construction of many more triangles, reducing the risk of ambiguity (multiple valid solutions). Special situations, involving regularities in patterns (as, for instance, input data containing just three equidistant points, or the case of a regular grid of points) would certainly provide an answer, and this answer would very likely be wrong (the human brain would fail as well, and for exactly the same reasons).

The reason why a two steps approach is encouraged here is mainly to enable an efficient use of this function: in principle, constructing all possible triangles using all of the available points is never wrong, but it could become very slow: a list of N points implies the evaluation of N*(N-1)*(N-2)/2 triangles, and an even greater number of comparisons between triangles. The possibility of evaluating first a rough transformation based on a limited number of identified points, and then using this transformation for recovering all the remaining points, may significantly speed up the whole identification process. However it should again be ensured that the main requirement (i.e., that the searched point pattern must be contained in the data) would still be valid for the selected subsets of points: a random choice would likely lead to a matching failure (due to too few, or no, common points).

A secondary reason for the two steps approach is to limit the effect of another class of ambiguities, happening when either or both of the input matrices contains a very large number of uniformely distributed points. The likelihood to find several triangles that are similar by chance, and at all scales and orientations, may increase to unacceptable levels.

A real example may clarify a possible way of using this function: let data contain the positions (in pixel) of detected stars on a CCD. Typically hundreds of star positions would be available, but only the brightest ones may be used for preliminary identification. The input data positions will therefore be opportunely ordered from the brightest to the dimmest star positions. In order to identify stars, a star catalogue is needed. From a rough knowledge of the pointing position of the telescope and of the size of the field of view, a subset of stars can be selected from the catalogue: they will be stored in the pattern list, ordered as well by their brightness, and with their RA and Dec coordinates converted into standard coordinates (a gnomonic coordinate system centered on the telescope pointing, i.e., a cartesian coordinate system), no matter in what units of arc, and no matter what orientation of the field. For the first matching step, the 10 brightest catalogue stars may be selected (selecting less stars would perhaps be unsafe, selecting more would likely make the program slower without producing any better result). Therefore use_pattern would be set to 10. From the data side, it would generally be appropriate to select twice as many stars positions, just to ensure that the searched pattern is present. Therefore use_data would be set to 20. A reasonable value for tolerance and for radius would be respectively 0.1 (a 10% variation of scales and angles) and 20 (pixels).

References cpl_array_delete(), CPL_ERROR_ACCESS_OUT_OF_RANGE, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NULL_INPUT, cpl_error_set, CPL_MATH_DEG_RAD, cpl_matrix_get_ncol(), cpl_msg_debug(), cpl_msg_indent_less(), cpl_msg_indent_more(), cpl_polynomial_delete(), cpl_polynomial_new(), cpl_table_delete(), cpl_table_fill_column_window_double(), cpl_table_get_column_median(), cpl_table_get_column_stdev(), cpl_table_get_data_double(), cpl_table_has_valid(), cpl_table_new(), cpl_table_new_column(), cpl_table_set_invalid(), and CPL_TYPE_DOUBLE.

cpl_bivector* cpl_ppm_match_positions ( const cpl_vector *  peaks,
const cpl_vector *  lines,
double  min_disp,
double  max_disp,
double  tolerance,
cpl_array **  seq_peaks,
cpl_array **  seq_lines 
)

Match 1-D patterns.

Parameters
peaksList of observed positions (e.g., of emission peaks)
linesList of positions in searched pattern (e.g., wavelengths)
min_dispMin expected scale (e.g., spectral dispersion in A/pixel)
max_dispMax expected scale (e.g., spectral dispersion in A/pixel)
toleranceTolerance for interval ratio comparison
seq_peaksReturned: index of identified peaks in input peaks
seq_linesReturned: index of identified lines in input lines
Returns
List of all matching points positions

This function attempts to find the reference pattern lines in a list of observed positions peaks. In the following documentation a terminology drawn from the context of arc lamp spectra calibration is used for simplicity: the reference pattern is then a list of wavelengths corresponding to a set of reference arc lamp emission lines - the so-called line catalog; while the observed positions are the positions (in pixel) on the CCD, measured along the dispersion direction, of any significant peak of the signal. To identify the observed peaks means to associate them with the right reference wavelength. This is attempted here with a point-pattern matching technique, where the pattern is contained in the vector lines, and is searched in the vector peak.

In order to work, this method just requires a rough expectation value of the spectral dispersion (in Angstrom/pixel), and a line catalog. The line catalog lines should just include lines that are expected somewhere in the CCD exposure of the calibration lamp (note, however, that a catalog including extra lines at its blue and/or red ends is still allowed).

Typically, the arc lamp lines candidates peak will include light contaminations, hot pixels, and other unwanted signal, but only in extreme cases does this prevent the pattern-recognition algorithm from identifying all the spectral lines. The pattern is detected even in the case peak contained more arc lamp lines than actually listed in the input line catalog.

This method is based on the assumption that the relation between wavelengths and CCD positions is with good approximation locally linear (this is always true, for any modern spectrograph).

The ratio between consecutive intervals pairs in wavelength and in pixel is invariant to linear transformations, and therefore this quantity can be used in the recognition of local portions of the searched pattern. All the examined sub-patterns will overlap, leading to the final identification of the whole pattern, notwithstanding the overall non-linearity of the relation between pixels and wavelengths.

Ambiguous cases, caused by exceptional regularities in the pattern, or by a number of undetected (but expected) peaks that disrupt the pattern on the data, are recovered by linear interpolation and extrapolation of the safely identified peaks.

More details about the applied algorithm can be found in the comments to the function code.

The seq_peaks and seq_lines are array reporting the positions of matching peaks and wavelengths in the input peaks and lines vectors. This functionality is not yet supported: this arguments should always be set to NULL or a CPL_ERROR_UNSUPPORTED_MODE would be set.

References cpl_bivector_wrap_vectors(), cpl_calloc(), cpl_error_set, CPL_ERROR_UNSUPPORTED_MODE, cpl_free(), cpl_malloc(), cpl_vector_get_data_const(), cpl_vector_get_size(), and cpl_vector_wrap().

cpl-6.6.1/html/jquery.js0000644000460300003120000043564212553662426012066 00000000000000/*! * jQuery JavaScript Library v1.7.1 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Mon Nov 21 21:11:03 2011 -0500 */ (function(bb,L){var av=bb.document,bu=bb.navigator,bl=bb.location;var b=(function(){var bF=function(b0,b1){return new bF.fn.init(b0,b1,bD)},bU=bb.jQuery,bH=bb.$,bD,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! * jQuery UI 1.8.18 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI */ (function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! * jQuery UI Widget 1.8.18 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Widget */ (function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! * jQuery UI Mouse 1.8.18 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Mouse * * Depends: * jquery.ui.widget.js */ (function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! * jQuery hashchange event - v1.3 - 7/21/2010 * http://benalman.com/projects/jquery-hashchange-plugin/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('