mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-23 04:30:15 -06:00
Merge commit 'b671ad35e6d6c58edaf8691357daf1922d61a7d3' into feature/websocketnavigation
* commit 'b671ad35e6d6c58edaf8691357daf1922d61a7d3': Feature/session recording (#737) Update libCurl to 7.63.0 Update GDAL to 2.3.2 Trying another timeout method for GDAL GetCapabilities requests Remove LMMP globebrowsing server to increase resilience Fix longitude/latitude specification for size of GeodeticPatch # Conflicts: # src/CMakeLists.txt
This commit is contained in:
@@ -136,7 +136,7 @@ begin_dependency("CURL")
|
||||
if (WIN32)
|
||||
set(CURL_ROOT_DIR "${OPENSPACE_EXT_DIR}/curl")
|
||||
target_include_directories(openspace-core SYSTEM PUBLIC ${CURL_ROOT_DIR}/include)
|
||||
target_link_libraries(openspace-core ${CURL_ROOT_DIR}/lib/libcurl_imp.lib)
|
||||
target_link_libraries(openspace-core ${CURL_ROOT_DIR}/lib/libcurl.lib)
|
||||
target_compile_definitions(openspace-core PUBLIC
|
||||
"OPENSPACE_CURL_ENABLED" "CURL_STATICLIB")
|
||||
else ()
|
||||
|
||||
34
data/assets/recording_test.scene
Normal file
34
data/assets/recording_test.scene
Normal file
@@ -0,0 +1,34 @@
|
||||
local sceneHelper = asset.require('util/scene_helper')
|
||||
local propertyHelper = asset.require('util/property_helper')
|
||||
|
||||
-- Specifying which other assets should be loaded in this scene
|
||||
asset.require('spice/base')
|
||||
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
|
||||
asset.require('scene/solarsystem/planets/earth/earth')
|
||||
asset.require('scene/digitaluniverse/constellationbounds')
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_dashboard')
|
||||
|
||||
asset.onInitialize(function ()
|
||||
openspace.time.setTime("2010 AUG 01")
|
||||
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Focus = "Earth",
|
||||
Position = { -1500000000000, 0, 0 },
|
||||
Rotation = { 0.0, 0.0, 1.0, 1.0 },
|
||||
})
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Focus = "Sun",
|
||||
Position = { 100000000000, 0, 0 },
|
||||
Rotation = { 0.0, 0.0, 1.0, 1.0 },
|
||||
})
|
||||
|
||||
openspace.setPropertyValue('Scene.ConstellationBounds.renderable.Enabled', true)
|
||||
openspace.setPropertyValueSingle('Scene.Earth.RenderableGlobe.Enabled', false);
|
||||
openspace.setPropertyValueSingle('Scene.EarthTrail.renderable.Enabled', false);
|
||||
openspace.time.interpolateTogglePause()
|
||||
|
||||
end)
|
||||
|
||||
@@ -9,10 +9,10 @@ return {
|
||||
},
|
||||
},
|
||||
Moon = {
|
||||
{
|
||||
Name = "OnMoon LMMP",
|
||||
URL = "https://onmoon.lmmp.nasa.gov/wms.cgi?request=GetCapabilities"
|
||||
},
|
||||
-- {
|
||||
-- Name = "OnMoon LMMP",
|
||||
-- URL = "https://onmoon.lmmp.nasa.gov/wms.cgi?request=GetCapabilities"
|
||||
-- },
|
||||
},
|
||||
Mercury = {
|
||||
{
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
###########################################################################
|
||||
pkginclude_HEADERS = \
|
||||
curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
|
||||
typecheck-gcc.h curlbuild.h curlrules.h
|
||||
|
||||
pkgincludedir= $(includedir)/curl
|
||||
|
||||
# curlbuild.h does not exist in the git tree. When the original libcurl
|
||||
# source code distribution archive file is created, curlbuild.h.dist is
|
||||
# renamed to curlbuild.h and included in the tarball so that it can be
|
||||
# used directly on non-configure systems.
|
||||
#
|
||||
# The distributed curlbuild.h will be overwritten on configure systems
|
||||
# when the configure script runs, with one that is suitable and specific
|
||||
# to the library being configured and built.
|
||||
#
|
||||
# curlbuild.h.in is the distributed template file from which the configure
|
||||
# script creates curlbuild.h at library configuration time, overwiting the
|
||||
# one included in the distribution archive.
|
||||
#
|
||||
# curlbuild.h.dist is not included in the source code distribution archive.
|
||||
|
||||
EXTRA_DIST = curlbuild.h.in
|
||||
|
||||
DISTCLEANFILES = curlbuild.h
|
||||
|
||||
checksrc:
|
||||
@@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
|
||||
|
||||
if CURLDEBUG
|
||||
# for debug builds, we scan the sources on all regular make invokes
|
||||
all-local: checksrc
|
||||
endif
|
||||
@@ -1,692 +0,0 @@
|
||||
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in 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.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include/curl
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(srcdir)/curlbuild.h.in $(top_srcdir)/mkinstalldirs \
|
||||
$(pkginclude_HEADERS)
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
|
||||
$(top_srcdir)/m4/curl-confopts.m4 \
|
||||
$(top_srcdir)/m4/curl-functions.m4 \
|
||||
$(top_srcdir)/m4/curl-openssl.m4 \
|
||||
$(top_srcdir)/m4/curl-override.m4 \
|
||||
$(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/xc-am-iface.m4 \
|
||||
$(top_srcdir)/m4/xc-cc-check.m4 \
|
||||
$(top_srcdir)/m4/xc-lt-iface.m4 \
|
||||
$(top_srcdir)/m4/xc-translit.m4 \
|
||||
$(top_srcdir)/m4/xc-val-flgs.m4 \
|
||||
$(top_srcdir)/m4/zz40-xc-ovr.m4 \
|
||||
$(top_srcdir)/m4/zz50-xc-ovr.m4 \
|
||||
$(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/lib/curl_config.h curlbuild.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
|
||||
$(LISP)curlbuild.h.in
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/curl
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
|
||||
CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@
|
||||
CURLVERSION = @CURLVERSION@
|
||||
CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
|
||||
CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
|
||||
CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
|
||||
CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
|
||||
CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
|
||||
CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
|
||||
CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
|
||||
CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
|
||||
CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
|
||||
CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
|
||||
CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
|
||||
CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
|
||||
CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
|
||||
CURL_DISABLE_SMB = @CURL_DISABLE_SMB@
|
||||
CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
|
||||
CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
|
||||
CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
|
||||
CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@
|
||||
CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@
|
||||
CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
ENABLE_SHARED = @ENABLE_SHARED@
|
||||
ENABLE_STATIC = @ENABLE_STATIC@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@
|
||||
HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
|
||||
HAVE_LIBZ = @HAVE_LIBZ@
|
||||
HAVE_OPENSSL_SRP = @HAVE_OPENSSL_SRP@
|
||||
IDN_ENABLED = @IDN_ENABLED@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
IPV6_ENABLED = @IPV6_ENABLED@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBCURL_LIBS = @LIBCURL_LIBS@
|
||||
LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@
|
||||
LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@
|
||||
LIBMETALINK_LIBS = @LIBMETALINK_LIBS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MANOPT = @MANOPT@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NROFF = @NROFF@
|
||||
NSS_LIBS = @NSS_LIBS@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKGADD_NAME = @PKGADD_NAME@
|
||||
PKGADD_PKG = @PKGADD_PKG@
|
||||
PKGADD_VENDOR = @PKGADD_VENDOR@
|
||||
PKGCONFIG = @PKGCONFIG@
|
||||
RANDOM_FILE = @RANDOM_FILE@
|
||||
RANLIB = @RANLIB@
|
||||
REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SSL_ENABLED = @SSL_ENABLED@
|
||||
SSL_LIBS = @SSL_LIBS@
|
||||
STRIP = @STRIP@
|
||||
SUPPORT_FEATURES = @SUPPORT_FEATURES@
|
||||
SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
|
||||
USE_ARES = @USE_ARES@
|
||||
USE_AXTLS = @USE_AXTLS@
|
||||
USE_CYASSL = @USE_CYASSL@
|
||||
USE_DARWINSSL = @USE_DARWINSSL@
|
||||
USE_GNUTLS = @USE_GNUTLS@
|
||||
USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@
|
||||
USE_LIBRTMP = @USE_LIBRTMP@
|
||||
USE_LIBSSH2 = @USE_LIBSSH2@
|
||||
USE_NGHTTP2 = @USE_NGHTTP2@
|
||||
USE_NSS = @USE_NSS@
|
||||
USE_OPENLDAP = @USE_OPENLDAP@
|
||||
USE_POLARSSL = @USE_POLARSSL@
|
||||
USE_SCHANNEL = @USE_SCHANNEL@
|
||||
USE_UNIX_SOCKETS = @USE_UNIX_SOCKETS@
|
||||
USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
|
||||
VERSION = @VERSION@
|
||||
VERSIONNUM = @VERSIONNUM@
|
||||
ZLIB_LIBS = @ZLIB_LIBS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
libext = @libext@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
subdirs = @subdirs@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
###########################################################################
|
||||
pkginclude_HEADERS = \
|
||||
curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
|
||||
typecheck-gcc.h curlbuild.h curlrules.h
|
||||
|
||||
|
||||
# curlbuild.h does not exist in the git tree. When the original libcurl
|
||||
# source code distribution archive file is created, curlbuild.h.dist is
|
||||
# renamed to curlbuild.h and included in the tarball so that it can be
|
||||
# used directly on non-configure systems.
|
||||
#
|
||||
# The distributed curlbuild.h will be overwritten on configure systems
|
||||
# when the configure script runs, with one that is suitable and specific
|
||||
# to the library being configured and built.
|
||||
#
|
||||
# curlbuild.h.in is the distributed template file from which the configure
|
||||
# script creates curlbuild.h at library configuration time, overwiting the
|
||||
# one included in the distribution archive.
|
||||
#
|
||||
# curlbuild.h.dist is not included in the source code distribution archive.
|
||||
EXTRA_DIST = curlbuild.h.in
|
||||
DISTCLEANFILES = curlbuild.h
|
||||
all: curlbuild.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/curl/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/curl/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
curlbuild.h: stamp-h2
|
||||
@test -f $@ || rm -f stamp-h2
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
|
||||
|
||||
stamp-h2: $(srcdir)/curlbuild.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h2
|
||||
cd $(top_builddir) && $(SHELL) ./config.status include/curl/curlbuild.h
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f curlbuild.h stamp-h2
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
@CURLDEBUG_FALSE@all-local:
|
||||
all-am: Makefile $(HEADERS) curlbuild.h all-local
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: all install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \
|
||||
clean-generic clean-libtool cscopelist-am ctags ctags-am \
|
||||
distclean distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-pkgincludeHEADERS \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am uninstall-pkgincludeHEADERS
|
||||
|
||||
|
||||
checksrc:
|
||||
@@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
|
||||
|
||||
# for debug builds, we scan the sources on all regular make invokes
|
||||
@CURLDEBUG_TRUE@all-local: checksrc
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,197 +0,0 @@
|
||||
#ifndef __CURL_CURLBUILD_H
|
||||
#define __CURL_CURLBUILD_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the libcurl development
|
||||
* mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* This header file shall only export symbols which are 'curl' or 'CURL'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file include/curl/curlbuild.h.in or
|
||||
* at file include/curl/curlbuild.h, this is due to the following reason:
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
* is suitable and specific to the library being configured and built, which
|
||||
* is generated from the include/curl/curlbuild.h.in template file.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CURL_SIZEOF_LONG
|
||||
#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_T
|
||||
#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_TU
|
||||
#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_OFF_T
|
||||
#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_OFF_T
|
||||
#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_T
|
||||
#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_TU
|
||||
#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file ws2tcpip.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_WS2TCPIP_H
|
||||
#ifdef CURL_PULL_WS2TCPIP_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/types.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_SYS_TYPES_H
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file stdint.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_STDINT_H
|
||||
#ifdef CURL_PULL_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file inttypes.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_INTTYPES_H
|
||||
#ifdef CURL_PULL_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/socket.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_SYS_SOCKET_H
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/poll.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_SYS_POLL_H
|
||||
#ifdef CURL_PULL_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#define CURL_SIZEOF_LONG ${CURL_SIZEOF_LONG}
|
||||
|
||||
/* Integral data type used for curl_socklen_t. */
|
||||
#define CURL_TYPEOF_CURL_SOCKLEN_T ${CURL_TYPEOF_CURL_SOCKLEN_T}
|
||||
|
||||
/* The size of `curl_socklen_t', as computed by sizeof. */
|
||||
#define CURL_SIZEOF_CURL_SOCKLEN_T ${CURL_SIZEOF_CURL_SOCKLEN_T}
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
|
||||
/* Signed integral data type used for curl_off_t. */
|
||||
#define CURL_TYPEOF_CURL_OFF_T ${CURL_TYPEOF_CURL_OFF_T}
|
||||
|
||||
/* Data type definition of curl_off_t. */
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
|
||||
/* curl_off_t formatting string directive without "%" conversion specifier. */
|
||||
#define CURL_FORMAT_CURL_OFF_T "${CURL_FORMAT_CURL_OFF_T}"
|
||||
|
||||
/* unsigned curl_off_t formatting string without "%" conversion specifier. */
|
||||
#define CURL_FORMAT_CURL_OFF_TU "${CURL_FORMAT_CURL_OFF_TU}"
|
||||
|
||||
/* curl_off_t formatting string directive with "%" conversion specifier. */
|
||||
#define CURL_FORMAT_OFF_T "${CURL_FORMAT_OFF_T}"
|
||||
|
||||
/* The size of `curl_off_t', as computed by sizeof. */
|
||||
#define CURL_SIZEOF_CURL_OFF_T ${CURL_SIZEOF_CURL_OFF_T}
|
||||
|
||||
/* curl_off_t constant suffix. */
|
||||
#define CURL_SUFFIX_CURL_OFF_T ${CURL_SUFFIX_CURL_OFF_T}
|
||||
|
||||
/* unsigned curl_off_t constant suffix. */
|
||||
#define CURL_SUFFIX_CURL_OFF_TU ${CURL_SUFFIX_CURL_OFF_TU}
|
||||
|
||||
#endif /* __CURL_CURLBUILD_H */
|
||||
@@ -1,197 +0,0 @@
|
||||
#ifndef __CURL_CURLBUILD_H
|
||||
#define __CURL_CURLBUILD_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the libcurl development
|
||||
* mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* This header file shall only export symbols which are 'curl' or 'CURL'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file include/curl/curlbuild.h.in or
|
||||
* at file include/curl/curlbuild.h, this is due to the following reason:
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
* is suitable and specific to the library being configured and built, which
|
||||
* is generated from the include/curl/curlbuild.h.in template file.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CURL_SIZEOF_LONG
|
||||
#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_T
|
||||
#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_TU
|
||||
#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_OFF_T
|
||||
#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_OFF_T
|
||||
#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_T
|
||||
#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_TU
|
||||
#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file ws2tcpip.h must be included by the external interface. */
|
||||
#undef CURL_PULL_WS2TCPIP_H
|
||||
#ifdef CURL_PULL_WS2TCPIP_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/types.h must be included by the external interface. */
|
||||
#undef CURL_PULL_SYS_TYPES_H
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file stdint.h must be included by the external interface. */
|
||||
#undef CURL_PULL_STDINT_H
|
||||
#ifdef CURL_PULL_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file inttypes.h must be included by the external interface. */
|
||||
#undef CURL_PULL_INTTYPES_H
|
||||
#ifdef CURL_PULL_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/socket.h must be included by the external interface. */
|
||||
#undef CURL_PULL_SYS_SOCKET_H
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/poll.h must be included by the external interface. */
|
||||
#undef CURL_PULL_SYS_POLL_H
|
||||
#ifdef CURL_PULL_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef CURL_SIZEOF_LONG
|
||||
|
||||
/* Integral data type used for curl_socklen_t. */
|
||||
#undef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
|
||||
/* The size of `curl_socklen_t', as computed by sizeof. */
|
||||
#undef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
|
||||
/* Signed integral data type used for curl_off_t. */
|
||||
#undef CURL_TYPEOF_CURL_OFF_T
|
||||
|
||||
/* Data type definition of curl_off_t. */
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
|
||||
/* curl_off_t formatting string directive without "%" conversion specifier. */
|
||||
#undef CURL_FORMAT_CURL_OFF_T
|
||||
|
||||
/* unsigned curl_off_t formatting string without "%" conversion specifier. */
|
||||
#undef CURL_FORMAT_CURL_OFF_TU
|
||||
|
||||
/* curl_off_t formatting string directive with "%" conversion specifier. */
|
||||
#undef CURL_FORMAT_OFF_T
|
||||
|
||||
/* The size of `curl_off_t', as computed by sizeof. */
|
||||
#undef CURL_SIZEOF_CURL_OFF_T
|
||||
|
||||
/* curl_off_t constant suffix. */
|
||||
#undef CURL_SUFFIX_CURL_OFF_T
|
||||
|
||||
/* unsigned curl_off_t constant suffix. */
|
||||
#undef CURL_SUFFIX_CURL_OFF_TU
|
||||
|
||||
#endif /* __CURL_CURLBUILD_H */
|
||||
@@ -1,262 +0,0 @@
|
||||
#ifndef __CURL_CURLRULES_H
|
||||
#define __CURL_CURLRULES_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* COMPILE TIME SANITY CHECKS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* All checks done in this file are intentionally placed in a public
|
||||
* header file which is pulled by curl/curl.h when an application is
|
||||
* being built using an already built libcurl library. Additionally
|
||||
* this file is also included and used when building the library.
|
||||
*
|
||||
* If compilation fails on this file it is certainly sure that the
|
||||
* problem is elsewhere. It could be a problem in the curlbuild.h
|
||||
* header file, or simply that you are using different compilation
|
||||
* settings than those used to build the library.
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* Do not deactivate any check, these are done to make sure that the
|
||||
* library is properly built and used.
|
||||
*
|
||||
* You can find further help on the libcurl development mailing list:
|
||||
* http://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* NOTE 2
|
||||
* ------
|
||||
*
|
||||
* Some of the following compile time checks are based on the fact
|
||||
* that the dimension of a constant array can not be a negative one.
|
||||
* In this way if the compile time verification fails, the compilation
|
||||
* will fail issuing an error. The error description wording is compiler
|
||||
* dependent but it will be quite similar to one of the following:
|
||||
*
|
||||
* "negative subscript or subscript is too large"
|
||||
* "array must have at least one element"
|
||||
* "-1 is an illegal array size"
|
||||
* "size of array is negative"
|
||||
*
|
||||
* If you are building an application which tries to use an already
|
||||
* built libcurl library and you are getting this kind of errors on
|
||||
* this file, it is a clear indication that there is a mismatch between
|
||||
* how the library was built and how you are trying to use it for your
|
||||
* application. Your already compiled or binary library provider is the
|
||||
* only one who can give you the details you need to properly use it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Verify that some macros are actually defined.
|
||||
*/
|
||||
|
||||
#ifndef CURL_SIZEOF_LONG
|
||||
# error "CURL_SIZEOF_LONG definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TYPEOF_CURL_OFF_T
|
||||
# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_CURL_OFF_T
|
||||
# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_CURL_OFF_TU
|
||||
# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_OFF_T
|
||||
# error "CURL_FORMAT_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SIZEOF_CURL_OFF_T
|
||||
# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SUFFIX_CURL_OFF_T
|
||||
# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SUFFIX_CURL_OFF_TU
|
||||
# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros private to this header file.
|
||||
*/
|
||||
|
||||
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
|
||||
|
||||
#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for long
|
||||
* is the same as the one reported by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_01__
|
||||
[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* curl_off_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_02__
|
||||
[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of curl_off_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for long
|
||||
* for the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_03__
|
||||
[CurlchkszGE(curl_off_t, long)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* curl_socklen_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_04__
|
||||
[CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of curl_socklen_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for int for
|
||||
* the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_05__
|
||||
[CurlchkszGE(curl_socklen_t, int)];
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
|
||||
* these to be visible and exported by the external libcurl interface API,
|
||||
* while also making them visible to the library internals, simply including
|
||||
* curl_setup.h, without actually needing to include curl.h internally.
|
||||
* If some day this section would grow big enough, all this should be moved
|
||||
* to its own header file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Figure out if we can use the ## preprocessor operator, which is supported
|
||||
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
|
||||
* or __cplusplus so we need to carefully check for them too.
|
||||
*/
|
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
|
||||
defined(__ILEC400__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */
|
||||
#undef CURL_ISOCPP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for minimum-width signed and unsigned curl_off_t integer constants.
|
||||
*/
|
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
|
||||
# define __CURL_OFF_T_C_HLPR2(x) x
|
||||
# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
|
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
|
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
|
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
|
||||
#else
|
||||
# ifdef CURL_ISOCPP
|
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
|
||||
# else
|
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
|
||||
# endif
|
||||
# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
|
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get rid of macros private to this header file.
|
||||
*/
|
||||
|
||||
#undef CurlchkszEQ
|
||||
#undef CurlchkszGE
|
||||
|
||||
/*
|
||||
* Get rid of macros not intended to exist beyond this point.
|
||||
*/
|
||||
|
||||
#undef CURL_PULL_WS2TCPIP_H
|
||||
#undef CURL_PULL_SYS_TYPES_H
|
||||
#undef CURL_PULL_SYS_SOCKET_H
|
||||
#undef CURL_PULL_SYS_POLL_H
|
||||
#undef CURL_PULL_STDINT_H
|
||||
#undef CURL_PULL_INTTYPES_H
|
||||
|
||||
#undef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
#undef CURL_TYPEOF_CURL_OFF_T
|
||||
|
||||
#ifdef CURL_NO_OLDIES
|
||||
#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_CURLRULES_H */
|
||||
@@ -7,11 +7,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@@ -26,17 +26,17 @@
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2015 Daniel Stenberg, <daniel@haxx.se>."
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2018 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.42.1"
|
||||
#define LIBCURL_VERSION "7.63.0-DEV"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 42
|
||||
#define LIBCURL_VERSION_PATCH 1
|
||||
#define LIBCURL_VERSION_MINOR 63
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
@@ -52,18 +52,26 @@
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x072a01
|
||||
#define LIBCURL_VERSION_NUM 0x073F00
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
* The format of the date follows this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
* "2007-11-23"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Wed Apr 29 06:07:13 UTC 2015"
|
||||
#define LIBCURL_TIMESTAMP "[unreleased]"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@@ -58,7 +58,7 @@ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
|
||||
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
@@ -95,6 +95,16 @@ CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_upkeep()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Performs connection upkeep for the given session handle.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@@ -24,8 +24,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
|
||||
#include "curl.h"
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -44,29 +43,6 @@ CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef _MPRINTF_REPLACE
|
||||
# undef printf
|
||||
# undef fprintf
|
||||
# undef sprintf
|
||||
# undef vsprintf
|
||||
# undef snprintf
|
||||
# undef vprintf
|
||||
# undef vfprintf
|
||||
# undef vsnprintf
|
||||
# undef aprintf
|
||||
# undef vaprintf
|
||||
# define printf curl_mprintf
|
||||
# define fprintf curl_mfprintf
|
||||
# define sprintf curl_msprintf
|
||||
# define vsprintf curl_mvsprintf
|
||||
# define snprintf curl_msnprintf
|
||||
# define vprintf curl_mvprintf
|
||||
# define vfprintf curl_mvfprintf
|
||||
# define vsnprintf curl_mvsnprintf
|
||||
# define aprintf curl_maprintf
|
||||
# define vaprintf curl_mvaprintf
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@@ -52,7 +52,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
|
||||
typedef struct Curl_multi CURLM;
|
||||
#else
|
||||
typedef void CURLM;
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
|
||||
@@ -66,6 +70,8 @@ typedef enum {
|
||||
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
|
||||
CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
|
||||
attempted to get added - again */
|
||||
CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a
|
||||
callback */
|
||||
CURLM_LAST
|
||||
} CURLMcode;
|
||||
|
||||
@@ -74,6 +80,11 @@ typedef enum {
|
||||
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
|
||||
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
|
||||
|
||||
/* bitmask bits for CURLMOPT_PIPELINING */
|
||||
#define CURLPIPE_NOTHING 0L
|
||||
#define CURLPIPE_HTTP1 1L
|
||||
#define CURLPIPE_MULTIPLEX 2L
|
||||
|
||||
typedef enum {
|
||||
CURLMSG_NONE, /* first, not used */
|
||||
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
|
||||
@@ -175,8 +186,8 @@ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code. *NOTE* that this only
|
||||
* returns errors etc regarding the whole multi stack. There might
|
||||
* still have occurred problems on invidual transfers even when this
|
||||
* returns OK.
|
||||
* still have occurred problems on individual transfers even when
|
||||
* this returns OK.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
@@ -209,7 +220,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
|
||||
* curl_multi_cleanup().
|
||||
*
|
||||
* The 'CURLMsg' struct is meant to be very simple and only contain
|
||||
* very basic informations. If more involved information is wanted,
|
||||
* very basic information. If more involved information is wanted,
|
||||
* we will provide the particular "transfer handle" in that struct
|
||||
* and that should/could/would be used in subsequent
|
||||
* curl_easy_getinfo() calls (or similar). The point being that we
|
||||
@@ -365,6 +376,12 @@ typedef enum {
|
||||
/* maximum number of open connections in total */
|
||||
CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
|
||||
|
||||
/* This is the server push callback function pointer */
|
||||
CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),
|
||||
|
||||
/* This is the argument passed to the server push callback */
|
||||
CINIT(PUSHDATA, OBJECTPOINT, 15),
|
||||
|
||||
CURLMOPT_LASTENTRY /* the last unused */
|
||||
} CURLMoption;
|
||||
|
||||
@@ -392,6 +409,31 @@ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
|
||||
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t sockfd, void *sockp);
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_push_callback
|
||||
*
|
||||
* Desc: This callback gets called when a new stream is being pushed by the
|
||||
* server. It approves or denies the new stream.
|
||||
*
|
||||
* Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
|
||||
*/
|
||||
#define CURL_PUSH_OK 0
|
||||
#define CURL_PUSH_DENY 1
|
||||
|
||||
struct curl_pushheaders; /* forward declaration only */
|
||||
|
||||
CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
|
||||
size_t num);
|
||||
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
|
||||
const char *name);
|
||||
|
||||
typedef int (*curl_push_callback)(CURL *parent,
|
||||
CURL *easy,
|
||||
size_t num_headers,
|
||||
struct curl_pushheaders *headers,
|
||||
void *userp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread (void *, size_t, size_t, FILE *);
|
||||
size_t fwrite (const void *, size_t, size_t, FILE *);
|
||||
size_t fread(void *, size_t, size_t, FILE *);
|
||||
size_t fwrite(const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __CURL_CURLBUILD_H
|
||||
#define __CURL_CURLBUILD_H
|
||||
#ifndef __CURL_SYSTEM_H
|
||||
#define __CURL_SYSTEM_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
@@ -7,11 +7,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@@ -22,387 +22,201 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
* Try to keep one section per platform, compiler and architecture, otherwise,
|
||||
* if an existing section is reused for a different one and later on the
|
||||
* original is adjusted, probably the piggybacking one can be adversely
|
||||
* changed.
|
||||
*
|
||||
* See file include/curl/curlbuild.h.in, run configure, and forget
|
||||
* that this file exists it is only used for non-configure systems.
|
||||
* But you can keep reading if you want ;-)
|
||||
* In order to differentiate between platforms/compilers/architectures use
|
||||
* only compiler built in predefined preprocessor symbols.
|
||||
*
|
||||
* curl_off_t
|
||||
* ----------
|
||||
*
|
||||
* For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit
|
||||
* wide signed integral data type. The width of this data type must remain
|
||||
* constant and independent of any possible large file support settings.
|
||||
*
|
||||
* As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit
|
||||
* wide signed integral data type if there is no 64-bit type.
|
||||
*
|
||||
* As a general rule, curl_off_t shall not be mapped to off_t. This rule shall
|
||||
* only be violated if off_t is the only 64-bit data type available and the
|
||||
* size of off_t is independent of large file support settings. Keep your
|
||||
* build on the safe side avoiding an off_t gating. If you have a 64-bit
|
||||
* off_t then take for sure that another 64-bit data type exists, dig deeper
|
||||
* and you will find it.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR NON-CONFIGURE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the libcurl development
|
||||
* mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* Try to keep one section per platform, compiler and architecture,
|
||||
* otherwise, if an existing section is reused for a different one and
|
||||
* later on the original is adjusted, probably the piggybacking one can
|
||||
* be adversely changed.
|
||||
*
|
||||
* In order to differentiate between platforms/compilers/architectures
|
||||
* use only compiler built in predefined preprocessor symbols.
|
||||
*
|
||||
* This header file shall only export symbols which are 'curl' or 'CURL'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* For any given platform/compiler curl_off_t must be typedef'ed to a
|
||||
* 64-bit wide signed integral data type. The width of this data type
|
||||
* must remain constant and independent of any possible large file
|
||||
* support settings.
|
||||
*
|
||||
* As an exception to the above, curl_off_t shall be typedef'ed to a
|
||||
* 32-bit wide signed integral data type if there is no 64-bit type.
|
||||
*
|
||||
* As a general rule, curl_off_t shall not be mapped to off_t. This
|
||||
* rule shall only be violated if off_t is the only 64-bit data type
|
||||
* available and the size of off_t is independent of large file support
|
||||
* settings. Keep your build on the safe side avoiding an off_t gating.
|
||||
* If you have a 64-bit off_t then take for sure that another 64-bit
|
||||
* data type exists, dig deeper and you will find it.
|
||||
*
|
||||
* NOTE 3:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file include/curl/curlbuild.h.dist or
|
||||
* at file include/curl/curlbuild.h, this is due to the following reason:
|
||||
* file include/curl/curlbuild.h.dist is renamed to include/curl/curlbuild.h
|
||||
* when the libcurl source code distribution archive file is created.
|
||||
*
|
||||
* File include/curl/curlbuild.h.dist is not included in the distribution
|
||||
* archive. File include/curl/curlbuild.h is not present in the git tree.
|
||||
*
|
||||
* The distributed include/curl/curlbuild.h file is only intended to be used
|
||||
* on systems which can not run the also distributed configure script.
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
* is suitable and specific to the library being configured and built, which
|
||||
* is generated from the include/curl/curlbuild.h.in template file.
|
||||
*
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
* appropriate buildconf* script to set up curlbuild.h and other local files.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CURL_SIZEOF_LONG
|
||||
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_T
|
||||
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_TU
|
||||
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_OFF_T
|
||||
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_OFF_T
|
||||
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_T
|
||||
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_TU
|
||||
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
#if defined(__DJGPP__) || defined(__GO32__)
|
||||
# if defined(__DJGPP__) && (__DJGPP__ > 1)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SALFORDC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# if (__BORLANDC__ < 0x520)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__TURBOC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__386__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__POCC__)
|
||||
# if (__POCC__ < 280)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# elif defined(_MSC_VER)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__LCC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SYMBIAN32__)
|
||||
# if defined(__EABI__) /* Treat all ARM compilers equally */
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__CW32__)
|
||||
# pragma longlong on
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__VC32__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MWERKS__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(_WIN32_WCE)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_WS2TCPIP_H 1
|
||||
|
||||
#elif defined(__VMS)
|
||||
# if defined(__VAX)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__OS400__)
|
||||
# if defined(__ILEC400__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
@@ -410,37 +224,28 @@
|
||||
#elif defined(__MVS__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
@@ -448,52 +253,90 @@
|
||||
#elif defined(__370__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(TPF)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__TINYC__) /* also known as tcc */
|
||||
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */
|
||||
# if !defined(__LP64) && (defined(__ILP32) || \
|
||||
defined(__i386) || \
|
||||
defined(__sparcv8) || \
|
||||
defined(__sparcv8plus))
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__LP64) || \
|
||||
defined(__amd64) || defined(__sparcv9)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#elif defined(__xlc__) /* IBM xlc compiler */
|
||||
# if !defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */
|
||||
@@ -501,61 +344,73 @@
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP GENERIC GCC THE LAST ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# if defined(__ILP32__) || \
|
||||
defined(__i386__) || defined(__ppc__) || defined(__arm__) || defined(__sparc__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
#elif defined(__GNUC__) && !defined(_SCO_DS)
|
||||
# if !defined(__LP64__) && \
|
||||
(defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \
|
||||
defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \
|
||||
defined(__sparc__) || defined(__mips__) || defined(__sh__) || \
|
||||
defined(__XTENSA__) || \
|
||||
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \
|
||||
(defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L))
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__LP64__) || \
|
||||
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
|
||||
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
|
||||
(defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#else
|
||||
# error "Unknown non-configure build target!"
|
||||
Error Compilation_aborted_Unknown_non_configure_build_target
|
||||
/* generic "safe guess" on old 32 bit style */
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
/* AIX needs <sys/poll.h> */
|
||||
#define CURL_PULL_SYS_POLL_H
|
||||
#endif
|
||||
|
||||
|
||||
/* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */
|
||||
/* ws2tcpip.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_WS2TCPIP_H
|
||||
# include <winsock2.h>
|
||||
# include <windows.h>
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
|
||||
@@ -570,8 +425,13 @@
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */
|
||||
/* sys/poll.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
#endif
|
||||
@@ -582,4 +442,52 @@
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_CURLBUILD_H */
|
||||
/*
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
|
||||
* these to be visible and exported by the external libcurl interface API,
|
||||
* while also making them visible to the library internals, simply including
|
||||
* curl_setup.h, without actually needing to include curl.h internally.
|
||||
* If some day this section would grow big enough, all this should be moved
|
||||
* to its own header file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Figure out if we can use the ## preprocessor operator, which is supported
|
||||
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
|
||||
* or __cplusplus so we need to carefully check for them too.
|
||||
*/
|
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
|
||||
defined(__ILEC400__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */
|
||||
#undef CURL_ISOCPP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for minimum-width signed and unsigned curl_off_t integer constants.
|
||||
*/
|
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
|
||||
# define __CURL_OFF_T_C_HLPR2(x) x
|
||||
# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
|
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
|
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
|
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
|
||||
#else
|
||||
# ifdef CURL_ISOCPP
|
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
|
||||
# else
|
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
|
||||
# endif
|
||||
# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
|
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_SYSTEM_H */
|
||||
@@ -7,11 +7,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@@ -40,7 +40,7 @@
|
||||
*/
|
||||
#define curl_easy_setopt(handle, option, value) \
|
||||
__extension__ ({ \
|
||||
__typeof__ (option) _curl_opt = option; \
|
||||
__typeof__(option) _curl_opt = option; \
|
||||
if(__builtin_constant_p(_curl_opt)) { \
|
||||
if(_curl_is_long_option(_curl_opt)) \
|
||||
if(!_curl_is_long(value)) \
|
||||
@@ -54,6 +54,9 @@ __extension__ ({ \
|
||||
if(_curl_is_write_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_write_cb(value)) \
|
||||
_curl_easy_setopt_err_write_callback(); \
|
||||
if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \
|
||||
if(!_curl_is_resolver_start_callback(value)) \
|
||||
_curl_easy_setopt_err_resolver_start_callback(); \
|
||||
if((_curl_opt) == CURLOPT_READFUNCTION) \
|
||||
if(!_curl_is_read_cb(value)) \
|
||||
_curl_easy_setopt_err_read_cb(); \
|
||||
@@ -96,6 +99,9 @@ __extension__ ({ \
|
||||
if((_curl_opt) == CURLOPT_HTTPPOST) \
|
||||
if(!_curl_is_arr((value), struct curl_httppost)) \
|
||||
_curl_easy_setopt_err_curl_httpost(); \
|
||||
if((_curl_opt) == CURLOPT_MIMEPOST) \
|
||||
if(!_curl_is_ptr((value), curl_mime)) \
|
||||
_curl_easy_setopt_err_curl_mimepost(); \
|
||||
if(_curl_is_slist_option(_curl_opt)) \
|
||||
if(!_curl_is_arr((value), struct curl_slist)) \
|
||||
_curl_easy_setopt_err_curl_slist(); \
|
||||
@@ -110,7 +116,7 @@ __extension__ ({ \
|
||||
/* FIXME: don't allow const pointers */
|
||||
#define curl_easy_getinfo(handle, info, arg) \
|
||||
__extension__ ({ \
|
||||
__typeof__ (info) _curl_info = info; \
|
||||
__typeof__(info) _curl_info = info; \
|
||||
if(__builtin_constant_p(_curl_info)) { \
|
||||
if(_curl_is_string_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), char *)) \
|
||||
@@ -124,6 +130,18 @@ __extension__ ({ \
|
||||
if(_curl_is_slist_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_slist *)) \
|
||||
_curl_easy_getinfo_err_curl_slist(); \
|
||||
if(_curl_is_tlssessioninfo_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_tlssessioninfo *)) \
|
||||
_curl_easy_getinfo_err_curl_tlssesssioninfo(); \
|
||||
if(_curl_is_certinfo_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_certinfo *)) \
|
||||
_curl_easy_getinfo_err_curl_certinfo(); \
|
||||
if(_curl_is_socket_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), curl_socket_t)) \
|
||||
_curl_easy_getinfo_err_curl_socket(); \
|
||||
if(_curl_is_off_t_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), curl_off_t)) \
|
||||
_curl_easy_getinfo_err_curl_off_t(); \
|
||||
} \
|
||||
curl_easy_getinfo(handle, _curl_info, arg); \
|
||||
})
|
||||
@@ -151,10 +169,14 @@ _CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
|
||||
"curl_easy_setopt expects a curl_off_t argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_string,
|
||||
"curl_easy_setopt expects a "
|
||||
"string (char* or char[]) argument for this option"
|
||||
"string ('char *' or char[]) argument for this option"
|
||||
)
|
||||
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
|
||||
"curl_easy_setopt expects a curl_write_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_resolver_start_callback,
|
||||
"curl_easy_setopt expects a "
|
||||
"curl_resolver_start_callback argument for this option"
|
||||
)
|
||||
_CURL_WARNING(_curl_easy_setopt_err_read_cb,
|
||||
"curl_easy_setopt expects a curl_read_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
|
||||
@@ -182,24 +204,38 @@ _CURL_WARNING(_curl_easy_setopt_err_error_buffer,
|
||||
"curl_easy_setopt expects a "
|
||||
"char buffer of CURL_ERROR_SIZE as argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_FILE,
|
||||
"curl_easy_setopt expects a FILE* argument for this option")
|
||||
"curl_easy_setopt expects a 'FILE *' argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_postfields,
|
||||
"curl_easy_setopt expects a void* or char* argument for this option")
|
||||
"curl_easy_setopt expects a 'void *' or 'char *' argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
|
||||
"curl_easy_setopt expects a struct curl_httppost* argument for this option")
|
||||
"curl_easy_setopt expects a 'struct curl_httppost *' "
|
||||
"argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_mimepost,
|
||||
"curl_easy_setopt expects a 'curl_mime *' "
|
||||
"argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
|
||||
"curl_easy_setopt expects a struct curl_slist* argument for this option")
|
||||
"curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
|
||||
"curl_easy_setopt expects a CURLSH* argument for this option")
|
||||
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_string,
|
||||
"curl_easy_getinfo expects a pointer to char * for this info")
|
||||
"curl_easy_getinfo expects a pointer to 'char *' for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_long,
|
||||
"curl_easy_getinfo expects a pointer to long for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_double,
|
||||
"curl_easy_getinfo expects a pointer to double for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
"curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
|
||||
"curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo,
|
||||
"curl_easy_getinfo expects a pointer to "
|
||||
"'struct curl_tlssessioninfo *' for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_certinfo,
|
||||
"curl_easy_getinfo expects a pointer to "
|
||||
"'struct curl_certinfo *' for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_socket,
|
||||
"curl_easy_getinfo expects a pointer to curl_socket_t for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
|
||||
"curl_easy_getinfo expects a pointer to curl_off_t for this info")
|
||||
|
||||
/* groups of curl_easy_setops options that take the same type of argument */
|
||||
|
||||
@@ -218,58 +254,83 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
|
||||
/* evaluates to true if option takes a char* argument */
|
||||
#define _curl_is_string_option(option) \
|
||||
((option) == CURLOPT_URL || \
|
||||
(option) == CURLOPT_PROXY || \
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_NOPROXY || \
|
||||
((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \
|
||||
(option) == CURLOPT_ACCEPT_ENCODING || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
(option) == CURLOPT_CAINFO || \
|
||||
(option) == CURLOPT_CAPATH || \
|
||||
(option) == CURLOPT_COOKIE || \
|
||||
(option) == CURLOPT_COOKIEFILE || \
|
||||
(option) == CURLOPT_COOKIEJAR || \
|
||||
(option) == CURLOPT_COOKIELIST || \
|
||||
(option) == CURLOPT_FTPPORT || \
|
||||
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
||||
(option) == CURLOPT_FTP_ACCOUNT || \
|
||||
(option) == CURLOPT_RANGE || \
|
||||
(option) == CURLOPT_CUSTOMREQUEST || \
|
||||
(option) == CURLOPT_SSLCERT || \
|
||||
(option) == CURLOPT_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_SSLKEY || \
|
||||
(option) == CURLOPT_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_KEYPASSWD || \
|
||||
(option) == CURLOPT_SSLENGINE || \
|
||||
(option) == CURLOPT_CAINFO || \
|
||||
(option) == CURLOPT_CAPATH || \
|
||||
(option) == CURLOPT_RANDOM_FILE || \
|
||||
(option) == CURLOPT_EGDSOCKET || \
|
||||
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_KRBLEVEL || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
||||
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_CRLFILE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
(option) == CURLOPT_XOAUTH2_BEARER || \
|
||||
(option) == CURLOPT_DNS_SERVERS || \
|
||||
(option) == CURLOPT_CUSTOMREQUEST || \
|
||||
(option) == CURLOPT_DEFAULT_PROTOCOL || \
|
||||
(option) == CURLOPT_DNS_INTERFACE || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP4 || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP6 || \
|
||||
(option) == CURLOPT_DNS_SERVERS || \
|
||||
(option) == CURLOPT_DOH_URL || \
|
||||
(option) == CURLOPT_EGDSOCKET || \
|
||||
(option) == CURLOPT_FTPPORT || \
|
||||
(option) == CURLOPT_FTP_ACCOUNT || \
|
||||
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_KEYPASSWD || \
|
||||
(option) == CURLOPT_KRBLEVEL || \
|
||||
(option) == CURLOPT_LOGIN_OPTIONS || \
|
||||
(option) == CURLOPT_MAIL_AUTH || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_NOPROXY || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PRE_PROXY || \
|
||||
(option) == CURLOPT_PROXY || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_PROXY_CAINFO || \
|
||||
(option) == CURLOPT_PROXY_CAPATH || \
|
||||
(option) == CURLOPT_PROXY_CRLFILE || \
|
||||
(option) == CURLOPT_PROXY_KEYPASSWD || \
|
||||
(option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PROXY_SERVICE_NAME || \
|
||||
(option) == CURLOPT_PROXY_SSLCERT || \
|
||||
(option) == CURLOPT_PROXY_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_PROXY_SSLKEY || \
|
||||
(option) == CURLOPT_PROXY_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_PROXY_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_RANDOM_FILE || \
|
||||
(option) == CURLOPT_RANGE || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
(option) == CURLOPT_SERVICE_NAME || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
||||
(option) == CURLOPT_SSLCERT || \
|
||||
(option) == CURLOPT_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_SSLENGINE || \
|
||||
(option) == CURLOPT_SSLKEY || \
|
||||
(option) == CURLOPT_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_UNIX_SOCKET_PATH || \
|
||||
(option) == CURLOPT_URL || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_XOAUTH2_BEARER || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a curl_write_callback argument */
|
||||
@@ -285,21 +346,23 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
|
||||
/* evaluates to true if option takes a data argument to pass to a callback */
|
||||
#define _curl_is_cb_data_option(option) \
|
||||
((option) == CURLOPT_WRITEDATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PROGRESSDATA || \
|
||||
(option) == CURLOPT_HEADERDATA || \
|
||||
((option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_CLOSESOCKETDATA || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_PRIVATE || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
(option) == CURLOPT_HEADERDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PRIVATE || \
|
||||
(option) == CURLOPT_PROGRESSDATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_WRITEDATA || \
|
||||
(option) == CURLOPT_RESOLVER_START_DATA || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */
|
||||
@@ -310,13 +373,15 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
|
||||
/* evaluates to true if option takes a struct curl_slist * argument */
|
||||
#define _curl_is_slist_option(option) \
|
||||
((option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
((option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_PROXYHEADER || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_RESOLVE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
0)
|
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */
|
||||
@@ -334,8 +399,23 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
|
||||
|
||||
/* true if info expects a pointer to struct curl_slist * argument */
|
||||
#define _curl_is_slist_info(info) \
|
||||
(CURLINFO_SLIST < (info))
|
||||
#define _curl_is_slist_info(info) \
|
||||
(((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST))
|
||||
|
||||
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */
|
||||
#define _curl_is_tlssessioninfo_info(info) \
|
||||
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
|
||||
|
||||
/* true if info expects a pointer to struct curl_certinfo * argument */
|
||||
#define _curl_is_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
|
||||
|
||||
/* true if info expects a pointer to struct curl_socket_t argument */
|
||||
#define _curl_is_socket_info(info) \
|
||||
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T)
|
||||
|
||||
/* true if info expects a pointer to curl_off_t argument */
|
||||
#define _curl_is_off_t_info(info) \
|
||||
(CURLINFO_OFF_T < (info))
|
||||
|
||||
|
||||
/* typecheck helpers -- check whether given expression has requested type*/
|
||||
@@ -349,9 +429,9 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
* == or whatsoever.
|
||||
*/
|
||||
|
||||
/* XXX: should evaluate to true iff expr is a pointer */
|
||||
/* XXX: should evaluate to true if expr is a pointer */
|
||||
#define _curl_is_any_ptr(expr) \
|
||||
(sizeof(expr) == sizeof(void*))
|
||||
(sizeof(expr) == sizeof(void *))
|
||||
|
||||
/* evaluates to true if expr is NULL */
|
||||
/* XXX: must not evaluate expr, so this check is not accurate */
|
||||
@@ -414,13 +494,15 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type FILE* */
|
||||
#define _curl_is_FILE(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), FILE *))
|
||||
#define _curl_is_FILE(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), FILE *)))
|
||||
|
||||
/* evaluates to true if expr can be passed as POST data (void* or char*) */
|
||||
#define _curl_is_postfields(expr) \
|
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_arr((expr), char))
|
||||
_curl_is_arr((expr), char) || \
|
||||
_curl_is_arr((expr), unsigned char))
|
||||
|
||||
/* FIXME: the whole callback checking is messy...
|
||||
* The idea is to tolerate char vs. void and const vs. not const
|
||||
@@ -430,102 +512,107 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
* function pointers, hide it */
|
||||
#define _curl_callback_compatible(func, type) \
|
||||
(__builtin_types_compatible_p(__typeof__(func), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(func), type*))
|
||||
__builtin_types_compatible_p(__typeof__(func) *, type))
|
||||
|
||||
/* evaluates to true if expr is of type curl_resolver_start_callback */
|
||||
#define _curl_is_resolver_start_callback(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
_curl_callback_compatible((expr), curl_resolver_start_callback))
|
||||
|
||||
/* evaluates to true if expr is of type curl_read_callback or "similar" */
|
||||
#define _curl_is_read_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \
|
||||
_curl_callback_compatible((expr), __typeof__(fread) *) || \
|
||||
_curl_callback_compatible((expr), curl_read_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback6))
|
||||
typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);
|
||||
typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *);
|
||||
typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *);
|
||||
typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *);
|
||||
typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *);
|
||||
typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *);
|
||||
typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_write_callback or "similar" */
|
||||
#define _curl_is_write_cb(expr) \
|
||||
(_curl_is_read_cb(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \
|
||||
_curl_callback_compatible((expr), __typeof__(fwrite) *) || \
|
||||
_curl_callback_compatible((expr), curl_write_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback6))
|
||||
typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);
|
||||
typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *);
|
||||
typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t,
|
||||
const void *);
|
||||
typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *);
|
||||
typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *);
|
||||
typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t,
|
||||
const void *);
|
||||
typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
|
||||
#define _curl_is_ioctl_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \
|
||||
_curl_callback_compatible((expr), curl_ioctl_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback4))
|
||||
typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);
|
||||
typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);
|
||||
typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *);
|
||||
typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *);
|
||||
typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *);
|
||||
typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
|
||||
#define _curl_is_sockopt_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \
|
||||
_curl_callback_compatible((expr), curl_sockopt_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback2))
|
||||
typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
|
||||
typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
|
||||
typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
|
||||
typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t,
|
||||
curlsocktype);
|
||||
|
||||
/* evaluates to true if expr is of type curl_opensocket_callback or
|
||||
"similar" */
|
||||
#define _curl_is_opensocket_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
|
||||
_curl_callback_compatible((expr), curl_opensocket_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback4))
|
||||
typedef curl_socket_t (_curl_opensocket_callback1)
|
||||
typedef curl_socket_t (*_curl_opensocket_callback1)
|
||||
(void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback2)
|
||||
typedef curl_socket_t (*_curl_opensocket_callback2)
|
||||
(void *, curlsocktype, const struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback3)
|
||||
typedef curl_socket_t (*_curl_opensocket_callback3)
|
||||
(const void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback4)
|
||||
typedef curl_socket_t (*_curl_opensocket_callback4)
|
||||
(const void *, curlsocktype, const struct curl_sockaddr *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
|
||||
#define _curl_is_progress_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \
|
||||
_curl_callback_compatible((expr), curl_progress_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback2))
|
||||
typedef int (_curl_progress_callback1)(void *,
|
||||
typedef int (*_curl_progress_callback1)(void *,
|
||||
double, double, double, double);
|
||||
typedef int (_curl_progress_callback2)(const void *,
|
||||
typedef int (*_curl_progress_callback2)(const void *,
|
||||
double, double, double, double);
|
||||
|
||||
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
|
||||
#define _curl_is_debug_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \
|
||||
_curl_callback_compatible((expr), curl_debug_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback3) || \
|
||||
@@ -534,28 +621,28 @@ typedef int (_curl_progress_callback2)(const void *,
|
||||
_curl_callback_compatible((expr), _curl_debug_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback8))
|
||||
typedef int (_curl_debug_callback1) (CURL *,
|
||||
typedef int (*_curl_debug_callback1) (CURL *,
|
||||
curl_infotype, char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback2) (CURL *,
|
||||
typedef int (*_curl_debug_callback2) (CURL *,
|
||||
curl_infotype, char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback3) (CURL *,
|
||||
typedef int (*_curl_debug_callback3) (CURL *,
|
||||
curl_infotype, const char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback4) (CURL *,
|
||||
typedef int (*_curl_debug_callback4) (CURL *,
|
||||
curl_infotype, const char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback5) (CURL *,
|
||||
typedef int (*_curl_debug_callback5) (CURL *,
|
||||
curl_infotype, unsigned char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback6) (CURL *,
|
||||
typedef int (*_curl_debug_callback6) (CURL *,
|
||||
curl_infotype, unsigned char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback7) (CURL *,
|
||||
typedef int (*_curl_debug_callback7) (CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback8) (CURL *,
|
||||
typedef int (*_curl_debug_callback8) (CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, const void *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
|
||||
/* this is getting even messier... */
|
||||
#define _curl_is_ssl_ctx_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \
|
||||
_curl_callback_compatible((expr), curl_ssl_ctx_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
|
||||
@@ -564,18 +651,19 @@ typedef int (_curl_debug_callback8) (CURL *,
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
|
||||
typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *,
|
||||
const void *);
|
||||
#ifdef HEADER_SSL_H
|
||||
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
|
||||
* this will of course break if we're included before OpenSSL headers...
|
||||
*/
|
||||
typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
|
||||
typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
|
||||
const void *);
|
||||
#else
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
|
||||
@@ -587,7 +675,7 @@ typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
|
||||
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
|
||||
#define _curl_is_conv_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \
|
||||
_curl_callback_compatible((expr), curl_conv_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback3) || \
|
||||
@@ -600,7 +688,7 @@ typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
|
||||
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
|
||||
#define _curl_is_seek_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \
|
||||
_curl_callback_compatible((expr), curl_seek_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback2))
|
||||
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
|
||||
|
||||
120
ext/curl/include/curl/urlapi.h
Normal file
120
ext/curl/include/curl/urlapi.h
Normal file
@@ -0,0 +1,120 @@
|
||||
#ifndef __CURL_URLAPI_H
|
||||
#define __CURL_URLAPI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* the error codes for the URL API */
|
||||
typedef enum {
|
||||
CURLUE_OK,
|
||||
CURLUE_BAD_HANDLE, /* 1 */
|
||||
CURLUE_BAD_PARTPOINTER, /* 2 */
|
||||
CURLUE_MALFORMED_INPUT, /* 3 */
|
||||
CURLUE_BAD_PORT_NUMBER, /* 4 */
|
||||
CURLUE_UNSUPPORTED_SCHEME, /* 5 */
|
||||
CURLUE_URLDECODE, /* 6 */
|
||||
CURLUE_OUT_OF_MEMORY, /* 7 */
|
||||
CURLUE_USER_NOT_ALLOWED, /* 8 */
|
||||
CURLUE_UNKNOWN_PART, /* 9 */
|
||||
CURLUE_NO_SCHEME, /* 10 */
|
||||
CURLUE_NO_USER, /* 11 */
|
||||
CURLUE_NO_PASSWORD, /* 12 */
|
||||
CURLUE_NO_OPTIONS, /* 13 */
|
||||
CURLUE_NO_HOST, /* 14 */
|
||||
CURLUE_NO_PORT, /* 15 */
|
||||
CURLUE_NO_QUERY, /* 16 */
|
||||
CURLUE_NO_FRAGMENT /* 17 */
|
||||
} CURLUcode;
|
||||
|
||||
typedef enum {
|
||||
CURLUPART_URL,
|
||||
CURLUPART_SCHEME,
|
||||
CURLUPART_USER,
|
||||
CURLUPART_PASSWORD,
|
||||
CURLUPART_OPTIONS,
|
||||
CURLUPART_HOST,
|
||||
CURLUPART_PORT,
|
||||
CURLUPART_PATH,
|
||||
CURLUPART_QUERY,
|
||||
CURLUPART_FRAGMENT
|
||||
} CURLUPart;
|
||||
|
||||
#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */
|
||||
#define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set,
|
||||
if the port number matches the
|
||||
default for the scheme */
|
||||
#define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if
|
||||
missing */
|
||||
#define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */
|
||||
#define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */
|
||||
#define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */
|
||||
#define CURLU_URLDECODE (1<<6) /* URL decode on get */
|
||||
#define CURLU_URLENCODE (1<<7) /* URL encode on set */
|
||||
#define CURLU_APPENDQUERY (1<<8) /* append a form style part */
|
||||
#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */
|
||||
|
||||
typedef struct Curl_URL CURLU;
|
||||
|
||||
/*
|
||||
* curl_url() creates a new CURLU handle and returns a pointer to it.
|
||||
* Must be freed with curl_url_cleanup().
|
||||
*/
|
||||
CURL_EXTERN CURLU *curl_url(void);
|
||||
|
||||
/*
|
||||
* curl_url_cleanup() frees the CURLU handle and related resources used for
|
||||
* the URL parsing. It will not free strings previously returned with the URL
|
||||
* API.
|
||||
*/
|
||||
CURL_EXTERN void curl_url_cleanup(CURLU *handle);
|
||||
|
||||
/*
|
||||
* curl_url_dup() duplicates a CURLU handle and returns a new copy. The new
|
||||
* handle must also be freed with curl_url_cleanup().
|
||||
*/
|
||||
CURL_EXTERN CURLU *curl_url_dup(CURLU *in);
|
||||
|
||||
/*
|
||||
* curl_url_get() extracts a specific part of the URL from a CURLU
|
||||
* handle. Returns error code. The returned pointer MUST be freed with
|
||||
* curl_free() afterwards.
|
||||
*/
|
||||
CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
|
||||
char **part, unsigned int flags);
|
||||
|
||||
/*
|
||||
* curl_url_set() sets a specific part of the URL in a CURLU handle. Returns
|
||||
* error code. The passed in string will be copied. Passing a NULL instead of
|
||||
* a part string, clears that part.
|
||||
*/
|
||||
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what,
|
||||
const char *part, unsigned int flags);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Binary file not shown.
BIN
ext/curl/lib/libcurl.exp
Normal file
BIN
ext/curl/lib/libcurl.exp
Normal file
Binary file not shown.
BIN
ext/curl/lib/libcurl.lib
Normal file
BIN
ext/curl/lib/libcurl.lib
Normal file
Binary file not shown.
Binary file not shown.
@@ -55,6 +55,7 @@ namespace interaction {
|
||||
struct WebsocketInputStates;
|
||||
class KeybindingManager;
|
||||
class NavigationHandler;
|
||||
class SessionRecording;
|
||||
class ShortcutManager;
|
||||
} // namespace interaction
|
||||
namespace performance { class PerformanceManager; }
|
||||
@@ -90,6 +91,7 @@ interaction::JoystickInputStates& gJoystickInputStates();
|
||||
interaction::WebsocketInputStates& gWebsocketInputStates();
|
||||
interaction::KeybindingManager& gKeybindingManager();
|
||||
interaction::NavigationHandler& gNavigationHandler();
|
||||
interaction::SessionRecording& gSessionRecording();
|
||||
interaction::ShortcutManager& gShortcutManager();
|
||||
performance::PerformanceManager& gPerformanceManager();
|
||||
properties::PropertyOwner& gRootPropertyOwner();
|
||||
@@ -124,6 +126,7 @@ static interaction::WebsocketInputStates& websocketInputStates =
|
||||
detail::gWebsocketInputStates();
|
||||
static interaction::KeybindingManager& keybindingManager = detail::gKeybindingManager();
|
||||
static interaction::NavigationHandler& navigationHandler = detail::gNavigationHandler();
|
||||
static interaction::SessionRecording& sessionRecording = detail::gSessionRecording();
|
||||
static interaction::ShortcutManager& shortcutManager = detail::gShortcutManager();
|
||||
static performance::PerformanceManager& performanceManager =
|
||||
detail::gPerformanceManager();
|
||||
|
||||
82
include/openspace/interaction/externinteraction.h
Normal file
82
include/openspace/interaction/externinteraction.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___EXTERNINTERACTION___H__
|
||||
#define __OPENSPACE_CORE___EXTERNINTERACTION___H__
|
||||
|
||||
#include <openspace/network/messagestructures.h>
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
#include <ghoul/io/socket/tcpsocket.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class ExternInteraction : public properties::PropertyOwner {
|
||||
public:
|
||||
ExternInteraction();
|
||||
/**
|
||||
* Method that generates a keyframeNavigator CameraPose from a CameraKeyframe
|
||||
* object, and then adds this to the navigationHandler's keyframe navigator.
|
||||
* \param kf The camera keyframe to add.
|
||||
*/
|
||||
void cameraInteraction(datamessagestructures::CameraKeyframe kf);
|
||||
/**
|
||||
* Method that generates a TimeKeyframeData from a TimeKeyframe object, and
|
||||
* then adds this to the timeManager.
|
||||
* \param kf The time keyframe to add.
|
||||
*/
|
||||
void timeInteraction(datamessagestructures::TimeKeyframe kf);
|
||||
/**
|
||||
* Method that passes a ScriptMessage object to the script engine, calling its
|
||||
* queueScript method to add it for execution.
|
||||
* \param sm The ScriptMessage object to queue in the script engine.
|
||||
*/
|
||||
void scriptInteraction(datamessagestructures::ScriptMessage sm);
|
||||
/**
|
||||
* Method that accepts a reference to a CameraKeyframe object, and populates
|
||||
* it with the current properties of the camera from the navigation handler.
|
||||
* \returns CameraKeyframe with current state from NavigationHandler.
|
||||
*/
|
||||
datamessagestructures::CameraKeyframe generateCameraKeyframe();
|
||||
/**
|
||||
* Method that accepts a reference to a TimeKeyframe object, and populates
|
||||
* it with the current time values from the application time manager.
|
||||
* \returns TimeKeyframe The time keyframe.
|
||||
*/
|
||||
datamessagestructures::TimeKeyframe generateTimeKeyframe();
|
||||
/**
|
||||
* Method that accepts a reference to a ScriptMessage object and a script
|
||||
* string, and populates the ScriptMessage with the script and timestamp
|
||||
* of the current application time.
|
||||
* \param script The script to execute in std::string form.
|
||||
* \returns ScriptMessage The ScriptMessage data structure with script.
|
||||
*/
|
||||
datamessagestructures::ScriptMessage generateScriptMessage(std::string script);
|
||||
private:
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___EXTERNINTERACTION___H__
|
||||
@@ -31,10 +31,19 @@
|
||||
#include <ghoul/misc/boolean.h>
|
||||
#include <glm/gtx/quaternion.hpp>
|
||||
|
||||
namespace openspace { class Camera; }
|
||||
namespace openspace {
|
||||
class Camera;
|
||||
class TimeManager;
|
||||
} // namespace openspace
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
enum class KeyframeTimeRef {
|
||||
Relative_applicationStart,
|
||||
Relative_recordedStart,
|
||||
Absolute_simTimeJ2000
|
||||
};
|
||||
|
||||
class KeyframeNavigator {
|
||||
public:
|
||||
BooleanType(Inclusive);
|
||||
@@ -47,16 +56,31 @@ public:
|
||||
bool followFocusNodeRotation;
|
||||
};
|
||||
|
||||
void updateCamera(Camera& camera);
|
||||
/**
|
||||
* Update camera position using the next camera pose keyframe from the timeline.
|
||||
* Returns true if camera was set to a pose from the next keyframe.
|
||||
* Returns false if no keyframes are available after the current time.
|
||||
* \param camera A reference to the camera object to have its pose updated.
|
||||
* \param ignoreFutureKeyframes true if only past keyframes are to be used.
|
||||
* \returns true only if a new future keyframe is available to set camera pose.
|
||||
*/
|
||||
bool updateCamera(Camera& camera, bool ignoreFutureKeyframes);
|
||||
static bool updateCamera(Camera* camera, const CameraPose prevPose,
|
||||
const CameraPose nextPose, double t, bool ignoreFutureKeyframes);
|
||||
|
||||
Timeline<CameraPose>& timeline();
|
||||
|
||||
void addKeyframe(double timestamp, KeyframeNavigator::CameraPose pose);
|
||||
void removeKeyframesAfter(double timestamp, Inclusive inclusive = Inclusive::No);
|
||||
void clearKeyframes();
|
||||
size_t nKeyframes() const;
|
||||
const std::vector<datamessagestructures::CameraKeyframe>& keyframes() const;
|
||||
double currentTime() const;
|
||||
void setTimeReferenceMode(KeyframeTimeRef refType, double referenceTimestamp);
|
||||
|
||||
private:
|
||||
Timeline<CameraPose> _cameraPoseTimeline;
|
||||
KeyframeTimeRef _timeframeMode = KeyframeTimeRef::Relative_applicationStart;
|
||||
double _referenceTimestamp = 0.0;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
@@ -63,8 +63,11 @@ public:
|
||||
void setInterpolationTime(float durationInSeconds);
|
||||
|
||||
void setCameraStateFromDictionary(const ghoul::Dictionary& cameraDict);
|
||||
|
||||
void updateCamera(double deltaTime);
|
||||
void setEnableKeyFrameInteraction();
|
||||
void setDisableKeyFrameInteraction();
|
||||
void triggerPlaybackStart();
|
||||
void stopPlayback();
|
||||
|
||||
// Accessors
|
||||
ghoul::Dictionary cameraStateDictionary();
|
||||
@@ -75,6 +78,7 @@ public:
|
||||
const InputState& inputState() const;
|
||||
const OrbitalNavigator& orbitalNavigator() const;
|
||||
KeyframeNavigator& keyframeNavigator() const;
|
||||
bool isKeyFrameInteractionEnabled() const;
|
||||
float interpolationTime() const;
|
||||
|
||||
// Callback functions
|
||||
@@ -122,9 +126,11 @@ public:
|
||||
|
||||
private:
|
||||
bool _cameraUpdatedFromScript = false;
|
||||
bool _playbackModeEnabled = false;
|
||||
|
||||
std::unique_ptr<InputState> _inputState;
|
||||
Camera* _camera = nullptr;
|
||||
std::function<void()> _playbackEndCallback;
|
||||
|
||||
std::unique_ptr<OrbitalNavigator> _orbitalNavigator;
|
||||
std::unique_ptr<KeyframeNavigator> _keyframeNavigator;
|
||||
|
||||
268
include/openspace/interaction/sessionrecording.h
Normal file
268
include/openspace/interaction/sessionrecording.h
Normal file
@@ -0,0 +1,268 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___SESSIONRECORDING___H__
|
||||
#define __OPENSPACE_CORE___SESSIONRECORDING___H__
|
||||
|
||||
#include <openspace/interaction/externinteraction.h>
|
||||
#include <openspace/interaction/keyframenavigator.h>
|
||||
#include <openspace/network/messagestructures.h>
|
||||
#include <openspace/scripting/lualibrary.h>
|
||||
#include <ghoul/io/socket/tcpsocket.h>
|
||||
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
|
||||
namespace openspace::interaction {
|
||||
#define RECORD_BINARY
|
||||
|
||||
class KeyframeNavigator;
|
||||
|
||||
class SessionRecording : public properties::PropertyOwner {
|
||||
public:
|
||||
enum class RecordedDataMode {
|
||||
Ascii,
|
||||
Binary
|
||||
};
|
||||
|
||||
SessionRecording();
|
||||
~SessionRecording();
|
||||
/**
|
||||
* Used to de-initialize the session recording feature. Any recording or playback
|
||||
* in progress will be stopped, files closed, and keyframes in memory deleted.
|
||||
*/
|
||||
void deinitialize();
|
||||
|
||||
/**
|
||||
* This is called with every rendered frame. If in recording state, the camera
|
||||
* state will be saved to the recording file (if its state has changed since last).
|
||||
* If in playback state, the next keyframe will be used (if it is time to do so).
|
||||
*/
|
||||
void preSynchronization();
|
||||
|
||||
/**
|
||||
* Starts a recording session, which will save data to the provided filename
|
||||
* according to the data format specified, and will continue until recording is
|
||||
* stopped using stopRecording() method.
|
||||
* \param filename file saved with recorded keyframes.
|
||||
* \returns true if recording to file starts without errors.
|
||||
*/
|
||||
bool startRecording(std::string filename);
|
||||
|
||||
/**
|
||||
* Starts a recording session, which will save data to the provided filename
|
||||
* in ASCII data format until recording is stopped using stopRecording() method.
|
||||
* \param filename file saved with recorded keyframes.
|
||||
* \returns true if recording to file starts without errors.
|
||||
*/
|
||||
void setRecordDataFormat(RecordedDataMode dataMode);
|
||||
|
||||
/**
|
||||
* Used to stop a recording in progress. If open, the recording file will be closed,
|
||||
* and all keyframes deleted from memory.
|
||||
*/
|
||||
void stopRecording();
|
||||
|
||||
/**
|
||||
* Used to check if a session recording is in progress.
|
||||
* \returns true if recording is in progress.
|
||||
*/
|
||||
bool isRecording() const;
|
||||
|
||||
/**
|
||||
* Starts a playback session, which can run in one of three different time modes.
|
||||
* \param filename file containing recorded keyframes to play back
|
||||
* \param timeMode which of the 3 time modes to use for time reference during
|
||||
* \param forceSimTimeAtStart if true simulation time is forced to that of playback
|
||||
* playback: recorded time, application time, or simulation time. See the LuaLibrary
|
||||
* entry for SessionRecording for details on these time modes.
|
||||
* \returns true if recording to file starts without errors.
|
||||
*/
|
||||
bool startPlayback(const std::string& filename, KeyframeTimeRef timeMode,
|
||||
bool forceSimTimeAtStart);
|
||||
|
||||
/**
|
||||
* Used to stop a playback in progress. If open, the playback file will be closed,
|
||||
* and all keyframes deleted from memory.
|
||||
*/
|
||||
void stopPlayback();
|
||||
|
||||
/**
|
||||
* Used to check if a session playback is in progress.
|
||||
* \returns true if playback is in progress.
|
||||
*/
|
||||
bool isPlayingBack() const;
|
||||
|
||||
/**
|
||||
* Used to trigger a save of the camera states (position, rotation, focus node,
|
||||
* whether it is following the rotation of a node, and timestamp). The data will
|
||||
* be saved to the recording file only if a recording is currently in progress.
|
||||
*/
|
||||
void saveCameraKeyframe();
|
||||
|
||||
/**
|
||||
* Used to trigger a save of the current timing states. The data will be saved
|
||||
* to the recording file only if a recording is currently in progress.
|
||||
*/
|
||||
void saveTimeKeyframe();
|
||||
|
||||
/**
|
||||
* Used to trigger a save of a script to the recording file, but only if a recording
|
||||
* is currently in progress.
|
||||
* \param scriptToSave String of the Lua command to be saved.
|
||||
*/
|
||||
void saveScriptKeyframe(std::string scriptToSave);
|
||||
|
||||
/**
|
||||
* \return The Lua library that contains all Lua functions available to affect the
|
||||
* interaction
|
||||
*/
|
||||
static openspace::scripting::LuaLibrary luaLibrary();
|
||||
|
||||
private:
|
||||
enum class SessionState {
|
||||
Idle = 0,
|
||||
Recording,
|
||||
Playback
|
||||
};
|
||||
enum class RecordedType {
|
||||
Camera = 0,
|
||||
Time,
|
||||
Script,
|
||||
Invalid
|
||||
};
|
||||
struct timelineEntry {
|
||||
RecordedType keyframeType;
|
||||
unsigned int idxIntoKeyframeTypeArray;
|
||||
double timestamp;
|
||||
};
|
||||
ExternInteraction _externInteract;
|
||||
bool _isRecording = false;
|
||||
double _timestampRecordStarted;
|
||||
double _timestampPlaybackStarted_application;
|
||||
double _timestampPlaybackStarted_simulation;
|
||||
double _timestampApplicationStarted_simulation;
|
||||
bool hasCameraChangedFromPrev(datamessagestructures::CameraKeyframe kfNew);
|
||||
double appropriateTimestamp(double timeOs, double timeRec, double timeSim);
|
||||
double equivalentSimulationTime(double timeOs, double timeRec, double timeSim);
|
||||
double equivalentApplicationTime(double timeOs, double timeRec, double timeSim);
|
||||
double currentTime() const;
|
||||
|
||||
void playbackCamera();
|
||||
void playbackTimeChange();
|
||||
void playbackScript();
|
||||
bool playbackAddEntriesToTimeline();
|
||||
void signalPlaybackFinishedForComponent(RecordedType type);
|
||||
void writeToFileBuffer(const double src);
|
||||
void writeToFileBuffer(std::vector<char>& cvec);
|
||||
void writeToFileBuffer(const unsigned char c);
|
||||
void writeToFileBuffer(bool b);
|
||||
void saveStringToFile(const std::string s);
|
||||
void saveKeyframeToFileBinary(unsigned char* bufferSource, size_t size);
|
||||
void findFirstCameraKeyframeInTimeline();
|
||||
std::string readHeaderElement(size_t readLen_chars);
|
||||
void readFromPlayback(unsigned char& result);
|
||||
void readFromPlayback(double& result);
|
||||
void readFromPlayback(float& result);
|
||||
void readFromPlayback(size_t& result);
|
||||
void readFromPlayback(bool& result);
|
||||
void readFromPlayback(std::string& result);
|
||||
void saveKeyframeToFile(std::string entry);
|
||||
|
||||
void addKeyframe(double timestamp, interaction::KeyframeNavigator::CameraPose keyframe);
|
||||
void addKeyframe(double timestamp, datamessagestructures::TimeKeyframe keyframe);
|
||||
void addKeyframe(double timestamp, std::string scriptToQueue);
|
||||
void moveAheadInTime();
|
||||
void lookForNonCameraKeyframesThatHaveComeDue(double currTime);
|
||||
void updateCameraWithOrWithoutNewKeyframes(double currTime);
|
||||
bool isTimeToHandleNextNonCameraKeyframe(double currTime);
|
||||
bool processNextNonCameraKeyframeAheadInTime();
|
||||
bool findNextFutureCameraIndex(double currTime);
|
||||
bool processCameraKeyframe(double now);
|
||||
bool processScriptKeyframe();
|
||||
bool isDataModeBinary();
|
||||
unsigned int findIndexOfLastCameraKeyframeInTimeline();
|
||||
bool doesTimelineEntryContainCamera(unsigned int index) const;
|
||||
|
||||
RecordedType getNextKeyframeType();
|
||||
RecordedType getPrevKeyframeType();
|
||||
double getNextTimestamp();
|
||||
double getPrevTimestamp();
|
||||
void cleanUpPlayback();
|
||||
|
||||
const bool _usingTimeKeyframes = false;
|
||||
const std::string _fileHeaderTitle = "OpenSpace_record/playback";
|
||||
static const size_t _fileHeaderVersionLength = 5;
|
||||
const char _fileHeaderVersion[_fileHeaderVersionLength] = { '0', '0', '.', '8', '5' };
|
||||
const char dataFormatAsciiTag = 'A';
|
||||
const char dataFormatBinaryTag = 'B';
|
||||
|
||||
RecordedDataMode _recordingDataMode = RecordedDataMode::Binary;
|
||||
SessionState _state = SessionState::Idle;
|
||||
std::string _playbackFilename;
|
||||
std::ifstream _playbackFile;
|
||||
std::string _playbackLineParsing;
|
||||
std::ofstream _recordFile;
|
||||
int _playbackLineNum = 1;
|
||||
KeyframeTimeRef _playbackTimeReferenceMode;
|
||||
datamessagestructures::CameraKeyframe _prevRecordedCameraKeyframe;
|
||||
bool _playbackActive_camera = false;
|
||||
bool _playbackActive_time = false;
|
||||
bool _playbackActive_script = false;
|
||||
bool _hasHitEndOfCameraKeyframes = false;
|
||||
bool _setSimulationTimeWithNextCameraKeyframe = false;
|
||||
|
||||
static const size_t keyframeHeaderSize_bytes = 33;
|
||||
static const size_t saveBufferCameraSize_min = 82;
|
||||
static const size_t saveBufferStringSize_max = 500;
|
||||
static const size_t _saveBufferMaxSize_bytes = keyframeHeaderSize_bytes +
|
||||
+ saveBufferCameraSize_min
|
||||
+ saveBufferStringSize_max;
|
||||
unsigned char _keyframeBuffer[_saveBufferMaxSize_bytes];
|
||||
size_t _bufferIndex = 0;
|
||||
|
||||
bool _cleanupNeeded = false;
|
||||
|
||||
std::vector < interaction::KeyframeNavigator::CameraPose> _keyframesCamera;
|
||||
std::vector<datamessagestructures::TimeKeyframe> _keyframesTime;
|
||||
std::vector<std::string> _keyframesScript;
|
||||
std::vector<timelineEntry> _timeline;
|
||||
|
||||
unsigned int _idxTimeline_nonCamera = 0;
|
||||
unsigned int _idxTime = 0;
|
||||
unsigned int _idxScript = 0;
|
||||
|
||||
unsigned int _idxTimeline_cameraPtrNext = 0;
|
||||
unsigned int _idxTimeline_cameraPtrPrev = 0;
|
||||
|
||||
unsigned int _idxTimeline_cameraFirstInTimeline = 0;
|
||||
double _cameraFirstInTimeline_timestamp = 0;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#include "sessionrecording.inl"
|
||||
|
||||
#endif // __OPENSPACE_CORE___SESSIONRECORDING___H__
|
||||
57
include/openspace/interaction/sessionrecording.inl
Normal file
57
include/openspace/interaction/sessionrecording.inl
Normal file
@@ -0,0 +1,57 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
template <class T>
|
||||
T nextKeyframeObj(unsigned int index,
|
||||
const std::vector<T>& keyframeContainer,
|
||||
std::function<void()> finishedCallback)
|
||||
{
|
||||
if (index >= (keyframeContainer.size() - 1)) {
|
||||
if( index == (keyframeContainer.size() - 1) )
|
||||
finishedCallback();
|
||||
return keyframeContainer.back();
|
||||
} else if (index < keyframeContainer.size()) {
|
||||
return keyframeContainer[index];
|
||||
} else {
|
||||
return keyframeContainer.back();
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T prevKeyframeObj(unsigned int index,
|
||||
const std::vector<T>& keyframeContainer)
|
||||
{
|
||||
if (index >= keyframeContainer.size()) {
|
||||
return keyframeContainer.back();
|
||||
} else if (index > 0) {
|
||||
return keyframeContainer[index - 1];
|
||||
} else {
|
||||
return keyframeContainer.front();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace openspace::interaction
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
namespace openspace::datamessagestructures {
|
||||
|
||||
@@ -142,6 +143,96 @@ struct CameraKeyframe {
|
||||
|
||||
return offset;
|
||||
};
|
||||
|
||||
void write(std::ostream& out) const {
|
||||
// Write position
|
||||
out.write(
|
||||
reinterpret_cast<const char*>(&_position),
|
||||
sizeof(_position)
|
||||
);
|
||||
|
||||
// Write orientation
|
||||
out.write(
|
||||
reinterpret_cast<const char*>(&_rotation),
|
||||
sizeof(_rotation)
|
||||
);
|
||||
|
||||
// Write follow focus node rotation?
|
||||
out.write(
|
||||
reinterpret_cast<const char*>(&_followNodeRotation),
|
||||
sizeof(_followNodeRotation)
|
||||
);
|
||||
|
||||
int nodeNameLength = static_cast<int>(_focusNode.size());
|
||||
|
||||
// Write focus node
|
||||
out.write(
|
||||
reinterpret_cast<const char*>(&nodeNameLength),
|
||||
sizeof(nodeNameLength)
|
||||
);
|
||||
out.write(
|
||||
_focusNode.c_str(),
|
||||
_focusNode.size()
|
||||
);
|
||||
|
||||
//Write scale
|
||||
out.write(
|
||||
reinterpret_cast<const char*>(&_scale),
|
||||
sizeof(_scale)
|
||||
);
|
||||
|
||||
// Write timestamp
|
||||
out.write(
|
||||
reinterpret_cast<const char*>(&_timestamp),
|
||||
sizeof(_timestamp)
|
||||
);
|
||||
};
|
||||
|
||||
void read(std::istream* in) {
|
||||
// Read position
|
||||
in->read(
|
||||
reinterpret_cast<char*>(&_position),
|
||||
sizeof(_position)
|
||||
);
|
||||
|
||||
// Read orientation
|
||||
in->read(
|
||||
reinterpret_cast<char*>(&_rotation),
|
||||
sizeof(_rotation)
|
||||
);
|
||||
|
||||
// Read follow focus node rotation
|
||||
unsigned char b;
|
||||
in->read(
|
||||
reinterpret_cast<char*>(&b),
|
||||
sizeof(unsigned char)
|
||||
);
|
||||
_followNodeRotation = (b == 1);
|
||||
|
||||
// Read focus node
|
||||
int nodeNameLength = static_cast<int>(_focusNode.size());
|
||||
in->read(
|
||||
reinterpret_cast<char*>(&nodeNameLength),
|
||||
sizeof(nodeNameLength)
|
||||
);
|
||||
std::vector<char> temp(nodeNameLength + 1);
|
||||
in->read(temp.data(), nodeNameLength);
|
||||
|
||||
temp[nodeNameLength] = '\0';
|
||||
_focusNode = temp.data();
|
||||
|
||||
// Read scale
|
||||
in->read(
|
||||
reinterpret_cast<char*>(&_scale),
|
||||
sizeof(_scale)
|
||||
);
|
||||
|
||||
// Read timestamp
|
||||
in->read(
|
||||
reinterpret_cast<char*>(&_timestamp),
|
||||
sizeof(_timestamp)
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
struct TimeKeyframe {
|
||||
@@ -169,6 +260,20 @@ struct TimeKeyframe {
|
||||
offset += sizeof(TimeKeyframe);
|
||||
return offset;
|
||||
};
|
||||
|
||||
void write(std::ostream* out) const {
|
||||
out->write(
|
||||
reinterpret_cast<const char*>(this),
|
||||
sizeof(TimeKeyframe)
|
||||
);
|
||||
};
|
||||
|
||||
void read(std::istream* in) {
|
||||
in->read(
|
||||
reinterpret_cast<char*>(this),
|
||||
sizeof(TimeKeyframe)
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
struct TimeTimeline {
|
||||
@@ -216,6 +321,38 @@ struct TimeTimeline {
|
||||
}
|
||||
return offset;
|
||||
};
|
||||
|
||||
void write(std::ostream* out) const {
|
||||
out->write(
|
||||
reinterpret_cast<const char*>(&_clear),
|
||||
sizeof(bool)
|
||||
);
|
||||
|
||||
int64_t nKeyframes = _keyframes.size();
|
||||
out->write(
|
||||
reinterpret_cast<const char*>(&nKeyframes),
|
||||
sizeof(int64_t)
|
||||
);
|
||||
for (const auto& k : _keyframes) {
|
||||
k.write(out);
|
||||
}
|
||||
};
|
||||
|
||||
void read(std::istream* in) {
|
||||
in->read(
|
||||
reinterpret_cast<char*>(&_clear),
|
||||
sizeof(bool)
|
||||
);
|
||||
|
||||
int64_t nKeyframes = _keyframes.size();
|
||||
in->read(
|
||||
reinterpret_cast<char*>(&nKeyframes),
|
||||
sizeof(int64_t)
|
||||
);
|
||||
for (auto& k : _keyframes) {
|
||||
k.read(in);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
struct ScriptMessage {
|
||||
@@ -225,6 +362,7 @@ struct ScriptMessage {
|
||||
}
|
||||
|
||||
std::string _script;
|
||||
double _timestamp;
|
||||
|
||||
void serialize(std::vector<char> &buffer) const {
|
||||
buffer.insert(buffer.end(), _script.begin(), _script.end());
|
||||
@@ -233,6 +371,23 @@ struct ScriptMessage {
|
||||
void deserialize(const std::vector<char> &buffer) {
|
||||
_script.assign(buffer.begin(), buffer.end());
|
||||
};
|
||||
|
||||
void write(std::ostream* out) const {
|
||||
out->write(_script.c_str(), _script.size());
|
||||
};
|
||||
|
||||
void read(std::istream* in) {
|
||||
size_t strLen;
|
||||
//Read string length from file
|
||||
in->read(reinterpret_cast<char*>(&strLen), sizeof(strLen));
|
||||
//Read back full string
|
||||
std::vector<char> temp(strLen + 1);
|
||||
in->read(temp.data(), strLen);
|
||||
temp[strLen] = '\0';
|
||||
|
||||
_script.erase();
|
||||
_script = temp.data();
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace openspace::messagestructures
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define __OPENSPACE_CORE___PARALLELPEER___H__
|
||||
|
||||
#include <openspace/network/parallelconnection.h>
|
||||
#include <openspace/interaction/externinteraction.h>
|
||||
#include <openspace/network/messagestructures.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
|
||||
@@ -132,6 +133,8 @@ private:
|
||||
std::unique_ptr<std::thread> _receiveThread = nullptr;
|
||||
std::shared_ptr<ghoul::Event<>> _connectionEvent;
|
||||
|
||||
ExternInteraction _externInteract;
|
||||
|
||||
ParallelConnection _connection;
|
||||
|
||||
TimeManager::CallbackHandle _timeJumpCallback = -1;
|
||||
|
||||
@@ -25,8 +25,21 @@
|
||||
#ifndef __OPENSPACE_CORE___SCRIPTSCHEDULER___H__
|
||||
#define __OPENSPACE_CORE___SCRIPTSCHEDULER___H__
|
||||
|
||||
#include <openspace/scripting/lualibrary.h>
|
||||
#include <openspace/interaction/keyframenavigator.h>
|
||||
|
||||
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
namespace {
|
||||
constexpr const char* KeyTime = "Time";
|
||||
constexpr const char* KeyForwardScript = "ForwardScript";
|
||||
constexpr const char* KeyBackwardScript = "BackwardScript";
|
||||
constexpr const char* KeyUniversalScript = "Script";
|
||||
} // namespace
|
||||
|
||||
namespace ghoul { class Dictionary; }
|
||||
namespace openspace::documentation { struct Documentation; }
|
||||
@@ -71,15 +84,16 @@ public:
|
||||
void clearSchedule();
|
||||
|
||||
/**
|
||||
* Progresses the script schedulers time and returns all scripts that has been
|
||||
* scheduled to run between \param newTime and the time provided in the last
|
||||
* invocation of this method.
|
||||
*
|
||||
* \param newTime A j2000 time value specifying the new time stamp that
|
||||
* the script scheduler should progress to.
|
||||
*
|
||||
* \returns the ordered queue of scripts .
|
||||
*/
|
||||
* Progresses the script schedulers time and returns all scripts that has been
|
||||
* scheduled to run between \param newTime and the time provided in the last invocation
|
||||
* of this method.
|
||||
*
|
||||
* \param newTime_simulation A j2000 time value specifying the new time stamp that
|
||||
* the script scheduler should progress to.
|
||||
* \param newTime_application The seconds elapsed since the application started
|
||||
*
|
||||
* \returns the ordered queue of scripts .
|
||||
*/
|
||||
// std::queue<std::string> progressTo(double newTime);
|
||||
|
||||
/**
|
||||
@@ -103,8 +117,29 @@ public:
|
||||
*/
|
||||
std::vector<ScheduledScript> allScripts() const;
|
||||
|
||||
/**
|
||||
* Sets the mode for how each scheduled script's timestamp will be interpreted.
|
||||
* \param refType reference mode (for exact syntax, see definition of
|
||||
* openspace::interaction::KeyframeTimeRef) which is either relative to the
|
||||
* application start time, relative to the recorded session playback start time,
|
||||
* or according to the absolute simulation time in seconds from J2000 epoch.
|
||||
*/
|
||||
void setTimeReferenceMode(openspace::interaction::KeyframeTimeRef refType);
|
||||
|
||||
/**
|
||||
* Sets the mode for scripts being run from playback
|
||||
*/
|
||||
void triggerPlaybackStart();
|
||||
|
||||
/**
|
||||
* Sets the flag for scripts no longer being run from playback
|
||||
*/
|
||||
void stopPlayback();
|
||||
|
||||
static LuaLibrary luaLibrary();
|
||||
void setModeApplicationTime();
|
||||
void setModeRecordedTime();
|
||||
void setModeSimulationTime();
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
@@ -115,6 +150,10 @@ private:
|
||||
|
||||
int _currentIndex = 0;
|
||||
double _currentTime = 0;
|
||||
bool _playbackModeEnabled = false;
|
||||
|
||||
openspace::interaction::KeyframeTimeRef _timeframeMode
|
||||
= openspace::interaction::KeyframeTimeRef::Absolute_simTimeJ2000;
|
||||
};
|
||||
|
||||
} // namespace openspace::scripting
|
||||
|
||||
@@ -103,6 +103,7 @@ public:
|
||||
|
||||
void removeTimeChangeCallback(CallbackHandle handle);
|
||||
void removeDeltaTimeChangeCallback(CallbackHandle handle);
|
||||
void triggerPlaybackStart();
|
||||
void removeTimeJumpCallback(CallbackHandle handle);
|
||||
void removeTimelineChangeCallback(CallbackHandle handle);
|
||||
|
||||
@@ -134,9 +135,11 @@ private:
|
||||
|
||||
double _latestConsumedTimestamp = -std::numeric_limits<double>::max();
|
||||
int _nextCallbackHandle = 0;
|
||||
bool _playbackModeEnabled = false;
|
||||
|
||||
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _timeChangeCallbacks;
|
||||
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _deltaTimeChangeCallbacks;
|
||||
|
||||
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _timeJumpCallbacks;
|
||||
std::vector<std::pair<CallbackHandle, TimeChangeCallback>> _timelineChangeCallbacks;
|
||||
};
|
||||
|
||||
@@ -120,7 +120,7 @@ if (WIN32)
|
||||
openspace-module-globebrowsing
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal_i.lib
|
||||
)
|
||||
register_external_libraries("${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal202.dll")
|
||||
register_external_libraries("${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal203.dll")
|
||||
else (WIN32)
|
||||
find_package(GDAL REQUIRED)
|
||||
|
||||
|
||||
123
modules/globebrowsing/ext/gdal/include/cpl_alibaba_oss.h
Normal file
123
modules/globebrowsing/ext/gdal/include/cpl_alibaba_oss.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_alibaba_oss.h e648607661fdd5cbc6bb778c17c20c3e7979a734 2018-04-04 19:27:08 +0200 Even Rouault $
|
||||
*
|
||||
* Name: cpl_alibaba_oss.h
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Alibaba Cloud Object Storage Service
|
||||
* Author: Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2017, Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CPL_ALIBABA_OSS_INCLUDED_H
|
||||
#define CPL_ALIBABA_OSS_INCLUDED_H
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "cpl_string.h"
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <map>
|
||||
#include "cpl_aws.h"
|
||||
|
||||
class VSIOSSHandleHelper final: public IVSIS3LikeHandleHelper
|
||||
{
|
||||
CPLString m_osURL;
|
||||
CPLString m_osSecretAccessKey;
|
||||
CPLString m_osAccessKeyId;
|
||||
CPLString m_osEndpoint;
|
||||
CPLString m_osBucket;
|
||||
CPLString m_osObjectKey;
|
||||
bool m_bUseHTTPS;
|
||||
bool m_bUseVirtualHosting;
|
||||
|
||||
void RebuildURL() override;
|
||||
|
||||
static bool GetConfiguration(CSLConstList papszOptions,
|
||||
CPLString& osSecretAccessKey,
|
||||
CPLString& osAccessKeyId);
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
VSIOSSHandleHelper(const CPLString& osSecretAccessKey,
|
||||
const CPLString& osAccessKeyId,
|
||||
const CPLString& osEndpoint,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey,
|
||||
bool bUseHTTPS, bool bUseVirtualHosting);
|
||||
~VSIOSSHandleHelper();
|
||||
|
||||
static VSIOSSHandleHelper* BuildFromURI(const char* pszURI,
|
||||
const char* pszFSPrefix,
|
||||
bool bAllowNoObject,
|
||||
CSLConstList papszOptions = nullptr);
|
||||
static CPLString BuildURL(const CPLString& osEndpoint,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey,
|
||||
bool bUseHTTPS, bool bUseVirtualHosting);
|
||||
|
||||
struct curl_slist* GetCurlHeaders(
|
||||
const CPLString& osVerb,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const void *pabyDataContent = nullptr,
|
||||
size_t nBytesContent = 0 ) const override;
|
||||
|
||||
bool CanRestartOnError(const char*, const char* pszHeaders,
|
||||
bool bSetError,
|
||||
bool* pbUpdateMap = nullptr) override;
|
||||
|
||||
const CPLString& GetURL() const override { return m_osURL; }
|
||||
const CPLString& GetBucket() const { return m_osBucket; }
|
||||
const CPLString& GetObjectKey() const { return m_osObjectKey; }
|
||||
const CPLString& GetEndpoint()const { return m_osEndpoint; }
|
||||
bool GetVirtualHosting() const { return m_bUseVirtualHosting; }
|
||||
void SetEndpoint(const CPLString &osStr);
|
||||
void SetVirtualHosting(bool b);
|
||||
|
||||
CPLString GetSignedURL(CSLConstList papszOptions);
|
||||
};
|
||||
|
||||
class VSIOSSUpdateParams
|
||||
{
|
||||
public:
|
||||
CPLString m_osEndpoint;
|
||||
|
||||
VSIOSSUpdateParams() {}
|
||||
|
||||
explicit VSIOSSUpdateParams(const VSIOSSHandleHelper* poHelper) :
|
||||
m_osEndpoint(poHelper->GetEndpoint()) {}
|
||||
|
||||
void UpdateHandlerHelper(VSIOSSHandleHelper* poHelper) {
|
||||
poHelper->SetEndpoint(m_osEndpoint);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* HAVE_CURL */
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_ALIBABA_OSS_INCLUDED_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_atomic_ops.h 35921 2016-10-25 02:28:29Z goatbar $
|
||||
* $Id: cpl_atomic_ops.h 44e0c0ecc2e12f7885d8572d0f18dd94e7fbda1c 2016-10-25 02:28:29Z Kurt Schwehr $
|
||||
*
|
||||
* Name: cpl_atomic_ops.h
|
||||
* Project: CPL - Common Portability Library
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_aws.h 37174 2017-01-18 20:00:36Z rouault $
|
||||
* $Id: cpl_aws.h 1d0f559204e90d0e54d4aebe6ea8b65f0851be69 2018-06-20 16:38:42 +0200 Even Rouault $
|
||||
*
|
||||
* Name: cpl_aws.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -33,22 +33,14 @@
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "cpl_string.h"
|
||||
|
||||
CPLString CPLGetAWS_SIGN4_Authorization(const CPLString& osSecretAccessKey,
|
||||
const CPLString& osAccessKeyId,
|
||||
const CPLString& osAccessToken,
|
||||
const CPLString& osAWSRegion,
|
||||
const CPLString& osRequestPayer,
|
||||
const CPLString& osService,
|
||||
const CPLString& osVerb,
|
||||
const CPLString& osHost,
|
||||
const CPLString& osCanonicalURI,
|
||||
const CPLString& osCanonicalQueryString,
|
||||
const CPLString& osXAMZContentSHA256,
|
||||
const CPLString& osTimestamp);
|
||||
#include <curl/curl.h>
|
||||
#include <map>
|
||||
|
||||
CPLString CPLGetLowerCaseHexSHA256( const void *pabyData, size_t nBytes );
|
||||
CPLString CPLGetLowerCaseHexSHA256( const CPLString& osStr );
|
||||
@@ -57,90 +49,185 @@ CPLString CPLGetAWS_SIGN4_Timestamp();
|
||||
|
||||
CPLString CPLAWSURLEncode(const CPLString& osURL, bool bEncodeSlash = true);
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
CPLString CPLAWSGetHeaderVal(const struct curl_slist* psExistingHeaders,
|
||||
const char* pszKey);
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <map>
|
||||
CPLString
|
||||
CPLGetAWS_SIGN4_Signature( const CPLString& osSecretAccessKey,
|
||||
const CPLString& osAccessToken,
|
||||
const CPLString& osRegion,
|
||||
const CPLString& osRequestPayer,
|
||||
const CPLString& osService,
|
||||
const CPLString& osVerb,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const CPLString& osHost,
|
||||
const CPLString& osCanonicalURI,
|
||||
const CPLString& osCanonicalQueryString,
|
||||
const CPLString& osXAMZContentSHA256,
|
||||
const CPLString& osTimestamp,
|
||||
CPLString& osSignedHeaders );
|
||||
|
||||
class VSIS3HandleHelper
|
||||
CPLString CPLGetAWS_SIGN4_Authorization(const CPLString& osSecretAccessKey,
|
||||
const CPLString& osAccessKeyId,
|
||||
const CPLString& osAccessToken,
|
||||
const CPLString& osRegion,
|
||||
const CPLString& osRequestPayer,
|
||||
const CPLString& osService,
|
||||
const CPLString& osVerb,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const CPLString& osHost,
|
||||
const CPLString& osCanonicalURI,
|
||||
const CPLString& osCanonicalQueryString,
|
||||
const CPLString& osXAMZContentSHA256,
|
||||
const CPLString& osTimestamp);
|
||||
|
||||
class IVSIS3LikeHandleHelper
|
||||
{
|
||||
protected:
|
||||
std::map<CPLString, CPLString> m_oMapQueryParameters;
|
||||
|
||||
virtual void RebuildURL() = 0;
|
||||
CPLString GetQueryString(bool bAddEmptyValueAfterEqual) const;
|
||||
|
||||
public:
|
||||
IVSIS3LikeHandleHelper() {}
|
||||
virtual ~IVSIS3LikeHandleHelper() {}
|
||||
|
||||
void ResetQueryParameters();
|
||||
void AddQueryParameter(const CPLString& osKey, const CPLString& osValue);
|
||||
|
||||
virtual struct curl_slist* GetCurlHeaders(const CPLString& osVerb,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const void *pabyDataContent = nullptr,
|
||||
size_t nBytesContent = 0) const = 0;
|
||||
|
||||
virtual bool AllowAutomaticRedirection() { return true; }
|
||||
virtual bool CanRestartOnError(const char*, const char* /* pszHeaders*/,
|
||||
bool /*bSetError*/, bool* /*pbUpdateMap*/ = nullptr) { return false;}
|
||||
|
||||
virtual const CPLString& GetURL() const = 0;
|
||||
|
||||
static bool GetBucketAndObjectKey(const char* pszURI,
|
||||
const char* pszFSPrefix,
|
||||
bool bAllowNoObject,
|
||||
CPLString &osBucketOut,
|
||||
CPLString &osObjectKeyOut);
|
||||
|
||||
static CPLString BuildCanonicalizedHeaders(
|
||||
std::map<CPLString, CPLString>& oSortedMapHeaders,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const char* pszHeaderPrefix);
|
||||
|
||||
static CPLString GetRFC822DateTime();
|
||||
};
|
||||
|
||||
class VSIS3HandleHelper final: public IVSIS3LikeHandleHelper
|
||||
{
|
||||
CPLString m_osURL;
|
||||
CPLString m_osSecretAccessKey;
|
||||
CPLString m_osAccessKeyId;
|
||||
CPLString m_osSessionToken;
|
||||
CPLString m_osAWSS3Endpoint;
|
||||
CPLString m_osAWSRegion;
|
||||
CPLString m_osEndpoint;
|
||||
CPLString m_osRegion;
|
||||
CPLString m_osRequestPayer;
|
||||
CPLString m_osBucket;
|
||||
CPLString m_osObjectKey;
|
||||
bool m_bUseHTTPS;
|
||||
bool m_bUseVirtualHosting;
|
||||
std::map<CPLString, CPLString> m_oMapQueryParameters;
|
||||
|
||||
static bool GetBucketAndObjectKey(const char* pszURI, const char* pszFSPrefix,
|
||||
bool bAllowNoObject,
|
||||
CPLString &osBucketOut, CPLString &osObjectKeyOut);
|
||||
void RebuildURL();
|
||||
void RebuildURL() override;
|
||||
|
||||
static bool GetConfigurationFromEC2(CPLString& osSecretAccessKey,
|
||||
CPLString& osAccessKeyId,
|
||||
CPLString& osSessionToken);
|
||||
|
||||
static bool GetConfigurationFromAWSConfigFiles(
|
||||
CPLString& osSecretAccessKey,
|
||||
CPLString& osAccessKeyId,
|
||||
CPLString& osSessionToken,
|
||||
CPLString& osRegion,
|
||||
CPLString& osCredentials);
|
||||
|
||||
static bool GetConfiguration(CSLConstList papszOptions,
|
||||
CPLString& osSecretAccessKey,
|
||||
CPLString& osAccessKeyId,
|
||||
CPLString& osSessionToken,
|
||||
CPLString& osRegion);
|
||||
protected:
|
||||
|
||||
public:
|
||||
VSIS3HandleHelper(const CPLString& osSecretAccessKey,
|
||||
const CPLString& osAccessKeyId,
|
||||
const CPLString& osSessionToken,
|
||||
const CPLString& osAWSS3Endpoint,
|
||||
const CPLString& osAWSRegion,
|
||||
const CPLString& osEndpoint,
|
||||
const CPLString& osRegion,
|
||||
const CPLString& osRequestPayer,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey,
|
||||
bool bUseHTTPS, bool bUseVirtualHosting);
|
||||
~VSIS3HandleHelper();
|
||||
|
||||
static VSIS3HandleHelper* BuildFromURI(const char* pszURI, const char* pszFSPrefix,
|
||||
bool bAllowNoObject);
|
||||
static CPLString BuildURL(const CPLString& osAWSS3Endpoint,
|
||||
static VSIS3HandleHelper* BuildFromURI(const char* pszURI,
|
||||
const char* pszFSPrefix,
|
||||
bool bAllowNoObject,
|
||||
CSLConstList papszOptions = nullptr);
|
||||
static CPLString BuildURL(const CPLString& osEndpoint,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey,
|
||||
bool bUseHTTPS, bool bUseVirtualHosting);
|
||||
|
||||
void ResetQueryParameters();
|
||||
void AddQueryParameter(const CPLString& osKey, const CPLString& osValue);
|
||||
struct curl_slist* GetCurlHeaders(const CPLString& osVerb,
|
||||
const void *pabyDataContent = NULL,
|
||||
size_t nBytesContent = 0);
|
||||
bool CanRestartOnError(const char* pszErrorMsg) { return CanRestartOnError(pszErrorMsg, false); }
|
||||
bool CanRestartOnError(const char*, bool bSetError);
|
||||
struct curl_slist* GetCurlHeaders(
|
||||
const CPLString& osVerb,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const void *pabyDataContent = nullptr,
|
||||
size_t nBytesContent = 0) const override;
|
||||
|
||||
const CPLString& GetURL() const { return m_osURL; }
|
||||
bool AllowAutomaticRedirection() override { return false; }
|
||||
bool CanRestartOnError(const char*, const char* pszHeaders,
|
||||
bool bSetError,
|
||||
bool* pbUpdateMap = nullptr) override;
|
||||
|
||||
const CPLString& GetURL() const override { return m_osURL; }
|
||||
const CPLString& GetBucket() const { return m_osBucket; }
|
||||
const CPLString& GetObjectKey() const { return m_osObjectKey; }
|
||||
const CPLString& GetAWSS3Endpoint()const { return m_osAWSS3Endpoint; }
|
||||
const CPLString& GetAWSRegion() const { return m_osAWSRegion; }
|
||||
const CPLString& GetEndpoint()const { return m_osEndpoint; }
|
||||
const CPLString& GetRegion() const { return m_osRegion; }
|
||||
const CPLString& GetRequestPayer() const { return m_osRequestPayer; }
|
||||
bool GetVirtualHosting() const { return m_bUseVirtualHosting; }
|
||||
void SetAWSS3Endpoint(const CPLString &osStr);
|
||||
void SetAWSRegion(const CPLString &osStr);
|
||||
void SetEndpoint(const CPLString &osStr);
|
||||
void SetRegion(const CPLString &osStr);
|
||||
void SetRequestPayer(const CPLString &osStr);
|
||||
void SetVirtualHosting(bool b);
|
||||
void SetObjectKey(const CPLString &osStr);
|
||||
|
||||
CPLString GetSignedURL(CSLConstList papszOptions);
|
||||
|
||||
static void CleanMutex();
|
||||
static void ClearCache();
|
||||
};
|
||||
|
||||
class VSIS3UpdateParams
|
||||
{
|
||||
public:
|
||||
CPLString m_osAWSRegion;
|
||||
CPLString m_osAWSS3Endpoint;
|
||||
CPLString m_osRegion;
|
||||
CPLString m_osEndpoint;
|
||||
CPLString m_osRequestPayer;
|
||||
bool m_bUseVirtualHosting;
|
||||
|
||||
VSIS3UpdateParams(const CPLString& osAWSRegion = "",
|
||||
const CPLString& osAWSS3Endpoint = "",
|
||||
const CPLString& osRequestPayer = "",
|
||||
bool bUseVirtualHosting = false) :
|
||||
m_osAWSRegion(osAWSRegion),
|
||||
m_osAWSS3Endpoint(osAWSS3Endpoint),
|
||||
m_osRequestPayer(osRequestPayer),
|
||||
m_bUseVirtualHosting(bUseVirtualHosting) {}
|
||||
VSIS3UpdateParams() :
|
||||
m_bUseVirtualHosting(false) {}
|
||||
|
||||
explicit VSIS3UpdateParams(const VSIS3HandleHelper* poHelper) :
|
||||
m_osRegion(poHelper->GetRegion()),
|
||||
m_osEndpoint(poHelper->GetEndpoint()),
|
||||
m_osRequestPayer(poHelper->GetRequestPayer()),
|
||||
m_bUseVirtualHosting(poHelper->GetVirtualHosting()) {}
|
||||
|
||||
void UpdateHandlerHelper(VSIS3HandleHelper* poHelper) {
|
||||
poHelper->SetRegion(m_osRegion);
|
||||
poHelper->SetEndpoint(m_osEndpoint);
|
||||
poHelper->SetRequestPayer(m_osRequestPayer);
|
||||
poHelper->SetVirtualHosting(m_bUseVirtualHosting);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* HAVE_CURL */
|
||||
|
||||
92
modules/globebrowsing/ext/gdal/include/cpl_azure.h
Normal file
92
modules/globebrowsing/ext/gdal/include/cpl_azure.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/**********************************************************************
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Microsoft Azure Storage Blob routines
|
||||
* Author: Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2017, Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CPL_AZURE_INCLUDED_H
|
||||
#define CPL_AZURE_INCLUDED_H
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include "cpl_http.h"
|
||||
#include "cpl_aws.h"
|
||||
#include <map>
|
||||
|
||||
class VSIAzureBlobHandleHelper final: public IVSIS3LikeHandleHelper
|
||||
{
|
||||
CPLString m_osURL;
|
||||
CPLString m_osEndpoint;
|
||||
CPLString m_osBucket;
|
||||
CPLString m_osObjectKey;
|
||||
CPLString m_osStorageAccount;
|
||||
CPLString m_osStorageKey;
|
||||
bool m_bUseHTTPS;
|
||||
|
||||
static bool GetConfiguration(CSLConstList papszOptions,
|
||||
bool& bUseHTTPS,
|
||||
CPLString& osEndpoint,
|
||||
CPLString& osStorageAccount,
|
||||
CPLString& osStorageKey);
|
||||
|
||||
static CPLString BuildURL(const CPLString& osEndpoint,
|
||||
const CPLString& osStorageAccount,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey,
|
||||
bool bUseHTTPS);
|
||||
|
||||
void RebuildURL() override;
|
||||
|
||||
public:
|
||||
VSIAzureBlobHandleHelper(const CPLString& osEndpoint,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey,
|
||||
const CPLString& osStorageAccount,
|
||||
const CPLString& osStorageKey,
|
||||
bool bUseHTTPS);
|
||||
~VSIAzureBlobHandleHelper();
|
||||
|
||||
static VSIAzureBlobHandleHelper* BuildFromURI(const char* pszURI,
|
||||
const char* pszFSPrefix,
|
||||
CSLConstList papszOptions = nullptr);
|
||||
|
||||
struct curl_slist* GetCurlHeaders(const CPLString& osVerbosVerb,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const void *pabyDataContent = nullptr,
|
||||
size_t nBytesContent = 0) const override;
|
||||
|
||||
const CPLString& GetURL() const override { return m_osURL; }
|
||||
|
||||
CPLString GetSignedURL(CSLConstList papszOptions);
|
||||
};
|
||||
|
||||
|
||||
#endif /* HAVE_CURL */
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_AZURE_INCLUDED_H */
|
||||
@@ -1,3 +1,5 @@
|
||||
#ifndef CPL_CONFIG_H
|
||||
#define CPL_CONFIG_H
|
||||
|
||||
/* We define this here in general so that a VC++ build will publicly
|
||||
declare STDCALL interfaces even if an application is built against it
|
||||
@@ -11,14 +13,14 @@
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1500)
|
||||
# define vsnprintf _vsnprintf
|
||||
#ifndef HAVE_VPRINTF
|
||||
#define HAVE_VPRINTF 1
|
||||
#endif
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1900)
|
||||
# define snprintf _snprintf
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#endif
|
||||
#ifndef HAVE_SNPRINTF
|
||||
#define HAVE_SNPRINTF 1
|
||||
#endif
|
||||
|
||||
#define HAVE_GETCWD 1
|
||||
@@ -59,7 +61,9 @@
|
||||
#define HAVE_SEARCH_H 1
|
||||
|
||||
/* Define to 1 if you have the <direct.h> header file. */
|
||||
#define HAVE_DIRECT_H
|
||||
#ifndef HAVE_DIRECT_H
|
||||
#define HAVE_DIRECT_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#undef HAVE_LOCALTIME_R
|
||||
@@ -102,20 +106,14 @@
|
||||
|
||||
#define lfind _lfind
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1310)
|
||||
# define VSI_STAT64 _stat
|
||||
# define VSI_STAT64_T _stat
|
||||
#else
|
||||
# define VSI_STAT64 _stat64
|
||||
# define VSI_STAT64_T __stat64
|
||||
#endif
|
||||
|
||||
/* VC6 doesn't known intptr_t */
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= 1200)
|
||||
typedef int intptr_t;
|
||||
#endif
|
||||
#define VSI_STAT64 _stat64
|
||||
#define VSI_STAT64_T __stat64
|
||||
|
||||
#pragma warning(disable: 4786)
|
||||
|
||||
/* #define CPL_DISABLE_DLL */
|
||||
|
||||
/* Define to 1, if your compiler supports long long data type */
|
||||
#define HAVE_LONG_LONG 1
|
||||
|
||||
#endif /* CPL_CONFIG_H */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: cpl_config_extras.h 37003 2016-12-23 14:54:07Z goatbar $ */
|
||||
/* $Id: cpl_config_extras.h 55f4cce7557b301901f754e28cd6193f2f02b522 2016-12-23 14:54:07Z Kurt Schwehr $ */
|
||||
|
||||
#ifndef INCLUDED_CPL_CONFIG_EXTRAS
|
||||
#define INCLUDED_CPL_CONFIG_EXTRAS
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_conv.h 37866 2017-03-30 20:16:05Z rouault $
|
||||
* $Id: cpl_conv.h dfac92801bd83819cbae2501803e02e06b361a43 2018-04-23 18:07:32 +0200 Martin Landa $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Convenience functions declarations.
|
||||
@@ -86,13 +86,8 @@ char CPL_DLL *CPLStrlwr( char *);
|
||||
char CPL_DLL *CPLFGets( char *, int, FILE *);
|
||||
const char CPL_DLL *CPLReadLine( FILE * );
|
||||
const char CPL_DLL *CPLReadLineL( VSILFILE * );
|
||||
#ifdef __cplusplus
|
||||
const char CPL_DLL *CPLReadLine2L( VSILFILE * , int nMaxCols,
|
||||
const char * const * papszOptions );
|
||||
#else
|
||||
const char CPL_DLL *CPLReadLine2L( VSILFILE * , int nMaxCols,
|
||||
char** papszOptions );
|
||||
#endif
|
||||
const char CPL_DLL *CPLReadLine2L( VSILFILE *, int, CSLConstList );
|
||||
const char CPL_DLL *CPLReadLine3L( VSILFILE *, int, int *, CSLConstList );
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Convert ASCII string to floating point number */
|
||||
@@ -174,6 +169,7 @@ int CPL_DLL CPLCheckForFile( char *pszFilename, char **papszSiblingList );
|
||||
|
||||
const char CPL_DLL *CPLGenerateTempFilename( const char *pszStem ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
|
||||
const char CPL_DLL *CPLExpandTilde( const char *pszFilename ) CPL_WARN_UNUSED_RESULT CPL_RETURNS_NONNULL;
|
||||
const char CPL_DLL *CPLGetHomeDir(void) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Find File Function */
|
||||
@@ -238,7 +234,7 @@ int CPL_DLL CPLUnlinkTree( const char * );
|
||||
int CPL_DLL CPLCopyFile( const char *pszNewPath, const char *pszOldPath );
|
||||
int CPL_DLL CPLCopyTree( const char *pszNewPath, const char *pszOldPath );
|
||||
int CPL_DLL CPLMoveFile( const char *pszNewPath, const char *pszOldPath );
|
||||
int CPL_DLL CPLSymlink( const char* pszOldPath, const char* pszNewPath, char** papszOptions );
|
||||
int CPL_DLL CPLSymlink( const char* pszOldPath, const char* pszNewPath, CSLConstList papszOptions );
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* ZIP Creation. */
|
||||
@@ -270,7 +266,7 @@ void CPL_DLL *CPLZLibInflate( const void* ptr, size_t nBytes,
|
||||
/* -------------------------------------------------------------------- */
|
||||
int CPL_DLL CPLValidateXML(const char* pszXMLFilename,
|
||||
const char* pszXSDFilename,
|
||||
char** papszOptions);
|
||||
CSLConstList papszOptions);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Locale handling. Prevents parallel executions of setlocale(). */
|
||||
@@ -280,6 +276,13 @@ char* CPLsetlocale (int category, const char* locale);
|
||||
void CPLCleanupSetlocaleMutex(void);
|
||||
/*! @endcond */
|
||||
|
||||
/*!
|
||||
CPLIsPowerOfTwo()
|
||||
@param i - tested number
|
||||
@return TRUE if i is power of two otherwise return FALSE
|
||||
*/
|
||||
int CPL_DLL CPLIsPowerOfTwo( unsigned int i );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -289,47 +292,109 @@ CPL_C_END
|
||||
//! @cond Doxygen_Suppress
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
class CPL_DLL CPLLocaleC
|
||||
{
|
||||
public:
|
||||
CPLLocaleC();
|
||||
~CPLLocaleC();
|
||||
|
||||
/* Make it non-copyable */
|
||||
CPLLocaleC(const CPLLocaleC&) = delete;
|
||||
CPLLocaleC& operator=(const CPLLocaleC&) = delete;
|
||||
|
||||
private:
|
||||
char *pszOldLocale;
|
||||
|
||||
/* Make it non-copyable */
|
||||
CPLLocaleC(const CPLLocaleC&);
|
||||
CPLLocaleC& operator=(const CPLLocaleC&);
|
||||
};
|
||||
|
||||
// Does the same as CPLLocaleC except that, when available, it tries to
|
||||
// only affect the current thread. But code that would be dependent of
|
||||
// setlocale(LC_NUMERIC, NULL) returning "C", such as current proj.4 versions,
|
||||
// will not work depending on the actual implementation
|
||||
class CPLThreadLocaleCPrivate;
|
||||
class CPL_DLL CPLThreadLocaleC
|
||||
{
|
||||
public:
|
||||
CPLThreadLocaleC();
|
||||
~CPLThreadLocaleC();
|
||||
|
||||
private:
|
||||
#ifdef HAVE_USELOCALE
|
||||
locale_t nNewLocale;
|
||||
locale_t nOldLocale;
|
||||
#else
|
||||
#if defined(_MSC_VER)
|
||||
int nOldValConfigThreadLocale;
|
||||
#endif
|
||||
char *pszOldLocale;
|
||||
#endif
|
||||
|
||||
/* Make it non-copyable */
|
||||
CPLThreadLocaleC(const CPLThreadLocaleC&);
|
||||
CPLThreadLocaleC& operator=(const CPLThreadLocaleC&);
|
||||
CPLThreadLocaleC(const CPLThreadLocaleC&) = delete;
|
||||
CPLThreadLocaleC& operator=(const CPLThreadLocaleC&) = delete;
|
||||
|
||||
private:
|
||||
CPLThreadLocaleCPrivate* m_private;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* def __cplusplus */
|
||||
//! @endcond
|
||||
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* C++ object for temporarily forcing a config option */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
class CPL_DLL CPLConfigOptionSetter
|
||||
{
|
||||
public:
|
||||
CPLConfigOptionSetter(const char* pszKey, const char* pszValue,
|
||||
bool bSetOnlyIfUndefined);
|
||||
~CPLConfigOptionSetter();
|
||||
|
||||
/* Make it non-copyable */
|
||||
CPLConfigOptionSetter(const CPLConfigOptionSetter&) = delete;
|
||||
CPLConfigOptionSetter& operator=(const CPLConfigOptionSetter&) = delete;
|
||||
|
||||
private:
|
||||
char* m_pszKey;
|
||||
char *m_pszOldValue;
|
||||
bool m_bRestoreOldValue;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* def __cplusplus */
|
||||
//! @endcond
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#include <type_traits> // for std::is_base_of
|
||||
#endif
|
||||
|
||||
namespace cpl
|
||||
{
|
||||
/** Use cpl::down_cast<Derived*>(pointer_to_base) as equivalent of
|
||||
* static_cast<Derived*>(pointer_to_base) with safe checking in debug
|
||||
* mode.
|
||||
*
|
||||
* Only works if no virtual inheritance is involved.
|
||||
*
|
||||
* @param f pointer to a base class
|
||||
* @return pointer to a derived class
|
||||
*/
|
||||
template<typename To, typename From> inline To down_cast(From* f)
|
||||
{
|
||||
static_assert(
|
||||
(std::is_base_of<From,
|
||||
typename std::remove_pointer<To>::type>::value),
|
||||
"target type not derived from source type");
|
||||
CPLAssert(f == nullptr || dynamic_cast<To>(f) != nullptr);
|
||||
return static_cast<To>(f);
|
||||
}
|
||||
}
|
||||
} // extern "C++"
|
||||
|
||||
#endif /* def __cplusplus */
|
||||
|
||||
#endif /* ndef CPL_CONV_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_csv.h 36376 2016-11-21 06:54:04Z goatbar $
|
||||
* $Id: cpl_csv.h 99aa5b9717f6d18543ca4487ebd4ccd34cb2b29e 2016-11-21 06:54:04Z Kurt Schwehr $
|
||||
*
|
||||
* Project: Common Portability Library
|
||||
* Purpose: Functions for reading and scanning CSV (comma separated,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_error.h 36675 2016-12-04 11:10:10Z rouault $
|
||||
* $Id: cpl_error.h f5361e0be8e2ae819dde996e6c6aa5985b8fefec 2018-04-02 15:11:21 +0200 Even Rouault $
|
||||
*
|
||||
* Name: cpl_error.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -81,7 +81,6 @@ typedef enum
|
||||
CPLE_UserInterrupt,
|
||||
CPLE_ObjectNull,
|
||||
CPLE_HttpResponse,
|
||||
CPLE_HttpResponse,
|
||||
CPLE_AWSBucketNotFound,
|
||||
CPLE_AWSObjectNotFound,
|
||||
CPLE_AWSAccessDenied,
|
||||
@@ -144,6 +143,7 @@ void CPL_DLL CPL_STDCALL CPLErrorReset( void );
|
||||
CPLErrorNum CPL_DLL CPL_STDCALL CPLGetLastErrorNo( void );
|
||||
CPLErr CPL_DLL CPL_STDCALL CPLGetLastErrorType( void );
|
||||
const char CPL_DLL * CPL_STDCALL CPLGetLastErrorMsg( void );
|
||||
GUInt32 CPL_DLL CPL_STDCALL CPLGetErrorCounter( void );
|
||||
void CPL_DLL * CPL_STDCALL CPLGetErrorHandlerUserData(void);
|
||||
void CPL_DLL CPLErrorSetState( CPLErr eErrClass, CPLErrorNum err_no, const char* pszMsg );
|
||||
/*! @cond Doxygen_Suppress */
|
||||
@@ -193,11 +193,63 @@ CPL_C_END
|
||||
#else
|
||||
# define VALIDATE_POINTER_ERR CE_Failure
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) && !defined(DOXYGEN_SKIP)
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
|
||||
#include <string>
|
||||
|
||||
class CPLErrorHandlerPusher
|
||||
{
|
||||
public:
|
||||
explicit CPLErrorHandlerPusher(CPLErrorHandler hHandler)
|
||||
{
|
||||
CPLPushErrorHandler(hHandler);
|
||||
}
|
||||
|
||||
CPLErrorHandlerPusher(CPLErrorHandler hHandler, void* user_data)
|
||||
{
|
||||
CPLPushErrorHandlerEx(hHandler, user_data);
|
||||
}
|
||||
|
||||
~CPLErrorHandlerPusher()
|
||||
{
|
||||
CPLPopErrorHandler();
|
||||
}
|
||||
};
|
||||
|
||||
class CPLErrorStateBackuper
|
||||
{
|
||||
CPLErrorNum m_nLastErrorNum;
|
||||
CPLErr m_nLastErrorType;
|
||||
std::string m_osLastErrorMsg;
|
||||
|
||||
public:
|
||||
CPLErrorStateBackuper() :
|
||||
m_nLastErrorNum(CPLGetLastErrorNo()),
|
||||
m_nLastErrorType(CPLGetLastErrorType()),
|
||||
m_osLastErrorMsg(CPLGetLastErrorMsg())
|
||||
{}
|
||||
|
||||
~CPLErrorStateBackuper()
|
||||
{
|
||||
CPLErrorSetState(m_nLastErrorType, m_nLastErrorNum,
|
||||
m_osLastErrorMsg.c_str());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*! @endcond */
|
||||
|
||||
/** Validate that a pointer is not NULL */
|
||||
#define VALIDATE_POINTER0(ptr, func) \
|
||||
do { if( NULL == ptr ) \
|
||||
do { if( CPL_NULLPTR == ptr ) \
|
||||
{ \
|
||||
CPLErr const ret = VALIDATE_POINTER_ERR; \
|
||||
CPLError( ret, CPLE_ObjectNull, \
|
||||
@@ -206,7 +258,7 @@ CPL_C_END
|
||||
|
||||
/** Validate that a pointer is not NULL, and return rc if it is NULL */
|
||||
#define VALIDATE_POINTER1(ptr, func, rc) \
|
||||
do { if( NULL == ptr ) \
|
||||
do { if( CPL_NULLPTR == ptr ) \
|
||||
{ \
|
||||
CPLErr const ret = VALIDATE_POINTER_ERR; \
|
||||
CPLError( ret, CPLE_ObjectNull, \
|
||||
|
||||
@@ -37,8 +37,11 @@
|
||||
#ifdef HAVE_CURL
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include "cpl_http.h"
|
||||
#include "cpl_aws.h"
|
||||
#include <map>
|
||||
|
||||
class VSIGSHandleHelper
|
||||
class VSIGSHandleHelper final: public IVSIS3LikeHandleHelper
|
||||
{
|
||||
CPLString m_osURL;
|
||||
CPLString m_osEndpoint;
|
||||
@@ -46,21 +49,49 @@ class VSIGSHandleHelper
|
||||
CPLString m_osSecretAccessKey;
|
||||
CPLString m_osAccessKeyId;
|
||||
bool m_bUseHeaderFile;
|
||||
GOA2Manager m_oManager;
|
||||
|
||||
static bool GetConfiguration(CSLConstList papszOptions,
|
||||
CPLString& osSecretAccessKey,
|
||||
CPLString& osAccessKeyId,
|
||||
CPLString& osHeaderFile,
|
||||
GOA2Manager& oManager);
|
||||
|
||||
static bool GetConfigurationFromConfigFile(
|
||||
CPLString& osSecretAccessKey,
|
||||
CPLString& osAccessKeyId,
|
||||
CPLString& osOAuth2RefreshToken,
|
||||
CPLString& osOAuth2ClientId,
|
||||
CPLString& osOAuth2ClientSecret,
|
||||
CPLString& osCredentials);
|
||||
|
||||
void RebuildURL() override;
|
||||
|
||||
public:
|
||||
VSIGSHandleHelper(const CPLString& osEndpoint,
|
||||
const CPLString& osBucketObjectKey,
|
||||
const CPLString& osSecretAccessKey,
|
||||
const CPLString& osAccessKeyId,
|
||||
bool bUseHeaderFile);
|
||||
bool bUseHeaderFile,
|
||||
const GOA2Manager& oManager);
|
||||
~VSIGSHandleHelper();
|
||||
|
||||
static VSIGSHandleHelper* BuildFromURI(const char* pszURI,
|
||||
const char* pszFSPrefix);
|
||||
const char* pszFSPrefix,
|
||||
CSLConstList papszOptions = nullptr);
|
||||
|
||||
struct curl_slist* GetCurlHeaders(const CPLString& osVerb) const;
|
||||
struct curl_slist* GetCurlHeaders(
|
||||
const CPLString& osVerbosVerb,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const void *pabyDataContent = nullptr,
|
||||
size_t nBytesContent = 0) const override;
|
||||
|
||||
const CPLString& GetURL() const { return m_osURL; }
|
||||
const CPLString& GetURL() const override { return m_osURL; }
|
||||
|
||||
CPLString GetSignedURL(CSLConstList papszOptions);
|
||||
|
||||
static void CleanMutex();
|
||||
static void ClearCache();
|
||||
};
|
||||
|
||||
#endif /* HAVE_CURL */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_hash_set.h 34931 2016-08-05 17:13:05Z rouault $
|
||||
* $Id: cpl_hash_set.h fcf615cbf6b2e03db17171af0ebba6da4b4a562d 2016-08-05 17:13:05Z Even Rouault $
|
||||
*
|
||||
* Name: cpl_hash_set.h
|
||||
* Project: CPL - Common Portability Library
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_http.h 37645 2017-03-08 00:15:33Z rouault $
|
||||
* $Id: cpl_http.h 07238f4cbcdc1a56c9db7e8dc3a5727346194074 2018-04-02 14:34:13 +0200 Even Rouault $
|
||||
*
|
||||
* Project: Common Portability Library
|
||||
* Purpose: Function wrapper for libcurl HTTP access.
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "cpl_conv.h"
|
||||
#include "cpl_string.h"
|
||||
#include "cpl_progress.h"
|
||||
#include "cpl_vsi.h"
|
||||
|
||||
/**
|
||||
@@ -41,6 +42,11 @@
|
||||
* Interface for downloading HTTP, FTP documents
|
||||
*/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define CPL_HTTP_MAX_RETRY 0
|
||||
#define CPL_HTTP_RETRY_DELAY 30.0
|
||||
/*! @endcond */
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/*! Describe a part of a multipart message */
|
||||
@@ -81,10 +87,25 @@ typedef struct {
|
||||
|
||||
} CPLHTTPResult;
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
typedef size_t (*CPLHTTPFetchWriteFunc)(void *pBuffer, size_t nSize, size_t nMemb, void *pWriteArg);
|
||||
/*! @endcond */
|
||||
|
||||
int CPL_DLL CPLHTTPEnabled( void );
|
||||
CPLHTTPResult CPL_DLL *CPLHTTPFetch( const char *pszURL, char **papszOptions);
|
||||
CPLHTTPResult CPL_DLL *CPLHTTPFetch( const char *pszURL, CSLConstList papszOptions);
|
||||
CPLHTTPResult CPL_DLL *CPLHTTPFetchEx( const char *pszURL,CSLConstList papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg,
|
||||
CPLHTTPFetchWriteFunc pfnWrite,
|
||||
void *pWriteArg);
|
||||
CPLHTTPResult CPL_DLL **CPLHTTPMultiFetch( const char * const * papszURL,
|
||||
int nURLCount,
|
||||
int nMaxSimultaneous,
|
||||
CSLConstList papszOptions);
|
||||
|
||||
void CPL_DLL CPLHTTPCleanup( void );
|
||||
void CPL_DLL CPLHTTPDestroyResult( CPLHTTPResult *psResult );
|
||||
void CPL_DLL CPLHTTPDestroyMultiResult( CPLHTTPResult **papsResults, int nCount );
|
||||
int CPL_DLL CPLHTTPParseMultipartMime( CPLHTTPResult *psResult );
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -101,14 +122,96 @@ char CPL_DLL *GOA2GetRefreshToken( const char *pszAuthToken,
|
||||
char CPL_DLL *GOA2GetAccessToken( const char *pszRefreshToken,
|
||||
const char *pszScope );
|
||||
|
||||
char CPL_DLL **GOA2GetAccessTokenFromServiceAccount(
|
||||
const char* pszPrivateKey,
|
||||
const char* pszClientEmail,
|
||||
const char* pszScope,
|
||||
CSLConstList papszAdditionalClaims,
|
||||
CSLConstList papszOptions);
|
||||
|
||||
char CPL_DLL **GOA2GetAccessTokenFromCloudEngineVM( CSLConstList papszOptions );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
/*! @cond Doxygen_Suppress */
|
||||
// Not sure if this belong here, used in cpl_http.cpp, cpl_vsil_curl.cpp and frmts/wms/gdalhttp.cpp
|
||||
void* CPLHTTPSetOptions(void *pcurl, const char * const* papszOptions);
|
||||
char** CPLHTTPGetOptionsFromEnv();
|
||||
double CPLHTTPGetNewRetryDelay(int response_code, double dfOldDelay);
|
||||
void* CPLHTTPIgnoreSigPipe();
|
||||
void CPLHTTPRestoreSigPipeHandler(void* old_handler);
|
||||
bool CPLMultiPerformWait(void* hCurlMultiHandle, int& repeats);
|
||||
/*! @endcond */
|
||||
|
||||
bool CPLIsMachinePotentiallyGCEInstance();
|
||||
bool CPLIsMachineForSureGCEInstance();
|
||||
|
||||
/** Manager of Google OAuth2 authentication.
|
||||
*
|
||||
* This class handles different authentication methods and handles renewal
|
||||
* of access token.
|
||||
*
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
class GOA2Manager
|
||||
{
|
||||
public:
|
||||
|
||||
GOA2Manager();
|
||||
|
||||
/** Authentication method */
|
||||
typedef enum
|
||||
{
|
||||
NONE,
|
||||
GCE,
|
||||
ACCESS_TOKEN_FROM_REFRESH,
|
||||
SERVICE_ACCOUNT
|
||||
} AuthMethod;
|
||||
|
||||
bool SetAuthFromGCE( CSLConstList papszOptions );
|
||||
bool SetAuthFromRefreshToken( const char* pszRefreshToken,
|
||||
const char* pszClientId,
|
||||
const char* pszClientSecret,
|
||||
CSLConstList papszOptions );
|
||||
bool SetAuthFromServiceAccount(const char* pszPrivateKey,
|
||||
const char* pszClientEmail,
|
||||
const char* pszScope,
|
||||
CSLConstList papszAdditionalClaims,
|
||||
CSLConstList papszOptions );
|
||||
|
||||
/** Returns the authentication method. */
|
||||
AuthMethod GetAuthMethod() const { return m_eMethod; }
|
||||
|
||||
const char* GetBearer() const;
|
||||
|
||||
/** Returns private key for SERVICE_ACCOUNT method */
|
||||
const CPLString& GetPrivateKey() const { return m_osPrivateKey; }
|
||||
|
||||
/** Returns client email for SERVICE_ACCOUNT method */
|
||||
const CPLString& GetClientEmail() const { return m_osClientEmail; }
|
||||
|
||||
private:
|
||||
|
||||
mutable CPLString m_osCurrentBearer;
|
||||
mutable time_t m_nExpirationTime;
|
||||
AuthMethod m_eMethod;
|
||||
|
||||
// for ACCESS_TOKEN_FROM_REFRESH
|
||||
CPLString m_osClientId;
|
||||
CPLString m_osClientSecret;
|
||||
CPLString m_osRefreshToken;
|
||||
|
||||
// for SERVICE_ACCOUNT
|
||||
CPLString m_osPrivateKey;
|
||||
CPLString m_osClientEmail;
|
||||
CPLString m_osScope;
|
||||
CPLStringList m_aosAdditionalClaims;
|
||||
|
||||
CPLStringList m_aosOptions;
|
||||
};
|
||||
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif /* ndef CPL_HTTP_H_INCLUDED */
|
||||
|
||||
218
modules/globebrowsing/ext/gdal/include/cpl_json.h
Normal file
218
modules/globebrowsing/ext/gdal/include/cpl_json.h
Normal file
@@ -0,0 +1,218 @@
|
||||
/******************************************************************************
|
||||
* Project: Common Portability Library
|
||||
* Purpose: Function wrapper for libjson-c access.
|
||||
* Author: Dmitry Baryshnikov, dmitry.baryshnikov@nextgis.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2017-2018 NextGIS, <info@nextgis.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CPL_JSON_H_INCLUDED
|
||||
#define CPL_JSON_H_INCLUDED
|
||||
|
||||
#include "cpl_progress.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
* \file cpl_json.h
|
||||
*
|
||||
* Interface for read and write JSON documents
|
||||
*/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
typedef void *JSONObjectH;
|
||||
|
||||
CPL_C_START
|
||||
|
||||
class CPLJSONArray;
|
||||
/*! @endcond */
|
||||
|
||||
/**
|
||||
* @brief The CPLJSONArray class holds JSON object from CPLJSONDocument
|
||||
*/
|
||||
class CPL_DLL CPLJSONObject
|
||||
{
|
||||
friend class CPLJSONArray;
|
||||
friend class CPLJSONDocument;
|
||||
public:
|
||||
/**
|
||||
* Json object types
|
||||
*/
|
||||
enum Type {
|
||||
Unknown,
|
||||
Null,
|
||||
Object,
|
||||
Array,
|
||||
Boolean,
|
||||
String,
|
||||
Integer,
|
||||
Long,
|
||||
Double
|
||||
};
|
||||
|
||||
/**
|
||||
* Json object format to string options
|
||||
*/
|
||||
enum PrettyFormat {
|
||||
Plain, ///< No extra whitespace or formatting applied
|
||||
Spaced, ///< Minimal whitespace inserted
|
||||
Pretty ///< Formatted output
|
||||
};
|
||||
|
||||
public:
|
||||
/*! @cond Doxygen_Suppress */
|
||||
CPLJSONObject();
|
||||
explicit CPLJSONObject(const std::string &osName, const CPLJSONObject &oParent);
|
||||
~CPLJSONObject();
|
||||
CPLJSONObject(const CPLJSONObject &other);
|
||||
CPLJSONObject &operator=(const CPLJSONObject &other);
|
||||
|
||||
private:
|
||||
explicit CPLJSONObject(const std::string &osName, JSONObjectH poJsonObject);
|
||||
/*! @endcond */
|
||||
|
||||
public:
|
||||
// setters
|
||||
void Add(const std::string &osName, const std::string &osValue);
|
||||
void Add(const std::string &osName, const char *pszValue);
|
||||
void Add(const std::string &osName, double dfValue);
|
||||
void Add(const std::string &osName, int nValue);
|
||||
void Add(const std::string &osName, GInt64 nValue);
|
||||
void Add(const std::string &osName, const CPLJSONArray &oValue);
|
||||
void Add(const std::string &osName, const CPLJSONObject &oValue);
|
||||
void Add(const std::string &osName, bool bValue);
|
||||
void AddNull(const std::string &osName);
|
||||
|
||||
void Set(const std::string &osName, const std::string &osValue);
|
||||
void Set(const std::string &osName, const char *pszValue);
|
||||
void Set(const std::string &osName, double dfValue);
|
||||
void Set(const std::string &osName, int nValue);
|
||||
void Set(const std::string &osName, GInt64 nValue);
|
||||
void Set(const std::string &osName, bool bValue);
|
||||
void SetNull(const std::string &osName);
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
JSONObjectH GetInternalHandle() const { return m_poJsonObject; }
|
||||
/*! @endcond */
|
||||
|
||||
// getters
|
||||
std::string GetString(const std::string &osName, const std::string &osDefault = "") const;
|
||||
double GetDouble(const std::string &osName, double dfDefault = 0.0) const;
|
||||
int GetInteger(const std::string &osName, int nDefault = 0) const;
|
||||
GInt64 GetLong(const std::string &osName, GInt64 nDefault = 0) const;
|
||||
bool GetBool(const std::string &osName, bool bDefault = false) const;
|
||||
std::string ToString(const std::string &osDefault = "") const;
|
||||
double ToDouble(double dfDefault = 0.0) const;
|
||||
int ToInteger(int nDefault = 0) const;
|
||||
GInt64 ToLong(GInt64 nDefault = 0) const;
|
||||
bool ToBool(bool bDefault = false) const;
|
||||
CPLJSONArray ToArray() const;
|
||||
std::string Format(enum PrettyFormat eFormat) const;
|
||||
|
||||
//
|
||||
void Delete(const std::string &osName);
|
||||
CPLJSONArray GetArray(const std::string &osName) const;
|
||||
CPLJSONObject GetObj(const std::string &osName) const;
|
||||
CPLJSONObject operator[](const std::string &osName) const;
|
||||
enum Type GetType() const;
|
||||
/*! @cond Doxygen_Suppress */
|
||||
std::string GetName() const { return m_osKey; }
|
||||
/*! @endcond */
|
||||
|
||||
std::vector<CPLJSONObject> GetChildren() const;
|
||||
bool IsValid() const;
|
||||
void Deinit();
|
||||
|
||||
protected:
|
||||
/*! @cond Doxygen_Suppress */
|
||||
CPLJSONObject GetObjectByPath(const std::string &osPath, std::string &osName) const;
|
||||
/*! @endcond */
|
||||
|
||||
private:
|
||||
JSONObjectH m_poJsonObject;
|
||||
std::string m_osKey;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The JSONArray class JSON array from JSONDocument
|
||||
*/
|
||||
class CPL_DLL CPLJSONArray : public CPLJSONObject
|
||||
{
|
||||
friend class CPLJSONObject;
|
||||
friend class CPLJSONDocument;
|
||||
public:
|
||||
/*! @cond Doxygen_Suppress */
|
||||
CPLJSONArray();
|
||||
explicit CPLJSONArray(const std::string &osName);
|
||||
explicit CPLJSONArray(const CPLJSONObject &other);
|
||||
|
||||
private:
|
||||
explicit CPLJSONArray(const std::string &osName, JSONObjectH poJsonObject);
|
||||
/*! @endcond */
|
||||
public:
|
||||
int Size() const;
|
||||
void Add(const CPLJSONObject &oValue);
|
||||
void Add(const std::string &osValue);
|
||||
void Add(const char* pszValue);
|
||||
void Add(double dfValue);
|
||||
void Add(int nValue);
|
||||
void Add(GInt64 nValue);
|
||||
void Add(bool bValue);
|
||||
CPLJSONObject operator[](int nIndex);
|
||||
const CPLJSONObject operator[](int nIndex) const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The CPLJSONDocument class Wrapper class around json-c library
|
||||
*/
|
||||
class CPL_DLL CPLJSONDocument
|
||||
{
|
||||
public:
|
||||
/*! @cond Doxygen_Suppress */
|
||||
CPLJSONDocument();
|
||||
~CPLJSONDocument();
|
||||
CPLJSONDocument(const CPLJSONDocument &other);
|
||||
CPLJSONDocument& operator=(const CPLJSONDocument &other);
|
||||
/*! @endcond */
|
||||
|
||||
bool Save(const std::string &osPath);
|
||||
std::string SaveAsString();
|
||||
|
||||
CPLJSONObject GetRoot();
|
||||
bool Load(const std::string &osPath);
|
||||
bool LoadMemory(const std::string &osStr);
|
||||
bool LoadMemory(const GByte *pabyData, int nLength = -1);
|
||||
bool LoadChunks(const std::string &osPath, size_t nChunkSize = 16384,
|
||||
GDALProgressFunc pfnProgress = nullptr,
|
||||
void *pProgressArg = nullptr);
|
||||
bool LoadUrl(const std::string &osUrl, char **papszOptions,
|
||||
GDALProgressFunc pfnProgress = nullptr,
|
||||
void *pProgressArg = nullptr);
|
||||
|
||||
private:
|
||||
JSONObjectH m_poRootJsonObject;
|
||||
};
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif // CPL_JSON_H_INCLUDED
|
||||
63
modules/globebrowsing/ext/gdal/include/cpl_json_header.h
Normal file
63
modules/globebrowsing/ext/gdal/include/cpl_json_header.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: Includes json-c header
|
||||
* Author: Even Rouault <even dot rouault at spatialys dot com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef OGR_JSON_HEADER_H
|
||||
#define OGR_JSON_HEADER_H
|
||||
|
||||
#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) && !defined(_MSC_VER))
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#include <json.h>
|
||||
|
||||
#undef json_object_object_foreachC
|
||||
#define json_object_object_foreachC(obj,iter) \
|
||||
for(iter.entry = json_object_get_object(obj)->head; (iter.entry ? (iter.key = (char*)iter.entry->k, iter.val = (struct json_object*)iter.entry->v, iter.entry) : nullptr) != nullptr; iter.entry = iter.entry->next)
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
struct JsonObjectReleaser
|
||||
{
|
||||
void operator()(json_object* poObj) const { json_object_put(poObj); }
|
||||
};
|
||||
|
||||
using JsonObjectUniquePtr = std::unique_ptr<json_object, JsonObjectReleaser>;
|
||||
|
||||
} // extern "C++"
|
||||
|
||||
#endif /* def __cplusplus && !CPL_SUPRESS_CPLUSPLUS */
|
||||
/*! @endcond */
|
||||
|
||||
#endif /* OGR_JSON_HEADER_H */
|
||||
@@ -0,0 +1,120 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: JSon streaming parser
|
||||
* Author: Even Rouault, even.rouault at spatialys.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2017, Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CPL_JSON_STREAMIN_PARSER_H
|
||||
#define CPL_JSON_STREAMIN_PARSER_H
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "cpl_port.h"
|
||||
|
||||
class CPL_DLL CPLJSonStreamingParser
|
||||
{
|
||||
enum State
|
||||
{
|
||||
INIT,
|
||||
OBJECT,
|
||||
ARRAY,
|
||||
STRING,
|
||||
NUMBER,
|
||||
STATE_TRUE,
|
||||
STATE_FALSE,
|
||||
STATE_NULL
|
||||
};
|
||||
|
||||
bool m_bExceptionOccurred;
|
||||
bool m_bElementFound;
|
||||
int m_nLastChar;
|
||||
int m_nLineCounter;
|
||||
int m_nCharCounter;
|
||||
std::vector<State> m_aState;
|
||||
std::string m_osToken;
|
||||
std::vector<bool> m_abFirstElement;
|
||||
bool m_bInStringEscape;
|
||||
bool m_bInUnicode;
|
||||
std::string m_osUnicodeHex;
|
||||
size_t m_nMaxDepth;
|
||||
size_t m_nMaxStringSize;
|
||||
|
||||
enum MemberState
|
||||
{
|
||||
WAITING_KEY,
|
||||
IN_KEY,
|
||||
KEY_FINISHED,
|
||||
IN_VALUE
|
||||
};
|
||||
std::vector<MemberState> m_aeObjectState;
|
||||
|
||||
enum State currentState() { return m_aState.back(); }
|
||||
void SkipSpace(const char*& pStr, size_t& nLength);
|
||||
void AdvanceChar(const char*& pStr, size_t& nLength);
|
||||
bool EmitException(const char* pszMessage);
|
||||
bool EmitUnexpectedChar(char ch);
|
||||
bool StartNewToken(const char*& pStr, size_t& nLength);
|
||||
bool CheckAndEmitTrueFalseOrNull(char ch);
|
||||
bool CheckStackEmpty();
|
||||
void DecodeUnicode();
|
||||
|
||||
public:
|
||||
CPLJSonStreamingParser();
|
||||
virtual ~CPLJSonStreamingParser();
|
||||
|
||||
void SetMaxDepth(size_t nVal);
|
||||
void SetMaxStringSize(size_t nVal);
|
||||
bool ExceptionOccurred() const { return m_bExceptionOccurred; }
|
||||
|
||||
static std::string GetSerializedString(const char* pszStr);
|
||||
|
||||
virtual void Reset();
|
||||
virtual bool Parse(const char* pStr, size_t nLength, bool bFinished);
|
||||
|
||||
virtual void String(const char* /*pszValue*/, size_t /*nLength*/) {}
|
||||
virtual void Number(const char* /*pszValue*/, size_t /*nLength*/) {}
|
||||
virtual void Boolean(bool /*b*/) {}
|
||||
virtual void Null() {}
|
||||
|
||||
virtual void StartObject() {}
|
||||
virtual void EndObject() {}
|
||||
virtual void StartObjectMember(const char* /*pszKey*/, size_t /*nLength*/) {}
|
||||
|
||||
virtual void StartArray() {}
|
||||
virtual void EndArray() {}
|
||||
virtual void StartArrayMember() {}
|
||||
|
||||
virtual void Exception(const char* /*pszMessage*/) {}
|
||||
};
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
/*! @endcond */
|
||||
|
||||
#endif // CPL_JSON_STREAMIN_PARSER_H
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_list.h 37825 2017-03-21 20:14:08Z rouault $
|
||||
* $Id: cpl_list.h 19e85ae1bff5f1b39d4a576e09a9cd70121a99cd 2017-03-21 20:14:08Z Even Rouault $
|
||||
*
|
||||
* Name: cpl_list.h
|
||||
* Project: CPL - Common Portability Library
|
||||
|
||||
28
modules/globebrowsing/ext/gdal/include/cpl_md5.h
Normal file
28
modules/globebrowsing/ext/gdal/include/cpl_md5.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* See md5.cpp for explanation and copyright information. */
|
||||
|
||||
#ifndef CPL_MD5_H
|
||||
#define CPL_MD5_H
|
||||
|
||||
#include "cpl_port.h"
|
||||
|
||||
CPL_C_START
|
||||
const char CPL_DLL *CPLMD5String( const char *pszText );
|
||||
CPL_C_END
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
struct CPLMD5Context {
|
||||
GUInt32 buf[4];
|
||||
GUInt32 bits[2];
|
||||
unsigned char in[64];
|
||||
};
|
||||
|
||||
void CPLMD5Init( struct CPLMD5Context *context );
|
||||
void CPLMD5Update( struct CPLMD5Context *context, unsigned char const *buf,
|
||||
unsigned len );
|
||||
void CPLMD5Final( unsigned char digest[16], struct CPLMD5Context *context );
|
||||
void CPLMD5Transform( GUInt32 buf[4], const unsigned char inraw[64] );
|
||||
|
||||
#endif // #ifndef DOXYGEN_SKIP
|
||||
|
||||
#endif /* !CPL_MD5_H */
|
||||
213
modules/globebrowsing/ext/gdal/include/cpl_mem_cache.h
Normal file
213
modules/globebrowsing/ext/gdal/include/cpl_mem_cache.h
Normal file
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* LRUCache11 - a templated C++11 based LRU cache class that allows
|
||||
* specification of
|
||||
* key, value and optionally the map container type (defaults to
|
||||
* std::unordered_map)
|
||||
* By using the std::map and a linked list of keys it allows O(1) insert, delete
|
||||
* and
|
||||
* refresh operations.
|
||||
*
|
||||
* This is a header-only library and all you need is the LRUCache11.hpp file
|
||||
*
|
||||
* Github: https://github.com/mohaps/lrucache11
|
||||
*
|
||||
* This is a follow-up to the LRUCache project -
|
||||
* https://github.com/mohaps/lrucache
|
||||
*
|
||||
* Copyright (c) 2012-22 SAURAV MOHAPATRA <mohaps@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
|
||||
#pragma once
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
#include <mutex>
|
||||
#include <stdexcept>
|
||||
#include <thread>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace lru11 {
|
||||
/*
|
||||
* a noop lockable concept that can be used in place of std::mutex
|
||||
*/
|
||||
class NullLock {
|
||||
public:
|
||||
void lock() {}
|
||||
void unlock() {}
|
||||
bool try_lock() { return true; }
|
||||
};
|
||||
|
||||
/**
|
||||
* error raised when a key not in cache is passed to get()
|
||||
*/
|
||||
class KeyNotFound : public std::invalid_argument {
|
||||
public:
|
||||
KeyNotFound() : std::invalid_argument("key_not_found") {}
|
||||
};
|
||||
|
||||
template <typename K, typename V>
|
||||
struct KeyValuePair {
|
||||
public:
|
||||
K key;
|
||||
V value;
|
||||
|
||||
KeyValuePair(const K& k, const V& v) : key(k), value(v) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* The LRU Cache class templated by
|
||||
* Key - key type
|
||||
* Value - value type
|
||||
* MapType - an associative container like std::unordered_map
|
||||
* LockType - a lock type derived from the Lock class (default:
|
||||
*NullLock = no synchronization)
|
||||
*
|
||||
* The default NullLock based template is not thread-safe, however passing
|
||||
*Lock=std::mutex will make it
|
||||
* thread-safe
|
||||
*/
|
||||
template <class Key, class Value, class Lock = NullLock,
|
||||
class Map = std::unordered_map<
|
||||
Key, typename std::list<KeyValuePair<Key, Value>>::iterator>>
|
||||
class Cache {
|
||||
public:
|
||||
typedef KeyValuePair<Key, Value> node_type;
|
||||
typedef std::list<KeyValuePair<Key, Value>> list_type;
|
||||
typedef Map map_type;
|
||||
typedef Lock lock_type;
|
||||
using Guard = std::lock_guard<lock_type>;
|
||||
/**
|
||||
* the max size is the hard limit of keys and (maxSize + elasticity) is the
|
||||
* soft limit
|
||||
* the cache is allowed to grow till maxSize + elasticity and is pruned back
|
||||
* to maxSize keys
|
||||
* set maxSize = 0 for an unbounded cache (but in that case, you're better off
|
||||
* using a std::unordered_map
|
||||
* directly anyway! :)
|
||||
*/
|
||||
explicit Cache(size_t maxSize = 64, size_t elasticity = 10)
|
||||
: maxSize_(maxSize), elasticity_(elasticity) {}
|
||||
virtual ~Cache() = default;
|
||||
size_t size() const {
|
||||
Guard g(lock_);
|
||||
return cache_.size();
|
||||
}
|
||||
bool empty() const {
|
||||
Guard g(lock_);
|
||||
return cache_.empty();
|
||||
}
|
||||
void clear() {
|
||||
Guard g(lock_);
|
||||
cache_.clear();
|
||||
keys_.clear();
|
||||
}
|
||||
void insert(const Key& k, const Value& v) {
|
||||
Guard g(lock_);
|
||||
const auto iter = cache_.find(k);
|
||||
if (iter != cache_.end()) {
|
||||
iter->second->value = v;
|
||||
keys_.splice(keys_.begin(), keys_, iter->second);
|
||||
return;
|
||||
}
|
||||
|
||||
keys_.emplace_front(k, v);
|
||||
cache_[k] = keys_.begin();
|
||||
prune();
|
||||
}
|
||||
bool tryGet(const Key& kIn, Value& vOut) {
|
||||
Guard g(lock_);
|
||||
const auto iter = cache_.find(kIn);
|
||||
if (iter == cache_.end()) {
|
||||
return false;
|
||||
}
|
||||
keys_.splice(keys_.begin(), keys_, iter->second);
|
||||
vOut = iter->second->value;
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* The const reference returned here is only
|
||||
* guaranteed to be valid till the next insert/delete
|
||||
*/
|
||||
const Value& get(const Key& k) {
|
||||
Guard g(lock_);
|
||||
const auto iter = cache_.find(k);
|
||||
if (iter == cache_.end()) {
|
||||
throw KeyNotFound();
|
||||
}
|
||||
keys_.splice(keys_.begin(), keys_, iter->second);
|
||||
return iter->second->value;
|
||||
}
|
||||
/**
|
||||
* returns a copy of the stored object (if found)
|
||||
*/
|
||||
Value getCopy(const Key& k) {
|
||||
return get(k);
|
||||
}
|
||||
bool remove(const Key& k) {
|
||||
Guard g(lock_);
|
||||
auto iter = cache_.find(k);
|
||||
if (iter == cache_.end()) {
|
||||
return false;
|
||||
}
|
||||
keys_.erase(iter->second);
|
||||
cache_.erase(iter);
|
||||
return true;
|
||||
}
|
||||
bool contains(const Key& k) {
|
||||
Guard g(lock_);
|
||||
return cache_.find(k) != cache_.end();
|
||||
}
|
||||
|
||||
size_t getMaxSize() const { return maxSize_; }
|
||||
size_t getElasticity() const { return elasticity_; }
|
||||
size_t getMaxAllowedSize() const { return maxSize_ + elasticity_; }
|
||||
template <typename F>
|
||||
void cwalk(F& f) const {
|
||||
Guard g(lock_);
|
||||
std::for_each(keys_.begin(), keys_.end(), f);
|
||||
}
|
||||
|
||||
protected:
|
||||
size_t prune() {
|
||||
size_t maxAllowed = maxSize_ + elasticity_;
|
||||
if (maxSize_ == 0 || cache_.size() <= maxAllowed) { /* ERO: changed < to <= */
|
||||
return 0;
|
||||
}
|
||||
size_t count = 0;
|
||||
while (cache_.size() > maxSize_) {
|
||||
cache_.erase(keys_.back().key);
|
||||
keys_.pop_back();
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
private:
|
||||
// Dissallow copying.
|
||||
Cache(const Cache&) = delete;
|
||||
Cache& operator=(const Cache&) = delete;
|
||||
|
||||
mutable Lock lock_{};
|
||||
Map cache_{};
|
||||
list_type keys_{};
|
||||
size_t maxSize_;
|
||||
size_t elasticity_;
|
||||
};
|
||||
|
||||
} // namespace LRUCache11
|
||||
|
||||
/*! @endcond */
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_minixml.h 35921 2016-10-25 02:28:29Z goatbar $
|
||||
* $Id: cpl_minixml.h df507edcc67aa14ada1432baf516f49e6557fb06 2018-04-10 15:26:13 +0200 Even Rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Declarations for MiniXML Handler.
|
||||
@@ -122,9 +122,33 @@ CPLXMLNode CPL_DLL *CPLParseXMLString( const char * );
|
||||
void CPL_DLL CPLDestroyXMLNode( CPLXMLNode * );
|
||||
CPLXMLNode CPL_DLL *CPLGetXMLNode( CPLXMLNode *poRoot,
|
||||
const char *pszPath );
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
/*! @cond Doxygen_Suppress */
|
||||
extern "C++"
|
||||
{
|
||||
inline const CPLXMLNode *CPLGetXMLNode( const CPLXMLNode *poRoot,
|
||||
const char *pszPath ) {
|
||||
return const_cast<const CPLXMLNode*>(CPLGetXMLNode(
|
||||
const_cast<CPLXMLNode*>(poRoot), pszPath));
|
||||
}
|
||||
}
|
||||
/*! @endcond */
|
||||
#endif
|
||||
CPLXMLNode CPL_DLL *CPLSearchXMLNode( CPLXMLNode *poRoot,
|
||||
const char *pszTarget );
|
||||
const char CPL_DLL *CPLGetXMLValue( CPLXMLNode *poRoot,
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
/*! @cond Doxygen_Suppress */
|
||||
extern "C++"
|
||||
{
|
||||
inline const CPLXMLNode *CPLSearchXMLNode( const CPLXMLNode *poRoot,
|
||||
const char *pszTarget ) {
|
||||
return const_cast<const CPLXMLNode*>(CPLSearchXMLNode(
|
||||
const_cast<CPLXMLNode*>(poRoot), pszTarget));
|
||||
}
|
||||
}
|
||||
/*! @endcond */
|
||||
#endif
|
||||
const char CPL_DLL *CPLGetXMLValue( const CPLXMLNode *poRoot,
|
||||
const char *pszPath,
|
||||
const char *pszDefault );
|
||||
CPLXMLNode CPL_DLL *CPLCreateXMLNode( CPLXMLNode *poParent,
|
||||
@@ -143,7 +167,7 @@ CPLXMLNode CPL_DLL *CPLCreateXMLElementAndValue( CPLXMLNode *psParent,
|
||||
void CPL_DLL CPLAddXMLAttributeAndValue( CPLXMLNode *psParent,
|
||||
const char *pszName,
|
||||
const char *pszValue );
|
||||
CPLXMLNode CPL_DLL *CPLCloneXMLTree( CPLXMLNode *psTree );
|
||||
CPLXMLNode CPL_DLL *CPLCloneXMLTree( const CPLXMLNode *psTree );
|
||||
int CPL_DLL CPLSetXMLValue( CPLXMLNode *psRoot, const char *pszPath,
|
||||
const char *pszValue );
|
||||
void CPL_DLL CPLStripXMLNamespace( CPLXMLNode *psRoot,
|
||||
@@ -157,33 +181,38 @@ int CPL_DLL CPLSerializeXMLTreeToFile( const CPLXMLNode *psTree,
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
struct CPLXMLTreeCloserDeleter
|
||||
{
|
||||
void operator()(CPLXMLNode* psNode) const { CPLDestroyXMLNode(psNode); }
|
||||
};
|
||||
/*! @endcond */
|
||||
|
||||
/** Manage a tree of XML nodes so that all nodes are freed when the instance goes
|
||||
* out of scope. Only the top level node should be in a CPLXMLTreeCloser.
|
||||
*/
|
||||
class CPLXMLTreeCloser {
|
||||
class CPLXMLTreeCloser: public std::unique_ptr<CPLXMLNode, CPLXMLTreeCloserDeleter>
|
||||
{
|
||||
public:
|
||||
/** Constructor */
|
||||
explicit CPLXMLTreeCloser(CPLXMLNode* data) { the_data_ = data; }
|
||||
explicit CPLXMLTreeCloser(CPLXMLNode* data):
|
||||
std::unique_ptr<CPLXMLNode, CPLXMLTreeCloserDeleter>(data) {}
|
||||
|
||||
/** Destructor */
|
||||
~CPLXMLTreeCloser() {
|
||||
if (the_data_) CPLDestroyXMLNode(the_data_);
|
||||
}
|
||||
|
||||
/** Returns the node pointer/
|
||||
* Modifying the contents pointed to by the return is allowed.
|
||||
/** Returns a pointer to the document (root) element
|
||||
* @return the node pointer */
|
||||
CPLXMLNode* get() const { return the_data_; }
|
||||
|
||||
/** Returns the node pointer/
|
||||
* Modifying the contents pointed to by the return is allowed.
|
||||
* @return the node pointer */
|
||||
CPLXMLNode* operator->() const { return get(); }
|
||||
|
||||
private:
|
||||
CPLXMLNode* the_data_;
|
||||
CPLXMLNode* getDocumentElement();
|
||||
};
|
||||
|
||||
} // extern "C++"
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* CPL_MINIXML_H_INCLUDED */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: cpl_minizip_ioapi.h 36484 2016-11-24 06:35:54Z goatbar $ */
|
||||
/* $Id: cpl_minizip_ioapi.h 2f03d19efafeda04a990e03e7fb3cf56dd11b213 2016-11-24 06:35:54Z Kurt Schwehr $ */
|
||||
|
||||
/* Modified version by Even Rouault. :
|
||||
- change fill_fopen_filefunc to cpl_fill_fopen_filefunc
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: cpl_minizip_unzip.h 35921 2016-10-25 02:28:29Z goatbar $ */
|
||||
/* $Id: cpl_minizip_unzip.h 44e0c0ecc2e12f7885d8572d0f18dd94e7fbda1c 2016-10-25 02:28:29Z Kurt Schwehr $ */
|
||||
/* Modified version by Even Rouault. :
|
||||
- Addition of cpl_unzGetCurrentFileZStreamPos
|
||||
- Decoration of symbol names unz* -> cpl_unz*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_minizip_zip.h 35921 2016-10-25 02:28:29Z goatbar $
|
||||
* $Id: cpl_minizip_zip.h 44e0c0ecc2e12f7885d8572d0f18dd94e7fbda1c 2016-10-25 02:28:29Z Kurt Schwehr $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_multiproc.h 35921 2016-10-25 02:28:29Z goatbar $
|
||||
* $Id: cpl_multiproc.h b5fb552a68377945dc4bff235f0e1af3728c75c6 2018-03-11 23:57:13Z Even Rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: CPL Multi-Threading, and process handling portability functions.
|
||||
@@ -122,7 +122,7 @@ void CPL_DLL CPLLockSetDebugPerf( CPLLock*, int bEnableIn ); /* only available
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
/* Instantiates the mutex if not already done. The parameter x should be a (void**). */
|
||||
#define CPLMutexHolderD(x) CPLMutexHolder oHolder(x,1000.0,__FILE__,__LINE__);
|
||||
@@ -205,7 +205,7 @@ class CPL_DLL CPLLockHolder
|
||||
#define CTLS_ERRORCONTEXT 5 /* cpl_error.cpp */
|
||||
#define CTLS_GDALDATASET_REC_PROTECT_MAP 6 /* gdaldataset.cpp */
|
||||
#define CTLS_PATHBUF 7 /* cpl_path.cpp */
|
||||
#define CTLS_UNUSED3 8
|
||||
#define CTLS_ABSTRACTARCHIVE_SPLIT 8 /* cpl_vsil_abstract_archive.cpp */
|
||||
#define CTLS_UNUSED4 9
|
||||
#define CTLS_CPLSPRINTF 10 /* cpl_string.h */
|
||||
#define CTLS_RESPONSIBLEPID 11 /* gdaldataset.cpp */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_odbc.h 36675 2016-12-04 11:10:10Z rouault $
|
||||
* $Id: cpl_odbc.h 7e07230bbff24eb333608de4dbd460b7312839d0 2017-12-11 19:08:47Z Even Rouault $
|
||||
*
|
||||
* Project: OGR ODBC Driver
|
||||
* Purpose: Declarations for ODBC Access Cover API.
|
||||
@@ -187,7 +187,7 @@ class CPL_DLL CPLODBCSession {
|
||||
|
||||
int CloseSession();
|
||||
|
||||
int Failed( int, HSTMT = NULL );
|
||||
int Failed( int, HSTMT = nullptr );
|
||||
/** Return connection handle */
|
||||
HDBC GetConnection() { return m_hDBC; }
|
||||
/** Return GetEnvironment handle */
|
||||
@@ -243,7 +243,7 @@ class CPL_DLL CPLODBCStatement {
|
||||
/** Return statement string */
|
||||
const char *GetCommand() { return m_pszStatement; }
|
||||
|
||||
int ExecuteSQL( const char * = NULL );
|
||||
int ExecuteSQL( const char * = nullptr );
|
||||
|
||||
// Results fetching
|
||||
int Fetch( int nOrientation = SQL_FETCH_NEXT,
|
||||
@@ -260,21 +260,21 @@ class CPL_DLL CPLODBCStatement {
|
||||
const char *GetColColumnDef( int );
|
||||
|
||||
int GetColId( const char * );
|
||||
const char *GetColData( int, const char * = NULL );
|
||||
const char *GetColData( const char *, const char * = NULL );
|
||||
const char *GetColData( int, const char * = nullptr );
|
||||
const char *GetColData( const char *, const char * = nullptr );
|
||||
int GetColDataLength( int );
|
||||
int GetRowCountAffected();
|
||||
|
||||
// Fetch special metadata.
|
||||
int GetColumns( const char *pszTable,
|
||||
const char *pszCatalog = NULL,
|
||||
const char *pszSchema = NULL );
|
||||
const char *pszCatalog = nullptr,
|
||||
const char *pszSchema = nullptr );
|
||||
int GetPrimaryKeys( const char *pszTable,
|
||||
const char *pszCatalog = NULL,
|
||||
const char *pszSchema = NULL );
|
||||
const char *pszCatalog = nullptr,
|
||||
const char *pszSchema = nullptr );
|
||||
|
||||
int GetTables( const char *pszCatalog = NULL,
|
||||
const char *pszSchema = NULL );
|
||||
int GetTables( const char *pszCatalog = nullptr,
|
||||
const char *pszSchema = nullptr );
|
||||
|
||||
void DumpResult( FILE *fp, int bShowSchema = FALSE );
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_port.h 37456 2017-02-25 18:35:03Z rouault $
|
||||
* $Id: cpl_port.h 9b81cd476af4dd1a40b1a79f9e3e355114e2cd33 2018-05-08 11:21:07 +0200 Even Rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
@@ -123,7 +123,7 @@
|
||||
#endif
|
||||
|
||||
/* Needed for std=c11 on Solaris to have strcasecmp() */
|
||||
#if defined(GDAL_COMPILATION) && defined(__sun__) && __STDC_VERSION__ >= 201112L && _XOPEN_SOURCE < 600
|
||||
#if defined(GDAL_COMPILATION) && defined(__sun__) && (__STDC_VERSION__ + 0) >= 201112L && (_XOPEN_SOURCE + 0) < 600
|
||||
#ifdef _XOPEN_SOURCE
|
||||
#undef _XOPEN_SOURCE
|
||||
#endif
|
||||
@@ -179,11 +179,17 @@
|
||||
/* Which versions of C++ are available. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __cplusplus >= 201103L
|
||||
# define HAVE_CXX11 1
|
||||
/* MSVC fails to define a decent value of __cplusplus. Try to target VS2015*/
|
||||
/* as a minimum */
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
# if !(__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900))
|
||||
# error Must have C++11 or newer.
|
||||
# endif
|
||||
/* TODO(schwehr): What are the correct tests for C++ 14 and 17? */
|
||||
# if __cplusplus >= 201402L
|
||||
# define HAVE_CXX14 1
|
||||
# endif
|
||||
/* TODO(schwehr): What is the correct test for C++ 17? */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*---------------------------------------------------------------------
|
||||
@@ -215,35 +221,25 @@ typedef unsigned char GByte;
|
||||
typedef int GBool;
|
||||
#endif
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifdef __cplusplus
|
||||
#define CPL_STATIC_CAST(type, expr) static_cast<type>(expr)
|
||||
#define CPL_REINTERPRET_CAST(type, expr) reinterpret_cast<type>(expr)
|
||||
#else
|
||||
#define CPL_STATIC_CAST(type, expr) ((type)(expr))
|
||||
#define CPL_REINTERPRET_CAST(type, expr) ((type)(expr))
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* 64bit support */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
#if defined(WIN32) && defined(_MSC_VER)
|
||||
|
||||
#define VSI_LARGE_API_SUPPORTED
|
||||
typedef __int64 GIntBig;
|
||||
typedef unsigned __int64 GUIntBig;
|
||||
#endif
|
||||
|
||||
/** Minimum GIntBig value */
|
||||
#define GINTBIG_MIN ((GIntBig)(0x80000000) << 32)
|
||||
/** Maximum GIntBig value */
|
||||
#define GINTBIG_MAX (((GIntBig)(0x7FFFFFFF) << 32) | 0xFFFFFFFFU)
|
||||
/** Maximum GUIntBig value */
|
||||
#define GUINTBIG_MAX (((GUIntBig)(0xFFFFFFFFU) << 32) | 0xFFFFFFFFU)
|
||||
|
||||
#define CPL_HAS_GINT64 1
|
||||
|
||||
/** Signed 64 bit integer type */
|
||||
typedef GIntBig GInt64;
|
||||
/** Unsigned 64 bit integer type */
|
||||
typedef GUIntBig GUInt64;
|
||||
|
||||
#define GINT64_MIN GINTBIG_MIN
|
||||
#define GINT64_MAX GINTBIG_MAX
|
||||
#define GUINT64_MAX GUINTBIG_MAX
|
||||
|
||||
#elif HAVE_LONG_LONG
|
||||
#if HAVE_LONG_LONG
|
||||
|
||||
/** Large signed integer type (generally 64-bit integer type).
|
||||
* Use GInt64 when exactly 64 bit is needed */
|
||||
@@ -253,11 +249,11 @@ typedef long long GIntBig;
|
||||
typedef unsigned long long GUIntBig;
|
||||
|
||||
/** Minimum GIntBig value */
|
||||
#define GINTBIG_MIN ((GIntBig)(0x80000000) << 32)
|
||||
#define GINTBIG_MIN (CPL_STATIC_CAST(GIntBig, 0x80000000) << 32)
|
||||
/** Maximum GIntBig value */
|
||||
#define GINTBIG_MAX (((GIntBig)(0x7FFFFFFF) << 32) | 0xFFFFFFFFU)
|
||||
#define GINTBIG_MAX ((CPL_STATIC_CAST(GIntBig, 0x7FFFFFFF) << 32) | 0xFFFFFFFFU)
|
||||
/** Maximum GUIntBig value */
|
||||
#define GUINTBIG_MAX (((GUIntBig)(0xFFFFFFFFU) << 32) | 0xFFFFFFFFU)
|
||||
#define GUINTBIG_MAX ((CPL_STATIC_CAST(GUIntBig, 0xFFFFFFFFU) << 32) | 0xFFFFFFFFU)
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define CPL_HAS_GINT64 1
|
||||
@@ -279,14 +275,8 @@ typedef GUIntBig GUInt64;
|
||||
|
||||
#else
|
||||
|
||||
// NOTE: we don't really support such platforms ! Many things might break
|
||||
#error "64bit integer support required"
|
||||
|
||||
typedef long GIntBig;
|
||||
typedef unsigned long GUIntBig;
|
||||
|
||||
#define GINTBIG_MIN INT_MIN
|
||||
#define GINTBIG_MAX INT_MAX
|
||||
#define GUINTBIG_MAX UINT_MAX
|
||||
#endif
|
||||
|
||||
#if SIZEOF_VOIDP == 8
|
||||
@@ -299,9 +289,7 @@ typedef int GPtrDiff_t;
|
||||
|
||||
#ifdef GDAL_COMPILATION
|
||||
#if HAVE_UINTPTR_T
|
||||
#if !defined(_MSC_VER) || _MSC_VER > 1500
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
typedef uintptr_t GUIntptr_t;
|
||||
#elif SIZEOF_VOIDP == 8
|
||||
typedef GUIntBig GUIntptr_t;
|
||||
@@ -309,7 +297,7 @@ typedef GUIntBig GUIntptr_t;
|
||||
typedef unsigned int GUIntptr_t;
|
||||
#endif
|
||||
|
||||
#define CPL_IS_ALIGNED(ptr, quant) (((GUIntptr_t)(ptr) % (quant)) == 0)
|
||||
#define CPL_IS_ALIGNED(ptr, quant) ((CPL_REINTERPRET_CAST(GUIntptr_t, CPL_STATIC_CAST(const void*, ptr)) % (quant)) == 0)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -328,19 +316,14 @@ typedef unsigned int GUIntptr_t;
|
||||
#define CPL_FRMT_GUIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "u"
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* Workaround VC6 bug */
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= 1200)
|
||||
#define GUINTBIG_TO_DOUBLE(x) (double)(GIntBig)(x)
|
||||
#else
|
||||
#define GUINTBIG_TO_DOUBLE(x) (double)(x)
|
||||
#endif
|
||||
#define GUINTBIG_TO_DOUBLE(x) CPL_STATIC_CAST(double, x)
|
||||
/*! @endcond */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#ifdef COMPAT_WITH_ICC_CONVERSION_CHECK
|
||||
#define CPL_INT64_FITS_ON_INT32(x) ((x) >= INT_MIN && (x) <= INT_MAX)
|
||||
#else
|
||||
#define CPL_INT64_FITS_ON_INT32(x) (((GIntBig)(int)(x)) == (x))
|
||||
#define CPL_INT64_FITS_ON_INT32(x) (CPL_STATIC_CAST(GIntBig, CPL_STATIC_CAST(int, x)) == (x))
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
@@ -407,52 +390,6 @@ typedef unsigned int GUIntptr_t;
|
||||
#endif
|
||||
/*! @endcond*/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
// Define NULL_AS_NULLPTR together with -std=c++11 -Wzero-as-null-pointer-constant with GCC
|
||||
// to detect misuses of NULL
|
||||
#if defined(NULL_AS_NULLPTR) && HAVE_CXX11
|
||||
|
||||
#ifdef __GNUC__
|
||||
// We need to include all that bunch of system headers, otherwise
|
||||
// as they include <stddef.h> with __need_NULL, this overrides our #define NULL nullptr
|
||||
// with #define NULL __null
|
||||
#include <locale.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
#ifdef HAVE_MMAP
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#ifndef _WIN32
|
||||
#include <dlfcn.h>
|
||||
#include <netdb.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
extern "C++" {
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <cstddef>
|
||||
#include <ostream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
}
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#undef NULL
|
||||
#define NULL nullptr
|
||||
#else /* defined(NULL_AS_NULLPTR) && HAVE_CXX11 */
|
||||
#ifndef NULL
|
||||
# define NULL 0
|
||||
#endif
|
||||
#endif /* defined(NULL_AS_NULLPTR) && HAVE_CXX11 */
|
||||
/*! @endcond */
|
||||
|
||||
#ifndef MAX
|
||||
/** Macro to compute the minimum of 2 values */
|
||||
# define MIN(a,b) (((a)<(b)) ? (a) : (b))
|
||||
@@ -653,10 +590,17 @@ static inline char* CPL_afl_friendly_strstr(const char* haystack, const char* ne
|
||||
# define CPLIsNan(x) _isnan(x)
|
||||
# define CPLIsInf(x) (!_isnan(x) && !_finite(x))
|
||||
# define CPLIsFinite(x) _finite(x)
|
||||
#elif defined(__cplusplus) && defined(__MINGW32__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2
|
||||
/* Hack for compatibility with ancient i586-mingw32msvc toolchain */
|
||||
#elif defined(__GNUC__) && ( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4 ) )
|
||||
/* When including <cmath> in C++11 the isnan() macro is undefined, so that */
|
||||
/* std::isnan() can work (#6489). This is a GCC specific workaround for now. */
|
||||
# define CPLIsNan(x) __builtin_isnan(x)
|
||||
# define CPLIsInf(x) __builtin_isinf(x)
|
||||
# define CPLIsFinite(x) __builtin_isfinite(x)
|
||||
#elif defined(__cplusplus) && defined(HAVE_STD_IS_NAN) && HAVE_STD_IS_NAN
|
||||
extern "C++" {
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#include <cmath>
|
||||
#endif
|
||||
static inline int CPLIsNan(float f) { return std::isnan(f); }
|
||||
static inline int CPLIsNan(double f) { return std::isnan(f); }
|
||||
static inline int CPLIsInf(float f) { return std::isinf(f); }
|
||||
@@ -664,15 +608,9 @@ static inline int CPLIsInf(double f) { return std::isinf(f); }
|
||||
static inline int CPLIsFinite(float f) { return std::isfinite(f); }
|
||||
static inline int CPLIsFinite(double f) { return std::isfinite(f); }
|
||||
}
|
||||
#elif defined(__GNUC__) && ( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4 ) )
|
||||
/* When including <cmath> in C++11 the isnan() macro is undefined, so that */
|
||||
/* std::isnan() can work (#6489). This is a GCC specific workaround for now. */
|
||||
# define CPLIsNan(x) __builtin_isnan(x)
|
||||
# define CPLIsInf(x) __builtin_isinf(x)
|
||||
# define CPLIsFinite(x) __builtin_isfinite(x)
|
||||
#else
|
||||
/** Return whether a floating-pointer number is NaN */
|
||||
#if defined(__cplusplus) && defined(__GNUC__) && defined(__linux) && !defined(__ANDROID__)
|
||||
#if defined(__cplusplus) && defined(__GNUC__) && defined(__linux) && !defined(__ANDROID__) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
/* so to not get warning about conversion from double to float with */
|
||||
/* gcc -Wfloat-conversion when using isnan()/isinf() macros */
|
||||
extern "C++" {
|
||||
@@ -724,7 +662,7 @@ static inline int CPLIsFinite(double f) { return !__isnan(f) && !__isinf(f); }
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
extern "C++" {
|
||||
@@ -752,7 +690,7 @@ template<> struct CPLStaticAssert<true>
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
/** Byte-swap a 16bit unsigned integer */
|
||||
#define CPL_SWAP16(x) ((GUInt16)( ((GUInt16)(x) << 8) | ((GUInt16)(x) >> 8) ))
|
||||
#define CPL_SWAP16(x) CPL_STATIC_CAST(GUInt16, (CPL_STATIC_CAST(GUInt16, x) << 8) | (CPL_STATIC_CAST(GUInt16, x) >> 8) )
|
||||
|
||||
#if defined(HAVE_GCC_BSWAP) && (defined(__i386__) || defined(__x86_64__))
|
||||
/* Could potentially be extended to other architectures but must be checked */
|
||||
@@ -760,32 +698,32 @@ template<> struct CPLStaticAssert<true>
|
||||
/* GCC (at least 4.6 or above) need that include */
|
||||
#include <x86intrin.h>
|
||||
/** Byte-swap a 32bit unsigned integer */
|
||||
#define CPL_SWAP32(x) ((GUInt32)(__builtin_bswap32((GUInt32)(x))))
|
||||
#define CPL_SWAP32(x) CPL_STATIC_CAST(GUInt32, __builtin_bswap32(CPL_STATIC_CAST(GUInt32, x)))
|
||||
/** Byte-swap a 64bit unsigned integer */
|
||||
#define CPL_SWAP64(x) ((GUInt64)(__builtin_bswap64((GUInt64)(x))))
|
||||
#define CPL_SWAP64(x) CPL_STATIC_CAST(GUInt64, __builtin_bswap64(CPL_STATIC_CAST(GUInt64, x)))
|
||||
#elif defined(_MSC_VER)
|
||||
#define CPL_SWAP32(x) ((GUInt32)(_byteswap_ulong((GUInt32)(x))))
|
||||
#define CPL_SWAP64(x) ((GUInt64)(_byteswap_uint64((GUInt64)(x))))
|
||||
#define CPL_SWAP32(x) CPL_STATIC_CAST(GUInt32, _byteswap_ulong(CPL_STATIC_CAST(GUInt32, x)))
|
||||
#define CPL_SWAP64(x) CPL_STATIC_CAST(GUInt64, _byteswap_uint64(CPL_STATIC_CAST(GUInt64, x)))
|
||||
#else
|
||||
/** Byte-swap a 32bit unsigned integer */
|
||||
#define CPL_SWAP32(x) \
|
||||
((GUInt32)( \
|
||||
(((GUInt32)(x) & (GUInt32)0x000000ffUL) << 24) | \
|
||||
(((GUInt32)(x) & (GUInt32)0x0000ff00UL) << 8) | \
|
||||
(((GUInt32)(x) & (GUInt32)0x00ff0000UL) >> 8) | \
|
||||
(((GUInt32)(x) & (GUInt32)0xff000000UL) >> 24) ))
|
||||
CPL_STATIC_CAST(GUInt32, \
|
||||
((CPL_STATIC_CAST(GUInt32, x) & 0x000000ffU) << 24) | \
|
||||
((CPL_STATIC_CAST(GUInt32, x) & 0x0000ff00U) << 8) | \
|
||||
((CPL_STATIC_CAST(GUInt32, x) & 0x00ff0000U) >> 8) | \
|
||||
((CPL_STATIC_CAST(GUInt32, x) & 0xff000000U) >> 24) )
|
||||
|
||||
/** Byte-swap a 64bit unsigned integer */
|
||||
#define CPL_SWAP64(x) \
|
||||
(((GUInt64)(CPL_SWAP32((GUInt32)(x))) << 32) | \
|
||||
(GUInt64)(CPL_SWAP32((GUInt32)((GUInt64)(x) >> 32))))
|
||||
((CPL_STATIC_CAST(GUInt64, CPL_SWAP32(CPL_STATIC_CAST(GUInt32, x))) << 32) | \
|
||||
(CPL_STATIC_CAST(GUInt64, CPL_SWAP32(CPL_STATIC_CAST(GUInt32, CPL_STATIC_CAST(GUInt64, x) >> 32)))))
|
||||
|
||||
#endif
|
||||
|
||||
/** Byte-swap a 16 bit pointer */
|
||||
#define CPL_SWAP16PTR(x) \
|
||||
{ \
|
||||
GByte byTemp, *_pabyDataT = (GByte *) (x); \
|
||||
GByte byTemp, *_pabyDataT = CPL_REINTERPRET_CAST(GByte*, x); \
|
||||
CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 2); \
|
||||
\
|
||||
byTemp = _pabyDataT[0]; \
|
||||
@@ -798,7 +736,7 @@ template<> struct CPLStaticAssert<true>
|
||||
/** Byte-swap a 32 bit pointer */
|
||||
#define CPL_SWAP32PTR(x) \
|
||||
{ \
|
||||
GByte byTemp, *_pabyDataT = (GByte *) (x); \
|
||||
GByte byTemp, *_pabyDataT = CPL_REINTERPRET_CAST(GByte*, x); \
|
||||
CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 4); \
|
||||
\
|
||||
byTemp = _pabyDataT[0]; \
|
||||
@@ -812,7 +750,7 @@ template<> struct CPLStaticAssert<true>
|
||||
/** Byte-swap a 64 bit pointer */
|
||||
#define CPL_SWAP64PTR(x) \
|
||||
{ \
|
||||
GByte byTemp, *_pabyDataT = (GByte *) (x); \
|
||||
GByte byTemp, *_pabyDataT = CPL_REINTERPRET_CAST(GByte*, x); \
|
||||
CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8); \
|
||||
\
|
||||
byTemp = _pabyDataT[0]; \
|
||||
@@ -895,25 +833,25 @@ template<> struct CPLStaticAssert<true>
|
||||
/** Return a Int16 from the 2 bytes ordered in LSB order at address x.
|
||||
* @deprecated Use rather CPL_LSBSINT16PTR or CPL_LSBUINT16PTR for explicit
|
||||
* signedness. */
|
||||
#define CPL_LSBINT16PTR(x) ((*(GByte*)(x)) | (*(((GByte*)(x))+1) << 8))
|
||||
#define CPL_LSBINT16PTR(x) ((*CPL_REINTERPRET_CAST(const GByte*, x)) | (*((CPL_REINTERPRET_CAST(const GByte*, x))+1) << 8))
|
||||
|
||||
/** Return a Int32 from the 4 bytes ordered in LSB order at address x.
|
||||
* @deprecated Use rather CPL_LSBSINT32PTR or CPL_LSBUINT32PTR for explicit
|
||||
* signedness. */
|
||||
#define CPL_LSBINT32PTR(x) ((*(GByte*)(x)) | (*(((GByte*)(x))+1) << 8) | \
|
||||
(*(((GByte*)(x))+2) << 16) | (*(((GByte*)(x))+3) << 24))
|
||||
#define CPL_LSBINT32PTR(x) ((*CPL_REINTERPRET_CAST(const GByte*, x)) | (*((CPL_REINTERPRET_CAST(const GByte*, x))+1) << 8) | \
|
||||
(*((CPL_REINTERPRET_CAST(const GByte*, x))+2) << 16) | (*((CPL_REINTERPRET_CAST(const GByte*, x))+3) << 24))
|
||||
|
||||
/** Return a signed Int16 from the 2 bytes ordered in LSB order at address x */
|
||||
#define CPL_LSBSINT16PTR(x) ((GInt16) CPL_LSBINT16PTR(x))
|
||||
#define CPL_LSBSINT16PTR(x) CPL_STATIC_CAST(GInt16,CPL_LSBINT16PTR(x))
|
||||
|
||||
/** Return a unsigned Int16 from the 2 bytes ordered in LSB order at address x */
|
||||
#define CPL_LSBUINT16PTR(x) ((GUInt16)CPL_LSBINT16PTR(x))
|
||||
#define CPL_LSBUINT16PTR(x) CPL_STATIC_CAST(GUInt16, CPL_LSBINT16PTR(x))
|
||||
|
||||
/** Return a signed Int32 from the 4 bytes ordered in LSB order at address x */
|
||||
#define CPL_LSBSINT32PTR(x) ((GInt32) CPL_LSBINT32PTR(x))
|
||||
#define CPL_LSBSINT32PTR(x) CPL_STATIC_CAST(GInt32, CPL_LSBINT32PTR(x))
|
||||
|
||||
/** Return a unsigned Int32 from the 4 bytes ordered in LSB order at address x */
|
||||
#define CPL_LSBUINT32PTR(x) ((GUInt32)CPL_LSBINT32PTR(x))
|
||||
#define CPL_LSBUINT32PTR(x) CPL_STATIC_CAST(GUInt32, CPL_LSBINT32PTR(x))
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/* Utility macro to explicitly mark intentionally unreferenced parameters. */
|
||||
@@ -968,27 +906,20 @@ static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); }
|
||||
#define CPL_SCAN_FUNC_FORMAT( format_idx, arg_idx )
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400 && (defined(GDAL_COMPILATION) || defined(CPL_ENABLE_MSVC_ANNOTATIONS))
|
||||
#if defined(_MSC_VER) && (defined(GDAL_COMPILATION) || defined(CPL_ENABLE_MSVC_ANNOTATIONS))
|
||||
#include <sal.h>
|
||||
# if _MSC_VER > 1400
|
||||
/** Macro into which to wrap the format argument of a printf-like function.
|
||||
* Only used if ANALYZE=1 is specified to nmake */
|
||||
# define CPL_FORMAT_STRING(arg) _Printf_format_string_ arg
|
||||
/** Macro into which to wrap the format argument of a sscanf-like function.
|
||||
* Only used if ANALYZE=1 is specified to nmake */
|
||||
# define CPL_SCANF_FORMAT_STRING(arg) _Scanf_format_string_ arg
|
||||
# else
|
||||
/** Macro into which to wrap the format argument of a printf-like function */
|
||||
# define CPL_FORMAT_STRING(arg) __format_string arg
|
||||
/** Macro into which to wrap the format argument of a sscanf-like function. */
|
||||
# define CPL_SCANF_FORMAT_STRING(arg) arg
|
||||
# endif
|
||||
#else
|
||||
/** Macro into which to wrap the format argument of a printf-like function */
|
||||
# define CPL_FORMAT_STRING(arg) arg
|
||||
/** Macro into which to wrap the format argument of a sscanf-like function. */
|
||||
# define CPL_SCANF_FORMAT_STRING(arg) arg
|
||||
#endif /* defined(_MSC_VER) && _MSC_VER >= 1400 && defined(GDAL_COMPILATION) */
|
||||
#endif /* defined(_MSC_VER) && defined(GDAL_COMPILATION) */
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP)
|
||||
/** Qualifier to warn when the return value of a function is not used */
|
||||
@@ -1039,28 +970,12 @@ static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); }
|
||||
#define CPL_RESTRICT
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#if HAVE_CXX11 || _MSC_VER >= 1500
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
/** To be used in public headers only. For non-public headers or .cpp files,
|
||||
* use override directly. */
|
||||
# define CPL_OVERRIDE override
|
||||
|
||||
#else
|
||||
|
||||
/** To be used in public headers only. For non-public headers or .cpp files,
|
||||
* use override directly. */
|
||||
# define CPL_OVERRIDE
|
||||
|
||||
/* For GDAL source compilation only, ignore override if non C++11 compiler */
|
||||
#ifdef GDAL_COMPILATION
|
||||
# define override
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_CXX11 || _MSC_VER >= 1500 */
|
||||
|
||||
#if HAVE_CXX11
|
||||
/** C++11 final qualifier */
|
||||
# define CPL_FINAL final
|
||||
|
||||
@@ -1072,19 +987,6 @@ static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); }
|
||||
# define CPL_DISALLOW_COPY_ASSIGN(ClassName) \
|
||||
ClassName( const ClassName & ) = delete; \
|
||||
ClassName &operator=( const ClassName & ) = delete;
|
||||
#else
|
||||
/** C++11 final qualifier */
|
||||
# define CPL_FINAL
|
||||
|
||||
/** Helper to remove the copy and assignment constructors so that the compiler
|
||||
will not generate the default versions.
|
||||
|
||||
Must be placed in the private section of a class and should be at the end.
|
||||
*/
|
||||
# define CPL_DISALLOW_COPY_ASSIGN(ClassName) \
|
||||
ClassName( const ClassName & ); \
|
||||
ClassName &operator=( const ClassName & );
|
||||
#endif /* HAVE_CXX11 */
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -1128,7 +1030,7 @@ CPL_C_END
|
||||
/*! @endcond */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
/** Returns the size of C style arrays. */
|
||||
#define CPL_ARRAYSIZE(array) \
|
||||
((sizeof(array) / sizeof(*(array))) / \
|
||||
@@ -1149,7 +1051,7 @@ inline static bool CPL_TO_BOOL(int x) { return x != 0; }
|
||||
#define HAVE_GCC_SYSTEM_HEADER
|
||||
#endif
|
||||
|
||||
#if ((defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7))) || __GNUC__ >= 7) && HAVE_CXX11
|
||||
#if ((defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7))) || __GNUC__ >= 7)
|
||||
/** Macro for fallthrough in a switch case construct */
|
||||
# define CPL_FALLTHROUGH [[clang::fallthrough]];
|
||||
#else
|
||||
@@ -1162,7 +1064,7 @@ inline static bool CPL_TO_BOOL(int x) { return x != 0; }
|
||||
// a integer is assigned to a bool
|
||||
// WARNING: use only at compilation time, since it is know to not work
|
||||
// at runtime for unknown reasons (crash in MongoDB driver for example)
|
||||
#if defined(__cplusplus) && defined(DEBUG_BOOL) && !defined(DO_NOT_USE_DEBUG_BOOL)
|
||||
#if defined(__cplusplus) && defined(DEBUG_BOOL) && !defined(DO_NOT_USE_DEBUG_BOOL) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
extern "C++" {
|
||||
class MSVCPedanticBool
|
||||
{
|
||||
@@ -1186,12 +1088,15 @@ class MSVCPedanticBool
|
||||
|
||||
bool operator== (const bool& other) const { return b == other; }
|
||||
bool operator!= (const bool& other) const { return b != other; }
|
||||
bool operator< (const bool& other) const { return b < other; }
|
||||
bool operator== (const MSVCPedanticBool& other) const { return b == other.b; }
|
||||
bool operator!= (const MSVCPedanticBool& other) const { return b != other.b; }
|
||||
bool operator< (const MSVCPedanticBool& other) const { return b < other.b; }
|
||||
|
||||
bool operator! () const { return !b; }
|
||||
operator bool() const { return b; }
|
||||
operator int() const { return b; }
|
||||
operator GIntBig() const { return b; }
|
||||
};
|
||||
|
||||
inline bool operator== (const bool& one, const MSVCPedanticBool& other) { return one == other.b; }
|
||||
@@ -1207,6 +1112,15 @@ inline bool operator!= (const bool& one, const MSVCPedanticBool& other) { return
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
#include <thread>
|
||||
#include <unordered_set>
|
||||
#include <complex>
|
||||
#include <iomanip>
|
||||
|
||||
} /* extern C++ */
|
||||
|
||||
@@ -1239,6 +1153,35 @@ inline bool operator!= (const bool& one, const MSVCPedanticBool& other) { return
|
||||
#define VOLATILE_BOOL volatile bool
|
||||
|
||||
#endif /* defined(__cplusplus) && defined(DEBUG_BOOL) */
|
||||
|
||||
#if __clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 8)
|
||||
#define CPL_NOSANITIZE_UNSIGNED_INT_OVERFLOW __attribute__((no_sanitize("unsigned-integer-overflow")))
|
||||
#else
|
||||
#define CPL_NOSANITIZE_UNSIGNED_INT_OVERFLOW
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
#define CPL_NULLPTR nullptr
|
||||
#else
|
||||
#define CPL_NULLPTR NULL
|
||||
#endif
|
||||
/*! @endcond */
|
||||
|
||||
/* This typedef is for C functions that take char** as argument, but */
|
||||
/* with the semantics of a const list. In C, char** is not implicitly cast to */
|
||||
/* const char* const*, contrary to C++. So when seen for C++, it is OK */
|
||||
/* to expose the prototyes as const char* const*, but for C we keep the */
|
||||
/* historical definition to avoid warnings. */
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) && !defined(DOXYGEN_SKIP)
|
||||
/** Type of a constant null-terminated list of nul terminated strings.
|
||||
* Seen as char** from C and const char* const* from C++ */
|
||||
typedef const char* const* CSLConstList;
|
||||
#else
|
||||
/** Type of a constant null-terminated list of nul terminated strings.
|
||||
* Seen as char** from C and const char* const* from C++ */
|
||||
typedef char** CSLConstList;
|
||||
#endif
|
||||
|
||||
#endif /* ndef CPL_BASE_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_progress.h 34518 2016-07-02 21:01:34Z goatbar $
|
||||
* $Id: cpl_progress.h bc89bc87f0d97aea76ed8642d92f686ce256f7c0 2013-01-25 17:55:47Z Frank Warmerdam $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_quad_tree.h 34931 2016-08-05 17:13:05Z rouault $
|
||||
* $Id: cpl_quad_tree.h fcf615cbf6b2e03db17171af0ebba6da4b4a562d 2016-08-05 17:13:05Z Even Rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Implementation of quadtree building and searching functions.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: cpl_sha256.h 34921 2016-08-04 22:26:31Z rouault $ */
|
||||
/* $Id: cpl_sha256.h 4066b56114dce5dd680e28b43526396ce43a6d7e 2018-02-14 12:47:28Z Even Rouault $ */
|
||||
|
||||
/* The MIT License
|
||||
|
||||
@@ -65,6 +65,12 @@ void CPL_DLL CPL_HMAC_SHA256(const void *pKey, size_t nKeyLen,
|
||||
const void *pabyMessage, size_t nMessageLen,
|
||||
GByte abyDigest[CPL_SHA256_HASH_SIZE]);
|
||||
|
||||
// Not exported for now
|
||||
GByte* CPL_RSA_SHA256_Sign(const char* pszPrivateKey,
|
||||
const void* pabyData,
|
||||
unsigned int nDataLen,
|
||||
unsigned int* pnSignatureLen);
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_spawn.h 31287 2015-11-01 18:29:27Z goatbar $
|
||||
* $Id: cpl_spawn.h f5361e0be8e2ae819dde996e6c6aa5985b8fefec 2018-04-02 15:11:21 +0200 Even Rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Implement CPLSystem().
|
||||
@@ -44,7 +44,7 @@ int CPL_DLL CPLSpawn( const char * const papszArgv[], VSILFILE* fin, VSILFILE* f
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
typedef HANDLE CPL_FILE_HANDLE;
|
||||
#define CPL_FILE_INVALID_HANDLE NULL
|
||||
#define CPL_FILE_INVALID_HANDLE CPL_NULLPTR
|
||||
typedef DWORD CPL_PID;
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_string.h 38064 2017-04-19 08:58:09Z rouault $
|
||||
* $Id: cpl_string.h 2a269ed2b136bd254b213f39846587c1eb237662 2018-04-18 23:42:24 +0200 Even Rouault $
|
||||
*
|
||||
* Name: cpl_string.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -64,16 +64,12 @@ char CPL_DLL **CSLAddString(char **papszStrList,
|
||||
const char *pszNewString) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL **CSLAddStringMayFail(
|
||||
char **papszStrList, const char *pszNewString) CPL_WARN_UNUSED_RESULT;
|
||||
#ifdef __cplusplus
|
||||
int CPL_DLL CSLCount(const char * const *papszStrList);
|
||||
#else
|
||||
int CPL_DLL CSLCount(char **papszStrList);
|
||||
#endif
|
||||
const char CPL_DLL *CSLGetField( char **, int );
|
||||
int CPL_DLL CSLCount(CSLConstList papszStrList);
|
||||
const char CPL_DLL *CSLGetField( CSLConstList, int );
|
||||
void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList);
|
||||
char CPL_DLL **CSLDuplicate(char **papszStrList) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL **CSLDuplicate(CSLConstList papszStrList) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL **CSLMerge( char **papszOrig,
|
||||
char **papszOverride ) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszOverride ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
char CPL_DLL **CSLTokenizeString(const char *pszString ) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL **CSLTokenizeStringComplex(
|
||||
@@ -96,44 +92,27 @@ char CPL_DLL **CSLTokenizeString2( const char *pszString,
|
||||
/** Flag for CSLTokenizeString2() to strip trailaing spaces */
|
||||
#define CSLT_STRIPENDSPACES 0x0020
|
||||
|
||||
int CPL_DLL CSLPrint(char **papszStrList, FILE *fpOut);
|
||||
int CPL_DLL CSLPrint(CSLConstList papszStrList, FILE *fpOut);
|
||||
char CPL_DLL **CSLLoad(const char *pszFname) CPL_WARN_UNUSED_RESULT;
|
||||
#ifdef __cplusplus
|
||||
char CPL_DLL **CSLLoad2(
|
||||
const char *pszFname, int nMaxLines, int nMaxCols,
|
||||
const char * const * papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
#else
|
||||
char CPL_DLL **CSLLoad2(
|
||||
const char *pszFname, int nMaxLines, int nMaxCols,
|
||||
char **papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
#endif
|
||||
int CPL_DLL CSLSave(char **papszStrList, const char *pszFname);
|
||||
CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CSLSave(CSLConstList papszStrList, const char *pszFname);
|
||||
|
||||
char CPL_DLL **CSLInsertStrings(char **papszStrList, int nInsertAtLineNo,
|
||||
char **papszNewLines) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszNewLines) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL **CSLInsertString(char **papszStrList, int nInsertAtLineNo,
|
||||
const char *pszNewLine) CPL_WARN_UNUSED_RESULT;
|
||||
char CPL_DLL **CSLRemoveStrings(
|
||||
char **papszStrList, int nFirstLineToDelete,
|
||||
int nNumToRemove, char ***ppapszRetStrings) CPL_WARN_UNUSED_RESULT;
|
||||
#ifdef __cplusplus
|
||||
int CPL_DLL CSLFindString( const char * const *papszList,
|
||||
const char *pszTarget );
|
||||
int CPL_DLL CSLFindStringCaseSensitive( const char * const *papszList,
|
||||
int CPL_DLL CSLFindString( CSLConstList papszList, const char *pszTarget );
|
||||
int CPL_DLL CSLFindStringCaseSensitive( CSLConstList papszList,
|
||||
const char *pszTarget );
|
||||
int CPL_DLL CSLPartialFindString( const char * const *papszHaystack,
|
||||
int CPL_DLL CSLPartialFindString( CSLConstList papszHaystack,
|
||||
const char *pszNeedle );
|
||||
#else
|
||||
// Present non-const to C code that does not like passing non-const to const.
|
||||
// Should be ABI compatible with the const versions.
|
||||
int CPL_DLL CSLFindString( char **papszList, const char *pszTarget );
|
||||
int CPL_DLL CSLFindStringCaseSensitive( char * const *papszList,
|
||||
const char *pszTarget );
|
||||
int CPL_DLL CSLPartialFindString( char * const *papszHaystack,
|
||||
const char *pszNeedle );
|
||||
#endif
|
||||
int CPL_DLL CSLFindName(char **papszStrList, const char *pszName);
|
||||
int CPL_DLL CSLFetchBoolean( char **papszStrList, const char *pszKey,
|
||||
int CPL_DLL CSLFindName(CSLConstList papszStrList, const char *pszName);
|
||||
int CPL_DLL CSLFetchBoolean( CSLConstList papszStrList, const char *pszKey,
|
||||
int bDefault );
|
||||
|
||||
/* TODO: Deprecate CSLTestBoolean. Remove in GDAL 3.x. */
|
||||
@@ -141,7 +120,7 @@ int CPL_DLL CSLTestBoolean( const char *pszValue );
|
||||
/* Do not use CPLTestBoolean in C++ code. Use CPLTestBool. */
|
||||
int CPL_DLL CPLTestBoolean( const char *pszValue );
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
#ifdef DO_NOT_USE_DEBUG_BOOL
|
||||
#define CPLTestBool(x) CPL_TO_BOOL(CPLTestBoolean(x))
|
||||
#define CPLFetchBool(list,key,default) \
|
||||
@@ -152,7 +131,7 @@ int CPL_DLL CPLTestBoolean( const char *pszValue );
|
||||
extern "C++" {
|
||||
#endif
|
||||
bool CPL_DLL CPLTestBool( const char *pszValue );
|
||||
bool CPL_DLL CPLFetchBool( const char * const *papszStrList, const char *pszKey,
|
||||
bool CPL_DLL CPLFetchBool( CSLConstList papszStrList, const char *pszKey,
|
||||
bool bDefault );
|
||||
#ifdef DEBUG_BOOL
|
||||
}
|
||||
@@ -163,24 +142,14 @@ bool CPL_DLL CPLFetchBool( const char * const *papszStrList, const char *pszKey,
|
||||
const char CPL_DLL *
|
||||
CPLParseNameValue( const char *pszNameValue, char **ppszKey );
|
||||
|
||||
#ifdef __cplusplus
|
||||
const char CPL_DLL *
|
||||
CSLFetchNameValue( const char * const *papszStrList, const char *pszName);
|
||||
CSLFetchNameValue( CSLConstList papszStrList, const char *pszName);
|
||||
const char CPL_DLL *
|
||||
CSLFetchNameValueDef( const char * const *papszStrList,
|
||||
CSLFetchNameValueDef( CSLConstList papszStrList,
|
||||
const char *pszName,
|
||||
const char *pszDefault );
|
||||
#else
|
||||
const char CPL_DLL *
|
||||
CSLFetchNameValue( char **papszStrList, const char *pszName);
|
||||
const char CPL_DLL *
|
||||
CSLFetchNameValueDef( char **papszStrList,
|
||||
const char *pszName,
|
||||
const char *pszDefault );
|
||||
#endif
|
||||
|
||||
char CPL_DLL **
|
||||
CSLFetchNameValueMultiple(char **papszStrList, const char *pszName);
|
||||
CSLFetchNameValueMultiple(CSLConstList papszStrList, const char *pszName);
|
||||
char CPL_DLL **
|
||||
CSLAddNameValue(char **papszStrList,
|
||||
const char *pszName,
|
||||
@@ -206,6 +175,8 @@ char CPL_DLL ** CSLParseCommandLine(const char* pszCommandLine);
|
||||
#define CPLES_CSV 4
|
||||
/** Scheme for CPLEscapeString()/CPLUnescapeString() for XML (preserves quotes) */
|
||||
#define CPLES_XML_BUT_QUOTES 5
|
||||
/** Scheme for CPLEscapeString()/CPLUnescapeString() for CSV (forced quoting) */
|
||||
#define CPLES_CSV_FORCE_QUOTING 6
|
||||
|
||||
char CPL_DLL *CPLEscapeString( const char *pszString, int nLength,
|
||||
int nScheme ) CPL_WARN_UNUSED_RESULT;
|
||||
@@ -219,7 +190,7 @@ GByte CPL_DLL *CPLHexToBinary( const char *pszHex,
|
||||
|
||||
char CPL_DLL *CPLBase64Encode( int nBytes,
|
||||
const GByte *pabyData ) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CPLBase64DecodeInPlace( GByte* pszBase64 );
|
||||
int CPL_DLL CPLBase64DecodeInPlace( GByte* pszBase64 ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/** Type of value */
|
||||
typedef enum
|
||||
@@ -319,7 +290,6 @@ char CPL_DLL *CPLForceToASCII(
|
||||
const char* pabyData, int nLen,
|
||||
char chReplacementChar ) CPL_WARN_UNUSED_RESULT;
|
||||
int CPL_DLL CPLStrlenUTF8( const char *pszUTF8Str );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
/************************************************************************/
|
||||
@@ -334,21 +304,51 @@ extern "C++"
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
// VC++ implicitly applies __declspec(dllexport) to template base
|
||||
// classes of classes marked with __declspec(dllexport).
|
||||
// Hence, VC++ would export symbols for the specialization of std::basic_string<char>,
|
||||
// since it is a base class of CPLString, which is marked with CPL_DLL.
|
||||
// As a result, if an application linked both gdal.dll and a static library that
|
||||
// (implicitly) instantiates std::string (almost all do!), then the linker would
|
||||
// emit an error concerning duplicate symbols for std::string.
|
||||
// The least intrusive solution is to turn CPLString into a template class
|
||||
// (that is not marked with CPL_DLL), make CPLString a typedef for a specialization
|
||||
// of that template class, and mark only the few non-inline member functions of
|
||||
// CPLStringT with CPL_DLL.
|
||||
#ifdef _MSC_VER
|
||||
|
||||
# define CPLSTRING_DLL CPL_DLL
|
||||
|
||||
template< class Dummy = void > class CPLStringT;
|
||||
typedef CPLStringT<> CPLString;
|
||||
|
||||
template< class Dummy >
|
||||
class CPLStringT : public std::string
|
||||
|
||||
#else
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
# define CPLSTRING_DLL
|
||||
# define CPLStringT CPLString
|
||||
/*! @endcond */
|
||||
|
||||
//! Convenient string class based on std::string.
|
||||
class CPL_DLL CPLString : public std::string
|
||||
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
|
||||
/** Constructor */
|
||||
CPLString(void) {}
|
||||
CPLStringT(void) {}
|
||||
/** Constructor */
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
CPLString( const std::string &oStr ) : std::string( oStr ) {}
|
||||
CPLStringT( const std::string &oStr ) : std::string( oStr ) {}
|
||||
/** Constructor */
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
CPLString( const char *pszStr ) : std::string( pszStr ) {}
|
||||
CPLStringT( const char *pszStr ) : std::string( pszStr ) {}
|
||||
/** Constructor */
|
||||
CPLString( const char *pszStr, size_t n ) : std::string( pszStr, n ) {}
|
||||
CPLStringT( const char *pszStr, size_t n ) : std::string( pszStr, n ) {}
|
||||
|
||||
/** Return string as zero terminated character array */
|
||||
operator const char* (void) const { return c_str(); }
|
||||
@@ -379,14 +379,6 @@ public:
|
||||
static_cast<std::string::size_type>(i));
|
||||
}
|
||||
|
||||
// Note: This is standard in C++11.
|
||||
#ifndef HAVE_CXX11
|
||||
/** Return last character (undefined behaviour if string is empty) */
|
||||
const char& back() const { return operator[](size()-1); }
|
||||
/** Return last character (undefined behaviour if string is empty) */
|
||||
char& back() { return operator[](size()-1); }
|
||||
#endif
|
||||
|
||||
/** Clear the string */
|
||||
void Clear() { resize(0); }
|
||||
|
||||
@@ -395,7 +387,7 @@ public:
|
||||
* string. */
|
||||
void Seize( char *pszValue )
|
||||
{
|
||||
if (pszValue == NULL )
|
||||
if (pszValue == nullptr )
|
||||
Clear();
|
||||
else
|
||||
{
|
||||
@@ -406,28 +398,34 @@ public:
|
||||
|
||||
/* There seems to be a bug in the way the compiler count indices...
|
||||
* Should be CPL_PRINT_FUNC_FORMAT (1, 2) */
|
||||
CPLString &Printf(
|
||||
CPLSTRING_DLL CPLString &Printf(
|
||||
CPL_FORMAT_STRING(const char *pszFormat), ... )
|
||||
CPL_PRINT_FUNC_FORMAT (2, 3);
|
||||
CPLString &vPrintf(
|
||||
CPLSTRING_DLL CPLString &vPrintf(
|
||||
CPL_FORMAT_STRING(const char *pszFormat), va_list args )
|
||||
CPL_PRINT_FUNC_FORMAT(2, 0);
|
||||
CPLString &FormatC( double dfValue, const char *pszFormat = NULL );
|
||||
CPLString &Trim();
|
||||
CPLString &Recode( const char *pszSrcEncoding, const char *pszDstEncoding );
|
||||
CPLString &replaceAll(
|
||||
CPLSTRING_DLL CPLString &FormatC( double dfValue, const char *pszFormat = nullptr );
|
||||
CPLSTRING_DLL CPLString &Trim();
|
||||
CPLSTRING_DLL CPLString &Recode( const char *pszSrcEncoding, const char *pszDstEncoding );
|
||||
CPLSTRING_DLL CPLString &replaceAll(
|
||||
const std::string &osBefore, const std::string& osAfter );
|
||||
CPLString &replaceAll( const std::string &osBefore, char chAfter );
|
||||
CPLString &replaceAll( char chBefore, const std::string &osAfter );
|
||||
CPLString &replaceAll( char chBefore, char chAfter );
|
||||
CPLSTRING_DLL CPLString &replaceAll( const std::string &osBefore, char chAfter );
|
||||
CPLSTRING_DLL CPLString &replaceAll( char chBefore, const std::string &osAfter );
|
||||
CPLSTRING_DLL CPLString &replaceAll( char chBefore, char chAfter );
|
||||
|
||||
/* case insensitive find alternates */
|
||||
size_t ifind( const std::string & str, size_t pos = 0 ) const;
|
||||
size_t ifind( const char * s, size_t pos = 0 ) const;
|
||||
CPLString &toupper( void );
|
||||
CPLString &tolower( void );
|
||||
CPLSTRING_DLL size_t ifind( const std::string & str, size_t pos = 0 ) const;
|
||||
CPLSTRING_DLL size_t ifind( const char * s, size_t pos = 0 ) const;
|
||||
CPLSTRING_DLL CPLString &toupper( void );
|
||||
CPLSTRING_DLL CPLString &tolower( void );
|
||||
|
||||
CPLSTRING_DLL bool endsWith( const std::string& osStr ) const;
|
||||
};
|
||||
|
||||
#ifndef _MSC_VER
|
||||
# undef CPLStringT
|
||||
#endif
|
||||
|
||||
CPLString CPL_DLL CPLOPrintf(CPL_FORMAT_STRING(const char *pszFormat), ... )
|
||||
CPL_PRINT_FUNC_FORMAT (1, 2);
|
||||
CPLString CPL_DLL CPLOvPrintf(
|
||||
@@ -462,6 +460,8 @@ class CPL_DLL CPLStringList
|
||||
public:
|
||||
CPLStringList();
|
||||
CPLStringList( char **papszList, int bTakeOwnership=TRUE );
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
CPLStringList( CSLConstList papszList );
|
||||
CPLStringList( const CPLStringList& oOther );
|
||||
~CPLStringList();
|
||||
|
||||
@@ -507,6 +507,8 @@ class CPL_DLL CPLStringList
|
||||
return Assign( papszListIn, TRUE ); }
|
||||
/** Assignment operator */
|
||||
CPLStringList &operator=(const CPLStringList& oOther);
|
||||
/** Assignment operator */
|
||||
CPLStringList &operator=(CSLConstList papszListIn);
|
||||
|
||||
/** Return string at specified index */
|
||||
char * operator[](int i);
|
||||
@@ -517,9 +519,14 @@ class CPL_DLL CPLStringList
|
||||
/** Return string at specified index */
|
||||
const char * operator[](size_t i) const {
|
||||
return (*this)[static_cast<int>(i)]; }
|
||||
/** Return value corresponding to pszKey, or nullptr */
|
||||
const char * operator[](const char* pszKey) const {
|
||||
return FetchNameValue(pszKey); }
|
||||
|
||||
/** Return list. Ownership remains to the object */
|
||||
char **List() { return papszList; }
|
||||
char** List() { return papszList; }
|
||||
/** Return list. Ownership remains to the object */
|
||||
CSLConstList List() const { return papszList; }
|
||||
char **StealList();
|
||||
|
||||
CPLStringList &Sort();
|
||||
@@ -528,8 +535,26 @@ class CPL_DLL CPLStringList
|
||||
|
||||
/** Return lists */
|
||||
operator char**(void) { return List(); }
|
||||
/** Return lists */
|
||||
operator CSLConstList(void) const { return List(); }
|
||||
};
|
||||
|
||||
#ifdef GDAL_COMPILATION
|
||||
|
||||
#include <memory>
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
struct CSLDestroyReleaser
|
||||
{
|
||||
void operator()(char** papszStr) const { CSLDestroy(papszStr); }
|
||||
};
|
||||
/*! @endcond */
|
||||
|
||||
/** Unique pointer type to use with CSL functions returning a char** */
|
||||
using CSLUniquePtr = std::unique_ptr< char*, CSLDestroyReleaser>;
|
||||
|
||||
#endif
|
||||
|
||||
} // extern "C++"
|
||||
|
||||
#endif /* def __cplusplus && !CPL_SUPRESS_CPLUSPLUS */
|
||||
|
||||
83
modules/globebrowsing/ext/gdal/include/cpl_swift.h
Normal file
83
modules/globebrowsing/ext/gdal/include/cpl_swift.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/**********************************************************************
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: OpenStack Swift Object Storage routines
|
||||
* Author: Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
**********************************************************************
|
||||
* Copyright (c) 2018, Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CPL_SWIFT_INCLUDED_H
|
||||
#define CPL_SWIFT_INCLUDED_H
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include "cpl_http.h"
|
||||
#include "cpl_aws.h"
|
||||
#include <map>
|
||||
|
||||
class VSISwiftHandleHelper final: public IVSIS3LikeHandleHelper
|
||||
{
|
||||
CPLString m_osURL;
|
||||
CPLString m_osStorageURL;
|
||||
CPLString m_osAuthToken;
|
||||
CPLString m_osBucket;
|
||||
CPLString m_osObjectKey;
|
||||
|
||||
static bool GetConfiguration(CPLString& osStorageURL,
|
||||
CPLString& osAuthToken);
|
||||
|
||||
static CPLString BuildURL(const CPLString& osStorageURL,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey);
|
||||
|
||||
void RebuildURL() override;
|
||||
|
||||
public:
|
||||
VSISwiftHandleHelper(const CPLString& osStorageURL,
|
||||
const CPLString& osAuthToken,
|
||||
const CPLString& osBucket,
|
||||
const CPLString& osObjectKey);
|
||||
~VSISwiftHandleHelper();
|
||||
|
||||
static VSISwiftHandleHelper* BuildFromURI(const char* pszURI,
|
||||
const char* pszFSPrefix);
|
||||
|
||||
struct curl_slist* GetCurlHeaders(const CPLString& osVerbosVerb,
|
||||
const struct curl_slist* psExistingHeaders,
|
||||
const void *pabyDataContent = nullptr,
|
||||
size_t nBytesContent = 0) const override;
|
||||
|
||||
const CPLString& GetURL() const override { return m_osURL; }
|
||||
|
||||
static void CleanMutex();
|
||||
static void ClearCache();
|
||||
};
|
||||
|
||||
|
||||
#endif /* HAVE_CURL */
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* CPL_SWIFT_INCLUDED_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_time.h 34518 2016-07-02 21:01:34Z goatbar $
|
||||
* $Id: cpl_time.h 66be9d67448bf852a32b5473508a75f26569a2e1 2017-09-26 18:35:09Z Even Rouault $
|
||||
*
|
||||
* Name: cpl_time.h
|
||||
* Project: CPL - Common Portability Library
|
||||
@@ -38,4 +38,13 @@
|
||||
struct tm CPL_DLL * CPLUnixTimeToYMDHMS(GIntBig unixTime, struct tm* pRet);
|
||||
GIntBig CPL_DLL CPLYMDHMSToUnixTime(const struct tm *brokendowntime);
|
||||
|
||||
int CPL_DLL CPLParseRFC822DateTime( const char* pszRFC822DateTime,
|
||||
int* pnYear,
|
||||
int* pnMonth,
|
||||
int* pnDay,
|
||||
int* pnHour,
|
||||
int* pnMinute,
|
||||
int* pnSecond,
|
||||
int* pnTZFlag,
|
||||
int* pnWeekDay );
|
||||
#endif // CPL_TIME_H_INCLUDED
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_virtualmem.h 36485 2016-11-24 07:54:20Z goatbar $
|
||||
* $Id: cpl_virtualmem.h aa47027b5633ab93caafae35f82f5e53c72ed05c 2016-11-24 07:54:20Z Kurt Schwehr $
|
||||
*
|
||||
* Name: cpl_virtualmem.h
|
||||
* Project: CPL - Common Portability Library
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_vsi.h 37640 2017-03-07 15:20:35Z rouault $
|
||||
* $Id: cpl_vsi.h 07238f4cbcdc1a56c9db7e8dc3a5727346194074 2018-04-02 14:34:13 +0200 Even Rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
@@ -33,6 +33,7 @@
|
||||
#define CPL_VSI_H_INCLUDED
|
||||
|
||||
#include "cpl_port.h"
|
||||
|
||||
/**
|
||||
* \file cpl_vsi.h
|
||||
*
|
||||
@@ -210,6 +211,16 @@ int CPL_DLL VSIIsCaseSensitiveFS( const char * pszFilename );
|
||||
|
||||
int CPL_DLL VSISupportsSparseFiles( const char* pszPath );
|
||||
|
||||
int CPL_DLL VSIHasOptimizedReadMultiRange( const char* pszPath );
|
||||
|
||||
const char CPL_DLL *VSIGetActualURL( const char* pszFilename );
|
||||
|
||||
char CPL_DLL *VSIGetSignedURL( const char* pszFilename, CSLConstList papszOptions );
|
||||
|
||||
const char CPL_DLL *VSIGetFileSystemOptions( const char* pszFilename );
|
||||
|
||||
char CPL_DLL **VSIGetFileSystemsPrefixes( void );
|
||||
|
||||
void CPL_DLL *VSIFGetNativeFileDescriptorL( VSILFILE* );
|
||||
|
||||
/* ==================================================================== */
|
||||
@@ -290,9 +301,11 @@ GIntBig CPL_DLL CPLGetUsablePhysicalRAM(void);
|
||||
char CPL_DLL **VSIReadDir( const char * );
|
||||
char CPL_DLL **VSIReadDirRecursive( const char *pszPath );
|
||||
char CPL_DLL **VSIReadDirEx( const char *pszPath, int nMaxFiles );
|
||||
int CPL_DLL VSIMkdir( const char * pathname, long mode );
|
||||
int CPL_DLL VSIRmdir( const char * pathname );
|
||||
int CPL_DLL VSIUnlink( const char * pathname );
|
||||
int CPL_DLL VSIMkdir( const char * pszPathname, long mode );
|
||||
int CPL_DLL VSIMkdirRecursive( const char * pszPathname, long mode );
|
||||
int CPL_DLL VSIRmdir( const char * pszDirname );
|
||||
int CPL_DLL VSIRmdirRecursive( const char * pszDirname );
|
||||
int CPL_DLL VSIUnlink( const char * pszFilename );
|
||||
int CPL_DLL VSIRename( const char * oldpath, const char * newpath );
|
||||
char CPL_DLL *VSIStrerror( int );
|
||||
GIntBig CPL_DLL VSIGetDiskFreeSpace(const char *pszDirname);
|
||||
@@ -306,11 +319,18 @@ void CPL_DLL VSIInstallLargeFileHandler(void);
|
||||
/*! @endcond */
|
||||
void CPL_DLL VSIInstallSubFileHandler(void);
|
||||
void VSIInstallCurlFileHandler(void);
|
||||
void CPL_DLL VSICurlClearCache(void);
|
||||
void VSIInstallCurlStreamingFileHandler(void);
|
||||
void VSIInstallS3FileHandler(void);
|
||||
void VSIInstallS3StreamingFileHandler(void);
|
||||
void VSIInstallGSFileHandler(void);
|
||||
void VSIInstallGSStreamingFileHandler(void);
|
||||
void VSIInstallAzureFileHandler(void);
|
||||
void VSIInstallAzureStreamingFileHandler(void);
|
||||
void VSIInstallOSSFileHandler(void);
|
||||
void VSIInstallOSSStreamingFileHandler(void);
|
||||
void VSIInstallSwiftFileHandler(void);
|
||||
void VSIInstallSwiftStreamingFileHandler(void);
|
||||
void VSIInstallGZipFileHandler(void); /* No reason to export that */
|
||||
void VSIInstallZipFileHandler(void); /* No reason to export that */
|
||||
void VSIInstallStdinHandler(void); /* No reason to export that */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_vsi_error.h 36769 2016-12-10 01:44:43Z goatbar $
|
||||
* $Id: cpl_vsi_error.h 1515758e53dd91f1c7f21f1e075e0c88e0e17fea 2016-12-10 01:44:43Z Kurt Schwehr $
|
||||
*
|
||||
* Project: VSI Virtual File System
|
||||
* Purpose: Implement an error system for reporting file system errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_vsi_virtual.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
* $Id: cpl_vsi_virtual.h 07238f4cbcdc1a56c9db7e8dc3a5727346194074 2018-04-02 14:34:13 +0200 Even Rouault $
|
||||
*
|
||||
* Project: VSI Virtual File System
|
||||
* Purpose: Declarations for classes related to the virtual filesystem.
|
||||
@@ -67,7 +67,7 @@ class CPL_DLL VSIVirtualHandle {
|
||||
virtual int Close() = 0;
|
||||
// Base implementation that only supports file extension.
|
||||
virtual int Truncate( vsi_l_offset nNewSize );
|
||||
virtual void *GetNativeFileDescriptor() { return NULL; }
|
||||
virtual void *GetNativeFileDescriptor() { return nullptr; }
|
||||
virtual VSIRangeStatus GetRangeStatus( CPL_UNUSED vsi_l_offset nOffset,
|
||||
CPL_UNUSED vsi_l_offset nLength )
|
||||
{ return VSI_RANGE_STATUS_UNKNOWN; }
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
virtual int Rmdir( const char *pszDirname )
|
||||
{ (void) pszDirname; errno=ENOENT; return -1; }
|
||||
virtual char **ReadDir( const char *pszDirname )
|
||||
{ (void) pszDirname; return NULL; }
|
||||
{ (void) pszDirname; return nullptr; }
|
||||
virtual char **ReadDirEx( const char *pszDirname, int /* nMaxFiles */ )
|
||||
{ return ReadDir(pszDirname); }
|
||||
virtual int Rename( const char *oldpath, const char *newpath )
|
||||
@@ -109,6 +109,10 @@ public:
|
||||
{ (void) pszFilename; return TRUE; }
|
||||
virtual GIntBig GetDiskFreeSpace( const char* /* pszDirname */ ) { return -1; }
|
||||
virtual int SupportsSparseFiles( const char* /* pszPath */ ) { return FALSE; }
|
||||
virtual int HasOptimizedReadMultiRange(const char* /* pszPath */) { return FALSE; }
|
||||
virtual const char* GetActualURL(const char* /*pszFilename*/) { return nullptr; }
|
||||
virtual const char* GetOptions() { return nullptr; }
|
||||
virtual char* GetSignedURL(const char* /*pszFilename*/, CSLConstList /* papszOptions */) { return nullptr; }
|
||||
};
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
@@ -135,6 +139,8 @@ public:
|
||||
VSIFilesystemHandler * );
|
||||
/* RemoveHandler is never defined. */
|
||||
/* static void RemoveHandler( const std::string& osPrefix ); */
|
||||
|
||||
static char** GetPrefixes();
|
||||
};
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
@@ -169,7 +175,7 @@ public:
|
||||
int nEntries;
|
||||
VSIArchiveEntry* entries;
|
||||
|
||||
VSIArchiveContent() : mTime(0), nFileSize(0), nEntries(0), entries(NULL) {}
|
||||
VSIArchiveContent() : mTime(0), nFileSize(0), nEntries(0), entries(nullptr) {}
|
||||
~VSIArchiveContent();
|
||||
};
|
||||
|
||||
@@ -204,14 +210,15 @@ public:
|
||||
VSIArchiveFilesystemHandler();
|
||||
virtual ~VSIArchiveFilesystemHandler();
|
||||
|
||||
virtual int Stat( const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags ) CPL_OVERRIDE;
|
||||
virtual int Unlink( const char *pszFilename ) CPL_OVERRIDE;
|
||||
virtual int Rename( const char *oldpath, const char *newpath ) CPL_OVERRIDE;
|
||||
virtual int Mkdir( const char *pszDirname, long nMode ) CPL_OVERRIDE;
|
||||
virtual int Rmdir( const char *pszDirname ) CPL_OVERRIDE;
|
||||
virtual char **ReadDirEx( const char *pszDirname, int nMaxFiles ) CPL_OVERRIDE;
|
||||
int Stat( const char *pszFilename, VSIStatBufL *pStatBuf,
|
||||
int nFlags ) override;
|
||||
int Unlink( const char *pszFilename ) override;
|
||||
int Rename( const char *oldpath, const char *newpath ) override;
|
||||
int Mkdir( const char *pszDirname, long nMode ) override;
|
||||
int Rmdir( const char *pszDirname ) override;
|
||||
char **ReadDirEx( const char *pszDirname, int nMaxFiles ) override;
|
||||
|
||||
virtual const VSIArchiveContent* GetContentOfArchive(const char* archiveFilename, VSIArchiveReader* poReader = NULL);
|
||||
virtual const VSIArchiveContent* GetContentOfArchive(const char* archiveFilename, VSIArchiveReader* poReader = nullptr);
|
||||
virtual char* SplitFilename(const char *pszFilename, CPLString &osFileInArchive, int bCheckMainFileExists);
|
||||
virtual VSIArchiveReader* OpenArchiveFile(const char* archiveFilename, const char* fileInArchiveName);
|
||||
virtual int FindFileInArchive(const char* archiveFilename, const char* fileInArchiveName, const VSIArchiveEntry** archiveEntry);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cpl_vsil_curl_priv.h 36772 2016-12-10 06:29:22Z goatbar $
|
||||
* $Id: cpl_vsil_curl_priv.h 9a2bcee25a010c5fe6c5e8fc258ed46578d043fb 2016-12-10 06:29:22Z Kurt Schwehr $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: Private API for VSICurl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**********************************************************************
|
||||
* $Id: cpl_worker_thread_pool.h 37003 2016-12-23 14:54:07Z goatbar $
|
||||
* $Id: cpl_worker_thread_pool.h 9ff327806cd64df6d73a6c91f92d12ca0c5e07df 2018-04-07 20:25:06 +0200 Even Rouault $
|
||||
*
|
||||
* Project: CPL - Common Portability Library
|
||||
* Purpose: CPL worker thread pool
|
||||
@@ -101,7 +101,7 @@ class CPL_DLL CPLWorkerThreadPool
|
||||
void WaitCompletion(int nMaxRemainingJobs = 0);
|
||||
|
||||
/** Return the number of threads setup */
|
||||
int GetThreadCount() const { return (int)aWT.size(); }
|
||||
int GetThreadCount() const { return static_cast<int>(aWT.size()); }
|
||||
};
|
||||
|
||||
#endif // CPL_WORKER_THREAD_POOL_H_INCLUDED_
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: cplkeywordparser.h 34931 2016-08-05 17:13:05Z rouault $
|
||||
* $Id: cplkeywordparser.h 21e39584409342c2c70c6635a2b0329113de8975 2018-01-06 16:34:40Z Even Rouault $
|
||||
*
|
||||
* Project: Common Portability Library
|
||||
* Purpose: Implementation of CPLKeywordParser - a class for parsing
|
||||
@@ -51,9 +51,9 @@ class CPLKeywordParser
|
||||
const char *pszHeaderNext;
|
||||
|
||||
void SkipWhite();
|
||||
int ReadWord( CPLString &osWord );
|
||||
int ReadPair( CPLString &osName, CPLString &osValue );
|
||||
int ReadGroup( const char *pszPathPrefix );
|
||||
bool ReadWord( CPLString &osWord );
|
||||
bool ReadPair( CPLString &osName, CPLString &osValue );
|
||||
bool ReadGroup( const char *pszPathPrefix, int nRecLevel );
|
||||
|
||||
public:
|
||||
CPLKeywordParser();
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
int Ingest( VSILFILE *fp );
|
||||
|
||||
const char *GetKeyword( const char *pszPath, const char *pszDefault=NULL );
|
||||
const char *GetKeyword( const char *pszPath, const char *pszDefault=nullptr );
|
||||
char **GetAllKeywords() { return papszKeywordList; }
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal.h 37723 2017-03-16 17:07:53Z rouault $
|
||||
* $Id: gdal.h 2a145ae8e090b07cdddea4397fd43a26d2a78591 2018-05-07 20:12:57 +0200 Even Rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: GDAL Core C/Public declarations.
|
||||
@@ -38,6 +38,9 @@
|
||||
*/
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#if defined(GDAL_COMPILATION)
|
||||
#define DO_NOT_DEFINE_GDAL_RELEASE_DATE_AND_GDAL_RELEASE_NAME
|
||||
#endif
|
||||
#include "gdal_version.h"
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_error.h"
|
||||
@@ -61,10 +64,13 @@ typedef enum {
|
||||
/*! Sixteen bit signed integer */ GDT_Int16 = 3,
|
||||
/*! Thirty two bit unsigned integer */ GDT_UInt32 = 4,
|
||||
/*! Thirty two bit signed integer */ GDT_Int32 = 5,
|
||||
/* TODO?(#6879): GDT_UInt64 */
|
||||
/* TODO?(#6879): GDT_Int64 */
|
||||
/*! Thirty two bit floating point */ GDT_Float32 = 6,
|
||||
/*! Sixty four bit floating point */ GDT_Float64 = 7,
|
||||
/*! Complex Int16 */ GDT_CInt16 = 8,
|
||||
/*! Complex Int32 */ GDT_CInt32 = 9,
|
||||
/* TODO?(#6879): GDT_CInt64 */
|
||||
/*! Complex Float32 */ GDT_CFloat32 = 10,
|
||||
/*! Complex Float64 */ GDT_CFloat64 = 11,
|
||||
GDT_TypeCount = 12 /* maximum type # + 1 */
|
||||
@@ -74,11 +80,19 @@ int CPL_DLL CPL_STDCALL GDALGetDataTypeSize( GDALDataType ); // Deprecated.
|
||||
int CPL_DLL CPL_STDCALL GDALGetDataTypeSizeBits( GDALDataType eDataType );
|
||||
int CPL_DLL CPL_STDCALL GDALGetDataTypeSizeBytes( GDALDataType );
|
||||
int CPL_DLL CPL_STDCALL GDALDataTypeIsComplex( GDALDataType );
|
||||
int CPL_DLL CPL_STDCALL GDALDataTypeIsInteger( GDALDataType );
|
||||
int CPL_DLL CPL_STDCALL GDALDataTypeIsFloating( GDALDataType );
|
||||
int CPL_DLL CPL_STDCALL GDALDataTypeIsSigned( GDALDataType );
|
||||
const char CPL_DLL * CPL_STDCALL GDALGetDataTypeName( GDALDataType );
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALGetDataTypeByName( const char * );
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnion( GDALDataType, GDALDataType );
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnionWithValue( GDALDataType eDT, double dValue, int bComplex );
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALFindDataType( int nBits, int bSigned, int bFloating, int bComplex );
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALFindDataTypeForValue( double dValue, int bComplex );
|
||||
double CPL_DLL GDALAdjustValueToDataType( GDALDataType eDT, double dfValue, int* pbClamped, int* pbRounded );
|
||||
GDALDataType CPL_STDCALL GDALGetNonComplexDataType( GDALDataType );
|
||||
GDALDataType CPL_DLL CPL_STDCALL GDALGetNonComplexDataType( GDALDataType );
|
||||
int CPL_DLL CPL_STDCALL GDALDataTypeIsConversionLossy( GDALDataType eTypeFrom,
|
||||
GDALDataType eTypeTo );
|
||||
|
||||
/**
|
||||
* status of the asynchronous stream
|
||||
@@ -168,14 +182,14 @@ typedef struct
|
||||
#define INIT_RASTERIO_EXTRA_ARG(s) \
|
||||
do { (s).nVersion = RASTERIO_EXTRA_ARG_CURRENT_VERSION; \
|
||||
(s).eResampleAlg = GRIORA_NearestNeighbour; \
|
||||
(s).pfnProgress = NULL; \
|
||||
(s).pProgressData = NULL; \
|
||||
(s).pfnProgress = CPL_NULLPTR; \
|
||||
(s).pProgressData = CPL_NULLPTR; \
|
||||
(s).bFloatingPointWindowValidity = FALSE; } while(0)
|
||||
|
||||
/*! Types of color interpretation for raster bands. */
|
||||
typedef enum
|
||||
{
|
||||
GCI_Undefined=0,
|
||||
/*! Undefined */ GCI_Undefined=0,
|
||||
/*! Greyscale */ GCI_GrayIndex=1,
|
||||
/*! Paletted (see associated color table) */ GCI_PaletteIndex=2,
|
||||
/*! Red band of RGBA image */ GCI_RedBand=3,
|
||||
@@ -192,7 +206,7 @@ typedef enum
|
||||
/*! Y Luminance */ GCI_YCbCr_YBand=14,
|
||||
/*! Cb Chroma */ GCI_YCbCr_CbBand=15,
|
||||
/*! Cr Chroma */ GCI_YCbCr_CrBand=16,
|
||||
/*! Max current value */ GCI_Max=16
|
||||
/*! Max current value (equals to GCI_YCbCr_CrBand currently) */ GCI_Max=16
|
||||
} GDALColorInterp;
|
||||
|
||||
const char CPL_DLL *GDALGetColorInterpretationName( GDALColorInterp );
|
||||
@@ -227,7 +241,7 @@ const char CPL_DLL *GDALGetPaletteInterpretationName( GDALPaletteInterp );
|
||||
/* error codes 100 to 299 reserved for GDAL. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#define CPLE_WrongFormat (CPLErrorNum)200
|
||||
#define CPLE_WrongFormat CPL_STATIC_CAST(CPLErrorNum, 200)
|
||||
#endif
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -301,16 +315,35 @@ typedef GIntBig GSpacing;
|
||||
* */
|
||||
#define GDAL_DMD_CREATIONFIELDDATATYPES "DMD_CREATIONFIELDDATATYPES"
|
||||
|
||||
/** List of (space separated) vector field sub-types support by the CreateField() API.
|
||||
* @since GDAL 2.3
|
||||
* */
|
||||
#define GDAL_DMD_CREATIONFIELDDATASUBTYPES "DMD_CREATIONFIELDDATASUBTYPES"
|
||||
|
||||
/** Capability set by a driver that exposes Subdatasets. */
|
||||
#define GDAL_DMD_SUBDATASETS "DMD_SUBDATASETS"
|
||||
|
||||
/** Capability set by a driver that implements the Open() API. */
|
||||
#define GDAL_DCAP_OPEN "DCAP_OPEN"
|
||||
|
||||
/** Capability set by a driver that implements the Create() API. */
|
||||
/** Capability set by a driver that implements the Create() API.
|
||||
*
|
||||
* If GDAL_DCAP_CREATE is set, but GDAL_DCAP_CREATECOPY not, a generic
|
||||
* CreateCopy() implementation is available and will use the Create() API of
|
||||
* the driver.
|
||||
* So to test if some CreateCopy() implementation is available, generic or
|
||||
* specialize, test for both GDAL_DCAP_CREATE and GDAL_DCAP_CREATECOPY.
|
||||
*/
|
||||
#define GDAL_DCAP_CREATE "DCAP_CREATE"
|
||||
|
||||
/** Capability set by a driver that implements the CreateCopy() API. */
|
||||
/** Capability set by a driver that implements the CreateCopy() API.
|
||||
*
|
||||
* If GDAL_DCAP_CREATECOPY is not defined, but GDAL_DCAP_CREATE is set, a generic
|
||||
* CreateCopy() implementation is available and will use the Create() API of
|
||||
* the driver.
|
||||
* So to test if some CreateCopy() implementation is available, generic or
|
||||
* specialize, test for both GDAL_DCAP_CREATE and GDAL_DCAP_CREATECOPY.
|
||||
*/
|
||||
#define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY"
|
||||
|
||||
/** Capability set by a driver that can read/create datasets through the VSI*L API. */
|
||||
@@ -346,17 +379,29 @@ typedef GIntBig GSpacing;
|
||||
*/
|
||||
#define GDAL_DCAP_NOTNULL_GEOMFIELDS "DCAP_NOTNULL_GEOMFIELDS"
|
||||
|
||||
/** Capability set by a non-spatial driver having no support for geometries. E.g. non-spatial
|
||||
* vector drivers (e.g. spreadsheet format drivers) do not support geometries,
|
||||
* and accordingly will have this capability present.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
#define GDAL_DCAP_NONSPATIAL "DCAP_NONSPATIAL"
|
||||
|
||||
/** Capability set by drivers which support feature styles.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
#define GDAL_DCAP_FEATURE_STYLES "DCAP_FEATURE_STYLES"
|
||||
|
||||
void CPL_DLL CPL_STDCALL GDALAllRegister( void );
|
||||
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL GDALCreate( GDALDriverH hDriver,
|
||||
const char *, int, int, int, GDALDataType,
|
||||
char ** ) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList ) CPL_WARN_UNUSED_RESULT;
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL
|
||||
GDALCreateCopy( GDALDriverH, const char *, GDALDatasetH,
|
||||
int, char **, GDALProgressFunc, void * ) CPL_WARN_UNUSED_RESULT;
|
||||
int, CSLConstList, GDALProgressFunc, void * ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
GDALDriverH CPL_DLL CPL_STDCALL GDALIdentifyDriver( const char * pszFilename,
|
||||
char ** papszFileList );
|
||||
CSLConstList papszFileList );
|
||||
|
||||
GDALDriverH CPL_DLL CPL_STDCALL GDALIdentifyDriverEx(
|
||||
const char *pszFilename, unsigned int nIdentifyFlags,
|
||||
@@ -483,6 +528,7 @@ int CPL_DLL CPL_STDCALL GDALDumpOpenDatasets( FILE * );
|
||||
GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriverByName( const char * );
|
||||
int CPL_DLL CPL_STDCALL GDALGetDriverCount( void );
|
||||
GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriver( int );
|
||||
GDALDriverH CPL_DLL CPL_STDCALL GDALCreateDriver( void );
|
||||
void CPL_DLL CPL_STDCALL GDALDestroyDriver( GDALDriverH );
|
||||
int CPL_DLL CPL_STDCALL GDALRegisterDriver( GDALDriverH );
|
||||
void CPL_DLL CPL_STDCALL GDALDeregisterDriver( GDALDriverH );
|
||||
@@ -498,7 +544,7 @@ CPLErr CPL_DLL CPL_STDCALL GDALCopyDatasetFiles( GDALDriverH,
|
||||
const char * pszNewName,
|
||||
const char * pszOldName);
|
||||
int CPL_DLL CPL_STDCALL GDALValidateCreationOptions( GDALDriverH,
|
||||
char** papszCreationOptions);
|
||||
CSLConstList papszCreationOptions);
|
||||
|
||||
/* The following are deprecated */
|
||||
const char CPL_DLL * CPL_STDCALL GDALGetDriverShortName( GDALDriverH );
|
||||
@@ -556,7 +602,7 @@ void CPL_DLL GDALComposeGeoTransforms(const double *padfGeoTransform1,
|
||||
|
||||
char CPL_DLL ** CPL_STDCALL GDALGetMetadataDomainList( GDALMajorObjectH hObject );
|
||||
char CPL_DLL ** CPL_STDCALL GDALGetMetadata( GDALMajorObjectH, const char * );
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALSetMetadata( GDALMajorObjectH, char **,
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALSetMetadata( GDALMajorObjectH, CSLConstList,
|
||||
const char * );
|
||||
const char CPL_DLL * CPL_STDCALL
|
||||
GDALGetMetadataItem( GDALMajorObjectH, const char *, const char * );
|
||||
@@ -582,7 +628,7 @@ int CPL_DLL CPL_STDCALL GDALGetRasterCount( GDALDatasetH );
|
||||
GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetRasterBand( GDALDatasetH, int );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALAddBand( GDALDatasetH hDS, GDALDataType eType,
|
||||
char **papszOptions );
|
||||
CSLConstList papszOptions );
|
||||
|
||||
GDALAsyncReaderH CPL_DLL CPL_STDCALL
|
||||
GDALBeginAsyncReader(GDALDatasetH hDS, int nXOff, int nYOff,
|
||||
@@ -590,7 +636,7 @@ GDALBeginAsyncReader(GDALDatasetH hDS, int nXOff, int nYOff,
|
||||
void *pBuf, int nBufXSize, int nBufYSize,
|
||||
GDALDataType eBufType, int nBandCount, int* panBandMap,
|
||||
int nPixelSpace, int nLineSpace, int nBandSpace,
|
||||
char **papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALEndAsyncReader(GDALDatasetH hDS, GDALAsyncReaderH hAsynchReaderH);
|
||||
@@ -613,7 +659,7 @@ CPLErr CPL_DLL CPL_STDCALL GDALDatasetRasterIOEx(
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALDatasetAdviseRead( GDALDatasetH hDS,
|
||||
int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
|
||||
int nBXSize, int nBYSize, GDALDataType eBDataType,
|
||||
int nBandCount, int *panBandCount, char **papszOptions );
|
||||
int nBandCount, int *panBandCount, CSLConstList papszOptions );
|
||||
|
||||
const char CPL_DLL * CPL_STDCALL GDALGetProjectionRef( GDALDatasetH );
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALSetProjection( GDALDatasetH, const char * );
|
||||
@@ -642,7 +688,7 @@ CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALCreateDatasetMaskBand( GDALDatasetH hDS, int nFlags );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALDatasetCopyWholeRaster(
|
||||
GDALDatasetH hSrcDS, GDALDatasetH hDstDS, char **papszOptions,
|
||||
GDALDatasetH hSrcDS, GDALDatasetH hDstDS, CSLConstList papszOptions,
|
||||
GDALProgressFunc pfnProgress, void *pProgressData ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALRasterBandCopyWholeRaster(
|
||||
@@ -662,9 +708,9 @@ OGRLayerH CPL_DLL GDALDatasetGetLayerByName( GDALDatasetH, const char * );
|
||||
OGRErr CPL_DLL GDALDatasetDeleteLayer( GDALDatasetH, int );
|
||||
OGRLayerH CPL_DLL GDALDatasetCreateLayer( GDALDatasetH, const char *,
|
||||
OGRSpatialReferenceH, OGRwkbGeometryType,
|
||||
char ** );
|
||||
CSLConstList );
|
||||
OGRLayerH CPL_DLL GDALDatasetCopyLayer( GDALDatasetH, OGRLayerH, const char *,
|
||||
char ** );
|
||||
CSLConstList );
|
||||
void CPL_DLL GDALDatasetResetReading( GDALDatasetH );
|
||||
OGRFeatureH CPL_DLL GDALDatasetGetNextFeature( GDALDatasetH hDS,
|
||||
OGRLayerH* phBelongingLayer,
|
||||
@@ -692,27 +738,27 @@ OGRErr CPL_DLL GDALDatasetRollbackTransaction(GDALDatasetH hDS);
|
||||
*/
|
||||
#define SRCVAL(papoSource, eSrcType, ii) \
|
||||
(eSrcType == GDT_Byte ? \
|
||||
((GByte *)papoSource)[ii] : \
|
||||
CPL_REINTERPRET_CAST(const GByte*,papoSource)[ii] : \
|
||||
(eSrcType == GDT_Float32 ? \
|
||||
((float *)papoSource)[ii] : \
|
||||
CPL_REINTERPRET_CAST(const float*,papoSource)[ii] : \
|
||||
(eSrcType == GDT_Float64 ? \
|
||||
((double *)papoSource)[ii] : \
|
||||
CPL_REINTERPRET_CAST(const double*,papoSource)[ii] : \
|
||||
(eSrcType == GDT_Int32 ? \
|
||||
((GInt32 *)papoSource)[ii] : \
|
||||
CPL_REINTERPRET_CAST(const GInt32*,papoSource)[ii] : \
|
||||
(eSrcType == GDT_UInt16 ? \
|
||||
((GUInt16 *)papoSource)[ii] : \
|
||||
CPL_REINTERPRET_CAST(const GUInt16*,papoSource)[ii] : \
|
||||
(eSrcType == GDT_Int16 ? \
|
||||
((GInt16 *)papoSource)[ii] : \
|
||||
CPL_REINTERPRET_CAST(const GInt16*,papoSource)[ii] : \
|
||||
(eSrcType == GDT_UInt32 ? \
|
||||
((GUInt32 *)papoSource)[ii] : \
|
||||
CPL_REINTERPRET_CAST(const GUInt32*,papoSource)[ii] : \
|
||||
(eSrcType == GDT_CInt16 ? \
|
||||
((GInt16 *)papoSource)[ii * 2] : \
|
||||
CPL_REINTERPRET_CAST(const GInt16*,papoSource)[(ii) * 2] : \
|
||||
(eSrcType == GDT_CInt32 ? \
|
||||
((GInt32 *)papoSource)[ii * 2] : \
|
||||
CPL_REINTERPRET_CAST(const GInt32*,papoSource)[(ii) * 2] : \
|
||||
(eSrcType == GDT_CFloat32 ? \
|
||||
((float *)papoSource)[ii * 2] : \
|
||||
CPL_REINTERPRET_CAST(const float*,papoSource)[(ii) * 2] : \
|
||||
(eSrcType == GDT_CFloat64 ? \
|
||||
((double *)papoSource)[ii * 2] : 0)))))))))))
|
||||
CPL_REINTERPRET_CAST(const double*,papoSource)[(ii) * 2] : 0)))))))))))
|
||||
|
||||
/** Type of functions to pass to GDALAddDerivedBandPixelFunc.
|
||||
* @since GDAL 2.2 */
|
||||
@@ -732,7 +778,7 @@ GDALGetActualBlockSize( GDALRasterBandH, int nXBlockOff, int nYBlockOff,
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALRasterAdviseRead( GDALRasterBandH hRB,
|
||||
int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
|
||||
int nBXSize, int nBYSize, GDALDataType eBDataType, char **papszOptions );
|
||||
int nBXSize, int nBYSize, GDALDataType eBDataType, CSLConstList papszOptions );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALRasterIO( GDALRasterBandH hRBand, GDALRWFlag eRWFlag,
|
||||
@@ -766,7 +812,7 @@ double CPL_DLL CPL_STDCALL GDALGetRasterNoDataValue( GDALRasterBandH, int * );
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterNoDataValue( GDALRasterBandH, double );
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALDeleteRasterNoDataValue( GDALRasterBandH );
|
||||
char CPL_DLL ** CPL_STDCALL GDALGetRasterCategoryNames( GDALRasterBandH );
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterCategoryNames( GDALRasterBandH, char ** );
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterCategoryNames( GDALRasterBandH, CSLConstList );
|
||||
double CPL_DLL CPL_STDCALL GDALGetRasterMinimum( GDALRasterBandH, int *pbSuccess );
|
||||
double CPL_DLL CPL_STDCALL GDALGetRasterMaximum( GDALRasterBandH, int *pbSuccess );
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALGetRasterStatistics(
|
||||
@@ -961,7 +1007,7 @@ int CPL_DLL CPL_STDCALL GDALCheckVersion( int nVersionMajor, int nVersionMinor,
|
||||
|
||||
#endif
|
||||
|
||||
/** Strucutre to store Rational Polynomial Coefficients / Rigorous Projection
|
||||
/** Structure to store Rational Polynomial Coefficients / Rigorous Projection
|
||||
* Model. See http://geotiff.maptools.org/rpc_prop.html */
|
||||
typedef struct
|
||||
{
|
||||
@@ -988,7 +1034,7 @@ typedef struct
|
||||
double dfMAX_LAT; /*!< Maximum latitude */
|
||||
} GDALRPCInfo;
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALExtractRPCInfo( char **, GDALRPCInfo * );
|
||||
int CPL_DLL CPL_STDCALL GDALExtractRPCInfo( CSLConstList, GDALRPCInfo * );
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Color tables. */
|
||||
@@ -1053,7 +1099,7 @@ typedef enum {
|
||||
/*! Color Range Green Maximum */ GFU_GreenMax = 15,
|
||||
/*! Color Range Blue Maximum */ GFU_BlueMax = 16,
|
||||
/*! Color Range Alpha Maximum */ GFU_AlphaMax = 17,
|
||||
/*! Maximum GFU value */ GFU_MaxCount
|
||||
/*! Maximum GFU value (equals to GFU_AlphaMax+1 currently) */ GFU_MaxCount
|
||||
} GDALRATFieldUsage;
|
||||
|
||||
GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
|
||||
@@ -1095,7 +1141,7 @@ CPLErr CPL_DLL CPL_STDCALL GDALRATValuesIOAsDouble( GDALRasterAttributeTableH hR
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALRATValuesIOAsInteger( GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag,
|
||||
int iField, int iStartRow, int iLength, int *pnData);
|
||||
CPLErr CPL_DLL CPL_STDCALL GDALRATValuesIOAsString( GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag,
|
||||
int iField, int iStartRow, int iLength, char **papszStrList);
|
||||
int iField, int iStartRow, int iLength, CSLConstList papszStrList);
|
||||
|
||||
void CPL_DLL CPL_STDCALL GDALRATSetRowCount( GDALRasterAttributeTableH,
|
||||
int );
|
||||
@@ -1151,7 +1197,7 @@ CPLVirtualMem CPL_DLL* GDALDatasetGetVirtualMem( GDALDatasetH hDS,
|
||||
size_t nCacheSize,
|
||||
size_t nPageSizeHint,
|
||||
int bSingleThreadUsage,
|
||||
char **papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
CPLVirtualMem CPL_DLL* GDALRasterBandGetVirtualMem( GDALRasterBandH hBand,
|
||||
GDALRWFlag eRWFlag,
|
||||
@@ -1164,13 +1210,13 @@ CPLVirtualMem CPL_DLL* GDALRasterBandGetVirtualMem( GDALRasterBandH hBand,
|
||||
size_t nCacheSize,
|
||||
size_t nPageSizeHint,
|
||||
int bSingleThreadUsage,
|
||||
char **papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
CPLVirtualMem CPL_DLL* GDALGetVirtualMemAuto( GDALRasterBandH hBand,
|
||||
GDALRWFlag eRWFlag,
|
||||
int *pnPixelSpace,
|
||||
GIntBig *pnLineSpace,
|
||||
char **papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/**! Enumeration to describe the tile organization */
|
||||
typedef enum
|
||||
@@ -1193,7 +1239,7 @@ CPLVirtualMem CPL_DLL* GDALDatasetGetTiledVirtualMem( GDALDatasetH hDS,
|
||||
GDALTileOrganization eTileOrganization,
|
||||
size_t nCacheSize,
|
||||
int bSingleThreadUsage,
|
||||
char **papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
CPLVirtualMem CPL_DLL* GDALRasterBandGetTiledVirtualMem( GDALRasterBandH hBand,
|
||||
GDALRWFlag eRWFlag,
|
||||
@@ -1203,7 +1249,7 @@ CPLVirtualMem CPL_DLL* GDALRasterBandGetTiledVirtualMem( GDALRasterBandH hBand,
|
||||
GDALDataType eBufType,
|
||||
size_t nCacheSize,
|
||||
int bSingleThreadUsage,
|
||||
char **papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszOptions ) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
/* ==================================================================== */
|
||||
/* VRTPansharpenedDataset class. */
|
||||
@@ -1219,7 +1265,7 @@ GDALDatasetH CPL_DLL GDALCreatePansharpenedVRT( const char* pszXML,
|
||||
/* ==================================================================== */
|
||||
|
||||
CPLXMLNode CPL_DLL* GDALGetJPEG2000Structure(const char* pszFilename,
|
||||
char** papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
CPL_C_END
|
||||
|
||||
|
||||
633
modules/globebrowsing/ext/gdal/include/gdal_alg.h
Normal file
633
modules/globebrowsing/ext/gdal/include/gdal_alg.h
Normal file
@@ -0,0 +1,633 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_alg.h ecc4064ad058e92440d85c2a83501cc45579c06c 2017-07-24 19:24:22Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL Image Processing Algorithms
|
||||
* Purpose: Prototypes, and definitions for various GDAL based algorithms.
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2001, Frank Warmerdam
|
||||
* Copyright (c) 2008-2012, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDAL_ALG_H_INCLUDED
|
||||
#define GDAL_ALG_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdal_alg.h
|
||||
*
|
||||
* Public (C callable) GDAL algorithm entry points, and definitions.
|
||||
*/
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
#include "gdal.h"
|
||||
#include "cpl_minixml.h"
|
||||
#include "ogr_api.h"
|
||||
#endif
|
||||
|
||||
CPL_C_START
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALComputeMedianCutPCT( GDALRasterBandH hRed,
|
||||
GDALRasterBandH hGreen,
|
||||
GDALRasterBandH hBlue,
|
||||
int (*pfnIncludePixel)(int,int,void*),
|
||||
int nColors,
|
||||
GDALColorTableH hColorTable,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALDitherRGB2PCT( GDALRasterBandH hRed,
|
||||
GDALRasterBandH hGreen,
|
||||
GDALRasterBandH hBlue,
|
||||
GDALRasterBandH hTarget,
|
||||
GDALColorTableH hColorTable,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
int CPL_DLL CPL_STDCALL GDALChecksumImage( GDALRasterBandH hBand,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALComputeProximity( GDALRasterBandH hSrcBand,
|
||||
GDALRasterBandH hProximityBand,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALFillNodata( GDALRasterBandH hTargetBand,
|
||||
GDALRasterBandH hMaskBand,
|
||||
double dfMaxSearchDist,
|
||||
int bDeprecatedOption,
|
||||
int nSmoothingIterations,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALPolygonize( GDALRasterBandH hSrcBand,
|
||||
GDALRasterBandH hMaskBand,
|
||||
OGRLayerH hOutLayer, int iPixValField,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALFPolygonize( GDALRasterBandH hSrcBand,
|
||||
GDALRasterBandH hMaskBand,
|
||||
OGRLayerH hOutLayer, int iPixValField,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALSieveFilter( GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand,
|
||||
GDALRasterBandH hDstBand,
|
||||
int nSizeThreshold, int nConnectedness,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
/*
|
||||
* Warp Related.
|
||||
*/
|
||||
|
||||
typedef int
|
||||
(*GDALTransformerFunc)( void *pTransformerArg,
|
||||
int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
#define GDAL_GTI2_SIGNATURE "GTI2"
|
||||
|
||||
typedef struct {
|
||||
GByte abySignature[4];
|
||||
const char *pszClassName;
|
||||
GDALTransformerFunc pfnTransform;
|
||||
void (*pfnCleanup)( void * pTransformerArg );
|
||||
CPLXMLNode *(*pfnSerialize)( void * pTransformerArg );
|
||||
void* (*pfnCreateSimilar)( void* pTransformerArg, double dfSrcRatioX, double dfSrcRatioY );
|
||||
} GDALTransformerInfo;
|
||||
/*! @endcond */
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void CPL_DLL GDALDestroyTransformer( void *pTransformerArg );
|
||||
int CPL_DLL GDALUseTransformer( void *pTransformerArg,
|
||||
int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z,
|
||||
int *panSuccess );
|
||||
void* GDALCreateSimilarTransformer( void* psTransformerArg, double dfSrcRatioX, double dfSrcRatioY );
|
||||
/*! @endcond */
|
||||
|
||||
/* High level transformer for going from image coordinates on one file
|
||||
to image coordinates on another, potentially doing reprojection,
|
||||
utilizing GCPs or using the geotransform. */
|
||||
|
||||
void CPL_DLL *
|
||||
GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT,
|
||||
GDALDatasetH hDstDS, const char *pszDstWKT,
|
||||
int bGCPUseOK, double dfGCPErrorThreshold,
|
||||
int nOrder );
|
||||
void CPL_DLL *
|
||||
GDALCreateGenImgProjTransformer2( GDALDatasetH hSrcDS, GDALDatasetH hDstDS,
|
||||
char **papszOptions );
|
||||
void CPL_DLL *
|
||||
GDALCreateGenImgProjTransformer3( const char *pszSrcWKT,
|
||||
const double *padfSrcGeoTransform,
|
||||
const char *pszDstWKT,
|
||||
const double *padfDstGeoTransform );
|
||||
void CPL_DLL GDALSetGenImgProjTransformerDstGeoTransform( void *,
|
||||
const double * );
|
||||
void CPL_DLL GDALDestroyGenImgProjTransformer( void * );
|
||||
int CPL_DLL GDALGenImgProjTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
void GDALSetTransformerDstGeoTransform( void *, const double * );
|
||||
void GDALGetTransformerDstGeoTransform( void*, double* );
|
||||
|
||||
/* Geo to geo reprojection transformer. */
|
||||
void CPL_DLL *
|
||||
GDALCreateReprojectionTransformer( const char *pszSrcWKT,
|
||||
const char *pszDstWKT );
|
||||
void CPL_DLL GDALDestroyReprojectionTransformer( void * );
|
||||
int CPL_DLL GDALReprojectionTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/* GCP based transformer ... forward is to georef coordinates */
|
||||
void CPL_DLL *
|
||||
GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
int nReqOrder, int bReversed );
|
||||
|
||||
/* GCP based transformer with refinement of the GCPs ... forward is to georef coordinates */
|
||||
void CPL_DLL *
|
||||
GDALCreateGCPRefineTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
int nReqOrder, int bReversed, double tolerance, int minimumGcps);
|
||||
|
||||
void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg );
|
||||
int CPL_DLL GDALGCPTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/* Thin Plate Spine transformer ... forward is to georef coordinates */
|
||||
|
||||
void CPL_DLL *
|
||||
GDALCreateTPSTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
int bReversed );
|
||||
void CPL_DLL GDALDestroyTPSTransformer( void *pTransformArg );
|
||||
int CPL_DLL GDALTPSTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
char CPL_DLL ** RPCInfoToMD( GDALRPCInfo *psRPCInfo );
|
||||
/*! @endcond */
|
||||
|
||||
/* RPC based transformer ... src is pixel/line/elev, dst is long/lat/elev */
|
||||
|
||||
void CPL_DLL *
|
||||
GDALCreateRPCTransformer( GDALRPCInfo *psRPC, int bReversed,
|
||||
double dfPixErrThreshold,
|
||||
char **papszOptions );
|
||||
void CPL_DLL GDALDestroyRPCTransformer( void *pTransformArg );
|
||||
int CPL_DLL GDALRPCTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/* Geolocation transformer */
|
||||
|
||||
void CPL_DLL *
|
||||
GDALCreateGeoLocTransformer( GDALDatasetH hBaseDS,
|
||||
char **papszGeolocationInfo,
|
||||
int bReversed );
|
||||
void CPL_DLL GDALDestroyGeoLocTransformer( void *pTransformArg );
|
||||
int CPL_DLL GDALGeoLocTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
/* Approximate transformer */
|
||||
void CPL_DLL *
|
||||
GDALCreateApproxTransformer( GDALTransformerFunc pfnRawTransformer,
|
||||
void *pRawTransformerArg, double dfMaxError );
|
||||
void CPL_DLL GDALApproxTransformerOwnsSubtransformer( void *pCBData,
|
||||
int bOwnFlag );
|
||||
void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg );
|
||||
int CPL_DLL GDALApproxTransform(
|
||||
void *pTransformArg, int bDstToSrc, int nPointCount,
|
||||
double *x, double *y, double *z, int *panSuccess );
|
||||
|
||||
int CPL_DLL CPL_STDCALL
|
||||
GDALSimpleImageWarp( GDALDatasetH hSrcDS,
|
||||
GDALDatasetH hDstDS,
|
||||
int nBandCount, int *panBandList,
|
||||
GDALTransformerFunc pfnTransform,
|
||||
void *pTransformArg,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg,
|
||||
char **papszWarpOptions );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALSuggestedWarpOutput( GDALDatasetH hSrcDS,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
double *padfGeoTransformOut,
|
||||
int *pnPixels, int *pnLines );
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALSuggestedWarpOutput2( GDALDatasetH hSrcDS,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
double *padfGeoTransformOut,
|
||||
int *pnPixels, int *pnLines,
|
||||
double *padfExtents,
|
||||
int nOptions );
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
CPLXMLNode CPL_DLL *
|
||||
GDALSerializeTransformer( GDALTransformerFunc pfnFunc, void *pTransformArg );
|
||||
CPLErr CPL_DLL GDALDeserializeTransformer( CPLXMLNode *psTree,
|
||||
GDALTransformerFunc *ppfnFunc,
|
||||
void **ppTransformArg );
|
||||
/*! @endcond */
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALTransformGeolocations( GDALRasterBandH hXBand,
|
||||
GDALRasterBandH hYBand,
|
||||
GDALRasterBandH hZBand,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg,
|
||||
char **papszOptions );
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Contour Line Generation */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
/** Contour writer callback type */
|
||||
typedef CPLErr (*GDALContourWriter)( double dfLevel, int nPoints,
|
||||
double *padfX, double *padfY, void * );
|
||||
|
||||
/** Contour generator opaque type */
|
||||
typedef void *GDALContourGeneratorH;
|
||||
|
||||
GDALContourGeneratorH CPL_DLL
|
||||
GDAL_CG_Create( int nWidth, int nHeight,
|
||||
int bNoDataSet, double dfNoDataValue,
|
||||
double dfContourInterval, double dfContourBase,
|
||||
GDALContourWriter pfnWriter, void *pCBData );
|
||||
CPLErr CPL_DLL GDAL_CG_FeedLine( GDALContourGeneratorH hCG,
|
||||
double *padfScanline );
|
||||
void CPL_DLL GDAL_CG_Destroy( GDALContourGeneratorH hCG );
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
typedef struct
|
||||
{
|
||||
void *hLayer;
|
||||
|
||||
double adfGeoTransform[6];
|
||||
|
||||
int nElevField;
|
||||
int nIDField;
|
||||
int nNextID;
|
||||
} OGRContourWriterInfo;
|
||||
|
||||
CPLErr CPL_DLL
|
||||
OGRContourWriter( double, int, double *, double *, void *pInfo );
|
||||
/*! @endcond */
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALContourGenerate( GDALRasterBandH hBand,
|
||||
double dfContourInterval, double dfContourBase,
|
||||
int nFixedLevelCount, double *padfFixedLevels,
|
||||
int bUseNoData, double dfNoDataValue,
|
||||
void *hLayer, int iIDField, int iElevField,
|
||||
GDALProgressFunc pfnProgress, void *pProgressArg );
|
||||
|
||||
/************************************************************************/
|
||||
/* Rasterizer API - geometries burned into GDAL raster. */
|
||||
/************************************************************************/
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALRasterizeGeometries( GDALDatasetH hDS,
|
||||
int nBandCount, int *panBandList,
|
||||
int nGeomCount, OGRGeometryH *pahGeometries,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
double *padfGeomBurnValue,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
CPLErr CPL_DLL
|
||||
GDALRasterizeLayers( GDALDatasetH hDS,
|
||||
int nBandCount, int *panBandList,
|
||||
int nLayerCount, OGRLayerH *pahLayers,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg,
|
||||
double *padfLayerBurnValues,
|
||||
char **papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALRasterizeLayersBuf( void *pData, int nBufXSize, int nBufYSize,
|
||||
GDALDataType eBufType, int nPixelSpace, int nLineSpace,
|
||||
int nLayerCount, OGRLayerH *pahLayers,
|
||||
const char *pszDstProjection,
|
||||
double *padfDstGeoTransform,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void *pTransformArg, double dfBurnValue,
|
||||
char **papszOptions, GDALProgressFunc pfnProgress,
|
||||
void *pProgressArg );
|
||||
|
||||
/************************************************************************/
|
||||
/* Gridding interface. */
|
||||
/************************************************************************/
|
||||
|
||||
/** Gridding Algorithms */
|
||||
typedef enum {
|
||||
/*! Inverse distance to a power */ GGA_InverseDistanceToAPower = 1,
|
||||
/*! Moving Average */ GGA_MovingAverage = 2,
|
||||
/*! Nearest Neighbor */ GGA_NearestNeighbor = 3,
|
||||
/*! Minimum Value (Data Metric) */ GGA_MetricMinimum = 4,
|
||||
/*! Maximum Value (Data Metric) */ GGA_MetricMaximum = 5,
|
||||
/*! Data Range (Data Metric) */ GGA_MetricRange = 6,
|
||||
/*! Number of Points (Data Metric) */ GGA_MetricCount = 7,
|
||||
/*! Average Distance (Data Metric) */ GGA_MetricAverageDistance = 8,
|
||||
/*! Average Distance Between Data Points (Data Metric) */
|
||||
GGA_MetricAverageDistancePts = 9,
|
||||
/*! Linear interpolation (from Delaunay triangulation. Since GDAL 2.1 */
|
||||
GGA_Linear = 10,
|
||||
/*! Inverse distance to a power with nearest neighbor search for max points */
|
||||
GGA_InverseDistanceToAPowerNearestNeighbor = 11
|
||||
} GDALGridAlgorithm;
|
||||
|
||||
/** Inverse distance to a power method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! Weighting power. */
|
||||
double dfPower;
|
||||
/*! Smoothing parameter. */
|
||||
double dfSmoothing;
|
||||
/*! Reserved for future use. */
|
||||
double dfAnisotropyRatio;
|
||||
/*! Reserved for future use. */
|
||||
double dfAnisotropyAngle;
|
||||
/*! The first radius (X axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius1;
|
||||
/*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius2;
|
||||
/*! Angle of ellipse rotation in degrees.
|
||||
*
|
||||
* Ellipse rotated counter clockwise.
|
||||
*/
|
||||
double dfAngle;
|
||||
/*! Maximum number of data points to use.
|
||||
*
|
||||
* Do not search for more points than this number.
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMaxPoints;
|
||||
/*! Minimum number of data points to use.
|
||||
*
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMinPoints;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridInverseDistanceToAPowerOptions;
|
||||
|
||||
/** Inverse distance to a power, with nearest neighbour search, control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! Weighting power. */
|
||||
double dfPower;
|
||||
/*! The radius of search circle. */
|
||||
double dfRadius;
|
||||
/*! Smoothing parameter. */
|
||||
double dfSmoothing;
|
||||
|
||||
/*! Maximum number of data points to use.
|
||||
*
|
||||
* Do not search for more points than this number.
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMaxPoints;
|
||||
/*! Minimum number of data points to use.
|
||||
*
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMinPoints;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridInverseDistanceToAPowerNearestNeighborOptions;
|
||||
|
||||
/** Moving average method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! The first radius (X axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius1;
|
||||
/*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius2;
|
||||
/*! Angle of ellipse rotation in degrees.
|
||||
*
|
||||
* Ellipse rotated counter clockwise.
|
||||
*/
|
||||
double dfAngle;
|
||||
/*! Minimum number of data points to average.
|
||||
*
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMinPoints;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridMovingAverageOptions;
|
||||
|
||||
/** Nearest neighbor method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! The first radius (X axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius1;
|
||||
/*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius2;
|
||||
/*! Angle of ellipse rotation in degrees.
|
||||
*
|
||||
* Ellipse rotated counter clockwise.
|
||||
*/
|
||||
double dfAngle;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridNearestNeighborOptions;
|
||||
|
||||
/** Data metrics method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! The first radius (X axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius1;
|
||||
/*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
|
||||
double dfRadius2;
|
||||
/*! Angle of ellipse rotation in degrees.
|
||||
*
|
||||
* Ellipse rotated counter clockwise.
|
||||
*/
|
||||
double dfAngle;
|
||||
/*! Minimum number of data points to average.
|
||||
*
|
||||
* If less amount of points found the grid node considered empty and will
|
||||
* be filled with NODATA marker.
|
||||
*/
|
||||
GUInt32 nMinPoints;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridDataMetricsOptions;
|
||||
|
||||
/** Linear method control options */
|
||||
typedef struct
|
||||
{
|
||||
/*! In case the point to be interpolated does not fit into a triangle of
|
||||
* the Delaunay triangulation, use that maximum distance to search a nearest
|
||||
* neighbour, or use nodata otherwise. If set to -1, the search distance is infinite.
|
||||
* If set to 0, nodata value will be always used.
|
||||
*/
|
||||
double dfRadius;
|
||||
/*! No data marker to fill empty points. */
|
||||
double dfNoDataValue;
|
||||
} GDALGridLinearOptions;
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALGridCreate( GDALGridAlgorithm, const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double, double,
|
||||
GUInt32, GUInt32, GDALDataType, void *,
|
||||
GDALProgressFunc, void *);
|
||||
|
||||
/** Grid context opaque type */
|
||||
typedef struct GDALGridContext GDALGridContext;
|
||||
|
||||
GDALGridContext CPL_DLL*
|
||||
GDALGridContextCreate( GDALGridAlgorithm eAlgorithm, const void *poOptions,
|
||||
GUInt32 nPoints,
|
||||
const double *padfX, const double *padfY, const double *padfZ,
|
||||
int bCallerWillKeepPointArraysAlive );
|
||||
|
||||
void CPL_DLL GDALGridContextFree(GDALGridContext* psContext);
|
||||
|
||||
CPLErr CPL_DLL GDALGridContextProcess(GDALGridContext* psContext,
|
||||
double dfXMin, double dfXMax, double dfYMin, double dfYMax,
|
||||
GUInt32 nXSize, GUInt32 nYSize, GDALDataType eType, void *pData,
|
||||
GDALProgressFunc pfnProgress, void *pProgressArg );
|
||||
|
||||
GDAL_GCP CPL_DLL *
|
||||
GDALComputeMatchingPoints( GDALDatasetH hFirstImage,
|
||||
GDALDatasetH hSecondImage,
|
||||
char **papszOptions,
|
||||
int *pnGCPCount );
|
||||
|
||||
/************************************************************************/
|
||||
/* Delaunay triangulation interface. */
|
||||
/************************************************************************/
|
||||
|
||||
/** Triangle fact */
|
||||
typedef struct
|
||||
{
|
||||
int anVertexIdx[3]; /**< index to the padfX/padfY arrays */
|
||||
int anNeighborIdx[3]; /**< index to GDALDelaunayTriangulation.pasFacets, or -1 */
|
||||
/* anNeighborIdx[k] is the triangle to the opposite side */
|
||||
/* of the opposite segment of anVertexIdx[k] */
|
||||
} GDALTriFacet;
|
||||
|
||||
/** Triangle barycentric coefficients.
|
||||
*
|
||||
* Conversion from cartesian (x,y) to barycentric (l1,l2,l3) with :
|
||||
* l1 = dfMul1X * (x - dfCxtX) + dfMul1Y * (y - dfCstY)
|
||||
* l2 = dfMul2X * (x - dfCxtX) + dfMul2Y * (y - dfCstY)
|
||||
* l3 = 1 - l1 - l2
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
double dfMul1X; /**< dfMul1X */
|
||||
double dfMul1Y; /**< dfMul1Y */
|
||||
double dfMul2X; /**< dfMul2X */
|
||||
double dfMul2Y; /**< dfMul2Y */
|
||||
double dfCstX; /**< dfCstX */
|
||||
double dfCstY; /**< dfCstY */
|
||||
} GDALTriBarycentricCoefficients;
|
||||
|
||||
/** Triangulation structure */
|
||||
typedef struct
|
||||
{
|
||||
int nFacets; /**< number of facets */
|
||||
GDALTriFacet *pasFacets; /**< array of nFacets facets */
|
||||
GDALTriBarycentricCoefficients *pasFacetCoefficients; /**< arra of nFacets barycentric coefficients */
|
||||
} GDALTriangulation;
|
||||
|
||||
int CPL_DLL GDALHasTriangulation(void);
|
||||
|
||||
GDALTriangulation CPL_DLL *GDALTriangulationCreateDelaunay(int nPoints,
|
||||
const double* padfX,
|
||||
const double* padfY);
|
||||
int CPL_DLL GDALTriangulationComputeBarycentricCoefficients(
|
||||
GDALTriangulation* psDT,
|
||||
const double* padfX,
|
||||
const double* padfY);
|
||||
int CPL_DLL GDALTriangulationComputeBarycentricCoordinates(
|
||||
const GDALTriangulation* psDT,
|
||||
int nFacetIdx,
|
||||
double dfX,
|
||||
double dfY,
|
||||
double* pdfL1,
|
||||
double* pdfL2,
|
||||
double* pdfL3);
|
||||
int CPL_DLL GDALTriangulationFindFacetBruteForce( const GDALTriangulation* psDT,
|
||||
double dfX,
|
||||
double dfY,
|
||||
int* panOutputFacetIdx );
|
||||
int CPL_DLL GDALTriangulationFindFacetDirected( const GDALTriangulation* psDT,
|
||||
int nFacetIdx,
|
||||
double dfX,
|
||||
double dfY,
|
||||
int* panOutputFacetIdx );
|
||||
void CPL_DLL GDALTriangulationFree(GDALTriangulation* psDT);
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
// GDAL internal use only
|
||||
void GDALTriangulationTerminate(void);
|
||||
/*! @endcond */
|
||||
|
||||
GDALDatasetH CPL_DLL GDALOpenVerticalShiftGrid(
|
||||
const char* pszProj4Geoidgrids,
|
||||
int* pbError );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALApplyVerticalShiftGrid( GDALDatasetH hSrcDataset,
|
||||
GDALDatasetH hGridDataset,
|
||||
int bInverse,
|
||||
double dfSrcUnitToMeter,
|
||||
double dfDstUnitToMeter,
|
||||
const char* const* papszOptions );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* ndef GDAL_ALG_H_INCLUDED */
|
||||
220
modules/globebrowsing/ext/gdal/include/gdal_alg_priv.h
Normal file
220
modules/globebrowsing/ext/gdal/include/gdal_alg_priv.h
Normal file
@@ -0,0 +1,220 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_alg_priv.h e13dcd4dc171dfeed63f912ba06b9374ce4f3bb2 2018-03-18 21:37:41Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL Image Processing Algorithms
|
||||
* Purpose: Prototypes and definitions for various GDAL based algorithms:
|
||||
* private declarations.
|
||||
* Author: Andrey Kiselev, dron@ak4719.spb.edu
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2008, Andrey Kiselev <dron@ak4719.spb.edu>
|
||||
* Copyright (c) 2010-2013, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDAL_ALG_PRIV_H_INCLUDED
|
||||
#define GDAL_ALG_PRIV_H_INCLUDED
|
||||
|
||||
#ifndef DOXYGEN_SKIP
|
||||
|
||||
#include "gdal_alg.h"
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/** Source of the burn value */
|
||||
typedef enum {
|
||||
/*! Use value from padfBurnValue */ GBV_UserBurnValue = 0,
|
||||
/*! Use value from the Z coordinate */ GBV_Z = 1,
|
||||
/*! Use value form the M value */ GBV_M = 2
|
||||
} GDALBurnValueSrc;
|
||||
|
||||
typedef enum {
|
||||
GRMA_Replace = 0,
|
||||
GRMA_Add = 1,
|
||||
} GDALRasterMergeAlg;
|
||||
|
||||
typedef struct {
|
||||
unsigned char * pabyChunkBuf;
|
||||
int nXSize;
|
||||
int nYSize;
|
||||
int nBands;
|
||||
GDALDataType eType;
|
||||
double *padfBurnValue;
|
||||
GDALBurnValueSrc eBurnValueSource;
|
||||
GDALRasterMergeAlg eMergeAlg;
|
||||
} GDALRasterizeInfo;
|
||||
|
||||
typedef enum {
|
||||
GRO_Raster = 0,
|
||||
GRO_Vector = 1,
|
||||
GRO_Auto = 2,
|
||||
} GDALRasterizeOptim;
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* Low level rasterizer API. */
|
||||
/************************************************************************/
|
||||
|
||||
typedef void (*llScanlineFunc)( void *, int, int, int, double );
|
||||
typedef void (*llPointFunc)( void *, int, int, double );
|
||||
|
||||
void GDALdllImagePoint( int nRasterXSize, int nRasterYSize,
|
||||
int nPartCount, int *panPartSize,
|
||||
double *padfX, double *padfY, double *padfVariant,
|
||||
llPointFunc pfnPointFunc, void *pCBData );
|
||||
|
||||
void GDALdllImageLine( int nRasterXSize, int nRasterYSize,
|
||||
int nPartCount, int *panPartSize,
|
||||
double *padfX, double *padfY, double *padfVariant,
|
||||
llPointFunc pfnPointFunc, void *pCBData );
|
||||
|
||||
void GDALdllImageLineAllTouched( int nRasterXSize, int nRasterYSize,
|
||||
int nPartCount, int *panPartSize,
|
||||
double *padfX, double *padfY,
|
||||
double *padfVariant,
|
||||
llPointFunc pfnPointFunc, void *pCBData );
|
||||
|
||||
void GDALdllImageFilledPolygon( int nRasterXSize, int nRasterYSize,
|
||||
int nPartCount, int *panPartSize,
|
||||
double *padfX, double *padfY,
|
||||
double *padfVariant,
|
||||
llScanlineFunc pfnScanlineFunc, void *pCBData );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
/************************************************************************/
|
||||
/* Polygon Enumerator */
|
||||
/************************************************************************/
|
||||
|
||||
#define GP_NODATA_MARKER -51502112
|
||||
|
||||
template<class DataType, class EqualityTest> class GDALRasterPolygonEnumeratorT
|
||||
|
||||
{
|
||||
private:
|
||||
void MergePolygon( int nSrcId, int nDstId );
|
||||
int NewPolygon( DataType nValue );
|
||||
|
||||
public: // these are intended to be readonly.
|
||||
|
||||
GInt32 *panPolyIdMap;
|
||||
DataType *panPolyValue;
|
||||
|
||||
int nNextPolygonId;
|
||||
int nPolyAlloc;
|
||||
|
||||
int nConnectedness;
|
||||
|
||||
public:
|
||||
explicit GDALRasterPolygonEnumeratorT( int nConnectedness=4 );
|
||||
~GDALRasterPolygonEnumeratorT();
|
||||
|
||||
void ProcessLine( DataType *panLastLineVal, DataType *panThisLineVal,
|
||||
GInt32 *panLastLineId, GInt32 *panThisLineId,
|
||||
int nXSize );
|
||||
|
||||
void CompleteMerges();
|
||||
|
||||
void Clear();
|
||||
};
|
||||
|
||||
struct IntEqualityTest
|
||||
{
|
||||
bool operator()(GInt32 a, GInt32 b) const { return a == b; }
|
||||
};
|
||||
|
||||
typedef GDALRasterPolygonEnumeratorT<GInt32, IntEqualityTest> GDALRasterPolygonEnumerator;
|
||||
|
||||
typedef void* (*GDALTransformDeserializeFunc)( CPLXMLNode *psTree );
|
||||
|
||||
void CPL_DLL *GDALRegisterTransformDeserializer(const char* pszTransformName,
|
||||
GDALTransformerFunc pfnTransformerFunc,
|
||||
GDALTransformDeserializeFunc pfnDeserializeFunc);
|
||||
void CPL_DLL GDALUnregisterTransformDeserializer(void* pData);
|
||||
|
||||
void GDALCleanupTransformDeserializerMutex();
|
||||
|
||||
/* Transformer cloning */
|
||||
|
||||
void* GDALCreateTPSTransformerInt( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
int bReversed, char** papszOptions );
|
||||
|
||||
void CPL_DLL * GDALCloneTransformer( void *pTransformerArg );
|
||||
|
||||
/************************************************************************/
|
||||
/* Color table related */
|
||||
/************************************************************************/
|
||||
|
||||
// Definitions exists for T = GUInt32 and T = GUIntBig.
|
||||
template<class T> int
|
||||
GDALComputeMedianCutPCTInternal( GDALRasterBandH hRed,
|
||||
GDALRasterBandH hGreen,
|
||||
GDALRasterBandH hBlue,
|
||||
GByte* pabyRedBand,
|
||||
GByte* pabyGreenBand,
|
||||
GByte* pabyBlueBand,
|
||||
int (*pfnIncludePixel)(int,int,void*),
|
||||
int nColors,
|
||||
int nBits,
|
||||
T* panHistogram,
|
||||
GDALColorTableH hColorTable,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
int GDALDitherRGB2PCTInternal( GDALRasterBandH hRed,
|
||||
GDALRasterBandH hGreen,
|
||||
GDALRasterBandH hBlue,
|
||||
GDALRasterBandH hTarget,
|
||||
GDALColorTableH hColorTable,
|
||||
int nBits,
|
||||
GInt16* pasDynamicColorMap,
|
||||
int bDither,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
|
||||
#define PRIME_FOR_65536 98317
|
||||
|
||||
// See HashHistogram structure in gdalmediancut.cpp and ColorIndex structure in
|
||||
// gdaldither.cpp 6 * sizeof(int) should be the size of the largest of both
|
||||
// structures.
|
||||
#define MEDIAN_CUT_AND_DITHER_BUFFER_SIZE_65536 (6 * sizeof(int) * PRIME_FOR_65536)
|
||||
|
||||
/************************************************************************/
|
||||
/* Float comparison function. */
|
||||
/************************************************************************/
|
||||
|
||||
/**
|
||||
* Units in the Last Place. This specifies how big an error we are willing to
|
||||
* accept in terms of the value of the least significant digit of the floating
|
||||
* point number’s representation. MAX_ULPS can also be interpreted in terms of
|
||||
* how many representable floats we are willing to accept between A and B.
|
||||
*/
|
||||
#define MAX_ULPS 10
|
||||
|
||||
GBool GDALFloatEquals(float A, float B);
|
||||
|
||||
struct FloatEqualityTest
|
||||
{
|
||||
bool operator()(float a, float b) { return GDALFloatEquals(a,b) == TRUE; }
|
||||
};
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* ndef GDAL_ALG_PRIV_H_INCLUDED */
|
||||
@@ -1,240 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Project: GDAL
|
||||
* Purpose: AVX2 emulation with SSE2 + a few SSE4.1 emulation
|
||||
* Author: Even Rouault <even dot rouault at spatialys dot com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDAL_AVX2_EMULATION_H_INCLUDED
|
||||
#define GDAL_AVX2_EMULATION_H_INCLUDED
|
||||
|
||||
#include <emmintrin.h>
|
||||
|
||||
#ifdef __SSE4_1__
|
||||
#include <smmintrin.h>
|
||||
|
||||
#define GDALmm_min_epu16 _mm_min_epu16
|
||||
#define GDALmm_max_epu16 _mm_max_epu16
|
||||
#define GDALmm_mullo_epi32 _mm_mullo_epi32
|
||||
|
||||
#else
|
||||
// Emulation of SSE4.1 _mm_min_epu16 and _mm_max_epu16 with SSE2 only
|
||||
|
||||
static inline __m128i GDALAVX2Emul_mm_cmple_epu16 (__m128i x, __m128i y)
|
||||
{
|
||||
return _mm_cmpeq_epi16(_mm_subs_epu16(x, y), _mm_setzero_si128() );
|
||||
}
|
||||
|
||||
static inline __m128i GDALAVX2Emul_mm_ternary(__m128i mask,
|
||||
__m128i then_reg,
|
||||
__m128i else_reg)
|
||||
{
|
||||
return _mm_or_si128(_mm_and_si128(mask, then_reg),
|
||||
_mm_andnot_si128(mask, else_reg));
|
||||
}
|
||||
|
||||
static inline __m128i GDALmm_min_epu16 (__m128i x, __m128i y)
|
||||
{
|
||||
const __m128i mask = GDALAVX2Emul_mm_cmple_epu16(x, y);
|
||||
return GDALAVX2Emul_mm_ternary(mask, x, y);
|
||||
}
|
||||
|
||||
static inline __m128i GDALmm_max_epu16 (__m128i x, __m128i y)
|
||||
{
|
||||
const __m128i mask = GDALAVX2Emul_mm_cmple_epu16(x, y);
|
||||
return GDALAVX2Emul_mm_ternary(mask, y, x);
|
||||
}
|
||||
|
||||
static inline __m128i GDALmm_mullo_epi32 (__m128i x, __m128i y)
|
||||
{
|
||||
const __m128i mul02 = _mm_shuffle_epi32(_mm_mul_epu32(x, y), 2 << 2);
|
||||
const __m128i mul13 = _mm_shuffle_epi32(_mm_mul_epu32(_mm_srli_si128(x, 4),
|
||||
_mm_srli_si128(y, 4)),
|
||||
2 << 2);
|
||||
return _mm_unpacklo_epi32(mul02, mul13);;
|
||||
}
|
||||
#endif // __SSE4_1__
|
||||
|
||||
|
||||
#ifdef __AVX2__
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
typedef __m256i GDALm256i;
|
||||
|
||||
#define GDALmm256_set1_epi8 _mm256_set1_epi8
|
||||
#define GDALmm256_set1_epi16 _mm256_set1_epi16
|
||||
#define GDALmm256_setzero_si256 _mm256_setzero_si256
|
||||
#define GDALmm256_load_si256 _mm256_load_si256
|
||||
#define GDALmm256_store_si256 _mm256_store_si256
|
||||
#define GDALmm256_storeu_si256 _mm256_storeu_si256
|
||||
#define GDALmm256_cmpeq_epi8 _mm256_cmpeq_epi8
|
||||
#define GDALmm256_sad_epu8 _mm256_sad_epu8
|
||||
#define GDALmm256_add_epi32 _mm256_add_epi32
|
||||
#define GDALmm256_andnot_si256 _mm256_andnot_si256
|
||||
#define GDALmm256_and_si256 _mm256_and_si256
|
||||
#define GDALmm256_or_si256 _mm256_or_si256
|
||||
#define GDALmm256_min_epu8 _mm256_min_epu8
|
||||
#define GDALmm256_max_epu8 _mm256_max_epu8
|
||||
#define GDALmm256_extracti128_si256 _mm256_extracti128_si256
|
||||
#define GDALmm256_cvtepu8_epi16 _mm256_cvtepu8_epi16
|
||||
#define GDALmm256_madd_epi16 _mm256_madd_epi16
|
||||
#define GDALmm256_min_epu16 _mm256_min_epu16
|
||||
#define GDALmm256_max_epu16 _mm256_max_epu16
|
||||
#define GDALmm256_cvtepu16_epi32 _mm256_cvtepu16_epi32
|
||||
#define GDALmm256_cvtepu16_epi64 _mm256_cvtepu16_epi64
|
||||
#define GDALmm256_cvtepu32_epi64 _mm256_cvtepu32_epi64
|
||||
#define GDALmm256_mullo_epi32 _mm256_mullo_epi32
|
||||
#define GDALmm256_add_epi64 _mm256_add_epi64
|
||||
#define GDALmm256_add_epi16 _mm256_add_epi16
|
||||
#define GDALmm256_sub_epi16 _mm256_sub_epi16
|
||||
#define GDALmm256_min_epi16 _mm256_min_epi16
|
||||
#define GDALmm256_max_epi16 _mm256_max_epi16
|
||||
|
||||
#else
|
||||
|
||||
typedef struct
|
||||
{
|
||||
__m128i low;
|
||||
__m128i high;
|
||||
} GDALm256i;
|
||||
|
||||
static inline GDALm256i GDALmm256_set1_epi8(char c)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_set1_epi8(c);
|
||||
reg.high = _mm_set1_epi8(c);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_set1_epi16(short s)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_set1_epi16(s);
|
||||
reg.high = _mm_set1_epi16(s);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_setzero_si256()
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_setzero_si128();
|
||||
reg.high = _mm_setzero_si128();
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_load_si256(GDALm256i const * p)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_load_si128((__m128i const*)p);
|
||||
reg.high = _mm_load_si128((__m128i const*)((char*)p+16));
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline void GDALmm256_store_si256(GDALm256i * p, GDALm256i reg)
|
||||
{
|
||||
_mm_store_si128((__m128i*)p, reg.low);
|
||||
_mm_store_si128((__m128i*)((char*)p+16), reg.high);
|
||||
}
|
||||
|
||||
static inline void GDALmm256_storeu_si256(GDALm256i * p, GDALm256i reg)
|
||||
{
|
||||
_mm_storeu_si128((__m128i*)p, reg.low);
|
||||
_mm_storeu_si128((__m128i*)((char*)p+16), reg.high);
|
||||
}
|
||||
|
||||
#define DEFINE_BINARY_MM256(mm256name, mm128name) \
|
||||
static inline GDALm256i mm256name(GDALm256i r1, GDALm256i r2) \
|
||||
{ \
|
||||
GDALm256i reg; \
|
||||
reg.low = mm128name(r1.low, r2.low); \
|
||||
reg.high = mm128name(r1.high, r2.high); \
|
||||
return reg; \
|
||||
}
|
||||
|
||||
DEFINE_BINARY_MM256(GDALmm256_cmpeq_epi8, _mm_cmpeq_epi8)
|
||||
DEFINE_BINARY_MM256(GDALmm256_sad_epu8, _mm_sad_epu8)
|
||||
DEFINE_BINARY_MM256(GDALmm256_add_epi32, _mm_add_epi32)
|
||||
DEFINE_BINARY_MM256(GDALmm256_andnot_si256, _mm_andnot_si128)
|
||||
DEFINE_BINARY_MM256(GDALmm256_and_si256, _mm_and_si128)
|
||||
DEFINE_BINARY_MM256(GDALmm256_or_si256, _mm_or_si128)
|
||||
DEFINE_BINARY_MM256(GDALmm256_min_epu8, _mm_min_epu8)
|
||||
DEFINE_BINARY_MM256(GDALmm256_max_epu8, _mm_max_epu8)
|
||||
DEFINE_BINARY_MM256(GDALmm256_madd_epi16, _mm_madd_epi16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_min_epu16, GDALmm_min_epu16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_max_epu16, GDALmm_max_epu16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_mullo_epi32, GDALmm_mullo_epi32)
|
||||
DEFINE_BINARY_MM256(GDALmm256_add_epi64, _mm_add_epi64)
|
||||
DEFINE_BINARY_MM256(GDALmm256_add_epi16, _mm_add_epi16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_sub_epi16, _mm_sub_epi16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_min_epi16, _mm_min_epi16)
|
||||
DEFINE_BINARY_MM256(GDALmm256_max_epi16, _mm_max_epi16)
|
||||
|
||||
static inline __m128i GDALmm256_extracti128_si256(GDALm256i reg, int index)
|
||||
{
|
||||
return (index == 0) ? reg.low : reg.high;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_cvtepu8_epi16(__m128i reg128)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_unpacklo_epi8(reg128, _mm_setzero_si128());
|
||||
reg.high = _mm_unpacklo_epi8(_mm_shuffle_epi32(reg128, 2 | (3 << 2)),
|
||||
_mm_setzero_si128());
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_cvtepu16_epi32(__m128i reg128)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_unpacklo_epi16(reg128, _mm_setzero_si128());
|
||||
reg.high = _mm_unpacklo_epi16(_mm_shuffle_epi32(reg128, 2 | (3 << 2)),
|
||||
_mm_setzero_si128());
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_cvtepu16_epi64(__m128i reg128)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_unpacklo_epi32(_mm_unpacklo_epi16(reg128,
|
||||
_mm_setzero_si128()),
|
||||
_mm_setzero_si128());
|
||||
reg.high = _mm_unpacklo_epi32(_mm_unpacklo_epi16(
|
||||
_mm_srli_si128(reg128, 4),
|
||||
_mm_setzero_si128()),
|
||||
_mm_setzero_si128());
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline GDALm256i GDALmm256_cvtepu32_epi64(__m128i reg128)
|
||||
{
|
||||
GDALm256i reg;
|
||||
reg.low = _mm_unpacklo_epi32(reg128, _mm_setzero_si128());
|
||||
reg.high = _mm_unpacklo_epi32(_mm_shuffle_epi32(reg128, 2 | (3 << 2)),
|
||||
_mm_setzero_si128());
|
||||
return reg;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* GDAL_AVX2_EMULATION_H_INCLUDED */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_csv.h 33844 2016-04-01 08:42:13Z rouault $
|
||||
* $Id: gdal_csv.h 8473217f278e7d65d5880d2160aea2231dc47db6 2016-04-01 08:42:13Z Even Rouault $
|
||||
*
|
||||
* Project: Common Portability Library
|
||||
* Purpose: Functions for reading and scanning CSV (comma separated,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_frmts.h 36731 2016-12-07 11:08:07Z rouault $
|
||||
* $Id: gdal_frmts.h cc3abf4797c390d97322b20caac26099104f0b58 2017-12-21 13:19:20Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: Prototypes for all format specific driver initialization.
|
||||
@@ -36,7 +36,6 @@
|
||||
CPL_C_START
|
||||
void CPL_DLL GDALRegister_GTiff(void);
|
||||
void CPL_DLL GDALRegister_GXF(void);
|
||||
void CPL_DLL GDALRegister_OGDI(void);
|
||||
void CPL_DLL GDALRegister_HFA(void);
|
||||
void CPL_DLL GDALRegister_AAIGrid(void);
|
||||
void CPL_DLL GDALRegister_GRASSASCIIGrid(void);
|
||||
@@ -119,6 +118,7 @@ void CPL_DLL GDALRegister_DIPEx(void);
|
||||
void CPL_DLL GDALRegister_ISIS3(void);
|
||||
void CPL_DLL GDALRegister_ISIS2(void);
|
||||
void CPL_DLL GDALRegister_PDS(void);
|
||||
void CPL_DLL GDALRegister_PDS4(void);
|
||||
void CPL_DLL GDALRegister_VICAR(void);
|
||||
void CPL_DLL GDALRegister_IDRISI(void);
|
||||
void CPL_DLL GDALRegister_Terragen(void);
|
||||
@@ -190,6 +190,8 @@ void CPL_DLL GDALRegister_RRASTER(void);
|
||||
void CPL_DLL GDALRegister_Derived(void);
|
||||
void CPL_DLL GDALRegister_JP2Lura(void);
|
||||
void CPL_DLL GDALRegister_PRF(void);
|
||||
void CPL_DLL GDALRegister_NULL(void);
|
||||
void CPL_DLL GDALRegister_RDA(void);
|
||||
CPL_C_END
|
||||
|
||||
#endif /* ndef GDAL_FRMTS_H_INCLUDED */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_mdreader.h 35883 2016-10-24 05:49:15Z goatbar $
|
||||
* $Id: gdal_mdreader.h 7cbc4992fe78542e3ade2da352b283218f4a5ffb 2017-12-19 16:39:24Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: Read metadata (mainly the remote sensing imagery) from files of
|
||||
@@ -66,6 +66,12 @@
|
||||
#define RPC_SAMP_NUM_COEFF "SAMP_NUM_COEFF"
|
||||
#define RPC_SAMP_DEN_COEFF "SAMP_DEN_COEFF"
|
||||
|
||||
/* Optional */
|
||||
#define RPC_MIN_LONG "MIN_LONG"
|
||||
#define RPC_MIN_LAT "MIN_LAT"
|
||||
#define RPC_MAX_LONG "MAX_LONG"
|
||||
#define RPC_MAX_LAT "MAX_LAT"
|
||||
|
||||
/**
|
||||
* Enumerator of metadata readers
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_pam.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
* $Id: gdal_pam.h 773b7550bb86d46bc587f547f5db549566665834 2017-12-18 04:05:13Z Kurt Schwehr $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: Declaration for Peristable Auxiliary Metadata classes.
|
||||
@@ -128,10 +128,10 @@ class CPL_DLL GDALPamDataset : public GDALDataset
|
||||
virtual CPLXMLNode *SerializeToXML( const char *);
|
||||
virtual CPLErr XMLInit( CPLXMLNode *, const char * );
|
||||
|
||||
virtual CPLErr TryLoadXML(char **papszSiblingFiles = NULL);
|
||||
virtual CPLErr TryLoadXML(char **papszSiblingFiles = nullptr);
|
||||
virtual CPLErr TrySaveXML();
|
||||
|
||||
CPLErr TryLoadAux(char **papszSiblingFiles = NULL);
|
||||
CPLErr TryLoadAux(char **papszSiblingFiles = nullptr);
|
||||
CPLErr TrySaveAux();
|
||||
|
||||
virtual const char *BuildPamFilename();
|
||||
@@ -146,41 +146,41 @@ class CPL_DLL GDALPamDataset : public GDALDataset
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
virtual ~GDALPamDataset();
|
||||
~GDALPamDataset() override;
|
||||
|
||||
virtual void FlushCache(void) CPL_OVERRIDE;
|
||||
void FlushCache(void) override;
|
||||
|
||||
virtual const char *GetProjectionRef(void) CPL_OVERRIDE;
|
||||
virtual CPLErr SetProjection( const char * ) CPL_OVERRIDE;
|
||||
const char *GetProjectionRef(void) override;
|
||||
CPLErr SetProjection( const char * ) override;
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
CPLErr GetGeoTransform( double * ) override;
|
||||
CPLErr SetGeoTransform( double * ) override;
|
||||
|
||||
virtual int GetGCPCount() CPL_OVERRIDE;
|
||||
virtual const char *GetGCPProjection() CPL_OVERRIDE;
|
||||
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
|
||||
virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
const char *pszGCPProjection ) CPL_OVERRIDE;
|
||||
int GetGCPCount() override;
|
||||
const char *GetGCPProjection() override;
|
||||
const GDAL_GCP *GetGCPs() override;
|
||||
CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
const char *pszGCPProjection ) override;
|
||||
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" ) override;
|
||||
CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) override;
|
||||
char **GetMetadata( const char * pszDomain = "" ) override;
|
||||
const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain = "" ) override;
|
||||
|
||||
virtual char **GetFileList(void) CPL_OVERRIDE;
|
||||
char **GetFileList(void) override;
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
virtual CPLErr CloneInfo( GDALDataset *poSrcDS, int nCloneInfoFlags );
|
||||
|
||||
virtual CPLErr IBuildOverviews( const char *pszResampling,
|
||||
int nOverviews, int *panOverviewList,
|
||||
int nListBands, int *panBandList,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressData ) CPL_OVERRIDE;
|
||||
CPLErr IBuildOverviews( const char *pszResampling,
|
||||
int nOverviews, int *panOverviewList,
|
||||
int nListBands, int *panBandList,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressData ) override;
|
||||
|
||||
// "semi private" methods.
|
||||
void MarkPamDirty() { nPamFlags |= GPF_DIRTY; }
|
||||
@@ -257,52 +257,52 @@ class CPL_DLL GDALPamRasterBand : public GDALRasterBand
|
||||
//! @cond Doxygen_Suppress
|
||||
explicit GDALPamRasterBand(int bForceCachedIO);
|
||||
//! @endcond
|
||||
virtual ~GDALPamRasterBand();
|
||||
~GDALPamRasterBand() override;
|
||||
|
||||
virtual void SetDescription( const char * ) CPL_OVERRIDE;
|
||||
void SetDescription( const char * ) override;
|
||||
|
||||
virtual CPLErr SetNoDataValue( double ) CPL_OVERRIDE;
|
||||
virtual double GetNoDataValue( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual CPLErr DeleteNoDataValue() CPL_OVERRIDE;
|
||||
CPLErr SetNoDataValue( double ) override;
|
||||
double GetNoDataValue( int *pbSuccess = nullptr ) override;
|
||||
CPLErr DeleteNoDataValue() override;
|
||||
|
||||
virtual CPLErr SetColorTable( GDALColorTable * ) CPL_OVERRIDE;
|
||||
virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
|
||||
CPLErr SetColorTable( GDALColorTable * ) override;
|
||||
GDALColorTable *GetColorTable() override;
|
||||
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp ) CPL_OVERRIDE;
|
||||
virtual GDALColorInterp GetColorInterpretation() CPL_OVERRIDE;
|
||||
CPLErr SetColorInterpretation( GDALColorInterp ) override;
|
||||
GDALColorInterp GetColorInterpretation() override;
|
||||
|
||||
virtual const char *GetUnitType() CPL_OVERRIDE;
|
||||
CPLErr SetUnitType( const char * ) CPL_OVERRIDE;
|
||||
const char *GetUnitType() override;
|
||||
CPLErr SetUnitType( const char * ) override;
|
||||
|
||||
virtual char **GetCategoryNames() CPL_OVERRIDE;
|
||||
virtual CPLErr SetCategoryNames( char ** ) CPL_OVERRIDE;
|
||||
char **GetCategoryNames() override;
|
||||
CPLErr SetCategoryNames( char ** ) override;
|
||||
|
||||
virtual double GetOffset( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
CPLErr SetOffset( double ) CPL_OVERRIDE;
|
||||
virtual double GetScale( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
CPLErr SetScale( double ) CPL_OVERRIDE;
|
||||
double GetOffset( int *pbSuccess = nullptr ) override;
|
||||
CPLErr SetOffset( double ) override;
|
||||
double GetScale( int *pbSuccess = nullptr ) override;
|
||||
CPLErr SetScale( double ) override;
|
||||
|
||||
virtual CPLErr GetHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig * panHistogram,
|
||||
int bIncludeOutOfRange, int bApproxOK,
|
||||
GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
|
||||
CPLErr GetHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig * panHistogram,
|
||||
int bIncludeOutOfRange, int bApproxOK,
|
||||
GDALProgressFunc, void *pProgressData ) override;
|
||||
|
||||
virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
|
||||
int *pnBuckets, GUIntBig ** ppanHistogram,
|
||||
int bForce,
|
||||
GDALProgressFunc, void *pProgressData) CPL_OVERRIDE;
|
||||
CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
|
||||
int *pnBuckets, GUIntBig ** ppanHistogram,
|
||||
int bForce,
|
||||
GDALProgressFunc, void *pProgressData) override;
|
||||
|
||||
virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig *panHistogram ) CPL_OVERRIDE;
|
||||
CPLErr SetDefaultHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig *panHistogram ) override;
|
||||
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" ) override;
|
||||
CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) override;
|
||||
|
||||
virtual GDALRasterAttributeTable *GetDefaultRAT() CPL_OVERRIDE;
|
||||
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) CPL_OVERRIDE;
|
||||
GDALRasterAttributeTable *GetDefaultRAT() override;
|
||||
CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) override;
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
// new in GDALPamRasterBand.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_priv.h 37723 2017-03-16 17:07:53Z rouault $
|
||||
* $Id: gdal_priv.h 12e52bca5d2ef4d60eac422db198aefa9577be63 2018-07-14 19:04:33 +0200 Even Rouault $
|
||||
*
|
||||
* Name: gdal_priv.h
|
||||
* Project: GDAL Core
|
||||
@@ -65,9 +65,16 @@ class GDALAsyncReader;
|
||||
#include "cpl_minixml.h"
|
||||
#include "cpl_multiproc.h"
|
||||
#include "cpl_atomic_ops.h"
|
||||
#include <vector>
|
||||
|
||||
#include <cmath>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "ogr_core.h"
|
||||
#include "ogr_feature.h"
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#define GMO_VALID 0x0001
|
||||
@@ -154,6 +161,18 @@ class CPL_DLL GDALMajorObject
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" );
|
||||
|
||||
/** Convert a GDALMajorObject* to a GDALMajorObjectH.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALMajorObjectH ToHandle(GDALMajorObject* poMajorObject)
|
||||
{ return static_cast<GDALMajorObjectH>(poMajorObject); }
|
||||
|
||||
/** Convert a GDALMajorObjectH to a GDALMajorObject*.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALMajorObject* FromHandle(GDALMajorObjectH hMajorObject)
|
||||
{ return static_cast<GDALMajorObject*>(hMajorObject); }
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -191,8 +210,8 @@ class CPL_DLL GDALDefaultOverviews
|
||||
GDALDefaultOverviews();
|
||||
~GDALDefaultOverviews();
|
||||
|
||||
void Initialize( GDALDataset *poDSIn, const char *pszName = NULL,
|
||||
char **papszSiblingFiles = NULL,
|
||||
void Initialize( GDALDataset *poDSIn, const char *pszName = nullptr,
|
||||
char **papszSiblingFiles = nullptr,
|
||||
int bNameIsOVR = FALSE );
|
||||
|
||||
void TransferSiblingFiles( char** papszSiblingFiles );
|
||||
@@ -228,8 +247,8 @@ class CPL_DLL GDALDefaultOverviews
|
||||
GDALRasterBand *GetMaskBand( int nBand );
|
||||
int GetMaskFlags( int nBand );
|
||||
|
||||
int HaveMaskFile( char **papszSiblings = NULL,
|
||||
const char *pszBasename = NULL );
|
||||
int HaveMaskFile( char **papszSiblings = nullptr,
|
||||
const char *pszBasename = nullptr );
|
||||
|
||||
char** GetSiblingFiles() { return papszInitSiblingFiles; }
|
||||
|
||||
@@ -251,7 +270,7 @@ class CPL_DLL GDALOpenInfo
|
||||
|
||||
public:
|
||||
GDALOpenInfo( const char * pszFile, int nOpenFlagsIn,
|
||||
char **papszSiblingFiles = NULL );
|
||||
const char * const * papszSiblingFiles = nullptr );
|
||||
~GDALOpenInfo( void );
|
||||
|
||||
/** Filename */
|
||||
@@ -316,8 +335,6 @@ typedef void signature_changed;
|
||||
#endif
|
||||
//! @endcond
|
||||
|
||||
class OGRFeature;
|
||||
|
||||
/** A set of associated raster bands, usually from one file. */
|
||||
class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
{
|
||||
@@ -444,13 +461,50 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
//! @endcond
|
||||
|
||||
public:
|
||||
virtual ~GDALDataset();
|
||||
~GDALDataset() override;
|
||||
|
||||
int GetRasterXSize( void );
|
||||
int GetRasterYSize( void );
|
||||
int GetRasterCount( void );
|
||||
int GetRasterXSize();
|
||||
int GetRasterYSize();
|
||||
int GetRasterCount();
|
||||
GDALRasterBand *GetRasterBand( int );
|
||||
|
||||
/** Class returned by GetBands() that act as a container for raster bands. */
|
||||
class CPL_DLL Bands
|
||||
{
|
||||
private:
|
||||
|
||||
friend class GDALDataset;
|
||||
GDALDataset* m_poSelf;
|
||||
explicit Bands(GDALDataset* poSelf): m_poSelf(poSelf) {}
|
||||
|
||||
class CPL_DLL Iterator
|
||||
{
|
||||
struct Private;
|
||||
std::unique_ptr<Private> m_poPrivate;
|
||||
public:
|
||||
Iterator(GDALDataset* poDS, bool bStart);
|
||||
Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
|
||||
Iterator(Iterator&& oOther); // declared but not defined. Needed for gcc 5.4 at least
|
||||
~Iterator();
|
||||
GDALRasterBand* operator*();
|
||||
Iterator& operator++();
|
||||
bool operator!=(const Iterator& it) const;
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
const Iterator begin() const;
|
||||
|
||||
const Iterator end() const;
|
||||
|
||||
size_t size() const;
|
||||
|
||||
GDALRasterBand* operator[](int iBand);
|
||||
GDALRasterBand* operator[](size_t iBand);
|
||||
};
|
||||
|
||||
Bands GetBands();
|
||||
|
||||
virtual void FlushCache(void);
|
||||
|
||||
virtual const char *GetProjectionRef(void);
|
||||
@@ -460,7 +514,7 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
virtual CPLErr SetGeoTransform( double * padfTransform );
|
||||
|
||||
virtual CPLErr AddBand( GDALDataType eType,
|
||||
char **papszOptions=NULL );
|
||||
char **papszOptions=nullptr );
|
||||
|
||||
virtual void *GetInternalHandle( const char * pszHandleName );
|
||||
virtual GDALDriver *GetDriver(void);
|
||||
@@ -496,7 +550,7 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
int, int *, GSpacing, GSpacing, GSpacing,
|
||||
GDALRasterIOExtraArg* psExtraArg
|
||||
#ifndef DOXYGEN_SKIP
|
||||
OPTIONAL_OUTSIDE_GDAL(NULL)
|
||||
OPTIONAL_OUTSIDE_GDAL(nullptr)
|
||||
#endif
|
||||
) CPL_WARN_UNUSED_RESULT;
|
||||
|
||||
@@ -527,33 +581,128 @@ class CPL_DLL GDALDataset : public GDALMajorObject
|
||||
|
||||
void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
|
||||
|
||||
virtual char ** GetMetadata(const char * pszDomain = "") CPL_OVERRIDE;
|
||||
char ** GetMetadata(const char * pszDomain = "") override;
|
||||
|
||||
// Only defined when Doxygen enabled
|
||||
#ifdef DOXYGEN_SKIP
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) override;
|
||||
const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) override;
|
||||
CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) override;
|
||||
#endif
|
||||
|
||||
virtual char ** GetMetadataDomainList() CPL_OVERRIDE;
|
||||
char **GetMetadataDomainList() override;
|
||||
|
||||
/** Convert a GDALDataset* to a GDALDatasetH.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALDatasetH ToHandle(GDALDataset* poDS)
|
||||
{ return static_cast<GDALDatasetH>(poDS); }
|
||||
|
||||
/** Convert a GDALDatasetH to a GDALDataset*.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALDataset* FromHandle(GDALDatasetH hDS)
|
||||
{ return static_cast<GDALDataset*>(hDS); }
|
||||
|
||||
/** @see GDALOpenEx().
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static GDALDataset* Open( const char* pszFilename,
|
||||
unsigned int nOpenFlags = 0,
|
||||
const char* const* papszAllowedDrivers = nullptr,
|
||||
const char* const* papszOpenOptions = nullptr,
|
||||
const char* const* papszSiblingFiles = nullptr )
|
||||
{
|
||||
return FromHandle(GDALOpenEx(pszFilename, nOpenFlags,
|
||||
papszAllowedDrivers,
|
||||
papszOpenOptions,
|
||||
papszSiblingFiles));
|
||||
}
|
||||
|
||||
/** Object returned by GetFeatures() iterators */
|
||||
struct FeatureLayerPair
|
||||
{
|
||||
/** Unique pointer to a OGRFeature. */
|
||||
OGRFeatureUniquePtr feature;
|
||||
|
||||
/** Layer to which the feature belongs to. */
|
||||
OGRLayer* layer;
|
||||
};
|
||||
|
||||
private:
|
||||
void *m_hPrivateData;
|
||||
class Private;
|
||||
Private *m_poPrivate;
|
||||
|
||||
OGRLayer* BuildLayerFromSelectInfo(swq_select* psSelectInfo,
|
||||
OGRGeometry *poSpatialFilter,
|
||||
const char *pszDialect,
|
||||
swq_select_parse_options* poSelectParseOptions);
|
||||
CPLStringList oDerivedMetadataList;
|
||||
|
||||
public:
|
||||
|
||||
virtual int GetLayerCount();
|
||||
virtual OGRLayer *GetLayer(int iLayer);
|
||||
|
||||
/** Class returned by GetLayers() that acts as a range of layers.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
class CPL_DLL Layers
|
||||
{
|
||||
private:
|
||||
|
||||
friend class GDALDataset;
|
||||
GDALDataset* m_poSelf;
|
||||
explicit Layers(GDALDataset* poSelf): m_poSelf(poSelf) {}
|
||||
|
||||
public:
|
||||
|
||||
/** Layer iterator.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
class CPL_DLL Iterator
|
||||
{
|
||||
struct Private;
|
||||
std::unique_ptr<Private> m_poPrivate;
|
||||
public:
|
||||
|
||||
using value_type = OGRLayer*; /**< value_type */
|
||||
using reference = OGRLayer*; /**< reference */
|
||||
using difference_type = void; /**< difference_type */
|
||||
using pointer = void; /**< pointer */
|
||||
using iterator_category = std::input_iterator_tag; /**< iterator_category */
|
||||
|
||||
Iterator(); /**< Default constructor */
|
||||
Iterator(GDALDataset* poDS, bool bStart); /**< Constructor */
|
||||
Iterator(const Iterator& oOther); /**< Copy constructor */
|
||||
Iterator(Iterator&& oOther); /**< Move constructor */
|
||||
~Iterator(); /**< Destructor */
|
||||
|
||||
Iterator& operator=(const Iterator& oOther); /**< Assignment operator */
|
||||
Iterator& operator=(Iterator&& oOther); /**< Move assignment operator */
|
||||
|
||||
OGRLayer* operator*() const; /**< Dereference operator */
|
||||
Iterator& operator++(); /**< Pre-increment operator */
|
||||
Iterator operator++(int); /**< Post-increment operator */
|
||||
bool operator!=(const Iterator& it) const; /**< Difference comparison operator */
|
||||
};
|
||||
|
||||
Iterator begin() const;
|
||||
Iterator end() const;
|
||||
|
||||
size_t size() const;
|
||||
|
||||
OGRLayer* operator[](int iLayer);
|
||||
OGRLayer* operator[](size_t iLayer);
|
||||
OGRLayer* operator[](const char* pszLayername);
|
||||
};
|
||||
|
||||
Layers GetLayers();
|
||||
|
||||
virtual OGRLayer *GetLayerByName(const char *);
|
||||
virtual OGRErr DeleteLayer(int iLayer);
|
||||
|
||||
@@ -563,15 +712,48 @@ private:
|
||||
GDALProgressFunc pfnProgress,
|
||||
void* pProgressData );
|
||||
|
||||
|
||||
/** Class returned by GetFeatures() that act as a container for vector features. */
|
||||
class CPL_DLL Features
|
||||
{
|
||||
private:
|
||||
|
||||
friend class GDALDataset;
|
||||
GDALDataset* m_poSelf;
|
||||
explicit Features(GDALDataset* poSelf): m_poSelf(poSelf) {}
|
||||
|
||||
class CPL_DLL Iterator
|
||||
{
|
||||
struct Private;
|
||||
std::unique_ptr<Private> m_poPrivate;
|
||||
public:
|
||||
Iterator(GDALDataset* poDS, bool bStart);
|
||||
Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
|
||||
Iterator(Iterator&& oOther); // declared but not defined. Needed for gcc 5.4 at least
|
||||
~Iterator();
|
||||
const FeatureLayerPair& operator*() const;
|
||||
Iterator& operator++();
|
||||
bool operator!=(const Iterator& it) const;
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
const Iterator begin() const;
|
||||
|
||||
const Iterator end() const;
|
||||
};
|
||||
|
||||
Features GetFeatures();
|
||||
|
||||
virtual int TestCapability( const char * );
|
||||
|
||||
virtual OGRLayer *CreateLayer( const char *pszName,
|
||||
OGRSpatialReference *poSpatialRef = NULL,
|
||||
OGRSpatialReference *poSpatialRef = nullptr,
|
||||
OGRwkbGeometryType eGType = wkbUnknown,
|
||||
char ** papszOptions = NULL );
|
||||
char ** papszOptions = nullptr );
|
||||
virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
|
||||
const char *pszNewName,
|
||||
char **papszOptions = NULL );
|
||||
char **papszOptions = nullptr );
|
||||
|
||||
virtual OGRStyleTable *GetStyleTable();
|
||||
virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
|
||||
@@ -606,9 +788,9 @@ private:
|
||||
|
||||
protected:
|
||||
virtual OGRLayer *ICreateLayer( const char *pszName,
|
||||
OGRSpatialReference *poSpatialRef = NULL,
|
||||
OGRSpatialReference *poSpatialRef = nullptr,
|
||||
OGRwkbGeometryType eGType = wkbUnknown,
|
||||
char ** papszOptions = NULL );
|
||||
char ** papszOptions = nullptr );
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
OGRErr ProcessSQLCreateIndex( const char * );
|
||||
@@ -626,6 +808,21 @@ private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALDataset)
|
||||
};
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
struct CPL_DLL GDALDatasetUniquePtrDeleter
|
||||
{
|
||||
void operator()(GDALDataset* poDataset) const
|
||||
{ GDALClose(poDataset); }
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
/** Unique pointer type for GDALDataset.
|
||||
* Appropriate for use on datasets open in non-shared mode and onto which
|
||||
* reference counter has not been manually modified.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
typedef std::unique_ptr<GDALDataset, GDALDatasetUniquePtrDeleter> GDALDatasetUniquePtr;
|
||||
|
||||
/* ******************************************************************** */
|
||||
/* GDALRasterBlock */
|
||||
/* ******************************************************************** */
|
||||
@@ -725,6 +922,9 @@ class CPL_DLL GDALRasterBlock
|
||||
static int FlushCacheBlock(int bDirtyBlocksOnly = FALSE);
|
||||
static void Verify();
|
||||
|
||||
static void EnterDisableDirtyBlockFlush();
|
||||
static void LeaveDisableDirtyBlockFlush();
|
||||
|
||||
#ifdef notdef
|
||||
static void CheckNonOrphanedBlocks(GDALRasterBand* poBand);
|
||||
void DumpBlock();
|
||||
@@ -767,6 +967,19 @@ public:
|
||||
void SetColorEntry( int, const GDALColorEntry * );
|
||||
int CreateColorRamp( int, const GDALColorEntry * ,
|
||||
int, const GDALColorEntry * );
|
||||
|
||||
/** Convert a GDALColorTable* to a GDALRasterBandH.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALColorTableH ToHandle(GDALColorTable* poCT)
|
||||
{ return static_cast<GDALColorTableH>(poCT); }
|
||||
|
||||
/** Convert a GDALColorTableH to a GDALColorTable*.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALColorTable* FromHandle(GDALColorTableH hCT)
|
||||
{ return static_cast<GDALColorTable*>(hCT); }
|
||||
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -922,7 +1135,7 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
GDALRasterBand();
|
||||
explicit GDALRasterBand(int bForceCachedIO);
|
||||
|
||||
virtual ~GDALRasterBand();
|
||||
~GDALRasterBand() override;
|
||||
|
||||
int GetXSize();
|
||||
int GetYSize();
|
||||
@@ -938,7 +1151,7 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg
|
||||
#ifndef DOXYGEN_SKIP
|
||||
OPTIONAL_OUTSIDE_GDAL(NULL)
|
||||
OPTIONAL_OUTSIDE_GDAL(nullptr)
|
||||
#endif
|
||||
) CPL_WARN_UNUSED_RESULT;
|
||||
CPLErr ReadBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
|
||||
@@ -950,18 +1163,18 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
CPLErr FlushBlock( int, int, int bWriteDirtyBlock = TRUE );
|
||||
|
||||
unsigned char* GetIndexColorTranslationTo(/* const */ GDALRasterBand* poReferenceBand,
|
||||
unsigned char* pTranslationTable = NULL,
|
||||
int* pApproximateMatching = NULL);
|
||||
unsigned char* pTranslationTable = nullptr,
|
||||
int* pApproximateMatching = nullptr);
|
||||
|
||||
// New OpengIS CV_SampleDimension stuff.
|
||||
|
||||
virtual CPLErr FlushCache();
|
||||
virtual char **GetCategoryNames();
|
||||
virtual double GetNoDataValue( int *pbSuccess = NULL );
|
||||
virtual double GetMinimum( int *pbSuccess = NULL );
|
||||
virtual double GetMaximum(int *pbSuccess = NULL );
|
||||
virtual double GetOffset( int *pbSuccess = NULL );
|
||||
virtual double GetScale( int *pbSuccess = NULL );
|
||||
virtual double GetNoDataValue( int *pbSuccess = nullptr );
|
||||
virtual double GetMinimum( int *pbSuccess = nullptr );
|
||||
virtual double GetMaximum(int *pbSuccess = nullptr );
|
||||
virtual double GetOffset( int *pbSuccess = nullptr );
|
||||
virtual double GetScale( int *pbSuccess = nullptr );
|
||||
virtual const char *GetUnitType();
|
||||
virtual GDALColorInterp GetColorInterpretation();
|
||||
virtual GDALColorTable *GetColorTable();
|
||||
@@ -989,14 +1202,14 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
|
||||
// Only defined when Doxygen enabled
|
||||
#ifdef DOXYGEN_SKIP
|
||||
virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
char **GetMetadata( const char * pszDomain = "" ) override;
|
||||
CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) override;
|
||||
const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) override;
|
||||
CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) override;
|
||||
#endif
|
||||
|
||||
virtual int HasArbitraryOverviews();
|
||||
@@ -1040,10 +1253,22 @@ class CPL_DLL GDALRasterBand : public GDALMajorObject
|
||||
int GetDataCoverageStatus( int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
int nMaskFlagStop = 0,
|
||||
double* pdfDataPct = NULL );
|
||||
double* pdfDataPct = nullptr );
|
||||
|
||||
void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
|
||||
|
||||
/** Convert a GDALRasterBand* to a GDALRasterBandH.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALRasterBandH ToHandle(GDALRasterBand* poBand)
|
||||
{ return static_cast<GDALRasterBandH>(poBand); }
|
||||
|
||||
/** Convert a GDALRasterBandH to a GDALRasterBand*.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALRasterBand* FromHandle(GDALRasterBandH hBand)
|
||||
{ return static_cast<GDALRasterBand*>(hBand); }
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALRasterBand)
|
||||
};
|
||||
@@ -1056,14 +1281,14 @@ private:
|
||||
class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
|
||||
{
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
CPLErr IReadBlock( int, int, void * ) override;
|
||||
|
||||
public:
|
||||
explicit GDALAllValidMaskBand( GDALRasterBand * );
|
||||
virtual ~GDALAllValidMaskBand();
|
||||
~GDALAllValidMaskBand() override;
|
||||
|
||||
virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
|
||||
virtual int GetMaskFlags() CPL_OVERRIDE;
|
||||
GDALRasterBand *GetMaskBand() override;
|
||||
int GetMaskFlags() override;
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -1076,14 +1301,17 @@ class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
|
||||
GDALRasterBand *poParent;
|
||||
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
|
||||
CPLErr IReadBlock( int, int, void * ) override;
|
||||
CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) override;
|
||||
|
||||
public:
|
||||
explicit GDALNoDataMaskBand( GDALRasterBand * );
|
||||
virtual ~GDALNoDataMaskBand();
|
||||
explicit GDALNoDataMaskBand( GDALRasterBand * );
|
||||
~GDALNoDataMaskBand() override;
|
||||
|
||||
static bool IsNoDataInRange(double dfNoDataValue,
|
||||
GDALDataType eDataType);
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -1095,11 +1323,11 @@ class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
|
||||
double *padfNodataValues;
|
||||
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
CPLErr IReadBlock( int, int, void * ) override;
|
||||
|
||||
public:
|
||||
explicit GDALNoDataValuesMaskBand( GDALDataset * );
|
||||
virtual ~GDALNoDataValuesMaskBand();
|
||||
~GDALNoDataValuesMaskBand() override;
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -1112,14 +1340,15 @@ class GDALRescaledAlphaBand : public GDALRasterBand
|
||||
void *pTemp;
|
||||
|
||||
protected:
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
|
||||
CPLErr IReadBlock( int, int, void * ) override;
|
||||
CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing,
|
||||
GDALRasterIOExtraArg* psExtraArg ) override;
|
||||
|
||||
public:
|
||||
explicit GDALRescaledAlphaBand( GDALRasterBand * );
|
||||
virtual ~GDALRescaledAlphaBand();
|
||||
explicit GDALRescaledAlphaBand( GDALRasterBand * );
|
||||
~GDALRescaledAlphaBand() override;
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
@@ -1160,12 +1389,12 @@ typedef enum
|
||||
class CPL_DLL GDALDriver : public GDALMajorObject
|
||||
{
|
||||
public:
|
||||
GDALDriver();
|
||||
virtual ~GDALDriver();
|
||||
GDALDriver();
|
||||
~GDALDriver() override;
|
||||
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) override;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Public C++ methods. */
|
||||
@@ -1252,6 +1481,19 @@ class CPL_DLL GDALDriver : public GDALMajorObject
|
||||
static CPLErr DefaultCopyFiles( const char * pszNewName,
|
||||
const char * pszOldName );
|
||||
//! @endcond
|
||||
|
||||
/** Convert a GDALDriver* to a GDALDriverH.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALDriverH ToHandle(GDALDriver* poDriver)
|
||||
{ return static_cast<GDALDriverH>(poDriver); }
|
||||
|
||||
/** Convert a GDALDriverH to a GDALDriver*.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALDriver* FromHandle(GDALDriverH hDriver)
|
||||
{ return static_cast<GDALDriver*>(hDriver); }
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALDriver)
|
||||
};
|
||||
@@ -1275,7 +1517,7 @@ class CPL_DLL GDALDriverManager : public GDALMajorObject
|
||||
|
||||
GDALDriver *GetDriver_unlocked( int iDriver )
|
||||
{ return (iDriver >= 0 && iDriver < nDrivers) ?
|
||||
papoDrivers[iDriver] : NULL; }
|
||||
papoDrivers[iDriver] : nullptr; }
|
||||
|
||||
GDALDriver *GetDriverByName_unlocked( const char * pszName )
|
||||
{ return oMapNameToDrivers[CPLString(pszName).toupper()]; }
|
||||
@@ -1503,15 +1745,6 @@ GDALDataset CPL_DLL *
|
||||
GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess,
|
||||
GDALDataset *poDependentDS );
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Misc functions. */
|
||||
/* ==================================================================== */
|
||||
|
||||
CPLErr CPL_DLL GDALParseGMLCoverage( CPLXMLNode *psTree,
|
||||
int *pnXSize, int *pnYSize,
|
||||
double *padfGeoTransform,
|
||||
char **ppszProjection );
|
||||
|
||||
/* ==================================================================== */
|
||||
/* Infrastructure to check that dataset characteristics are valid */
|
||||
/* ==================================================================== */
|
||||
@@ -1519,16 +1752,6 @@ CPLErr CPL_DLL GDALParseGMLCoverage( CPLXMLNode *psTree,
|
||||
int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
|
||||
int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
|
||||
|
||||
// Test if 2 floating point values match. Useful when comparing values
|
||||
// stored as a string at some point. See #3573, #4183, #4506
|
||||
#define ARE_REAL_EQUAL(dfVal1, dfVal2) \
|
||||
/* Is it FLT_MIN ? Cf #6578 */ \
|
||||
(((float)dfVal2 == (float)1.17549435e-38) ? ((float)dfVal1 == (float)dfVal2) : \
|
||||
/* Or DBL_MIN ? */ \
|
||||
(dfVal2 == 2.2250738585072014e-308) ? (dfVal1 == dfVal2) : \
|
||||
/* General case */ \
|
||||
(dfVal1 == dfVal2 || fabs(dfVal1 - dfVal2) < 1e-10 || (dfVal2 != 0 && fabs(1 - dfVal1 / dfVal2) < 1e-10 )))
|
||||
|
||||
/* Internal use only */
|
||||
|
||||
/* CPL_DLL exported, but only for in-tree drivers that can be built as plugins */
|
||||
@@ -1554,7 +1777,7 @@ void GDALSetResponsiblePIDForCurrentThread(GIntBig responsiblePID);
|
||||
GIntBig GDALGetResponsiblePIDForCurrentThread();
|
||||
|
||||
CPLString GDALFindAssociatedFile( const char *pszBasename, const char *pszExt,
|
||||
char **papszSiblingFiles, int nFlags );
|
||||
CSLConstList papszSiblingFiles, int nFlags );
|
||||
|
||||
CPLErr EXIFExtractMetadata(char**& papszMetadata,
|
||||
void *fpL, int nOffset,
|
||||
@@ -1579,6 +1802,15 @@ void GDALRasterIOExtraArgSetResampleAlg(GDALRasterIOExtraArg* psExtraArg,
|
||||
GDALDataset* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
|
||||
int bThisLevelOnly);
|
||||
|
||||
// Should cover particular cases of #3573, #4183, #4506, #6578
|
||||
// Behaviour is undefined if fVal1 or fVal2 are NaN (should be tested before
|
||||
// calling this function)
|
||||
template<class T> inline bool ARE_REAL_EQUAL(T fVal1, T fVal2, int ulp = 2)
|
||||
{
|
||||
return fVal1 == fVal2 || /* Should cover infinity */
|
||||
std::abs(fVal1 - fVal2) < std::numeric_limits<float>::epsilon() * std::abs(fVal1+fVal2) * ulp;
|
||||
}
|
||||
|
||||
#define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
|
||||
|
||||
// Number of data samples that will be used to compute approximate statistics
|
||||
|
||||
@@ -1,354 +0,0 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_priv_templates.hpp 36822 2016-12-12 11:18:45Z rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: Inline C++ templates
|
||||
* Author: Phil Vachon, <philippe at cowpig.ca>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2009, Phil Vachon, <philippe at cowpig.ca>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDAL_PRIV_TEMPLATES_HPP_INCLUDED
|
||||
#define GDAL_PRIV_TEMPLATES_HPP_INCLUDED
|
||||
|
||||
#include <limits>
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALGetDataLimits() */
|
||||
/************************************************************************/
|
||||
/**
|
||||
* Compute the limits of values that can be placed in Tout in terms of
|
||||
* Tin. Usually used for output clamping, when the output data type's
|
||||
* limits are stable relative to the input type (i.e. no roundoff error).
|
||||
*
|
||||
* @param tMaxValue the returned maximum value
|
||||
* @param tMinValue the returned minimum value
|
||||
*/
|
||||
|
||||
template <class Tin, class Tout>
|
||||
inline void GDALGetDataLimits(Tin &tMaxValue, Tin &tMinValue)
|
||||
{
|
||||
tMaxValue = std::numeric_limits<Tin>::max();
|
||||
tMinValue = std::numeric_limits<Tin>::min();
|
||||
|
||||
// Compute the actual minimum value of Tout in terms of Tin.
|
||||
if (std::numeric_limits<Tout>::is_signed && std::numeric_limits<Tout>::is_integer)
|
||||
{
|
||||
// the minimum value is less than zero
|
||||
if (std::numeric_limits<Tout>::digits < std::numeric_limits<Tin>::digits ||
|
||||
!std::numeric_limits<Tin>::is_integer)
|
||||
{
|
||||
// Tout is smaller than Tin, so we need to clamp values in input
|
||||
// to the range of Tout's min/max values
|
||||
if (std::numeric_limits<Tin>::is_signed)
|
||||
{
|
||||
tMinValue = static_cast<Tin>(std::numeric_limits<Tout>::min());
|
||||
}
|
||||
tMaxValue = static_cast<Tin>(std::numeric_limits<Tout>::max());
|
||||
}
|
||||
}
|
||||
else if (std::numeric_limits<Tout>::is_integer)
|
||||
{
|
||||
// the output is unsigned, so we just need to determine the max
|
||||
/* coverity[same_on_both_sides] */
|
||||
if (std::numeric_limits<Tout>::digits <= std::numeric_limits<Tin>::digits)
|
||||
{
|
||||
// Tout is smaller than Tin, so we need to clamp the input values
|
||||
// to the range of Tout's max
|
||||
tMaxValue = static_cast<Tin>(std::numeric_limits<Tout>::max());
|
||||
}
|
||||
tMinValue = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALClampValue() */
|
||||
/************************************************************************/
|
||||
/**
|
||||
* Clamp values of type T to a specified range
|
||||
*
|
||||
* @param tValue the value
|
||||
* @param tMax the max value
|
||||
* @param tMin the min value
|
||||
*/
|
||||
template <class T>
|
||||
inline T GDALClampValue(const T tValue, const T tMax, const T tMin)
|
||||
{
|
||||
return tValue > tMax ? tMax :
|
||||
tValue < tMin ? tMin : tValue;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALCopyWord() */
|
||||
/************************************************************************/
|
||||
/**
|
||||
* Copy a single word, optionally rounding if appropriate (i.e. going
|
||||
* from the float to the integer case). Note that this is the function
|
||||
* you should specialize if you're adding a new data type.
|
||||
*
|
||||
* @param tValueIn value of type Tin; the input value to be converted
|
||||
* @param tValueOut value of type Tout; the output value
|
||||
*/
|
||||
|
||||
template <class Tin, class Tout>
|
||||
inline void GDALCopyWord(const Tin tValueIn, Tout &tValueOut)
|
||||
{
|
||||
Tin tMaxVal, tMinVal;
|
||||
GDALGetDataLimits<Tin, Tout>(tMaxVal, tMinVal);
|
||||
tValueOut = static_cast<Tout>(GDALClampValue(tValueIn, tMaxVal, tMinVal));
|
||||
}
|
||||
|
||||
template <class Tin>
|
||||
inline void GDALCopyWord(const Tin tValueIn, float &fValueOut)
|
||||
{
|
||||
fValueOut = (float) tValueIn;
|
||||
}
|
||||
|
||||
template <class Tin>
|
||||
inline void GDALCopyWord(const Tin tValueIn, double &dfValueOut)
|
||||
{
|
||||
dfValueOut = tValueIn;
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const double dfValueIn, double &dfValueOut)
|
||||
{
|
||||
dfValueOut = dfValueIn;
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const float fValueIn, float &fValueOut)
|
||||
{
|
||||
fValueOut = fValueIn;
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const float fValueIn, double &dfValueOut)
|
||||
{
|
||||
dfValueOut = fValueIn;
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const double dfValueIn, float &fValueOut)
|
||||
{
|
||||
fValueOut = static_cast<float>(dfValueIn);
|
||||
}
|
||||
|
||||
template <class Tout>
|
||||
inline void GDALCopyWord(const float fValueIn, Tout &tValueOut)
|
||||
{
|
||||
float fMaxVal, fMinVal;
|
||||
GDALGetDataLimits<float, Tout>(fMaxVal, fMinVal);
|
||||
tValueOut = static_cast<Tout>(
|
||||
GDALClampValue(fValueIn + 0.5f, fMaxVal, fMinVal));
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const float fValueIn, short &nValueOut)
|
||||
{
|
||||
float fMaxVal, fMinVal;
|
||||
GDALGetDataLimits<float, short>(fMaxVal, fMinVal);
|
||||
float fValue = fValueIn >= 0.0f ? fValueIn + 0.5f :
|
||||
fValueIn - 0.5f;
|
||||
nValueOut = static_cast<short>(
|
||||
GDALClampValue(fValue, fMaxVal, fMinVal));
|
||||
}
|
||||
|
||||
template <class Tout>
|
||||
inline void GDALCopyWord(const double dfValueIn, Tout &tValueOut)
|
||||
{
|
||||
double dfMaxVal, dfMinVal;
|
||||
GDALGetDataLimits<double, Tout>(dfMaxVal, dfMinVal);
|
||||
tValueOut = static_cast<Tout>(
|
||||
GDALClampValue(dfValueIn + 0.5, dfMaxVal, dfMinVal));
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const double dfValueIn, int &nValueOut)
|
||||
{
|
||||
double dfMaxVal, dfMinVal;
|
||||
GDALGetDataLimits<double, int>(dfMaxVal, dfMinVal);
|
||||
double dfValue = dfValueIn >= 0.0 ? dfValueIn + 0.5 :
|
||||
dfValueIn - 0.5;
|
||||
nValueOut = static_cast<int>(
|
||||
GDALClampValue(dfValue, dfMaxVal, dfMinVal));
|
||||
}
|
||||
|
||||
inline void GDALCopyWord(const double dfValueIn, short &nValueOut)
|
||||
{
|
||||
double dfMaxVal, dfMinVal;
|
||||
GDALGetDataLimits<double, short>(dfMaxVal, dfMinVal);
|
||||
double dfValue = dfValueIn > 0.0 ? dfValueIn + 0.5 :
|
||||
dfValueIn - 0.5;
|
||||
nValueOut = static_cast<short>(
|
||||
GDALClampValue(dfValue, dfMaxVal, dfMinVal));
|
||||
}
|
||||
|
||||
// Roundoff occurs for Float32 -> int32 for max/min. Overload GDALCopyWord
|
||||
// specifically for this case.
|
||||
inline void GDALCopyWord(const float fValueIn, int &nValueOut)
|
||||
{
|
||||
if (fValueIn >= static_cast<float>(std::numeric_limits<int>::max()))
|
||||
{
|
||||
nValueOut = std::numeric_limits<int>::max();
|
||||
}
|
||||
else if (fValueIn <= static_cast<float>(std::numeric_limits<int>::min()))
|
||||
{
|
||||
nValueOut = std::numeric_limits<int>::min();
|
||||
}
|
||||
else
|
||||
{
|
||||
nValueOut = static_cast<int>(fValueIn > 0.0f ?
|
||||
fValueIn + 0.5f : fValueIn - 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
// Roundoff occurs for Float32 -> uint32 for max. Overload GDALCopyWord
|
||||
// specifically for this case.
|
||||
inline void GDALCopyWord(const float fValueIn, unsigned int &nValueOut)
|
||||
{
|
||||
if (fValueIn >= static_cast<float>(std::numeric_limits<unsigned int>::max()))
|
||||
{
|
||||
nValueOut = std::numeric_limits<unsigned int>::max();
|
||||
}
|
||||
else if (fValueIn <= static_cast<float>(std::numeric_limits<unsigned int>::min()))
|
||||
{
|
||||
nValueOut = std::numeric_limits<unsigned int>::min();
|
||||
}
|
||||
else
|
||||
{
|
||||
nValueOut = static_cast<unsigned int>(fValueIn + 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALCopy4Words() */
|
||||
/************************************************************************/
|
||||
/**
|
||||
* Copy 4 packed words to 4 packed words, optionally rounding if appropriate
|
||||
* (i.e. going from the float to the integer case).
|
||||
*
|
||||
* @param pValueIn pointer to 4 input values of type Tin.
|
||||
* @param pValueOut pointer to 4 output values of type Tout.
|
||||
*/
|
||||
|
||||
template <class Tin, class Tout>
|
||||
inline void GDALCopy4Words(const Tin* pValueIn, Tout* const &pValueOut)
|
||||
{
|
||||
GDALCopyWord(pValueIn[0], pValueOut[0]);
|
||||
GDALCopyWord(pValueIn[1], pValueOut[1]);
|
||||
GDALCopyWord(pValueIn[2], pValueOut[2]);
|
||||
GDALCopyWord(pValueIn[3], pValueOut[3]);
|
||||
}
|
||||
|
||||
// Needs SSE2
|
||||
// _mm_cvtsi128_si64 doesn't work gcc 3.4
|
||||
#if (defined(__x86_64) || defined(_M_X64)) && !(defined(__GNUC__) && __GNUC__ < 4)
|
||||
|
||||
#include <emmintrin.h>
|
||||
|
||||
static inline void GDALCopyXMMToInt32(const __m128i xmm, void* pDest)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
int n32 = _mm_cvtsi128_si32 (xmm); // Extract lower 32 bit word
|
||||
memcpy(pDest, &n32, sizeof(n32));
|
||||
#else
|
||||
*(int*)pDest = _mm_cvtsi128_si32 (xmm);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void GDALCopyXMMToInt64(const __m128i xmm, void* pDest)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
GInt64 n64 = _mm_cvtsi128_si64 (xmm); // Extract lower 64 bit word
|
||||
memcpy(pDest, &n64, sizeof(n64));
|
||||
#else
|
||||
*(GInt64*)pDest = _mm_cvtsi128_si64 (xmm);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if __SSE4_1__
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
|
||||
inline void GDALCopy4Words(const float* pValueIn, GByte* const &pValueOut)
|
||||
{
|
||||
__m128 xmm = _mm_loadu_ps(pValueIn);
|
||||
|
||||
// The following clamping would be useless due to the final saturating
|
||||
// packing if we could guarantee the input range in [INT_MIN,INT_MAX]
|
||||
const __m128 xmm_min = _mm_set1_ps(0);
|
||||
const __m128 xmm_max = _mm_set1_ps(255);
|
||||
xmm = _mm_min_ps(_mm_max_ps(xmm, xmm_min), xmm_max);
|
||||
|
||||
const __m128 p0d5 = _mm_set1_ps(0.5f);
|
||||
xmm = _mm_add_ps(xmm, p0d5);
|
||||
|
||||
__m128i xmm_i = _mm_cvttps_epi32 (xmm);
|
||||
|
||||
xmm_i = _mm_packs_epi32(xmm_i, xmm_i); // Pack int32 to int16
|
||||
xmm_i = _mm_packus_epi16(xmm_i, xmm_i); // Pack int16 to uint8
|
||||
GDALCopyXMMToInt32(xmm_i, pValueOut);
|
||||
}
|
||||
|
||||
inline void GDALCopy4Words(const float* pValueIn, GInt16* const &pValueOut)
|
||||
{
|
||||
__m128 xmm = _mm_loadu_ps(pValueIn);
|
||||
|
||||
const __m128 xmm_min = _mm_set1_ps(-32768);
|
||||
const __m128 xmm_max = _mm_set1_ps(32767);
|
||||
xmm = _mm_min_ps(_mm_max_ps(xmm, xmm_min), xmm_max);
|
||||
|
||||
const __m128 p0d5 = _mm_set1_ps(0.5f);
|
||||
const __m128 m0d5 = _mm_set1_ps(-0.5f);
|
||||
const __m128 mask = _mm_cmpge_ps(xmm, p0d5);
|
||||
// f >= 0.5f ? f + 0.5f : f - 0.5f
|
||||
xmm = _mm_add_ps(xmm, _mm_or_ps(_mm_and_ps(mask, p0d5),
|
||||
_mm_andnot_ps(mask, m0d5)));
|
||||
|
||||
__m128i xmm_i = _mm_cvttps_epi32 (xmm);
|
||||
|
||||
xmm_i = _mm_packs_epi32(xmm_i, xmm_i); // Pack int32 to int16
|
||||
GDALCopyXMMToInt64(xmm_i, pValueOut);
|
||||
}
|
||||
|
||||
inline void GDALCopy4Words(const float* pValueIn, GUInt16* const &pValueOut)
|
||||
{
|
||||
__m128 xmm = _mm_loadu_ps(pValueIn);
|
||||
|
||||
const __m128 xmm_min = _mm_set1_ps(0);
|
||||
const __m128 xmm_max = _mm_set1_ps(65535);
|
||||
xmm = _mm_min_ps(_mm_max_ps(xmm, xmm_min), xmm_max);
|
||||
|
||||
xmm = _mm_add_ps(xmm, _mm_set1_ps(0.5f));
|
||||
|
||||
__m128i xmm_i = _mm_cvttps_epi32 (xmm);
|
||||
|
||||
#if __SSE4_1__
|
||||
xmm_i = _mm_packus_epi32(xmm_i, xmm_i); // Pack int32 to uint16
|
||||
#else
|
||||
// Translate to int16 range because _mm_packus_epi32 is SSE4.1 only
|
||||
xmm_i = _mm_add_epi32(xmm_i, _mm_set1_epi32(-32768));
|
||||
xmm_i = _mm_packs_epi32(xmm_i, xmm_i); // Pack int32 to int16
|
||||
// Translate back to uint16 range (actually -32768==32768 in int16)
|
||||
xmm_i = _mm_add_epi16(xmm_i, _mm_set1_epi16(-32768));
|
||||
#endif
|
||||
GDALCopyXMMToInt64(xmm_i, pValueOut);
|
||||
}
|
||||
#endif // defined(__x86_64) || defined(_M_X64)
|
||||
|
||||
#endif // GDAL_PRIV_TEMPLATES_HPP_INCLUDED
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_proxy.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
* $Id: gdal_proxy.h d10f99bfacb1d7c3331a539c4667d1c95199313d 2017-12-18 12:00:18Z Kurt Schwehr $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: GDAL Core C++/Private declarations
|
||||
@@ -45,55 +45,55 @@
|
||||
|
||||
class CPL_DLL GDALProxyDataset : public GDALDataset
|
||||
{
|
||||
protected:
|
||||
GDALProxyDataset() {};
|
||||
protected:
|
||||
GDALProxyDataset() {}
|
||||
|
||||
virtual GDALDataset *RefUnderlyingDataset() = 0;
|
||||
virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset);
|
||||
virtual GDALDataset *RefUnderlyingDataset() = 0;
|
||||
virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset);
|
||||
|
||||
virtual CPLErr IBuildOverviews( const char *, int, int *,
|
||||
int, int *, GDALProgressFunc, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
int, int *, GSpacing, GSpacing, GSpacing,
|
||||
GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
|
||||
public:
|
||||
CPLErr IBuildOverviews( const char *, int, int *,
|
||||
int, int *, GDALProgressFunc, void * ) override;
|
||||
CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
int, int *, GSpacing, GSpacing, GSpacing,
|
||||
GDALRasterIOExtraArg* psExtraArg ) override;
|
||||
|
||||
virtual char **GetMetadataDomainList() CPL_OVERRIDE;
|
||||
virtual char **GetMetadata( const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
public:
|
||||
char **GetMetadataDomainList() override;
|
||||
char **GetMetadata( const char * pszDomain ) override;
|
||||
CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) override;
|
||||
const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) override;
|
||||
CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) override;
|
||||
|
||||
virtual void FlushCache(void) CPL_OVERRIDE;
|
||||
void FlushCache() override;
|
||||
|
||||
virtual const char *GetProjectionRef(void) CPL_OVERRIDE;
|
||||
virtual CPLErr SetProjection( const char * ) CPL_OVERRIDE;
|
||||
const char *GetProjectionRef(void) override;
|
||||
CPLErr SetProjection( const char * ) override;
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
CPLErr GetGeoTransform( double * ) override;
|
||||
CPLErr SetGeoTransform( double * ) override;
|
||||
|
||||
virtual void *GetInternalHandle( const char * ) CPL_OVERRIDE;
|
||||
virtual GDALDriver *GetDriver(void) CPL_OVERRIDE;
|
||||
virtual char **GetFileList(void) CPL_OVERRIDE;
|
||||
void *GetInternalHandle( const char * ) override;
|
||||
GDALDriver *GetDriver() override;
|
||||
char **GetFileList() override;
|
||||
|
||||
virtual int GetGCPCount() CPL_OVERRIDE;
|
||||
virtual const char *GetGCPProjection() CPL_OVERRIDE;
|
||||
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
|
||||
virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
const char *pszGCPProjection ) CPL_OVERRIDE;
|
||||
int GetGCPCount() override;
|
||||
const char *GetGCPProjection() override;
|
||||
const GDAL_GCP *GetGCPs() override;
|
||||
CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
|
||||
const char *pszGCPProjection ) override;
|
||||
|
||||
virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eDT,
|
||||
int nBandCount, int *panBandList,
|
||||
char **papszOptions ) CPL_OVERRIDE;
|
||||
CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eDT,
|
||||
int nBandCount, int *panBandList,
|
||||
char **papszOptions ) override;
|
||||
|
||||
virtual CPLErr CreateMaskBand( int nFlags ) CPL_OVERRIDE;
|
||||
CPLErr CreateMaskBand( int nFlags ) override;
|
||||
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyDataset)
|
||||
@@ -105,95 +105,95 @@ class CPL_DLL GDALProxyDataset : public GDALDataset
|
||||
|
||||
class CPL_DLL GDALProxyRasterBand : public GDALRasterBand
|
||||
{
|
||||
protected:
|
||||
GDALProxyRasterBand() {};
|
||||
protected:
|
||||
GDALProxyRasterBand() {}
|
||||
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() = 0;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand);
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() = 0;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand);
|
||||
|
||||
virtual CPLErr IReadBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IWriteBlock( int, int, void * ) CPL_OVERRIDE;
|
||||
virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) CPL_OVERRIDE;
|
||||
CPLErr IReadBlock( int, int, void * ) override;
|
||||
CPLErr IWriteBlock( int, int, void * ) override;
|
||||
CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
|
||||
void *, int, int, GDALDataType,
|
||||
GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) override;
|
||||
|
||||
public:
|
||||
public:
|
||||
char **GetMetadataDomainList() override;
|
||||
char **GetMetadata( const char * pszDomain ) override;
|
||||
CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) override;
|
||||
const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) override;
|
||||
CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) override;
|
||||
CPLErr FlushCache() override;
|
||||
char **GetCategoryNames() override;
|
||||
double GetNoDataValue( int *pbSuccess = nullptr ) override;
|
||||
double GetMinimum( int *pbSuccess = nullptr ) override;
|
||||
double GetMaximum(int *pbSuccess = nullptr ) override;
|
||||
double GetOffset( int *pbSuccess = nullptr ) override;
|
||||
double GetScale( int *pbSuccess = nullptr ) override;
|
||||
const char *GetUnitType() override;
|
||||
GDALColorInterp GetColorInterpretation() override;
|
||||
GDALColorTable *GetColorTable() override;
|
||||
CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0) override;
|
||||
|
||||
virtual char **GetMetadataDomainList() CPL_OVERRIDE;
|
||||
virtual char **GetMetadata( const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual CPLErr FlushCache() CPL_OVERRIDE;
|
||||
virtual char **GetCategoryNames() CPL_OVERRIDE;
|
||||
virtual double GetNoDataValue( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual double GetMinimum( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual double GetMaximum(int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual double GetOffset( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual double GetScale( int *pbSuccess = NULL ) CPL_OVERRIDE;
|
||||
virtual const char *GetUnitType() CPL_OVERRIDE;
|
||||
virtual GDALColorInterp GetColorInterpretation() CPL_OVERRIDE;
|
||||
virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
|
||||
virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0) CPL_OVERRIDE;
|
||||
CPLErr SetCategoryNames( char ** ) override;
|
||||
CPLErr SetNoDataValue( double ) override;
|
||||
CPLErr DeleteNoDataValue() override;
|
||||
CPLErr SetColorTable( GDALColorTable * ) override;
|
||||
CPLErr SetColorInterpretation( GDALColorInterp ) override;
|
||||
CPLErr SetOffset( double ) override;
|
||||
CPLErr SetScale( double ) override;
|
||||
CPLErr SetUnitType( const char * ) override;
|
||||
|
||||
virtual CPLErr SetCategoryNames( char ** ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetNoDataValue( double ) CPL_OVERRIDE;
|
||||
virtual CPLErr DeleteNoDataValue() CPL_OVERRIDE;
|
||||
virtual CPLErr SetColorTable( GDALColorTable * ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetColorInterpretation( GDALColorInterp ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetOffset( double ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetScale( double ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetUnitType( const char * ) CPL_OVERRIDE;
|
||||
CPLErr GetStatistics( int bApproxOK, int bForce,
|
||||
double *pdfMin, double *pdfMax,
|
||||
double *pdfMean, double *padfStdDev ) override;
|
||||
CPLErr ComputeStatistics( int bApproxOK,
|
||||
double *pdfMin, double *pdfMax,
|
||||
double *pdfMean, double *pdfStdDev,
|
||||
GDALProgressFunc, void *pProgressData ) override;
|
||||
CPLErr SetStatistics( double dfMin, double dfMax,
|
||||
double dfMean, double dfStdDev ) override;
|
||||
CPLErr ComputeRasterMinMax( int, double* ) override;
|
||||
|
||||
virtual CPLErr GetStatistics( int bApproxOK, int bForce,
|
||||
double *pdfMin, double *pdfMax,
|
||||
double *pdfMean, double *padfStdDev ) CPL_OVERRIDE;
|
||||
virtual CPLErr ComputeStatistics( int bApproxOK,
|
||||
double *pdfMin, double *pdfMax,
|
||||
double *pdfMean, double *pdfStdDev,
|
||||
GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetStatistics( double dfMin, double dfMax,
|
||||
double dfMean, double dfStdDev ) CPL_OVERRIDE;
|
||||
virtual CPLErr ComputeRasterMinMax( int, double* ) CPL_OVERRIDE;
|
||||
int HasArbitraryOverviews() override;
|
||||
int GetOverviewCount() override;
|
||||
GDALRasterBand *GetOverview( int ) override;
|
||||
GDALRasterBand *GetRasterSampleOverview( GUIntBig ) override;
|
||||
CPLErr BuildOverviews( const char *, int, int *,
|
||||
GDALProgressFunc, void * ) override;
|
||||
|
||||
virtual int HasArbitraryOverviews() CPL_OVERRIDE;
|
||||
virtual int GetOverviewCount() CPL_OVERRIDE;
|
||||
virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
|
||||
virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig ) CPL_OVERRIDE;
|
||||
virtual CPLErr BuildOverviews( const char *, int, int *,
|
||||
GDALProgressFunc, void * ) CPL_OVERRIDE;
|
||||
CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eDT, char **papszOptions ) override;
|
||||
|
||||
virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
int nBufXSize, int nBufYSize,
|
||||
GDALDataType eDT, char **papszOptions ) CPL_OVERRIDE;
|
||||
CPLErr GetHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig * panHistogram,
|
||||
int bIncludeOutOfRange, int bApproxOK,
|
||||
GDALProgressFunc, void *pProgressData ) override;
|
||||
|
||||
virtual CPLErr GetHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig * panHistogram,
|
||||
int bIncludeOutOfRange, int bApproxOK,
|
||||
GDALProgressFunc, void *pProgressData ) CPL_OVERRIDE;
|
||||
CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
|
||||
int *pnBuckets, GUIntBig ** ppanHistogram,
|
||||
int bForce,
|
||||
GDALProgressFunc, void *pProgressData) override;
|
||||
CPLErr SetDefaultHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig *panHistogram ) override;
|
||||
|
||||
virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
|
||||
int *pnBuckets, GUIntBig ** ppanHistogram,
|
||||
int bForce,
|
||||
GDALProgressFunc, void *pProgressData) CPL_OVERRIDE;
|
||||
virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
|
||||
int nBuckets, GUIntBig *panHistogram ) CPL_OVERRIDE;
|
||||
GDALRasterAttributeTable *GetDefaultRAT() override;
|
||||
CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) override;
|
||||
|
||||
virtual GDALRasterAttributeTable *GetDefaultRAT() CPL_OVERRIDE;
|
||||
virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * ) CPL_OVERRIDE;
|
||||
GDALRasterBand *GetMaskBand() override;
|
||||
int GetMaskFlags() override;
|
||||
CPLErr CreateMaskBand( int nFlags ) override;
|
||||
|
||||
virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
|
||||
virtual int GetMaskFlags() CPL_OVERRIDE;
|
||||
virtual CPLErr CreateMaskBand( int nFlags ) CPL_OVERRIDE;
|
||||
CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
|
||||
int *pnPixelSpace,
|
||||
GIntBig *pnLineSpace,
|
||||
char **papszOptions ) override;
|
||||
|
||||
virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
|
||||
int *pnPixelSpace,
|
||||
GIntBig *pnLineSpace,
|
||||
char **papszOptions ) CPL_OVERRIDE;
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyRasterBand)
|
||||
};
|
||||
@@ -207,7 +207,7 @@ class GDALProxyPoolRasterBand;
|
||||
|
||||
class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset
|
||||
{
|
||||
private:
|
||||
private:
|
||||
GIntBig responsiblePID;
|
||||
|
||||
char *pszProjectionRef;
|
||||
@@ -221,42 +221,50 @@ class CPL_DLL GDALProxyPoolDataset : public GDALProxyDataset
|
||||
CPLHashSet *metadataItemSet;
|
||||
|
||||
GDALProxyPoolCacheEntry* cacheEntry;
|
||||
char *m_pszOwner;
|
||||
|
||||
protected:
|
||||
virtual GDALDataset *RefUnderlyingDataset() CPL_OVERRIDE;
|
||||
virtual void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset) CPL_OVERRIDE;
|
||||
GDALDataset *RefUnderlyingDataset(bool bForceOpen);
|
||||
|
||||
friend class GDALProxyPoolRasterBand;
|
||||
protected:
|
||||
GDALDataset *RefUnderlyingDataset() override;
|
||||
void UnrefUnderlyingDataset(GDALDataset* poUnderlyingDataset) override;
|
||||
|
||||
public:
|
||||
GDALProxyPoolDataset(const char* pszSourceDatasetDescription,
|
||||
int nRasterXSize, int nRasterYSize,
|
||||
GDALAccess eAccess = GA_ReadOnly,
|
||||
int bShared = FALSE,
|
||||
const char * pszProjectionRef = NULL,
|
||||
double * padfGeoTransform = NULL);
|
||||
virtual ~GDALProxyPoolDataset();
|
||||
friend class GDALProxyPoolRasterBand;
|
||||
|
||||
void SetOpenOptions(char** papszOpenOptions);
|
||||
void AddSrcBandDescription( GDALDataType eDataType, int nBlockXSize, int nBlockYSize);
|
||||
public:
|
||||
GDALProxyPoolDataset( const char* pszSourceDatasetDescription,
|
||||
int nRasterXSize, int nRasterYSize,
|
||||
GDALAccess eAccess = GA_ReadOnly,
|
||||
int bShared = FALSE,
|
||||
const char * pszProjectionRef = nullptr,
|
||||
double * padfGeoTransform = nullptr,
|
||||
const char* pszOwner = nullptr );
|
||||
~GDALProxyPoolDataset() override;
|
||||
|
||||
virtual const char *GetProjectionRef(void) CPL_OVERRIDE;
|
||||
virtual CPLErr SetProjection( const char * ) CPL_OVERRIDE;
|
||||
void SetOpenOptions( char** papszOpenOptions );
|
||||
void AddSrcBandDescription( GDALDataType eDataType, int nBlockXSize,
|
||||
int nBlockYSize );
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
void FlushCache() override;
|
||||
|
||||
/* Special behaviour for the following methods : they return a pointer */
|
||||
/* data type, that must be cached by the proxy, so it doesn't become invalid */
|
||||
/* when the underlying object get closed */
|
||||
virtual char **GetMetadata( const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
const char *GetProjectionRef() override;
|
||||
CPLErr SetProjection( const char * ) override;
|
||||
|
||||
virtual void *GetInternalHandle( const char * pszRequest ) CPL_OVERRIDE;
|
||||
CPLErr GetGeoTransform( double * ) override;
|
||||
CPLErr SetGeoTransform( double * ) override;
|
||||
|
||||
// Special behaviour for the following methods : they return a pointer
|
||||
// data type, that must be cached by the proxy, so it doesn't become invalid
|
||||
// when the underlying object get closed.
|
||||
char **GetMetadata( const char * pszDomain ) override;
|
||||
const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) override;
|
||||
|
||||
void *GetInternalHandle( const char * pszRequest ) override;
|
||||
|
||||
const char *GetGCPProjection() override;
|
||||
const GDAL_GCP *GetGCPs() override;
|
||||
|
||||
virtual const char *GetGCPProjection() CPL_OVERRIDE;
|
||||
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolDataset)
|
||||
};
|
||||
@@ -270,48 +278,55 @@ class GDALProxyPoolMaskBand;
|
||||
|
||||
class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
|
||||
{
|
||||
private:
|
||||
CPLHashSet *metadataSet;
|
||||
CPLHashSet *metadataItemSet;
|
||||
char *pszUnitType;
|
||||
char **papszCategoryNames;
|
||||
GDALColorTable *poColorTable;
|
||||
private:
|
||||
CPLHashSet *metadataSet;
|
||||
CPLHashSet *metadataItemSet;
|
||||
char *pszUnitType;
|
||||
char **papszCategoryNames;
|
||||
GDALColorTable *poColorTable;
|
||||
|
||||
int nSizeProxyOverviewRasterBand;
|
||||
GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand;
|
||||
GDALProxyPoolMaskBand *poProxyMaskBand;
|
||||
int nSizeProxyOverviewRasterBand;
|
||||
GDALProxyPoolOverviewRasterBand **papoProxyOverviewRasterBand;
|
||||
GDALProxyPoolMaskBand *poProxyMaskBand;
|
||||
|
||||
void Init();
|
||||
void Init();
|
||||
|
||||
protected:
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() CPL_OVERRIDE;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand) CPL_OVERRIDE;
|
||||
GDALRasterBand* RefUnderlyingRasterBand( bool bForceOpen );
|
||||
|
||||
friend class GDALProxyPoolOverviewRasterBand;
|
||||
friend class GDALProxyPoolMaskBand;
|
||||
protected:
|
||||
GDALRasterBand* RefUnderlyingRasterBand() override;
|
||||
void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
|
||||
override;
|
||||
|
||||
public:
|
||||
GDALProxyPoolRasterBand(GDALProxyPoolDataset* poDS, int nBand,
|
||||
GDALDataType eDataType,
|
||||
int nBlockXSize, int nBlockYSize);
|
||||
GDALProxyPoolRasterBand(GDALProxyPoolDataset* poDS,
|
||||
GDALRasterBand* poUnderlyingRasterBand);
|
||||
virtual ~GDALProxyPoolRasterBand();
|
||||
friend class GDALProxyPoolOverviewRasterBand;
|
||||
friend class GDALProxyPoolMaskBand;
|
||||
|
||||
void AddSrcMaskBandDescription( GDALDataType eDataType, int nBlockXSize, int nBlockYSize);
|
||||
public:
|
||||
GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS, int nBand,
|
||||
GDALDataType eDataType,
|
||||
int nBlockXSize, int nBlockYSize );
|
||||
GDALProxyPoolRasterBand( GDALProxyPoolDataset* poDS,
|
||||
GDALRasterBand* poUnderlyingRasterBand );
|
||||
~GDALProxyPoolRasterBand() override;
|
||||
|
||||
void AddSrcMaskBandDescription( GDALDataType eDataType, int nBlockXSize,
|
||||
int nBlockYSize );
|
||||
|
||||
// Special behaviour for the following methods : they return a pointer
|
||||
// data type, that must be cached by the proxy, so it doesn't become invalid
|
||||
// when the underlying object get closed.
|
||||
char **GetMetadata( const char * pszDomain ) override;
|
||||
const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) override;
|
||||
char **GetCategoryNames() override;
|
||||
const char *GetUnitType() override;
|
||||
GDALColorTable *GetColorTable() override;
|
||||
GDALRasterBand *GetOverview( int ) override;
|
||||
GDALRasterBand *GetRasterSampleOverview( GUIntBig nDesiredSamples ) override; // TODO
|
||||
GDALRasterBand *GetMaskBand() override;
|
||||
|
||||
CPLErr FlushCache() override;
|
||||
|
||||
/* Special behaviour for the following methods : they return a pointer */
|
||||
/* data type, that must be cached by the proxy, so it doesn't become invalid */
|
||||
/* when the underlying object get closed */
|
||||
virtual char **GetMetadata( const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain ) CPL_OVERRIDE;
|
||||
virtual char **GetCategoryNames() CPL_OVERRIDE;
|
||||
virtual const char *GetUnitType() CPL_OVERRIDE;
|
||||
virtual GDALColorTable *GetColorTable() CPL_OVERRIDE;
|
||||
virtual GDALRasterBand *GetOverview(int) CPL_OVERRIDE;
|
||||
virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig nDesiredSamples) CPL_OVERRIDE; // TODO
|
||||
virtual GDALRasterBand *GetMaskBand() CPL_OVERRIDE;
|
||||
private:
|
||||
CPL_DISALLOW_COPY_ASSIGN(GDALProxyPoolRasterBand)
|
||||
};
|
||||
@@ -322,23 +337,24 @@ class CPL_DLL GDALProxyPoolRasterBand : public GDALProxyRasterBand
|
||||
|
||||
class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand
|
||||
{
|
||||
private:
|
||||
GDALProxyPoolRasterBand *poMainBand;
|
||||
int nOverviewBand;
|
||||
private:
|
||||
GDALProxyPoolRasterBand *poMainBand;
|
||||
int nOverviewBand;
|
||||
|
||||
GDALRasterBand *poUnderlyingMainRasterBand;
|
||||
int nRefCountUnderlyingMainRasterBand;
|
||||
GDALRasterBand *poUnderlyingMainRasterBand;
|
||||
int nRefCountUnderlyingMainRasterBand;
|
||||
|
||||
protected:
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() CPL_OVERRIDE;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand) CPL_OVERRIDE;
|
||||
protected:
|
||||
GDALRasterBand* RefUnderlyingRasterBand() override;
|
||||
void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
|
||||
override;
|
||||
|
||||
public:
|
||||
GDALProxyPoolOverviewRasterBand(GDALProxyPoolDataset* poDS,
|
||||
GDALRasterBand* poUnderlyingOverviewBand,
|
||||
GDALProxyPoolRasterBand* poMainBand,
|
||||
int nOverviewBand);
|
||||
virtual ~GDALProxyPoolOverviewRasterBand();
|
||||
public:
|
||||
GDALProxyPoolOverviewRasterBand( GDALProxyPoolDataset* poDS,
|
||||
GDALRasterBand* poUnderlyingOverviewBand,
|
||||
GDALProxyPoolRasterBand* poMainBand,
|
||||
int nOverviewBand );
|
||||
~GDALProxyPoolOverviewRasterBand() override;
|
||||
};
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -347,25 +363,26 @@ class GDALProxyPoolOverviewRasterBand : public GDALProxyPoolRasterBand
|
||||
|
||||
class GDALProxyPoolMaskBand : public GDALProxyPoolRasterBand
|
||||
{
|
||||
private:
|
||||
GDALProxyPoolRasterBand *poMainBand;
|
||||
private:
|
||||
GDALProxyPoolRasterBand *poMainBand;
|
||||
|
||||
GDALRasterBand *poUnderlyingMainRasterBand;
|
||||
int nRefCountUnderlyingMainRasterBand;
|
||||
GDALRasterBand *poUnderlyingMainRasterBand;
|
||||
int nRefCountUnderlyingMainRasterBand;
|
||||
|
||||
protected:
|
||||
virtual GDALRasterBand* RefUnderlyingRasterBand() CPL_OVERRIDE;
|
||||
virtual void UnrefUnderlyingRasterBand(GDALRasterBand* poUnderlyingRasterBand) CPL_OVERRIDE;
|
||||
protected:
|
||||
GDALRasterBand* RefUnderlyingRasterBand() override;
|
||||
void UnrefUnderlyingRasterBand( GDALRasterBand* poUnderlyingRasterBand )
|
||||
override;
|
||||
|
||||
public:
|
||||
GDALProxyPoolMaskBand(GDALProxyPoolDataset* poDS,
|
||||
GDALRasterBand* poUnderlyingMaskBand,
|
||||
GDALProxyPoolRasterBand* poMainBand);
|
||||
GDALProxyPoolMaskBand(GDALProxyPoolDataset* poDS,
|
||||
GDALProxyPoolRasterBand* poMainBand,
|
||||
GDALDataType eDataType,
|
||||
int nBlockXSize, int nBlockYSize);
|
||||
virtual ~GDALProxyPoolMaskBand();
|
||||
public:
|
||||
GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
|
||||
GDALRasterBand* poUnderlyingMaskBand,
|
||||
GDALProxyPoolRasterBand* poMainBand );
|
||||
GDALProxyPoolMaskBand( GDALProxyPoolDataset* poDS,
|
||||
GDALProxyPoolRasterBand* poMainBand,
|
||||
GDALDataType eDataType,
|
||||
int nBlockXSize, int nBlockYSize );
|
||||
~GDALProxyPoolMaskBand() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_rat.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
* $Id: gdal_rat.h 3c5e4ec07e57067c187d87dad3b6be5490b76a4e 2018-04-02 23:38:56 +0200 Even Rouault $
|
||||
*
|
||||
* Project: GDAL Core
|
||||
* Purpose: GDALRasterAttributeTable class declarations.
|
||||
@@ -31,6 +31,7 @@
|
||||
#define GDAL_RAT_H_INCLUDED
|
||||
|
||||
#include "cpl_minixml.h"
|
||||
#include "gdal_priv.h"
|
||||
|
||||
// Clone and Serialize are allowed to fail if GetRowCount()*GetColCount()
|
||||
// greater than this number
|
||||
@@ -52,7 +53,7 @@ public:
|
||||
*
|
||||
* Creates a new copy of an existing raster attribute table. The new copy
|
||||
* becomes the responsibility of the caller to destroy.
|
||||
* May fail (return NULL) if the attribute table is too large to clone
|
||||
* May fail (return nullptr) if the attribute table is too large to clone
|
||||
* (GetRowCount() * GetColCount() > RAT_MAX_ELEM_FOR_CLONE)
|
||||
*
|
||||
* This method is the same as the C function GDALRATClone().
|
||||
@@ -261,7 +262,7 @@ public:
|
||||
/**
|
||||
* \brief Serialize
|
||||
*
|
||||
* May fail (return NULL) if the attribute table is too large to serialize
|
||||
* May fail (return nullptr) if the attribute table is too large to serialize
|
||||
* (GetRowCount() * GetColCount() > RAT_MAX_ELEM_FOR_CLONE)
|
||||
*/
|
||||
virtual CPLXMLNode *Serialize() const;
|
||||
@@ -271,7 +272,19 @@ public:
|
||||
virtual CPLErr InitializeFromColorTable( const GDALColorTable * );
|
||||
virtual GDALColorTable *TranslateToColorTable( int nEntryCount = -1 );
|
||||
|
||||
virtual void DumpReadable( FILE * = NULL );
|
||||
virtual void DumpReadable( FILE * = nullptr );
|
||||
|
||||
/** Convert a GDALRasterAttributeTable* to a GDALRasterAttributeTableH.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALRasterAttributeTableH ToHandle(GDALRasterAttributeTable* poRAT)
|
||||
{ return static_cast<GDALRasterAttributeTableH>(poRAT); }
|
||||
|
||||
/** Convert a GDALRasterAttributeTableH to a GDALRasterAttributeTable*.
|
||||
* @since GDAL 2.3
|
||||
*/
|
||||
static inline GDALRasterAttributeTable* FromHandle(GDALRasterAttributeTableH hRAT)
|
||||
{ return static_cast<GDALRasterAttributeTable*>(hRAT); }
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
@@ -301,6 +314,7 @@ class GDALRasterAttributeField
|
||||
|
||||
//! Raster Attribute Table container.
|
||||
|
||||
// cppcheck-suppress copyCtorAndEqOperator
|
||||
class CPL_DLL GDALDefaultRasterAttributeTable : public GDALRasterAttributeTable
|
||||
{
|
||||
private:
|
||||
@@ -322,42 +336,42 @@ class CPL_DLL GDALDefaultRasterAttributeTable : public GDALRasterAttributeTable
|
||||
public:
|
||||
GDALDefaultRasterAttributeTable();
|
||||
GDALDefaultRasterAttributeTable( const GDALDefaultRasterAttributeTable& );
|
||||
virtual ~GDALDefaultRasterAttributeTable();
|
||||
~GDALDefaultRasterAttributeTable() override;
|
||||
|
||||
GDALDefaultRasterAttributeTable *Clone() const CPL_OVERRIDE;
|
||||
GDALDefaultRasterAttributeTable *Clone() const override;
|
||||
|
||||
virtual int GetColumnCount() const CPL_OVERRIDE;
|
||||
int GetColumnCount() const override;
|
||||
|
||||
virtual const char *GetNameOfCol( int ) const CPL_OVERRIDE;
|
||||
virtual GDALRATFieldUsage GetUsageOfCol( int ) const CPL_OVERRIDE;
|
||||
virtual GDALRATFieldType GetTypeOfCol( int ) const CPL_OVERRIDE;
|
||||
const char *GetNameOfCol( int ) const override;
|
||||
GDALRATFieldUsage GetUsageOfCol( int ) const override;
|
||||
GDALRATFieldType GetTypeOfCol( int ) const override;
|
||||
|
||||
virtual int GetColOfUsage( GDALRATFieldUsage ) const CPL_OVERRIDE;
|
||||
int GetColOfUsage( GDALRATFieldUsage ) const override;
|
||||
|
||||
virtual int GetRowCount() const CPL_OVERRIDE;
|
||||
int GetRowCount() const override;
|
||||
|
||||
virtual const char *GetValueAsString( int iRow, int iField ) const CPL_OVERRIDE;
|
||||
virtual int GetValueAsInt( int iRow, int iField ) const CPL_OVERRIDE;
|
||||
virtual double GetValueAsDouble( int iRow, int iField ) const CPL_OVERRIDE;
|
||||
const char *GetValueAsString( int iRow, int iField ) const override;
|
||||
int GetValueAsInt( int iRow, int iField ) const override;
|
||||
double GetValueAsDouble( int iRow, int iField ) const override;
|
||||
|
||||
virtual void SetValue( int iRow, int iField,
|
||||
const char *pszValue ) CPL_OVERRIDE;
|
||||
virtual void SetValue( int iRow, int iField, double dfValue) CPL_OVERRIDE;
|
||||
virtual void SetValue( int iRow, int iField, int nValue ) CPL_OVERRIDE;
|
||||
void SetValue( int iRow, int iField,
|
||||
const char *pszValue ) override;
|
||||
void SetValue( int iRow, int iField, double dfValue) override;
|
||||
void SetValue( int iRow, int iField, int nValue ) override;
|
||||
|
||||
virtual int ChangesAreWrittenToFile() CPL_OVERRIDE;
|
||||
virtual void SetRowCount( int iCount ) CPL_OVERRIDE;
|
||||
int ChangesAreWrittenToFile() override;
|
||||
void SetRowCount( int iCount ) override;
|
||||
|
||||
virtual int GetRowOfValue( double dfValue ) const CPL_OVERRIDE;
|
||||
virtual int GetRowOfValue( int nValue ) const CPL_OVERRIDE;
|
||||
int GetRowOfValue( double dfValue ) const override;
|
||||
int GetRowOfValue( int nValue ) const override;
|
||||
|
||||
virtual CPLErr CreateColumn( const char *pszFieldName,
|
||||
GDALRATFieldType eFieldType,
|
||||
GDALRATFieldUsage eFieldUsage ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetLinearBinning( double dfRow0Min,
|
||||
double dfBinSize ) CPL_OVERRIDE;
|
||||
virtual int GetLinearBinning( double *pdfRow0Min,
|
||||
double *pdfBinSize ) const CPL_OVERRIDE;
|
||||
CPLErr CreateColumn( const char *pszFieldName,
|
||||
GDALRATFieldType eFieldType,
|
||||
GDALRATFieldUsage eFieldUsage ) override;
|
||||
CPLErr SetLinearBinning( double dfRow0Min,
|
||||
double dfBinSize ) override;
|
||||
int GetLinearBinning( double *pdfRow0Min,
|
||||
double *pdfBinSize ) const override;
|
||||
};
|
||||
|
||||
#endif /* ndef GDAL_RAT_H_INCLUDED */
|
||||
|
||||
558
modules/globebrowsing/ext/gdal/include/gdal_simplesurf.h
Normal file
558
modules/globebrowsing/ext/gdal/include/gdal_simplesurf.h
Normal file
@@ -0,0 +1,558 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_simplesurf.h 1b31a5ae8474bacb2fb8cce9c7121b390e192c4c 2016-12-04 04:32:31Z Kurt Schwehr $
|
||||
* Project: GDAL
|
||||
* Purpose: Correlator
|
||||
* Author: Andrew Migal, migal.drew@gmail.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2012, Andrew Migal
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Class for searching corresponding points on images.
|
||||
*/
|
||||
|
||||
#ifndef GDALSIMPLESURF_H_
|
||||
#define GDALSIMPLESURF_H_
|
||||
|
||||
#include "gdal_priv.h"
|
||||
#include "cpl_conv.h"
|
||||
#include <list>
|
||||
|
||||
/**
|
||||
* @brief Class of "feature point" in raster. Used by SURF-based algorithm.
|
||||
*
|
||||
* @details This point presents coordinates of distinctive pixel in image.
|
||||
* In computer vision, feature points - the most "strong" and "unique"
|
||||
* pixels (or areas) in picture, which can be distinguished from others.
|
||||
* For more details, see FAST corner detector, SIFT, SURF and similar algorithms.
|
||||
*/
|
||||
class GDALFeaturePoint
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Standard constructor. Initializes all parameters with negative numbers
|
||||
* and allocates memory for descriptor.
|
||||
*/
|
||||
GDALFeaturePoint();
|
||||
|
||||
/**
|
||||
* Copy constructor
|
||||
* @param fp Copied instance of GDALFeaturePoint class
|
||||
*/
|
||||
GDALFeaturePoint(const GDALFeaturePoint& fp);
|
||||
|
||||
/**
|
||||
* Create instance of GDALFeaturePoint class
|
||||
*
|
||||
* @param nX X-coordinate (pixel)
|
||||
* @param nY Y-coordinate (line)
|
||||
* @param nScale Scale which contains this point (2, 4, 8, 16 and so on)
|
||||
* @param nRadius Half of the side of descriptor area
|
||||
* @param nSign Sign of Hessian determinant for this point
|
||||
*
|
||||
* @note This constructor normally is invoked by SURF-based algorithm,
|
||||
* which provides all necessary parameters.
|
||||
*/
|
||||
GDALFeaturePoint(int nX, int nY, int nScale, int nRadius, int nSign);
|
||||
virtual ~GDALFeaturePoint();
|
||||
|
||||
/** Assignment operator */
|
||||
GDALFeaturePoint& operator=(const GDALFeaturePoint& point);
|
||||
|
||||
/**
|
||||
* Provide access to point's descriptor.
|
||||
*
|
||||
* @param nIndex Position of descriptor's value.
|
||||
* nIndex should be within range from 0 to DESC_SIZE (in current version - 64)
|
||||
*
|
||||
* @return Reference to value of descriptor in 'nIndex' position.
|
||||
* If index is out of range then behaviour is undefined.
|
||||
*/
|
||||
double& operator[](int nIndex);
|
||||
|
||||
/** Descriptor length */
|
||||
static const int DESC_SIZE = 64;
|
||||
|
||||
/**
|
||||
* Fetch X-coordinate (pixel) of point
|
||||
*
|
||||
* @return X-coordinate in pixels
|
||||
*/
|
||||
int GetX() const;
|
||||
|
||||
/**
|
||||
* Set X coordinate of point
|
||||
*
|
||||
* @param nX X coordinate in pixels
|
||||
*/
|
||||
void SetX(int nX);
|
||||
|
||||
/**
|
||||
* Fetch Y-coordinate (line) of point.
|
||||
*
|
||||
* @return Y-coordinate in pixels.
|
||||
*/
|
||||
int GetY() const;
|
||||
|
||||
/**
|
||||
* Set Y coordinate of point.
|
||||
*
|
||||
* @param nY Y coordinate in pixels.
|
||||
*/
|
||||
void SetY(int nY);
|
||||
|
||||
/**
|
||||
* Fetch scale of point.
|
||||
*
|
||||
* @return Scale for this point.
|
||||
*/
|
||||
int GetScale() const ;
|
||||
|
||||
/**
|
||||
* Set scale of point.
|
||||
*
|
||||
* @param nScale Scale for this point.
|
||||
*/
|
||||
void SetScale(int nScale);
|
||||
|
||||
/**
|
||||
* Fetch radius of point.
|
||||
*
|
||||
* @return Radius for this point.
|
||||
*/
|
||||
int GetRadius() const;
|
||||
|
||||
/**
|
||||
* Set radius of point.
|
||||
*
|
||||
* @param nRadius Radius for this point.
|
||||
*/
|
||||
void SetRadius(int nRadius);
|
||||
|
||||
/**
|
||||
* Fetch sign of Hessian determinant of point.
|
||||
*
|
||||
* @return Sign for this point.
|
||||
*/
|
||||
int GetSign() const;
|
||||
|
||||
/**
|
||||
* Set sign of point.
|
||||
*
|
||||
* @param nSign Sign of Hessian determinant for this point.
|
||||
*/
|
||||
void SetSign(int nSign);
|
||||
|
||||
private:
|
||||
// Coordinates of point in image
|
||||
int nX;
|
||||
int nY;
|
||||
// --------------------
|
||||
int nScale;
|
||||
int nRadius;
|
||||
int nSign;
|
||||
// Descriptor array
|
||||
double *padfDescriptor;
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Integral image class (summed area table).
|
||||
* @details Integral image is a table for fast computing the sum of
|
||||
* values in rectangular subarea. In more detail, for 2-dimensional array
|
||||
* of numbers this class provides capability to get sum of values in
|
||||
* rectangular arbitrary area with any size in constant time.
|
||||
* Integral image is constructed from grayscale picture.
|
||||
*/
|
||||
class GDALIntegralImage
|
||||
{
|
||||
public:
|
||||
GDALIntegralImage();
|
||||
virtual ~GDALIntegralImage();
|
||||
|
||||
/**
|
||||
* Compute integral image for specified array. Result is stored internally.
|
||||
*
|
||||
* @param padfImg Pointer to 2-dimensional array of values
|
||||
* @param nHeight Number of rows in array
|
||||
* @param nWidth Number of columns in array
|
||||
*/
|
||||
void Initialize(const double **padfImg, int nHeight, int nWidth);
|
||||
|
||||
/**
|
||||
* Fetch value of specified position in integral image.
|
||||
*
|
||||
* @param nRow Row of this position
|
||||
* @param nCol Column of this position
|
||||
*
|
||||
* @return Value in specified position or zero if parameters are out of range.
|
||||
*/
|
||||
double GetValue(int nRow, int nCol);
|
||||
|
||||
/**
|
||||
* Get sum of values in specified rectangular grid. Rectangle is constructed
|
||||
* from left top point.
|
||||
*
|
||||
* @param nRow Row of left top point of rectangle
|
||||
* @param nCol Column of left top point of rectangle
|
||||
* @param nWidth Width of rectangular area (number of columns)
|
||||
* @param nHeight Height of rectangular area (number of rows)
|
||||
*
|
||||
* @return Sum of values in specified grid.
|
||||
*/
|
||||
double GetRectangleSum(int nRow, int nCol, int nWidth, int nHeight);
|
||||
|
||||
/**
|
||||
* Get value of horizontal Haar wavelet in specified square grid.
|
||||
*
|
||||
* @param nRow Row of left top point of square
|
||||
* @param nCol Column of left top point of square
|
||||
* @param nSize Side of the square
|
||||
*
|
||||
* @return Value of horizontal Haar wavelet in specified square grid.
|
||||
*/
|
||||
double HaarWavelet_X(int nRow, int nCol, int nSize);
|
||||
|
||||
/**
|
||||
* Get value of vertical Haar wavelet in specified square grid.
|
||||
*
|
||||
* @param nRow Row of left top point of square
|
||||
* @param nCol Column of left top point of square
|
||||
* @param nSize Side of the square
|
||||
*
|
||||
* @return Value of vertical Haar wavelet in specified square grid.
|
||||
*/
|
||||
double HaarWavelet_Y(int nRow, int nCol, int nSize);
|
||||
|
||||
/**
|
||||
* Fetch height of integral image.
|
||||
*
|
||||
* @return Height of integral image (number of rows).
|
||||
*/
|
||||
int GetHeight();
|
||||
|
||||
/**
|
||||
* Fetch width of integral image.
|
||||
*
|
||||
* @return Width of integral image (number of columns).
|
||||
*/
|
||||
int GetWidth();
|
||||
|
||||
private:
|
||||
double **pMatrix;
|
||||
int nWidth;
|
||||
int nHeight;
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Class for computation and storage of Hessian values in SURF-based algorithm.
|
||||
*
|
||||
* @details SURF-based algorithm normally uses this class for searching
|
||||
* feature points on raster images. Class also contains traces of Hessian matrices
|
||||
* to provide fast computations.
|
||||
*/
|
||||
class GDALOctaveLayer
|
||||
{
|
||||
public:
|
||||
GDALOctaveLayer();
|
||||
|
||||
/**
|
||||
* Create instance with provided parameters.
|
||||
*
|
||||
* @param nOctave Number of octave which contains this layer
|
||||
* @param nInterval Number of position in octave
|
||||
*
|
||||
* @note Normally constructor is invoked only by SURF-based algorithm.
|
||||
*/
|
||||
GDALOctaveLayer(int nOctave, int nInterval);
|
||||
virtual ~GDALOctaveLayer();
|
||||
|
||||
/**
|
||||
* Perform calculation of Hessian determinants and their signs
|
||||
* for specified integral image. Result is stored internally.
|
||||
*
|
||||
* @param poImg Integral image object, which provides all necessary
|
||||
* data for computation
|
||||
*
|
||||
* @note Normally method is invoked only by SURF-based algorithm.
|
||||
*/
|
||||
void ComputeLayer(GDALIntegralImage *poImg);
|
||||
|
||||
/**
|
||||
* Octave which contains this layer (1,2,3...)
|
||||
*/
|
||||
int octaveNum;
|
||||
/**
|
||||
* Length of the side of filter
|
||||
*/
|
||||
int filterSize;
|
||||
/**
|
||||
* Length of the border
|
||||
*/
|
||||
int radius;
|
||||
/**
|
||||
* Scale for this layer
|
||||
*/
|
||||
int scale;
|
||||
/**
|
||||
* Image width in pixels
|
||||
*/
|
||||
int width;
|
||||
/**
|
||||
* Image height in pixels
|
||||
*/
|
||||
int height;
|
||||
/**
|
||||
* Hessian values for image pixels
|
||||
*/
|
||||
double **detHessians;
|
||||
/**
|
||||
* Hessian signs for speeded matching
|
||||
*/
|
||||
int **signs;
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Class for handling octave layers in SURF-based algorithm.
|
||||
* @details Class contains OctaveLayers and provides capability to construct octave space and distinguish
|
||||
* feature points. Normally this class is used only by SURF-based algorithm.
|
||||
*/
|
||||
class GDALOctaveMap
|
||||
{
|
||||
CPL_DISALLOW_COPY_ASSIGN( GDALOctaveMap )
|
||||
|
||||
public:
|
||||
/**
|
||||
* Create octave space. Octave numbers are start with one. (1, 2, 3, 4, ... )
|
||||
*
|
||||
* @param nOctaveStart Number of bottom octave
|
||||
* @param nOctaveEnd Number of top octave. Should be equal or greater than OctaveStart
|
||||
*/
|
||||
GDALOctaveMap(int nOctaveStart, int nOctaveEnd);
|
||||
virtual ~GDALOctaveMap();
|
||||
|
||||
/**
|
||||
* Calculate Hessian values for octave space
|
||||
* (for all stored octave layers) using specified integral image
|
||||
* @param poImg Integral image instance which provides necessary data
|
||||
* @see GDALOctaveLayer
|
||||
*/
|
||||
void ComputeMap(GDALIntegralImage *poImg);
|
||||
|
||||
/**
|
||||
* Method makes decision that specified point
|
||||
* in middle octave layer is maximum among all points
|
||||
* from 3x3x3 neighbourhood (surrounding points in
|
||||
* bottom, middle and top layers). Provided layers should be from the same octave's interval.
|
||||
* Detects feature points.
|
||||
*
|
||||
* @param row Row of point, which is candidate to be feature point
|
||||
* @param col Column of point, which is candidate to be feature point
|
||||
* @param bot Bottom octave layer
|
||||
* @param mid Middle octave layer
|
||||
* @param top Top octave layer
|
||||
* @param threshold Threshold for feature point recognition. Detected feature point
|
||||
* will have Hessian value greater than this provided threshold.
|
||||
*
|
||||
* @return TRUE if candidate was evaluated as feature point or FALSE otherwise.
|
||||
*/
|
||||
static bool PointIsExtremum(int row, int col, GDALOctaveLayer *bot,
|
||||
GDALOctaveLayer *mid, GDALOctaveLayer *top, double threshold);
|
||||
|
||||
/**
|
||||
* 2-dimensional array of octave layers
|
||||
*/
|
||||
GDALOctaveLayer ***pMap;
|
||||
|
||||
/**
|
||||
* Value for constructing internal octave space
|
||||
*/
|
||||
static const int INTERVALS = 4;
|
||||
|
||||
/**
|
||||
* Number of bottom octave
|
||||
*/
|
||||
int octaveStart;
|
||||
|
||||
/**
|
||||
* Number of top octave. Should be equal or greater than OctaveStart
|
||||
*/
|
||||
int octaveEnd;
|
||||
};
|
||||
|
||||
/**
|
||||
* @author Andrew Migal migal.drew@gmail.com
|
||||
* @brief Class for searching corresponding points on images.
|
||||
* @details Provides capability for detection feature points
|
||||
* and finding equal points on different images.
|
||||
* Class implements simplified version of SURF algorithm (Speeded Up Robust Features).
|
||||
* As original, this realization is scale invariant, but sensitive to rotation.
|
||||
* Images should have similar rotation angles (maximum difference is up to 10-15 degrees),
|
||||
* otherwise algorithm produces incorrect and very unstable results.
|
||||
*/
|
||||
|
||||
class GDALSimpleSURF
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* Class stores indexes of pair of point
|
||||
* and distance between them.
|
||||
*/
|
||||
class MatchedPointPairInfo
|
||||
{
|
||||
public:
|
||||
MatchedPointPairInfo(int nInd_1, int nInd_2, double dfDist)
|
||||
{
|
||||
ind_1 = nInd_1;
|
||||
ind_2 = nInd_2;
|
||||
euclideanDist = dfDist;
|
||||
}
|
||||
|
||||
int ind_1;
|
||||
int ind_2;
|
||||
double euclideanDist;
|
||||
};
|
||||
|
||||
CPL_DISALLOW_COPY_ASSIGN( GDALSimpleSURF )
|
||||
|
||||
public:
|
||||
/**
|
||||
* Prepare class according to specified parameters. Octave numbers affects
|
||||
* to amount of detected points and their robustness.
|
||||
* Range between bottom and top octaves also affects to required time of detection points
|
||||
* (if range is large, algorithm should perform more operations).
|
||||
* @param nOctaveStart Number of bottom octave. Octave numbers starts with one
|
||||
* @param nOctaveEnd Number of top octave. Should be equal or greater than OctaveStart
|
||||
*
|
||||
* @note
|
||||
* Every octave finds points with specific size. For small images
|
||||
* use small octave numbers, for high resolution - large.
|
||||
* For 1024x1024 images it's normal to use any octave numbers from range 1-6.
|
||||
* (for example, octave start - 1, octave end - 3, or octave start - 2, octave end - 2.)
|
||||
* For larger images, try 1-10 range or even higher.
|
||||
* Pay attention that number of detected point decreases quickly per octave
|
||||
* for particular image. Algorithm finds more points in case of small octave numbers.
|
||||
* If method detects nothing, reduce bottom bound of octave range.
|
||||
*
|
||||
* NOTICE that every octave requires time to compute. Use a little range
|
||||
* or only one octave if execution time is significant.
|
||||
*/
|
||||
GDALSimpleSURF(int nOctaveStart, int nOctaveEnd);
|
||||
virtual ~GDALSimpleSURF();
|
||||
|
||||
/**
|
||||
* Convert image with RGB channels to grayscale using "luminosity" method.
|
||||
* Result is used in SURF-based algorithm, but may be used anywhere where
|
||||
* grayscale images with nice contrast are required.
|
||||
*
|
||||
* @param red Image's red channel
|
||||
* @param green Image's green channel
|
||||
* @param blue Image's blue channel
|
||||
* @param nXSize Width of initial image
|
||||
* @param nYSize Height of initial image
|
||||
* @param padfImg Array for resulting grayscale image
|
||||
* @param nHeight Height of resulting image
|
||||
* @param nWidth Width of resulting image
|
||||
*
|
||||
* @return CE_None or CE_Failure if error occurs.
|
||||
*/
|
||||
static CPLErr ConvertRGBToLuminosity(
|
||||
GDALRasterBand *red,
|
||||
GDALRasterBand *green,
|
||||
GDALRasterBand *blue,
|
||||
int nXSize, int nYSize,
|
||||
double **padfImg, int nHeight, int nWidth);
|
||||
|
||||
/**
|
||||
* Find feature points using specified integral image.
|
||||
*
|
||||
* @param poImg Integral image to be used
|
||||
* @param dfThreshold Threshold for feature point recognition. Detected feature point
|
||||
* will have Hessian value greater than this provided threshold.
|
||||
*
|
||||
* @note Typical threshold's value is 0,001. But this value
|
||||
* can be various in each case and depends on image's nature.
|
||||
* For example, value can be 0.002 or 0.005.
|
||||
* Fill free to experiment with it.
|
||||
* If threshold is high, than number of detected feature points is small,
|
||||
* and vice versa.
|
||||
*/
|
||||
std::vector<GDALFeaturePoint>*
|
||||
ExtractFeaturePoints(GDALIntegralImage *poImg, double dfThreshold);
|
||||
|
||||
/**
|
||||
* Find corresponding points (equal points in two collections).
|
||||
*
|
||||
* @param poMatchPairs Resulting collection for matched points
|
||||
* @param poFirstCollect Points on the first image
|
||||
* @param poSecondCollect Points on the second image
|
||||
* @param dfThreshold Value from 0 to 1. Threshold affects to number of
|
||||
* matched points. If threshold is lower, amount of corresponding
|
||||
* points is larger, and vice versa
|
||||
*
|
||||
* @return CE_None or CE_Failure if error occurs.
|
||||
*/
|
||||
static CPLErr MatchFeaturePoints(
|
||||
std::vector<GDALFeaturePoint*> *poMatchPairs,
|
||||
std::vector<GDALFeaturePoint> *poFirstCollect,
|
||||
std::vector<GDALFeaturePoint> *poSecondCollect,
|
||||
double dfThreshold);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Compute euclidean distance between descriptors of two feature points.
|
||||
* It's used in comparison and matching of points.
|
||||
*
|
||||
* @param firstPoint First feature point to be compared
|
||||
* @param secondPoint Second feature point to be compared
|
||||
*
|
||||
* @return Euclidean distance between descriptors.
|
||||
*/
|
||||
static double GetEuclideanDistance(
|
||||
GDALFeaturePoint &firstPoint, GDALFeaturePoint &secondPoint);
|
||||
|
||||
/**
|
||||
* Set provided distance values to range from 0 to 1.
|
||||
*
|
||||
* @param poList List of distances to be normalized
|
||||
*/
|
||||
static void NormalizeDistances(std::list<MatchedPointPairInfo> *poList);
|
||||
|
||||
/**
|
||||
* Compute descriptor for specified feature point.
|
||||
*
|
||||
* @param poPoint Feature point instance
|
||||
* @param poImg image where feature point was found
|
||||
*/
|
||||
static void SetDescriptor(GDALFeaturePoint *poPoint, GDALIntegralImage *poImg);
|
||||
|
||||
private:
|
||||
int octaveStart;
|
||||
int octaveEnd;
|
||||
GDALOctaveMap *poOctMap;
|
||||
};
|
||||
|
||||
#endif /* GDALSIMPLESURF_H_ */
|
||||
223
modules/globebrowsing/ext/gdal/include/gdal_utils.h
Normal file
223
modules/globebrowsing/ext/gdal/include/gdal_utils.h
Normal file
@@ -0,0 +1,223 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_utils.h dc3819d387764593c0fb5a5c4d02c21a848a4c9d 2018-04-12 18:07:28 +0200 Even Rouault $
|
||||
*
|
||||
* Project: GDAL Utilities
|
||||
* Purpose: GDAL Utilities Public Declarations.
|
||||
* Author: Faza Mahamood, fazamhd at gmail dot com
|
||||
*
|
||||
* ****************************************************************************
|
||||
* Copyright (c) 1998, Frank Warmerdam
|
||||
* Copyright (c) 2007-2015, Even Rouault <even.rouault at spatialys.com>
|
||||
* Copyright (c) 2015, Faza Mahamood
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDAL_UTILS_H_INCLUDED
|
||||
#define GDAL_UTILS_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdal_utils.h
|
||||
*
|
||||
* Public (C callable) GDAL Utilities entry points.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
#include "cpl_port.h"
|
||||
#include "gdal.h"
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/*! Options for GDALInfo(). Opaque type */
|
||||
typedef struct GDALInfoOptions GDALInfoOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALInfoOptionsForBinary GDALInfoOptionsForBinary;
|
||||
|
||||
GDALInfoOptions CPL_DLL *GDALInfoOptionsNew(char** papszArgv, GDALInfoOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALInfoOptionsFree( GDALInfoOptions *psOptions );
|
||||
|
||||
char CPL_DLL *GDALInfo( GDALDatasetH hDataset, const GDALInfoOptions *psOptions );
|
||||
|
||||
/*! Options for GDALTranslate(). Opaque type */
|
||||
typedef struct GDALTranslateOptions GDALTranslateOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALTranslateOptionsForBinary GDALTranslateOptionsForBinary;
|
||||
|
||||
GDALTranslateOptions CPL_DLL *GDALTranslateOptionsNew(char** papszArgv,
|
||||
GDALTranslateOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALTranslateOptionsFree( GDALTranslateOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALTranslateOptionsSetProgress( GDALTranslateOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALTranslate(const char *pszDestFilename,
|
||||
GDALDatasetH hSrcDataset,
|
||||
const GDALTranslateOptions *psOptions,
|
||||
int *pbUsageError);
|
||||
|
||||
/*! Options for GDALWarp(). Opaque type */
|
||||
typedef struct GDALWarpAppOptions GDALWarpAppOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALWarpAppOptionsForBinary GDALWarpAppOptionsForBinary;
|
||||
|
||||
GDALWarpAppOptions CPL_DLL *GDALWarpAppOptionsNew(char** papszArgv,
|
||||
GDALWarpAppOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALWarpAppOptionsFree( GDALWarpAppOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALWarpAppOptionsSetProgress( GDALWarpAppOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
void CPL_DLL GDALWarpAppOptionsSetQuiet( GDALWarpAppOptions *psOptions,
|
||||
int bQuiet );
|
||||
void CPL_DLL GDALWarpAppOptionsSetWarpOption( GDALWarpAppOptions *psOptions,
|
||||
const char* pszKey,
|
||||
const char* pszValue );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALWarp( const char *pszDest, GDALDatasetH hDstDS,
|
||||
int nSrcCount, GDALDatasetH *pahSrcDS,
|
||||
const GDALWarpAppOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALVectorTranslate(). Opaque type */
|
||||
typedef struct GDALVectorTranslateOptions GDALVectorTranslateOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALVectorTranslateOptionsForBinary GDALVectorTranslateOptionsForBinary;
|
||||
|
||||
GDALVectorTranslateOptions CPL_DLL *GDALVectorTranslateOptionsNew(char** papszArgv,
|
||||
GDALVectorTranslateOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALVectorTranslateOptionsFree( GDALVectorTranslateOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALVectorTranslateOptionsSetProgress( GDALVectorTranslateOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALVectorTranslate( const char *pszDest, GDALDatasetH hDstDS, int nSrcCount,
|
||||
GDALDatasetH *pahSrcDS,
|
||||
const GDALVectorTranslateOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALDEMProcessing(). Opaque type */
|
||||
typedef struct GDALDEMProcessingOptions GDALDEMProcessingOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALDEMProcessingOptionsForBinary GDALDEMProcessingOptionsForBinary;
|
||||
|
||||
GDALDEMProcessingOptions CPL_DLL *GDALDEMProcessingOptionsNew(char** papszArgv,
|
||||
GDALDEMProcessingOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALDEMProcessingOptionsFree( GDALDEMProcessingOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALDEMProcessingOptionsSetProgress( GDALDEMProcessingOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALDEMProcessing(const char *pszDestFilename,
|
||||
GDALDatasetH hSrcDataset,
|
||||
const char* pszProcessing,
|
||||
const char* pszColorFilename,
|
||||
const GDALDEMProcessingOptions *psOptions,
|
||||
int *pbUsageError);
|
||||
|
||||
/*! Options for GDALNearblack(). Opaque type */
|
||||
typedef struct GDALNearblackOptions GDALNearblackOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALNearblackOptionsForBinary GDALNearblackOptionsForBinary;
|
||||
|
||||
GDALNearblackOptions CPL_DLL *GDALNearblackOptionsNew(char** papszArgv,
|
||||
GDALNearblackOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALNearblackOptionsFree( GDALNearblackOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALNearblackOptionsSetProgress( GDALNearblackOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALNearblack( const char *pszDest, GDALDatasetH hDstDS,
|
||||
GDALDatasetH hSrcDS,
|
||||
const GDALNearblackOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALGrid(). Opaque type */
|
||||
typedef struct GDALGridOptions GDALGridOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALGridOptionsForBinary GDALGridOptionsForBinary;
|
||||
|
||||
GDALGridOptions CPL_DLL *GDALGridOptionsNew(char** papszArgv,
|
||||
GDALGridOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALGridOptionsFree( GDALGridOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALGridOptionsSetProgress( GDALGridOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALGrid( const char *pszDest,
|
||||
GDALDatasetH hSrcDS,
|
||||
const GDALGridOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALRasterize(). Opaque type */
|
||||
typedef struct GDALRasterizeOptions GDALRasterizeOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALRasterizeOptionsForBinary GDALRasterizeOptionsForBinary;
|
||||
|
||||
GDALRasterizeOptions CPL_DLL *GDALRasterizeOptionsNew(char** papszArgv,
|
||||
GDALRasterizeOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALRasterizeOptionsFree( GDALRasterizeOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALRasterizeOptionsSetProgress( GDALRasterizeOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALRasterize( const char *pszDest, GDALDatasetH hDstDS,
|
||||
GDALDatasetH hSrcDS,
|
||||
const GDALRasterizeOptions *psOptions, int *pbUsageError );
|
||||
|
||||
/*! Options for GDALBuildVRT(). Opaque type */
|
||||
typedef struct GDALBuildVRTOptions GDALBuildVRTOptions;
|
||||
|
||||
/** Opaque type */
|
||||
typedef struct GDALBuildVRTOptionsForBinary GDALBuildVRTOptionsForBinary;
|
||||
|
||||
GDALBuildVRTOptions CPL_DLL *GDALBuildVRTOptionsNew(char** papszArgv,
|
||||
GDALBuildVRTOptionsForBinary* psOptionsForBinary);
|
||||
|
||||
void CPL_DLL GDALBuildVRTOptionsFree( GDALBuildVRTOptions *psOptions );
|
||||
|
||||
void CPL_DLL GDALBuildVRTOptionsSetProgress( GDALBuildVRTOptions *psOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void *pProgressData );
|
||||
|
||||
GDALDatasetH CPL_DLL GDALBuildVRT( const char *pszDest,
|
||||
int nSrcCount, GDALDatasetH *pahSrcDS, const char* const* papszSrcDSNames,
|
||||
const GDALBuildVRTOptions *psOptions, int *pbUsageError );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* GDAL_UTILS_H_INCLUDED */
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: gdal_version.h 38167 2017-04-28 16:00:45Z rouault $ */
|
||||
/* $Id$ */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* GDAL Version Information. */
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
#ifndef GDAL_VERSION_MAJOR
|
||||
# define GDAL_VERSION_MAJOR 2
|
||||
# define GDAL_VERSION_MINOR 2
|
||||
# define GDAL_VERSION_REV 0
|
||||
# define GDAL_VERSION_MINOR 3
|
||||
# define GDAL_VERSION_REV 2
|
||||
# define GDAL_VERSION_BUILD 0
|
||||
#endif
|
||||
|
||||
@@ -22,9 +22,11 @@
|
||||
# define GDAL_VERSION_NUM (GDAL_COMPUTE_VERSION(GDAL_VERSION_MAJOR,GDAL_VERSION_MINOR,GDAL_VERSION_REV)+GDAL_VERSION_BUILD)
|
||||
#endif
|
||||
|
||||
#if !defined(DO_NOT_DEFINE_GDAL_RELEASE_DATE_AND_GDAL_RELEASE_NAME)
|
||||
#ifndef GDAL_RELEASE_DATE
|
||||
# define GDAL_RELEASE_DATE 20170428
|
||||
# define GDAL_RELEASE_DATE 20180921
|
||||
#endif
|
||||
#ifndef GDAL_RELEASE_NAME
|
||||
# define GDAL_RELEASE_NAME "2.2.0"
|
||||
# define GDAL_RELEASE_NAME "2.3.2"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
110
modules/globebrowsing/ext/gdal/include/gdal_vrt.h
Normal file
110
modules/globebrowsing/ext/gdal/include/gdal_vrt.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdal_vrt.h cad9c764a44d2b5383a70a341158b4518b25cedd 2016-11-30 01:46:53Z Kurt Schwehr $
|
||||
*
|
||||
* Project: Virtual GDAL Datasets
|
||||
* Purpose: C/Public declarations of virtual GDAL dataset objects.
|
||||
* Author: Andrey Kiselev, dron@ak4719.spb.edu
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2007, Andrey Kiselev <dron@ak4719.spb.edu>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDAL_VRT_H_INCLUDED
|
||||
#define GDAL_VRT_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdal_vrt.h
|
||||
*
|
||||
* Public (C callable) entry points for virtual GDAL dataset objects.
|
||||
*/
|
||||
|
||||
#include "cpl_error.h"
|
||||
#include "cpl_minixml.h"
|
||||
#include "cpl_port.h"
|
||||
#include "gdal.h"
|
||||
|
||||
/** Special value to indicate that nodata is not set */
|
||||
#define VRT_NODATA_UNSET -1234.56
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/** Type for a function that returns the pixel data in a provided window */
|
||||
typedef CPLErr
|
||||
(*VRTImageReadFunc)( void *hCBData,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
void *pData );
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Define handle types related to various VRT dataset classes. */
|
||||
/* -------------------------------------------------------------------- */
|
||||
/*! @cond Doxygen_Suppress */
|
||||
typedef void *VRTAveragedSourceH;
|
||||
typedef void *VRTAverageFilteredSourceH;
|
||||
typedef void *VRTComplexSourceH;
|
||||
typedef void *VRTDerivedRasterBandH;
|
||||
typedef void *VRTDriverH;
|
||||
typedef void *VRTFilteredSourceH;
|
||||
typedef void *VRTFuncSourceH;
|
||||
typedef void *VRTKernelFilteredSourceH;
|
||||
typedef void *VRTRasterBandH;
|
||||
typedef void *VRTRawRasterBandH;
|
||||
typedef void *VRTSimpleSourceH;
|
||||
typedef void *VRTSourceH;
|
||||
typedef void *VRTWarpedDatasetH;
|
||||
typedef void *VRTWarpedRasterBandH;
|
||||
/*! @endcond */
|
||||
|
||||
/** Opaque type for a VRT dataset */
|
||||
typedef void *VRTDatasetH;
|
||||
/** Opaque type for a VRT sourced raster band */
|
||||
typedef void *VRTSourcedRasterBandH;
|
||||
|
||||
/* ==================================================================== */
|
||||
/* VRTDataset class. */
|
||||
/* ==================================================================== */
|
||||
|
||||
VRTDatasetH CPL_DLL CPL_STDCALL VRTCreate( int, int );
|
||||
void CPL_DLL CPL_STDCALL VRTFlushCache( VRTDatasetH );
|
||||
CPLXMLNode CPL_DLL * CPL_STDCALL VRTSerializeToXML( VRTDatasetH, const char * );
|
||||
int CPL_DLL CPL_STDCALL VRTAddBand( VRTDatasetH, GDALDataType, char ** );
|
||||
|
||||
/* ==================================================================== */
|
||||
/* VRTSourcedRasterBand class. */
|
||||
/* ==================================================================== */
|
||||
|
||||
CPLErr CPL_STDCALL VRTAddSource( VRTSourcedRasterBandH, VRTSourceH );
|
||||
CPLErr CPL_DLL CPL_STDCALL VRTAddSimpleSource( VRTSourcedRasterBandH,
|
||||
GDALRasterBandH,
|
||||
int, int, int, int,
|
||||
int, int, int, int,
|
||||
const char *, double );
|
||||
CPLErr CPL_DLL CPL_STDCALL VRTAddComplexSource( VRTSourcedRasterBandH,
|
||||
GDALRasterBandH,
|
||||
int, int, int, int,
|
||||
int, int, int, int,
|
||||
double, double, double );
|
||||
CPLErr CPL_DLL CPL_STDCALL VRTAddFuncSource( VRTSourcedRasterBandH,
|
||||
VRTImageReadFunc,
|
||||
void *, double );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* GDAL_VRT_H_INCLUDED */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalexif.h 35883 2016-10-24 05:49:15Z goatbar $
|
||||
* $Id: gdalexif.h 45d3d60d2b90c52d7ef69f5a9336219e4c6069d7 2017-09-14 09:50:30Z Even Rouault $
|
||||
*
|
||||
* Project: JPEG JFIF Driver
|
||||
* Purpose: Implement GDAL JPEG Support based on IJG libjpeg.
|
||||
@@ -7,6 +7,7 @@
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2000, Frank Warmerdam
|
||||
* Copyright (c) 2017, Even Rouault
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -29,166 +30,6 @@
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
#ifdef RENAME_INTERNAL_LIBTIFF_SYMBOLS
|
||||
#include "../frmts/gtiff/libtiff/gdal_libtiff_symbol_rename.h"
|
||||
#endif
|
||||
|
||||
static const struct gpsname {
|
||||
GUInt16 tag;
|
||||
const char* name;
|
||||
} gpstags [] = {
|
||||
{ 0x00, "EXIF_GPSVersionID" },
|
||||
{ 0x01, "EXIF_GPSLatitudeRef" },
|
||||
{ 0x02, "EXIF_GPSLatitude" },
|
||||
{ 0x03, "EXIF_GPSLongitudeRef" },
|
||||
{ 0x04, "EXIF_GPSLongitude" },
|
||||
{ 0x05, "EXIF_GPSAltitudeRef" },
|
||||
{ 0x06, "EXIF_GPSAltitude" },
|
||||
{ 0x07, "EXIF_GPSTimeStamp" },
|
||||
{ 0x08, "EXIF_GPSSatellites" },
|
||||
{ 0x09, "EXIF_GPSStatus" },
|
||||
{ 0x0a, "EXIF_GPSMeasureMode" },
|
||||
{ 0x0b, "EXIF_GPSDOP" },
|
||||
{ 0x0c, "EXIF_GPSSpeedRef"},
|
||||
{ 0x0d, "EXIF_GPSSpeed"},
|
||||
{ 0x0e, "EXIF_GPSTrackRef"},
|
||||
{ 0x0f, "EXIF_GPSTrack"},
|
||||
{ 0x10, "EXIF_GPSImgDirectionRef"},
|
||||
{ 0x11, "EXIF_GPSImgDirection"},
|
||||
{ 0x12, "EXIF_GPSMapDatum"},
|
||||
{ 0x13, "EXIF_GPSDestLatitudeRef"},
|
||||
{ 0x14, "EXIF_GPSDestLatitude"},
|
||||
{ 0x15, "EXIF_GPSDestLongitudeRef"},
|
||||
{ 0x16, "EXIF_GPSDestLongitude"},
|
||||
{ 0x17, "EXIF_GPSDestBearingRef"},
|
||||
{ 0x18, "EXIF_GPSDestBearing"},
|
||||
{ 0x19, "EXIF_GPSDestDistanceRef"},
|
||||
{ 0x1a, "EXIF_GPSDestDistance"},
|
||||
{ 0x1b, "EXIF_GPSProcessingMethod"},
|
||||
{ 0x1c, "EXIF_GPSAreaInformation"},
|
||||
{ 0x1d, "EXIF_GPSDateStamp"},
|
||||
{ 0x1e, "EXIF_GPSDifferential"},
|
||||
{ 0xffff, ""}
|
||||
};
|
||||
|
||||
static const struct tagname {
|
||||
GUInt16 tag;
|
||||
const char* name;
|
||||
} tagnames [] = {
|
||||
//{ 0x100, "EXIF_Image_Width"},
|
||||
// { 0x101, "EXIF_Image_Length"},
|
||||
{ 0x102, "EXIF_BitsPerSample"},
|
||||
{ 0x103, "EXIF_Compression"},
|
||||
{ 0x106, "EXIF_PhotometricInterpretation"},
|
||||
{ 0x10A, "EXIF_Fill_Order"},
|
||||
{ 0x10D, "EXIF_Document_Name"},
|
||||
{ 0x10E, "EXIF_ImageDescription"},
|
||||
{ 0x10F, "EXIF_Make"},
|
||||
{ 0x110, "EXIF_Model"},
|
||||
{ 0x111, "EXIF_StripOffsets"},
|
||||
{ 0x112, "EXIF_Orientation"},
|
||||
{ 0x115, "EXIF_SamplesPerPixel"},
|
||||
{ 0x116, "EXIF_RowsPerStrip"},
|
||||
{ 0x117, "EXIF_StripByteCounts"},
|
||||
{ 0x11A, "EXIF_XResolution"},
|
||||
{ 0x11B, "EXIF_YResolution"},
|
||||
{ 0x11C, "EXIF_PlanarConfiguration"},
|
||||
{ 0x128, "EXIF_ResolutionUnit"},
|
||||
{ 0x12D, "EXIF_TransferFunction"},
|
||||
{ 0x131, "EXIF_Software"},
|
||||
{ 0x132, "EXIF_DateTime"},
|
||||
{ 0x13B, "EXIF_Artist"},
|
||||
{ 0x13E, "EXIF_WhitePoint"},
|
||||
{ 0x13F, "EXIF_PrimaryChromaticities"},
|
||||
{ 0x156, "EXIF_Transfer_Range"},
|
||||
{ 0x200, "EXIF_JPEG_Proc"},
|
||||
{ 0x201, "EXIF_JPEGInterchangeFormat"},
|
||||
{ 0x202, "EXIF_JPEGInterchangeFormatLength"},
|
||||
{ 0x211, "EXIF_YCbCrCoefficients"},
|
||||
{ 0x212, "EXIF_YCbCrSubSampling"},
|
||||
{ 0x213, "EXIF_YCbCrPositioning"},
|
||||
{ 0x214, "EXIF_ReferenceBlackWhite"},
|
||||
{ 0x828D, "EXIF_CFA_Repeat_Pattern_Dim"},
|
||||
{ 0x828E, "EXIF_CFA_Pattern"},
|
||||
{ 0x828F, "EXIF_Battery_Level"},
|
||||
{ 0x8298, "EXIF_Copyright"},
|
||||
{ 0x829A, "EXIF_ExposureTime"},
|
||||
{ 0x829D, "EXIF_FNumber"},
|
||||
{ 0x83BB, "EXIF_IPTC/NAA"},
|
||||
// { 0x8769, "EXIF_Offset"},
|
||||
{ 0x8773, "EXIF_Inter_Color_Profile"},
|
||||
{ 0x8822, "EXIF_ExposureProgram"},
|
||||
{ 0x8824, "EXIF_SpectralSensitivity"},
|
||||
// { 0x8825, "EXIF_GPSOffset"},
|
||||
{ 0x8827, "EXIF_ISOSpeedRatings"},
|
||||
{ 0x8828, "EXIF_OECF"},
|
||||
{ 0x9000, "EXIF_ExifVersion"},
|
||||
{ 0x9003, "EXIF_DateTimeOriginal"},
|
||||
{ 0x9004, "EXIF_DateTimeDigitized"},
|
||||
{ 0x9101, "EXIF_ComponentsConfiguration"},
|
||||
{ 0x9102, "EXIF_CompressedBitsPerPixel"},
|
||||
{ 0x9201, "EXIF_ShutterSpeedValue"},
|
||||
{ 0x9202, "EXIF_ApertureValue"},
|
||||
{ 0x9203, "EXIF_BrightnessValue"},
|
||||
{ 0x9204, "EXIF_ExposureBiasValue"},
|
||||
{ 0x9205, "EXIF_MaxApertureValue"},
|
||||
{ 0x9206, "EXIF_SubjectDistance"},
|
||||
{ 0x9207, "EXIF_MeteringMode"},
|
||||
{ 0x9208, "EXIF_LightSource"},
|
||||
{ 0x9209, "EXIF_Flash"},
|
||||
{ 0x920A, "EXIF_FocalLength"},
|
||||
{ 0x9214, "EXIF_SubjectArea"},
|
||||
{ 0x927C, "EXIF_MakerNote"},
|
||||
{ 0x9286, "EXIF_UserComment"},
|
||||
{ 0x9290, "EXIF_SubSecTime"},
|
||||
{ 0x9291, "EXIF_SubSecTime_Original"},
|
||||
{ 0x9292, "EXIF_SubSecTime_Digitized"},
|
||||
{ 0xA000, "EXIF_FlashpixVersion"},
|
||||
{ 0xA001, "EXIF_ColorSpace"},
|
||||
{ 0xA002, "EXIF_PixelXDimension"},
|
||||
{ 0xA003, "EXIF_PixelYDimension"},
|
||||
{ 0xA004, "EXIF_RelatedSoundFile"},
|
||||
// { 0xA005, "EXIF_InteroperabilityOffset"},
|
||||
{ 0xA20B, "EXIF_FlashEnergy"}, // 0x920B in TIFF/EP
|
||||
{ 0xA20C, "EXIF_SpatialFrequencyResponse"}, // 0x920C - -
|
||||
{ 0xA20E, "EXIF_FocalPlaneXResolution"}, // 0x920E - -
|
||||
{ 0xA20F, "EXIF_FocalPlaneYResolution"}, // 0x920F - -
|
||||
{ 0xA210, "EXIF_FocalPlaneResolutionUnit"}, // 0x9210 - -
|
||||
{ 0xA214, "EXIF_SubjectLocation"}, // 0x9214 - -
|
||||
{ 0xA215, "EXIF_ExposureIndex"}, // 0x9215 - -
|
||||
{ 0xA217, "EXIF_SensingMethod"}, // 0x9217 - -
|
||||
{ 0xA300, "EXIF_FileSource"},
|
||||
{ 0xA301, "EXIF_SceneType"},
|
||||
{ 0xA302, "EXIF_CFAPattern"},
|
||||
{ 0xA401, "EXIF_CustomRendered"},
|
||||
{ 0xA402, "EXIF_ExposureMode"},
|
||||
{ 0XA403, "EXIF_WhiteBalance"},
|
||||
{ 0xA404, "EXIF_DigitalZoomRatio"},
|
||||
{ 0xA405, "EXIF_FocalLengthIn35mmFilm"},
|
||||
{ 0xA406, "EXIF_SceneCaptureType"},
|
||||
{ 0xA407, "EXIF_GainControl"},
|
||||
{ 0xA408, "EXIF_Contrast"},
|
||||
{ 0xA409, "EXIF_Saturation"},
|
||||
{ 0xA40A, "EXIF_Sharpness"},
|
||||
{ 0xA40B, "EXIF_DeviceSettingDescription"},
|
||||
{ 0xA40C, "EXIF_SubjectDistanceRange"},
|
||||
{ 0xA420, "EXIF_ImageUniqueID"},
|
||||
{ 0x0000, ""}
|
||||
};
|
||||
|
||||
static const struct intr_tag {
|
||||
GInt16 tag;
|
||||
const char* name;
|
||||
} intr_tags [] = {
|
||||
|
||||
{ 0x1, "EXIF_Interoperability_Index"},
|
||||
{ 0x2, "EXIF_Interoperability_Version"},
|
||||
{ 0x1000, "EXIF_Related_Image_File_Format"},
|
||||
{ 0x1001, "EXIF_Related_Image_Width"},
|
||||
{ 0x1002, "EXIF_Related_Image_Length"},
|
||||
{ 0x0000, ""}
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
TIFF_NOTYPE = 0, /* placeholder */
|
||||
TIFF_BYTE = 1, /* 8-bit unsigned integer */
|
||||
@@ -224,15 +65,12 @@ typedef struct {
|
||||
GUInt32 tdir_offset; /* byte offset to field data */
|
||||
} GDALEXIFTIFFDirEntry;
|
||||
|
||||
CPL_C_START
|
||||
/* Table of tag datatype widths. */
|
||||
extern int TIFFDataWidth(GDALEXIFTIFFDataType);
|
||||
extern void TIFFSwabShort(GUInt16*);
|
||||
extern void TIFFSwabLong(GUInt32*);
|
||||
extern void TIFFSwabDouble(double*);
|
||||
extern void TIFFSwabArrayOfShort(GUInt16*, unsigned long);
|
||||
extern void TIFFSwabArrayOfLong(GUInt32*, unsigned long);
|
||||
extern void TIFFSwabArrayOfDouble(double*, unsigned long);
|
||||
CPL_C_END
|
||||
GByte* EXIFCreate(char** papszEXIFMetadata,
|
||||
GByte* pabyThumbnail,
|
||||
GUInt32 nThumbnailSize,
|
||||
GUInt32 nThumbnailWidth,
|
||||
GUInt32 nThumbnailHeight,
|
||||
GUInt32 *pnOutBufferSize);
|
||||
|
||||
|
||||
//! @endcond
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalgeorefpamdataset.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
* $Id: gdalgeorefpamdataset.h 773b7550bb86d46bc587f547f5db549566665834 2017-12-18 04:05:13Z Kurt Schwehr $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: GDALPamDataset with internal storage for georeferencing, with
|
||||
@@ -60,26 +60,26 @@ class CPL_DLL GDALGeorefPamDataset : public GDALPamDataset
|
||||
char** m_papszMainMD;
|
||||
|
||||
public:
|
||||
GDALGeorefPamDataset();
|
||||
virtual ~GDALGeorefPamDataset();
|
||||
GDALGeorefPamDataset();
|
||||
~GDALGeorefPamDataset() override;
|
||||
|
||||
virtual CPLErr TryLoadXML(char **papszSiblingFiles = NULL) CPL_OVERRIDE;
|
||||
CPLErr TryLoadXML(char **papszSiblingFiles = nullptr) override;
|
||||
|
||||
virtual CPLErr GetGeoTransform( double * ) CPL_OVERRIDE;
|
||||
virtual const char *GetProjectionRef() CPL_OVERRIDE;
|
||||
CPLErr GetGeoTransform( double * ) override;
|
||||
const char *GetProjectionRef() override;
|
||||
|
||||
virtual int GetGCPCount() CPL_OVERRIDE;
|
||||
virtual const char *GetGCPProjection() CPL_OVERRIDE;
|
||||
virtual const GDAL_GCP *GetGCPs() CPL_OVERRIDE;
|
||||
int GetGCPCount() override;
|
||||
const char *GetGCPProjection() override;
|
||||
const GDAL_GCP *GetGCPs() override;
|
||||
|
||||
virtual char **GetMetadata( const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
virtual CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) CPL_OVERRIDE;
|
||||
char **GetMetadata( const char * pszDomain = "" ) override;
|
||||
const char *GetMetadataItem( const char * pszName,
|
||||
const char * pszDomain = "" ) override;
|
||||
CPLErr SetMetadata( char ** papszMetadata,
|
||||
const char * pszDomain = "" ) override;
|
||||
CPLErr SetMetadataItem( const char * pszName,
|
||||
const char * pszValue,
|
||||
const char * pszDomain = "" ) override;
|
||||
};
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
140
modules/globebrowsing/ext/gdal/include/gdalgrid.h
Normal file
140
modules/globebrowsing/ext/gdal/include/gdalgrid.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalgrid.h fcf615cbf6b2e03db17171af0ebba6da4b4a562d 2016-08-05 17:13:05Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL Gridding API.
|
||||
* Purpose: Prototypes, and definitions for of GDAL scattered data gridder.
|
||||
* Author: Andrey Kiselev, dron@ak4719.spb.edu
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2007, Andrey Kiselev <dron@ak4719.spb.edu>
|
||||
* Copyright (c) 2012, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDALGRID_H_INCLUDED
|
||||
#define GDALGRID_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdalgrid.h
|
||||
*
|
||||
* GDAL gridder related entry points and definitions.
|
||||
*/
|
||||
|
||||
#include "gdal_alg.h"
|
||||
|
||||
/*
|
||||
* GridCreate Algorithm names
|
||||
*/
|
||||
|
||||
static const char szAlgNameInvDist[] = "invdist";
|
||||
static const char szAlgNameInvDistNearestNeighbor[] = "invdistnn";
|
||||
static const char szAlgNameAverage[] = "average";
|
||||
static const char szAlgNameNearest[] = "nearest";
|
||||
static const char szAlgNameMinimum[] = "minimum";
|
||||
static const char szAlgNameMaximum[] = "maximum";
|
||||
static const char szAlgNameRange[] = "range";
|
||||
static const char szAlgNameCount[] = "count";
|
||||
static const char szAlgNameAverageDistance[] = "average_distance";
|
||||
static const char szAlgNameAverageDistancePts[] = "average_distance_pts";
|
||||
static const char szAlgNameLinear[] = "linear";
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
typedef CPLErr (*GDALGridFunction)( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
/*! @endcond */
|
||||
|
||||
CPLErr
|
||||
GDALGridInverseDistanceToAPower( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridInverseDistanceToAPowerNearestNeighbor( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridInverseDistanceToAPowerNoSearch( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridMovingAverage( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridNearestNeighbor( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricMinimum( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricMaximum( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricRange( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricCount( const void *, GUInt32,
|
||||
const double *, const double *, const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricAverageDistance( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *, double, double, double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridDataMetricAverageDistancePts( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *, double, double,
|
||||
double *,
|
||||
void* );
|
||||
CPLErr
|
||||
GDALGridLinear( const void *, GUInt32,
|
||||
const double *, const double *,
|
||||
const double *,
|
||||
double, double, double *,
|
||||
void* );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
ParseAlgorithmAndOptions( const char *,
|
||||
GDALGridAlgorithm *,
|
||||
void ** );
|
||||
CPL_C_END
|
||||
|
||||
#endif /* GDALGRID_H_INCLUDED */
|
||||
94
modules/globebrowsing/ext/gdal/include/gdalgrid_priv.h
Normal file
94
modules/globebrowsing/ext/gdal/include/gdalgrid_priv.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalgrid_priv.h 538551c247adf9f139ab49ffd68629bf93bb4404 2016-08-13 21:20:46Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL Gridding API.
|
||||
* Purpose: Prototypes, and definitions for of GDAL scattered data gridder.
|
||||
* Author: Even Rouault, <even dot rouault at mines dash paris dot org>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2013, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDALGRID_PRIV_H
|
||||
#define GDALGRID_PRIV_H
|
||||
|
||||
#include "cpl_error.h"
|
||||
#include "cpl_quad_tree.h"
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const double* padfX;
|
||||
const double* padfY;
|
||||
} GDALGridXYArrays;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GDALGridXYArrays* psXYArrays;
|
||||
int i;
|
||||
} GDALGridPoint;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CPLQuadTree* hQuadTree;
|
||||
double dfInitialSearchRadius;
|
||||
float *pafX; // Aligned to be usable with AVX
|
||||
float *pafY;
|
||||
float *pafZ;
|
||||
GDALTriangulation* psTriangulation;
|
||||
int nInitialFacetIdx;
|
||||
/*! Weighting power divided by 2 (pre-computation). */
|
||||
double dfPowerDiv2PreComp;
|
||||
/*! The radius of search circle squared (pre-computation). */
|
||||
double dfRadiusPower2PreComp;
|
||||
/*! The radius of search circle to power 4 (pre-computation). */
|
||||
double dfRadiusPower4PreComp;
|
||||
} GDALGridExtraParameters;
|
||||
|
||||
#ifdef HAVE_SSE_AT_COMPILE_TIME
|
||||
CPLErr
|
||||
GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE(
|
||||
const void *poOptions,
|
||||
GUInt32 nPoints,
|
||||
const double *unused_padfX,
|
||||
const double *unused_padfY,
|
||||
const double *unused_padfZ,
|
||||
double dfXPoint, double dfYPoint,
|
||||
double *pdfValue,
|
||||
void* hExtraParamsIn );
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVX_AT_COMPILE_TIME
|
||||
CPLErr GDALGridInverseDistanceToAPower2NoSmoothingNoSearchAVX(
|
||||
const void *poOptions,
|
||||
GUInt32 nPoints,
|
||||
const double *unused_padfX,
|
||||
const double *unused_padfY,
|
||||
const double *unused_padfZ,
|
||||
double dfXPoint, double dfYPoint,
|
||||
double *pdfValue,
|
||||
void* hExtraParamsIn );
|
||||
#endif
|
||||
|
||||
//! @endcond
|
||||
|
||||
#endif // GDALGRID_PRIV_H
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdaljp2abstractdataset.h 36501 2016-11-25 14:09:24Z rouault $
|
||||
* $Id: gdaljp2abstractdataset.h d10f99bfacb1d7c3331a539c4667d1c95199313d 2017-12-18 12:00:18Z Kurt Schwehr $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: GDALGeorefPamDataset with helper to read georeferencing and other
|
||||
@@ -43,20 +43,20 @@ class CPL_DLL GDALJP2AbstractDataset: public GDALGeorefPamDataset
|
||||
int m_nWORLDFILEIndex;
|
||||
|
||||
protected:
|
||||
virtual int CloseDependentDatasets() CPL_OVERRIDE;
|
||||
int CloseDependentDatasets() override;
|
||||
|
||||
public:
|
||||
GDALJP2AbstractDataset();
|
||||
virtual ~GDALJP2AbstractDataset();
|
||||
GDALJP2AbstractDataset();
|
||||
~GDALJP2AbstractDataset() override;
|
||||
|
||||
void LoadJP2Metadata( GDALOpenInfo* poOpenInfo,
|
||||
const char* pszOverrideFilename = NULL );
|
||||
void LoadVectorLayers( int bOpenRemoteResources = FALSE );
|
||||
void LoadJP2Metadata( GDALOpenInfo* poOpenInfo,
|
||||
const char* pszOverrideFilename = nullptr );
|
||||
void LoadVectorLayers( int bOpenRemoteResources = FALSE );
|
||||
|
||||
virtual char **GetFileList( void ) CPL_OVERRIDE;
|
||||
char **GetFileList( void ) override;
|
||||
|
||||
virtual int GetLayerCount() CPL_OVERRIDE;
|
||||
virtual OGRLayer *GetLayer( int i ) CPL_OVERRIDE;
|
||||
int GetLayerCount() override;
|
||||
OGRLayer *GetLayer( int i ) override;
|
||||
};
|
||||
//! @endcond
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdaljp2metadata.h 36411 2016-11-21 22:03:48Z rouault $
|
||||
* $Id: gdaljp2metadata.h 7e07230bbff24eb333608de4dbd460b7312839d0 2017-12-11 19:08:47Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: JP2 Box Reader (and GMLJP2 Interpreter)
|
||||
@@ -60,7 +60,7 @@ class CPL_DLL GDALJP2Box
|
||||
GByte *pabyData;
|
||||
|
||||
public:
|
||||
explicit GDALJP2Box( VSILFILE * = NULL );
|
||||
explicit GDALJP2Box( VSILFILE * = nullptr );
|
||||
~GDALJP2Box();
|
||||
|
||||
int SetOffset( GIntBig nNewOffset );
|
||||
@@ -171,10 +171,10 @@ public:
|
||||
|
||||
int ReadAndParse( VSILFILE * fpVSIL,
|
||||
int nGEOJP2Index = 0, int nGMLJP2Index = 1,
|
||||
int nMSIGIndex = 2, int *pnIndexUsed = NULL );
|
||||
int nMSIGIndex = 2, int *pnIndexUsed = nullptr );
|
||||
int ReadAndParse( const char *pszFilename, int nGEOJP2Index = 0,
|
||||
int nGMLJP2Index = 1, int nMSIGIndex = 2,
|
||||
int nWorldFileIndex = 3, int *pnIndexUsed = NULL );
|
||||
int nWorldFileIndex = 3, int *pnIndexUsed = nullptr );
|
||||
|
||||
// Write oriented.
|
||||
void SetProjection( const char *pszWKT );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdaljp2metadatagenerator.h 35883 2016-10-24 05:49:15Z goatbar $
|
||||
* $Id: gdaljp2metadatagenerator.h a340ddc9f053a5fd00cde76090d5664875f134f0 2016-10-24 05:49:15Z Kurt Schwehr $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: GDALJP2Metadata: metadata generator
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: Includes json-c header
|
||||
* Author: Even Rouault <even dot rouault at spatialys dot com>
|
||||
* Purpose: Linear system solver
|
||||
* Author: VIZRT Development Team.
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot com>
|
||||
* Copyright (c) 2017 Alan Thomas <alant@outlook.com.au>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -24,15 +24,16 @@
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef OGR_JSON_HEADER_H
|
||||
#define OGR_JSON_HEADER_H
|
||||
/*! @cond Doxygen_Suppress */
|
||||
|
||||
#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) && !defined(_MSC_VER))
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
#ifndef GDALLINEARSYSTEM_H_INCLUDED
|
||||
#define GDALLINEARSYSTEM_H_INCLUDED
|
||||
|
||||
#include <json.h>
|
||||
bool GDALLinearSystemSolve( const int nDim, const int nRHS,
|
||||
const double adfA[], const double adfRHS[], double adfOut[] );
|
||||
|
||||
#endif /* OGR_JSON_HEADER_H */
|
||||
#endif /* #ifndef GDALLINEARSYSTEM_H_INCLUDED */
|
||||
|
||||
/*! @endcond */
|
||||
287
modules/globebrowsing/ext/gdal/include/gdalpansharpen.h
Normal file
287
modules/globebrowsing/ext/gdal/include/gdalpansharpen.h
Normal file
@@ -0,0 +1,287 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalpansharpen.h 4971449609881d6ffdca70188292293852d12691 2017-12-17 16:48:14Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL Pansharpening module
|
||||
* Purpose: Prototypes, and definitions for pansharpening related work.
|
||||
* Author: Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2015, Even Rouault <even.rouault at spatialys.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDALPANSHARPEN_H_INCLUDED
|
||||
#define GDALPANSHARPEN_H_INCLUDED
|
||||
|
||||
#include "gdal.h"
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/**
|
||||
* \file gdalpansharpen.h
|
||||
*
|
||||
* GDAL pansharpening related entry points and definitions.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
/** Pansharpening algorithms.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/*! Weighted Brovery. */
|
||||
GDAL_PSH_WEIGHTED_BROVEY
|
||||
} GDALPansharpenAlg;
|
||||
|
||||
/** Pansharpening options.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*! Pan sharpening algorithm/method. Only weighed Brovey for now. */
|
||||
GDALPansharpenAlg ePansharpenAlg;
|
||||
|
||||
/*! Resampling algorithm to upsample spectral bands to pan band resolution. */
|
||||
GDALRIOResampleAlg eResampleAlg;
|
||||
|
||||
/*! Bit depth of the spectral bands. Can be let to 0 for default behaviour. */
|
||||
int nBitDepth;
|
||||
|
||||
/*! Number of weight coefficients in padfWeights. */
|
||||
int nWeightCount;
|
||||
|
||||
/*! Array of nWeightCount weights used by weighted Brovey. */
|
||||
double *padfWeights;
|
||||
|
||||
/*! Panchromatic band. */
|
||||
GDALRasterBandH hPanchroBand;
|
||||
|
||||
/*! Number of input spectral bands. */
|
||||
int nInputSpectralBands;
|
||||
|
||||
/** Array of nInputSpectralBands input spectral bands. The spectral band have
|
||||
* generally a coarser resolution than the panchromatic band, but they
|
||||
* are assumed to have the same spatial extent (and projection) at that point.
|
||||
* Necessary spatial adjustments must be done beforehand, for example by wrapping
|
||||
* inside a VRT dataset.
|
||||
*/
|
||||
GDALRasterBandH *pahInputSpectralBands;
|
||||
|
||||
/*! Number of output pansharpened spectral bands. */
|
||||
int nOutPansharpenedBands;
|
||||
|
||||
/*! Array of nOutPansharpendBands values such as panOutPansharpenedBands[k] is a value in the range [0,nInputSpectralBands-1] . */
|
||||
int *panOutPansharpenedBands;
|
||||
|
||||
/*! Whether the panchromatic and spectral bands have a noData value. */
|
||||
int bHasNoData;
|
||||
|
||||
/** NoData value of the panchromatic and spectral bands (only taken into account if bHasNoData = TRUE).
|
||||
This will also be use has the output nodata value. */
|
||||
double dfNoData;
|
||||
|
||||
/** Number of threads or -1 to mean ALL_CPUS. By default (0), single threaded mode is enabled
|
||||
* unless the GDAL_NUM_THREADS configuration option is set to an integer or ALL_CPUS. */
|
||||
int nThreads;
|
||||
|
||||
/** Shift in pixels of multispectral bands w.r.t panchromatic band, in X direction */
|
||||
double dfMSShiftX;
|
||||
|
||||
/** Shift in pixels of multispectral bands w.r.t panchromatic band, in Y direction */
|
||||
double dfMSShiftY;
|
||||
|
||||
} GDALPansharpenOptions;
|
||||
|
||||
GDALPansharpenOptions CPL_DLL * GDALCreatePansharpenOptions(void);
|
||||
void CPL_DLL GDALDestroyPansharpenOptions( GDALPansharpenOptions * );
|
||||
GDALPansharpenOptions CPL_DLL * GDALClonePansharpenOptions(
|
||||
const GDALPansharpenOptions* psOptions);
|
||||
|
||||
/*! Pansharpening operation handle. */
|
||||
typedef void* GDALPansharpenOperationH;
|
||||
|
||||
GDALPansharpenOperationH CPL_DLL GDALCreatePansharpenOperation(const GDALPansharpenOptions* );
|
||||
void CPL_DLL GDALDestroyPansharpenOperation( GDALPansharpenOperationH );
|
||||
CPLErr CPL_DLL GDALPansharpenProcessRegion( GDALPansharpenOperationH hOperation,
|
||||
int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType);
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <vector>
|
||||
#include "gdal_priv.h"
|
||||
#include "cpl_worker_thread_pool.h"
|
||||
|
||||
#ifdef DEBUG_TIMING
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
class GDALPansharpenOperation;
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
typedef struct
|
||||
{
|
||||
GDALPansharpenOperation* poPansharpenOperation;
|
||||
GDALDataType eWorkDataType;
|
||||
GDALDataType eBufDataType;
|
||||
const void* pPanBuffer;
|
||||
const void* pUpsampledSpectralBuffer;
|
||||
void* pDataBuf;
|
||||
int nValues;
|
||||
int nBandValues;
|
||||
GUInt32 nMaxValue;
|
||||
|
||||
#ifdef DEBUG_TIMING
|
||||
struct timeval* ptv;
|
||||
#endif
|
||||
|
||||
CPLErr eErr;
|
||||
} GDALPansharpenJob;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GDALDataset* poMEMDS;
|
||||
int nXOff;
|
||||
int nYOff;
|
||||
int nXSize;
|
||||
int nYSize;
|
||||
double dfXOff;
|
||||
double dfYOff;
|
||||
double dfXSize;
|
||||
double dfYSize;
|
||||
void *pBuffer;
|
||||
GDALDataType eDT;
|
||||
int nBufXSize;
|
||||
int nBufYSize;
|
||||
int nBandCount;
|
||||
GDALRIOResampleAlg eResampleAlg;
|
||||
GSpacing nBandSpace;
|
||||
|
||||
#ifdef DEBUG_TIMING
|
||||
struct timeval* ptv;
|
||||
#endif
|
||||
} GDALPansharpenResampleJob;
|
||||
//! @endcond
|
||||
|
||||
/** Pansharpening operation class.
|
||||
*/
|
||||
class GDALPansharpenOperation
|
||||
{
|
||||
GDALPansharpenOptions* psOptions;
|
||||
std::vector<int> anInputBands;
|
||||
std::vector<GDALDataset*> aVDS; // to destroy
|
||||
std::vector<GDALRasterBand*> aMSBands; // original multispectral bands potentially warped into a VRT
|
||||
int bPositiveWeights;
|
||||
CPLWorkerThreadPool* poThreadPool;
|
||||
int nKernelRadius;
|
||||
|
||||
static void PansharpenJobThreadFunc(void* pUserData);
|
||||
static void PansharpenResampleJobThreadFunc(void* pUserData);
|
||||
|
||||
template<class WorkDataType, class OutDataType> void WeightedBroveyWithNoData(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
OutDataType* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
WorkDataType nMaxValue) const;
|
||||
template<class WorkDataType, class OutDataType, int bHasBitDepth> void WeightedBrovey3(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
OutDataType* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
WorkDataType nMaxValue) const;
|
||||
|
||||
// cppcheck-suppress functionStatic
|
||||
template<class WorkDataType, class OutDataType> void WeightedBrovey(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
OutDataType* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
WorkDataType nMaxValue) const;
|
||||
template<class WorkDataType> CPLErr WeightedBrovey(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
WorkDataType nMaxValue) const;
|
||||
|
||||
// cppcheck-suppress functionStatic
|
||||
template<class WorkDataType> CPLErr WeightedBrovey(
|
||||
const WorkDataType* pPanBuffer,
|
||||
const WorkDataType* pUpsampledSpectralBuffer,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType,
|
||||
int nValues,
|
||||
int nBandValues) const;
|
||||
template<class T> void WeightedBroveyPositiveWeights(
|
||||
const T* pPanBuffer,
|
||||
const T* pUpsampledSpectralBuffer,
|
||||
T* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
T nMaxValue) const;
|
||||
|
||||
template<class T, int NINPUT, int NOUTPUT> int WeightedBroveyPositiveWeightsInternal(
|
||||
const T* pPanBuffer,
|
||||
const T* pUpsampledSpectralBuffer,
|
||||
T* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
T nMaxValue) const;
|
||||
|
||||
// cppcheck-suppress unusedPrivateFunction
|
||||
template<class T> void WeightedBroveyGByteOrUInt16(
|
||||
const T* pPanBuffer,
|
||||
const T* pUpsampledSpectralBuffer,
|
||||
T* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
T nMaxValue ) const;
|
||||
|
||||
CPLErr PansharpenChunk( GDALDataType eWorkDataType, GDALDataType eBufDataType,
|
||||
const void* pPanBuffer,
|
||||
const void* pUpsampledSpectralBuffer,
|
||||
void* pDataBuf,
|
||||
int nValues,
|
||||
int nBandValues,
|
||||
GUInt32 nMaxValue) const;
|
||||
public:
|
||||
GDALPansharpenOperation();
|
||||
~GDALPansharpenOperation();
|
||||
|
||||
CPLErr Initialize(const GDALPansharpenOptions* psOptions);
|
||||
CPLErr ProcessRegion(int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType);
|
||||
GDALPansharpenOptions* GetOptions();
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* GDALPANSHARPEN_H_INCLUDED */
|
||||
@@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalsse_priv.h 34921 2016-08-04 22:26:31Z rouault $
|
||||
* $Id: gdalsse_priv.h a82a268adfd10bccfa254f9e416a68c105315d25 2018-04-08 13:53:09 +0200 Even Rouault $
|
||||
*
|
||||
* Project: GDAL
|
||||
* Purpose: SSE2 helper
|
||||
@@ -46,6 +46,51 @@
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
|
||||
#include "gdal_priv_templates.hpp"
|
||||
|
||||
static inline __m128i GDALCopyInt16ToXMM(const void* ptr)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
unsigned short s;
|
||||
memcpy(&s, ptr, 2);
|
||||
return _mm_cvtsi32_si128(s);
|
||||
#else
|
||||
return _mm_cvtsi32_si128(*static_cast<const unsigned short*>(ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __m128i GDALCopyInt32ToXMM(const void* ptr)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
GInt32 i;
|
||||
memcpy(&i, ptr, 4);
|
||||
return _mm_cvtsi32_si128(i);
|
||||
#else
|
||||
return _mm_cvtsi32_si128(*static_cast<const GInt32*>(ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __m128i GDALCopyInt64ToXMM(const void* ptr)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
GInt64 i;
|
||||
memcpy(&i, ptr, 8);
|
||||
return _mm_cvtsi64_si128(i);
|
||||
#else
|
||||
return _mm_cvtsi64_si128(*static_cast<const GInt64*>(ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void GDALCopyXMMToInt16(const __m128i xmm, void* pDest)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
GInt16 i = static_cast<GInt16>(_mm_extract_epi16(xmm, 0));
|
||||
memcpy(pDest, &i, 2);
|
||||
#else
|
||||
*static_cast<GInt16*>(pDest) = static_cast<GInt16>(_mm_extract_epi16(xmm, 0));
|
||||
#endif
|
||||
}
|
||||
|
||||
class XMMReg2Double
|
||||
{
|
||||
public:
|
||||
@@ -165,29 +210,19 @@ class XMMReg2Double
|
||||
xmm = _mm_loadu_pd(ptr);
|
||||
}
|
||||
|
||||
inline void nsLoad2ValAligned(const double* pval)
|
||||
inline void nsLoad2ValAligned(const double* ptr)
|
||||
{
|
||||
xmm = _mm_load_pd(pval);
|
||||
xmm = _mm_load_pd(ptr);
|
||||
}
|
||||
|
||||
inline void nsLoad2Val(const float* pval)
|
||||
inline void nsLoad2Val(const float* ptr)
|
||||
{
|
||||
__m128 temp1 = _mm_load_ss(pval);
|
||||
__m128 temp2 = _mm_load_ss(pval + 1);
|
||||
temp1 = _mm_shuffle_ps(temp1, temp2, _MM_SHUFFLE(1,0,1,0));
|
||||
temp1 = _mm_shuffle_ps(temp1, temp1, _MM_SHUFFLE(3,3,2,0));
|
||||
xmm = _mm_cvtps_pd(temp1);
|
||||
xmm = _mm_cvtps_pd(_mm_castsi128_ps(GDALCopyInt64ToXMM(ptr)));
|
||||
}
|
||||
|
||||
inline void nsLoad2Val(const unsigned char* ptr)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
unsigned short s;
|
||||
memcpy(&s, ptr, 2);
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(s);
|
||||
#else
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(*(unsigned short*)(ptr));
|
||||
#endif
|
||||
__m128i xmm_i = GDALCopyInt16ToXMM(ptr);
|
||||
#ifdef __SSE4_1__
|
||||
xmm_i = _mm_cvtepu8_epi32(xmm_i);
|
||||
#else
|
||||
@@ -199,9 +234,7 @@ class XMMReg2Double
|
||||
|
||||
inline void nsLoad2Val(const short* ptr)
|
||||
{
|
||||
int i;
|
||||
memcpy(&i, ptr, 4);
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(i);
|
||||
__m128i xmm_i = GDALCopyInt32ToXMM(ptr);
|
||||
#ifdef __SSE4_1__
|
||||
xmm_i = _mm_cvtepi16_epi32(xmm_i);
|
||||
#else
|
||||
@@ -213,9 +246,7 @@ class XMMReg2Double
|
||||
|
||||
inline void nsLoad2Val(const unsigned short* ptr)
|
||||
{
|
||||
int i;
|
||||
memcpy(&i, ptr, 4);
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(i);
|
||||
__m128i xmm_i = GDALCopyInt32ToXMM(ptr);
|
||||
#ifdef __SSE4_1__
|
||||
xmm_i = _mm_cvtepu16_epi32(xmm_i);
|
||||
#else
|
||||
@@ -226,13 +257,7 @@ class XMMReg2Double
|
||||
|
||||
static inline void Load4Val(const unsigned char* ptr, XMMReg2Double& low, XMMReg2Double& high)
|
||||
{
|
||||
#ifdef CPL_CPU_REQUIRES_ALIGNED_ACCESS
|
||||
int i;
|
||||
memcpy(&i, ptr, 4);
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(i);
|
||||
#else
|
||||
__m128i xmm_i = _mm_cvtsi32_si128(*(int*)(ptr));
|
||||
#endif
|
||||
__m128i xmm_i = GDALCopyInt32ToXMM(ptr);
|
||||
#ifdef __SSE4_1__
|
||||
xmm_i = _mm_cvtepu8_epi32(xmm_i);
|
||||
#else
|
||||
@@ -320,35 +345,59 @@ class XMMReg2Double
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline void AddLowAndHigh()
|
||||
inline double GetHorizSum() const
|
||||
{
|
||||
__m128d xmm2;
|
||||
xmm2 = _mm_shuffle_pd(xmm,xmm,_MM_SHUFFLE2(0,1)); /* transfer high word into low word of xmm2 */
|
||||
xmm = _mm_add_pd(xmm, xmm2);
|
||||
return _mm_cvtsd_f64(_mm_add_sd(xmm, xmm2));
|
||||
}
|
||||
|
||||
inline void Store2Double(double* pval) const
|
||||
inline void Store2Val(double* ptr) const
|
||||
{
|
||||
_mm_storeu_pd(pval, xmm);
|
||||
_mm_storeu_pd(ptr, xmm);
|
||||
}
|
||||
|
||||
inline void Store2DoubleAligned(double* pval) const
|
||||
inline void Store2ValAligned(double* ptr) const
|
||||
{
|
||||
_mm_store_pd(pval, xmm);
|
||||
_mm_store_pd(ptr, xmm);
|
||||
}
|
||||
|
||||
void Store2Val(unsigned short* ptr) const
|
||||
inline void Store2Val(float* ptr) const
|
||||
{
|
||||
__m128i tmp = _mm_cvtpd_epi32(xmm); /* Convert the 2 double values to 2 integers */
|
||||
ptr[0] = (GUInt16)_mm_extract_epi16(tmp, 0);
|
||||
ptr[1] = (GUInt16)_mm_extract_epi16(tmp, 2);
|
||||
__m128i xmm_i = _mm_castps_si128( _mm_cvtpd_ps(xmm) );
|
||||
GDALCopyXMMToInt64(xmm_i, reinterpret_cast<GInt64*>(ptr));
|
||||
}
|
||||
|
||||
inline void Store2Val(unsigned char* ptr) const
|
||||
{
|
||||
__m128i tmp = _mm_cvttpd_epi32(_mm_add_pd(xmm, _mm_set1_pd(0.5))); /* Convert the 2 double values to 2 integers */
|
||||
// X X X X 0 B 0 A --> 0 X X X X 0 B 0 (srli)
|
||||
// or X X X X 0 B 0 A
|
||||
tmp = _mm_or_si128(tmp, _mm_srli_si128(tmp, 2));
|
||||
tmp = _mm_packus_epi16(tmp, tmp);
|
||||
GDALCopyXMMToInt16(tmp, reinterpret_cast<GInt16*>(ptr));
|
||||
}
|
||||
|
||||
inline void Store2Val(unsigned short* ptr) const
|
||||
{
|
||||
__m128i tmp = _mm_cvttpd_epi32(_mm_add_pd(xmm, _mm_set1_pd(0.5))); /* Convert the 2 double values to 2 integers */
|
||||
// X X X X 0 B 0 A --> 0 X X X X 0 B 0 (srli)
|
||||
// or X X X X 0 B 0 A
|
||||
tmp = _mm_or_si128(tmp, _mm_srli_si128(tmp, 2));
|
||||
GDALCopyXMMToInt32(tmp, reinterpret_cast<GInt32*>(ptr));
|
||||
|
||||
//ptr[0] = (GUInt16)_mm_extract_epi16(tmp, 0);
|
||||
//ptr[1] = (GUInt16)_mm_extract_epi16(tmp, 2);
|
||||
}
|
||||
|
||||
inline void StoreMask(unsigned char* ptr) const
|
||||
{
|
||||
_mm_storeu_si128( reinterpret_cast<__m128i*>(ptr), _mm_castpd_si128(xmm) );
|
||||
}
|
||||
|
||||
inline operator double () const
|
||||
{
|
||||
double val;
|
||||
_mm_store_sd(&val, xmm);
|
||||
return val;
|
||||
return _mm_cvtsd_f64(xmm);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -466,8 +515,8 @@ class XMMReg2Double
|
||||
static inline XMMReg2Double Min(const XMMReg2Double& expr1, const XMMReg2Double& expr2)
|
||||
{
|
||||
XMMReg2Double reg;
|
||||
reg.low = (expr1.low < expr2.low) ? expr1.low : expr2.high;
|
||||
reg.high = (expr1.high < expr2.high) ? expr1.high : expr2.low;
|
||||
reg.low = (expr1.low < expr2.low) ? expr1.low : expr2.low;
|
||||
reg.high = (expr1.high < expr2.high) ? expr1.high : expr2.high;
|
||||
return reg;
|
||||
}
|
||||
|
||||
@@ -513,28 +562,28 @@ class XMMReg2Double
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void nsLoad1ValHighAndLow(const double* pval)
|
||||
inline void nsLoad1ValHighAndLow(const double* ptr)
|
||||
{
|
||||
low = pval[0];
|
||||
high = pval[0];
|
||||
low = ptr[0];
|
||||
high = ptr[0];
|
||||
}
|
||||
|
||||
inline void nsLoad2Val(const double* pval)
|
||||
inline void nsLoad2Val(const double* ptr)
|
||||
{
|
||||
low = pval[0];
|
||||
high = pval[1];
|
||||
low = ptr[0];
|
||||
high = ptr[1];
|
||||
}
|
||||
|
||||
inline void nsLoad2ValAligned(const double* pval)
|
||||
inline void nsLoad2ValAligned(const double* ptr)
|
||||
{
|
||||
low = pval[0];
|
||||
high = pval[1];
|
||||
low = ptr[0];
|
||||
high = ptr[1];
|
||||
}
|
||||
|
||||
inline void nsLoad2Val(const float* pval)
|
||||
inline void nsLoad2Val(const float* ptr)
|
||||
{
|
||||
low = pval[0];
|
||||
high = pval[1];
|
||||
low = ptr[0];
|
||||
high = ptr[1];
|
||||
}
|
||||
|
||||
inline void nsLoad2Val(const unsigned char* ptr)
|
||||
@@ -646,29 +695,45 @@ class XMMReg2Double
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline void AddLowAndHigh()
|
||||
inline double GetHorizSum() const
|
||||
{
|
||||
double add = low + high;
|
||||
low = add;
|
||||
high = add;
|
||||
return low + high;
|
||||
}
|
||||
|
||||
inline void Store2Double(double* pval) const
|
||||
inline void Store2Val(double* ptr) const
|
||||
{
|
||||
pval[0] = low;
|
||||
pval[1] = high;
|
||||
ptr[0] = low;
|
||||
ptr[1] = high;
|
||||
}
|
||||
|
||||
inline void Store2DoubleAligned(double* pval) const
|
||||
inline void Store2ValAligned(double* ptr) const
|
||||
{
|
||||
pval[0] = low;
|
||||
pval[1] = high;
|
||||
ptr[0] = low;
|
||||
ptr[1] = high;
|
||||
}
|
||||
|
||||
inline void Store2Val(float* ptr) const
|
||||
{
|
||||
ptr[0] = low;
|
||||
ptr[1] = high;
|
||||
}
|
||||
|
||||
void Store2Val(unsigned char* ptr) const
|
||||
{
|
||||
ptr[0] = (unsigned char)(low + 0.5);
|
||||
ptr[1] = (unsigned char)(high + 0.5);
|
||||
}
|
||||
|
||||
void Store2Val(unsigned short* ptr) const
|
||||
{
|
||||
ptr[0] = (GUInt16)low;
|
||||
ptr[1] = (GUInt16)high;
|
||||
ptr[0] = (GUInt16)(low + 0.5);
|
||||
ptr[1] = (GUInt16)(high + 0.5);
|
||||
}
|
||||
|
||||
inline void StoreMask(unsigned char* ptr) const
|
||||
{
|
||||
memcpy(ptr, &low, 8);
|
||||
memcpy(ptr + 8, &high, 8);
|
||||
}
|
||||
|
||||
inline operator double () const
|
||||
@@ -679,6 +744,258 @@ class XMMReg2Double
|
||||
|
||||
#endif /* defined(__x86_64) || defined(_M_X64) */
|
||||
|
||||
#ifdef __AVX__
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
class XMMReg4Double
|
||||
{
|
||||
public:
|
||||
__m256d ymm;
|
||||
|
||||
XMMReg4Double() {}
|
||||
XMMReg4Double(const XMMReg4Double& other) : ymm(other.ymm) {}
|
||||
|
||||
static inline XMMReg4Double Zero()
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.Zeroize();
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void Zeroize()
|
||||
{
|
||||
ymm = _mm256_setzero_pd();
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Load1ValHighAndLow(const double* ptr)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.nsLoad1ValHighAndLow(ptr);
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void nsLoad1ValHighAndLow(const double* ptr)
|
||||
{
|
||||
ymm = _mm256_set1_pd(*ptr);
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Load4Val(const unsigned char* ptr)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.nsLoad4Val(ptr);
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void nsLoad4Val(const unsigned char* ptr)
|
||||
{
|
||||
__m128i xmm_i = GDALCopyInt32ToXMM(ptr);
|
||||
xmm_i = _mm_cvtepu8_epi32(xmm_i);
|
||||
ymm = _mm256_cvtepi32_pd(xmm_i);
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Load4Val(const short* ptr)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.nsLoad4Val(ptr);
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void nsLoad4Val(const short* ptr)
|
||||
{
|
||||
__m128i xmm_i = GDALCopyInt64ToXMM(ptr);
|
||||
xmm_i = _mm_cvtepi16_epi32(xmm_i);
|
||||
ymm = _mm256_cvtepi32_pd(xmm_i);
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Load4Val(const unsigned short* ptr)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.nsLoad4Val(ptr);
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void nsLoad4Val(const unsigned short* ptr)
|
||||
{
|
||||
__m128i xmm_i = GDALCopyInt64ToXMM(ptr);
|
||||
xmm_i = _mm_cvtepu16_epi32(xmm_i);
|
||||
ymm = _mm256_cvtepi32_pd(xmm_i); // ok to use signed conversion since we are in the ushort range, so cannot be interpreted as negative int32
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Load4Val(const double* ptr)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.nsLoad4Val(ptr);
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void nsLoad4Val(const double* ptr)
|
||||
{
|
||||
ymm = _mm256_loadu_pd(ptr);
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Load4ValAligned(const double* ptr)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.nsLoad4ValAligned(ptr);
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void nsLoad4ValAligned(const double* ptr)
|
||||
{
|
||||
ymm = _mm256_load_pd(ptr);
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Load4Val(const float* ptr)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.nsLoad4Val(ptr);
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline void nsLoad4Val(const float* ptr)
|
||||
{
|
||||
ymm = _mm256_cvtps_pd( _mm_loadu_ps(ptr) );
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Equals(const XMMReg4Double& expr1, const XMMReg4Double& expr2)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.ymm = _mm256_cmp_pd(expr1.ymm, expr2.ymm, _CMP_EQ_OQ);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline XMMReg4Double NotEquals(const XMMReg4Double& expr1, const XMMReg4Double& expr2)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.ymm = _mm256_cmp_pd(expr1.ymm, expr2.ymm, _CMP_NEQ_OQ);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Greater(const XMMReg4Double& expr1, const XMMReg4Double& expr2)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.ymm = _mm256_cmp_pd(expr1.ymm, expr2.ymm, _CMP_GT_OQ);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline XMMReg4Double And(const XMMReg4Double& expr1, const XMMReg4Double& expr2)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.ymm = _mm256_and_pd(expr1.ymm, expr2.ymm);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Ternary(const XMMReg4Double& cond, const XMMReg4Double& true_expr, const XMMReg4Double& false_expr)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.ymm = _mm256_or_pd(_mm256_and_pd (cond.ymm, true_expr.ymm), _mm256_andnot_pd(cond.ymm, false_expr.ymm));
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inline XMMReg4Double Min(const XMMReg4Double& expr1, const XMMReg4Double& expr2)
|
||||
{
|
||||
XMMReg4Double reg;
|
||||
reg.ymm = _mm256_min_pd(expr1.ymm, expr2.ymm);
|
||||
return reg;
|
||||
}
|
||||
|
||||
inline XMMReg4Double& operator= (const XMMReg4Double& other)
|
||||
{
|
||||
ymm = other.ymm;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline XMMReg4Double& operator+= (const XMMReg4Double& other)
|
||||
{
|
||||
ymm = _mm256_add_pd(ymm, other.ymm);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline XMMReg4Double& operator*= (const XMMReg4Double& other)
|
||||
{
|
||||
ymm = _mm256_mul_pd(ymm, other.ymm);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline XMMReg4Double operator+ (const XMMReg4Double& other) const
|
||||
{
|
||||
XMMReg4Double ret;
|
||||
ret.ymm = _mm256_add_pd(ymm, other.ymm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline XMMReg4Double operator- (const XMMReg4Double& other) const
|
||||
{
|
||||
XMMReg4Double ret;
|
||||
ret.ymm = _mm256_sub_pd(ymm, other.ymm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline XMMReg4Double operator* (const XMMReg4Double& other) const
|
||||
{
|
||||
XMMReg4Double ret;
|
||||
ret.ymm = _mm256_mul_pd(ymm, other.ymm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline XMMReg4Double operator/ (const XMMReg4Double& other) const
|
||||
{
|
||||
XMMReg4Double ret;
|
||||
ret.ymm = _mm256_div_pd(ymm, other.ymm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void AddToLow( const XMMReg2Double& other )
|
||||
{
|
||||
__m256d ymm2 = _mm256_setzero_pd();
|
||||
ymm2 = _mm256_insertf128_pd( ymm2, other.xmm, 0);
|
||||
ymm = _mm256_add_pd(ymm, ymm2);
|
||||
}
|
||||
|
||||
inline double GetHorizSum() const
|
||||
{
|
||||
__m256d ymm_tmp1, ymm_tmp2;
|
||||
ymm_tmp2 = _mm256_hadd_pd(ymm, ymm);
|
||||
ymm_tmp1 = _mm256_permute2f128_pd(ymm_tmp2, ymm_tmp2, 1);
|
||||
ymm_tmp1 = _mm256_add_pd(ymm_tmp1, ymm_tmp2);
|
||||
return _mm_cvtsd_f64(_mm256_castpd256_pd128(ymm_tmp1));
|
||||
}
|
||||
|
||||
inline void Store4Val(unsigned char* ptr) const
|
||||
{
|
||||
__m128i xmm_i = _mm256_cvttpd_epi32 (_mm256_add_pd(ymm, _mm256_set1_pd(0.5)));
|
||||
//xmm_i = _mm_packs_epi32(xmm_i, xmm_i); // Pack int32 to int16
|
||||
//xmm_i = _mm_packus_epi16(xmm_i, xmm_i); // Pack int16 to uint8
|
||||
xmm_i = _mm_shuffle_epi8(xmm_i, _mm_cvtsi32_si128(0 | (4 << 8) | (8 << 16) | (12 << 24))); // SSSE3
|
||||
GDALCopyXMMToInt32(xmm_i, reinterpret_cast<GInt32*>(ptr));
|
||||
}
|
||||
|
||||
inline void Store4Val(unsigned short* ptr) const
|
||||
{
|
||||
__m128i xmm_i = _mm256_cvttpd_epi32 (_mm256_add_pd(ymm, _mm256_set1_pd(0.5)));
|
||||
xmm_i = _mm_packus_epi32(xmm_i, xmm_i); // Pack uint32 to uint16
|
||||
GDALCopyXMMToInt64(xmm_i, reinterpret_cast<GInt64*>(ptr));
|
||||
}
|
||||
|
||||
inline void Store4Val(float* ptr) const
|
||||
{
|
||||
_mm_storeu_ps(ptr, _mm256_cvtpd_ps (ymm));
|
||||
}
|
||||
|
||||
inline void Store4Val(double* ptr) const
|
||||
{
|
||||
_mm256_storeu_pd(ptr, ymm);
|
||||
}
|
||||
|
||||
inline void StoreMask(unsigned char* ptr) const
|
||||
{
|
||||
_mm256_storeu_si256( reinterpret_cast<__m256i*>(ptr), _mm256_castpd_si256(ymm) );
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
class XMMReg4Double
|
||||
{
|
||||
public:
|
||||
@@ -850,29 +1167,64 @@ class XMMReg4Double
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline void AddLowAndHigh()
|
||||
void AddToLow( const XMMReg2Double& other )
|
||||
{
|
||||
low = low + high;
|
||||
low.AddLowAndHigh();
|
||||
low += other;
|
||||
}
|
||||
|
||||
inline XMMReg2Double& GetLow()
|
||||
inline double GetHorizSum() const
|
||||
{
|
||||
return low;
|
||||
return (low + high).GetHorizSum();
|
||||
}
|
||||
|
||||
inline XMMReg2Double& GetHigh()
|
||||
{
|
||||
return high;
|
||||
}
|
||||
|
||||
void Store4Val(unsigned short* ptr) const
|
||||
inline void Store4Val(unsigned char* ptr) const
|
||||
{
|
||||
low.Store2Val(ptr);
|
||||
high.Store2Val(ptr+2);
|
||||
}
|
||||
|
||||
inline void Store4Val(unsigned short* ptr) const
|
||||
{
|
||||
#if 1
|
||||
low.Store2Val(ptr);
|
||||
high.Store2Val(ptr+2);
|
||||
#else
|
||||
__m128i xmm0 = _mm_cvtpd_epi32 (low.xmm);
|
||||
__m128i xmm1 = _mm_cvtpd_epi32 (high.xmm);
|
||||
xmm0 = _mm_or_si128(xmm0, _mm_slli_si128(xmm1, 8));
|
||||
#if __SSE4_1__
|
||||
xmm0 = _mm_packus_epi32(xmm0, xmm0); // Pack uint32 to uint16
|
||||
#else
|
||||
xmm0 = _mm_add_epi32( xmm0, _mm_set1_epi32(-32768) );
|
||||
xmm0 = _mm_packs_epi32( xmm0, xmm0 );
|
||||
xmm0 = _mm_sub_epi16( xmm0, _mm_set1_epi16(-32768) );
|
||||
#endif
|
||||
GDALCopyXMMToInt64(xmm0, (GInt64*)ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void Store4Val(float* ptr) const
|
||||
{
|
||||
low.Store2Val(ptr);
|
||||
high.Store2Val(ptr+2);
|
||||
}
|
||||
|
||||
inline void Store4Val(double* ptr) const
|
||||
{
|
||||
low.Store2Val(ptr);
|
||||
high.Store2Val(ptr+2);
|
||||
}
|
||||
|
||||
inline void StoreMask(unsigned char* ptr) const
|
||||
{
|
||||
low.StoreMask(ptr);
|
||||
high.StoreMask(ptr+16);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DOXYGEN_SKIP */
|
||||
|
||||
#endif /* GDALSSE_PRIV_H_INCLUDED */
|
||||
|
||||
551
modules/globebrowsing/ext/gdal/include/gdalwarper.h
Normal file
551
modules/globebrowsing/ext/gdal/include/gdalwarper.h
Normal file
@@ -0,0 +1,551 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalwarper.h 7e07230bbff24eb333608de4dbd460b7312839d0 2017-12-11 19:08:47Z Even Rouault $
|
||||
*
|
||||
* Project: GDAL High Performance Warper
|
||||
* Purpose: Prototypes, and definitions for warping related work.
|
||||
* Author: Frank Warmerdam, warmerdam@pobox.com
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2003, Frank Warmerdam
|
||||
* Copyright (c) 2009-2012, Even Rouault <even dot rouault at mines-paris dot org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GDALWARPER_H_INCLUDED
|
||||
#define GDALWARPER_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \file gdalwarper.h
|
||||
*
|
||||
* GDAL warper related entry points and definitions. Eventually it is
|
||||
* expected that this file will be mostly private to the implementation,
|
||||
* and the public C entry points will be available in gdal_alg.h.
|
||||
*/
|
||||
|
||||
#include "gdal_alg.h"
|
||||
#include "cpl_minixml.h"
|
||||
#include "cpl_multiproc.h"
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/* Note: values are selected to be consistent with GDALRIOResampleAlg of gcore/gdal.h */
|
||||
/*! Warp Resampling Algorithm */
|
||||
typedef enum {
|
||||
/*! Nearest neighbour (select on one input pixel) */ GRA_NearestNeighbour=0,
|
||||
/*! Bilinear (2x2 kernel) */ GRA_Bilinear=1,
|
||||
/*! Cubic Convolution Approximation (4x4 kernel) */ GRA_Cubic=2,
|
||||
/*! Cubic B-Spline Approximation (4x4 kernel) */ GRA_CubicSpline=3,
|
||||
/*! Lanczos windowed sinc interpolation (6x6 kernel) */ GRA_Lanczos=4,
|
||||
/*! Average (computes the average of all non-NODATA contributing pixels) */ GRA_Average=5,
|
||||
/*! Mode (selects the value which appears most often of all the sampled points) */ GRA_Mode=6,
|
||||
/* GRA_Gauss=7 reserved. */
|
||||
/*! Max (selects maximum of all non-NODATA contributing pixels) */ GRA_Max=8,
|
||||
/*! Min (selects minimum of all non-NODATA contributing pixels) */ GRA_Min=9,
|
||||
/*! Med (selects median of all non-NODATA contributing pixels) */ GRA_Med=10,
|
||||
/*! Q1 (selects first quartile of all non-NODATA contributing pixels) */ GRA_Q1=11,
|
||||
/*! Q3 (selects third quartile of all non-NODATA contributing pixels) */ GRA_Q3=12
|
||||
} GDALResampleAlg;
|
||||
|
||||
/*! GWKAverageOrMode Algorithm */
|
||||
typedef enum {
|
||||
/*! Average */ GWKAOM_Average=1,
|
||||
/*! Mode */ GWKAOM_Fmode=2,
|
||||
/*! Mode of GDT_Byte, GDT_UInt16, or GDT_Int16 */ GWKAOM_Imode=3,
|
||||
/*! Maximum */ GWKAOM_Max=4,
|
||||
/*! Minimum */ GWKAOM_Min=5,
|
||||
/*! Quantile */ GWKAOM_Quant=6
|
||||
} GWKAverageOrModeAlg;
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
typedef int
|
||||
(*GDALMaskFunc)( void *pMaskFuncArg,
|
||||
int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff,
|
||||
int nXSize, int nYSize,
|
||||
GByte **papabyImageData,
|
||||
int bMaskIsFloat, void *pMask );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpNoDataMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte **papabyImageData, int bMaskIsFloat,
|
||||
void *pValidityMask, int* pbOutAllValid );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpDstAlphaMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte ** /*ppImageData */,
|
||||
int bMaskIsFloat, void *pValidityMask );
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpSrcAlphaMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte ** /*ppImageData */,
|
||||
int bMaskIsFloat, void *pValidityMask, int* pbOutAllOpaque );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpSrcMaskMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte ** /*ppImageData */,
|
||||
int bMaskIsFloat, void *pValidityMask );
|
||||
|
||||
CPLErr CPL_DLL
|
||||
GDALWarpCutlineMasker( void *pMaskFuncArg, int nBandCount, GDALDataType eType,
|
||||
int nXOff, int nYOff, int nXSize, int nYSize,
|
||||
GByte ** /* ppImageData */,
|
||||
int bMaskIsFloat, void *pValidityMask );
|
||||
/*! @endcond */
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALWarpOptions */
|
||||
/************************************************************************/
|
||||
|
||||
/** Warp control options for use with GDALWarpOperation::Initialize() */
|
||||
typedef struct {
|
||||
|
||||
char **papszWarpOptions;
|
||||
|
||||
/*! In bytes, 0.0 for internal default */
|
||||
double dfWarpMemoryLimit;
|
||||
|
||||
/*! Resampling algorithm to use */
|
||||
GDALResampleAlg eResampleAlg;
|
||||
|
||||
/*! data type to use during warp operation, GDT_Unknown lets the algorithm
|
||||
select the type */
|
||||
GDALDataType eWorkingDataType;
|
||||
|
||||
/*! Source image dataset. */
|
||||
GDALDatasetH hSrcDS;
|
||||
|
||||
/*! Destination image dataset - may be NULL if only using GDALWarpOperation::WarpRegionToBuffer(). */
|
||||
GDALDatasetH hDstDS;
|
||||
|
||||
/*! Number of bands to process, may be 0 to select all bands. */
|
||||
int nBandCount;
|
||||
|
||||
/*! The band numbers for the source bands to process (1 based) */
|
||||
int *panSrcBands;
|
||||
|
||||
/*! The band numbers for the destination bands to process (1 based) */
|
||||
int *panDstBands;
|
||||
|
||||
/*! The source band so use as an alpha (transparency) value, 0=disabled */
|
||||
int nSrcAlphaBand;
|
||||
|
||||
/*! The dest. band so use as an alpha (transparency) value, 0=disabled */
|
||||
int nDstAlphaBand;
|
||||
|
||||
/*! The "nodata" value real component for each input band, if NULL there isn't one */
|
||||
double *padfSrcNoDataReal;
|
||||
/*! The "nodata" value imaginary component - may be NULL even if real
|
||||
component is provided. */
|
||||
double *padfSrcNoDataImag;
|
||||
|
||||
/*! The "nodata" value real component for each output band, if NULL there isn't one */
|
||||
double *padfDstNoDataReal;
|
||||
/*! The "nodata" value imaginary component - may be NULL even if real
|
||||
component is provided. */
|
||||
double *padfDstNoDataImag;
|
||||
|
||||
/*! GDALProgressFunc() compatible progress reporting function, or NULL
|
||||
if there isn't one. */
|
||||
GDALProgressFunc pfnProgress;
|
||||
|
||||
/*! Callback argument to be passed to pfnProgress. */
|
||||
void *pProgressArg;
|
||||
|
||||
/*! Type of spatial point transformer function */
|
||||
GDALTransformerFunc pfnTransformer;
|
||||
|
||||
/*! Handle to image transformer setup structure */
|
||||
void *pTransformerArg;
|
||||
|
||||
/** Unused. Must be NULL */
|
||||
GDALMaskFunc *papfnSrcPerBandValidityMaskFunc;
|
||||
/** Unused. Must be NULL */
|
||||
void **papSrcPerBandValidityMaskFuncArg;
|
||||
|
||||
/** Unused. Must be NULL */
|
||||
GDALMaskFunc pfnSrcValidityMaskFunc;
|
||||
/** Unused. Must be NULL */
|
||||
void *pSrcValidityMaskFuncArg;
|
||||
|
||||
/** Unused. Must be NULL */
|
||||
GDALMaskFunc pfnSrcDensityMaskFunc;
|
||||
/** Unused. Must be NULL */
|
||||
void *pSrcDensityMaskFuncArg;
|
||||
|
||||
/** Unused. Must be NULL */
|
||||
GDALMaskFunc pfnDstDensityMaskFunc;
|
||||
/** Unused. Must be NULL */
|
||||
void *pDstDensityMaskFuncArg;
|
||||
|
||||
/** Unused. Must be NULL */
|
||||
GDALMaskFunc pfnDstValidityMaskFunc;
|
||||
/** Unused. Must be NULL */
|
||||
void *pDstValidityMaskFuncArg;
|
||||
|
||||
/** Unused. Must be NULL */
|
||||
CPLErr (*pfnPreWarpChunkProcessor)( void *pKern, void *pArg );
|
||||
/** Unused. Must be NULL */
|
||||
void *pPreWarpProcessorArg;
|
||||
|
||||
/** Unused. Must be NULL */
|
||||
CPLErr (*pfnPostWarpChunkProcessor)( void *pKern, void *pArg);
|
||||
/** Unused. Must be NULL */
|
||||
void *pPostWarpProcessorArg;
|
||||
|
||||
/*! Optional OGRPolygonH for a masking cutline. */
|
||||
void *hCutline;
|
||||
|
||||
/*! Optional blending distance to apply across cutline in pixels, default is zero. */
|
||||
double dfCutlineBlendDist;
|
||||
|
||||
} GDALWarpOptions;
|
||||
|
||||
GDALWarpOptions CPL_DLL * CPL_STDCALL GDALCreateWarpOptions(void);
|
||||
void CPL_DLL CPL_STDCALL GDALDestroyWarpOptions( GDALWarpOptions * );
|
||||
GDALWarpOptions CPL_DLL * CPL_STDCALL
|
||||
GDALCloneWarpOptions( const GDALWarpOptions * );
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALWarpInitDstNoDataReal( GDALWarpOptions *, double dNoDataReal );
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALWarpInitSrcNoDataReal( GDALWarpOptions *, double dNoDataReal );
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALWarpInitNoDataReal( GDALWarpOptions *, double dNoDataReal );
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALWarpInitDstNoDataImag( GDALWarpOptions *, double dNoDataImag );
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALWarpInitSrcNoDataImag( GDALWarpOptions *, double dNoDataImag );
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALWarpResolveWorkingDataType( GDALWarpOptions * );
|
||||
|
||||
void CPL_DLL CPL_STDCALL
|
||||
GDALWarpInitDefaultBandMapping( GDALWarpOptions *, int nBandCount );
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
CPLXMLNode CPL_DLL * CPL_STDCALL
|
||||
GDALSerializeWarpOptions( const GDALWarpOptions * );
|
||||
GDALWarpOptions CPL_DLL * CPL_STDCALL
|
||||
GDALDeserializeWarpOptions( CPLXMLNode * );
|
||||
/*! @endcond */
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALReprojectImage() */
|
||||
/************************************************************************/
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALReprojectImage( GDALDatasetH hSrcDS, const char *pszSrcWKT,
|
||||
GDALDatasetH hDstDS, const char *pszDstWKT,
|
||||
GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit,
|
||||
double dfMaxError,
|
||||
GDALProgressFunc pfnProgress, void *pProgressArg,
|
||||
GDALWarpOptions *psOptions );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALCreateAndReprojectImage( GDALDatasetH hSrcDS, const char *pszSrcWKT,
|
||||
const char *pszDstFilename, const char *pszDstWKT,
|
||||
GDALDriverH hDstDriver, char **papszCreateOptions,
|
||||
GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit,
|
||||
double dfMaxError,
|
||||
GDALProgressFunc pfnProgress, void *pProgressArg,
|
||||
GDALWarpOptions *psOptions );
|
||||
|
||||
/************************************************************************/
|
||||
/* VRTWarpedDataset */
|
||||
/************************************************************************/
|
||||
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL
|
||||
GDALAutoCreateWarpedVRT( GDALDatasetH hSrcDS,
|
||||
const char *pszSrcWKT, const char *pszDstWKT,
|
||||
GDALResampleAlg eResampleAlg,
|
||||
double dfMaxError, const GDALWarpOptions *psOptions );
|
||||
|
||||
GDALDatasetH CPL_DLL CPL_STDCALL
|
||||
GDALCreateWarpedVRT( GDALDatasetH hSrcDS,
|
||||
int nPixels, int nLines, double *padfGeoTransform,
|
||||
GDALWarpOptions *psOptions );
|
||||
|
||||
CPLErr CPL_DLL CPL_STDCALL
|
||||
GDALInitializeWarpedVRT( GDALDatasetH hDS,
|
||||
GDALWarpOptions *psWO );
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALWarpKernel */
|
||||
/* */
|
||||
|
||||
/** This is the number of dummy pixels that must be reserved in source arrays
|
||||
* in order to satisfy assumptions made in GWKResample(), and more specifically
|
||||
* by GWKGetPixelRow() that always read a even number of pixels. So if we are
|
||||
* in the situation to read the last pixel of the source array, we need 1 extra
|
||||
* dummy pixel to avoid reading out of bounds. */
|
||||
#define WARP_EXTRA_ELTS 1
|
||||
|
||||
/** This class represents the lowest level of abstraction of warping.
|
||||
*
|
||||
* It holds the imagery for one "chunk" of a warp, and the
|
||||
* pre-prepared masks. All IO is done before and after its
|
||||
* operation. This class is not normally used by the
|
||||
* application.
|
||||
*/
|
||||
class CPL_DLL GDALWarpKernel
|
||||
{
|
||||
public:
|
||||
/** Warp options */
|
||||
char **papszWarpOptions;
|
||||
|
||||
/** Resample algorithm */
|
||||
GDALResampleAlg eResample;
|
||||
/** Working data type */
|
||||
GDALDataType eWorkingDataType;
|
||||
/** Number of input and output bands (excluding alpha bands) */
|
||||
int nBands;
|
||||
|
||||
/** Width of the source image */
|
||||
int nSrcXSize;
|
||||
/** Height of the source image */
|
||||
int nSrcYSize;
|
||||
/** Extra pixels (included in nSrcXSize) reserved for filter window. Should be ignored in scale computation */
|
||||
double dfSrcXExtraSize;
|
||||
/** Extra pixels (included in nSrcYSize) reserved for filter window. Should be ignored in scale computation */
|
||||
double dfSrcYExtraSize;
|
||||
/** Array of nBands source images of size nSrcXSize * nSrcYSize. Each subarray must have WARP_EXTRA_ELTS at the end */
|
||||
GByte **papabySrcImage;
|
||||
|
||||
/** Array of nBands validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8 */
|
||||
GUInt32 **papanBandSrcValid;
|
||||
/** Unified validity mask of size (nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS) / 8 */
|
||||
GUInt32 *panUnifiedSrcValid;
|
||||
/** Unified source density of size nSrcXSize * nSrcYSize + WARP_EXTRA_ELTS */
|
||||
float *pafUnifiedSrcDensity;
|
||||
|
||||
/** Width of the destination image */
|
||||
int nDstXSize;
|
||||
/** Height of the destination image */
|
||||
int nDstYSize;
|
||||
/** Array of nBands destination images of size nDstXSize * nDstYSize */
|
||||
GByte **papabyDstImage;
|
||||
/** Validify mask of size (nDstXSize * nDstYSize) / 8 */
|
||||
GUInt32 *panDstValid;
|
||||
/** Destination density of size nDstXSize * nDstYSize */
|
||||
float *pafDstDensity;
|
||||
|
||||
/** X resampling scale, i.e. nDstXSize / nSrcXSize */
|
||||
double dfXScale;
|
||||
/** Y resampling scale, i.e. nDstYSize / nSrcYSize */
|
||||
double dfYScale;
|
||||
/** X size of filter kernel */
|
||||
double dfXFilter;
|
||||
/** Y size of filter kernel */
|
||||
double dfYFilter;
|
||||
/** X size of window to filter */
|
||||
int nXRadius;
|
||||
/** Y size of window to filter */
|
||||
int nYRadius;
|
||||
/** X filtering offset */
|
||||
int nFiltInitX;
|
||||
/** Y filtering offset */
|
||||
int nFiltInitY;
|
||||
|
||||
/** X offset of the source buffer regarding the top-left corner of the image */
|
||||
int nSrcXOff;
|
||||
/** Y offset of the source buffer regarding the top-left corner of the image */
|
||||
int nSrcYOff;
|
||||
|
||||
/** X offset of the destination buffer regarding the top-left corner of the image */
|
||||
int nDstXOff;
|
||||
/** Y offset of the destination buffer regarding the top-left corner of the image */
|
||||
int nDstYOff;
|
||||
|
||||
/** Pixel transformation function */
|
||||
GDALTransformerFunc pfnTransformer;
|
||||
/** User data provided to pfnTransformer */
|
||||
void *pTransformerArg;
|
||||
|
||||
/** Progress function */
|
||||
GDALProgressFunc pfnProgress;
|
||||
/** User data provided to pfnProgress */
|
||||
void *pProgress;
|
||||
|
||||
/** Base/offset value for progress computation */
|
||||
double dfProgressBase;
|
||||
/** Scale value for progress computation */
|
||||
double dfProgressScale;
|
||||
|
||||
/** Array of nBands value for destination nodata */
|
||||
double *padfDstNoDataReal;
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
/** Per-thread data. Internally set */
|
||||
void *psThreadData;
|
||||
/*! @endcond */
|
||||
|
||||
GDALWarpKernel();
|
||||
virtual ~GDALWarpKernel();
|
||||
|
||||
CPLErr Validate();
|
||||
CPLErr PerformWarp();
|
||||
};
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
void* GWKThreadsCreate(char** papszWarpOptions,
|
||||
GDALTransformerFunc pfnTransformer,
|
||||
void* pTransformerArg);
|
||||
void GWKThreadsEnd(void* psThreadDataIn);
|
||||
/*! @endcond */
|
||||
|
||||
/************************************************************************/
|
||||
/* GDALWarpOperation() */
|
||||
/* */
|
||||
/* This object is application created, or created by a higher */
|
||||
/* level convenience function. It is responsible for */
|
||||
/* subdividing the operation into chunks, loading and saving */
|
||||
/* imagery, and establishing the varios validity and density */
|
||||
/* masks. Actual resampling is done by the GDALWarpKernel. */
|
||||
/************************************************************************/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
typedef struct _GDALWarpChunk GDALWarpChunk;
|
||||
/*! @endcond */
|
||||
|
||||
class CPL_DLL GDALWarpOperation {
|
||||
private:
|
||||
GDALWarpOptions *psOptions;
|
||||
|
||||
void WipeOptions();
|
||||
int ValidateOptions();
|
||||
|
||||
CPLErr ComputeSourceWindow( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
int *pnSrcXOff, int *pnSrcYOff,
|
||||
int *pnSrcXSize, int *pnSrcYSize,
|
||||
double *pdfSrcXExtraSize, double *pdfSrcYExtraSize,
|
||||
double* pdfSrcFillRatio );
|
||||
|
||||
static CPLErr CreateKernelMask( GDALWarpKernel *, int iBand,
|
||||
const char *pszType );
|
||||
|
||||
CPLMutex *hIOMutex;
|
||||
CPLMutex *hWarpMutex;
|
||||
|
||||
int nChunkListCount;
|
||||
int nChunkListMax;
|
||||
GDALWarpChunk *pasChunkList;
|
||||
|
||||
int bReportTimings;
|
||||
unsigned long nLastTimeReported;
|
||||
|
||||
void *psThreadData;
|
||||
|
||||
void WipeChunkList();
|
||||
CPLErr CollectChunkListInternal( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize );
|
||||
void CollectChunkList( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize );
|
||||
void ReportTiming( const char * );
|
||||
|
||||
public:
|
||||
GDALWarpOperation();
|
||||
virtual ~GDALWarpOperation();
|
||||
|
||||
CPLErr Initialize( const GDALWarpOptions *psNewOptions );
|
||||
void* CreateDestinationBuffer( int nDstXSize, int nDstYSize,
|
||||
int *pbWasInitialized = nullptr );
|
||||
static void DestroyDestinationBuffer(void* pDstBuffer);
|
||||
|
||||
const GDALWarpOptions *GetOptions();
|
||||
|
||||
CPLErr ChunkAndWarpImage( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize );
|
||||
CPLErr ChunkAndWarpMulti( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize );
|
||||
CPLErr WarpRegion( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
int nSrcXOff=0, int nSrcYOff=0,
|
||||
int nSrcXSize=0, int nSrcYSize=0,
|
||||
double dfProgressBase=0.0, double dfProgressScale=1.0);
|
||||
CPLErr WarpRegion( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
int nSrcXOff, int nSrcYOff,
|
||||
int nSrcXSize, int nSrcYSize,
|
||||
double dfSrcXExtraSize, double dfSrcYExtraSize,
|
||||
double dfProgressBase, double dfProgressScale);
|
||||
CPLErr WarpRegionToBuffer( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType,
|
||||
int nSrcXOff=0, int nSrcYOff=0,
|
||||
int nSrcXSize=0, int nSrcYSize=0,
|
||||
double dfProgressBase=0.0, double dfProgressScale=1.0);
|
||||
CPLErr WarpRegionToBuffer( int nDstXOff, int nDstYOff,
|
||||
int nDstXSize, int nDstYSize,
|
||||
void *pDataBuf,
|
||||
GDALDataType eBufDataType,
|
||||
int nSrcXOff, int nSrcYOff,
|
||||
int nSrcXSize, int nSrcYSize,
|
||||
double dfSrcXExtraSize, double dfSrcYExtraSize,
|
||||
double dfProgressBase, double dfProgressScale);
|
||||
};
|
||||
|
||||
#endif /* def __cplusplus */
|
||||
|
||||
CPL_C_START
|
||||
|
||||
/** Opaque type representing a GDALWarpOperation object */
|
||||
typedef void * GDALWarpOperationH;
|
||||
|
||||
GDALWarpOperationH CPL_DLL GDALCreateWarpOperation(const GDALWarpOptions* );
|
||||
void CPL_DLL GDALDestroyWarpOperation( GDALWarpOperationH );
|
||||
CPLErr CPL_DLL GDALChunkAndWarpImage( GDALWarpOperationH, int, int, int, int );
|
||||
CPLErr CPL_DLL GDALChunkAndWarpMulti( GDALWarpOperationH, int, int, int, int );
|
||||
CPLErr CPL_DLL GDALWarpRegion( GDALWarpOperationH,
|
||||
int, int, int, int, int, int, int, int );
|
||||
CPLErr CPL_DLL GDALWarpRegionToBuffer( GDALWarpOperationH, int, int, int, int,
|
||||
void *, GDALDataType,
|
||||
int, int, int, int );
|
||||
|
||||
/************************************************************************/
|
||||
/* Warping kernel functions */
|
||||
/************************************************************************/
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
int GWKGetFilterRadius(GDALResampleAlg eResampleAlg);
|
||||
|
||||
typedef double (*FilterFuncType)(double dfX);
|
||||
FilterFuncType GWKGetFilterFunc(GDALResampleAlg eResampleAlg);
|
||||
|
||||
// TODO(schwehr): Can padfVals be a const pointer?
|
||||
typedef double (*FilterFunc4ValuesType)(double* padfVals);
|
||||
FilterFunc4ValuesType GWKGetFilterFunc4Values(GDALResampleAlg eResampleAlg);
|
||||
/*! @endcond */
|
||||
|
||||
CPL_C_END
|
||||
|
||||
#endif /* ndef GDAL_ALG_H_INCLUDED */
|
||||
197
modules/globebrowsing/ext/gdal/include/gdalwarpkernel_opencl.h
Normal file
197
modules/globebrowsing/ext/gdal/include/gdalwarpkernel_opencl.h
Normal file
@@ -0,0 +1,197 @@
|
||||
/******************************************************************************
|
||||
* $Id: gdalwarpkernel_opencl.h 678d89afcc4ec43e300b2f337b51349139543d01 2016-06-30 22:42:39Z Kurt Schwehr $
|
||||
*
|
||||
* Project: OpenCL Image Reprojector
|
||||
* Purpose: Implementation of the GDALWarpKernel reprojector in OpenCL.
|
||||
* Author: Seth Price, seth@pricepages.org
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2010, Seth Price <seth@pricepages.org>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(HAVE_OPENCL)
|
||||
|
||||
/* The following relates to the profiling calls to
|
||||
clSetCommandQueueProperty() which are not available by default
|
||||
with some OpenCL implementation (i.e. ATI) */
|
||||
|
||||
#if defined(DEBUG_OPENCL) && DEBUG_OPENCL == 1
|
||||
#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <OpenCL/OpenCL.h>
|
||||
#else
|
||||
#include <CL/opencl.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus /* If this is a C++ compiler, use C linkage */
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
OCL_Bilinear=10,
|
||||
OCL_Cubic=11,
|
||||
OCL_CubicSpline=12,
|
||||
OCL_Lanczos=13
|
||||
} OCLResampAlg;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VENDOR_OTHER,
|
||||
VENDOR_AMD,
|
||||
VENDOR_INTEL
|
||||
} OCLVendor;
|
||||
|
||||
struct oclWarper {
|
||||
cl_command_queue queue;
|
||||
cl_context context;
|
||||
cl_device_id dev;
|
||||
cl_kernel kern1;
|
||||
cl_kernel kern4;
|
||||
|
||||
int srcWidth;
|
||||
int srcHeight;
|
||||
int dstWidth;
|
||||
int dstHeight;
|
||||
|
||||
int useUnifiedSrcDensity;
|
||||
int useUnifiedSrcValid;
|
||||
int useDstDensity;
|
||||
int useDstValid;
|
||||
|
||||
int numBands;
|
||||
int numImages;
|
||||
OCLResampAlg resampAlg;
|
||||
|
||||
cl_channel_type imageFormat;
|
||||
cl_mem *realWorkCL;
|
||||
union {
|
||||
void **v;
|
||||
char **c;
|
||||
unsigned char **uc;
|
||||
short **s;
|
||||
unsigned short **us;
|
||||
float **f;
|
||||
} realWork;
|
||||
|
||||
cl_mem *imagWorkCL;
|
||||
union {
|
||||
void **v;
|
||||
char **c;
|
||||
unsigned char **uc;
|
||||
short **s;
|
||||
unsigned short **us;
|
||||
float **f;
|
||||
} imagWork;
|
||||
|
||||
cl_mem *dstRealWorkCL;
|
||||
union {
|
||||
void **v;
|
||||
char **c;
|
||||
unsigned char **uc;
|
||||
short **s;
|
||||
unsigned short **us;
|
||||
float **f;
|
||||
} dstRealWork;
|
||||
|
||||
cl_mem *dstImagWorkCL;
|
||||
union {
|
||||
void **v;
|
||||
char **c;
|
||||
unsigned char **uc;
|
||||
short **s;
|
||||
unsigned short **us;
|
||||
float **f;
|
||||
} dstImagWork;
|
||||
|
||||
unsigned int imgChSize1;
|
||||
cl_channel_order imgChOrder1;
|
||||
unsigned int imgChSize4;
|
||||
cl_channel_order imgChOrder4;
|
||||
char useVec;
|
||||
|
||||
cl_mem useBandSrcValidCL;
|
||||
char *useBandSrcValid;
|
||||
|
||||
cl_mem nBandSrcValidCL;
|
||||
float *nBandSrcValid;
|
||||
|
||||
cl_mem xyWorkCL;
|
||||
float *xyWork;
|
||||
|
||||
int xyWidth;
|
||||
int xyHeight;
|
||||
int coordMult;
|
||||
|
||||
unsigned int xyChSize;
|
||||
cl_channel_order xyChOrder;
|
||||
|
||||
cl_mem fDstNoDataRealCL;
|
||||
float *fDstNoDataReal;
|
||||
|
||||
OCLVendor eCLVendor;
|
||||
};
|
||||
|
||||
struct oclWarper* GDALWarpKernelOpenCL_createEnv(int srcWidth, int srcHeight,
|
||||
int dstWidth, int dstHeight,
|
||||
cl_channel_type imageFormat,
|
||||
int numBands, int coordMult,
|
||||
int useImag, int useBandSrcValid,
|
||||
float *fDstDensity,
|
||||
double *dfDstNoDataReal,
|
||||
OCLResampAlg resampAlg, cl_int *envErr);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_setSrcValid(struct oclWarper *warper,
|
||||
int *bandSrcValid, int bandNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_setSrcImg(struct oclWarper *warper, void *imgData,
|
||||
int bandNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_setDstImg(struct oclWarper *warper, void *imgData,
|
||||
int bandNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_setCoordRow(struct oclWarper *warper,
|
||||
double *rowSrcX, double *rowSrcY,
|
||||
double srcXOff, double srcYOff,
|
||||
int *success, int rowNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_runResamp(struct oclWarper *warper,
|
||||
float *unifiedSrcDensity,
|
||||
unsigned int *unifiedSrcValid,
|
||||
float *dstDensity,
|
||||
unsigned int *dstValid,
|
||||
double dfXScale, double dfYScale,
|
||||
double dfXFilter, double dfYFilter,
|
||||
int nXRadius, int nYRadius,
|
||||
int nFiltInitX, int nFiltInitY);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_getRow(struct oclWarper *warper,
|
||||
void **rowReal, void **rowImag,
|
||||
int rowNum, int bandNum);
|
||||
|
||||
cl_int GDALWarpKernelOpenCL_deleteEnv(struct oclWarper *warper);
|
||||
|
||||
#ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* defined(HAVE_OPENCL) */
|
||||
741
modules/globebrowsing/ext/gdal/include/gnm.h
Normal file
741
modules/globebrowsing/ext/gdal/include/gnm.h
Normal file
@@ -0,0 +1,741 @@
|
||||
/******************************************************************************
|
||||
* $Id: gnm.h 5524ee5324f7bd364d391d842a6488c90c0186a7 2018-04-02 16:20:13 +0200 Even Rouault $
|
||||
*
|
||||
* Project: GDAL/OGR Geography Network support (Geographic Network Model)
|
||||
* Purpose: GNM general public declarations.
|
||||
* Authors: Mikhail Gusev (gusevmihs at gmail dot com)
|
||||
* Dmitry Baryshnikov, polimax@mail.ru
|
||||
*
|
||||
******************************************************************************
|
||||
* Copyright (c) 2014, Mikhail Gusev
|
||||
* Copyright (c) 2014-2015, NextGIS <info@nextgis.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GNM
|
||||
#define GNM
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
#include "ogrsf_frmts.h"
|
||||
#endif
|
||||
#include "gnmgraph.h"
|
||||
|
||||
// Direction of an edge.
|
||||
typedef int GNMDirection; // We use int values in order to save them to the
|
||||
// network data.
|
||||
|
||||
// Network's metadata parameters names.
|
||||
#define GNM_MD_NAME "net_name"
|
||||
#define GNM_MD_DESCR "net_description"
|
||||
#define GNM_MD_SRS "net_srs"
|
||||
#define GNM_MD_VERSION "net_version"
|
||||
#define GNM_MD_RULE "net_rule"
|
||||
#define GNM_MD_FORMAT "FORMAT"
|
||||
#define GNM_MD_FETCHEDGES "fetch_edge"
|
||||
#define GNM_MD_FETCHVERTEX "fetch_vertex"
|
||||
#define GNM_MD_NUM_PATHS "num_paths"
|
||||
#define GNM_MD_EMITTER "emitter"
|
||||
|
||||
// TODO: Constants for capabilities.
|
||||
//#define GNMCanChangeConnections "CanChangeConnections"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/** Dijkstra shortest path */ GATDijkstraShortestPath = 1,
|
||||
/** KShortest Paths */ GATKShortestPath,
|
||||
/** Recursive Breadth-first search */ GATConnectedComponents
|
||||
} GNMGraphAlgorithmType;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
|
||||
|
||||
/**
|
||||
* General GNM class which represents a geography network of common format.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
class CPL_DLL GNMNetwork : public GDALDataset
|
||||
{
|
||||
public:
|
||||
GNMNetwork();
|
||||
virtual ~GNMNetwork();
|
||||
|
||||
// GDALDataset Interface
|
||||
virtual const char *GetProjectionRef(void) override;
|
||||
virtual char **GetFileList(void) override;
|
||||
|
||||
// GNMNetwork Interface
|
||||
|
||||
/**
|
||||
* @brief Create network system layers
|
||||
*
|
||||
* Creates the connectivity (the "network path" of data) over the dataset
|
||||
* and returns the resulting network.
|
||||
* NOTE: This method does not create any connections among features
|
||||
* but creates the necessary set of fields, layers, etc.
|
||||
* NOTE: After the successful creation the passed dataset must not be
|
||||
* modified outside (but can be read as usual).
|
||||
* NOTE: For the common network format the creation is forbidden if the
|
||||
* passed dataset already has network system layers and OVERWRITE creation
|
||||
* option is FALSE.
|
||||
*
|
||||
* @param pszFilename - A path there the network folder (schema, etc.) will
|
||||
* be created. The folder (schema, etc.) name get
|
||||
* options.
|
||||
* @param papszOptions - create network options. The create options
|
||||
* specific for gnm driver.
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr Create( const char* pszFilename, char** papszOptions ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Open a network
|
||||
* @param poOpenInfo GDALOpenInfo pointer
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr Open( GDALOpenInfo* poOpenInfo ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Delete network. Delete all dependent layers
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr Delete() = 0;
|
||||
|
||||
/**
|
||||
* @brief GetName - a network name. The value provided to create function
|
||||
* in GNM_MD_NAME key. While creation this value used to create the
|
||||
* folder or db schema name. But can be changed after creation.
|
||||
* @return Network name string
|
||||
*/
|
||||
virtual const char* GetName() const;
|
||||
|
||||
/**
|
||||
* @brief GetVersion return the network version if applicable
|
||||
* @return version value
|
||||
*/
|
||||
virtual int GetVersion() const { return 0;}
|
||||
|
||||
/**
|
||||
* @brief DisconnectAll method clears the network graph
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr DisconnectAll () = 0;
|
||||
|
||||
/**
|
||||
* @brief GetFeatureByGlobalFID search all network layers for given feature
|
||||
* identificator.
|
||||
* @param nGFID feature identificator.
|
||||
* @return OGRFeature pointer or NULL. The pointer should be freed via
|
||||
* OGRFeature::DestroyFeature().
|
||||
*/
|
||||
virtual OGRFeature *GetFeatureByGlobalFID (GNMGFID nGFID) = 0;
|
||||
|
||||
/**
|
||||
* @brief Create path between start and end GFIDs.
|
||||
* @param nStartFID - start identificator
|
||||
* @param nEndFID - end identificator
|
||||
* @param eAlgorithm - The algorithm to get path
|
||||
* @param papszOptions - algorithm specific options
|
||||
* @return In memory OGRLayer pointer with features constituting
|
||||
* the shortest path (or paths). The caller have to free
|
||||
* the pointer via @see ReleaseResultSet().
|
||||
*/
|
||||
virtual OGRLayer *GetPath (GNMGFID nStartFID, GNMGFID nEndFID,
|
||||
GNMGraphAlgorithmType eAlgorithm, char** papszOptions) = 0;
|
||||
protected:
|
||||
/**
|
||||
* @brief Check if network already exist
|
||||
* @param pszFilename - path to network (folder or database
|
||||
* @param papszOptions - create options
|
||||
* @return TRUE if exist and not overwrite or FALSE
|
||||
*/
|
||||
virtual int CheckNetworkExist( const char* pszFilename,
|
||||
char** papszOptions ) = 0;
|
||||
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
CPLString m_soName;
|
||||
CPLString m_soSRS;
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
class GNMRule;
|
||||
class OGRGNMWrappedResultLayer;
|
||||
|
||||
/**
|
||||
* GNM class which represents a geography network of generic format.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
class CPL_DLL GNMGenericNetwork: public GNMNetwork
|
||||
{
|
||||
public:
|
||||
GNMGenericNetwork();
|
||||
virtual ~GNMGenericNetwork();
|
||||
|
||||
// GDALDataset Interface
|
||||
|
||||
virtual int GetLayerCount() override;
|
||||
virtual OGRLayer *GetLayer(int) override;
|
||||
virtual OGRErr DeleteLayer(int) override;
|
||||
|
||||
virtual int TestCapability( const char * ) override;
|
||||
|
||||
virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
|
||||
const char *pszNewName,
|
||||
char **papszOptions = nullptr ) override;
|
||||
|
||||
virtual int CloseDependentDatasets() override;
|
||||
virtual void FlushCache(void) override;
|
||||
|
||||
// GNMNetwork Interface
|
||||
|
||||
virtual CPLErr Create( const char* pszFilename, char** papszOptions ) override = 0;
|
||||
virtual CPLErr Delete() override;
|
||||
|
||||
virtual int GetVersion() const override;
|
||||
/**
|
||||
* @brief GetNewGlobalFID increase the global ID counter.
|
||||
* @return New global feature ID.
|
||||
*/
|
||||
virtual GNMGFID GetNewGlobalFID();
|
||||
|
||||
/**
|
||||
* @brief Get the algorithm name
|
||||
* @param eAlgorithm GNM algorithm type
|
||||
* @param bShortName Indicator which name to return - short or long
|
||||
* @return String with algorithm name
|
||||
*/
|
||||
virtual CPLString GetAlgorithmName(GNMDirection eAlgorithm, bool bShortName);
|
||||
|
||||
/**
|
||||
* @brief AddFeatureGlobalFID add the FID <-> Layer name link to fast access
|
||||
* features by global FID.
|
||||
* @param nFID - global FID
|
||||
* @param pszLayerName - layer name
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr AddFeatureGlobalFID(GNMGFID nFID, const char* pszLayerName);
|
||||
|
||||
/**
|
||||
* @brief Connects two features via third feature (may be virtual, so the
|
||||
* identificator should be -1). The features may be at the same layer
|
||||
* or different layers.
|
||||
* @param nSrcFID - source feature identificator
|
||||
* @param nTgtFID - target feature identificator
|
||||
* @param nConFID - connection feature identificator (-1 for virtual connection)
|
||||
* @param dfCost - cost moving from source to target (default 1)
|
||||
* @param dfInvCost - cost moving from target to source (default 1)
|
||||
* @param eDir - direction, may be source to target, traget to source or both.
|
||||
* (default - both)
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr ConnectFeatures (GNMGFID nSrcFID,
|
||||
GNMGFID nTgtFID,
|
||||
GNMGFID nConFID = -1,
|
||||
double dfCost = 1,
|
||||
double dfInvCost = 1,
|
||||
GNMDirection eDir = GNM_EDGE_DIR_BOTH);
|
||||
|
||||
/**
|
||||
* @brief Remove features connection
|
||||
* @param nSrcFID - source feature identificator
|
||||
* @param nTgtFID - target feature identificator
|
||||
* @param nConFID - connection feature identificator
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr DisconnectFeatures (GNMGFID nSrcFID,
|
||||
GNMGFID nTgtFID,
|
||||
GNMGFID nConFID);
|
||||
|
||||
/**
|
||||
* @brief Find the corresponding identificator in graph (source, target,
|
||||
* connector) and remove such connections.
|
||||
* @param nFID - identificator to find.
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr DisconnectFeaturesWithId(GNMGFID nFID);
|
||||
|
||||
/**
|
||||
* @brief Change connection attributes. Search the connection by source
|
||||
* feature identificator, target feature identificator and connection
|
||||
* identificator.
|
||||
* @param nSrcFID - source feature identificator
|
||||
* @param nTgtFID - target feature identificator
|
||||
* @param nConFID - connection feature identificator
|
||||
* @param dfCost - new cost moving from source to target
|
||||
* @param dfInvCost - new cost moving from target to source
|
||||
* @param eDir - new direction
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr ReconnectFeatures (GNMGFID nSrcFID,
|
||||
GNMGFID nTgtFID,
|
||||
GNMGFID nConFID,
|
||||
double dfCost = 1,
|
||||
double dfInvCost = 1,
|
||||
GNMDirection eDir = GNM_EDGE_DIR_BOTH);
|
||||
|
||||
virtual CPLErr DisconnectAll() override;
|
||||
|
||||
virtual OGRFeature *GetFeatureByGlobalFID(GNMGFID nFID) override;
|
||||
|
||||
/**
|
||||
* @brief Create network rule
|
||||
*
|
||||
* Creates the rule in the network according to the special syntax. These
|
||||
* rules are declarative and make an effect for the network when they exist.
|
||||
* Each rule for layer can be created only if the corresponding layer
|
||||
* existed and removed when the layer is being deleted.
|
||||
*
|
||||
* Rules syntax for the common network format in GNM contains the key words
|
||||
* (words in capital letters or signs) and the modifiers which refers to the
|
||||
* network objects. All the following combinations are available:
|
||||
*
|
||||
* Notation:
|
||||
* layer1, layer2, layer3 - a layer names (the corresponding layers must be
|
||||
* exist;
|
||||
* field1 - a field name (field must be exist);
|
||||
* constant1 - any double constant;
|
||||
* string1 - any string;
|
||||
*
|
||||
* Rules describing which layer can be connected or not connected with each
|
||||
* other, and (optional) which layer must serve as a connector. By default
|
||||
* all connections are forbidden. But while network creation process the
|
||||
* rule to allow any connection added. During the connection process each
|
||||
* rule tested if this connection can be created.
|
||||
*
|
||||
* "ALLOW CONNECTS ANY"
|
||||
* "DENY CONNECTS ANY"
|
||||
* "DENY CONNECTS layer1 WITH layer2"
|
||||
* "ALLOW CONNECTS layer1 WITH layer2 VIA layer3"
|
||||
*
|
||||
* @param pszRuleStr Rule string which will parsed. If the parsing was
|
||||
* successful, the rule will start having effect immediately.
|
||||
* @return CE_None on success.
|
||||
*/
|
||||
virtual CPLErr CreateRule (const char *pszRuleStr);
|
||||
|
||||
/**
|
||||
* @brief Delete all rules from network
|
||||
* @return CE_None on success.
|
||||
*/
|
||||
virtual CPLErr DeleteAllRules();
|
||||
|
||||
/**
|
||||
* @brief Delete the specified rule
|
||||
* @param pszRuleStr - the rule to delete
|
||||
* @return CE_None on success.
|
||||
*/
|
||||
virtual CPLErr DeleteRule(const char *pszRuleStr);
|
||||
|
||||
/**
|
||||
* @brief Get the rule list
|
||||
* @return list of rule strings. The caller have to free the lis via CPLDestroy.
|
||||
*/
|
||||
virtual char** GetRules() const;
|
||||
|
||||
/**
|
||||
* @brief Attempts to build the network topology automatically
|
||||
*
|
||||
* The method simply gets point and line or multiline layers from the
|
||||
* papszLayerList and searches for each line which connects two points: start
|
||||
* and end, so it can be not so effective in performance when it is called
|
||||
* on huge networks.
|
||||
* Note, when passing your tolerance value: this value will depend of spatial
|
||||
* reference system of the network, and especially of its 0,0 position
|
||||
* because dfTolerance is just divided by 2 and added/subtracted to/from
|
||||
* both sides of each line-feature end point forming thus the square area
|
||||
* around it. The first point-feature occurred inside this area will be given
|
||||
* as a start/end point for the current connection. So it is also desirable
|
||||
* that at least two layers are passed in papszLayerList (one point and one
|
||||
* line), and they are already connected "visually" ("geometrically").
|
||||
*
|
||||
* @param papszLayerList A list of layers to connect. The list should be
|
||||
* freed via CSLDestroy.
|
||||
* @param dfTolerance Snapping tolerance.
|
||||
* @param dfCost Direct cost.
|
||||
* @param dfInvCost Inverse cost.
|
||||
* @param eDir Direction.
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr ConnectPointsByLines (char **papszLayerList,
|
||||
double dfTolerance,
|
||||
double dfCost,
|
||||
double dfInvCost,
|
||||
GNMDirection eDir);
|
||||
|
||||
/**
|
||||
* @brief Change the block state of edge or vertex
|
||||
* @param nFID Identificator
|
||||
* @param bIsBlock Block or unblock
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr ChangeBlockState (GNMGFID nFID, bool bIsBlock);
|
||||
|
||||
/**
|
||||
* @brief Change all vertices and edges block state.
|
||||
*
|
||||
* This is mainly use for unblock all vertices and edges.
|
||||
*
|
||||
* @param bIsBlock Block or unblock
|
||||
* @return CE_None on success
|
||||
*/
|
||||
virtual CPLErr ChangeAllBlockState (bool bIsBlock = false);
|
||||
|
||||
virtual OGRLayer *GetPath (GNMGFID nStartFID, GNMGFID nEndFID,
|
||||
GNMGraphAlgorithmType eAlgorithm, char** papszOptions) override;
|
||||
protected:
|
||||
/**
|
||||
* @brief Check or create layer OGR driver
|
||||
* @param pszDefaultDriverName - default driver name
|
||||
* @param papszOptions - create options
|
||||
* @return CE_None if driver is exist or CE_Failure
|
||||
*/
|
||||
virtual CPLErr CheckLayerDriver(const char* pszDefaultDriverName,
|
||||
char** papszOptions);
|
||||
/**
|
||||
* @brief Check if provided OGR driver accepted as storage for network data
|
||||
* @param pszDriverName The driver name
|
||||
* @return true if supported, else false
|
||||
*/
|
||||
virtual bool CheckStorageDriverSupport(const char* pszDriverName) = 0;
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
virtual CPLErr CreateMetadataLayer( GDALDataset* const pDS, int nVersion,
|
||||
size_t nFieldSize = 1024 );
|
||||
virtual CPLErr StoreNetworkSrs();
|
||||
virtual CPLErr LoadNetworkSrs();
|
||||
virtual CPLErr CreateGraphLayer( GDALDataset* const pDS );
|
||||
virtual CPLErr CreateFeaturesLayer( GDALDataset* const pDS );
|
||||
virtual CPLErr LoadMetadataLayer( GDALDataset* const pDS );
|
||||
virtual CPLErr LoadGraphLayer( GDALDataset* const pDS );
|
||||
virtual CPLErr LoadGraph();
|
||||
virtual CPLErr LoadFeaturesLayer( GDALDataset* const pDS );
|
||||
virtual CPLErr DeleteMetadataLayer() = 0;
|
||||
virtual CPLErr DeleteGraphLayer() = 0;
|
||||
virtual CPLErr DeleteFeaturesLayer() = 0;
|
||||
virtual CPLErr LoadNetworkLayer(const char* pszLayername) = 0;
|
||||
virtual CPLErr DeleteNetworkLayers() = 0;
|
||||
virtual void ConnectPointsByMultiline(GIntBig nFID,
|
||||
const OGRMultiLineString *poMultiLineString,
|
||||
const std::vector<OGRLayer *> &paPointLayers,
|
||||
double dfTolerance, double dfCost,
|
||||
double dfInvCost, GNMDirection eDir);
|
||||
virtual void ConnectPointsByLine(GIntBig nFID,
|
||||
const OGRLineString *poLineString,
|
||||
const std::vector<OGRLayer *> &paPointLayers,
|
||||
double dfTolerance, double dfCost,
|
||||
double dfInvCost, GNMDirection eDir);
|
||||
virtual GNMGFID FindNearestPoint(const OGRPoint* poPoint,
|
||||
const std::vector<OGRLayer*>& paPointLayers,
|
||||
double dfTolerance);
|
||||
virtual OGRFeature* FindConnection(GNMGFID nSrcFID, GNMGFID nTgtFID,
|
||||
GNMGFID nConFID);
|
||||
virtual void SaveRules();
|
||||
virtual GNMGFID GetNewVirtualFID();
|
||||
virtual void FillResultLayer(OGRGNMWrappedResultLayer* poResLayer,
|
||||
const GNMPATH &path, int nNoOfPath,
|
||||
bool bReturnVertices, bool bReturnEdges);
|
||||
//! @endcond
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
int m_nVersion;
|
||||
GNMGFID m_nGID;
|
||||
GNMGFID m_nVirtualConnectionGID;
|
||||
OGRLayer* m_poMetadataLayer;
|
||||
OGRLayer* m_poGraphLayer;
|
||||
OGRLayer* m_poFeaturesLayer;
|
||||
|
||||
GDALDriver *m_poLayerDriver;
|
||||
|
||||
std::map<GNMGFID, CPLString> m_moFeatureFIDMap;
|
||||
std::vector<OGRLayer*> m_apoLayers;
|
||||
std::vector<GNMRule> m_asRules;
|
||||
bool m_bIsRulesChanged;
|
||||
|
||||
GNMGraph m_oGraph;
|
||||
bool m_bIsGraphLoaded;
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
/**
|
||||
* GNM layer which represents a geography network layer of generic format.
|
||||
* The class override some OGRLayer methods to fulfill the network requirements.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
class GNMGenericLayer : public OGRLayer
|
||||
{
|
||||
public:
|
||||
GNMGenericLayer(OGRLayer* poLayer, GNMGenericNetwork* poNetwork);
|
||||
virtual ~GNMGenericLayer();
|
||||
|
||||
// OGRLayer Interface
|
||||
|
||||
virtual OGRGeometry *GetSpatialFilter() override;
|
||||
virtual void SetSpatialFilter( OGRGeometry * ) override;
|
||||
virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
|
||||
double dfMaxX, double dfMaxY ) override;
|
||||
|
||||
virtual void SetSpatialFilter( int iGeomField, OGRGeometry * ) override;
|
||||
virtual void SetSpatialFilterRect( int iGeomField,
|
||||
double dfMinX, double dfMinY,
|
||||
double dfMaxX, double dfMaxY ) override;
|
||||
|
||||
virtual OGRErr SetAttributeFilter( const char * ) override;
|
||||
|
||||
virtual void ResetReading() override;
|
||||
virtual OGRFeature *GetNextFeature() override;
|
||||
virtual OGRErr SetNextByIndex( GIntBig nIndex ) override;
|
||||
|
||||
virtual OGRErr DeleteFeature( GIntBig nFID ) override;
|
||||
|
||||
virtual const char *GetName() override;
|
||||
virtual OGRwkbGeometryType GetGeomType() override;
|
||||
virtual OGRFeatureDefn *GetLayerDefn() override;
|
||||
virtual int FindFieldIndex( const char *pszFieldName, int bExactMatch ) override;
|
||||
|
||||
virtual OGRSpatialReference *GetSpatialRef() override;
|
||||
|
||||
virtual GIntBig GetFeatureCount( int bForce = TRUE ) override;
|
||||
virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override;
|
||||
virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent,
|
||||
int bForce = TRUE) override;
|
||||
|
||||
virtual int TestCapability( const char * ) override;
|
||||
|
||||
virtual OGRErr CreateField( OGRFieldDefn *poField,
|
||||
int bApproxOK = TRUE ) override;
|
||||
virtual OGRErr DeleteField( int iField ) override;
|
||||
virtual OGRErr ReorderFields( int* panMap ) override;
|
||||
virtual OGRErr AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn,
|
||||
int nFlagsIn ) override;
|
||||
|
||||
virtual OGRErr CreateGeomField( OGRGeomFieldDefn *poField,
|
||||
int bApproxOK = TRUE ) override;
|
||||
|
||||
virtual OGRErr SyncToDisk() override;
|
||||
|
||||
virtual OGRStyleTable *GetStyleTable() override;
|
||||
virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable ) override;
|
||||
|
||||
virtual void SetStyleTable(OGRStyleTable *poStyleTable) override;
|
||||
|
||||
virtual OGRErr StartTransaction() override;
|
||||
virtual OGRErr CommitTransaction() override;
|
||||
virtual OGRErr RollbackTransaction() override;
|
||||
|
||||
virtual const char *GetFIDColumn() override;
|
||||
virtual const char *GetGeometryColumn() override;
|
||||
|
||||
virtual OGRErr SetIgnoredFields( const char **papszFields ) override;
|
||||
|
||||
/** Intersection */
|
||||
OGRErr Intersection( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = nullptr,
|
||||
GDALProgressFunc pfnProgress = nullptr,
|
||||
void * pProgressArg = nullptr );
|
||||
/** Union */
|
||||
OGRErr Union( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = nullptr,
|
||||
GDALProgressFunc pfnProgress = nullptr,
|
||||
void * pProgressArg = nullptr );
|
||||
/** SymDifference */
|
||||
OGRErr SymDifference( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions,
|
||||
GDALProgressFunc pfnProgress,
|
||||
void * pProgressArg );
|
||||
/** Identity */
|
||||
OGRErr Identity( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = nullptr,
|
||||
GDALProgressFunc pfnProgress = nullptr,
|
||||
void * pProgressArg = nullptr );
|
||||
/** Update */
|
||||
OGRErr Update( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = nullptr,
|
||||
GDALProgressFunc pfnProgress = nullptr,
|
||||
void * pProgressArg = nullptr );
|
||||
/** Clip */
|
||||
OGRErr Clip( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = nullptr,
|
||||
GDALProgressFunc pfnProgress = nullptr,
|
||||
void * pProgressArg = nullptr );
|
||||
/** Erase */
|
||||
OGRErr Erase( OGRLayer *pLayerMethod,
|
||||
OGRLayer *pLayerResult,
|
||||
char** papszOptions = nullptr,
|
||||
GDALProgressFunc pfnProgress = nullptr,
|
||||
void * pProgressArg = nullptr );
|
||||
|
||||
/** GetFeaturesRead */
|
||||
GIntBig GetFeaturesRead();
|
||||
|
||||
/** AttributeFilterEvaluationNeedsGeometry */
|
||||
int AttributeFilterEvaluationNeedsGeometry();
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
/* consider these private */
|
||||
OGRErr InitializeIndexSupport( const char * );
|
||||
OGRLayerAttrIndex *GetIndex();
|
||||
//! @endcond
|
||||
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
virtual OGRErr ISetFeature( OGRFeature *poFeature ) override;
|
||||
virtual OGRErr ICreateFeature( OGRFeature *poFeature ) override;
|
||||
|
||||
protected:
|
||||
CPLString m_soLayerName;
|
||||
OGRLayer *m_poLayer;
|
||||
GNMGenericNetwork* m_poNetwork;
|
||||
std::map<GNMGFID, GIntBig> m_mnFIDMap;
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/** Rule for connect features */ GRTConnection = 0
|
||||
} GNMRuleType;
|
||||
|
||||
/**
|
||||
* @brief The simple class for rules
|
||||
*
|
||||
* By now we have only connect rules, so the one class is enough. Maybe in
|
||||
* future the set of classes for different rule types will be needed.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
// cppcheck-suppress copyCtorAndEqOperator
|
||||
class CPL_DLL GNMRule
|
||||
{
|
||||
public:
|
||||
/** Constructor */
|
||||
GNMRule();
|
||||
/** Constructor */
|
||||
explicit GNMRule(const std::string &oRule );
|
||||
/** Constructor */
|
||||
explicit GNMRule(const char* pszRule);
|
||||
/** Constructor */
|
||||
GNMRule(const GNMRule &oRule);
|
||||
virtual ~GNMRule();
|
||||
/**
|
||||
* @brief This function indicate if rule string was parsed successfully
|
||||
* @return true if rule is valid
|
||||
*/
|
||||
virtual bool IsValid() const;
|
||||
/**
|
||||
* @brief Indicator of any layer state
|
||||
* @return true if accept any layer
|
||||
*/
|
||||
virtual bool IsAcceptAny() const;
|
||||
/**
|
||||
* @brief This is for future use to indicate the rule type/ Now return only
|
||||
* GRTConnection type.
|
||||
* @return the rule type
|
||||
*/
|
||||
virtual GNMRuleType GetType() const;
|
||||
/**
|
||||
* @brief Check if connection can take place.
|
||||
* @param soSrcLayerName - the layer name
|
||||
* @param soTgtLayerName - the layer name
|
||||
* @param soConnLayerName - the layer name
|
||||
* @return true if can connect features from soSrcLayerName and soTgtLayerName
|
||||
* via soConnLayerName
|
||||
*/
|
||||
virtual bool CanConnect(const CPLString &soSrcLayerName,
|
||||
const CPLString &soTgtLayerName,
|
||||
const CPLString &soConnLayerName = "");
|
||||
/** Return source layer name */
|
||||
virtual CPLString GetSourceLayerName() const;
|
||||
/** Return target layer name */
|
||||
virtual CPLString GetTargetLayerName() const;
|
||||
/** Return connector layer name */
|
||||
virtual CPLString GetConnectorLayerName() const;
|
||||
/** Return rule as a string */
|
||||
const char* c_str() const;
|
||||
/** Return rule as a string */
|
||||
operator const char* (void) const;
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
virtual bool ParseRuleString();
|
||||
protected:
|
||||
CPLString m_soSrcLayerName;
|
||||
CPLString m_soTgtLayerName;
|
||||
CPLString m_soConnLayerName;
|
||||
bool m_bAllow;
|
||||
bool m_bValid;
|
||||
bool m_bAny;
|
||||
CPLString m_soRuleString;
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The OGRGNMWrappedResultLayer class for search paths queries results.
|
||||
*
|
||||
* @since GDAL 2.1
|
||||
*/
|
||||
|
||||
class OGRGNMWrappedResultLayer : public OGRLayer
|
||||
{
|
||||
public:
|
||||
OGRGNMWrappedResultLayer(GDALDataset* poDS, OGRLayer* poLayer);
|
||||
~OGRGNMWrappedResultLayer();
|
||||
|
||||
// OGRLayer
|
||||
virtual void ResetReading() override;
|
||||
virtual OGRFeature *GetNextFeature() override;
|
||||
virtual OGRErr SetNextByIndex( GIntBig nIndex ) override;
|
||||
virtual OGRFeature *GetFeature( GIntBig nFID ) override;
|
||||
virtual OGRFeatureDefn *GetLayerDefn() override;
|
||||
virtual GIntBig GetFeatureCount( int bForce = TRUE ) override;
|
||||
virtual int TestCapability( const char * pszCap ) override;
|
||||
virtual OGRErr CreateField( OGRFieldDefn *poField, int bApproxOK = TRUE ) override;
|
||||
virtual OGRErr CreateGeomField( OGRGeomFieldDefn *poField,
|
||||
int bApproxOK = TRUE ) override;
|
||||
virtual const char *GetFIDColumn() override;
|
||||
virtual const char *GetGeometryColumn() override;
|
||||
virtual OGRSpatialReference *GetSpatialRef() override;
|
||||
|
||||
// OGRGNMWrappedResultLayer
|
||||
virtual OGRErr InsertFeature(OGRFeature* poFeature,
|
||||
const CPLString &soLayerName, int nPathNo,
|
||||
bool bIsEdge);
|
||||
protected:
|
||||
virtual OGRErr ISetFeature( OGRFeature *poFeature ) override;
|
||||
virtual OGRErr ICreateFeature( OGRFeature *poFeature ) override;
|
||||
protected:
|
||||
//! @cond Doxygen_Suppress
|
||||
GDALDataset *poDS;
|
||||
OGRLayer *poLayer;
|
||||
//! @endcond
|
||||
};
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // GNM
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user